source: trunk/examples/extended/optical/LXe/src/LXeSteppingVerbose.cc @ 1023

Last change on this file since 1023 was 807, checked in by garnier, 16 years ago

update

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