34 #define INCLXX_IN_GEANT4_MODE 1
55 void bias(ParticleList &particles,
const ThreeVector &pInVec,
const G4double slope) {
57 const ThreeVector collisionAxis = pInVec/pIn;
58 const ThreeVector pMomVec = biasMe->getMomentum();
60 const G4double pMomCosAng = pMomVec.dot(collisionAxis)/pMom;
65 const G4double cosAngSlope = 2
e-6 * slope * pIn * pMom;
66 const G4double cosAng = 1. + std::log(1. -
Random::shoot()*(1.-std::exp(-2.*cosAngSlope)))/cosAngSlope;
70 const G4double rotationAngle = ang - pMomAng;
74 ThreeVector rotationAxis;
76 rotationAxis = collisionAxis.vector(pMomVec);
77 const G4double axisLength = rotationAxis.mag();
78 const G4double oneOverLength = 1./axisLength;
79 rotationAxis *= oneOverLength;
83 rotationAxis = collisionAxis.anyOrthogonal();
87 particles.rotateMomentum(rotationAngle, rotationAxis);
92 namespace PhaseSpaceGenerator {
94 return thePhaseSpaceGenerator->generate(sqrtS, particles);
101 biasMe = particles[index];
104 bias(particles, pInVec, slope);
108 thePhaseSpaceGenerator =
g;
112 return thePhaseSpaceGenerator;
116 delete thePhaseSpaceGenerator;
117 thePhaseSpaceGenerator = NULL;
void generateBiased(const G4double sqrtS, ParticleList &particles, const size_t index, const G4double slope)
Generate a biased event in the CM system.
PhaseSpaceGeneratorType getPhaseSpaceGeneratorType() const
Get the phase-space-generator type.
Generate momenta using the RauboldLynch method.
void generate(const G4double sqrtS, ParticleList &particles)
Generate an event in the CM system.
static constexpr double g
void setPhaseSpaceGenerator(IPhaseSpaceGenerator *g)
G4double arcCos(const G4double x)
Calculates arccos with some tolerance on illegal arguments.
Generate momenta using the Kopylov method.
Abstract interface for the phase-space generators.
void initialize(Config const *const theConfig)
IPhaseSpaceGenerator * getPhaseSpaceGenerator()
void deletePhaseSpaceGenerator()