ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LimitSelectorsTests.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file LimitSelectorsTests.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018-2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #include <boost/test/unit_test.hpp>
10 
14 #include "Dataset.hpp"
15 
16 namespace {
17 // Construct a particle that is close to its X0/L0 path limit.
18 //
19 // Passing a thin slab should still be Ok, but the thick slab should not.
20 ActsFatras::Particle makeParticleCloseToLimit() {
21  // create particle and move it close to the X0/L0 limit
23  particle.setMaterialPassed(0.125, 0.0125);
24  // limit is a bit above 1% in radiation/interaction length
25  particle.setMaterialLimits(0.125 + 0.0125, 0.0125 + 0.0125);
26  return particle;
27 }
28 } // namespace
29 
30 BOOST_AUTO_TEST_SUITE(LimitSelectors)
31 
32 BOOST_AUTO_TEST_CASE(PathLimitX0) {
34  auto particle = makeParticleCloseToLimit();
35  // particle is still within limits for thin block
36  BOOST_TEST(not select(particle, Acts::Test::makePercentSlab()));
37  // particle would pass limits for thick block
38  BOOST_TEST(select(particle, Acts::Test::makeUnitSlab()));
39 }
40 
41 BOOST_AUTO_TEST_CASE(PathLimitL0) {
43  auto particle = makeParticleCloseToLimit();
44  // particle is still within limits for thin block
45  BOOST_TEST(not select(particle, Acts::Test::makePercentSlab()));
46  // particle would pass limits for thick block
47  BOOST_TEST(select(particle, Acts::Test::makeUnitSlab()));
48 }
49 
50 BOOST_AUTO_TEST_SUITE_END()