Generic Event Biasing

Introduction

This section presents the generic biasing classes which have been introduced since release 10.0. Theses classes are meant to virtually allow any type of process-level based biasing.

In 10.0 and 10.1, only PostStep biasing actions are possible, which allows:

  • Physics process biasing of:

    • occurrence law, i.e. biasing acting on the process PostStepGetPhysicalInteractionLength(...) level;

    • final state production, i.e. biasing acting on the process PostStepDoIt(...)

  • Biasing of non-physics type:

    • Where by that we mean biasing actions which act on particles, but are not modifying a physics process behaviour

    • Splitting and killing are the important example of such cases

Design of Generic Biasing

We have decided to split the actual biasing actions (change probability occurrence of a process, change its final state generation, split, kill, etc…) from the decisions about these actions to be taken. The reason for this is that several biasing actions are often needed to build one biasing technique, these actions having to be selected along some specific logic of the technique.

For example, a technique like the “force collision” of MCNP involves a splitting, a force interaction of one copy in the volume and a force free flight (under zero weight) of the other copy in the volume.

The classes which provides the interfaces for these biasing actions and decisions are respectively:

  • G4VBiasingOperation

  • G4VBiasingOperator

A third class, G4BiasingProcessInterface provides the interface between these classes and the stepping.

The G4VBiasingOperation Interface Class

G4VBiasingOperation defines two types of methods:

  • methods for physics-based biasing:

    • virtual const G4VBiasingInteractionLaw* ProvideOccurenceBiasingInteractionLaw( const G4BiasingProcessInterface* /* callingProcess */, G4ForceCondition& /* proposeForceCondition */ ) = 0;

    • virtual G4VParticleChange* ApplyFinalStateBiasing( const G4BiasingProcessInterface* /* callingProcess */, const G4Track* /* track */, const G4Step* /* step */, G4bool& /* forceBiasedFinalState */) = 0;

      • which is meant for final state biasing.

      • the biasing operation gets called (by the G4BiasingProcessInterface callingProcess) and has to return a biased particle change. This one should take care of providing the proper weight values for the biasing applied.

  • methods for non-physics biasing:

    • virtual G4double DistanceToApplyOperation( const G4Track* /* track */, G4double /* previousStepSize */, G4ForceCondition* /* condition */) = 0;

      • which returns the distance at which the operation must be applied, and returns also the force condition for this.

      • the returned values (distance, force condition) are returned to the stepping manager by the the G4BiasingProcessInterface callingProcess to make the biasing operation to compete for limiting the step.

    • virtual G4VParticleChange* GenerateBiasingFinalState( const G4Track* /* track */, const G4Step* /* step */) = 0;

      • called if the operation has limited the step.

      • must return the final state generated by the operation.

The G4VBiasingOperator Interface Class

The G4VBiasingOperator class is meant to define the interface to pilot biasing operations. It selects biasing operations or sequences of biasing operations to build up the logic of a specific biasing technique. It is messaged by each G4BiasingProcessInterface callingProcess instance, which pass their “identity” through their own pointer values. The operator has hence all the necessary information for taking decisions.

In addition, since 10.1, the G4BiasingProcessInterface callingProcess instances do “anticipated” calls to their underneath wrapped physics process (if any) : the first of the G4BiasingProcessInterface callingProcess instance, trigger calls to all PostStepGetPhysicalInteractionLength(...) methods of biased processes. In this way, all process cross-sections have been updated before the first call to the biasing operator. This one has hence all ready-to-use physics information the first it is messaged in the step by the first G4BiasingProcessInterface callingProcess instance.

The G4VBiasingOperator class defines the following interface:

  • virtual G4VBiasingOperation* ProposeNonPhysicsBiasingOperation( const G4Track* track, const G4BiasingProcessInterface* callingProcess ) = 0;

    • This method is called by each G4BiasingProcessInterface instance which does not hold/wrap a physics process.

    • The G4VBiasingOperation returned will have its DistanceToApplyOperation(...) and GenerateBiasingFinalState(...) methods called at proper times (post step GPIL and post step DoIt times, respectively) by the G4BiasingProcessInterface callingProcess .

  • virtual G4VBiasingOperation* ProposeOccurenceBiasingOperation( const G4Track* track, const G4BiasingProcessInterface* callingProcess ) = 0;

    • The G4VBiasingOperation returned will have its ProvideOccurenceBiasingInteractionLaw(...) called to get the biased interaction law to be used.

    • This method is called at the PostStepGetPhysicalInteractionLength(...) level.

  • virtual G4VBiasingOperation* ProposeFinalStateBiasingOperation( const G4Track* track, const G4BiasingProcessInterface* callingProcess ) = 0;

    • The G4VBiasingOperation returned will have its ApplyFinalStateBiasing(...) called to generated the physics-based biased final state.

    • This method is called at the PostStepDoIt(...) level.

Physics Process Occurrence Biasing

The occurrence biasing is the biasing which affects the probability for a physics process to occur. For now, we discuss only the case of neutral particles, i.e., having no continuous energy loss along a step. The case of charged particles is expected to be treated in later releases.

