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

Feedback Re: simulation efficiency 

Forum: Event and Track Management
Re: Question simulation efficiency (Sean Turnbull)
Date: 11 Jul, 2011
From: Joel Long <Joel Long>

Hello Sean,

I am somewhat confused as to exactly what you need. Do you really want to know about all the neutrons produced in the whole geometry, or just in a particular volume or two?

Personally, I would suggest using an extension of G4VSensitiveDetector in the region of interest, with some extensions of G4VSDFilter. Counting would happen in ProcessHits(G4Step aStep, ...) and your count could be output in EndOfEventAction or whatever that method is called. Failing this, use G4UserStackingAction rather than G4UserSteppingAction. As it is, the method is called every time any particle takes a step. Granted, you immediately check if it is the first step and return if it isn't, but it's a waste to call the method at all. G4UserStackingAction isn't really designed for what you are doing, but it shouldn't be hard to adapt, and it lets you make your checks *only* when a particle is created. This is probably going to make the smallest footprint on your runtime.

Other than that, your check process looks functional. I would move the check for whether the particle is a primary inside the check for the PDG particle code for the neutron. I assume you have no Au198 primaries, so the check is unnecessary for it, and I would guess that the neutron check will eliminate more candidates than the secondary check, so you could save a bit of time by putting the neutron check on the outside. Alternatively, you could forgo the primary particle check entirely and just subtract the number of primaries at the end, though that is very poor programming practice.

Does this answer your question?

Thanks, Joel

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

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: "Re: 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 ]