Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-15 09:30:29

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2026 Wouter Deconinck
0003 
0004 #pragma once
0005 
0006 #include <JANA/JEvent.h>
0007 #include <edm4eic/InclusiveKinematicsCollection.h>
0008 #include <edm4eic/ReconstructedParticleCollection.h>
0009 #include <edm4hep/MCParticleCollection.h>
0010 #include <memory>
0011 #include <string>
0012 #include <utility>
0013 #include <vector>
0014 
0015 #include "algorithms/reco/InclusiveKinematicsTruthDressed.h"
0016 #include "algorithms/reco/InclusiveKinematicsTruthDressedConfig.h"
0017 #include "extensions/jana/JOmniFactory.h"
0018 #include "services/algorithms_init/AlgorithmsInit_service.h"
0019 
0020 namespace eicrecon {
0021 
0022 class InclusiveKinematicsTruthDressed_factory
0023     : public JOmniFactory<InclusiveKinematicsTruthDressed_factory,
0024                           InclusiveKinematicsTruthDressedConfig> {
0025 
0026 public:
0027   using AlgoT = eicrecon::InclusiveKinematicsTruthDressed;
0028 
0029 private:
0030   std::unique_ptr<AlgoT> m_algo;
0031 
0032   PodioInput<edm4hep::MCParticle> m_mc_particles_input{this};
0033   PodioOutput<edm4eic::InclusiveKinematics> m_inclusive_kinematics_output{this};
0034   PodioOutput<edm4eic::ReconstructedParticle> m_scattered_lepton_output{this};
0035   PodioOutput<edm4hep::MCParticle> m_scattered_lepton_constituents_output{this};
0036 
0037   ParameterRef<double> m_coneDeltaR{this, "coneDeltaR", config().coneDeltaR};
0038 
0039   Service<AlgorithmsInit_service> m_algorithmsInit{this};
0040 
0041 public:
0042   void Configure() {
0043     m_algo = std::make_unique<AlgoT>(GetPrefix());
0044     m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
0045     m_algo->applyConfig(config());
0046     m_algo->init();
0047   }
0048 
0049   void Process(int32_t /* run_number */, uint64_t /* event_number */) {
0050     m_algo->process({m_mc_particles_input()},
0051                     {m_inclusive_kinematics_output().get(), m_scattered_lepton_output().get(),
0052                      m_scattered_lepton_constituents_output().get()});
0053   }
0054 };
0055 
0056 } // namespace eicrecon