Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /acts/Tests/IntegrationTests/PropagationCompareEigenStraightLine.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/EigenStepper.hpp"
0016 #include "Acts/Propagator/Propagator.hpp"
0017 #include "Acts/Propagator/StraightLineStepper.hpp"
0018 
0019 #include "PropagationDatasets.hpp"
0020 #include "PropagationTests.hpp"
0021 
0022 namespace {
0023 
0024 namespace ds = ActsTests::PropagationDatasets;
0025 using namespace Acts::UnitLiterals;
0026 
0027 using MagneticField = Acts::ConstantBField;
0028 using EigenStepper = Acts::EigenStepper<>;
0029 using EigenPropagator = Acts::Propagator<EigenStepper>;
0030 using StraightLineStepper = Acts::StraightLineStepper;
0031 using StraightLinePropagator = Acts::Propagator<StraightLineStepper>;
0032 
0033 // absolute parameter tolerances for position, direction, and absolute momentum
0034 constexpr auto epsPos = 1_um;
0035 constexpr auto epsDir = 0.125_mrad;
0036 constexpr auto epsMom = 1_eV;
0037 // relative covariance tolerance
0038 constexpr auto epsCov = 0.00125;
0039 
0040 const Acts::GeometryContext geoCtx;
0041 const Acts::MagneticFieldContext magCtx;
0042 
0043 constexpr auto bz = 2_T;
0044 
0045 const auto magFieldZero =
0046     std::make_shared<MagneticField>(Acts::Vector3::Zero());
0047 const auto magFieldNonZero =
0048     std::make_shared<MagneticField>(Acts::Vector3::UnitZ() * bz);
0049 const EigenPropagator eigenPropagatorZero{EigenStepper(magFieldZero)};
0050 const EigenPropagator eigenPropagatorNonZero{EigenStepper(magFieldNonZero)};
0051 const StraightLinePropagator straightPropagator{StraightLineStepper()};
0052 
0053 }  // namespace
0054 
0055 BOOST_AUTO_TEST_SUITE(PropagationCompareEigenStraightLine)
0056 
0057 BOOST_DATA_TEST_CASE(NeutralZeroMagneticField,
0058                      ds::phi* ds::thetaCentral* ds::absMomentum* ds::pathLength,
0059                      phi, theta, p, s) {
0060   runForwardComparisonTest(eigenPropagatorZero, straightPropagator, geoCtx,
0061                            magCtx,
0062                            makeParametersCurvilinearNeutral(phi, theta, p), s,
0063                            epsPos, epsDir, epsMom, epsCov);
0064 }
0065 
0066 // TODO https://github.com/acts-project/acts/issues/4375
0067 //
0068 // BOOST_DATA_TEST_CASE(NeutralNonZeroMagneticField,
0069 //                      ds::phi* ds::thetaCentral* ds::absMomentum*
0070 //                      ds::pathLength, phi, theta, p, s) {
0071 //   runForwardComparisonTest(
0072 //       eigenPropagatorNonZero, straightPropagator, geoCtx, magCtx,
0073 //       makeParametersCurvilinearNeutral(phi, theta, p), s, epsPos, epsDir,
0074 //       epsMom, epsCov, CovarianceCheck::Full);
0075 // }
0076 
0077 BOOST_DATA_TEST_CASE(ChargedZeroMagneticField,
0078                      ds::phi* ds::thetaCentral* ds::absMomentum*
0079                          ds::chargeNonZero* ds::pathLength,
0080                      phi, theta, p, q, s) {
0081   runForwardComparisonTest(eigenPropagatorZero, straightPropagator, geoCtx,
0082                            magCtx, makeParametersCurvilinear(phi, theta, p, q),
0083                            s, epsPos, epsDir, epsMom, epsCov);
0084 }
0085 
0086 // TODO add comparison tests between the straight line and eigen propagator for
0087 //      a charged particle w/ infinite momentum in a non-zero magnetic field.
0088 //      these should be identical. requires proper handling of q/p=0 in the
0089 //      track parameters.
0090 
0091 BOOST_AUTO_TEST_SUITE_END()