File indexing completed on 2024-11-15 08:59:58
0001
0002
0003
0004
0005 #pragma once
0006
0007 #include <ActsExamples/EventData/Track.hpp>
0008 #include <JANA/JEvent.h>
0009 #include <edm4eic/TrackParametersCollection.h>
0010 #include <edm4eic/TrajectoryCollection.h>
0011 #include <memory>
0012 #include <string>
0013 #include <utility>
0014 #include <vector>
0015
0016 #include "ActsExamples/EventData/Trajectories.hpp"
0017 #include "algorithms/tracking/CKFTracking.h"
0018 #include "algorithms/tracking/CKFTrackingConfig.h"
0019 #include "extensions/jana/JOmniFactory.h"
0020 #include "services/geometry/acts/ACTSGeo_service.h"
0021
0022 namespace eicrecon {
0023
0024 class CKFTracking_factory :
0025 public JOmniFactory<CKFTracking_factory, CKFTrackingConfig> {
0026
0027 private:
0028 using AlgoT = eicrecon::CKFTracking;
0029 std::unique_ptr<AlgoT> m_algo;
0030
0031 PodioInput<edm4eic::TrackParameters> m_parameters_input {this};
0032 PodioInput<edm4eic::Measurement2D> m_measurements_input {this};
0033 Output<ActsExamples::Trajectories> m_acts_trajectories_output {this};
0034 Output<ActsExamples::ConstTrackContainer> m_acts_tracks_output {this};
0035
0036 ParameterRef<std::vector<double>> m_etaBins {this, "EtaBins", config().etaBins, "Eta Bins for ACTS CKF tracking reco"};
0037 ParameterRef<std::vector<double>> m_chi2CutOff {this, "Chi2CutOff", config().chi2CutOff, "Chi2 Cut Off for ACTS CKF tracking"};
0038 ParameterRef<std::vector<size_t>> m_numMeasurementsCutOff {this, "NumMeasurementsCutOff", config().numMeasurementsCutOff, "Number of measurements Cut Off for ACTS CKF tracking"};
0039
0040 Service<ACTSGeo_service> m_ACTSGeoSvc {this};
0041
0042 public:
0043 void Configure() {
0044 m_algo = std::make_unique<AlgoT>();
0045 m_algo->applyConfig(config());
0046 m_algo->init(m_ACTSGeoSvc().actsGeoProvider(), logger());
0047 }
0048
0049 void ChangeRun(int64_t run_number) {
0050 }
0051
0052 void Process(int64_t run_number, uint64_t event_number) {
0053 std::tie(
0054 m_acts_trajectories_output(),
0055 m_acts_tracks_output()
0056 ) = m_algo->process(
0057 *m_parameters_input(),
0058 *m_measurements_input()
0059 );
0060 }
0061 };
0062
0063 }