Message: Accessing SingleParticleSource from UserPrimaryGeneratorAction Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Accessing SingleParticleSource from UserPrimaryGeneratorAction 

Keywords: GPS, vertex
Forum: Event and Track Management
Date: 20 Sep, 2007
From: Ben Loer <bloer@princeton.edu>

Hi all,

I am trying to simulate the background environment for my detector. To do this, I use the G4GeneralParticleSource to define the isotopes (via /gps/ion ..) and confine them to the volumes of my different components. For my analysis, I would like to be able to generate the different spectra due to these different sources. It's easy enough to get the particle type from the gps, but this isn't always sufficient, for say, Radon, which is in all components. I thought an easy way to to it was to have in the GeneratePrimaries method the line

gps->GetCurrentSourceIndex()

after generating the primary vertex to find which SingleParticleSource was used to generate the vertex. Unfortunately, this just points to the last source added, or the last source set active.

Is there any method to find which of the defined sources was used to generate the vertex? If not, is there any way to index my different backgrounds in an accessible way? Is there a way to get which volume the primary was generated in from within the UserPrimaryGeneratorAction?

Thanks!

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

 Add Message Add Message
to: "Accessing SingleParticleSource from UserPrimaryGeneratorAction"

 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 ]