Message: How to get the name of the volume a track is in? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question How to get the name of the volume a track is in? 

Keywords: track volume name
Forum: Event and Track Management
Date: 09 Aug, 2003
From: Mark Polsen <mpolsen@citrus.ucr.edu>

I've created my own custom tracjectory class and am able to store most of the track's information except the name of the volume a track is in. Whenever I try to access this information my application crashes.

Anyone of these lines produces a seg fault: -------------------------------------------------

aTrack->GetLogicalVolumeAtVertex()->GetName()

aTrack->GetVolume()->GetName()

aTrack->GetNextVolume()->GetName()

-------------------------------------------------

Even if I just get a pointer to the G4LogicalVolume or G4VPhysicalVolume, the result is always null. The following code always gives a name of "undefined".

G4LogicalVolume* logVol = aTrack->GetLogicalVolumeAtVertex();
if ( logVol ) {
    G4String volName = logVol->GetName();
    volumeType = volName;
} else {
    volumeType = "undefined";
}

Any help or suggestions are greatly appreciated.

Thank You, Mark Polsen

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: How to get the name of the volume a track is in?   (Makoto Asai - 09 Aug, 2003)
2 None: Re: How to get the name of the volume a track is in?   (Mark Polsen - 11 Aug, 2003)
 Add Message Add Message
to: "How to get the name of the volume a track is in?"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]