Geant4  10.01.p03
LXeSteppingVerbose.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 //
26 // $Id: LXeSteppingVerbose.cc 68752 2013-04-05 10:23:47Z gcosmo $
27 //
30 //
31 //
32 #include "LXeSteppingVerbose.hh"
33 
34 #include "G4SteppingManager.hh"
35 #include "G4UnitsTable.hh"
36 
37 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
38 
40 
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42 
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
48 {
49 CopyState();
50 
51  G4int prec = G4cout.precision(3);
52 
53  if( verboseLevel >= 1 ){
54  if( verboseLevel >= 4 ) VerboseTrack();
55  if( verboseLevel >= 3 ){
56  G4cout << G4endl;
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 
69  G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
70  << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
71  << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
72  << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
73  << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
74  << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
75  << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
76  << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
77  << " ";
78 
79  // if( fStepStatus != fWorldBoundary){
80  if( fTrack->GetNextVolume() != 0 ) {
81  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
82  } else {
83  G4cout << std::setw(10) << "OutOfWorld";
84  }
85 
87  G4cout << " "
88  << std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
89  ->GetProcessName();
90  } else {
91  G4cout << " UserLimit";
92  }
93 
94  G4cout << G4endl;
95 
96  if( verboseLevel == 2 ){
97  G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
100  if(tN2ndariesTot>0){
101  G4cout << " :----- List of 2ndaries - "
102  << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
103  << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
104  << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
105  << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
106  << "), "
107  << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
108  << " ---------------"
109  << G4endl;
110 
111  for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
112  lp1<(*fSecondary).size(); lp1++){
113  G4cout << " : "
114  << std::setw(6)
115  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
116  << std::setw(6)
117  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
118  << std::setw(6)
119  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
120  << std::setw(6)
121  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
122  << std::setw(10)
123  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
124  G4cout << G4endl;
125  }
126 
127  G4cout << " :-----------------------------"
128  << "----------------------------------"
129  << "-- EndOf2ndaries Info ---------------"
130  << G4endl;
131  }
132  }
133  }
134  G4cout.precision(prec);
135 }
136 
137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
138 
140 {
141  CopyState();
142  G4int prec = G4cout.precision(3);
143  if( verboseLevel > 0 ){
144 
145  G4cout << std::setw( 5) << "Step#" << " "
146  << std::setw( 6) << "X" << " "
147  << std::setw( 6) << "Y" << " "
148  << std::setw( 6) << "Z" << " "
149  << std::setw( 9) << "KineE" << " "
150  << std::setw( 9) << "dEStep" << " "
151  << std::setw(10) << "StepLeng"
152  << std::setw(10) << "TrakLeng"
153  << std::setw(10) << "Volume" << " "
154  << std::setw(10) << "Process" << G4endl;
155 
156  G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
157  << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
158  << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
159  << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
160  << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
161  << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
162  << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
163  << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
164  << " ";
165 
166  if(fTrack->GetNextVolume()){
167  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
168  } else {
169  G4cout << std::setw(10) << "OutOfWorld";
170  }
171  G4cout << " initStep" << G4endl;
172  }
173  G4cout.precision(prec);
174 }
175 
176 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Definition of the LXeSteppingVerbose class.
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
virtual void StepInfo()
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
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4double GetTotalEnergyDeposit() const
G4double GetTrackLength() const
const G4VProcess * GetProcessDefinedStep() const
G4StepPoint * GetPostStepPoint() const
G4VPhysicalVolume * GetVolume() const
#define G4endl
Definition: G4ios.hh:61