ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
F04SteppingVerbose.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file F04SteppingVerbose.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 //
26 //
29 //
30 
31 #include "G4UnitsTable.hh"
32 
33 #include "F04SteppingVerbose.hh"
34 
35 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
36 
38 {
40 }
41 
42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43 
45 
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47 
49 {
50  CopyState();
51 
52  G4int prec = G4cout.precision(8);
53 
54  if (fTrack->GetDefinition()->GetParticleName() == "proton") return;
55 // if (fTrack->GetDefinition()->GetParticleName() == "pi+") return;
56 // if (fTrack->GetDefinition()->GetParticleName() == "mu+") return;
57  if (fTrack->GetDefinition()->GetParticleName() == "e+") return;
58 
59  if( verboseLevel >= 1 ){
60  if( verboseLevel >= 4 ) VerboseTrack();
61  if( verboseLevel >= 3 ){
62  G4cout << G4endl;
63  G4cout << std::setw( 5) << "#Step#" << " "
64  << std::setw(10) << "X" << " "
65  << std::setw(10) << "Y" << " "
66  << std::setw(10) << "Z" << " "
67  << std::setw(10) << "KineE" << " "
68  << std::setw(10) << "dEStep" << " "
69  << std::setw(10) << "StepLeng"
70  << std::setw(10) << "TrakLeng"
71  << std::setw(10) << "NextVolu"
72  << std::setw(10) << "Process"
73  << std::setw(10) << "Dir_x" << " "
74  << std::setw(10) << "Dir_y" << " "
75  << std::setw(10) << "Dir_z" << " "
76  << G4endl;
77  }
78 
79  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
80  << std::setw(10) << G4BestUnit(fTrack->GetPosition().x(),"Length")
81  << std::setw(10) << G4BestUnit(fTrack->GetPosition().y(),"Length")
82  << std::setw(10) << G4BestUnit(fTrack->GetPosition().z(),"Length")
83  << std::setw(10) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
84  << std::setw(10) << G4BestUnit(fStep->
85  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()->
98  GetProcessDefinedStep()->GetProcessName();
99  } else {
100  G4cout << " UserLimit";
101  }
102 
103 // G4cout << std::setw(12) <<
104 // G4BestUnit(fTrack->GetMomentumDirection().x(),"Length")
105 // << std::setw(12) <<
106 // G4BestUnit(fTrack->GetMomentumDirection().y(),"Length")
107 // << std::setw(12) <<
108 // G4BestUnit(fTrack->GetMomentumDirection().z(),"Length");
109 
110  G4cout << G4endl;
111 
112  if( verboseLevel == 2 ){
113  G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
116  if(tN2ndariesTot>0){
117  G4cout << " :----- List of 2ndaries - "
118  << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
119  << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
120  << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
121  << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
122  << "), "
123  << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
124  << " ---------------"
125  << G4endl;
126 
127  for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
128  lp1<(*fSecondary).size(); lp1++){
129  G4cout << " : "
130  << std::setw(6)
131  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
132  << std::setw(6)
133  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
134  << std::setw(6)
135  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
136  << std::setw(6)
137  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
138  << std::setw(10)
139  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
140  G4cout << G4endl;
141  }
142 
143  G4cout << " :-----------------------------"
144  << "----------------------------------"
145  << "-- EndOf2ndaries Info ---------------"
146  << G4endl;
147  }
148  }
149 
150  }
151  G4cout.precision(prec);
152 }
153 
154 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
155 
157 {
158  CopyState();
159 
160  G4int prec = G4cout.precision(3);
161 
162  if (fTrack->GetDefinition()->GetParticleName() == "proton") return;
163 // if (fTrack->GetDefinition()->GetParticleName() == "pi+") return;
164 // if (fTrack->GetDefinition()->GetParticleName() == "mu+") return;
165  if (fTrack->GetDefinition()->GetParticleName() == "e+") return;
166 
167  G4cout << G4endl;
168  G4cout << "*******************************************************"
169  << "**************************************************"
170  << G4endl;
171  G4cout << "* G4Track Information: "
172  << " Particle = " << fTrack->GetDefinition()->GetParticleName()
173  << ","
174  << " Track ID = " << fTrack->GetTrackID()
175  << ","
176  << " Parent ID = " << fTrack->GetParentID()
177  << G4endl;
178  G4cout << "*******************************************************"
179  << "**************************************************"
180  << G4endl;
181  G4cout << G4endl;
182 
183  if( verboseLevel > 0 ){
184 
185  G4cout << std::setw( 5) << "Step#" << " "
186  << std::setw( 6) << "X" << " "
187  << std::setw( 6) << "Y" << " "
188  << std::setw( 6) << "Z" << " "
189  << std::setw( 9) << "KineE" << " "
190  << std::setw( 9) << "dEStep" << " "
191  << std::setw(10) << "StepLeng"
192  << std::setw(10) << "TrakLeng"
193  << std::setw(10) << "Volume" << " "
194  << std::setw(10) << "Process" << G4endl;
195 
196  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
197  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
198  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
199  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
200  << std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
201  << std::setw( 6) <<
203  << std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
204  << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
205 
206  if(fTrack->GetNextVolume()){
207  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
208  } else {
209  G4cout << std::setw(10) << "OutOfWorld";
210  }
211  G4cout << " initStep" << G4endl;
212  }
213  G4cout.precision(prec);
214 }