Message: simulation efficiency Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question simulation efficiency 

Forum: Event and Track Management
Date: 11 Jul, 2011
From: Sean Turnbull <Sean Turnbull>

Hi all,

I am wanting to count the number of neutrons and Au198 isotopes produced during my simulation and displayed at the end of the run.

Whilst I can do this in SteppingAction and pass the counts to EndofRunAction, I am wondering is this the fastest method to use? There are quite a number of neutrons produced hence not wanting the count event by event and only the end result. I have this:

void SteppingAction::UserSteppingAction(const G4Step* aStep)
{
// ----------------------------------------------------------------------------
  G4Track* fTrack = aStep->GetTrack();

    if ( fTrack->GetCurrentStepNumber() != 1) return;
      //- check for this is not a primary particle. e.g. ParentID > 0 .
    if ( fTrack->GetParentID() == 0 ) return;

    G4double particleValue = G4double(fTrack->GetDefinition()->GetPDGEncoding());

   if (particleValue == 2112)
    {
        ncount++;
        runAction->neutronCount(ncount);
    }
    if ( particleValue == 1000791980 )
    {
        acount++;
        runAction->auCount(acount);
    }
}

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

1 Idea: Re: simulation efficiency   (Zach Hartwig - 11 Jul, 2011)
1 Ok: Re: simulation efficiency   (Joel Long - 11 Jul, 2011)
(_ Agree: Re: simulation efficiency   (Zach Hartwig - 11 Jul, 2011)
2 Feedback: Re: simulation efficiency   (Joel Long - 11 Jul, 2011)
1 Feedback: Re: simulation efficiency   (Sean Turnbull - 11 Jul, 2011)
(_ Feedback: Re: simulation efficiency   (Sean Turnbull - 11 Jul, 2011)
(_ Ok: Re: simulation efficiency   (Joel Long - 11 Jul, 2011)
 Add Message Add Message
to: "simulation efficiency"

 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 ]