Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2024 Daniel Brandenburg
0003 
0004 #pragma once
0005 
0006 #include <JANA/JEvent.h>
0007 #include <edm4eic/InclusiveKinematicsCollection.h>
0008 #include <memory>
0009 #include <string>
0010 #include <utility>
0011 #include <vector>
0012 
0013 #include "algorithms/reco/ScatteredElectronsTruth.h"
0014 #include "extensions/jana/JOmniFactory.h"
0015 
0016 namespace eicrecon {
0017 
0018 class ScatteredElectronsTruth_factory :
0019         public JOmniFactory<ScatteredElectronsTruth_factory> {
0020 
0021 public:
0022     using AlgoT = eicrecon::ScatteredElectronsTruth;
0023 private:
0024     std::unique_ptr<AlgoT> m_algo;
0025 
0026     PodioInput<edm4hep::MCParticle> m_mc_particles_input {this};
0027     PodioInput<edm4eic::ReconstructedParticle> m_rc_particles_input {this};
0028     PodioInput<edm4eic::MCRecoParticleAssociation> m_rc_particles_assoc_input {this};
0029 
0030     // Declare outputs
0031     PodioOutput<edm4eic::ReconstructedParticle> m_out_reco_particles {this};
0032 
0033     Service<AlgorithmsInit_service> m_algorithmsInit {this};
0034 
0035 public:
0036     void Configure() {
0037         m_algo = std::make_unique<AlgoT>(GetPrefix());
0038         m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
0039         m_algo->init();
0040     }
0041 
0042     void ChangeRun(int64_t run_number) {
0043     }
0044 
0045     void Process(int64_t run_number, uint64_t event_number) {
0046         m_algo->process({m_mc_particles_input(), m_rc_particles_input(), m_rc_particles_assoc_input()},
0047                         {m_out_reco_particles().get()});
0048 
0049     }
0050 };
0051 
0052 } // eicrecon