From eccfd0215657063f4067d30e3bc13fee504903ea Mon Sep 17 00:00:00 2001 From: Dmitry Romanov Date: Thu, 21 Nov 2024 10:40:15 -0500 Subject: [PATCH] CKFTracking updates --- source/tdis/CMakeLists.txt | 5 ++-- source/tdis/tracking/CKFTracking.cc | 5 +--- source/tdis/tracking/CKFTracking.h | 15 +++++++++++ source/tdis/tracking/KalmanFittingFactory.cpp | 1 + source/tdis/tracking/KalmanFittingFactory.h | 26 ++++++++++++++----- 5 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 source/tdis/tracking/KalmanFittingFactory.cpp diff --git a/source/tdis/CMakeLists.txt b/source/tdis/CMakeLists.txt index 6b2323e..dd8145a 100644 --- a/source/tdis/CMakeLists.txt +++ b/source/tdis/CMakeLists.txt @@ -50,8 +50,9 @@ add_executable(tdis # tracking/Measurement2DFactory.h tracking/TruthTrackParameterFactory.h tracking/KalmanFittingFactory.h - tracking/CKFTracking.h - tracking/CKFTracking.cc + tracking/KalmanFittingFactory.cpp + # tracking/CKFTracking.h + # tracking/CKFTracking.cc ) # ---------- FIND REQUIRED PACKAGES ------------- diff --git a/source/tdis/tracking/CKFTracking.cc b/source/tdis/tracking/CKFTracking.cc index 742b774..35a4eae 100644 --- a/source/tdis/tracking/CKFTracking.cc +++ b/source/tdis/tracking/CKFTracking.cc @@ -307,11 +307,8 @@ namespace eicrecon { auto& constTracks = *(constTracks_v.front()); // Seed number column accessor -#if Acts_VERSION_MAJOR >= 32 + const Acts::ConstProxyAccessor constSeedNumber("seed"); -#else - const Acts::ConstTrackAccessor constSeedNumber("seed"); -#endif // Prepare the output data with MultiTrajectory, per seed std::vector acts_trajectories; diff --git a/source/tdis/tracking/CKFTracking.h b/source/tdis/tracking/CKFTracking.h index d2e9047..e86676d 100644 --- a/source/tdis/tracking/CKFTracking.h +++ b/source/tdis/tracking/CKFTracking.h @@ -71,6 +71,21 @@ namespace eicrecon { process(const edm4eic::Measurement2DCollection& meas2Ds, const edm4eic::TrackParametersCollection &init_trk_params); + private: + std::shared_ptr m_log; + std::shared_ptr m_acts_logger{nullptr}; + std::shared_ptr m_trackFinderFunc; + std::shared_ptr m_geoSvc; + + std::shared_ptr m_BField = nullptr; + Acts::GeometryContext m_geoctx; + Acts::CalibrationContext m_calibctx; + Acts::MagneticFieldContext m_fieldctx; + + Acts::MeasurementSelector::Config m_sourcelinkSelectorCfg; + + /// Private access to the logging instance + const Acts::Logger& logger() const { return *m_acts_logger; } }; } // namespace eicrecon::Reco diff --git a/source/tdis/tracking/KalmanFittingFactory.cpp b/source/tdis/tracking/KalmanFittingFactory.cpp new file mode 100644 index 0000000..9f1a46e --- /dev/null +++ b/source/tdis/tracking/KalmanFittingFactory.cpp @@ -0,0 +1 @@ +#include "KalmanFittingFactory.h"" \ No newline at end of file diff --git a/source/tdis/tracking/KalmanFittingFactory.h b/source/tdis/tracking/KalmanFittingFactory.h index c262974..57eda1e 100644 --- a/source/tdis/tracking/KalmanFittingFactory.h +++ b/source/tdis/tracking/KalmanFittingFactory.h @@ -2,19 +2,33 @@ #include #include +#include #include +#include "ActsGeometryService.h" +#include "podio_model/DigitizedMtpcMcHit.h" +#include "podio_model/Measurement2D.h" +#include "podio_model/TrackParameters.h" +#include "services/LogService.hpp" + namespace tdis::tracking { struct KalmanFittingFactory : public JOmniFactory { - PodioInput m_mc_hits_in{this, {"DigitizedMtpcMcHit"}}; - PodioOutput m_tracker_hits_out{this, "TrackerHit"}; - PodioOutput m_measurements_out{this, "Measurement2D"}; - Service m_service_geometry{this}; + PodioInput m_parameters_input {this}; + PodioInput m_measurements_input {this}; + Output m_acts_trajectories_output {this}; + Output m_acts_tracks_output {this}; + + ParameterRef> m_etaBins {this, "EtaBins", config().etaBins, "Eta Bins for ACTS CKF tracking reco"}; + ParameterRef> m_chi2CutOff {this, "Chi2CutOff", config().chi2CutOff, "Chi2 Cut Off for ACTS CKF tracking"}; + ParameterRef> m_numMeasurementsCutOff {this, "NumMeasurementsCutOff", config().numMeasurementsCutOff, "Number of measurements Cut Off for ACTS CKF tracking"}; + + + Service m_serviceGeometry{this}; Service m_service_log{this}; Parameter m_cfg_use_true_pos{this, "acts:use_true_position", true, "Use true hits xyz instead of digitized one"}; @@ -66,8 +80,8 @@ namespace tdis::tracking { private: std::shared_ptr m_log; std::shared_ptr m_acts_logger{nullptr}; - std::shared_ptr m_trackFinderFunc; - std::shared_ptr m_geoSvc; + // std::shared_ptr m_trackFinderFunc; + std::shared_ptr m_BField = nullptr; Acts::GeometryContext m_geoctx;