Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Em10SteppingVerbose.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 /// \file electromagnetic/TestEm10/src/Em10SteppingVerbose.cc
27 /// \brief Implementation of the Em10SteppingVerbose class
28 //
29 //
30 // $Id: Em10SteppingVerbose.cc 67268 2013-02-13 11:38:40Z ihrivnac $
31 //
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
34 
35 #include "Em10SteppingVerbose.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(8);
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) << "KineE" << " "
68  << std::setw(10) << "dEStep" << " "
69  << std::setw(10) << "StepLeng"
70  << std::setw(10) << "TrakLeng"
71  << std::setw(10) << "NextVolu"
72  << std::setw(10) << "Process"
73  << std::setw(10) << "Dir_x" << " "
74  << std::setw(10) << "Dir_y" << " "
75  << std::setw(10) << "Dir_z" << " "
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  << std::setw(10) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
84  << std::setw(10) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
85  << std::setw(10) << G4BestUnit(fStep->GetStepLength(),"Length")
86  << std::setw(10) << G4BestUnit(fTrack->GetTrackLength(),"Length");
87 
88  // if( fStepStatus != fWorldBoundary){
89  if( fTrack->GetNextVolume() != 0 ) {
90  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
91  } else {
92  G4cout << std::setw(10) << "OutOfWorld";
93  }
94 
96  G4cout << " "
97  << std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
98  ->GetProcessName();
99  } else {
100  G4cout << " UserLimit";
101  }
102 
103  G4cout << std::setw(12) << G4BestUnit(fTrack->GetMomentumDirection().x(),"Length")
104  << std::setw(12) << G4BestUnit(fTrack->GetMomentumDirection().y(),"Length")
105  << std::setw(12) << G4BestUnit(fTrack->GetMomentumDirection().z(),"Length");
106 
107  G4cout << G4endl;
108 
109  if( verboseLevel == 2 ){
110  G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
113  if(tN2ndariesTot>0){
114  G4cout << " :----- List of 2ndaries - "
115  << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
116  << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
117  << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
118  << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
119  << "), "
120  << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
121  << " ---------------"
122  << G4endl;
123 
124  for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
125  lp1<(*fSecondary).size(); lp1++){
126 
127  G4cout << " : "
128  << std::setw(6)
129  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
130  << std::setw(6)
131  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
132  << std::setw(6)
133  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
134  << std::setw(6)
135  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
136  << std::setw(10)
137  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
138  G4cout << G4endl;
139  }
140 
141  G4cout << " :-----------------------------"
142  << "----------------------------------"
143  << "-- EndOf2ndaries Info ---------------"
144  << G4endl;
145  }
146  }
147 
148  }
149  G4cout.precision(prec);
150 }
151 
152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
153 
155 {
156 
157  CopyState();
158 G4int prec = G4cout.precision(3);
159  if( verboseLevel > 0 ){
160 
161  G4cout << std::setw( 5) << "Step#" << " "
162  << std::setw( 6) << "X" << " "
163  << std::setw( 6) << "Y" << " "
164  << std::setw( 6) << "Z" << " "
165  << std::setw( 9) << "KineE" << " "
166  << std::setw( 9) << "dEStep" << " "
167  << std::setw(10) << "StepLeng"
168  << std::setw(10) << "TrakLeng"
169  << std::setw(10) << "Volume" << " "
170  << std::setw(10) << "Process" << G4endl;
171 
172  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
173  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
174  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
175  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
176  << std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
177  << std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
178  << std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
179  << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
180 
181  if(fTrack->GetNextVolume()){
182  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
183  } else {
184  G4cout << std::setw(10) << "OutOfWorld";
185  }
186  G4cout << " initStep" << G4endl;
187  }
188  G4cout.precision(prec);
189 }
190 
191 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
192 
193 
194 
195 
196 
197 
198 
199 
200 
G4double GetStepLength() const
double x() 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
double z() const
G4VPhysicalVolume * GetNextVolume() const
Definition of the Em10SteppingVerbose class.
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
const G4ThreeVector & GetMomentumDirection() const
G4StepPoint * GetPostStepPoint() const
double y() const
G4VPhysicalVolume * GetVolume() const
#define G4endl
Definition: G4ios.hh:61