Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-28 07:02:21

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2022 Whitney Armstrong, Wouter Deconinck, Sylvester Joosten
0003 
0004 #include "Acts/MagneticField/MagneticFieldProvider.hpp"
0005 #include "Acts/Propagator/EigenStepper.hpp"
0006 #include "Acts/Propagator/Navigator.hpp"
0007 #include "Acts/Propagator/Propagator.hpp"
0008 #include "Acts/TrackFitting/GainMatrixSmoother.hpp"
0009 #include "Acts/TrackFitting/GainMatrixUpdater.hpp"
0010 
0011 #include "TrackFindingAlgorithm.h"
0012 
0013 #include "JugBase/BField/DD4hepBField.h"
0014 
0015 
0016 #include <random>
0017 #include <stdexcept>
0018 
0019 namespace {
0020   using Updater  = Acts::GainMatrixUpdater;
0021   using Smoother = Acts::GainMatrixSmoother;
0022 
0023   using Stepper    = Acts::EigenStepper<>;
0024   using Navigator  = Acts::Navigator;
0025   using Propagator = Acts::Propagator<Stepper, Navigator>;
0026   using CKF        = Acts::CombinatorialKalmanFilter<Propagator, Acts::VectorMultiTrajectory>;
0027 
0028   /** Finder implmentation .
0029    *
0030    * \ingroup track
0031    */
0032   struct TrackFinderFunctionImpl
0033     : public Jug::Reco::TrackFindingAlgorithm::TrackFinderFunction {
0034     CKF trackFinder;
0035 
0036     TrackFinderFunctionImpl(CKF&& f) : trackFinder(std::move(f)) {}
0037 
0038     Jug::Reco::TrackFindingAlgorithm::TrackFinderResult
0039     operator()(const Jug::TrackParametersContainer& initialParameters,
0040                const Jug::Reco::TrackFindingAlgorithm::TrackFinderOptions& options)
0041                const override
0042     {
0043       return trackFinder.findTracks(initialParameters, options);
0044     };
0045   };
0046 
0047 } // namespace
0048 
0049 namespace Jug::Reco {
0050 
0051   std::shared_ptr<TrackFindingAlgorithm::TrackFinderFunction>
0052   TrackFindingAlgorithm::makeTrackFinderFunction(
0053       std::shared_ptr<const Acts::TrackingGeometry>      trackingGeometry,
0054       std::shared_ptr<const Acts::MagneticFieldProvider> magneticField)
0055   {
0056     Stepper   stepper(std::move(magneticField));
0057     Navigator::Config cfg{trackingGeometry};
0058     cfg.resolvePassive   = false;
0059     cfg.resolveMaterial  = true;
0060     cfg.resolveSensitive = true;
0061     Navigator navigator(cfg);
0062 
0063     Propagator propagator(std::move(stepper), std::move(navigator));
0064     CKF        trackFinder(std::move(propagator));
0065 
0066     // build the track finder functions. onws the track finder object.
0067     return std::make_shared<TrackFinderFunctionImpl>(std::move(trackFinder));
0068   }
0069 
0070 } // namespace Jug::Reco