Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2024 Sebouh Paul
0003 
0004 #pragma once
0005 
0006 #include "algorithms/reco/FarForwardNeutronReconstruction.h"
0007 #include "algorithms/reco/FarForwardNeutronReconstructionConfig.h"
0008 #include "services/algorithms_init/AlgorithmsInit_service.h"
0009 #include "extensions/jana/JOmniFactory.h"
0010 
0011 
0012 namespace eicrecon {
0013 
0014   class FarForwardNeutronReconstruction_factory : public JOmniFactory<FarForwardNeutronReconstruction_factory,FarForwardNeutronReconstructionConfig> {
0015 
0016    using AlgoT = eicrecon::FarForwardNeutronReconstruction;
0017      private:
0018          std::unique_ptr<AlgoT> m_algo;
0019     PodioInput<edm4eic::Cluster> m_clusters_hcal_input {this};
0020     PodioInput<edm4eic::Cluster> m_clusters_ecal_input {this};
0021     PodioOutput<edm4eic::ReconstructedParticle> m_neutrons_output {this};
0022     ParameterRef<std::vector<double>> m_scale_corr_coeff_hcal     {this, "scale_corr_coeff_hcal",          config().scale_corr_coeff_hcal};
0023     ParameterRef<std::vector<double>> m_scale_corr_coeff_ecal     {this, "scale_corr_coeff_ecal",          config().scale_corr_coeff_ecal};
0024     Service<AlgorithmsInit_service> m_algorithmsInit {this};
0025 
0026 public:
0027     void Configure() {
0028         m_algo = std::make_unique<AlgoT>(GetPrefix());
0029         m_algo->level((algorithms::LogLevel)logger()->level());
0030 
0031         m_algo->applyConfig(config());
0032         m_algo->init();
0033     }
0034 
0035     void ChangeRun(int64_t run_number) {
0036     }
0037 
0038     void Process(int64_t run_number, uint64_t event_number) {
0039       m_algo->process({m_clusters_hcal_input(), m_clusters_ecal_input()},{m_neutrons_output().get()});
0040     }
0041 };
0042 
0043 } // eicrecon