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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31 
32 #include "SteppingVerbose.hh"
33 
34 #include "G4SteppingManager.hh"
35 #include "G4UnitsTable.hh"
36 
37 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
38 
40 {}
41 
42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43 
45 {}
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
48 
50 {
51  CopyState();
52 
53  G4int prec = G4cout.precision(3);
54 
55  if( verboseLevel >= 1 ){
56  if( verboseLevel >= 4 ) VerboseTrack();
57  if( verboseLevel >= 3 ){
58  G4cout << G4endl;
59  G4cout << std::setw( 5) << "#Step#" << " "
60  << std::setw( 6) << "X" << " "
61  << std::setw( 6) << "Y" << " "
62  << std::setw( 6) << "Z" << " "
63  << std::setw( 9) << "KineE" << " "
64  << std::setw( 9) << "dEStep" << " "
65  << std::setw(10) << "StepLeng"
66  << std::setw(10) << "TrakLeng"
67  << std::setw(10) << "Volume" << " "
68  << std::setw(10) << "Process" << G4endl;
69  }
70 
71  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
72  << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
73  << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
74  << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
75  << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
76  << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
77  << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
78  << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
79  << std::setw(10) << fTrack->GetVolume()->GetName();
80 
81  const G4VProcess* process
83  G4String procName = " UserLimit";
84  if (process) procName = process->GetProcessName();
85  if (fStepStatus == fWorldBoundary) procName = "OutOfWorld";
86  G4cout << " " << std::setw(10) << procName;
87  G4cout << G4endl;
88 
89  if( verboseLevel == 2 ){
90  G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
93  if(tN2ndariesTot>0){
94  G4cout << "\n :----- List of secondaries ----------------"
95  << G4endl;
96  G4cout.precision(4);
97  for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
98  lp1<(*fSecondary).size(); lp1++){
99  G4cout << " "
100  << std::setw(13)
101  << (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
102  << ": energy ="
103  << std::setw(6)
104  << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
105  << " time ="
106  << std::setw(6)
107  << G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time");
108  G4cout << G4endl;
109  }
110 
111  G4cout << " :------------------------------------------\n"
112  << G4endl;
113  }
114  }
115 
116  }
117  G4cout.precision(prec);
118 }
119 
120 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
121 
123 {
124 
125  CopyState();
126 G4int prec = G4cout.precision(3);
127  if( verboseLevel > 0 ){
128 
129  G4cout << std::setw( 5) << "Step#" << " "
130  << std::setw( 6) << "X" << " "
131  << std::setw( 6) << "Y" << " "
132  << std::setw( 6) << "Z" << " "
133  << std::setw( 9) << "KineE" << " "
134  << std::setw( 9) << "dEStep" << " "
135  << std::setw(10) << "StepLeng"
136  << std::setw(10) << "TrakLeng"
137  << std::setw(10) << "Volume" << " "
138  << std::setw(10) << "Process" << G4endl;
139 
140  G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
141  << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
142  << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
143  << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
144  << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
145  << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
146  << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
147  << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
148  << std::setw(10) << fTrack->GetVolume()->GetName()
149  << " initStep" << G4endl;
150  }
151  G4cout.precision(prec);
152 }
153 
154 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......