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 //
30 //
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "SteppingVerbose.hh"
35 
36 #include "G4SteppingManager.hh"
37 #include "G4ParticleTypes.hh"
38 #include "G4UnitsTable.hh"
39 
40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
41 
44 { }
45 
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47 
49 {}
50 
51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
52 
54 {
55  CopyState();
56 
57  G4int prec = G4cout.precision(3);
58 
59  //Step zero
60  //
61  if( verboseLevel > 0 ){
62  G4cout << std::setw( 5) << "Step#" << " "
63  << std::setw( 6) << "X" << " "
64  << std::setw( 6) << "Y" << " "
65  << std::setw( 6) << "Z" << " "
66  << std::setw( 9) << "KineE" << " "
67  << std::setw( 9) << "dEStep" << " "
68  << std::setw(10) << "StepLeng"
69  << std::setw(10) << "TrakLeng"
70  << std::setw(10) << "Volume" << " "
71  << std::setw(10) << "Process" << G4endl;
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  << std::setw(10) << fTrack->GetVolume()->GetName()
82  << " initStep" << G4endl;
83  }
84  G4cout.precision(prec);
85 }
86 
87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
88 
90 {
91  CopyState();
92 
93  G4int prec = G4cout.precision(3);
94 
95  if( verboseLevel >= 1 ){
96  if( verboseLevel >= 4 ) VerboseTrack();
97  if( verboseLevel >= 3 ){
98  G4cout << G4endl;
99  G4cout << std::setw( 5) << "#Step#" << " "
100  << std::setw( 6) << "X" << " "
101  << std::setw( 6) << "Y" << " "
102  << std::setw( 6) << "Z" << " "
103  << std::setw( 9) << "KineE" << " "
104  << std::setw( 9) << "dEStep" << " "
105  << std::setw(10) << "StepLeng"
106  << std::setw(10) << "TrakLeng"
107  << std::setw(10) << "Volume" << " "
108  << std::setw(10) << "Process" << G4endl;
109  }
110 
111  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
112  << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
113  << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
114  << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
115  << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
116  << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
117  << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
118  << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
119  << std::setw(10) << fTrack->GetVolume()->GetName();
120 
121  const G4VProcess* process
123  G4String procName = " UserLimit";
124  if (process) procName = process->GetProcessName();
125  if (fStepStatus == fWorldBoundary) procName = "OutOfWorld";
126  G4cout << " " << std::setw(10) << procName;
127  G4cout << G4endl;
128 
129  if( verboseLevel == 2 ){
130  G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
133  if(tN2ndariesTot>0){
134  G4cout << "\n :----- List of secondaries ----------------"
135  << G4endl;
136  G4cout.precision(4);
137  for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
138  lp1<(*fSecondary).size(); lp1++){
139  G4cout << " "
140  << std::setw(13)
141  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
142  << ": energy ="
143  << std::setw(6)
144  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
145  << " time ="
146  << std::setw(6)
147  << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time");
148  G4cout << G4endl;
149  }
150 
151  G4cout << " :------------------------------------------\n"
152  << G4endl;
153  }
154  }
155 
156  }
157  G4cout.precision(prec);
158 }
159 
160 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......