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) 2023 Wouter Deconinck
0003 
0004 #pragma once
0005 
0006 #include "algorithms/calorimetry/ImagingClusterReco.h"
0007 #include "extensions/jana/JOmniFactory.h"
0008 #include "services/algorithms_init/AlgorithmsInit_service.h"
0009 
0010 namespace eicrecon {
0011 
0012 class ImagingClusterReco_factory :
0013     public JOmniFactory<ImagingClusterReco_factory, ImagingClusterRecoConfig> {
0014 
0015 public:
0016     using AlgoT = eicrecon::ImagingClusterReco;
0017 private:
0018     std::unique_ptr<AlgoT> m_algo;
0019 
0020     PodioInput<edm4eic::ProtoCluster> m_protos_input {this};
0021     PodioInput<edm4hep::SimCalorimeterHit> m_mchits_input {this};
0022 
0023     PodioOutput<edm4eic::Cluster> m_clusters_output {this};
0024     PodioOutput<edm4eic::MCRecoClusterParticleAssociation> m_assocs_output {this};
0025     PodioOutput<edm4eic::Cluster> m_layers_output {this};
0026 
0027     ParameterRef<int> m_trackStopLayer {this, "trackStopLayer", config().trackStopLayer};
0028 
0029     Service<AlgorithmsInit_service> m_algorithmsInit {this};
0030 
0031 public:
0032     void Configure() {
0033         m_algo = std::make_unique<AlgoT>(GetPrefix());
0034         m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
0035         m_algo->applyConfig(config());
0036         m_algo->init();
0037     }
0038 
0039     void ChangeRun(int64_t run_number) {
0040     }
0041 
0042     void Process(int64_t run_number, uint64_t event_number) {
0043         m_algo->process({m_protos_input(), m_mchits_input()},
0044                         {m_clusters_output().get(), m_assocs_output().get(), m_layers_output().get()});
0045     }
0046 };
0047 
0048 } // eicrecon