The process occurrence is driven by the exponential law, which parameter in Geant4 is the process mean free path \(\lambda\), which is also the inverse of the cross-section \(\sigma\). The (analog or natural) probability density function (pdf) of interactions is given by \(p_\mathrm{a}(l) = \sigma_\mathrm{a} \exp(-\sigma_\mathrm{a}l)\), where \(l\) is the distance at which the interaction occurs, and where we have relabelled \(\sigma\) as \(\sigma_\mathrm{a}\). In Geant4, volumes are made of a single material, meaning that \(\sigma_\mathrm{a}\) does not depend on \(l\) : at some position, starting point of a step, the track “sees” the same cross-section at all positions \(l\) in the volume.

The occurrence biasing consists in substituting \(p_\mathrm{a}(l)\) by some arbitrary biased interaction law \(p_\mathrm{b}(l)\).

Formalism for occurrence biasing

More details about the formalism will be provided in the physics reference manual biasing related part (to come).

An arbitrary interaction law \(p_\mathrm{b}(l)\) can be recasted in term of an “effective” cross-section \(\sigma_\mathrm{b}(l)\), which depends on \(l\) in general, as

  • \(p_\mathrm{b}(l) = \sigma_b(l) \exp(-\int \sigma_\mathrm{b}(s)ds\) , where the integration runs over \([0,l]\),

  • where \(\sigma_\mathrm{b}(l)\) is given by \(\sigma_\mathrm{b}(l) = p_\mathrm{b}(l) / P_\mathrm{NI,b}(l)\)

  • where \(P_\mathrm{NI,b}(l)\) is the probability for non-interaction along segment \([0,l]\) and is given by \(P_\mathrm{NI,b}(L)l= 1-l p_\mathrm{b}(s)ds = \exp(-\int \sigma_\mathrm{b}(s) \mathrm{d}s)\) where the integration runs over \([0,l]\).

which is the formalism that corresponds to non-constant cross-sections.

When applying this formalism to the analog pdf \(p_\mathrm{a}(l)\), we simply have \(\sigma_\mathrm{b}(l) = \sigma_\mathrm{a}\) and \(P_\mathrm{NI,b}(l) = \exp (-\sigma_\mathrm{a}l)\) , as this must.

In contrast with the analog case, the “effective” cross-section may depend on \(l\), even in a volume made of single material. An example of this is the forced interaction: if it is decided that the interaction of a process, with analog cross-section \(\sigma_\mathrm{a}\) , will be forced and will happen somewhere on the segment \([0,L]\), then we have

  • Forced interaction over segment \([0,L]\) case:

  • \(p_\mathrm{b}(l) = \sigma_\mathrm{a} \exp (-\sigma_\mathrm{a} l / (1- \exp(-\sigma_\mathrm{a}L))\) ,

  • \(P_\mathrm{NI,b}(l) = 1 - (1-\exp( -\sigma_\mathrm{a} l))/(1-\exp(-\sigma_\mathrm{a} L))\) ,

  • \(\sigma_\mathrm{b}(l) = \sigma_\mathrm{a} / (1-\exp(- \sigma_\mathrm{a} (L-l))\) .

In the occurrence biasing, two weights have to be taken into account:

  • When the track travels from 0 to \(l\) without interaction, it has a different probability to do so in the biased and analog schemes, meaning that a weight for non-interaction has to be applied, this weight being:

    \(w_\mathrm{NI} = P_\mathrm{NI,a}(l) / P_\mathrm{NI,b}(l)\) .

    If several processes are biased, each with a dedicated law, then, as the total probability for non-interaction is the product of individual probabilities, the total non-interaction weight is simply the product of the individual weights. This non-interaction weight has hence to be applied for all biased processes.

  • If the track then makes an interaction in the next segment \(dl\) the analog process would have a probability \(\sigma_\mathrm{a} dl\) to do so, while this probability is \(\sigma_\mathrm{b}(l) dl\) for the biased process. A weight for interaction has hence to applied and is

    \(w_\mathrm{I} = \sigma_\mathrm{a} / \sigma_\mathrm{b}(l)\) ,

    where the analog and biased cross-sections are for the process which is taking place.

Implementation of Occurrence Biasing

Previous section shows that weights for non-interaction probability and effective cross-section are needed to compute the related non-interaction and interaction weights. The class G4VBiasingInteractionLaw is the interface for implementing “interaction laws”, it defines the pure virtual methods

  • virtual G4double ComputeNonInteractionProbabilityAt(G4double length) const = 0;

  • virtual G4double ComputeEffectiveCrossSectionAt(G4double length) const = 0;

that are used in these weights calculations. It defines also the pure virtual method:

  • virtual G4double SampleInteractionLength() = 0;

In the case of the occurrence biasing, the dedicated virtual const G4VBiasingOperation::ProvideOccurenceBiasingInteractionLaw( const G4BiasingProcessInterface* callingProcess, G4ForceCondition& proposeForceCondition ) = 0; is meant to return the biased law. The G4BiasingProcessInterface will not change the state of the law. It will collect the sampled interaction length (that the biasing operation must have asked to law to sample) and will used the non-interaction probability method in its AlongStepDoIt(...) to compute the weight for non-interaction, these weight being multiplied among biased processes, and it will use the effective cross-section of process “i”, if process “i” wins the interaction length race, in its PostStepDoIt(...) to compute the weight for interaction.

To compute these weights, the G4BiasingProcessInterface holds a private interaction law, to which it sets the analog process cross-section that it collects at the beginning of the step.

As occurrence biasing and final state biasing are independent operations, the weight correction for interaction due to the occurrence biasing is applied on top of the final state generated by the process (this final state being biased or not).