File indexing completed on 2025-01-18 09:55:44
0001
0002
0003
0004 #pragma once
0005
0006 #include <Acts/Surfaces/Surface.hpp>
0007 #include <JANA/JEvent.h>
0008 #include <edm4eic/TrackSegmentCollection.h>
0009 #include <memory>
0010 #include <string>
0011 #include <utility>
0012 #include <vector>
0013
0014 #include "algorithms/interfaces/WithPodConfig.h"
0015 #include "algorithms/tracking/TrackPropagation.h"
0016 #include "algorithms/tracking/TrackPropagationConfig.h"
0017 #include "extensions/jana/JOmniFactory.h"
0018 #include "services/geometry/acts/ACTSGeo_service.h"
0019 #include "services/geometry/dd4hep/DD4hep_service.h"
0020
0021 namespace eicrecon {
0022
0023 class TrackPropagation_factory :
0024 public JOmniFactory<TrackPropagation_factory, TrackPropagationConfig> {
0025
0026 private:
0027 using AlgoT = eicrecon::TrackPropagation;
0028 std::unique_ptr<AlgoT> m_algo;
0029
0030 PodioInput<edm4eic::Track> m_tracks_input {this};
0031 Input<ActsExamples::Trajectories> m_acts_trajectories_input {this};
0032 Input<ActsExamples::ConstTrackContainer> m_acts_tracks_input {this};
0033 PodioOutput<edm4eic::TrackSegment> m_track_segments_output {this};
0034
0035 Service<DD4hep_service> m_GeoSvc {this};
0036 Service<ACTSGeo_service> m_ACTSGeoSvc {this};
0037
0038 public:
0039 void Configure() {
0040 m_algo = std::make_unique<AlgoT>();
0041 m_algo->applyConfig(config());
0042 m_algo->init(m_GeoSvc().detector(), m_ACTSGeoSvc().actsGeoProvider(), logger());
0043 }
0044
0045 void ChangeRun(int64_t run_number) {
0046 }
0047
0048 void Process(int64_t run_number, uint64_t event_number) {
0049 m_algo->process(
0050 {*m_tracks_input(), m_acts_trajectories_input(), m_acts_tracks_input()},
0051 {m_track_segments_output().get()}
0052 );
0053 }
0054 };
0055
0056 }