|Message: Re: Tracks History||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
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