source: trunk/examples/advanced/microbeam/src/MicrobeamSteppingVerbose.cc@ 1333

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

update

  • Property svn:executable set to *
File size: 6.9 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: MicrobeamSteppingVerbose.cc,v 1.5 2006/06/29 16:05:41 gunter Exp $
28// -------------------------------------------------------------------
29
30#include "G4UnitsTable.hh"
31
32#include "MicrobeamSteppingVerbose.hh"
33
34//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
35
36MicrobeamSteppingVerbose::MicrobeamSteppingVerbose()
37{}
38
39//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
40
41MicrobeamSteppingVerbose::~MicrobeamSteppingVerbose()
42{}
43
44//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
45
46void MicrobeamSteppingVerbose::StepInfo()
47{
48 CopyState();
49
50 G4int prec = G4cout.precision(6);
51
52 if( verboseLevel >= 1 ){
53 if( verboseLevel >= 4 ) VerboseTrack();
54 if( verboseLevel >= 3 ){
55 G4cout << G4endl;
56 G4cout << std::setw( 5) << "#Step#" << " "
57 << std::setw( 6) << "X" << " "
58 << std::setw( 6) << "Y" << " "
59 << std::setw( 6) << "Z" << " "
60 << std::setw( 9) << "KineE" << " "
61 << std::setw( 9) << "dEStep" << " "
62 << std::setw(10) << "StepLeng"
63 << std::setw(10) << "TrakLeng"
64 << std::setw(10) << "NextVolu"
65 << std::setw(10) << "Process" << G4endl;
66 }
67
68 G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
69 << std::setw( 7) << G4BestUnit(fTrack->GetPosition().x(),"Length") << " "
70 << std::setw( 7) << G4BestUnit(fTrack->GetPosition().y(),"Length") << " "
71 << std::setw( 7) << G4BestUnit(fTrack->GetPosition().z(),"Length") << " "
72 << std::setw( 7) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy") << " "
73 << std::setw( 7) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy") << " "
74 << std::setw( 7) << G4BestUnit(fStep->GetStepLength(),"Length") << " "
75 << std::setw( 7) << G4BestUnit(fTrack->GetTrackLength(),"Length") << " ";
76
77
78 if( fTrack->GetNextVolume() != 0 ) {
79 G4cout << std::setw(11) << fTrack->GetNextVolume()->GetName() <<" ";
80 } else {
81 G4cout << std::setw(11) << "OutOfWorld";
82 }
83
84 if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){
85 G4cout << std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
86 ->GetProcessName();
87 } else {
88 G4cout << "User Limit";
89 }
90
91 G4cout << G4endl;
92
93 if( verboseLevel == 2 ){
94 G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
95 fN2ndariesAlongStepDoIt +
96 fN2ndariesPostStepDoIt;
97 if(tN2ndariesTot>0){
98 G4cout << " :----- List of 2ndaries - "
99 << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
100 << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
101 << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
102 << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
103 << "), "
104 << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
105 << " ---------------"
106 << G4endl;
107
108 for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
109 lp1<(*fSecondary).size(); lp1++){
110 G4cout << " : "
111 << std::setw(6)
112 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
113 << std::setw(6)
114 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
115 << std::setw(6)
116 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
117 << std::setw(6)
118 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
119 << std::setw(10)
120 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
121 G4cout << G4endl;
122 }
123
124 G4cout << " :-----------------------------"
125 << "----------------------------------"
126 << "-- EndOf2ndaries Info ---------------"
127 << G4endl;
128 }
129 }
130
131 }
132 G4cout.precision(prec);
133 }
134
135//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
136
137void MicrobeamSteppingVerbose::TrackingStarted()
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(11) << fTrack->GetNextVolume()->GetName() << " ";
165 } else {
166 G4cout << std::setw(11) << "OutOfWorld" << " ";
167 }
168 G4cout << std::setw(10) << "initStep" << G4endl;
169 }
170 G4cout.precision(prec);
171 G4cout<< "exit MicrobeamSteppingVerbose::TrackingStarted() " <<G4endl;
172}
Note: See TracBrowser for help on using the repository browser.