|
DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
45 double x1 = std::sin(theta)*std::cos(phi);
46 double x2 = std::sin(theta)*std::sin(phi);
47 double x3 = std::cos(theta);
49 direction.SetXYZ(x1,x2,x3);
59 double sin_theta = std::sqrt(1.0-cos_theta*cos_theta);
60 double x1 = sin_theta*std::cos(phi);
61 double x2 = sin_theta*std::sin(phi);
62 double x3 = cos_theta;
64 direction.SetXYZ(x1,x2,x3);
71 static double eta(
double x) {
return -1.0*std::log(std::tan(x/2.0)); }
80 double eta = eta_min + (eta_max-eta_min)*rnd.
rndm();
81 double x1 = std::cos(phi);
82 double x2 = std::sin(phi);
83 double x3 = std::sinh(eta);
84 double r = std::sqrt(1.0+x3*x3);
85 direction.SetXYZ(x1/r,x2/r,x3/r);
92 static double ffbar(
double x) {
double c = std::cos(x);
return 1 + c*c; }
102 double vmax = std::max(v1,v2);
104 double dice = rnd.
rndm()*vmax;
106 double dist = Distribution::ffbar(theta);
107 if ( dice <=
dist ) {
108 double x1 = std::sin(theta)*std::cos(phi);
109 double x2 = std::sin(theta)*std::sin(phi);
110 double x3 = std::cos(theta);
111 direction.SetXYZ(x1,x2,x3);
134 except(
"Unknown distribution densitiy: %s. Cannot generate primaries.",
virtual ~Geant4IsotropeGenerator()
Default destructor.
double rndm(int i=0)
Create flat distributed random numbers in the interval ]0,1].
double m_phiMax
Property: Maximal phi angular value.
void getParticleDirectionUniform(int num, ROOT::Math::XYZVector &direction, double &momentum) const
Uniform particle distribution.
std::string m_distribution
Property: Distribution name. Default: "uniform". Allowed: "uniform", "cos(theta)",...
static void increment(T *)
Increment count according to type information.
Geant4Event & event() const
Access the geant4 event – valid only between BeginEvent() and EndEvent()!
Geant4Random & random() const
Access the random number generator.
double m_phiMin
Property: Minimal phi angular value.
double m_thetaMax
Property: Maximal theta angular value.
void getParticleDirectionEta(int num, ROOT::Math::XYZVector &direction, double &momentum) const
e+e- --> ffbar particle distribution ~ 1 + cos^2(theta)
void getParticleDirectionCosTheta(int num, ROOT::Math::XYZVector &direction, double &momentum) const
Particle distribution ~ cos(theta)
double m_thetaMin
Property: Minimal theta angular value.
void except(const char *fmt,...) const
Support of exceptions: Print fatal message and throw runtime_error.
void getParticleMomentumUniform(double &momentum) const
Uniform particle momentum.
void getParticleDirectionFFbar(int num, ROOT::Math::XYZVector &direction, double &momentum) const
e+e- --> ffbar particle distribution ~ 1 + cos^2(theta)
Geant4Action & declareProperty(const std::string &nam, T &val)
Declare property.
static void decrement(T *)
Decrement count according to type information.
Geant4IsotropeGenerator()=delete
Inhibit default constructor.
Mini interface to THE random generator of the application.
Generate particles isotrop in space around origine (0,0,0)
Namespace for the Geant4 based simulation part of the AIDA detector description toolkit.
double dist(const Position &p0, const Position &p1)
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...
User event context for DDG4.
Generic context to extend user, run and event information.
Geant4Context * context() const
Access the context.