when in my MySensitivedetector::ProcessHits(G4Step* aStep, G4TouchableHistory* ROhist) I read the location the Read-out geometry is returning the replica number relative to the volume in the PreStep position and not in the PostStep where the energy is actually released. If I still want to use the Read-out geometry, is it possible to get the replica number from the post-step point? In my code I have my sensitive volume voxellized into 11x11x11 (x-z-y) using G4PVReplica if I run the code and print the G4int idy = ROhist->GetReplicaNumber(); G4int idz = ROhist->GetReplicaNumber(1); G4int idx = ROhist->GetReplicaNumber(2); G4cout << aStep->GetPreStepPoint()->GetPosition() << G4endl; G4cout << aStep->GetPostStepPoint()->GetPosition() << G4endl; G4cout << idx << "\t" << idy << "\t" << idz << G4endl; That's what I get.....-4.5 is the baseline, every 0.038 I should have a different voxel on y.... (0.0786003,-4.5,0.0980559) (0.0786047,-4.55639,0.0980614) 5 10 5 (0.00479803,-4.51903,0.0358086 (-0.0206169,-4.60625,0.0767389 5 10 5
In case the current step is limitted by a physics process rather than transportation, both Pre and PostStepPoint should address the same replica number. If the step is limitted by the transprotation, PostStepPoint addresses the NEXT volume the step will proceed. Given the Readout geometry would not limit the step, all energy should belong to the PreStepPoint, more precisely the volume refered by PreStepPoint. Readout geometry refers to the PreStepPoint intentionally.