Message: Re: get source index from G4event Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: get source index from G4event 

Forum: Event and Track Management
Re: Question get source index from G4event (Yigit Dallilar)
Date: 17 Jul, 2013
From: Michael H. Kelsey <Michael H. Kelsey>

On Wed, 17 Jul 2013 14:33:02 GMT, Yigit Dallilar wrote:
> Hello,
> 
> I have a question.
> 
> For example, i created two sources the one is in index 0 and the other
> one is in index 1. I can get vertex information from G4event but it is
> not enough for me. I need to know that if this vertex belongs to the
> source index 0 or the source index 1.
> 
> Is there a way to get that information directly?

Not with the built in Geant4 object (G4PrimaryVertex). However, your generator can attach an object of type G4VUserPrimaryVertexInformation to the vertex which is created. By making a subclass of this type, you can store arbitrary additional data, such as the identity of your source or other configuration stuff.

You can then access this information (and dynamically cast to your subclass) in your event analysis (UserAction) code.

Unfortunately, I don't see that any of our examples directly demonstrate how this works. Example RE01 does show how to use G4VUserTrackInformation, which is an analogous class for use with individual tracks.

  -- Michael Kelsey

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

1 None: Re: get source index from G4event   (Yigit Dallilar - 18 Jul, 2013)
2 None: Re: get source index from G4event   (Yigit Dallilar - 18 Jul, 2013)
 Add Message Add Message
to: "Re: get source index from G4event"

 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 ]