Geant4  10.01.p03
PurgMagSteppingVerbose.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 // Code developed by:
27 // S.Larsson
28 //
29 // ************************************
30 // * *
31 // * PurgMagSteppingVerbose.cc *
32 // * *
33 // ************************************
34 //
35 // $Id: PurgMagSteppingVerbose.cc 69086 2013-04-18 07:29:59Z gcosmo $
36 //
37 
39 #include "G4SteppingManager.hh"
40 
41 #include "G4UnitsTable.hh"
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
44 
46 {}
47 
48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
49 
51 {}
52 
53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
54 
56 {
57  CopyState();
58 
59  G4int prec = G4cout.precision(3);
60 
61  if( verboseLevel >= 1 ){
62  if( verboseLevel >= 4 ) VerboseTrack();
63  if( verboseLevel >= 3 ){
64  G4cout << G4endl;
65  G4cout << std::setw( 5) << "#Step#" << " "
66  << std::setw( 6) << "X" << " "
67  << std::setw( 6) << "Y" << " "
68  << std::setw( 6) << "Z" << " "
69  << std::setw( 9) << "KineE" << " "
70  << std::setw( 9) << "dEStep" << " "
71  << std::setw(10) << "StepLeng"
72  << std::setw(10) << "TrakLeng"
73  << std::setw(10) << "NextVolu"
74  << std::setw(10) << "Process" << G4endl;
75  }
76 
77  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
78  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
79  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
80  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
81  << std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
82  << std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
83  << std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
84  << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
85 
86  // if( fStepStatus != fWorldBoundary){
87  if( fTrack->GetNextVolume() != 0 ) {
88  G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName();
89  } else {
90  G4cout << std::setw(10) << "OutOfWorld";
91  }
92 
94  G4cout << std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
95  ->GetProcessName();
96  } else {
97  G4cout << "User Limit";
98  }
99 
100  G4cout << G4endl;
101 
102  if( verboseLevel == 2 ){
103  G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
106  if(tN2ndariesTot>0){
107  G4cout << " :----- List of 2ndaries - "
108  << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
109  << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
110  << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
111  << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
112  << "), "
113  << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
114  << " ---------------"
115  << G4endl;
116 
117  for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
118  lp1<(*fSecondary).size(); lp1++){
119  G4cout << " : "
120  << std::setw(6)
121  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
122  << std::setw(6)
123  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
124  << std::setw(6)
125  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
126  << std::setw(6)
127  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
128  << std::setw(10)
129  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
130  G4cout << G4endl;
131  }
132 
133  G4cout << " :-----------------------------"
134  << "----------------------------------"
135  << "-- EndOf2ndaries Info ---------------"
136  << G4endl;
137  }
138  }
139 
140  }
141  G4cout.precision(prec);
142  G4cout<< "exit PurgMagSteppingVerbose::StepInfo " <<G4endl;
143 }
144 
145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
146 
148 {
149  CopyState();
150 G4int prec = G4cout.precision(3);
151  if( verboseLevel > 0 ){
152 
153  G4cout << std::setw( 5) << "Step#" << " "
154  << std::setw( 6) << "X" << " "
155  << std::setw( 6) << "Y" << " "
156  << std::setw( 6) << "Z" << " "
157  << std::setw( 9) << "KineE" << " "
158  << std::setw( 9) << "dEStep" << " "
159  << std::setw(10) << "StepLeng"
160  << std::setw(10) << "TrakLeng"
161  << std::setw(10) << "NextVolu"
162  << std::setw(10) << "Process" << G4endl;
163 
164  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
165  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
166  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
167  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
168  << std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
169  << std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
170  << std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
171  << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
172 
173  if(fTrack->GetNextVolume()){
174  G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName() << " ";
175  } else {
176  G4cout << std::setw(10) << "OutOfWorld" << " ";
177  }
178  G4cout << std::setw(10) << "initStep" << G4endl;
179  }
180  G4cout.precision(prec);
181  G4cout<< "exit PurgMagSteppingVerbose::TrackingStarted() " <<G4endl;
182 }
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
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
#define G4endl
Definition: G4ios.hh:61