File indexing completed on 2025-09-15 08:56:05
0001
0002
0003
0004 #pragma once
0005
0006 #include "algorithms/digi/MPGDTrackerDigi.h"
0007 #include "services/algorithms_init/AlgorithmsInit_service.h"
0008 #include "extensions/jana/JOmniFactory.h"
0009
0010 namespace eicrecon {
0011
0012 class MPGDTrackerDigi_factory
0013 : public JOmniFactory<MPGDTrackerDigi_factory, MPGDTrackerDigiConfig> {
0014
0015 public:
0016 using AlgoT = eicrecon::MPGDTrackerDigi;
0017
0018 private:
0019 std::unique_ptr<AlgoT> m_algo;
0020
0021 PodioInput<edm4hep::EventHeader> m_event_headers_input{this};
0022 PodioInput<edm4hep::SimTrackerHit> m_sim_hits_input{this};
0023
0024 PodioOutput<edm4eic::RawTrackerHit> m_raw_hits_output{this};
0025 PodioOutput<edm4eic::MCRecoTrackerHitAssociation> m_assoc_output{this};
0026
0027 ParameterRef<double> m_threshold{this, "threshold", config().threshold};
0028 ParameterRef<double> m_timeResolution{this, "timeResolution", config().timeResolution};
0029 ParameterRef<std::string> m_readout{this, "readoutClass", config().readout};
0030
0031 public:
0032 void Configure() {
0033 m_algo = std::make_unique<AlgoT>(GetPrefix());
0034 m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
0035 m_algo->applyConfig(config());
0036 m_algo->init();
0037 }
0038
0039 void Process(int32_t , uint64_t ) {
0040 m_algo->process({m_event_headers_input(), m_sim_hits_input()},
0041 {m_raw_hits_output().get(), m_assoc_output().get()});
0042 }
0043 };
0044
0045 }