Message: Re: How I can receive number of events? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: How I can receive number of events? 

Forum: Run Management
Re: Question How I can receive number of events? (Evgenya)
Date: 21 Sep, 2009
From: Gumplinger Peter <Gumplinger Peter>

In your UserSteppingAction you can identify a primary particle with:

UserSteppingAction(const G4Step * theStep){

G4Track* theTrack = theStep->GetTrack();

if (theTrack->GetParentID () == 0) {

// primary particle

You can identify if such a particle intersects your detector (named 'Detector') with the following code:

G4StepPoint* thePostPoint = theStep->GetPostStepPoint();

G4VPhysicalVolume* thePostPV = thePostPoint->GetPhysicalVolume();



You may want to study our novice examples and follow links to the many G4 tutorials given over the years to learn more about G4. Go to:

For most tutorial events the agenda has links to the slides shown.

 Add Message Add Message
to: "Re: How I can receive number of events?"

 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 ]