 |
DD4hep
1.36.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
14 #ifndef DDG4_GEANT4ISOTROPEGENERATOR_H
15 #define DDG4_GEANT4ISOTROPEGENERATOR_H
80 static double haltonValue(uint64_t index,
int base);
93 virtual void getParticleDirection(
int num, ROOT::Math::XYZVector& direction,
double& momentum)
const override;
97 void getParticleDirectionEta(
int num,
const std::function<
double(
unsigned int)>& sample, ROOT::Math::XYZVector& direction,
double& momentum)
const;
99 void getParticleDirectionCosTheta(
int num,
const std::function<
double(
unsigned int)>& sample, ROOT::Math::XYZVector& direction,
double& momentum)
const;
101 void getParticleDirectionUniform(
int num,
const std::function<
double(
unsigned int)>& sample, ROOT::Math::XYZVector& direction,
double& momentum)
const;
115 #endif // DDG4_GEANT4ISOTROPEGENERATOR_H
virtual ~Geant4IsotropeGenerator()
Default destructor.
double m_phiMax
Property: Maximal phi angular value.
std::string m_distribution
Property: Distribution name. Default: "uniform". Allowed: "uniform", "cos(theta)",...
uint64_t m_haltonIndex
Current Halton sequence index (incremented per generated particle)
double m_phiMin
Property: Minimal phi angular value.
double m_thetaMax
Property: Maximal theta angular value.
uint64_t m_haltonOffset
Property: Starting index in the Halton sequence (use for parallel-job partitioning)
double m_thetaMin
Property: Minimal theta angular value.
std::function< double(unsigned int)> makeSampler(Geant4Random &rnd) const
Build a per-particle sampler: PRNG or Halton depending on m_halton.
double haltonScrambled(uint64_t index, unsigned int dim) const
Return the scrambled Halton sample for dimension dim (0=phi,1=theta,2=momentum)
Geant4IsotropeGenerator(const Geant4IsotropeGenerator ©)=delete
Inhibit copy constructor.
void sampleMomentum(double h, double &momentum) const
Sample momentum from [m_momentumMin, m_momentumMax] using a pre-computed [0,1) value h.
void initHalton(Geant4Random &rnd) const
Initialize Cranley-Patterson shifts using rnd; set m_haltonIndex = m_haltonOffset.
void getParticleDirectionFFbar(int num, ROOT::Math::XYZVector &direction, double &momentum) const
e+e- --> ffbar particle distribution ~ 1 + cos^2(theta) (PRNG only; incompatible with Halton)
Geant4IsotropeGenerator()=delete
Inhibit default constructor.
std::once_flag m_haltonOnce
Ensures initHalton() runs exactly once across all events.
Mini interface to THE random generator of the application.
const std::string & name() const
Access name of the action.
Generate particles isotrop in space around origine (0,0,0)
static double haltonValue(uint64_t index, int base)
Compute the radical inverse of index in the given base (standard Halton value)
Namespace for the AIDA detector description toolkit.
virtual void getParticleDirection(int num, ROOT::Math::XYZVector &direction, double &momentum) const override
Particle modification. Caller presets defaults to: ( direction = m_direction, momentum = [m_momentumM...
void getParticleDirectionEta(int num, const std::function< double(unsigned int)> &sample, ROOT::Math::XYZVector &direction, double &momentum) const
Flat pseudorapidity (eta) distribution.
void getParticleDirectionCosTheta(int num, const std::function< double(unsigned int)> &sample, ROOT::Math::XYZVector &direction, double &momentum) const
Particle distribution ~ cos(theta)
void getParticleDirectionUniform(int num, const std::function< double(unsigned int)> &sample, ROOT::Math::XYZVector &direction, double &momentum) const
Uniform particle distribution.
Generic context to extend user, run and event information.
Generate particles isotrop in space around origine (0,0,0)
std::array< double, 3 > m_haltonShift
Per-dimension additive scramble shifts in [0,1), sampled from Geant4Random on first use.
Geant4Context * context() const
Access the context.
bool m_halton
Property: Enable scrambled Halton sequence sampling (RQMC mode)