Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
BetheHeitlerTests.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file BetheHeitlerTests.cpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2018-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
9
#include <boost/test/data/test_case.hpp>
10
#include <boost/test/unit_test.hpp>
11
12
#include "
Acts/Definitions/Algebra.hpp
"
13
#include "
Acts/Definitions/Common.hpp
"
14
#include "
Acts/Definitions/PdgParticle.hpp
"
15
#include "
Acts/Tests/CommonHelpers/FloatComparisons.hpp
"
16
#include "
Acts/Tests/CommonHelpers/PredefinedMaterials.hpp
"
17
#include "
ActsFatras/EventData/Particle.hpp
"
18
#include "
ActsFatras/Physics/ElectroMagnetic/BetheHeitler.hpp
"
19
20
#include <array>
21
#include <random>
22
#include <utility>
23
24
#include "
Dataset.hpp
"
25
26
using
Generator
= std::ranlux48;
27
28
BOOST_DATA_TEST_CASE
(
29
FatrasBetheHeitler,
30
Dataset::momentumPhi
*
Dataset::momentumLambda
*
Dataset::momentumAbs
^
31
Dataset::rngSeed
,
32
phi
, lambda,
p
,
seed
) {
33
Generator
gen
(
seed
);
34
ActsFatras::Particle
before =
35
Dataset::makeParticle
(
Acts::PdgParticle::eElectron
,
phi
, lambda,
p
);
36
ActsFatras::Particle
after = before;
37
38
ActsFatras::BetheHeitler
process
;
39
const
auto
outgoing =
process
(gen,
Acts::Test::makeUnitSlab
(), after);
40
// energy loss changes momentum and energy
41
BOOST_CHECK_LT(after.
absoluteMomentum
(), before.
absoluteMomentum
());
42
BOOST_CHECK_LT(after.
energy
(), before.
energy
());
43
// energy loss creates no new particles
44
BOOST_CHECK_EQUAL(outgoing.size(), 1);
45
BOOST_CHECK_GT(outgoing[0].absoluteMomentum(), 0.);
46
BOOST_CHECK_EQUAL(outgoing[0].pathInX0(), 0.);
47
BOOST_CHECK_EQUAL(outgoing[0].pathInL0(), 0.);
48
49
// Get the four momenta
50
Acts::Vector4
p0 = before.
fourMomentum
();
51
Acts::Vector4
p1 = after.
fourMomentum
();
52
Acts::Vector4
k
= outgoing[0].fourMomentum();
53
54
// Test for similar invariant masses
55
Acts::Vector4
sum
= p1 +
k
;
56
double
s
=
sum
(
Acts::eEnergy
) *
sum
(
Acts::eEnergy
) -
57
sum.template segment<3>(
Acts::eMom0
).
norm
() *
58
sum.template segment<3>(
Acts::eMom0
).
norm
();
59
double
s0 = p0(
Acts::eEnergy
) * p0(
Acts::eEnergy
) -
60
p0.template segment<3>(
Acts::eMom0
).
norm
() *
61
p0.template segment<3>(
Acts::eMom0
).
norm
();
62
CHECK_CLOSE_OR_SMALL
(s, s0, 1
e
-2, 1
e
-2);
63
}
acts
blob
sPHENIX
Tests
UnitTests
Fatras
Physics
BetheHeitlerTests.cpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:45
using
1.8.2 with
sPHENIX GitHub integration