File indexing completed on 2025-01-18 09:55:44
0001
0002
0003
0004 #pragma once
0005
0006 #include "algorithms/pid/MatchToRICHPID.h"
0007 #include "extensions/jana/JOmniFactory.h"
0008 #include <edm4eic/CherenkovParticleID.h>
0009 #include <edm4eic/ReconstructedParticle.h>
0010 #include <edm4eic/MCRecoParticleAssociation.h>
0011 #include <edm4hep/ParticleID.h>
0012 #include <memory>
0013
0014 namespace eicrecon {
0015
0016 class MatchToRICHPID_factory : public JOmniFactory<MatchToRICHPID_factory, MatchToRICHPIDConfig> {
0017 public:
0018 using AlgoT = eicrecon::MatchToRICHPID;
0019
0020 private:
0021 std::unique_ptr<AlgoT> m_algo;
0022
0023 PodioInput<edm4eic::ReconstructedParticle> m_recoparticles_input{this};
0024 PodioInput<edm4eic::MCRecoParticleAssociation> m_assocs_input{this};
0025 PodioInput<edm4eic::CherenkovParticleID> m_cherenkov_particle_ids_input{this};
0026 PodioOutput<edm4eic::ReconstructedParticle> m_recoparticles_output{this};
0027 PodioOutput<edm4eic::MCRecoParticleAssociation> m_assocs_output{this};
0028 PodioOutput<edm4hep::ParticleID> m_pids_output{this};
0029
0030 public:
0031 void Configure() {
0032 m_algo = std::make_unique<AlgoT>(this->GetPrefix());
0033 m_algo->level((algorithms::LogLevel)logger()->level());
0034 m_algo->applyConfig(config());
0035 m_algo->init();
0036 };
0037
0038 void ChangeRun(int64_t run_number) {};
0039
0040 void Process(int64_t run_number, uint64_t event_number) {
0041 m_algo->process({m_recoparticles_input(), m_assocs_input(), m_cherenkov_particle_ids_input()},
0042 {m_recoparticles_output().get(), m_assocs_output().get(), m_pids_output().get()});
0043 }
0044 };
0045
0046 }