9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
31 BOOST_AUTO_TEST_SUITE(FatrasPhotonConversion)
36 using namespace Acts::UnitLiterals;
48 std::pair<Scalar, Scalar> limits;
50 BOOST_CHECK_EQUAL(limits.first, std::numeric_limits<Scalar>::infinity());
51 BOOST_CHECK_EQUAL(limits.second, std::numeric_limits<Scalar>::infinity());
54 std::vector<ActsFatras::Particle> generated;
55 BOOST_CHECK(!pc.run(gen,
particle, generated));
56 BOOST_CHECK(generated.empty());
58 BOOST_CHECK_EQUAL(
particle.fourPosition(), particleInit.fourPosition());
59 BOOST_CHECK_EQUAL(
particle.fourMomentum(), particleInit.fourMomentum());
60 BOOST_CHECK_EQUAL(
particle.process(), particleInit.process());
61 BOOST_CHECK_EQUAL(
particle.properTime(), particleInit.properTime());
62 BOOST_CHECK_EQUAL(
particle.pathInX0(), particleInit.pathInX0());
63 BOOST_CHECK_EQUAL(
particle.pathInL0(), particleInit.pathInL0());
69 using namespace Acts::UnitLiterals;
82 BOOST_CHECK_EQUAL(limits.first, std::numeric_limits<Scalar>::infinity());
83 BOOST_CHECK_EQUAL(limits.second, std::numeric_limits<Scalar>::infinity());
86 std::vector<ActsFatras::Particle> generated;
87 BOOST_CHECK(!pc.run(gen,
particle, generated));
88 BOOST_CHECK(generated.empty());
90 BOOST_CHECK_EQUAL(
particle.fourPosition(), particleInit.fourPosition());
91 BOOST_CHECK_EQUAL(
particle.fourMomentum(), particleInit.fourMomentum());
92 BOOST_CHECK_EQUAL(
particle.process(), particleInit.process());
93 BOOST_CHECK_EQUAL(
particle.properTime(), particleInit.properTime());
94 BOOST_CHECK_EQUAL(
particle.pathInX0(), particleInit.pathInX0());
95 BOOST_CHECK_EQUAL(
particle.pathInL0(), particleInit.pathInL0());
101 using namespace Acts::UnitLiterals;
114 BOOST_CHECK_EQUAL(limits.first, std::numeric_limits<Scalar>::infinity());
115 BOOST_CHECK_EQUAL(limits.second, std::numeric_limits<Scalar>::infinity());
118 std::vector<ActsFatras::Particle> generated;
119 BOOST_CHECK(!pc.run(gen,
particle, generated));
120 BOOST_CHECK(generated.empty());
122 BOOST_CHECK_EQUAL(
particle.fourPosition(), particleInit.fourPosition());
123 BOOST_CHECK_EQUAL(
particle.fourMomentum(), particleInit.fourMomentum());
124 BOOST_CHECK_EQUAL(
particle.process(), particleInit.process());
125 BOOST_CHECK_EQUAL(
particle.properTime(), particleInit.properTime());
126 BOOST_CHECK_EQUAL(
particle.pathInX0(), particleInit.pathInX0());
127 BOOST_CHECK_EQUAL(
particle.pathInL0(), particleInit.pathInL0());
133 using namespace Acts::UnitLiterals;
146 BOOST_CHECK_NE(limits.first, std::numeric_limits<Scalar>::infinity());
147 BOOST_CHECK_EQUAL(limits.second, std::numeric_limits<Scalar>::infinity());
150 std::vector<ActsFatras::Particle> generated;
151 BOOST_CHECK(pc.run(gen,
particle, generated));
152 BOOST_CHECK_EQUAL(generated.size(), 2);
159 BOOST_CHECK_NE(generated[0].
pdg(), generated[1].
pdg());
160 BOOST_CHECK_NE(generated[0].fourMomentum(), Acts::Vector4::Zero());
161 BOOST_CHECK_NE(generated[1].fourMomentum(), Acts::Vector4::Zero());
165 generated[0].fourMomentum() + generated[1].fourMomentum();
168 momVector.norm() * momVector.norm();
169 BOOST_CHECK(std::isfinite(sSum));
172 particleInit.energy() * particleInit.energy() -
173 particleInit.absoluteMomentum() * particleInit.absoluteMomentum();
174 BOOST_CHECK(std::isfinite(sParticle));
178 BOOST_AUTO_TEST_SUITE_END()