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