File indexing completed on 2025-01-18 09:55:42
0001
0002
0003
0004 #pragma once
0005
0006 #include <Acts/EventData/VectorMultiTrajectory.hpp>
0007 #include <Acts/Geometry/GeometryContext.hpp>
0008 #include <Acts/Geometry/TrackingGeometry.hpp>
0009 #include <Acts/MagneticField/MagneticFieldContext.hpp>
0010 #include <Acts/MagneticField/MagneticFieldProvider.hpp>
0011 #include <Acts/TrackFinding/CombinatorialKalmanFilter.hpp>
0012 #include <Acts/TrackFinding/MeasurementSelector.hpp>
0013 #include <Acts/Utilities/CalibrationContext.hpp>
0014 #include <Acts/Utilities/Logger.hpp>
0015 #include <Acts/Utilities/Result.hpp>
0016 #include <ActsExamples/EventData/IndexSourceLink.hpp>
0017 #include <ActsExamples/EventData/Track.hpp>
0018 #include <ActsExamples/EventData/Trajectories.hpp>
0019 #include <edm4eic/Measurement2DCollection.h>
0020 #include <edm4eic/TrackParametersCollection.h>
0021 #include <spdlog/logger.h>
0022 #include <memory>
0023 #include <tuple>
0024 #include <vector>
0025
0026 #include "CKFTrackingConfig.h"
0027 #include "DD4hepBField.h"
0028 #include "algorithms/interfaces/WithPodConfig.h"
0029
0030 class ActsGeometryProvider;
0031
0032 namespace eicrecon {
0033
0034
0035
0036
0037
0038
0039 class CKFTracking: public WithPodConfig<eicrecon::CKFTrackingConfig> {
0040 public:
0041
0042
0043 using TrackFinderOptions =
0044 Acts::CombinatorialKalmanFilterOptions<ActsExamples::IndexSourceLinkAccessor::Iterator,
0045 Acts::VectorMultiTrajectory>;
0046 using TrackFinderResult =
0047 Acts::Result<std::vector<ActsExamples::TrackContainer::TrackProxy>>;
0048
0049
0050
0051
0052 class CKFTrackingFunction {
0053 public:
0054 virtual ~CKFTrackingFunction() = default;
0055
0056 virtual TrackFinderResult operator()(const ActsExamples::TrackParameters&,
0057 const TrackFinderOptions&,
0058 ActsExamples::TrackContainer&) const = 0;
0059 };
0060
0061
0062
0063
0064 static std::shared_ptr<CKFTrackingFunction> makeCKFTrackingFunction(
0065 std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry,
0066 std::shared_ptr<const Acts::MagneticFieldProvider> magneticField,
0067 const Acts::Logger& logger);
0068
0069 CKFTracking();
0070
0071 void init(std::shared_ptr<const ActsGeometryProvider> geo_svc, std::shared_ptr<spdlog::logger> log);
0072
0073 std::tuple<
0074 std::vector<ActsExamples::Trajectories*>,
0075 std::vector<ActsExamples::ConstTrackContainer*>
0076 >
0077 process(const edm4eic::TrackParametersCollection& init_trk_params,
0078 const edm4eic::Measurement2DCollection& meas2Ds);
0079
0080 private:
0081 std::shared_ptr<spdlog::logger> m_log;
0082 std::shared_ptr<const Acts::Logger> m_acts_logger{nullptr};
0083 std::shared_ptr<CKFTrackingFunction> m_trackFinderFunc;
0084 std::shared_ptr<const ActsGeometryProvider> m_geoSvc;
0085
0086 std::shared_ptr<const eicrecon::BField::DD4hepBField> m_BField = nullptr;
0087 Acts::GeometryContext m_geoctx;
0088 Acts::CalibrationContext m_calibctx;
0089 Acts::MagneticFieldContext m_fieldctx;
0090
0091 Acts::MeasurementSelector::Config m_sourcelinkSelectorCfg;
0092
0093
0094 const Acts::Logger& logger() const { return *m_acts_logger; }
0095 };
0096
0097 }