Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:13:06

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 #pragma once
0010 
0011 #include <boost/test/data/test_case.hpp>
0012 
0013 #include "Acts/Definitions/PdgParticle.hpp"
0014 #include "Acts/Definitions/Units.hpp"
0015 #include "Acts/Material/MaterialSlab.hpp"
0016 #include "Acts/Tests/CommonHelpers/PredefinedMaterials.hpp"
0017 #include "Acts/Utilities/UnitVectors.hpp"
0018 #include "ActsFatras/EventData/Particle.hpp"
0019 
0020 #include <cstdint>
0021 
0022 namespace Dataset {
0023 
0024 namespace data = boost::unit_test::data;
0025 using namespace Acts::UnitLiterals;
0026 
0027 // particle identity
0028 const auto particlePdg = data::make(std::vector<Acts::PdgParticle>{
0029     Acts::PdgParticle::eElectron,
0030     Acts::PdgParticle::ePositron,
0031     Acts::PdgParticle::eMuon,
0032     Acts::PdgParticle::eAntiMuon,
0033 });
0034 
0035 // kinematic particle parameters
0036 const auto momentumPhi = data::xrange(0_degree, 360_degree, 60_degree);
0037 const auto momentumTheta = data::xrange(-45_degree, 45_degree, 15_degree);
0038 const auto momentumAbs = data::xrange(500_MeV, 10_GeV, 500_MeV);
0039 
0040 // seeds for the random number generator
0041 const auto rngSeed =
0042     data::xrange<std::uint32_t>((data::begin = 2u, data::step = 3u));
0043 
0044 // combined parameter set
0045 const auto parameters =
0046     particlePdg * momentumPhi * momentumTheta * momentumAbs ^ rngSeed;
0047 
0048 const auto parametersPhotonConversion = momentumPhi * momentumTheta ^ rngSeed;
0049 
0050 // utility function to build a particle from the dataset parameters
0051 inline ActsFatras::Particle makeParticle(Acts::PdgParticle pdg, double phi,
0052                                          double theta, double p) {
0053   const auto id = ActsFatras::Barcode().setVertexPrimary(1).setParticle(1);
0054   return ActsFatras::Particle(id, pdg)
0055       .setPosition4(0, 0, 0, 0)
0056       .setDirection(Acts::makeDirectionFromPhiTheta(phi, theta))
0057       .setAbsoluteMomentum(p);
0058 }
0059 
0060 }  // namespace Dataset