Message: scoring flux based on process Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question scoring flux based on process 

Forum: Biasing and Scoring
Date: 18 Nov, 2014
From: lalageh <lalageh>

Hello all,

I am scoring flux in a water phantom for 178 MeV proton beam using Geant4.10 p02. I have filters based on particle type (I am filtering flux for gamma). But I'd like to know how to filter it based on physics processes? Currently I have the following code for "conversion" process. But, it does not give me the flux of gammas that undergo "conversion"! I think it is giving the flux of secondary particles that are produced by conversion.

How can I have the flux of particles that undergo a specific physics process? Can anyone help me please

Thank you

Here is my code:

G4bool FluxCell_Gamma_conv::ProcessHits(G4Step* aStep,G4TouchableHistory*)
{
  G4String CPName;
if(aStep->GetPostStepPoint()->GetProcessDefinedStep()!=0)
CPName = aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName();  
  if(CPName=="conv")
    {
      G4double stepLength = aStep->GetStepLength();
      if ( stepLength == 0. ) return FALSE;

      G4int idx = ((G4TouchableHistory*)
		   (aStep->GetPreStepPoint()->GetTouchable()))
	->GetReplicaNumber(indexDepth);
      if(idx<0) {idx=0;}
      G4double cubicVolume = ComputeVolume(aStep, idx);
      G4double CellFlux1 = stepLength/ cubicVolume;
      if (weighted) CellFlux1 *= aStep->GetPreStepPoint()->GetWeight(); 
      G4int index = GetIndex(aStep);
      EvtMap->add(index,CellFlux1);
      return TRUE;
    }
  else
    return FALSE;
}

 Add Message Add Message
to: "scoring flux based on process"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews