Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:13:05

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 "Acts/Tests/CommonHelpers/PredefinedMaterials.hpp"
0013 #include "ActsFatras/EventData/Particle.hpp"
0014 #include "ActsFatras/Physics/ElectroMagnetic/BetheBloch.hpp"
0015 
0016 #include <array>
0017 #include <random>
0018 
0019 #include "Dataset.hpp"
0020 
0021 using Generator = std::ranlux48;
0022 
0023 BOOST_DATA_TEST_CASE(FatrasBetheBloch, Dataset::parameters, pdg, phi, theta, p,
0024                      seed) {
0025   Generator gen(seed);
0026   ActsFatras::Particle before = Dataset::makeParticle(pdg, phi, theta, p);
0027   ActsFatras::Particle after = before;
0028 
0029   ActsFatras::BetheBloch process;
0030   const auto outgoing = process(gen, Acts::Test::makeUnitSlab(), after);
0031   // energy loss changes momentum and energy
0032   BOOST_CHECK_LT(after.absoluteMomentum(), before.absoluteMomentum());
0033   BOOST_CHECK_LT(after.energy(), before.energy());
0034   // energy loss creates no new particles
0035   BOOST_CHECK(outgoing.empty());
0036 }