File indexing completed on 2025-01-30 09:18:51
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
0011 namespace eicrecon {
0012
0013 class MPGDTrackerDigi_factory : public JOmniFactory<MPGDTrackerDigi_factory, MPGDTrackerDigiConfig> {
0014
0015 public:
0016 using AlgoT = eicrecon::MPGDTrackerDigi;
0017 private:
0018 std::unique_ptr<AlgoT> m_algo;
0019
0020 PodioInput<edm4hep::SimTrackerHit> m_sim_hits_input {this};
0021
0022 PodioOutput<edm4eic::RawTrackerHit> m_raw_hits_output {this};
0023 PodioOutput<edm4eic::MCRecoTrackerHitAssociation> m_assoc_output {this};
0024
0025 ParameterRef<double> m_threshold {this, "threshold", config().threshold};
0026 ParameterRef<double> m_timeResolution {this, "timeResolution", config().timeResolution};
0027 ParameterRef<std::string> m_readout {this, "readoutClass", config().readout};
0028
0029 public:
0030 void Configure() {
0031 m_algo = std::make_unique<AlgoT>(GetPrefix());
0032 m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
0033 m_algo->applyConfig(config());
0034 m_algo->init();
0035 }
0036
0037 void ChangeRun(int64_t run_number) {
0038 }
0039
0040 void Process(int64_t run_number, uint64_t event_number) {
0041 m_algo->process({m_sim_hits_input()},
0042 {m_raw_hits_output().get(),m_assoc_output().get()});
0043 }
0044 };
0045
0046 }