Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
F02SteppingVerbose.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: F02SteppingVerbose.cc 76247 2013-11-08 11:18:52Z gcosmo $
31 //
32 //
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35 
36 #include "F02SteppingVerbose.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(3);
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( 6) << "X" << " "
66  << std::setw( 6) << "Y" << " "
67  << std::setw( 6) << "Z" << " "
68  << std::setw( 9) << "KineE" << " "
69  << std::setw( 9) << "dEStep" << " "
70  << std::setw(10) << "StepLeng"
71  << std::setw(10) << "TrakLeng"
72  << std::setw(10) << "NextVolu"
73  << std::setw(10) << "Process" << G4endl;
74  }
75 
76  G4cout << std::setw( 5)<<fTrack->GetCurrentStepNumber() << " "
77  << std::setw( 6)<<G4BestUnit(fTrack->GetPosition().x(),"Length")
78  << std::setw( 6)<<G4BestUnit(fTrack->GetPosition().y(),"Length")
79  << std::setw( 6)<<G4BestUnit(fTrack->GetPosition().z(),"Length")
80  << std::setw( 6)<<G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
81  << std::setw( 6)<<G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
82  << std::setw( 6)<<G4BestUnit(fStep->GetStepLength(),"Length")
83  << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
84 
85  if( fTrack->GetNextVolume() != 0 ) {
86  G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName();
87  } else {
88  G4cout << std::setw(10) << "OutOfWorld";
89  }
90 
92  G4cout << std::setw(10)
94  ->GetProcessName();
95  } else {
96  G4cout << " UserLimit";
97  }
98 
99  G4cout << G4endl;
100 
101  if( verboseLevel == 2 ){
102  G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
105  if(tN2ndariesTot>0){
106  G4cout << " :----- List of 2ndaries - "
107  << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
108  << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
109  << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
110  << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
111  << "), "
112  << " ---------------"
113  << G4endl;
114  G4cout << " :-----------------------------"
115  << "----------------------------------"
116  << "-- EndOf2ndaries Info ---------------"
117  << G4endl;
118  }
119  }
120 
121  }
122  G4cout.precision(prec);
123 }
124 
125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
126 
128 {
129  CopyState();
130  G4int prec = G4cout.precision(3);
131  if( verboseLevel > 0 ){
132 
133  G4cout << std::setw( 5) << "Step#" << " "
134  << std::setw( 6) << "X" << " "
135  << std::setw( 6) << "Y" << " "
136  << std::setw( 6) << "Z" << " "
137  << std::setw( 9) << "KineE" << " "
138  << std::setw( 9) << "dEStep" << " "
139  << std::setw(10) << "StepLeng"
140  << std::setw(10) << "TrakLeng"
141  << std::setw(10) << "NextVolu"
142  << std::setw(10) << "Process" << G4endl;
143 
144  G4cout << std::setw( 5)<<fTrack->GetCurrentStepNumber() << " "
145  << std::setw( 6)<<G4BestUnit(fTrack->GetPosition().x(),"Length")
146  << std::setw( 6)<<G4BestUnit(fTrack->GetPosition().y(),"Length")
147  << std::setw( 6)<<G4BestUnit(fTrack->GetPosition().z(),"Length")
148  << std::setw( 6)<<G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
149  << std::setw( 6)<<G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
150  << std::setw( 6)<<G4BestUnit(fStep->GetStepLength(),"Length")
151  << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
152 
153  if(fTrack->GetNextVolume()){
154  G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName() << " ";
155  } else {
156  G4cout << std::setw(10) << "OutOfWorld" << " ";
157  }
158  G4cout << std::setw(10) << "initStep" << G4endl;
159  }
160  G4cout.precision(prec);
161 }
162 
163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double GetStepLength() const
double x() const
const G4ThreeVector & GetPosition() const
virtual void TrackingStarted()
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
int G4int
Definition: G4Types.hh:78
double z() const
G4VPhysicalVolume * GetNextVolume() const
static const double prec
Definition: RanecuEngine.cc:58
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
G4int GetCurrentStepNumber() const
Definition of the F02SteppingVerbose class.
const G4String & GetName() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4double GetTotalEnergyDeposit() const
G4double GetTrackLength() const
const G4VProcess * GetProcessDefinedStep() const
virtual void StepInfo()
G4StepPoint * GetPostStepPoint() const
double y() const
#define G4endl
Definition: G4ios.hh:61