I´m trying to expedite my simulations by discarding particles generated on unrelevant volumes for results. Ir order to get this, I include in myStackingACtion class, inside the function ClassifyNewTrack(aTrack), the next instruction: const G4LogicalVolume* logVolume = aTrack->GetLogicalVolumeAtVertex(); in order to get the logical volume and then its name. But when I make this I get a Null Pointer, and when trying to access the name, then program aborts with a segmentation violation.
Most likely the user uses the LogicalVolume pointer even for the primary particles.