Geant4  10.01.p01
F01SteppingVerbose.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: F01SteppingVerbose.cc 77483 2013-11-25 10:10:57Z gcosmo $
31 //
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 
35 #include "F01SteppingVerbose.hh"
36 
37 #include "G4SteppingManager.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(6);
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) << "Direction x" << " "
68  << std::setw(10) << "dir y" << " "
69  << std::setw(10) << "dir z" << " "
70  << std::setw( 8) << "KineE" << " "
71  << std::setw( 6) << "dEStep" << " "
72  << std::setw(10) << "StepLeng"
73  << std::setw(10) << "TrakLeng"
74  << std::setw(10) << "NextVolu"
75  << std::setw(10) << "Process" << " "
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  G4cout << std::setw(10) << fTrack->GetMomentumDirection().x() << " "
84  << std::setw(10) << fTrack->GetMomentumDirection().y() << " "
85  << std::setw(10) << fTrack->GetMomentumDirection().z() << " ";
86  G4cout << std::setw( 8) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
87  << std::setw( 6) << G4BestUnit(
88  fStep->GetTotalEnergyDeposit(),"Energy")
89  << std::setw(10) << G4BestUnit(fStep->GetStepLength(),"Length")
90  << std::setw(10) << G4BestUnit(fTrack->GetTrackLength(),"Length");
91 
92  if( fTrack->GetNextVolume() != 0 ) {
93  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
94  } else {
95  G4cout << std::setw(10) << "OutOfWorld";
96  }
97 
99  G4cout << " "
100  << std::setw(10)
102  ->GetProcessName();
103  } else {
104  G4cout << " UserLimit";
105  }
106  G4cout << G4endl;
107 
108  if( verboseLevel == 2 ){
109  G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
112  if(tN2ndariesTot>0){
113  G4cout << " :----- List of 2ndaries - "
114  << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
115  << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
116  << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
117  << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
118  << "), "
119  << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
120  << " ---------------"
121  << G4endl;
122 
123  for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
124  lp1<(*fSecondary).size(); lp1++)
125  {
126  G4cout << " : "
127  << std::setw(6)
128  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
129  << std::setw(6)
130  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
131  << std::setw(6)
132  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
133  << std::setw(6)
134  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
135  << std::setw(10)
136  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
137  G4cout << G4endl;
138  }
139 
140  G4cout << " :-----------------------------"
141  << "----------------------------------"
142  << "-- EndOf2ndaries Info ---------------"
143  << G4endl;
144  }
145  }
146 
147  }
148  G4cout.precision(prec);
149 }
150 
151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
152 
154 {
155  CopyState();
156  G4int prec = G4cout.precision(6);
157  if( verboseLevel > 0 ){
158 
159  G4cout << std::setw( 5) << "Step#" << " "
160  << std::setw(10) << "X" << " "
161  << std::setw(10) << "Y" << " "
162  << std::setw(10) << "Z" << " "
163  << std::setw(10) << "Direction x" << " "
164  << std::setw(10) << "dir y" << " "
165  << std::setw(10) << "dir z" << " "
166  << std::setw(10) << "KineE" << " "
167  << std::setw(10) << "dEStep" << " "
168  << std::setw(10) << "StepLeng"
169  << std::setw(10) << "TrakLeng"
170  << std::setw(10) << "Volume" << " "
171  << std::setw(10) << "Process"
172  << G4endl;
173 
174  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
175  << std::setw(10) << G4BestUnit(fTrack->GetPosition().x(),"Length")
176  << std::setw(10) << G4BestUnit(fTrack->GetPosition().y(),"Length")
177  << std::setw(10) << G4BestUnit(fTrack->GetPosition().z(),"Length");
178  G4cout << std::setw(10) << fTrack->GetMomentumDirection().x() << " "
179  << std::setw(10) << fTrack->GetMomentumDirection().y() << " "
180  << std::setw(10) << fTrack->GetMomentumDirection().z() << " ";
181  G4cout << std::setw( 8) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
182  << std::setw( 6) << G4BestUnit(
183  fStep->GetTotalEnergyDeposit(),"Energy")
184  << std::setw(10) << G4BestUnit(fStep->GetStepLength(),"Length")
185  << std::setw(10) << G4BestUnit(fTrack->GetTrackLength(),"Length");
186 
187  if(fTrack->GetNextVolume()){
188  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
189  } else {
190  G4cout << std::setw(10) << "OutOfWorld";
191  }
192  G4cout << " initStep" << G4endl;
193  }
194  G4cout.precision(prec);
195 }
196 
197 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
virtual void StepInfo()
G4double GetStepLength() const
G4double z
Definition: TRTMaterials.hh:39
const G4ThreeVector & GetPosition() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
int G4int
Definition: G4Types.hh:78
Definition of the F01SteppingVerbose class.
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
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4double GetTotalEnergyDeposit() const
G4double GetTrackLength() const
virtual void TrackingStarted()
const G4VProcess * GetProcessDefinedStep() const
const G4ThreeVector & GetMomentumDirection() const
G4StepPoint * GetPostStepPoint() const
G4VPhysicalVolume * GetVolume() const
#define G4endl
Definition: G4ios.hh:61