Message: Re: how to tag a particle (neutron) that has just been produced Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: how to tag a particle (neutron) that has just been produced 

Forum: Geometry
Re: None how to tag a particle (neutron) that has just been produced (Eduard Friske)
Date: 19 Jun, 2015
From: John Apostolakis <John Apostolakis>

I suggest to create a TrackingAction which has a StartTracking method that filters and records what you need.

Typically it will work best if you have a separate class that carries out what you want, and it is messaged by the trackingAction and your SteppingAction.

Regards,
 John

Sent from my tablet.

> On 19 Jun 2015, at 07:42, Eduard Friske <eduard.friske@uni-tuebingen.de> wrote:
> 
> 
> *** Discussion title: Geometry
> 
> Hello,
> 
> how can I find out whether a particle has just been produced within a
> volume? To get particles that entered it the command
> GetPreStepPoint()->GetStepStatus() == fGeomBoundary can be used, but I
> don't think this works for particles that never entered the volume.
> 
> With my current code I check for fUndefined simply because I don't know
> what else to check for, but it also doesn't work.
> 
> Code snippet:
> 
> if (step->GetTrack()->GetDefinition()->GetParticleName() == "neutron" && ((step->GetPreStepPoint()->GetStepStatus() == fGeomBoundary) || (step->GetPreStepPoint()->GetStepStatus() == fUndefined)))
>        {
> 
>                std::vector<G4GDMLAuxPairType>::const_iterator ipair = auxInfo.begin();
>                for( ipair = auxInfo.begin(); ipair != auxInfo.end(); ipair++ )
>                {
>                        if (ipair->type == "tracking")
>                        {
>                                tracking = true;
>                                if (ipair->value == "origin" && (step->GetPreStepPoint()->GetStepStatus() == fUndefined))
>                                {
>                                        origin = true;
>                                }
>                                else if (ipair->value == "trajectory" && (step->GetPreStepPoint()->GetStepStatus() == fGeomBoundary))
>                                {
>                                        trajectory = true;
>                                }
>                                else if (ipair->value == "hit")
>                                {
>                                        hit = true;
>                                }
>                        }
>                }
> 
> ...
>        }
> }
> 
> To explain what I try to achieve:
> 
> I need the position of the produced neutrons, and their momentum after
> they have left my apparatus, therefore I defined an envelope for
> trajectory information and now try to extract the initial neutron
> location within the gas volume.
> 
> Does anyone have an advice on how to do that properly?
> 
> Thanks for your effort!
> 
> -------------------------------------------------------------
> Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or unsubscribe) at: 
> http://hypernews.slac.stanford.edu/HyperNews/geant4/get/geometry/1419.html 

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

1 None: Re: how to tag a particle (neutron) that has just been produced   (Eduard Friske - 26 Jun, 2015)
 Add Message Add Message
to: "Re: how to tag a particle (neutron) that has just been produced"

 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 ]