Hi everyone.
I’m trying to get first step information in a volume like this.
if(step->IsFirstStepInVolume() && step->GetTrack()->GetParentID()==1)
{
analysisManager->FillNtupleDColumn(...);
analysisManager->FillNtupleDColumn(...);
analysisManager->AddNtupleRow();
G4cout << "step number = " << step->GetTrack()->GetCurrentStepNumber() << G4endl;
}
When a particle arrives at the volume called PMT form other volumes, it’s current step number will be printed on the screen.
*********************************************************************************************************
* G4Track Information: Particle = opticalphoton, Track ID = 10351, Parent ID = 1
*********************************************************************************************************
Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
0 9.95e-05 0.000673 -19.6 2.9e-06 0 0 0 Target initStep
1 86.8 -125 -0.7 2.9e-06 0 153 153 PMT Transportation
2 101 -145 2.38 2.9e-06 2.9e-06 25 178 PMT OpAbsorption
step number = 2
Like this. However, The information of step number 2 is not what I what. How do I change the judgment.