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)
Re: Question Re: counting particles crossing the boundary (Summit)
Date: 28 Feb, 2014
From: Gumplinger Peter <Gumplinger Peter>

>     if(step->GetTrack()->GetParentID() == 0) {
>    G4StepPoint* point = step->GetPostStepPoint();
>    G4StepPoint* point2 = step->GetPreStepPoint();
>    G4VPhysicalVolume* thePostPV = point->GetPhysicalVolume();
>    G4VPhysicalVolume* thePrePV = point2->GetPhysicalVolume();
>    if(thePrePV->GetName()=="Target1" && thePostPV->GetName()=="Target2") {
>    inparticlecount ++;
>    }
>    if(thePrePV->GetName()=="Target2" && thePostPV->GetName()=="Target3") {
>    outparticlecount ++;
>    }
> }

OK, so this counts primary particles (whatever they are) as they enter Target2 from Target1 and leave Target2 into Target3.

> The ratio of inparticlecount and outparticlecount is much
> smaller than quoted by experimentalists in literature.

Well, then there is something wrong with how you set up your geometry and/or initial condition or, if you are confident that your simulation correctly reflects the experiment, there could be something wrong with the physics in Geant4.

> inparticlecount/outparticlecount = (9936/9429) = 1.0538 for 1 cm thick
> target but reverse calculations shows that it should be about 1.0977. I
> have tried in 9.5 and 9.6 versions.

Well, perhaps G4 is not accurate enough at that 5% level.

> Can you please me what should to do to get ratio close to the
> experiments???

You can contact the physics process forum in question, explain what you want to model and ask what might be the best PhysicsList for your problem.

> And in the method AddTargetStep(const G4Step* step), I have tried to
> find out the secondary tracks as:
>    if(step->GetTrack()->GetParentID() != 0)
>    G4cout<<"Secondary particle tracked...!!!\n";
> But I have not got any secondary tracks.

Sure looks like you got no secondary tracks or AddTargetStep is not called for secondaries.

> In the method
> ScoreNewTrack(const G4Track* track), I am getting histograms (Z versus
> Fragmentation Cross Sections). This means that there are secondary
> particles but AddTargetStep() is not able to get these.

No clue.

> What modifications should I made to get parentID???

None: step->GetTrack()->GetParentID()

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

1 None: Re: counting particles crossing the boundary   (Summit - 03 Mar, 2014)
(_ None: Re: counting particles crossing the boundary   (Summit - 15 Apr, 2014)
(_ Feedback: Re: counting particles crossing the boundary   (Gumplinger Peter - 16 Apr, 2014)
 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 ]