ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExN02SteppingVerbose.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ExN02SteppingVerbose.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 //
30 //
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "ExN02SteppingVerbose.hh"
35 
36 #include "G4SteppingManager.hh"
37 #include "G4UnitsTable.hh"
38 
39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
40 
42 {}
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 
47 {}
48 
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50 
52 {
53  CopyState();
54 
55  G4int prec = G4cout.precision(3);
56 
57  if( verboseLevel >= 1 ){
58  if( verboseLevel >= 4 ) VerboseTrack();
59  if( verboseLevel >= 3 ){
60  G4cout << G4endl;
61  G4cout << std::setw( 5) << "#Step#" << " "
62  << std::setw( 6) << "X" << " "
63  << std::setw( 6) << "Y" << " "
64  << std::setw( 6) << "Z" << " "
65  << std::setw( 9) << "KineE" << " "
66  << std::setw( 9) << "dEStep" << " "
67  << std::setw(10) << "StepLeng"
68  << std::setw(10) << "TrakLeng"
69  << std::setw(10) << "Volume" << " "
70  << std::setw(10) << "Process" << G4endl;
71  }
72 
73  G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
74  << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
75  << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
76  << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
77  << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
78  << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
79  << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
80  << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
81  << " ";
82 
83  // if( fStepStatus != fWorldBoundary){
84  if( fTrack->GetNextVolume() != 0 ) {
85  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
86  } else {
87  G4cout << std::setw(10) << "OutOfWorld";
88  }
89 
91  G4cout << " "
92  << std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
93  ->GetProcessName();
94  } else {
95  G4cout << " UserLimit";
96  }
97 
98  G4cout << G4endl;
99 
100  if( verboseLevel == 2 ){
101  G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
104  if(tN2ndariesTot>0){
105  G4cout << "\n :----- List of secondaries ----------------"
106  << G4endl;
107 
108  for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
109  lp1<(*fSecondary).size(); lp1++){
110  G4cout << " "
111  << std::setw(13)
112  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
113  << ": energy ="
114  << std::setw(6)
115  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
116  << " time ="
117  << std::setw(6)
118  << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time");
119  G4cout << G4endl;
120  }
121 
122  G4cout << " :------------------------------------------"
123  << G4endl;
124  }
125  }
126 
127  }
128  G4cout.precision(prec);
129 }
130 
131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
132 
134 {
135 
136  CopyState();
137 G4int prec = G4cout.precision(3);
138  if( verboseLevel > 0 ){
139 
140  G4cout << std::setw( 5) << "Step#" << " "
141  << std::setw( 6) << "X" << " "
142  << std::setw( 6) << "Y" << " "
143  << std::setw( 6) << "Z" << " "
144  << std::setw( 9) << "KineE" << " "
145  << std::setw( 9) << "dEStep" << " "
146  << std::setw(10) << "StepLeng"
147  << std::setw(10) << "TrakLeng"
148  << std::setw(10) << "Volume" << " "
149  << std::setw(10) << "Process" << G4endl;
150 
151  G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
152  << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
153  << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
154  << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
155  << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
156  << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
157  << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
158  << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
159  << " ";
160 
161  if(fTrack->GetNextVolume()){
162  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
163  } else {
164  G4cout << std::setw(10) << "OutOfWorld";
165  }
166  G4cout << " initStep" << G4endl;
167  }
168  G4cout.precision(prec);
169 }
170 
171 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......