EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Highland.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Highland.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018-2020 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 
9 #pragma once
10 
13 
14 #include <random>
15 
16 namespace ActsFatras {
17 namespace detail {
18 
23 struct Highland {
32  template <typename generator_t>
33  double operator()(generator_t &generator, const Acts::MaterialSlab &slab,
34  Particle &particle) const {
35  // compute the planar scattering angle
36  const auto theta0 = Acts::computeMultipleScatteringTheta0(
37  slab, particle.pdg(), particle.mass(),
38  particle.charge() / particle.absMomentum(), particle.charge());
39  // draw from the normal distribution representing the 3d angle distribution
40  return std::normal_distribution<double>(0.0, M_SQRT2 * theta0)(generator);
41  }
42 };
43 
44 } // namespace detail
45 
47 
48 } // namespace ActsFatras