ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SteppingVerbose.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SteppingVerbose.cc
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
28 
29 #include "SteppingVerbose.hh"
30 
31 #include "G4SteppingManager.hh"
32 #include "G4ParticleTypes.hh"
33 #include "G4UnitsTable.hh"
34 
35 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
36 
39 {}
40 
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42 
44 {}
45 
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47 
49 {
50  CopyState();
51 
52  G4int prec = G4cout.precision(3);
53 
54  // step zero
55  if( verboseLevel > 0 ){
56  G4cout << std::setw( 5) << "Step#" << " "
57  << std::setw( 6) << "X" << " "
58  << std::setw( 6) << "Y" << " "
59  << std::setw( 6) << "Z" << " "
60  << std::setw( 9) << "KineE" << " "
61  << std::setw( 9) << "dEStep" << " "
62  << std::setw(10) << "StepLeng"
63  << std::setw(10) << "TrakLeng"
64  << std::setw(10) << "Volume" << " "
65  << std::setw(10) << "Process" << G4endl;
66 
67  G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
68  << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
69  << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
70  << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
71  << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
72  << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
73  << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
74  << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
75  << std::setw(10) << fTrack->GetVolume()->GetName()
76  << " initStep" << G4endl;
77  }
78  G4cout.precision(prec);
79 }
80 
81 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
82 
84 {
85  CopyState();
86 
87  G4int prec = G4cout.precision(3);
88 
89  if( verboseLevel >= 1 ){
90  if( verboseLevel >= 4 ) VerboseTrack();
91  if( verboseLevel >= 3 ){
92  G4cout << G4endl;
93  G4cout << std::setw( 5) << "#Step#" << " "
94  << std::setw( 6) << "X" << " "
95  << std::setw( 6) << "Y" << " "
96  << std::setw( 6) << "Z" << " "
97  << std::setw( 9) << "KineE" << " "
98  << std::setw( 9) << "dEStep" << " "
99  << std::setw(10) << "StepLeng"
100  << std::setw(10) << "TrakLeng"
101  << std::setw(10) << "Volume" << " "
102  << std::setw(10) << "Process" << G4endl;
103  }
104 
105  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
106  << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
107  << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
108  << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
109  << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
110  << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
111  << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
112  << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
113  << std::setw(10) << fTrack->GetVolume()->GetName();
114 
115  const G4VProcess* process
117  G4String procName = " UserLimit";
118  if (process) procName = process->GetProcessName();
119  if (fStepStatus == fWorldBoundary) procName = "OutOfWorld";
120  G4cout << " " << std::setw(10) << procName;
121  G4cout << G4endl;
122 
123  if (verboseLevel == 2) {
124  const std::vector<const G4Track*>* secondary
126  size_t nbtrk = (*secondary).size();
127  if (nbtrk) {
128  G4cout << "\n :----- List of secondaries ----------------" << G4endl;
129  G4cout.precision(4);
130  for (size_t lp=0; lp<(*secondary).size(); lp++) {
131  G4cout << " "
132  << std::setw(13)
133  << (*secondary)[lp]->GetDefinition()->GetParticleName()
134  << ": energy ="
135  << std::setw(6)
136  << G4BestUnit((*secondary)[lp]->GetKineticEnergy(),"Energy")
137  << " time ="
138  << std::setw(6)
139  << G4BestUnit((*secondary)[lp]->GetGlobalTime(),"Time");
140  G4cout << G4endl;
141  }
142 
143  G4cout << " :------------------------------------------\n" << G4endl;
144  }
145  }
146 
147  }
148  G4cout.precision(prec);
149 }