Message: 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 how to tag a particle (neutron) that has just been produced 

Forum: Geometry
Date: 19 Jun, 2015
From: Eduard Friske <Eduard Friske>

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!

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   (John Apostolakis - 19 Jun, 2015)
(_ None: Re: how to tag a particle (neutron) that has just been produced   (Eduard Friske - 26 Jun, 2015)
 Add Message Add Message
to: "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 ]