Message: Re: counting particles crossing the boundary Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: counting particles crossing the boundary 

Forum: Event and Track Management
Re: Question counting particles crossing the boundary (Summit)
Date: 18 Feb, 2014
From: Gumplinger Peter <Gumplinger Peter>

>    if(point->GetStepStatus() == fGeomBoundary && thePostPV->GetName()=="Target2") 
>    {
>       inparticlecount ++;
>    }

This counts all tracks that enter Target2 from anywhere, not necessarily only from Target1.

> Approach1:
> 
> if(point->GetStepStatus() == fGeomBoundary && thePrePV->GetName()=="Target2") 
>   {
>    outparticlecount ++;
>    }

This counts all tracks leaving Target2, regardless into where they might go

> Approach2:
> 
> if(point->GetStepStatus() == fGeomBoundary && thePostPV->GetName()=="Target3") 
>    {
>    outparticlecount ++;
>    }

Again, this counts all tracks that arrive at Target3 from anywhere.

Tracks that go from Target1 to Target2 have preStep in Target1 and postStep in Target2.

> And in the method AddTargetStep(const G4Step* step), I have tried to
> find out the tracks with parent ID different than 0 as
> 
> if(GetParentID() != 0)
> 
> then I am not getting any ID. Can anyone suggest me what should I do to
> get parent ID?

Perhaps you don't have any secondary particles.

 Add Message Add Message
to: "Re: counting particles crossing the boundary"

 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 ]