Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BetheHeitler.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BetheHeitler.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2021 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
10 
16 
17 #include <algorithm>
18 #include <cmath>
19 #include <utility>
20 
22  const Particle &particle, Scalar gammaE, Scalar rndPsi, Scalar rndTheta1,
23  Scalar rndTheta2, Scalar rndTheta3) const {
24  // ------------------------------------------------------
25  // simple approach
26  // (a) simulate theta uniform within the opening angle of the relativistic
27  // Hertz dipole
28  // theta_max = 1/gamma
29  // (b)Following the Geant4 approximation from L. Urban -> encapsulate that
30  // later
31  // the azimutal angle
32 
33  Scalar psi = 2. * M_PI * rndPsi;
34 
35  // the start of the equation
36  Scalar theta = 0.;
38  // the simplest simulation
39  theta = particle.mass() / particle.energy() * rndTheta1;
40  } else {
41  // ----->
42  theta = particle.mass() / particle.energy();
43  // follow
44  constexpr Scalar a = 0.625; // 5/8
45  Scalar u = -log(rndTheta2 * rndTheta3) / a;
46  theta *= (rndTheta1 < 0.25) ? u : u / 3.; // 9./(9.+27) = 0.25
47  }
48 
49  Vector3 particleDirection = particle.direction();
50  Vector3 photonDirection = particleDirection;
51 
52  // construct the combined rotation to the scattered direction
53  Acts::RotationMatrix3 rotation(
54  // rotation of the scattering deflector axis relative to the reference
55  Acts::AngleAxis3(psi, particleDirection) *
56  // rotation by the scattering angle around the deflector axis
57  Acts::AngleAxis3(theta, Acts::makeCurvilinearUnitU(particleDirection)));
58  photonDirection.applyOnTheLeft(rotation);
59 
60  Particle photon(particle.particleId().makeDescendant(0),
62  photon.setProcess(ActsFatras::ProcessType::eBremsstrahlung)
63  .setPosition4(particle.fourPosition())
64  .setDirection(photonDirection)
65  .setAbsoluteMomentum(gammaE)
67  return photon;
68 }