Message: Re: Is there a simple way to get parent name of a track? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: Is there a simple way to get parent name of a track? 

Forum: Event and Track Management
Re: None Is there a simple way to get parent name of a track? (Fada Guan)
Date: 13 Sep, 2011
From: Tom Roberts <Tom Roberts>

What I do is declare a std::map<int,int> that maps from trackID to PDGid, clear it in BeginOfEventAction(), also clear it in EndOfEventAction(), and add an entry in PreUserTrackingAction(). Now I can get the PDGid of the parent track, and thus all I need to know.

The question is where to declare it, because it is used in several different Geant4 classes. My approach is to have a singleton class BLManager that contains all Geant4 callbacks, so I simply declare it in that class. Because of the way the callback classes are deleted, this requires a small wrapper class for each Geant4 callback class.

Instead of that, you could just declare the map to be global.

 Add Message Add Message
to: "Re: Is there a simple way to get parent name of a track?"

 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 ]