[Gate-users] proton trajectory parameters actor

Nils Krah nils.krah at creatis.insa-lyon.fr
Fri Feb 12 12:17:38 CET 2021


      
And a follow-up:
  
​
  
​You might want to add these lines to your mac file:
  
/gate/actor/addActor ProtonNuclearInformationActor myNuclearInfoActor
  
/gate/actor/myNuclearInfoActor/attachTo                        world
  
  
​and these​ when you specify your PhaseSpaceActors:
  
​/gate/actor/{DetectorName}/enableNuclearFlag                    true
  
  
This should add additional information to your phase space output, namely (when reading the root files in python with uproot):
  
​​CreatorProcess = phaseSpace.array("CreatorProcess")
  
NuclearProcess = phaseSpace.array("NuclearProcess")
  
​
  
​CreatorProcess means whether proton is a primary (=0) or whether it was created via nuclear elastic (1) or inelastic (2) interaction.
  
​NuclearProcess means whether the proton has undergone nuclear elastic (1) or inelastic (2) scattering or not (0).
  
​
  
​So CP=0, NP=0 is a primary proton which has only undergone electromagnetic interaction.
  
​CP=0, NP=1 is a primary which was scattered via nuclear elastic interaction, but it's still the same primary proton.
  
​CP=1, NP=0 is a secondary proton resulting from a nuclear elastic interaction which has not undergone any nuclear interaction since then.
  
​
  
​Using these flags, you should be able to filter out the events you want.
  
​
  
​This source code of this actor is here:
  
​https://github.com/OpenGATE/Gate/blob/develop/source/digits_hits/src/GateProtonNuclearInformationActor.cc
  
​
  
​Cheers,
  
​Nils
  
  
On Feb 12 2021, at 11:49 am, Nils Krah  <nils.krah at creatis.insa-lyon.fr>  wrote:
  
