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