Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 09:39:11

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2024 - 2025, Simon Gardner
0003 
0004 #pragma once
0005 
0006 #include "algorithms/fardetectors/FarDetectorTransportationPostML.h"
0007 #include "services/algorithms_init/AlgorithmsInit_service.h"
0008 #include "extensions/jana/JOmniFactory.h"
0009 
0010 
0011 namespace eicrecon {
0012 
0013 class FarDetectorTransportationPostML_factory : public JOmniFactory<FarDetectorTransportationPostML_factory, FarDetectorTransportationPostMLConfig> {
0014 
0015 public:
0016   using AlgoT = eicrecon::FarDetectorTransportationPostML;
0017 private:
0018   std::unique_ptr<AlgoT> m_algo;
0019 
0020   PodioInput<edm4eic::Tensor>     m_prediction_tensor_input {this};
0021   PodioInput<edm4hep::MCParticle> m_beamelectrons_input     {this};
0022 
0023   PodioOutput<edm4eic::ReconstructedParticle> m_particle_output {this};
0024 
0025 public:
0026   void Configure() {
0027         m_algo = std::make_unique<AlgoT>(GetPrefix());
0028         m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
0029         m_algo->applyConfig(config());
0030         m_algo->init();
0031   }
0032 
0033   void ChangeRun(int64_t run_number) {
0034   }
0035 
0036   void Process(int64_t run_number, uint64_t event_number) {
0037         m_algo->process({m_prediction_tensor_input(), m_beamelectrons_input()},
0038                         {m_particle_output().get()});
0039   }
0040 };
0041 
0042 } // eicrecon