File indexing completed on 2025-10-17 08:00:59
0001
0002
0003
0004
0005
0006
0007
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
0036 BOOST_CHECK_LT(after.absoluteMomentum(), before.absoluteMomentum());
0037 BOOST_CHECK_LT(after.energy(), before.energy());
0038
0039 BOOST_CHECK(outgoing.empty());
0040 }
0041
0042 BOOST_AUTO_TEST_SUITE_END()
0043
0044 }