Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-01 07:56:32

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2024 Wouter Deconinck, Dmitry Kalinkin, Derek Anderson
0003 
0004 #pragma once
0005 
0006 #include "extensions/jana/JOmniFactory.h"
0007 #include "algorithms/reco/ChargedMCParticleSelector.h"
0008 
0009 namespace eicrecon {
0010 
0011 class ChargedMCParticleSelector_factory
0012     : public JOmniFactory<ChargedMCParticleSelector_factory, NoConfig> {
0013 
0014 private:
0015   // algorithm
0016   std::unique_ptr<eicrecon::ChargedMCParticleSelector> m_algo;
0017 
0018   // input collection
0019   PodioInput<edm4hep::MCParticle> m_pars_in{this, "GeneratedParticles"};
0020 
0021   // output collection
0022   PodioOutput<edm4hep::MCParticle> m_pars_out{this};
0023 
0024 public:
0025   void Configure() {
0026     m_algo = std::make_unique<eicrecon::ChargedMCParticleSelector>();
0027     m_algo->init(logger());
0028   }
0029 
0030   void ChangeRun(int32_t /* run_number */) { /* nothing to do */
0031   }
0032 
0033   void Process(int32_t /* run_number */, int64_t /* event_number */) {
0034     m_pars_out() = m_algo->process(m_pars_in());
0035   }
0036 };
0037 
0038 } // namespace eicrecon