Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-17 08:00:59

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include <boost/test/data/test_case.hpp>
0010 #include <boost/test/unit_test.hpp>
0011 
0012 #include "ActsFatras/EventData/Particle.hpp"
0013 #include "ActsFatras/Physics/ElectroMagnetic/BetheBloch.hpp"
0014 #include "ActsTests/CommonHelpers/PredefinedMaterials.hpp"
0015 
0016 #include <array>
0017 #include <random>
0018 
0019 #include "Dataset.hpp"
0020 
0021 using Generator = std::ranlux48;
0022 
0023 namespace ActsTests {
0024 
0025 BOOST_AUTO_TEST_SUITE(PhysicsSuite)
0026 
0027 BOOST_DATA_TEST_CASE(FatrasBetheBloch, Dataset::parameters, pdg, phi, theta, p,
0028                      seed) {
0029   Generator gen(seed);
0030   ActsFatras::Particle before = Dataset::makeParticle(pdg, phi, theta, p);
0031   ActsFatras::Particle after = before;
0032 
0033   ActsFatras::BetheBloch process;
0034   const auto outgoing = process(gen, makeUnitSlab(), after);
0035   // energy loss changes momentum and energy
0036   BOOST_CHECK_LT(after.absoluteMomentum(), before.absoluteMomentum());
0037   BOOST_CHECK_LT(after.energy(), before.energy());
0038   // energy loss creates no new particles
0039   BOOST_CHECK(outgoing.empty());
0040 }
0041 
0042 BOOST_AUTO_TEST_SUITE_END()
0043 
0044 }  // namespace ActsTests