Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-17 07:47:50

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include <boost/test/unit_test.hpp>
0010 
0011 #include "Acts/EventData/TrackContainer.hpp"
0012 #include "Acts/EventData/VectorMultiTrajectory.hpp"
0013 #include "Acts/EventData/VectorTrackContainer.hpp"
0014 #include "ActsExamples/EventData/Jets.hpp"
0015 
0016 using namespace Acts;
0017 using namespace ActsExamples;
0018 
0019 namespace ActsTests {
0020 
0021 BOOST_AUTO_TEST_SUITE(FastJetSuite)
0022 
0023 BOOST_AUTO_TEST_CASE(TruthParticleOneJet) {
0024   ActsExamples::SimBarcode barcode;
0025   ActsExamples::TruthJet jet(Acts::Vector4(100, 0, 0, 100),
0026                              ActsExamples::JetLabel::Unknown);
0027   jet.setConstituents(std::vector<ActsExamples::SimBarcode>{barcode});
0028   BOOST_CHECK_EQUAL(jet.constituents().size(), 1);
0029   BOOST_CHECK_EQUAL(jet.constituents()[0], barcode);
0030 }
0031 
0032 BOOST_AUTO_TEST_CASE(SingleTrackJet) {
0033   Acts::TrackContainer tracks{VectorTrackContainer{}, VectorMultiTrajectory{}};
0034   auto track = tracks.makeTrack();
0035 
0036   track.parameters()[Acts::eBoundLoc0] = 10.0;
0037   track.parameters()[Acts::eBoundLoc1] = 0.0;
0038   track.parameters()[Acts::eBoundTime] = 0.0;
0039 
0040   auto constTrack = tracks.getTrack(0);
0041   AnyConstTrackProxy anyConstTrack(constTrack);
0042 
0043   std::vector<Acts::AnyConstTrackProxy> constituents{anyConstTrack};
0044 
0045   ActsExamples::TrackJet jet(Acts::Vector4(100, 0, 0, 100),
0046                              ActsExamples::JetLabel::Unknown);
0047   std::vector<Acts::AnyConstTrackProxy> jetConstituents;
0048   jetConstituents.push_back(anyConstTrack);
0049   jet.setConstituents(jetConstituents);
0050 
0051   BOOST_CHECK_EQUAL(jet.constituents().size(), 1);
0052   BOOST_CHECK(jet.constituents()[0].index() == tracks.getTrack(0).index());
0053 }
0054 
0055 BOOST_AUTO_TEST_SUITE_END()
0056 
0057 }  // namespace ActsTests