I set /tracking/verbose 1
and /process/optical/boundary/verbose 2
.
For the photon hits the surface, the boundary status is always âĂĂĂReflectionâ followed by âStepTooSmallâ, and the âStepTooSmallâ step has 0 step length as you said. I list the last 3 steps (it reflects many times and is absorbed by scintillator in the last step):
G4WT2 > Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
G4WT2 > *** SpikeReflection ***
G4WT2 > 13 50 -42.5 0 2.8e-06 0 22.7 477 housing Transportation
G4WT2 > G4VDiscreteProcess::PostStepGetPhysicalInteractionLength() - [ OpBoundary]
G4WT2 > Particle type - opticalphoton
G4WT2 > mass: 0[GeV]
G4WT2 > charge: 0[e]
G4WT2 > Direction x: -0.9438583563660174, y: 0.3303504247281061, z: 0
G4WT2 > Total Momentum = 2.8e-09[GeV]
G4WT2 > Momentum: -2.642803397824849e-09[GeV], y: 9.249811892386971e-10[GeV], z: 0[GeV]
G4WT2 > Total Energy = 2.8e-09[GeV]
G4WT2 > Kinetic Energy = 2.8e-09[GeV]
G4WT2 > MagneticMoment [MeV/T]: 0
G4WT2 > ProperTime = 0[ns]
G4WT2 > in Material Al
G4WT2 > InteractionLength= 1.797693134862316e+307[cm]
G4WT2 > Photon at Boundary!
G4WT2 > thePrePV: housing
G4WT2 > thePostPV: scintillator
G4WT2 > *** StepTooSmall ***
G4WT2 > 14 50 -42.5 0 2.8e-06 0 0 477 scintillator Transportation
G4WT2 > G4VDiscreteProcess::PostStepGetPhysicalInteractionLength() - [ OpBoundary]
G4WT2 > Particle type - opticalphoton
G4WT2 > mass: 0[GeV]
G4WT2 > charge: 0[e]
G4WT2 > Direction x: -0.9438583563660174, y: 0.3303504247281061, z: 0
G4WT2 > Total Momentum = 2.8e-09[GeV]
G4WT2 > Momentum: -2.642803397824849e-09[GeV], y: 9.249811892386971e-10[GeV], z: 0[GeV]
G4WT2 > Total Energy = 2.8e-09[GeV]
G4WT2 > Kinetic Energy = 2.8e-09[GeV]
G4WT2 > MagneticMoment [MeV/T]: 0
G4WT2 > ProperTime = 0[ns]
G4WT2 > in Material LYSO
G4WT2 > InteractionLength= 1.797693134862316e+307[cm]
G4WT2 > 15 20.7 -32.2 0 2.8e-06 2.8e-06 31 508 scintillator OpAbsorption
For the photon hits the edge, there are only 2 steps (âSpikeReflectionâ and âNoRindexâ):
G4WT5 > Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
G4WT5 > *** SpikeReflection ***
G4WT5 > 1 50 50 0 2.8e-06 0 70.7 70.7 housing Transportation
G4WT5 > G4VDiscreteProcess::PostStepGetPhysicalInteractionLength() - [ OpBoundary]
G4WT5 > Particle type - opticalphoton
G4WT5 > mass: 0[GeV]
G4WT5 > charge: 0[e]
G4WT5 > Direction x: -0.7071067811865476, y: 0.7071067811865476, z: 0
G4WT5 > Total Momentum = 2.8e-09[GeV]
G4WT5 > Momentum: -1.979898987322333e-09[GeV], y: 1.979898987322333e-09[GeV], z: 0[GeV]
G4WT5 > Total Energy = 2.8e-09[GeV]
G4WT5 > Kinetic Energy = 2.8e-09[GeV]
G4WT5 > MagneticMoment [MeV/T]: 0
G4WT5 > ProperTime = 0[ns]
G4WT5 > in Material Al
G4WT5 > InteractionLength= 1.797693134862316e+307[cm]
G4WT5 > Photon at Boundary!
G4WT5 > thePrePV: housing
G4WT5 > thePostPV: expHall
G4WT5 > Old Momentum Direction: (-0.7071067811865476,0.7071067811865476,0)
G4WT5 > Old Polarization: (0.4496521907555314,0.4496521907555314,0.7717679798342909)
G4WT5 > *** NoRINDEX ***
G4WT5 > 2 49 51 0 2.8e-06 2.8e-06 1.41 72.1 expHall Transportation
As for getting step length in UserSteppingAction, the result is the same as /tracking/verbose 1
prints out, and the only difference is numerical precision. For example when photon hits edge, the two stepsâ length is:
G4WT5 > step number: 1 step length: 70.71067811865476
G4WT5 > step number: 2 step length: 1.414213562373095