Geant4_10
OpNoviceSteppingVerbose.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 //
27 //
28 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30 
32 
33 #include "G4SteppingManager.hh"
34 #include "G4UnitsTable.hh"
35 
36 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
37 
40 {}
41 
42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43 
45 {}
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
48 
50 {
51  CopyState();
52 
53  G4int prec = G4cout.precision(3);
54 
55  if( verboseLevel >= 1 ){
56  if( verboseLevel >= 4 ) VerboseTrack();
57  if( verboseLevel >= 3 ){
58  G4cout << G4endl;
59  G4cout << std::setw( 5) << "#Step#" << " "
60  << std::setw( 6) << "X" << " "
61  << std::setw( 6) << "Y" << " "
62  << std::setw( 6) << "Z" << " "
63  << std::setw( 9) << "KineE" << " "
64  << std::setw( 9) << "dEStep" << " "
65  << std::setw(10) << "StepLeng"
66  << std::setw(10) << "TrakLeng"
67  << std::setw(10) << "Volume" << " "
68  << std::setw(10) << "Process" << G4endl;
69  }
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  << " ";
80 
81  // if( fStepStatus != fWorldBoundary){
82  if( fTrack->GetNextVolume() != 0 ) {
83  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
84  } else {
85  G4cout << std::setw(10) << "OutOfWorld";
86  }
87 
89  G4cout << " "
90  << std::setw(10)
92  ->GetProcessName();
93  } else {
94  G4cout << " UserLimit";
95  }
96 
97  G4cout << G4endl;
98 
99  if( verboseLevel == 2 ){
100  G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
103  if(tN2ndariesTot>0){
104  G4cout << " :----- List of 2ndaries - "
105  << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
106  << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
107  << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
108  << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
109  << "), "
110  << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
111  << " ---------------"
112  << G4endl;
113 
114  for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
115  lp1<(*fSecondary).size(); lp1++){
116  G4cout << " : "
117  << std::setw(6)
118  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
119  << std::setw(6)
120  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
121  << std::setw(6)
122  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
123  << std::setw(6)
124  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
125  << std::setw(10)
126  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
127  G4cout << G4endl;
128  }
129 
130  G4cout << " :-----------------------------"
131  << "----------------------------------"
132  << "-- EndOf2ndaries Info ---------------"
133  << G4endl;
134  }
135  }
136 
137  }
138  G4cout.precision(prec);
139 }
140 
141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
142 
144 {
145 
146  CopyState();
147  G4int prec = G4cout.precision(3);
148  if( verboseLevel > 0 ){
149 
150  G4cout << std::setw( 5) << "Step#" << " "
151  << std::setw( 6) << "X" << " "
152  << std::setw( 6) << "Y" << " "
153  << std::setw( 6) << "Z" << " "
154  << std::setw( 9) << "KineE" << " "
155  << std::setw( 9) << "dEStep" << " "
156  << std::setw(10) << "StepLeng"
157  << std::setw(10) << "TrakLeng"
158  << std::setw(10) << "Volume" << " "
159  << std::setw(10) << "Process" << G4endl;
160 
161  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
162  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
163  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
164  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
165  << std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
166  << std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
167  << std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
168  << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
169  << " ";
170 
171  if(fTrack->GetNextVolume()){
172  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
173  } else {
174  G4cout << "OutOfWorld";
175  }
176  G4cout << " initStep" << G4endl;
177  }
178  G4cout.precision(prec);
179 }
180 
181 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double GetStepLength() const
double x() const
const G4ThreeVector & GetPosition() const
tuple x
Definition: test.py:50
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
int G4int
Definition: G4Types.hh:78
double z() const
G4VPhysicalVolume * GetNextVolume() const
Double_t y
Definition: plot.C:279
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
double y() const
G4VPhysicalVolume * GetVolume() const
tuple z
Definition: test.py:28
#define G4endl
Definition: G4ios.hh:61