ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
Scattering.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file Scattering.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
11
#include <array>
12
#include <random>
13
14
#include "
Acts/Material/MaterialProperties.hpp
"
15
#include "
Acts/Utilities/Definitions.hpp
"
16
#include "
Acts/Utilities/UnitVectors.hpp
"
17
#include "
ActsFatras/EventData/Particle.hpp
"
18
19
namespace
ActsFatras {
20
namespace
detail {
21
25
template
<
typename
scattering_model_t>
26
struct
Scattering
{
28
scattering_model_t
angle
;
29
38
template
<
typename
generator_t>
39
std::array<Particle, 0>
operator()
(generator_t &
generator
,
40
const
Acts::MaterialProperties
&slab,
41
Particle
&
particle
)
const
{
42
// the scattered direction can be computed by rotating the initial
43
// direction around a vector orthogonal to the initial direction, i.e. the
44
// scattering deflector, by the scattering angle. there are an infinite
45
// number of vectors orthogonal to the initial direction. the deflector is
46
// rotated by some angle relative to some fixpoint.
47
//
48
// thus two random angles are required: the random deflector orientation
49
// angle drawn uniformly from the [-pi,pi) range and the scattering angle
50
// drawn from the specific scattering model distribution.
51
52
// draw the random orientation angle
53
const
auto
psi =
54
std::uniform_real_distribution<double>(-
M_PI
,
M_PI
)(generator);
55
// draw the scattering angle
56
const
auto
theta
=
angle
(generator, slab, particle);
57
58
Acts::Vector3D
direction = particle.
unitDirection
();
59
// construct the combined rotation to the scattered direction
60
Acts::RotationMatrix3D
rotation(
61
// rotation of the scattering deflector axis relative to the reference
62
Acts::AngleAxis3D
(psi, direction) *
63
// rotation by the scattering angle around the deflector axis
64
Acts::AngleAxis3D
(
theta
,
Acts::makeCurvilinearUnitU
(direction)));
65
direction.applyOnTheLeft(rotation);
66
particle.
setDirection
(direction);
67
68
// scattering is non-destructive and produces no secondaries
69
return
{};
70
}
71
};
72
73
}
// namespace detail
74
}
// namespace ActsFatras
acts
blob
master
Fatras
include
ActsFatras
Physics
Scattering
detail
Scattering.hpp
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:24
using
1.8.2 with
ECCE GitHub integration