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