>   
> Great, I'm glad it helped.
>   
>>   
> ​This is what I use in my mac files:
>   
>>   
> ​/gate/actor/{DetectorName}/enableXDirection                      true
>   
> /gate/actor/{DetectorName}/enableYDirection                      true
>   
> /gate/actor/{DetectorName}/enableZDirection                      true
>   
>   
> ​So maybe you have to specify X, Y, Z as well. Let us know.
>   
>>   
> ​Nils
>   
> On Feb 12 2021, at 11:02 am, Dmitry Hits  <dmitry.hits at phys.ethz.ch>  wrote:
>   
> >   
> > Hi Nils, Hi Nicolas,
> >   
> >
> >   
> > Thank you very much for the detailed answer! I only did some preliminary tests but I think that the option 1 will work for me.
> >   
> >
> >   
> > By the way, I am not sure whether you have an access to the documentation files, but if you do, I may have found a small typo there.
> >   
> >
> >   
> >   https://opengate.readthedocs.io/en/latest/tools_to_interact_with_the_simulation_actors.html#phase-space-actor
> >   
> >   
> >   /gate/actor/MyActor/enableDirection false
> >   
> > Gave me an error. I think because it is not one of the methods of PhaseSpaceActor.   
> >   
> >   
> >
> >   
> > Cheers,
> >   
> >
> >   
> > Dmitry
> >   
> >
> >   
> >
> >   
> > >   
> > > On 11 Feb 2021, at 15:07, Nils Krah  <nils.krah at creatis.insa-lyon.fr (mailto:nils.krah at creatis.insa-lyon.fr)>  wrote:
> > >   
> > >   
> > >   
> > > Hi Dmitry,
> > >   
> > > ​To extend Nicolas' suggestion:
> > >   
> > > ​
> > >   
> > > Bear in mind that a PhaseSpaceActor by default stores the particles' kinematic properties once it enters the volume to which the actor is attached.
> > >   
> > > ​
> > >   
> > > ​​I see two ways in which you can use the PhaseSpaceActor for your purpose:
> > >   
> > > ​
> > >   
> > > ​1) Insert many PhaseSpaceActors at different depths into the volume in which you want to track the protons. You need to be a bit careful with the geometry because each actor needs a volume to attach to which in turn needs to be inserted into the volume across which the protons are tracked. Maybe very thin slices of a suitable material would work. Essentially, you are placing virtual tracking detectors into your volume. As a result you will get a list of events per actor, i.e. a list of root files, from which you need to merge information in post-processing, e.g. by matching the EventID. Per proton you will then get a set of transverse positions in discretized depths (where you placed the actors). Bear in mind that nuclear interactions can produce secondary particle with the same EventID, so that multiple positions can appear per actor. You will want some filtering strategy, based on what you try to analyze.
> > >   
> > > ​
> > >   
> > > ​2) Option 2: Attach one actor to the entire volume across which the protons are tracked and turn on the option "storeAllSteps". This will write an entry for each step of each proton to a root file, and not only when the proton enters the volume. You get one root file. You get the full information about where the proton and its descendants were at each tracking step. Clearly, output data is much larger. And the depths at which information is stored is not regularly spaced because Geant4 dynamically adjusts the step length. So again, you need post-processing to merge entries with the same EventID in the root file and take care of secondary particles according to your needs. If you want to compare transverse positions of the protons among each other, you might need to interpolate to common depths.
> > >   
> > > ​
> > >   
> > > ​Hope my explanations are clear, please ask if not.
> > >   
> > > ​
> > >   
> > > ​Cheers,
> > >   
> > > ​Nils
> > >   
> > >   
> > > On Feb 11 2021, at 10:39 am, Nicolas Arbor  <nicolas.arbor at iphc.cnrs.fr (mailto:nicolas.arbor at iphc.cnrs.fr)>  wrote:
> > >   
> > > >   
> > > > Hi Dmitry,
> > > >   
> > > >   
> > > > I think the PhaseSpace actor could be suitable for that purpose, no ?
> > > >   
> > > >   
> > > >   https://opengate.readthedocs.io/en/latest/tools_to_interact_with_the_simulation_actors.html#phase-space-actor
> > > >   
> > > >   
> > > > Cheers,
> > > >   
> > > > Nicolas
> > > >   
> > > >   
> > > >   
> > > > Le 11/02/2021 à 10:12, Dmitry Hits a écrit   :
> > > >   
> > > >   
> > > > >   
> > > > >   
> > > > > Dear Gate-Users,
> > > > >   
> > > > >   
> > > > > I was wondering if someone has already written an actor that stores the parameters of proton trajectory?
> > > > >   
> > > > > In particular, I am interested to know the energy and direction of a proton at different points its trajectory.
> > > > >   
> > > > >   
> > > > > Cheers,
> > > > >   
> > > > >   
> > > > > Dmitry
> > > > >   
> > > > >   
> > > > >   
> > > > > _______________________________________________
> > > > >   
> > > > > Gate-users mailing list
> > > > >   
> > > > > Gate-users at lists.opengatecollaboration.org (mailto:Gate-users at lists.opengatecollaboration.org)http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
> > > > >   
> > > > >   
> > > >   
> > > >   
> > > >   
> > > > --
> > > >   
> > > > ***********************************************************************
> > > >   
> > > > Nicolas ARBOR
> > > >   
> > > > Maître de Conférences
> > > >   
> > > > Université de Strasbourg - Faculté de Physique et Ingénierie
> > > >   
> > > > Groupe de recherche DeSIs - Institut Pluridisciplinaire Hubert Curien
> > > >   
> > > > 23, rue du Loess BP28 67037 Strasbourg Cedex 2
> > > >   
> > > > mail :   nicolas.arbor at iphc.cnrs.fr (mailto:nicolas.arbor at iphc.cnrs.fr)   / tel : 03.88.10.64.27
> > > >   
> > > > ***********************************************************************
> > > >   
> > > >   
> > > >   
> > > > _______________________________________________
> > > >   
> > > > Gate-users mailing list
> > > >   
> > > > Gate-users at lists.opengatecollaboration.org (mailto:Gate-users at lists.opengatecollaboration.org)
> > > >   
> > > >   http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
> > > >   
> > > >   
> > >   
> > >   
> >   
> >   
> >   
>   
>   
> _______________________________________________
>   
> Gate-users mailing list
>   
> Gate-users at lists.opengatecollaboration.org
>   
>  http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
>   
>   
     
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20210212/cd690d3f/attachment-0001.html>


More information about the Gate-users mailing list