34#define INCLXX_IN_GEANT4_MODE 1
61 const G4double pMomCosAng = pMomVec.
dot(collisionAxis)/pMom;
66 const G4double cosAngSlope = 2e-6 * slope * pIn * pMom;
67 const G4double cosAng = 1. + std::log(1. -
Random::shoot()*(1.-std::exp(-2.*cosAngSlope)))/cosAngSlope;
71 const G4double rotationAngle = ang - pMomAng;
77 rotationAxis = collisionAxis.
vector(pMomVec);
79 const G4double oneOverLength = 1./axisLength;
80 rotationAxis *= oneOverLength;
93 namespace PhaseSpaceGenerator {
102 biasMe = particles[index];
106 if(pInVec.
mag() != 0.)
bias(particles, pInVec, slope);
static constexpr double g
PhaseSpaceGeneratorType getPhaseSpaceGeneratorType() const
Get the phase-space-generator type.
Abstract interface for the phase-space generators.
virtual void generate(const G4double sqrtS, ParticleList &particles)=0
Generate an event in the CM frame.
void rotateMomentum(const G4double angle, const ThreeVector &axis) const
const G4INCL::ThreeVector & getMomentum() const
Generate momenta using the Kopylov method.
Generate momenta using the RauboldLynch method.
G4double dot(const ThreeVector &v) const
ThreeVector anyOrthogonal() const
Return a vector orthogonal to this.
ThreeVector vector(const ThreeVector &v) const
G4double arcCos(const G4double x)
Calculates arccos with some tolerance on illegal arguments.
void initialize(Config const *const theConfig)
void setPhaseSpaceGenerator(IPhaseSpaceGenerator *g)
void deletePhaseSpaceGenerator()
void generateBiased(const G4double sqrtS, ParticleList &particles, const size_t index, const G4double slope)
Generate a biased event in the CM system.
IPhaseSpaceGenerator * getPhaseSpaceGenerator()
void generate(const G4double sqrtS, ParticleList &particles)
Generate an event in the CM system.
G4ThreadLocal IPhaseSpaceGenerator * thePhaseSpaceGenerator
void bias(ParticleList &particles, const ThreeVector &pInVec, const G4double slope)
Actually perform the biasing.
G4ThreadLocal Particle * biasMe