source: trunk/source/geometry/magneticfield/test/field02/src/F02SteppingVerbose.cc @ 1347

Last change on this file since 1347 was 1347, checked in by garnier, 13 years ago

geant4 tag 9.4

File size: 7.2 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: F02SteppingVerbose.cc,v 1.4 2006/06/29 18:28:37 gunter Exp $
28// GEANT4 tag $Name: geant4-09-04-ref-00 $
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() != NULL){
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          //  << "#SpawnTotal=" << std::setw(3) << (*fSecondary).entries()
122               << " ---------------"
123               << G4endl;
124        /*
125        for(G4int lp1=(*fSecondary).entries()-tN2ndariesTot;
126                        lp1<(*fSecondary).entries(); lp1++)
127        {
128          G4cout << "    : "
129                 << std::setw(6)
130                 << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
131                 << std::setw(6)
132                 << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
133                 << std::setw(6)
134                 << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
135                 << std::setw(6)
136                 << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
137                 << std::setw(10)
138                 << (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
139          G4cout << G4endl;
140        }
141        */     
142        G4cout << "    :-----------------------------"
143               << "----------------------------------"
144               << "-- EndOf2ndaries Info ---------------"
145               << G4endl;
146      }
147    }
148   
149  }
150  G4cout.precision(prec);
151}
152
153////////////////////////////////////////////////
154void F02SteppingVerbose::TrackingStarted()
155////////////////////////////////////////////////
156{
157
158  CopyState();
159G4int prec = G4cout.precision(3);
160  if( verboseLevel > 0 ){
161
162    G4cout << std::setw( 5) << "Step#"      << " "
163           << std::setw( 6) << "X"          << "    "
164           << std::setw( 6) << "Y"          << "    " 
165           << std::setw( 6) << "Z"          << "    "
166           << std::setw( 9) << "KineE"      << " "
167           << std::setw( 9) << "dEStep"     << " " 
168           << std::setw(10) << "StepLeng" 
169           << std::setw(10) << "TrakLeng"
170           << std::setw(10) << "NextVolu"
171           << std::setw(10) << "Process"    << G4endl;       
172
173    G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
174           << std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
175           << std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
176           << std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
177           << std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
178           << std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
179           << std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
180           << std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
181
182    if(fTrack->GetNextVolume()){
183      G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName() << " ";
184    } else {
185      G4cout << std::setw(10) << "OutOfWorld" << " ";
186    }
187    G4cout << std::setw(10) << "initStep" << G4endl;
188  }
189  G4cout.precision(prec);
190}
Note: See TracBrowser for help on using the repository browser.