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 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/extended/geometry/vecGeomNavigation/src/VG01SteppingVerboseWithDir.cc (Version 11.3.0) and /examples/extended/geometry/vecGeomNavigation/src/VG01SteppingVerboseWithDir.cc (Version 9.0.p1)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 // s                                              
 27 /// \file VG01SteppingVerboseWithDir.cc           
 28 /// \brief Implementation of the VG01SteppingV    
 29                                                   
 30 // Author : J. Apostolakis,  (EP/SFT CERN)  20    
 31 //                                                
 32 //  Refines the existing G4SteppingVerbose, ad    
 33 //   - direction of particle                      
 34 //   - safety (at step's start point)             
 35                                                   
 36 #include "VG01SteppingVerboseWithDir.hh"          
 37                                                   
 38 #include "G4SteppingManager.hh"                   
 39 #include "G4UnitsTable.hh"                        
 40                                                   
 41 //....oooOO0OOooo........oooOO0OOooo........oo    
 42                                                   
 43 VG01SteppingVerboseWithDir::VG01SteppingVerbos    
 44                                                   
 45 //....oooOO0OOooo........oooOO0OOooo........oo    
 46                                                   
 47 VG01SteppingVerboseWithDir::~VG01SteppingVerbo    
 48                                                   
 49 //....oooOO0OOooo........oooOO0OOooo........oo    
 50                                                   
 51 void VG01SteppingVerboseWithDir::Banner()         
 52 {                                                 
 53   G4cout << G4endl;                               
 54   G4cout << std::setw(5) << "Step#"               
 55          << " " << std::setw(9) << "X (mm)"       
 56          << " " << std::setw(9) << "Y (mm)"       
 57          << " " << std::setw(9) << "Z (mm)"       
 58          << " " << std::setw(11) << "Ek (MeV)"    
 59          << " " << std::setw(8) << "dE (MeV)"     
 60          << " " << std::setw(7) << "Step(mm)"     
 61          << " " << std::setw(12) << "Track(mm)    
 62          << " " << std::setw(7) << "Safety(mm)    
 63          << " | " << std::setw(11) << " Dir.x     
 64          << " " << std::setw(11) << " Dir.y "     
 65          << " " << std::setw(11) << " Dir.z "     
 66          << " | " << std::setw(15) << "Materia    
 67          << "NextVolu" << G4endl;                 
 68 }                                                 
 69                                                   
 70 //....oooOO0OOooo........oooOO0OOooo........oo    
 71                                                   
 72 void VG01SteppingVerboseWithDir::StepInfo()       
 73 {                                                 
 74   CopyState();                                    
 75                                                   
 76   G4int prec = G4cout.precision(6);               
 77                                                   
 78   if (verboseLevel >= 1) {                        
 79     if (verboseLevel >= 4) VerboseTrack();        
 80     if (verboseLevel >= 3) {                      
 81       Banner();                                   
 82     }                                             
 83                                                   
 84     G4cout << std::setw(5) << fTrack->GetCurre    
 85            << fTrack->GetPosition().x() / CLHE    
 86            << fTrack->GetPosition().y() / CLHE    
 87            << fTrack->GetPosition().z() / CLHE    
 88            << std::setw(11) << fTrack->GetKine    
 89     G4cout.precision(3);                          
 90     G4cout << std::setw(8) << fStep->GetTotalE    
 91            << fStep->GetStepLength() / CLHEP::    
 92     G4cout.precision(6);                          
 93     G4cout << std::setw(12) << fTrack->GetTrac    
 94                                                   
 95     G4cout.precision(5);                          
 96     G4StepPoint* preStepPt = fTrack->GetStep()    
 97     if (preStepPt != nullptr) {                   
 98       G4double safety = preStepPt->GetSafety()    
 99       G4cout << std::setw(8) << ((safety > 1.0    
100     }                                             
101     else {                                        
102       G4cout << std::setw(8) << "-0.0_(N/A)"      
103              << " ";                              
104     }                                             
105                                                   
106     G4cout << "| ";                               
107     G4cout << std::setw(11) << fTrack->GetMome    
108            << fTrack->GetMomentumDirection().y    
109            << fTrack->GetMomentumDirection().z    
110                                                   
111     G4cout << std::setw(15) << fTrack->GetMate    
112     G4VProcess const* pds = fStep->GetPostStep    
113     G4cout << std::setw(14) << ((pds != nullpt    
114            << " ";                                
115     // if( fStepStatus != fWorldBoundary){        
116     if (fTrack->GetNextVolume() != nullptr) {     
117       G4cout << std::setw(10) << fTrack->GetNe    
118       G4cout << std::setw(4) << fTrack->GetNex    
119     }                                             
120     else {                                        
121       G4cout << std::setw(10) << "OutOfWorld";    
122     }                                             
123                                                   
124     G4cout << " ";                                
125                                                   
126     G4cout << G4endl;                             
127                                                   
128     if (verboseLevel == 2) {                      
129       G4int tN2ndariesTot = fN2ndariesAtRestDo    
130       if (tN2ndariesTot > 0) {                    
131         G4cout << "    :----- List of 2ndaries    
132                << "#SpawnInStep=" << std::setw    
133                << fN2ndariesAtRestDoIt << ",Al    
134                << ",Post=" << std::setw(2) <<     
135                << "#SpawnTotal=" << std::setw(    
136                << G4endl;                         
137                                                   
138         for (size_t lp1 = (*fSecondary).size()    
139           G4cout << "    : " << std::setw(8) <    
140                  << " " << std::setw(8) << (*f    
141                  << std::setw(8) << (*fSeconda    
142                  << std::setw(8) << (*fSeconda    
143                  << std::setw(10) << (*fSecond    
144           G4cout << G4endl;                       
145         }                                         
146                                                   
147         G4cout << "    :----------------------    
148                << "---------------------------    
149                << "-- EndOf2ndaries Info -----    
150       }                                           
151     }                                             
152   }                                               
153   G4cout.precision(prec);                         
154   // G4cout<< "exit VG01SteppingVerboseWithDir    
155 }                                                 
156                                                   
157 //....oooOO0OOooo........oooOO0OOooo........oo    
158                                                   
159 void VG01SteppingVerboseWithDir::TrackingStart    
160 {                                                 
161   CopyState();                                    
162   G4int prec = G4cout.precision(6);               
163   if (verboseLevel > 0) {                         
164     Banner();                                     
165                                                   
166     G4cout << std::setw(5) << fTrack->GetCurre    
167            << fTrack->GetPosition().x() / CLHE    
168            << fTrack->GetPosition().y() / CLHE    
169            << fTrack->GetPosition().z() / CLHE    
170            << std::setw(11) << fTrack->GetKine    
171     // << " ( = " << std::setw(8) << G4BestUni    
172     G4cout.precision(3);                          
173     G4cout << std::setw(8) << fStep->GetTotalE    
174            << fStep->GetStepLength() / CLHEP::    
175     G4cout.precision(6);                          
176     G4cout << std::setw(12) << fTrack->GetTrac    
177                                                   
178     G4Step const* step = fTrack->GetStep();       
179     G4StepPoint const* preStepPt = nullptr;       
180     if (step != nullptr) preStepPt = fTrack->G    
181     if (preStepPt != nullptr) {                   
182       G4double safety = preStepPt->GetSafety()    
183       G4cout << std::setw(8) << ((safety > 1.0    
184     }                                             
185     else {                                        
186       G4cout << std::setw(8) << "N/A"             
187              << " ";                              
188     }                                             
189     G4cout << "| ";                               
190     G4cout << std::setw(11) << fTrack->GetMome    
191            << fTrack->GetMomentumDirection().y    
192            << fTrack->GetMomentumDirection().z    
193                                                   
194     // Material and volume name                   
195     if (fTrack->GetVolume()) {                    
196       G4Material* material = fTrack->GetVolume    
197       if (material != nullptr) {                  
198         G4cout << std::setw(15) << material->G    
199       }                                           
200       else {                                      
201         G4cout << std::setw(15) << "No-Materia    
202                << " ";                            
203       }                                           
204       G4cout << std::setw(14) << "initStep"       
205              << " ";                              
206       G4cout << std::setw(10) << fTrack->GetVo    
207       G4cout << std::setw(4) << fTrack->GetVol    
208     }                                             
209     else {                                        
210       G4cout << std::setw(10) << "No-Material"    
211              << " ";                              
212       G4cout << std::setw(14) << "initStep"       
213              << " ";                              
214       G4cout << std::setw(10) << "OutOfWorld"     
215              << " ";                              
216     }                                             
217     // fTrack->GetMaterial() fails at track st    
218     G4cout << G4endl;                             
219   }                                               
220   G4cout.precision(prec);                         
221 }                                                 
222