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