Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:11:19

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2020 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include <boost/test/data/test_case.hpp>
0012 
0013 #include "Acts/Definitions/Units.hpp"
0014 #include "Acts/Surfaces/CylinderSurface.hpp"
0015 #include "Acts/Surfaces/DiscSurface.hpp"
0016 #include "Acts/Surfaces/PerigeeSurface.hpp"
0017 #include "Acts/Surfaces/PlaneSurface.hpp"
0018 #include "Acts/Surfaces/RegularSurface.hpp"
0019 
0020 #include <cmath>
0021 #include <vector>
0022 
0023 namespace {
0024 
0025 namespace bdata = boost::unit_test::data;
0026 using namespace Acts;
0027 
0028 // reference surfaces
0029 // this includes only those surfaces that can take unbounded local positions as
0030 // inputs, i.e. no angles or strictly positive radii.
0031 const auto surfaces =
0032     bdata::make(std::vector<std::shared_ptr<const RegularSurface>>{
0033         Surface::makeShared<CylinderSurface>(
0034             Transform3::Identity(), 10 /* radius */, 100 /* half-length z */),
0035         // TODO perigee roundtrip local->global->local does not seem to work
0036         // Surface::makeShared<PerigeeSurface>(Vector3(0, 0, -1.5)),
0037         Surface::makeShared<PlaneSurface>(Vector3::Zero(), Vector3::UnitX()),
0038         Surface::makeShared<PlaneSurface>(Vector3::Zero(), Vector3::UnitY()),
0039         Surface::makeShared<PlaneSurface>(Vector3::Zero(), Vector3::UnitZ()),
0040     });
0041 // positions
0042 const auto posAngle = bdata::xrange(-M_PI, M_PI, 0.25);
0043 const auto posPositiveNonzero = bdata::xrange(0.25, 1.0, 0.25);
0044 const auto posPositive = bdata::make(0.0) + posPositiveNonzero;
0045 const auto posSymmetric = bdata::xrange(-1.0, 1.0, 0.25);
0046 // time
0047 const auto ts = bdata::make(1.0);
0048 // direction angles
0049 const auto phis = bdata::make({0.0, M_PI, -M_PI, M_PI_2, -M_PI_2});
0050 const auto thetasNoForwardBackward = bdata::xrange(M_PI_4, M_PI, M_PI_4);
0051 const auto thetas = bdata::make({0.0, M_PI}) + thetasNoForwardBackward;
0052 // absolute momenta
0053 const auto ps = bdata::make({1.0, 10.0});
0054 // charges
0055 const auto qsNonZero = bdata::make({-UnitConstants::e, UnitConstants::e});
0056 const auto qsAny = bdata::make({
0057     -2 * UnitConstants::e,
0058     -1 * UnitConstants::e,
0059     0 * UnitConstants::e,
0060     1 * UnitConstants::e,
0061     2 * UnitConstants::e,
0062 });
0063 
0064 }  // namespace