source: trunk/examples/extended/electromagnetic/TestEm10/src/Em10SteppingVerbose.cc @ 1281

Last change on this file since 1281 was 1230, checked in by garnier, 14 years ago

update to geant4.9.3

File size: 7.4 KB
Line 
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: Em10SteppingVerbose.cc,v 1.6 2006/06/29 16:39:12 gunter Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
32
33#include "Em10SteppingVerbose.hh"
34
35#include "G4SteppingManager.hh"
36#include "G4UnitsTable.hh"
37
38//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
39
40Em10SteppingVerbose::Em10SteppingVerbose()
41{}
42
43//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
44
45Em10SteppingVerbose::~Em10SteppingVerbose()
46{} 
47
48//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
49
50void Em10SteppingVerbose::StepInfo()
51{
52  CopyState();
53 
54  G4int prec = G4cout.precision(8);
55
56  if( verboseLevel >= 1 ){
57    if( verboseLevel >= 4 ) VerboseTrack();
58    if( verboseLevel >= 3 ){
59      G4cout << G4endl;   
60      G4cout << std::setw( 5) << "#Step#"     << " "
61             << std::setw(10) << "X"          << "    "
62             << std::setw(10) << "Y"          << "    " 
63             << std::setw(10) << "Z"          << "    "
64             << std::setw(10) << "KineE"      << " "
65             << std::setw(10) << "dEStep"     << " " 
66             << std::setw(10) << "StepLeng"     
67             << std::setw(10) << "TrakLeng" 
68             << std::setw(10) << "NextVolu" 
69             << std::setw(10) << "Process"   
70             << std::setw(10) << "Dir_x"        << "    "
71             << std::setw(10) << "Dir_y"        << "    " 
72             << std::setw(10) << "Dir_z"        << "    "
73             << G4endl;           
74    }
75
76    G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
77           << std::setw(10) << G4BestUnit(fTrack->GetPosition().x(),"Length")
78           << std::setw(10) << G4BestUnit(fTrack->GetPosition().y(),"Length")
79           << std::setw(10) << G4BestUnit(fTrack->GetPosition().z(),"Length")
80           << std::setw(10) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
81           << std::setw(10) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
82           << std::setw(10) << G4BestUnit(fStep->GetStepLength(),"Length")
83           << std::setw(10) << G4BestUnit(fTrack->GetTrackLength(),"Length");
84
85    // if( fStepStatus != fWorldBoundary){
86    if( fTrack->GetNextVolume() != 0 ) { 
87      G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
88    } else {
89      G4cout << std::setw(10) << "OutOfWorld";
90    }
91
92    if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){
93      G4cout << "  " 
94             << std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
95                                        ->GetProcessName();
96    } else {
97      G4cout << "   UserLimit";
98    }
99
100    G4cout << std::setw(12) << G4BestUnit(fTrack->GetMomentumDirection().x(),"Length")
101           << std::setw(12) << G4BestUnit(fTrack->GetMomentumDirection().y(),"Length")
102           << std::setw(12) << G4BestUnit(fTrack->GetMomentumDirection().z(),"Length");
103
104    G4cout << G4endl;
105
106    if( verboseLevel == 2 ){
107      G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
108                            fN2ndariesAlongStepDoIt +
109                            fN2ndariesPostStepDoIt;
110      if(tN2ndariesTot>0){
111        G4cout << "    :----- List of 2ndaries - "
112               << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
113               << "(Rest="  << std::setw(2) << fN2ndariesAtRestDoIt
114               << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
115               << ",Post="  << std::setw(2) << fN2ndariesPostStepDoIt
116               << "), "
117               << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
118               << " ---------------"
119               << G4endl;
120
121        for(size_t lp1=(*fSecondary).size()-tN2ndariesTot; 
122                        lp1<(*fSecondary).size(); lp1++){
123
124          G4cout << "    : "
125                 << std::setw(6)
126                 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
127                 << std::setw(6)
128                 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
129                 << std::setw(6)
130                 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
131                 << std::setw(6)
132                 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
133                 << std::setw(10)
134                 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
135          G4cout << G4endl;
136        }
137             
138        G4cout << "    :-----------------------------"
139               << "----------------------------------"
140               << "-- EndOf2ndaries Info ---------------"
141               << G4endl;
142      }
143    }
144   
145  }
146  G4cout.precision(prec);
147}
148
149//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
150
151void Em10SteppingVerbose::TrackingStarted()
152{
153
154  CopyState();
155G4int prec = G4cout.precision(3);
156  if( verboseLevel > 0 ){
157
158    G4cout << std::setw( 5) << "Step#"      << " "
159           << std::setw( 6) << "X"          << "    "
160           << std::setw( 6) << "Y"          << "    " 
161           << std::setw( 6) << "Z"          << "    "
162           << std::setw( 9) << "KineE"      << " "
163           << std::setw( 9) << "dEStep"     << " " 
164           << std::setw(10) << "StepLeng" 
165           << std::setw(10) << "TrakLeng"
166           << std::setw(10) << "Volume"     << "  "
167           << std::setw(10) << "Process"    << G4endl;       
168
169    G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
170           << std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
171           << std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
172           << std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
173           << std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
174           << std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
175           << std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
176           << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
177
178    if(fTrack->GetNextVolume()){
179      G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
180    } else {
181      G4cout << std::setw(10) << "OutOfWorld";
182    }
183    G4cout  << "    initStep" << G4endl;
184  }
185  G4cout.precision(prec);
186}
187
188//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
189
190
191
192
193
194
195
196
197
Note: See TracBrowser for help on using the repository browser.