File indexing completed on 2025-01-18 09:12:14
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "ActsFatras/Physics/ElectroMagnetic/BetheHeitler.hpp"
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/PdgParticle.hpp"
0013 #include "Acts/Utilities/UnitVectors.hpp"
0014 #include "ActsFatras/EventData/Barcode.hpp"
0015 #include "ActsFatras/EventData/ProcessType.hpp"
0016
0017 #include <algorithm>
0018 #include <cmath>
0019 #include <numbers>
0020 #include <utility>
0021
0022 ActsFatras::Particle ActsFatras::BetheHeitler::bremPhoton(
0023 const Particle &particle, double gammaE, double rndPsi, double rndTheta1,
0024 double rndTheta2, double rndTheta3) const {
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 double psi = 2. * std::numbers::pi * rndPsi;
0035
0036
0037 double theta = 0.;
0038 if (uniformHertzDipoleAngle) {
0039
0040 theta = particle.mass() / particle.energy() * rndTheta1;
0041 } else {
0042
0043 theta = particle.mass() / particle.energy();
0044
0045 constexpr double a = 0.625;
0046 double u = -log(rndTheta2 * rndTheta3) / a;
0047 theta *= (rndTheta1 < 0.25) ? u : u / 3.;
0048 }
0049
0050 Acts::Vector3 particleDirection = particle.direction();
0051 Acts::Vector3 photonDirection = particleDirection;
0052
0053
0054 Acts::RotationMatrix3 rotation(
0055
0056 Acts::AngleAxis3(psi, particleDirection) *
0057
0058 Acts::AngleAxis3(theta, Acts::makeCurvilinearUnitU(particleDirection)));
0059 photonDirection.applyOnTheLeft(rotation);
0060
0061 Particle photon(particle.particleId().makeDescendant(0),
0062 Acts::PdgParticle::eGamma);
0063 photon.setProcess(ActsFatras::ProcessType::eBremsstrahlung)
0064 .setPosition4(particle.fourPosition())
0065 .setDirection(photonDirection)
0066 .setAbsoluteMomentum(gammaE)
0067 .setReferenceSurface(particle.referenceSurface());
0068 return photon;
0069 }