File indexing completed on 2025-12-16 09:28:09
0001
0002
0003
0004 #pragma once
0005
0006 #include <ActsExamples/EventData/Trajectories.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/tracking/TrackProjector.h"
0015 #include "extensions/jana/JOmniFactory.h"
0016
0017 namespace eicrecon {
0018
0019 class TrackProjector_factory : public JOmniFactory<TrackProjector_factory, NoConfig> {
0020
0021 private:
0022 using AlgoT = eicrecon::TrackProjector;
0023
0024 std::unique_ptr<AlgoT> m_algo;
0025
0026 Input<ActsExamples::Trajectories> m_acts_trajectories_input{this};
0027 PodioInput<edm4eic::Track> m_tracks_input{this};
0028 PodioOutput<edm4eic::TrackSegment> m_segments_output{this};
0029
0030 Service<AlgorithmsInit_service> m_algorithmsInit{this};
0031
0032 public:
0033 void Configure() {
0034 m_algo = std::make_unique<AlgoT>(this->GetPrefix());
0035 m_algo->level((algorithms::LogLevel)logger()->level());
0036 m_algo->applyConfig(config());
0037 m_algo->init();
0038 }
0039
0040 void Process(int32_t , uint64_t ) {
0041 std::vector<gsl::not_null<const ActsExamples::Trajectories*>> acts_trajectories_input;
0042 for (auto acts_traj : m_acts_trajectories_input()) {
0043 acts_trajectories_input.push_back(acts_traj);
0044 }
0045 m_algo->process(
0046 {
0047 acts_trajectories_input,
0048 m_tracks_input(),
0049 },
0050 {
0051 m_segments_output().get(),
0052 });
0053 }
0054 };
0055
0056 }