Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /acts/Tests/IntegrationTests/PropagationCompareAtlasEigenConstant.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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/data/test_case.hpp>
0010 #include <boost/test/unit_test.hpp>
0011 
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 #include "Acts/MagneticField/ConstantBField.hpp"
0014 #include "Acts/MagneticField/MagneticFieldContext.hpp"
0015 #include "Acts/Propagator/AtlasStepper.hpp"
0016 #include "Acts/Propagator/EigenStepper.hpp"
0017 #include "Acts/Propagator/Propagator.hpp"
0018 
0019 #include <utility>
0020 
0021 #include "PropagationDatasets.hpp"
0022 #include "PropagationTests.hpp"
0023 
0024 namespace {
0025 
0026 namespace ds = ActsTests::PropagationDatasets;
0027 
0028 using namespace Acts;
0029 using namespace UnitLiterals;
0030 
0031 using MagneticField = ConstantBField;
0032 using AtlasStepper = AtlasStepper;
0033 using AtlasPropagator = Propagator<AtlasStepper>;
0034 using EigenStepper = EigenStepper<>;
0035 using EigenPropagator = Propagator<EigenStepper>;
0036 
0037 // absolute parameter tolerances for position, direction, and absolute momentum
0038 constexpr auto epsPos = 1_um;
0039 constexpr auto epsTime = 1_um;
0040 constexpr auto epsDir = 0.125_mrad;
0041 constexpr auto epsMom = 1_eV;
0042 // relative covariance tolerance
0043 constexpr auto epsCov = 0.1;
0044 
0045 const auto geoCtx = GeometryContext::dangerouslyDefaultConstruct();
0046 const MagneticFieldContext magCtx;
0047 
0048 inline std::pair<AtlasPropagator, EigenPropagator> makePropagators(double bz) {
0049   auto field = std::make_shared<MagneticField>(Vector3(0.0, 0.0, bz));
0050   return {AtlasPropagator(AtlasStepper(field)),
0051           EigenPropagator(EigenStepper(field))};
0052 }
0053 
0054 }  // namespace
0055 
0056 BOOST_AUTO_TEST_SUITE(PropagationCompareAtlasEigenConstant)
0057 
0058 BOOST_DATA_TEST_CASE(Forward,
0059                      ds::phi*(ds::thetaWithoutBeam)*ds::absMomentum*
0060                          ds::chargeNonZero* ds::pathLength* ds::magneticField,
0061                      phi, theta, p, q, s, bz) {
0062   auto [atlasPropagator, eigenPropagator] = makePropagators(bz);
0063   runForwardComparisonTest(
0064       atlasPropagator, eigenPropagator, geoCtx, magCtx,
0065       makeParametersCurvilinearWithCovariance(phi, theta, p, q), s, epsPos,
0066       epsTime, epsDir, epsMom, epsCov);
0067 }
0068 
0069 BOOST_DATA_TEST_CASE(ToCylinderAlongZ,
0070                      ds::phi* ds::thetaWithoutBeam* ds::absMomentum*
0071                          ds::chargeNonZero* ds::pathLength* ds::magneticField,
0072                      phi, theta, p, q, s, bz) {
0073   auto [atlasPropagator, eigenPropagator] = makePropagators(bz);
0074   runToSurfaceComparisonTest(
0075       atlasPropagator, eigenPropagator, geoCtx, magCtx,
0076       makeParametersCurvilinearWithCovariance(phi, theta, p, q), s,
0077       ZCylinderSurfaceBuilder(), epsPos, epsTime, epsDir, epsMom, epsCov);
0078 }
0079 
0080 BOOST_DATA_TEST_CASE(
0081     ToDisc,
0082     ds::phiWithoutAmbiguity* ds::thetaWithoutBeam* ds::absMomentum*
0083         ds::chargeNonZero* ds::pathLength* ds::magneticField,
0084     phi, theta, p, q, s, bz) {
0085   auto [atlasPropagator, eigenPropagator] = makePropagators(bz);
0086   runToSurfaceComparisonTest(
0087       atlasPropagator, eigenPropagator, geoCtx, magCtx,
0088       makeParametersCurvilinearWithCovariance(phi, theta, p, q), s,
0089       DiscSurfaceBuilder(), epsPos, epsTime, epsDir, epsMom, epsCov);
0090 }
0091 
0092 BOOST_DATA_TEST_CASE(ToPlane,
0093                      ds::phi* ds::thetaWithoutBeam* ds::absMomentum*
0094                          ds::chargeNonZero* ds::pathLength* ds::magneticField,
0095                      phi, theta, p, q, s, bz) {
0096   auto [atlasPropagator, eigenPropagator] = makePropagators(bz);
0097   runToSurfaceComparisonTest(
0098       atlasPropagator, eigenPropagator, geoCtx, magCtx,
0099       makeParametersCurvilinearWithCovariance(phi, theta, p, q), s,
0100       PlaneSurfaceBuilder(), epsPos, epsTime, epsDir, epsMom, epsCov);
0101 }
0102 
0103 BOOST_DATA_TEST_CASE(ToStrawAlongZ,
0104                      ds::phi* ds::thetaWithoutBeam* ds::absMomentum*
0105                          ds::chargeNonZero* ds::pathLength* ds::magneticField,
0106                      phi, theta, p, q, s, bz) {
0107   auto [atlasPropagator, eigenPropagator] = makePropagators(bz);
0108   runToSurfaceComparisonTest(
0109       atlasPropagator, eigenPropagator, geoCtx, magCtx,
0110       makeParametersCurvilinearWithCovariance(phi, theta, p, q), s,
0111       ZStrawSurfaceBuilder(), epsPos, epsTime, epsDir, epsMom, epsCov);
0112 }
0113 
0114 BOOST_AUTO_TEST_SUITE_END()