Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-27 07:03:06

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright 2024, Dmitry Kalinkin
0003 
0004 #pragma once
0005 
0006 #include "algorithms/tracking/TracksToParticles.h"
0007 #include <edm4eic/MCRecoParticleAssociation.h>
0008 #include <edm4eic/ReconstructedParticle.h>
0009 #include <edm4eic/Track.h>
0010 #include <edm4hep/MCParticleCollection.h>
0011 #include <edm4hep/ParticleID.h>
0012 #include <memory>
0013 
0014 namespace eicrecon {
0015 
0016 class TracksToParticles_factory
0017     : public JOmniFactory<TracksToParticles_factory, NoConfig> {
0018 public:
0019   using AlgoT = eicrecon::TracksToParticles;
0020 
0021 private:
0022   std::unique_ptr<AlgoT> m_algo;
0023 
0024   PodioInput<edm4eic::Track> m_tracks_input{this};
0025   PodioInput<edm4eic::MCRecoTrackParticleAssociation> m_trackassocs_input{this};
0026   PodioOutput<edm4eic::ReconstructedParticle> m_recoparticles_output{this};
0027   PodioOutput<edm4eic::MCRecoParticleAssociation> m_recoassocs_output{this};
0028 
0029 public:
0030   void Configure() {
0031     m_algo = std::make_unique<AlgoT>(this->GetPrefix());
0032     m_algo->level((algorithms::LogLevel)logger()->level());
0033     m_algo->applyConfig(config());
0034     m_algo->init();
0035   };
0036 
0037   void ChangeRun(int64_t run_number) {};
0038 
0039   void Process(int64_t run_number, uint64_t event_number) {
0040     m_algo->process({m_tracks_input(), m_trackassocs_input()},
0041                     {m_recoparticles_output().get(), m_recoassocs_output().get()});
0042   }
0043 };
0044 
0045 } // namespace eicrecon