Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
F02SteppingVerbose.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 // $Id$
31 //
32 //
33 //---------------------------------------------------------------
34 //
35 // F02SteppingVerbose.cc
36 //
37 // Description:
38 // Implementation of the F02SteppingVerbose class
39 // Contact:
40 // Questions and comments to this code should be sent to
41 // Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
42 // Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
43 //
44 //---------------------------------------------------------------
45 
46 #include "F02SteppingVerbose.hh"
47 #include "G4SteppingManager.hh"
48 
49 #include "G4UnitsTable.hh"
50 
54 {
55 }
56 
60 {
61 }
62 
66 {
67  CopyState();
68 
69  G4int prec = G4cout.precision(3);
70 
71  if( verboseLevel >= 1 ){
72  if( verboseLevel >= 4 ) VerboseTrack();
73  if( verboseLevel >= 3 ){
74  G4cout << G4endl;
75  G4cout << std::setw( 5) << "#Step#" << " "
76  << std::setw( 6) << "X" << " "
77  << std::setw( 6) << "Y" << " "
78  << std::setw( 6) << "Z" << " "
79  << std::setw( 9) << "KineE" << " "
80  << std::setw( 9) << "dEStep" << " "
81  << std::setw(10) << "StepLeng"
82  << std::setw(10) << "TrakLeng"
83  << std::setw(10) << "NextVolu"
84  << std::setw(10) << "Process" << G4endl;
85  }
86 
87  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
88  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
89  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
90  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
91  << std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
92  << std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
93  << std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
94  << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
95 
96  // if( fStepStatus != fWorldBoundary){
97  if( fTrack->GetNextVolume() != 0 ) {
98  G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName();
99  } else {
100  G4cout << std::setw(10) << "OutOfWorld";
101  }
102 
104  G4cout << std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
105  ->GetProcessName();
106  } else {
107  G4cout << "User Limit";
108  }
109 
110  G4cout << G4endl;
111 
112  if( verboseLevel == 2 ){
113  G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
116  if(tN2ndariesTot>0){
117  G4cout << " :----- List of 2ndaries - "
118  << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
119  << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
120  << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
121  << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
122  << "), "
123  << " ---------------"
124  << G4endl;
125  G4cout << " :-----------------------------"
126  << "----------------------------------"
127  << "-- EndOf2ndaries Info ---------------"
128  << G4endl;
129  }
130  }
131 
132  }
133  G4cout.precision(prec);
134 }
135 
139 {
140 
141  CopyState();
142 G4int prec = G4cout.precision(3);
143  if( verboseLevel > 0 ){
144 
145  G4cout << std::setw( 5) << "Step#" << " "
146  << std::setw( 6) << "X" << " "
147  << std::setw( 6) << "Y" << " "
148  << std::setw( 6) << "Z" << " "
149  << std::setw( 9) << "KineE" << " "
150  << std::setw( 9) << "dEStep" << " "
151  << std::setw(10) << "StepLeng"
152  << std::setw(10) << "TrakLeng"
153  << std::setw(10) << "NextVolu"
154  << std::setw(10) << "Process" << G4endl;
155 
156  G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
157  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
158  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
159  << std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
160  << std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
161  << std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
162  << std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
163  << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
164 
165  if(fTrack->GetNextVolume()){
166  G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName() << " ";
167  } else {
168  G4cout << std::setw(10) << "OutOfWorld" << " ";
169  }
170  G4cout << std::setw(10) << "initStep" << G4endl;
171  }
172  G4cout.precision(prec);
173 }