File indexing completed on 2025-02-22 10:33:27
0001
0002
0003
0004 #pragma once
0005
0006 #include "algorithms/fardetectors/FarDetectorTransportationPreML.h"
0007 #include "services/algorithms_init/AlgorithmsInit_service.h"
0008 #include "extensions/jana/JOmniFactory.h"
0009
0010
0011 namespace eicrecon {
0012
0013 class FarDetectorTransportationPreML_factory : public JOmniFactory<FarDetectorTransportationPreML_factory, FarDetectorTransportationPreMLConfig> {
0014
0015 public:
0016 using AlgoT = eicrecon::FarDetectorTransportationPreML;
0017 private:
0018 std::unique_ptr<AlgoT> m_algo;
0019
0020 PodioInput<edm4eic::TrackParameters> m_trackparam_input {this};
0021 PodioInput<edm4hep::MCParticle> m_scatteredelectrons_input {this};
0022 PodioInput<edm4hep::MCParticle> m_beamelectrons_input {this};
0023
0024 PodioOutput<edm4eic::Tensor> m_feature_tensor_output {this};
0025 PodioOutput<edm4eic::Tensor> m_target_tensor_output {this};
0026
0027 public:
0028 void Configure() {
0029 m_algo = std::make_unique<AlgoT>(GetPrefix());
0030 m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
0031 m_algo->applyConfig(config());
0032 m_algo->init();
0033 }
0034
0035 void ChangeRun(int64_t run_number) {
0036 }
0037
0038 void Process(int64_t run_number, uint64_t event_number) {
0039 m_algo->process({m_trackparam_input(),m_scatteredelectrons_input(), m_beamelectrons_input()},
0040 {m_feature_tensor_output().get(), m_target_tensor_output().get()});
0041 }
0042 };
0043
0044 }