Message: Re: primary and secondary protons? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: primary and secondary protons? 

Forum: Particles
Re: Question primary and secondary protons? (Dan Fry)
Date: 29 Jun, 2006
From: Vladimir IVANTCHENKO <vnivanch@mail.cern.ch>

On Tue, 20 Jun 2006, Dan Fry wrote:

> *** Discussion title: Particles
> Email replies to PublicHyperNews@slac.stanford.edu must include:
>   In-Reply-To: <"/particles/250"@geant4-hn.slac.stanford.edu>
>   Subject: ...change this to be about your reply.
> 
> Sorry for a double post but perhaps this is a better place for my
> question?
> 
> I don't know if this is a problem but I suspect I may not be calling
> something in the right way. I see a strange dip in the mean proton
> energy as a function of depth in water when I turn the hadronics on. In
> other words it starts out at the entrance of the water phantom with
> close to the initial energy (200MeV) but does not decay monotonically to
> close to zero within the Bragg peak. Instead there is a dip to low
> energy near the phantom entrance (shallow depth) and increases again
> before decaying. I have thoroughly checked my binning method, not to
> mention that the mean proton energy decays monotonically if the
> hadronics is off. My suspicion is that I am somehow getting a mix
> between primary and secondary protons which would only happen when the
> hadronics is turned on. The lower energy secondaries which are more
> pronounced in number at shallow water depths would skew the energy
> distribution resulting in a lower mean energy.
> 
> The part of the code with UserSteppingAction is below. I am looking at
> whether the proton is primary or secondary by looking at fParentID. Is
> this correct? Also, do I need to have anything set a certain way in the
> TrackingAction or is it sufficient to use [const G4Track* currentTrack =
> aStep->GetTrack();]
> 
> Thanks for any help,
> 
> Dan
> 
> ----Code snippet below----
> 
> if(particle_name == "proton")
> {                
>  // Look to see if the proton is a secondary or primary.
>  // Primary has a track ID, fTrackID = 1, fParentID = 0.
> 
>         G4int fParentID = currentTrack->GetParentID();
>         if(fParentID == 1)  // This is secondary proton
>         {
>              ptrVoxelData[pindex].spCount += 1;
>              ptrVoxelData[pindex].spEnergy += Ekin_PreStep/MeV;
>              ptrVoxelData[pindex].spDose += EdepStep/MeV;
>              if(pindex != ptr_EvtAction->last_Voxel)
>              {
>                 ptrVoxelData[pindex].pfluxCount += 1;
>                 ptr_EvtAction->last_Voxel = pindex;
>              }
>          }
>          else if(fParentID == 0)  // This is primary proton
>          {
>              ptrVoxelData[pindex].pCount += 1;
>              ptrVoxelData[pindex].pEnergy += Ekin_PreStep/MeV;
>              ptrVoxelData[pindex].pDose += EdepStep/MeV;
> 
>              //Output range here, based upon an energy threshold of 100keV
> 
>              if(((Ekin_PostStep/keV) <= 10.) && (ptr_EvtAction->flag != false))
>              {
>                 int xint = (int)((position_post.x()/mm)/0.1);
>                 int yint = (int)((position_post.y()/mm)/0.1);
>                 int zint = (int)((position_post.z()/mm)/0.1);
> 
>                 prangex[xint] += 1;
>                 prangey[yint] += 1;
>                 prangez[zint] += 1;
>                 ptr_EvtAction->flag = false;
> 
>                 if(pindex != ptr_EvtAction->last_Voxel)
>                 {
>                    ptrVoxelData[pindex].spfluxCount += 1;
>                    ptr_EvtAction->last_Voxel = pindex;
>                 }
>              }
>          }
> }
> 
> 

Hello,

There was a deep in older releases of G4. Try to use recent one and/or 
reduce cut and step limitation.

VI

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

1 None: Re: primary and secondary protons?   (Dan Fry - 29 Jun, 2006)
 Add Message Add Message
to: "Re: primary and secondary protons?"

 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 ]