Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 08:59:57

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 : public JOmniFactory<ChargedMCParticleSelector_factory, NoConfig> {
0012 
0013     private:
0014 
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 
0026       void Configure() {
0027         m_algo = std::make_unique<eicrecon::ChargedMCParticleSelector>();
0028         m_algo->init(logger());
0029       }
0030 
0031       void ChangeRun(int64_t run_number) {
0032         /* nothing to do */
0033       }
0034 
0035      void Process(int64_t run_number, int64_t event_number) {
0036         m_pars_out() = m_algo->process(m_pars_in());
0037       }
0038 
0039   };
0040 
0041 }  // end eicrecon namespace