EIC Software
 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 
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 
42  seed) {
43  Generator gen(seed);
45  ActsFatras::Particle after = before;
46 
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()