File indexing completed on 2025-08-03 08:09:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #define BOOST_TEST_MODULE LimitSelector Tests
0011
0012 #include <boost/test/included/unit_test.hpp>
0013
0014
0015 #include <boost/test/data/test_case.hpp>
0016
0017
0018 #include <boost/test/output_test_stream.hpp>
0019
0020
0021 #include "Acts/Material/Material.hpp"
0022 #include "Acts/Material/MaterialProperties.hpp"
0023 #include "Acts/Utilities/Units.hpp"
0024 #include "Fatras/Selectors/LimitSelectors.hpp"
0025 #include "Particle.hpp"
0026
0027 namespace bdata = boost::unit_test::data;
0028 namespace tt = boost::test_tools;
0029
0030 namespace Fatras {
0031
0032 namespace Test {
0033
0034
0035 Acts::Material berilium = Acts::Material(352.8, 407., 9.012, 4., 1.848e-3);
0036
0037 double m = 134.9766 * Acts::UnitConstants::MeV;
0038
0039
0040 BOOST_AUTO_TEST_CASE(Kinematic_cast_tests) {
0041
0042 Acts::MaterialProperties detector(berilium, 1. * Acts::UnitConstants::mm);
0043
0044
0045 Acts::Vector3D position(0., 0., 0.);
0046
0047 Acts::Vector3D momentum(1500. * Acts::UnitConstants::MeV, 0., 0.);
0048 Particle pion(position, momentum, m, -1.);
0049
0050
0051 pion.setLimits(0.15, 0.45);
0052
0053 pion.update(position, momentum, 0.10, 0.34);
0054
0055 X0Limit x0LimitSelector;
0056 L0Limit l0LimitSelector;
0057
0058 BOOST_CHECK(!x0LimitSelector(detector, pion));
0059 BOOST_CHECK(!l0LimitSelector(detector, pion));
0060
0061 detector = Acts::MaterialProperties(berilium, 150. * Acts::UnitConstants::mm);
0062
0063
0064 BOOST_CHECK(x0LimitSelector(detector, pion));
0065 BOOST_CHECK(l0LimitSelector(detector, pion));
0066 }
0067
0068 }
0069 }