Geant4  10.01.p03
F03SteppingVerbose.cc
Go to the documentation of this file.
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 // $Id: F03SteppingVerbose.cc 76602 2013-11-13 08:33:35Z gcosmo $
31 //
32 //
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35 
36 #include "F03SteppingVerbose.hh"
37 
38 #include "G4SteppingManager.hh"
39 #include "G4UnitsTable.hh"
40 
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42 
45 {}
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
48 
50 {}
51 
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 
55 {
56  CopyState();
57 
58  G4int prec = G4cout.precision(8);
59 
60  if( verboseLevel >= 1 ){
61  if( verboseLevel >= 4 ) VerboseTrack();
62  if( verboseLevel >= 3 ){
63  G4cout << G4endl;
64  G4cout << std::setw( 5) << "#Step#" << " "
65  << std::setw(10) << "X" << " "
66  << std::setw(10) << "Y" << " "
67  << std::setw(10) << "Z" << " "
68  << std::setw(10) << "KineE" << " "
69  << std::setw(10) << "dEStep" << " "
70  << std::setw(10) << "StepLeng"
71  << std::setw(10) << "TrakLeng"
72  << std::setw(10) << "NextVolu"
73  << std::setw(10) << "Process"
74  << std::setw(10) << "Dir_x" << " "
75  << std::setw(10) << "Dir_y" << " "
76  << std::setw(10) << "Dir_z" << " "
77  << G4endl;
78  }
79 
80  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
81  << std::setw(10) << G4BestUnit(fTrack->GetPosition().x(),"Length")
82  << std::setw(10) << G4BestUnit(fTrack->GetPosition().y(),"Length")
83  << std::setw(10) << G4BestUnit(fTrack->GetPosition().z(),"Length")
84  << std::setw(10) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
85  << std::setw(10) << G4BestUnit(
86  fStep->GetTotalEnergyDeposit(),"Energy")
87  << std::setw(10) << G4BestUnit(fStep->GetStepLength(),"Length")
88  << std::setw(10) << G4BestUnit(fTrack->GetTrackLength(),"Length");
89 
90  if( fTrack->GetNextVolume() != 0 ) {
91  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
92  } else {
93  G4cout << std::setw(10) << "OutOfWorld";
94  }
95 
97  G4cout << " "
98  << std::setw(10)
100  ->GetProcessName();
101  } else {
102  G4cout << " UserLimit";
103  }
104 
105  G4cout << std::setw(12)
106  << G4BestUnit(fTrack->GetMomentumDirection().x(),"Length")
107  << std::setw(12)
108  << G4BestUnit(fTrack->GetMomentumDirection().y(),"Length")
109  << std::setw(12)
110  << G4BestUnit(fTrack->GetMomentumDirection().z(),"Length");
111 
112  G4cout << G4endl;
113 
114  if( verboseLevel == 2 ){
115  G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
118  if(tN2ndariesTot>0){
119  G4cout << " :----- List of 2ndaries - "
120  << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
121  << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
122  << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
123  << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
124  << "), "
125  << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
126  << " ---------------"
127  << G4endl;
128 
129  for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
130  lp1<(*fSecondary).size(); lp1++){
131  G4cout << " : "
132  << std::setw(6)
133  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
134  << std::setw(6)
135  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
136  << std::setw(6)
137  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
138  << std::setw(6)
139  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
140  << std::setw(10)
141  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
142  G4cout << G4endl;
143  }
144 
145  G4cout << " :-----------------------------"
146  << "----------------------------------"
147  << "-- EndOf2ndaries Info ---------------"
148  << G4endl;
149  }
150  }
151 
152  }
153  G4cout.precision(prec);
154 }
155 
156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
157 
159 {
160 
161  CopyState();
162  G4int prec = G4cout.precision(3);
163  if( verboseLevel > 0 ){
164 
165  G4cout << std::setw( 5) << "Step#" << " "
166  << std::setw( 6) << "X" << " "
167  << std::setw( 6) << "Y" << " "
168  << std::setw( 6) << "Z" << " "
169  << std::setw( 9) << "KineE" << " "
170  << std::setw( 9) << "dEStep" << " "
171  << std::setw(10) << "StepLeng"
172  << std::setw(10) << "TrakLeng"
173  << std::setw(10) << "Volume" << " "
174  << std::setw(10) << "Process" << G4endl;
175 
176  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
177  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
178  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
179  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
180  << std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
181  << std::setw( 6) << G4BestUnit(
182  fStep->GetTotalEnergyDeposit(),"Energy")
183  << std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
184  << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
185 
186  if(fTrack->GetNextVolume()){
187  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
188  } else {
189  G4cout << std::setw(10) << "OutOfWorld";
190  }
191  G4cout << " initStep" << G4endl;
192  }
193  G4cout.precision(prec);
194 }
195 
196 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
virtual void StepInfo()
G4double GetStepLength() const
G4double z
Definition: TRTMaterials.hh:39
const G4ThreeVector & GetPosition() const
virtual void TrackingStarted()
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
int G4int
Definition: G4Types.hh:78
G4VPhysicalVolume * GetNextVolume() const
static const double prec
Definition: RanecuEngine.cc:58
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
G4int GetCurrentStepNumber() const
G4TrackVector * fSecondary
const G4String & GetName() const
Definition of the F03SteppingVerbose class.
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4double GetTotalEnergyDeposit() const
G4double GetTrackLength() const
const G4VProcess * GetProcessDefinedStep() const
const G4ThreeVector & GetMomentumDirection() const
G4StepPoint * GetPostStepPoint() const
G4VPhysicalVolume * GetVolume() const
#define G4endl
Definition: G4ios.hh:61