EIC Software
Reference for
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 "
Acts/Material/MaterialSlab.hpp
"
13
#include "
Acts/Tests/CommonHelpers/PredefinedMaterials.hpp
"
14
#include "
ActsFatras/EventData/Particle.hpp
"
15
#include "
ActsFatras/Physics/EnergyLoss/BetheBloch.hpp
"
16
#include "
ActsFatras/Physics/EnergyLoss/BetheHeitler.hpp
"
17
18
#include <random>
19
20
#include "
Dataset.hpp
"
21
22
using
Generator
= std::ranlux48;
23
24
BOOST_AUTO_TEST_SUITE(FatrasEnergyLoss)
25
26
BOOST_DATA_TEST_CASE
(BetheBloch, Dataset::
parameters
,
pdg
,
phi
, lambda,
p
,
27
seed) {
28
Generator
gen(seed);
29
ActsFatras::Particle
before =
Dataset::makeParticle
(pdg, phi, lambda, p);
30
ActsFatras::Particle
after = before;
31
32
ActsFatras::BetheBloch
process;
33
const
auto
outgoing = process(gen,
Acts::Test::makeUnitSlab
(), after);
34
// energy loss changes momentum and energy
35
BOOST_CHECK_LT(after.
absMomentum
(), before.
absMomentum
());
36
BOOST_CHECK_LT(after.
energy
(), before.
energy
());
37
// energy loss creates no new particles
38
BOOST_CHECK(outgoing.empty());
39
}
40
41
BOOST_DATA_TEST_CASE
(BetheHeitler,
Dataset::parameters
,
pdg
,
phi
, lambda,
p
,
42
seed) {
43
Generator
gen(seed);
44
ActsFatras::Particle
before =
Dataset::makeParticle
(
pdg
,
phi
, lambda,
p
);
45
ActsFatras::Particle
after = before;
46
47
ActsFatras::BetheHeitler
process;
48
const
auto
outgoing = process(gen,
Acts::Test::makeUnitSlab
(), after);
49
// energy loss changes momentum and energy
50
BOOST_CHECK_LT(after.
absMomentum
(), before.
absMomentum
());
51
BOOST_CHECK_LT(after.
energy
(), before.
energy
());
52
// energy loss creates no new particles
53
BOOST_CHECK(outgoing.empty());
54
}
55
56
BOOST_AUTO_TEST_SUITE_END()
acts
blob
sPHENIX
Tests
UnitTests
Fatras
Physics
EnergyLossTests.cpp
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:28
using
1.8.2 with
EIC GitHub integration