Import Geant4 11.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2024-12-06 11:11:40 +01:00
parent e58e650b32
commit 32390e802b
1984 changed files with 98713 additions and 83996 deletions
@@ -23,27 +23,24 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//---------------------------------------------------------------------
//
// G4BOptnLeadingParticle
//
// Class Description:
// A G4VBiasingOperation that implements the so-called "Leading
// particle biasing scheme". It is of interest in the shield problem
// to estimate the flux leaking from the shield.
// It works as follows:
// - it is intented for hadronic inelastic interaction
// - at each interaction, are kept:
// - the most energetic particle (the leading particle)
// - with unmodified weight
// - randomly one particle of each species
// - with this particle weight = n * primary_weight where
// n is the number of particles of this species
//---------------------------------------------------------------------
// Initial version Nov. 2019 M. Verderi
//
// A G4VBiasingOperation that implements the so-called "Leading
// particle biasing scheme". It is of interest in the shield problem
// to estimate the flux leaking from the shield.
// It works as follows:
// - it is intented for hadronic inelastic interaction
// - at each interaction, are kept:
// - the most energetic particle (the leading particle)
// - with unmodified weight
// - randomly one particle of each species
// - with this particle weight = n * primary_weight where
// n is the number of particles of this species
//
// Author: Marc Verderi, November 2019.
// --------------------------------------------------------------------
#ifndef G4BOptnLeadingParticle_hh
#define G4BOptnLeadingParticle_hh 1
@@ -51,46 +48,53 @@
#include "G4VBiasingOperation.hh"
#include "G4ParticleChange.hh"
class G4BOptnLeadingParticle : public G4VBiasingOperation {
public:
// -- Constructor :
G4BOptnLeadingParticle(G4String name);
// -- destructor:
virtual ~G4BOptnLeadingParticle();
public:
// -- Methods from G4VBiasingOperation interface:
// ----------------------------------------------
// -- Unused:
virtual const G4VBiasingInteractionLaw* ProvideOccurenceBiasingInteractionLaw( const G4BiasingProcessInterface*, G4ForceCondition& ) {return nullptr;}
// -- Used:
virtual G4VParticleChange* ApplyFinalStateBiasing( const G4BiasingProcessInterface*, // -- Method used for this biasing. The related biasing operator
const G4Track*, // -- returns this biasing operation at the post step do it level
const G4Step*, // -- when the wrapped process has won the interaction length race.
G4bool& ); // -- The wrapped process final state is then trimmed.
// -- Unused:
virtual G4double DistanceToApplyOperation( const G4Track*,
G4double,
G4ForceCondition*) {return 0;}
virtual G4VParticleChange* GenerateBiasingFinalState( const G4Track*,
const G4Step* ) {return nullptr;}
class G4BOptnLeadingParticle : public G4VBiasingOperation
{
public:
public:
// -- The possibility is given to further apply a Russian roulette on tracks that are accompagnying the leading particle
// -- after the classical leading particle biasing algorithm has been applied.
// -- This is of interest when applying the technique to e+ -> gamma gamma for example. Given one gamma is leading,
// -- the second one is alone in its category, hence selected. With the Russian roulette it is then possible to keep
// -- this one randomly. This is also of interest for pi0 decays, or for brem. e- -> e- gamma where the e- or gamma
// -- are alone in their category.
void SetFurtherKillingProbability( G4double p ) { fRussianRouletteKillingProbability = p; } // -- if p <= 0.0 the killing is ignored.
G4double GetFurtherKillingProbability() const { return fRussianRouletteKillingProbability; }
// -- Constructor :
G4BOptnLeadingParticle(const G4String& name);
// -- destructor:
virtual ~G4BOptnLeadingParticle();
private:
// -- Particle change used to return the trimmed final state:
G4ParticleChange fParticleChange;
G4double fRussianRouletteKillingProbability;
// -- Methods from G4VBiasingOperation interface:
// ----------------------------------------------
// -- Unused:
virtual const G4VBiasingInteractionLaw*
ProvideOccurenceBiasingInteractionLaw( const G4BiasingProcessInterface*,
G4ForceCondition& ) { return nullptr; }
// -- Used:
virtual G4VParticleChange*
ApplyFinalStateBiasing( const G4BiasingProcessInterface*, // -- Method used for this biasing. The related biasing operator
const G4Track*, // -- returns this biasing operation at the post step do it level
const G4Step*, // -- when the wrapped process has won the interaction length race.
G4bool& ); // -- The wrapped process final state is then trimmed.
// -- Unused:
virtual G4double
DistanceToApplyOperation( const G4Track*, G4double, G4ForceCondition* ) { return 0.0; }
virtual G4VParticleChange*
GenerateBiasingFinalState( const G4Track*, const G4Step* ) { return nullptr; }
// -- The possibility is given to further apply a Russian roulette on tracks that are accompagnying the leading particle
// -- after the classical leading particle biasing algorithm has been applied.
// -- This is of interest when applying the technique to e+ -> gamma gamma for example. Given one gamma is leading,
// -- the second one is alone in its category, hence selected. With the Russian roulette it is then possible to keep
// -- this one randomly. This is also of interest for pi0 decays, or for brem. e- -> e- gamma where the e- or gamma
// -- are alone in their category.
void SetFurtherKillingProbability( G4double p ) // -- if p <= 0.0 the killing is ignored.
{
fRussianRouletteKillingProbability = p;
}
G4double GetFurtherKillingProbability() const
{
return fRussianRouletteKillingProbability;
}
private:
// -- Particle change used to return the trimmed final state:
G4ParticleChange fParticleChange;
G4double fRussianRouletteKillingProbability = -1.0;
};
#endif