source: trunk/examples/extended/field/field02/src/F02SteppingVerbose.cc@ 1036

Last change on this file since 1036 was 807, checked in by garnier, 17 years ago

update

File size: 6.5 KB
RevLine 
[807]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: F02SteppingVerbose.cc,v 1.6 2006/06/29 17:18:31 gunter Exp $
28// GEANT4 tag $Name: $
29//
30//
31//---------------------------------------------------------------
32//
33// F02SteppingVerbose.cc
34//
35// Description:
36// Implementation of the F02SteppingVerbose class
37// Contact:
38// Questions and comments to this code should be sent to
39// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
40// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
41//
42//---------------------------------------------------------------
43
44#include "F02SteppingVerbose.hh"
45#include "G4SteppingManager.hh"
46
47#include "G4UnitsTable.hh"
48
49////////////////////////////////////////////////
50F02SteppingVerbose::F02SteppingVerbose()
51////////////////////////////////////////////////
52{
53}
54
55//////////////////////////////////////////////////
56F02SteppingVerbose::~F02SteppingVerbose()
57//////////////////////////////////////////////////
58{
59}
60
61/////////////////////////////////////////
62void F02SteppingVerbose::StepInfo()
63/////////////////////////////////////////
64{
65 CopyState();
66
67 G4int prec = G4cout.precision(3);
68
69 if( verboseLevel >= 1 ){
70 if( verboseLevel >= 4 ) VerboseTrack();
71 if( verboseLevel >= 3 ){
72 G4cout << G4endl;
73 G4cout << std::setw( 5) << "#Step#" << " "
74 << std::setw( 6) << "X" << " "
75 << std::setw( 6) << "Y" << " "
76 << std::setw( 6) << "Z" << " "
77 << std::setw( 9) << "KineE" << " "
78 << std::setw( 9) << "dEStep" << " "
79 << std::setw(10) << "StepLeng"
80 << std::setw(10) << "TrakLeng"
81 << std::setw(10) << "NextVolu"
82 << std::setw(10) << "Process" << G4endl;
83 }
84
85 G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
86 << std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
87 << std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
88 << std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
89 << std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
90 << std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
91 << std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
92 << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
93
94 // if( fStepStatus != fWorldBoundary){
95 if( fTrack->GetNextVolume() != 0 ) {
96 G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName();
97 } else {
98 G4cout << std::setw(10) << "OutOfWorld";
99 }
100
101 if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != 0){
102 G4cout << std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
103 ->GetProcessName();
104 } else {
105 G4cout << "User Limit";
106 }
107
108 G4cout << G4endl;
109
110 if( verboseLevel == 2 ){
111 G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
112 fN2ndariesAlongStepDoIt +
113 fN2ndariesPostStepDoIt;
114 if(tN2ndariesTot>0){
115 G4cout << " :----- List of 2ndaries - "
116 << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
117 << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
118 << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
119 << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
120 << "), "
121 << " ---------------"
122 << G4endl;
123 G4cout << " :-----------------------------"
124 << "----------------------------------"
125 << "-- EndOf2ndaries Info ---------------"
126 << G4endl;
127 }
128 }
129
130 }
131 G4cout.precision(prec);
132}
133
134////////////////////////////////////////////////
135void F02SteppingVerbose::TrackingStarted()
136////////////////////////////////////////////////
137{
138
139 CopyState();
140G4int prec = G4cout.precision(3);
141 if( verboseLevel > 0 ){
142
143 G4cout << std::setw( 5) << "Step#" << " "
144 << std::setw( 6) << "X" << " "
145 << std::setw( 6) << "Y" << " "
146 << std::setw( 6) << "Z" << " "
147 << std::setw( 9) << "KineE" << " "
148 << std::setw( 9) << "dEStep" << " "
149 << std::setw(10) << "StepLeng"
150 << std::setw(10) << "TrakLeng"
151 << std::setw(10) << "NextVolu"
152 << std::setw(10) << "Process" << G4endl;
153
154 G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
155 << std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
156 << std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
157 << std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
158 << std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
159 << std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
160 << std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
161 << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
162
163 if(fTrack->GetNextVolume()){
164 G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName() << " ";
165 } else {
166 G4cout << std::setw(10) << "OutOfWorld" << " ";
167 }
168 G4cout << std::setw(10) << "initStep" << G4endl;
169 }
170 G4cout.precision(prec);
171}
Note: See TracBrowser for help on using the repository browser.