File indexing completed on 2026-09-15 09:06:37
0001
0002
0003
0004 #pragma once
0005
0006 #include "algorithms/calorimetry/ImagingTopoCluster.h"
0007 #include "extensions/jana/JOmniFactory.h"
0008 #include "services/algorithms_init/AlgorithmsInit_service.h"
0009
0010 namespace eicrecon {
0011
0012 class ImagingTopoCluster_factory
0013 : public JOmniFactory<ImagingTopoCluster_factory, ImagingTopoClusterConfig> {
0014
0015 public:
0016 using AlgoT = eicrecon::ImagingTopoCluster;
0017
0018 private:
0019 std::unique_ptr<AlgoT> m_algo;
0020
0021 PodioInput<edm4eic::CalorimeterHit> m_hits_input{this};
0022 PodioOutput<edm4eic::ProtoCluster> m_protos_output{this};
0023
0024
0025
0026
0027
0028 ParameterRef<std::vector<double>> m_ldep_same{this, "sameLayerDistEtaPhi",
0029 config().sameLayerDistEtaPhi};
0030 ParameterRef<std::vector<double>> m_ldep_diff{this, "diffLayerDistEtaPhi",
0031 config().diffLayerDistEtaPhi};
0032 ParameterRef<std::vector<double>> m_ldtz_same{this, "sameLayerDistTZ", config().sameLayerDistTZ};
0033 ParameterRef<std::vector<double>> m_ldtz_diff{this, "diffLayerDistTZ", config().diffLayerDistTZ};
0034
0035
0036
0037
0038 ParameterRef<eicrecon::ImagingTopoClusterConfig::ELayerMode> m_sameLayerMode{
0039 this, "sameLayerMode", config().sameLayerMode};
0040 ParameterRef<eicrecon::ImagingTopoClusterConfig::ELayerMode> m_diffLayerMode{
0041 this, "diffLayerMode", config().diffLayerMode};
0042
0043 ParameterRef<int> m_nlr{this, "neighbourLayersRange", config().neighbourLayersRange};
0044 ParameterRef<double> m_sd{this, "sectorDist", config().sectorDist};
0045 ParameterRef<double> m_mched{this, "minClusterHitEdep", config().minClusterHitEdep};
0046 ParameterRef<double> m_mcced{this, "minClusterCenterEdep", config().minClusterCenterEdep};
0047 ParameterRef<double> m_mced{this, "minClusterEdep", config().minClusterEdep};
0048 ParameterRef<std::size_t> m_mcnh{this, "minClusterNhits", config().minClusterNhits};
0049
0050 Service<AlgorithmsInit_service> m_algorithmsInit{this};
0051
0052 public:
0053 void Configure() {
0054 m_algo = std::make_unique<AlgoT>(GetPrefix());
0055 m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
0056 m_algo->applyConfig(config());
0057 m_algo->init();
0058 }
0059
0060 void Process(int32_t , uint64_t ) {
0061 m_algo->process({m_hits_input()}, {m_protos_output().get()});
0062 }
0063 };
0064
0065 }