In line 89 G4double density = aStep->GetTrack()->GetStep()->GetPreStepPoint()->GetMaterial()->GetDensity(); I think there is no need to get track first and then get step, we can use aStep directly, viz., G4double density = aStep->GetPreStepPoint()->GetMaterial()->GetDensity(); I have tested and found there was not any difference in the results coming from above two lines. Thanks a lot. Fada
Hello. If the scorer is defined in the mass geometry, "aStep" and the G4Step object taken from G4Track are identical as you wrote. But if the scorer is defined in a parallel world, "aStep" has the geometry information of the parallel world, while G4Step taken from G4Track has the geometry information of the mass world. Thus, this is the only safe way to guarantee that the scorer always gets the proper material. Note that if you use the new "layered mass geometry" feature in version 9.5, material information of the mass world (i.e. G4Step taken from G4Track) is overwritten by the parallel world material, and thus this implementation is still correct. Makoto
Thanks a lot!