ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
F01SteppingVerbose.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file F01SteppingVerbose.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 "F01SteppingVerbose.hh"
35 
36 #include "G4SteppingManager.hh"
37 #include "G4UnitsTable.hh"
38 
39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
40 
43 {}
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
48 {}
49 
50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
51 
53 {
54  CopyState();
55 
56  G4int prec = G4cout.precision(6);
57 
58  if( verboseLevel >= 1 ){
59  if( verboseLevel >= 4 ) VerboseTrack();
60  if( verboseLevel >= 3 ){
61  G4cout << G4endl;
62  G4cout << std::setw( 5) << "#Step#" << " "
63  << std::setw(10) << "X" << " "
64  << std::setw(10) << "Y" << " "
65  << std::setw(10) << "Z" << " "
66  << std::setw(10) << "Direction x" << " "
67  << std::setw(10) << "dir y" << " "
68  << std::setw(10) << "dir z" << " "
69  << std::setw( 8) << "KineE" << " "
70  << std::setw( 6) << "dEStep" << " "
71  << std::setw(10) << "StepLeng"
72  << std::setw(10) << "TrakLeng"
73  << std::setw(10) << "NextVolu"
74  << std::setw(10) << "Process" << " "
75  << G4endl;
76  }
77 
78  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
79  << std::setw(10) << G4BestUnit(fTrack->GetPosition().x(),"Length")
80  << std::setw(10) << G4BestUnit(fTrack->GetPosition().y(),"Length")
81  << std::setw(10) << G4BestUnit(fTrack->GetPosition().z(),"Length");
82  G4cout << std::setw(10) << fTrack->GetMomentumDirection().x() << " "
83  << std::setw(10) << fTrack->GetMomentumDirection().y() << " "
84  << std::setw(10) << fTrack->GetMomentumDirection().z() << " ";
85  G4cout << std::setw( 8) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
86  << std::setw( 6) << G4BestUnit(
87  fStep->GetTotalEnergyDeposit(),"Energy")
88  << std::setw(10) << G4BestUnit(fStep->GetStepLength(),"Length")
89  << std::setw(10) << G4BestUnit(fTrack->GetTrackLength(),"Length");
90 
91  if( fTrack->GetNextVolume() != 0 ) {
92  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
93  } else {
94  G4cout << std::setw(10) << "OutOfWorld";
95  }
96 
98  G4cout << " "
99  << std::setw(10)
101  ->GetProcessName();
102  } else {
103  G4cout << " UserLimit";
104  }
105  G4cout << G4endl;
106 
107  if( verboseLevel == 2 ){
108  G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
111  if(tN2ndariesTot>0){
112  G4cout << " :----- List of 2ndaries - "
113  << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
114  << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
115  << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
116  << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
117  << "), "
118  << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
119  << " ---------------"
120  << G4endl;
121 
122  for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
123  lp1<(*fSecondary).size(); lp1++)
124  {
125  G4cout << " : "
126  << std::setw(6)
127  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
128  << std::setw(6)
129  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
130  << std::setw(6)
131  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
132  << std::setw(6)
133  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
134  << std::setw(10)
135  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
136  G4cout << G4endl;
137  }
138 
139  G4cout << " :-----------------------------"
140  << "----------------------------------"
141  << "-- EndOf2ndaries Info ---------------"
142  << G4endl;
143  }
144  }
145 
146  }
147  G4cout.precision(prec);
148 }
149 
150 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
151 
153 {
154  CopyState();
155  G4int prec = G4cout.precision(6);
156  if( verboseLevel > 0 ){
157 
158  G4cout << std::setw( 5) << "Step#" << " "
159  << std::setw(10) << "X" << " "
160  << std::setw(10) << "Y" << " "
161  << std::setw(10) << "Z" << " "
162  << std::setw(10) << "Direction x" << " "
163  << std::setw(10) << "dir y" << " "
164  << std::setw(10) << "dir z" << " "
165  << std::setw(10) << "KineE" << " "
166  << std::setw(10) << "dEStep" << " "
167  << std::setw(10) << "StepLeng"
168  << std::setw(10) << "TrakLeng"
169  << std::setw(10) << "Volume" << " "
170  << std::setw(10) << "Process"
171  << G4endl;
172 
173  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
174  << std::setw(10) << G4BestUnit(fTrack->GetPosition().x(),"Length")
175  << std::setw(10) << G4BestUnit(fTrack->GetPosition().y(),"Length")
176  << std::setw(10) << G4BestUnit(fTrack->GetPosition().z(),"Length");
177  G4cout << std::setw(10) << fTrack->GetMomentumDirection().x() << " "
178  << std::setw(10) << fTrack->GetMomentumDirection().y() << " "
179  << std::setw(10) << fTrack->GetMomentumDirection().z() << " ";
180  G4cout << std::setw( 8) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
181  << std::setw( 6) << G4BestUnit(
182  fStep->GetTotalEnergyDeposit(),"Energy")
183  << std::setw(10) << G4BestUnit(fStep->GetStepLength(),"Length")
184  << std::setw(10) << G4BestUnit(fTrack->GetTrackLength(),"Length");
185 
186  if(fTrack->GetNextVolume()){
187  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
188  } else {
189  G4cout << std::setw(10) << "OutOfWorld";
190  }
191  G4cout << " initStep" << G4endl;
192  }
193  G4cout.precision(prec);
194 }
195 
196 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......