Message: Re: get secondary particle info from track Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: get secondary particle info from track 

Forum: Event and Track Management
Re: Question get secondary particle info from track (Dragos Constantin)
Re: Agree Re: get secondary particle info from track (Gumplinger Peter)
Re: Question Re: get secondary particle info from track (Dragos Constantin)
Date: 20 Apr, 2010
From: Robert Penny <Robert Penny>

If I could throw in a suggestion....

I was doing some simulations where I wanted to keep tabs on how many
Compton scatterings a photon had undergone before coming back into a
detector.  I attached a class derived from G4VUserTrackInformation to
each photon tracking through the system.  This just had a single data
member, which was the number of compton scatters.

I install a custom UserSteppingAction that for each step checks if the
particle is a gamma, and then checks if it was a compton scatter.  If
so, I increment my numComptonThisTrack.



  G4StepPoint *post_pt  = s->GetPostStepPoint();
  const G4VProcess *post_proc = post_pt->GetProcessDefinedStep();

  G4Track *t = s->GetTrack();

  // Only output information for gammas
  if ( t->GetDefinition() == G4Gamma::GammaDefinition() )
    {
      G4int procType, emSubType;
      procType  = post_proc->GetProcessType();
      emSubType = post_proc->GetProcessSubType();

      BS_TrackInformation *userInfo
      = (BS_TrackInformation *)t->GetUserInformation();

      if ( procType == fElectromagnetic && emSubType ==
fComptonScattering )
        {
          userInfo->numComptonThisTrack++;
        }
#if 0
      G4cout
      << post_proc->GetProcessName()
      << ' ' <<  procType << ' ' << emSubType;

      if ( userInfo )
        {
          G4cout
          << ' ' << userInfo->numComptonThisTrack;
        }

      G4cout << G4endl;
#endif
    }


I attach the user info in the Stacking action.  This is a brief
description... hope it might be of some help.

-Rob.




On Tue, 2010-04-20 at 17:00 -0700, Dragos Constantin wrote:
> *** Discussion title: Event and Track Management
> 
> Thank you Peter for your message. It turns out my problem is not that
> simple. In fact I have to determine the photons which are only
> transported from their source to the detector (which is a thin phase
> space plane). The function GetParentID() will tel us if the particle is
> a primary and not if it was scattered. I mean if a primary particle gets
> scattered it will stay a primary particle. Am I right? My problem uses
> 50 keV photons which are highly unlikely to generate secondary
> particles.
> 
> What will be the strategy to determine the scattered photons from the
> ones that are only transported? To me it seems expensive to look at the
> history of each track and discover if besides transport I have something
> else along the track, but this is the only alternatiove that I have
> discovered so far.
> 
> Thank you.
> 
> Dragos
> 
> On Mon, 19 Apr 2010 20:16:46 GMT, Gumplinger Peter wrote:
> 
> > Yes,
> > 
> > theStep->GetTrack()->GetParentID() == 0
> > 
> > means that the track is a primary and hence has no parent.
> > 
> 
> -------------------------------------------------------------
> Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or unsubscribe) at: 
> http://hypernews.slac.stanford.edu/HyperNews/geant4/get/eventtrackmanage/926/1/1.html 

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

1 Agree: Re: get secondary particle info from track   (Gumplinger Peter - 20 Apr, 2010)
 Add Message Add Message
to: "Re: get secondary particle info from track"

 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 ]