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
EnergyLossTests.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file EnergyLossTests.cpp
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
#include <boost/test/data/test_case.hpp>
10
#include <boost/test/unit_test.hpp>
11
12
#include <random>
13
14
#include "
Acts/Material/MaterialProperties.hpp
"
15
#include "
Acts/Tests/CommonHelpers/PredefinedMaterials.hpp
"
16
#include "
ActsFatras/EventData/Particle.hpp
"
17
#include "
ActsFatras/Physics/EnergyLoss/BetheBloch.hpp
"
18
#include "
ActsFatras/Physics/EnergyLoss/BetheHeitler.hpp
"
19
#include "
Dataset.hpp
"
20
21
using
Generator
= std::ranlux48;
22
23
BOOST_AUTO_TEST_SUITE(FatrasEnergyLoss)
24
25
BOOST_DATA_TEST_CASE
(BetheBloch, Dataset::
parameters
,
pdg
,
phi
,
lambda
,
p
,
26
seed
) {
27
Generator
gen(seed);
28
ActsFatras::Particle
before =
Dataset::makeParticle
(pdg, phi, lambda, p);
29
ActsFatras::Particle
after = before;
30
31
ActsFatras::BetheBloch
process;
32
const
auto
outgoing = process(gen,
Acts::Test::makeUnitSlab
(), after);
33
// energy loss changes momentum and energy
34
BOOST_TEST(after.
absMomentum
() < before.
absMomentum
());
35
BOOST_TEST(after.
energy
() < before.
energy
());
36
// energy loss creates no new particles
37
BOOST_TEST(outgoing.empty());
38
}
39
40
BOOST_DATA_TEST_CASE
(BetheHeitler,
Dataset::parameters
,
pdg
,
phi
,
lambda
,
p
,
41
seed
) {
42
Generator
gen(
seed
);
43
ActsFatras::Particle
before =
Dataset::makeParticle
(
pdg
,
phi
,
lambda
,
p
);
44
ActsFatras::Particle
after = before;
45
46
ActsFatras::BetheHeitler
process;
47
const
auto
outgoing = process(gen,
Acts::Test::makeUnitSlab
(), after);
48
// energy loss changes momentum and energy
49
BOOST_TEST(after.
absMomentum
() < before.
absMomentum
());
50
BOOST_TEST(after.
energy
() < before.
energy
());
51
// energy loss creates no new particles
52
BOOST_TEST(outgoing.empty());
53
}
54
55
BOOST_AUTO_TEST_SUITE_END()
acts
blob
master
Tests
UnitTests
Fatras
Physics
EnergyLossTests.cpp
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:27
using
1.8.2 with
ECCE GitHub integration