ACTARSim
ACTAR TPC Simulation Reference Guide
ActarSimSteppingVerbose.cc
Go to the documentation of this file.
1 // - AUTHOR: Hector Alvarez-Pol 11/2004
2 /******************************************************************
3  * Copyright (C) 2005-2016, Hector Alvarez-Pol *
4  * All rights reserved. *
5  * *
6  * License according to GNU LESSER GPL (see lgpl-3.0.txt). *
7  * For the list of contributors see CREDITS. *
8  ******************************************************************/
9 //////////////////////////////////////////////////////////////////
10 /// \class ActarSimSteppingVerbose
11 /// Controls the verbosity during the step (please, not too much:-)
12 /////////////////////////////////////////////////////////////////
13 
15 
16 #include "G4SteppingManager.hh"
17 #include "G4UnitsTable.hh"
18 
19 //////////////////////////////////////////////////////////////////
20 /// Constructor. Nothing to do.
22 }
23 
24 //////////////////////////////////////////////////////////////////
25 /// Destructor. Nothing to do.
27 }
28 
29 //////////////////////////////////////////////////////////////////
30 /// A complete info dump for each step
32  CopyState();
33 
34  G4int prec = G4cout.precision(3);
35 
36  if( verboseLevel >= 1 ){
37  if( verboseLevel >= 4 ) VerboseTrack();
38  if( verboseLevel >= 3 ){
39  G4cout << G4endl;
40  G4cout << std::setw( 5) << "#Step#" << " "
41  << std::setw( 6) << "X" << " "
42  << std::setw( 6) << "Y" << " "
43  << std::setw( 6) << "Z" << " "
44  << std::setw( 9) << "KineE" << " "
45  << std::setw( 9) << "dEStep" << " "
46  << std::setw(10) << "StepLeng"
47  << std::setw(10) << "TrakLeng"
48  << std::setw(10) << "Volume" << " "
49  << std::setw(10) << "Process" << G4endl;
50  }
51 
52  G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
53  << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
54  << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
55  << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
56  << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
57  << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
58  << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
59  << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
60  << " ";
61 
62  // if( fStepStatus != fWorldBoundary){
63  if( fTrack->GetNextVolume() != 0 ) {
64  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
65  } else {
66  G4cout << std::setw(10) << "OutOfWorld";
67  }
68 
69  if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != 0){
70  G4cout << " "
71  << std::setw(10)
72  << fStep->GetPostStepPoint()->GetProcessDefinedStep()
73  ->GetProcessName();
74  } else {
75  G4cout << " UserLimit";
76  }
77 
78  G4cout << G4endl;
79 
80  if( verboseLevel == 2 ){
81  G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
82  fN2ndariesAlongStepDoIt +
83  fN2ndariesPostStepDoIt;
84  if(tN2ndariesTot>0){
85  G4cout << " :----- List of 2ndaries - "
86  << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
87  << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
88  << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
89  << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
90  << "), "
91  << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
92  << " ---------------"
93  << G4endl;
94 
95  for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
96  lp1<(*fSecondary).size(); lp1++){
97  G4cout << " : "
98  << std::setw(6)
99  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
100  << std::setw(6)
101  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
102  << std::setw(6)
103  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
104  << std::setw(6)
105  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
106  << std::setw(10)
107  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
108  G4cout << G4endl;
109  }
110 
111  G4cout << " :-----------------------------"
112  << "----------------------------------"
113  << "-- EndOf2ndaries Info ---------------"
114  << G4endl;
115  }
116  }
117  }
118  G4cout.precision(prec);
119 }
120 
122  CopyState();
123  G4int prec = G4cout.precision(3);
124  if( verboseLevel > 0 ){
125  G4cout << std::setw( 5) << "Step#" << " "
126  << std::setw( 6) << "X" << " "
127  << std::setw( 6) << "Y" << " "
128  << std::setw( 6) << "Z" << " "
129  << std::setw( 9) << "KineE" << " "
130  << std::setw( 9) << "dEStep" << " "
131  << std::setw(10) << "StepLeng"
132  << std::setw(10) << "TrakLeng"
133  << std::setw(10) << "Volume" << " "
134  << std::setw(10) << "Process" << G4endl;
135 
136  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
137  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
138  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
139  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
140  << std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
141  << std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
142  << std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
143  << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
144  << " ";
145 
146  if(fTrack->GetNextVolume()){
147  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
148  } else {
149  G4cout << "OutOfWorld";
150  }
151  G4cout << " initStep" << G4endl;
152  }
153  G4cout.precision(prec);
154 }
void StepInfo()
A complete info dump for each step.
ActarSimSteppingVerbose()
Constructor. Nothing to do.
~ActarSimSteppingVerbose()
Destructor. Nothing to do.