Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-06 08:29:51

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2023 Wouter Deconinck
0003 
0004 #pragma once
0005 
0006 #include <edm4eic/EDM4eicVersion.h>
0007 #include "algorithms/calorimetry/ImagingClusterReco.h"
0008 #include "extensions/jana/JOmniFactory.h"
0009 #include "services/algorithms_init/AlgorithmsInit_service.h"
0010 
0011 namespace eicrecon {
0012 
0013 class ImagingClusterReco_factory
0014     : public JOmniFactory<ImagingClusterReco_factory, ImagingClusterRecoConfig> {
0015 
0016 public:
0017   using AlgoT = eicrecon::ImagingClusterReco;
0018 
0019 private:
0020   std::unique_ptr<AlgoT> m_algo;
0021 
0022   PodioInput<edm4eic::ProtoCluster> m_protos_input{this};
0023 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0024   PodioInput<edm4eic::MCRecoCalorimeterHitLink> m_mchitlinks_input{this};
0025 #endif
0026   PodioInput<edm4eic::MCRecoCalorimeterHitAssociation> m_mchitassocs_input{this};
0027 
0028   PodioOutput<edm4eic::Cluster> m_clusters_output{this};
0029 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0030   PodioOutput<edm4eic::MCRecoClusterParticleLink> m_links_output{this};
0031 #endif
0032   PodioOutput<edm4eic::MCRecoClusterParticleAssociation> m_assocs_output{this};
0033   PodioOutput<edm4eic::Cluster> m_layers_output{this};
0034 
0035   ParameterRef<int> m_trackStopLayer{this, "trackStopLayer", config().trackStopLayer};
0036 
0037   Service<AlgorithmsInit_service> m_algorithmsInit{this};
0038 
0039 public:
0040   void Configure() {
0041     m_algo = std::make_unique<AlgoT>(GetPrefix());
0042     m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
0043     m_algo->applyConfig(config());
0044     m_algo->init();
0045   }
0046 
0047   void Process(int32_t /* run_number */, uint64_t /* event_number */) {
0048     m_algo->process({m_protos_input(),
0049 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0050                      m_mchitlinks_input(),
0051 #endif
0052                      m_mchitassocs_input()},
0053                     {m_clusters_output().get(),
0054 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0055                      m_links_output().get(),
0056 #endif
0057                      m_assocs_output().get(), m_layers_output().get()});
0058   }
0059 };
0060 
0061 } // namespace eicrecon