Message: Re: Tracks History Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Tracks History 

Forum: Event and Track Management
Re: None Tracks History (Adam Geva)
Date: 23 Apr, 2017
From: Michael H. Kelsey <Michael H. Kelsey>

On Sat, 22 Apr 2017 16:21:44 GMT, Adam Geva wrote:
> Dear G4 Users, I have a sensitive detector and a source of gamma
> particles. Once a particle hits my detector (exactly on its boundary -
> preStepPoint->GetStepStatus()==fGeomBoundary) I would like to be able to
> get information regarding the history and processes of that particle -
> example: how many Compton interactions it had undergone since its
> creation.
> Does this information even exist at the time of a hit? what is the best
> way to access it?

History information doesn't exist in Geant4. The G4Track and G4Step pointers are one-at-a-time, and reused over the course of a trajectory and event.

What you can do, if you want, is to create some sort of container stack yourself, to keep the bits of history you need. In your SteppingAction you would store the current step's data for that track into your history, and access it elsewhere (e.g., EventAction).

If all you want to do count interactions, the "history container" can be as simple as a std::pair<G4int, G4int>, where the key is the track ID and the value is the count.  Or it can be a complex data structure with volume, process, energy, etc.  Either way, the G4 toolkit doesn't provide anything built-in.
      -- Michael Kelsey

 Add Message Add Message
to: "Re: Tracks History"

 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 ]