ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BarcodeTests.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BarcodeTests.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 
12 
14 
15 BOOST_AUTO_TEST_SUITE(FatrasBarcode)
16 
17 BOOST_AUTO_TEST_CASE(MakeDescendant) {
18  // initial barcode with primary particle
20  BOOST_TEST(p3.vertexPrimary() == 1u);
21  BOOST_TEST(p3.vertexSecondary() == 2u);
22  BOOST_TEST(p3.particle() == 3u);
23  BOOST_TEST(p3.generation() == 0u);
24  BOOST_TEST(p3.subParticle() == 0u);
25 
26  // generate two first-generation descendants
27  auto p30 = p3.makeDescendant(0);
28  auto p31 = p3.makeDescendant(1);
29  BOOST_TEST(p30.vertexPrimary() == 1u);
30  BOOST_TEST(p30.vertexSecondary() == 2u);
31  BOOST_TEST(p30.particle() == 3u);
32  BOOST_TEST(p30.generation() == 1u);
33  BOOST_TEST(p30.subParticle() == 0u);
34  BOOST_TEST(p31.vertexPrimary() == 1u);
35  BOOST_TEST(p31.vertexSecondary() == 2u);
36  BOOST_TEST(p31.particle() == 3u);
37  BOOST_TEST(p31.generation() == 1u);
38  BOOST_TEST(p31.subParticle() == 1u);
39 
40  // generate two (overlapping) second-generation descendants.
41  auto p300 = p30.makeDescendant(0);
42  auto p310 = p31.makeDescendant(0);
43  BOOST_TEST(p300.vertexPrimary() == 1u);
44  BOOST_TEST(p300.vertexSecondary() == 2u);
45  BOOST_TEST(p300.particle() == 3u);
46  BOOST_TEST(p300.generation() == 2u);
47  BOOST_TEST(p300.subParticle() == 0u);
48  BOOST_TEST(p310.vertexPrimary() == 1u);
49  BOOST_TEST(p310.vertexSecondary() == 2u);
50  BOOST_TEST(p310.particle() == 3u);
51  BOOST_TEST(p310.generation() == 2u);
52  BOOST_TEST(p310.subParticle() == 0u);
53 }
54 
55 BOOST_AUTO_TEST_SUITE_END()