File indexing completed on 2025-08-03 08:09:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #define BOOST_TEST_MODULE KinemtaicCast 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/Utilities/Units.hpp"
0022 #include "Fatras/Selectors/KinematicCasts.hpp"
0023 #include "Particle.hpp"
0024
0025 namespace bdata = boost::unit_test::data;
0026 namespace tt = boost::test_tools;
0027
0028 namespace Fatras {
0029
0030 namespace Test {
0031
0032 double m = 134.9766 * Acts::units::_MeV;
0033
0034
0035 BOOST_AUTO_TEST_CASE(Kinematic_cast_tests) {
0036
0037
0038 Acts::Vector3D position(0., 0., 0.);
0039 Acts::Vector3D momentumCentral(1500. * Acts::units::_MeV, 0., 0.);
0040 Particle pionCentral(position, momentumCentral, m, -1.);
0041
0042
0043 Acts::Vector3D positionFwd(0., 0., 100.);
0044 Acts::Vector3D momentumFwd(10. * Acts::units::_MeV, 10. * Acts::units::_MeV,
0045 1500. * Acts::units::_MeV);
0046 Particle pionFwd(positionFwd, momentumFwd, m, -1.);
0047
0048
0049 casts::eta eta_c;
0050 casts::absEta absEta_c;
0051 casts::pT pT_c;
0052 casts::p p_c;
0053 casts::E E_c;
0054 casts::vR vR_c;
0055 casts::vZ vZ_c;
0056
0057
0058 BOOST_TEST(eta_c(pionCentral) == 0., tt::tolerance(1e-10));
0059 BOOST_TEST(absEta_c(pionCentral) == 0., tt::tolerance(1e-10));
0060 BOOST_TEST(pT_c(pionCentral), 1500. * Acts::units::_MeV);
0061 BOOST_TEST(p_c(pionCentral), 1500. * Acts::units::_MeV);
0062 BOOST_CHECK(E_c(pionCentral) > p_c(pionCentral));
0063
0064 BOOST_CHECK_CLOSE(vR_c(pionCentral), 0., 10e-5);
0065 BOOST_CHECK_CLOSE(vZ_c(pionCentral), 0., 10e-5);
0066
0067
0068 BOOST_CHECK(eta_c(pionFwd) > eta_c(pionCentral));
0069 BOOST_TEST(vZ_c(pionFwd), 100. * Acts::units::_MeV);
0070 }
0071
0072 }
0073 }