Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WLSSteppingVerbose.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 //
31 
32 #include "G4UnitsTable.hh"
33 
34 #include "WLSSteppingVerbose.hh"
35 #include "WLSSteppingAction.hh"
36 
37 // Print out of the steps
38 
40 {
42 }
43 
45 
47 {
48  CopyState();
49 
50  G4int prec = G4cout.precision(8);
51 
52  // if (fTrack->GetDefinition()->GetParticleName() != "opticalphoton") return;
53 
54  if ( verboseLevel >= 1 ) {
55  if ( verboseLevel >= 4 ) VerboseTrack();
56  if ( verboseLevel >= 3 ) {
57  G4cout << G4endl;
58  G4cout << std::setw( 5) << "#Step#" << " "
59  << std::setw(10) << "X" << " "
60  << std::setw(10) << "Y" << " "
61  << std::setw(10) << "Z" << " "
62  << std::setw(10) << "KineE" << " "
63  << std::setw(10) << "dEStep" << " "
64  << std::setw(10) << "StepLeng"
65  << std::setw(10) << "TrakLeng"
66  << std::setw(10) << "NextVolu"
67  << std::setw(10) << "Process"
68  << std::setw(10) << "Dir_x" << " "
69  << std::setw(10) << "Dir_y" << " "
70  << std::setw(10) << "Dir_z" << " "
71  << G4endl;
72  }
73 
74  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
75  << std::setw(10) << G4BestUnit(fTrack->GetPosition().x(),"Length")
76  << std::setw(10) << G4BestUnit(fTrack->GetPosition().y(),"Length")
77  << std::setw(10) << G4BestUnit(fTrack->GetPosition().z(),"Length")
78  << std::setw(10) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
79  << std::setw(10) << G4BestUnit(fStep->
80  GetTotalEnergyDeposit(),"Energy")
81  << std::setw(10) << G4BestUnit(fStep->GetStepLength(),"Length")
82  << std::setw(10) << G4BestUnit(fTrack->GetTrackLength(),"Length");
83 
84  if ( fTrack->GetNextVolume() != 0 ) {
85  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
86  } else {
87  G4cout << std::setw(10) << "OutOfWorld";
88  }
89 
90  if ( fStep->GetPostStepPoint()->GetProcessDefinedStep() != 0 ) {
91  G4cout << " "
92  << std::setw(10) << fStep->
93  GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName();
94  } else {
95  G4cout << " UserLimit";
96  }
97 
98  //G4cout << std::setw(12) << G4BestUnit(fTrack->
99  // GetMomentumDirection().x(),"Length")
100  // << std::setw(12) << G4BestUnit(fTrack->
101  // GetMomentumDirection().y(),"Length")
102  // << std::setw(12) << G4BestUnit(fTrack->
103  // GetMomentumDirection().z(),"Length");
104 
105  G4cout << G4endl;
106 
107  if ( verboseLevel == 2 ) {
108  G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
111  if ( tN2ndariesTot>0 ) {
112  G4cout << " :----- List of 2ndaries - "
113  << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
114  << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
115  << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
116  << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
117  << "), "
118  << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
119  << " ---------------"
120  << G4endl;
121 
122  for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
123  lp1<(*fSecondary).size(); lp1++){
124  G4cout << " : "
125  << std::setw(6)
126  << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
127  << std::setw(6)
128  << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
129  << std::setw(6)
130  << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
131  << std::setw(6)
132  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
133  << std::setw(10)
134  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
135  G4cout << G4endl;
136  }
137 
138  G4cout << " :-----------------------------"
139  << "----------------------------------"
140  << "-- EndOf2ndaries Info ---------------"
141  << G4endl;
142  }
143  }
144 
145  }
146  G4cout.precision(prec);
147 }
148 
150 {
151  CopyState();
152 
153  G4int prec = G4cout.precision(3);
154 
155  // if (fTrack->GetDefinition()->GetParticleName() != "opticalphoton") return;
156 
157  if ( verboseLevel > 0 ) {
158 
159  G4cout << G4endl;
160  G4cout << "*******************************************************"
161  << "**************************************************"
162  << G4endl;
163  G4cout << "* G4Track Information: "
164  << " Particle = " << fTrack->GetDefinition()->GetParticleName()
165  << ","
166  << " Track ID = " << fTrack->GetTrackID()
167  << ","
168  << " Parent ID = " << fTrack->GetParentID()
169  << G4endl;
170  G4cout << "*******************************************************"
171  << "**************************************************"
172  << G4endl;
173  G4cout << G4endl;
174 
175  G4cout << std::setw( 5) << "Step#" << " "
176  << std::setw(10) << "X" << " "
177  << std::setw(10) << "Y" << " "
178  << std::setw(10) << "Z" << " "
179  << std::setw(10) << "KineE" << " "
180  << std::setw(10) << "dEStep" << " "
181  << std::setw(10) << "StepLeng" << " "
182  << std::setw(10) << "TrakLeng" << " "
183  << std::setw(10) << "Volume" << " "
184  << std::setw(10) << "Process" << G4endl;
185 
186  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
187  << std::setw(10) << G4BestUnit(fTrack->GetPosition().x(),"Length")
188  << std::setw(10) << G4BestUnit(fTrack->GetPosition().y(),"Length")
189  << std::setw(10) << G4BestUnit(fTrack->GetPosition().z(),"Length")
190  << std::setw(10) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
191  << std::setw(10) << G4BestUnit(fStep->
192  GetTotalEnergyDeposit(),"Energy")
193  << std::setw(10) << G4BestUnit(fStep->GetStepLength(),"Length")
194  << std::setw(10) << G4BestUnit(fTrack->GetTrackLength(),"Length");
195 
196  if ( fTrack->GetNextVolume() ) {
197  G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
198  } else {
199  G4cout << std::setw(10) << "OutOfWorld";
200  }
201  G4cout << " initStep" << G4endl;
202  }
203  G4cout.precision(prec);
204 }