Problem 676 - Getting Null Pointer when trying to get the Logical Volume in MyStackingAction
Summary: Getting Null Pointer when trying to get the Logical Volume in MyStackingAction
Status: RESOLVED INVALID
Alias: None
Product: Geant4
Classification: Unclassified
Component: track (show other problems)
Version: 6.2
Hardware: PC Linux
: P5 normal
Assignee: Makoto.Asai
URL:
Depends on:
Blocks:
 
Reported: 2004-10-05 04:58 CEST by jmunoz
Modified: 2007-04-08 18:38 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description jmunoz 2004-10-05 04:58:25 CEST
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.
Comment 1 asai 2004-10-22 15:22:59 CEST
Most likely the user uses the LogicalVolume pointer even for the primary
particles.