Message: Re: How to retrieve various informations Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: How to retrieve various informations 

Keywords: event id, particle id, interaction vertex
Forum: Event and Track Management
Re: Sad How to retrieve various informations (MLucia)
Date: 27 Jul, 2005
From: Zach Hartwig <zsh42@g2pc1.bu.edu>

Hi Maria,
   A good place to start is to compile some of the "NOVICE" examples
that accompany the GEANT4 source code distribution.  Its best to 
compile and run them, and get a feel for what the programs and then 
start rooting through the source code to see how the programs actually 
work.  Example "N03" is probably the best place to start.

For your information retrieval purposes I'd specifically recommend looking at user action classes "ExN03EventAction.cc" and "ExN03SteppingAction.cc". These are classes where you, the user, have access to a veritable cornicopia of GEANT4-produced information. In the steppingAction class, you have access to the the G4Step pointer, which provides you with information such as energy depostion, step lengths, etc, but you can also use the member function "step -> GetTrack()" to obtain even more information (total trackLength, trackID, momentum, Kinetic Energy, all relevant particle creation("vertex") information)m etc). In the eventAction class, you'll find access to the G4Event pointer from which you can retrieve things like particleID etc.

You may find that in eventAction or your other user action classes that you'll want access to the pointers that you don't automatically get passed by GEANT4 (for instance, I make heavy use of the G4Track pointer in my eventAction classes). A handy little trick to grab the current pointers is to add the snippet of code found below :

currentTrack = G4RunManagerKernel::GetRunManagerKernel()
    -> GetTrackingManager() -> GetTrack();
(substitute "event" for "track" and "Tracking"and you'll get the 
current event ptr.)

Hope this helps! Good luck!

~ZSH

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

1 Feedback: Re: How to retrieve various informations   (Maria Lucia - 28 Jul, 2005)
(_ None: Re: How to retrieve various informations   (michel maire - 28 Jul, 2005)
 Add Message Add Message
to: "Re: How to retrieve various informations"

 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 ]