143 const G4StepPoint* preStep =
step->GetPreStepPoint();
144 const G4StepPoint* postStep =
step->GetPostStepPoint();
148 prec =
G4cout.precision(16);
151 G4cout <<
" ++G4Step Information " << G4endl;
152 G4cout <<
" Address of G4Track : " << track << G4endl;
153 G4cout <<
" Step Length (mm) : " << track->GetStepLength()
155 G4cout <<
" Energy Deposit (MeV) : " <<
step->GetTotalEnergyDeposit()
158 G4cout <<
" -------------------------------------------------------" 159 <<
"-------------------------------" << G4endl;
160 G4cout <<
" StepPoint Information " << std::setw(30) <<
"PreStep" 161 << std::setw(30) <<
"PostStep" << G4endl;
162 G4cout <<
" -------------------------------------------------------" 163 <<
"-------------------------------" << G4endl;
164 G4cout <<
" Position - x (cm) : " 165 << std::setw(30) << preStep->GetPosition().x()/CLHEP::cm
166 << std::setw(30) << postStep->GetPosition().x()/CLHEP::cm << G4endl;
167 G4cout <<
" Position - y (cm) : " 168 << std::setw(30) << preStep->GetPosition().y()/CLHEP::cm
169 << std::setw(30) << postStep->GetPosition().y()/CLHEP::cm << G4endl;
170 G4cout <<
" Position - z (cm) : " 171 << std::setw(30) << preStep->GetPosition().z()/CLHEP::cm
172 << std::setw(30) << postStep->GetPosition().z()/CLHEP::cm << G4endl;
173 G4cout <<
" Global Time (ns) : " 174 << std::setw(30) << preStep->GetGlobalTime()/CLHEP::ns
175 << std::setw(30) << postStep->GetGlobalTime()/CLHEP::ns << G4endl;
176 G4cout <<
" Local Time (ns) : " 177 << std::setw(30) << preStep->GetLocalTime()/CLHEP::ns
178 << std::setw(30) << postStep->GetLocalTime()/CLHEP::ns << G4endl;
179 G4cout <<
" Proper Time (ns) : " 180 << std::setw(30) << preStep->GetProperTime()/CLHEP::ns
181 << std::setw(30) << postStep->GetProperTime()/CLHEP::ns << G4endl;
182 G4cout <<
" Momentum Direct - x : " 183 << std::setw(30) << preStep->GetMomentumDirection().x()
184 << std::setw(30) << postStep->GetMomentumDirection().x()
186 G4cout <<
" Momentum Direct - y : " 187 << std::setw(30) << preStep->GetMomentumDirection().y()
188 << std::setw(30) << postStep->GetMomentumDirection().y()
190 G4cout <<
" Momentum Direct - z : " 191 << std::setw(30) << preStep->GetMomentumDirection().z()
192 << std::setw(30) << postStep->GetMomentumDirection().z()
194 G4cout <<
" Momentum - x (GeV/c): " 195 << std::setw(30) << preStep->GetMomentum().x()/
CLHEP::GeV 196 << std::setw(30) << postStep->GetMomentum().x()/
CLHEP::GeV << G4endl;
197 G4cout <<
" Momentum - y (GeV/c): " 198 << std::setw(30) << preStep->GetMomentum().y()/
CLHEP::GeV 199 << std::setw(30) << postStep->GetMomentum().y()/
CLHEP::GeV << G4endl;
200 G4cout <<
" Momentum - z (GeV/c): " 201 << std::setw(30) << preStep->GetMomentum().z()/
CLHEP::GeV 202 << std::setw(30) << postStep->GetMomentum().z()/
CLHEP::GeV << G4endl;
203 G4cout <<
" Total Energy (GeV) : " 204 << std::setw(30) << preStep->GetTotalEnergy()/
CLHEP::GeV 205 << std::setw(30) << postStep->GetTotalEnergy()/
CLHEP::GeV << G4endl;
206 G4cout <<
" Kinetic Energy (GeV): " 207 << std::setw(30) << preStep->GetKineticEnergy()/
CLHEP::GeV 208 << std::setw(30) << postStep->GetKineticEnergy()/
CLHEP::GeV << G4endl;
209 G4cout <<
" Velocity (mm/ns) : " 210 << std::setw(30) << preStep->GetVelocity()
211 << std::setw(30) << postStep->GetVelocity() << G4endl;
212 G4cout <<
" Volume Name : " 213 << std::setw(30) << preStep->GetPhysicalVolume()->GetName();
214 G4String volName = (postStep->GetPhysicalVolume()) ?
215 postStep->GetPhysicalVolume()->GetName() :
"OutOfWorld";
217 G4cout << std::setw(30) << volName << G4endl;
218 G4cout <<
" Safety (mm) : " 219 << std::setw(30) << preStep->GetSafety()
220 << std::setw(30) << postStep->GetSafety() << G4endl;
221 G4cout <<
" Polarization - x : " 222 << std::setw(30) << preStep->GetPolarization().x()
223 << std::setw(30) << postStep->GetPolarization().x()
225 G4cout <<
" Polarization - y : " 226 << std::setw(30) << preStep->GetPolarization().y()
227 << std::setw(30) << postStep->GetPolarization().y()
229 G4cout <<
" Polarization - Z : " 230 << std::setw(30) << preStep->GetPolarization().z()
231 << std::setw(30) << postStep->GetPolarization().z()
234 << std::setw(30) << preStep->GetWeight()
235 << std::setw(30) << postStep->GetWeight() << G4endl;
236 G4cout <<
" Step Status : " ;
237 G4StepStatus tStepStatus = preStep->GetStepStatus();
238 if( tStepStatus == fGeomBoundary ){
239 G4cout << std::setw(30) <<
"Geom Limit";
240 }
else if ( tStepStatus == fAlongStepDoItProc ){
241 G4cout << std::setw(30) <<
"AlongStep Proc.";
242 }
else if ( tStepStatus == fPostStepDoItProc ){
243 G4cout << std::setw(30) <<
"PostStep Proc";
244 }
else if ( tStepStatus == fAtRestDoItProc ){
245 G4cout << std::setw(30) <<
"AtRest Proc";
246 }
else if ( tStepStatus == fUndefined ){
247 G4cout << std::setw(30) <<
"Undefined";
250 tStepStatus = postStep->GetStepStatus();
251 if( tStepStatus == fGeomBoundary ){
252 G4cout << std::setw(30) <<
"Geom Limit";
253 }
else if ( tStepStatus == fAlongStepDoItProc ){
254 G4cout << std::setw(30) <<
"AlongStep Proc.";
255 }
else if ( tStepStatus == fPostStepDoItProc ){
256 G4cout << std::setw(30) <<
"PostStep Proc";
257 }
else if ( tStepStatus == fAtRestDoItProc ){
258 G4cout << std::setw(30) <<
"AtRest Proc";
259 }
else if ( tStepStatus == fUndefined ){
260 G4cout << std::setw(30) <<
"Undefined";
264 G4cout <<
" Process defined Step: " ;
265 if( preStep->GetProcessDefinedStep() == 0 ){
266 G4cout << std::setw(30) <<
"Undefined";
269 << preStep->GetProcessDefinedStep()->GetProcessName();
271 if( postStep->GetProcessDefinedStep() == 0){
272 G4cout << std::setw(30) <<
"Undefined";
275 << postStep->GetProcessDefinedStep()->GetProcessName();
280 G4cout <<
" -------------------------------------------------------" 281 <<
"-------------------------------" << G4endl;
286 const G4VTouchable* tch1 = preStep->GetTouchable();
287 const G4VTouchable* tch2 = postStep->GetTouchable();
289 G4double
x = postStep->GetPosition().x();
290 G4double
y = postStep->GetPosition().y();
291 G4cout <<
"Touchable depth pre= " << tch1->GetHistoryDepth()
292 <<
" post= " << tch2->GetHistoryDepth()
293 <<
" trans1= " << tch1->GetTranslation(tch1->GetHistoryDepth())
294 <<
" trans2= " << tch2->GetTranslation(tch2->GetHistoryDepth())
297 const G4VPhysicalVolume* pv1 = preStep->GetPhysicalVolume();
298 const G4VPhysicalVolume* pv2 = postStep->GetPhysicalVolume();
299 G4cout <<
"PreStepVolume: " << pv1->GetName() << G4endl;
300 G4cout <<
" Translation: " << pv1->GetObjectTranslation() << G4endl;
301 G4cout <<
" Rotation: " << pv1->GetObjectRotationValue() << G4endl;
302 const G4VSolid* sv1 = pv1->GetLogicalVolume()->GetSolid();
306 G4cout <<
"PostStepVolume: " << pv2->GetName() << G4endl;
307 G4cout <<
" Translation: " << pv2->GetObjectTranslation() << G4endl;
308 G4cout <<
" Rotation: " << pv2->GetObjectRotationValue() << G4endl;
309 const G4VSolid* sv2 = pv2->GetLogicalVolume()->GetSolid();
315 G4cout <<
"##### Geometry Depth Analysis" << G4endl;
316 for(G4int
k=1;
k<tch1->GetHistoryDepth(); ++
k) {
317 const G4VPhysicalVolume*
pv = tch1->GetVolume(
k);
319 const G4VSolid* sol = pv->GetLogicalVolume()->GetSolid();
320 G4cout <<
" Depth # " <<
k <<
" PhysVolume " << pv->GetName() << G4endl;
321 G4cout <<
" Translation: " << pv->GetObjectTranslation() << G4endl;
322 G4cout <<
" Rotation: " << pv->GetObjectRotationValue() << G4endl;
331 prec =
G4cout.precision(4);
332 G4cout << std::setw( 5) << track->GetCurrentStepNumber() <<
" " 333 << std::setw( 8) << track->GetPosition().x()/CLHEP::cm <<
" " 334 << std::setw( 8) << track->GetPosition().y()/CLHEP::cm <<
" " 335 << std::setw( 8) << track->GetPosition().z()/CLHEP::cm <<
" " 336 << std::setw( 9) << track->GetKineticEnergy()/
CLHEP::GeV <<
" ";
338 prec =
G4cout.precision(3);
340 << std::setw( 8) <<
step->GetStepLength()/CLHEP::mm <<
" " 341 << std::setw( 9) << track->GetTrackLength()/CLHEP::cm <<
" ";
343 G4bool endTracking =
false;
344 if( track->GetNextVolume() !=
nullptr ) {
345 G4cout << std::setw(30) << track->GetVolume()->GetName() <<
" ";
347 G4cout << std::setw(30) <<
"OutOfWorld" <<
" ";
353 }
else if(postStep->GetProcessDefinedStep() !=
nullptr){
354 G4cout << postStep->GetProcessDefinedStep()->GetProcessName();
361 if(!endTracking && fStopAndKill != track->GetTrackStatus()) {
return; }
363 prec =
G4cout.precision(4);
364 G4cout <<
" ++List of " <<
step->GetSecondary()->size()
365 <<
" secondaries generated " << G4endl;
366 const G4TrackVector* tv = sManager->GetSecondary();
367 G4int
n = tv->size();
368 for(G4int
i=0;
i<
n; ++
i) {
372 << (*tv)[
i]->GetPosition().x()/CLHEP::cm <<
" " 374 << (*tv)[
i]->GetPosition().y()/CLHEP::cm <<
" " 376 << (*tv)[
i]->GetPosition().z()/CLHEP::cm <<
") cm, " 378 << (*tv)[
i]->GetKineticEnergy()/
CLHEP::GeV <<
" GeV, " 380 << (*tv)[
i]->GetGlobalTime()/CLHEP::ns <<
" ns, " 382 << (*tv)[
i]->GetDefinition()->GetParticleName() << G4endl;