Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 08:59:56

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2023 Wouter Deconinck
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 : public JOmniFactory<ImagingTopoCluster_factory, ImagingTopoClusterConfig> {
0013 
0014 public:
0015     using AlgoT = eicrecon::ImagingTopoCluster;
0016 private:
0017     std::unique_ptr<AlgoT> m_algo;
0018 
0019     PodioInput<edm4eic::CalorimeterHit> m_hits_input {this};
0020     PodioOutput<edm4eic::ProtoCluster> m_protos_output {this};
0021 
0022     ParameterRef<std::vector<double>> m_ldxy {this, "localDistXY", config().localDistXY};
0023     ParameterRef<std::vector<double>> m_ldep {this, "layerDistEtaPhi", config().layerDistEtaPhi};
0024     ParameterRef<std::vector<double>> m_ldxy_adjacent {this, "layerDistXY", config().layerDistXY};
0025     ParameterRef<eicrecon::ImagingTopoClusterConfig::ELayerMode> m_laymode {this, "layerMode", config().layerMode};
0026     ParameterRef<int> m_nlr {this, "neighbourLayersRange", config().neighbourLayersRange};
0027     ParameterRef<double> m_sd {this, "sectorDist", config().sectorDist};
0028     ParameterRef<double> m_mched {this, "minClusterHitEdep", config().minClusterHitEdep};
0029     ParameterRef<double> m_mcced {this, "minClusterCenterEdep", config().minClusterCenterEdep};
0030     ParameterRef<double> m_mced {this, "minClusterEdep", config().minClusterEdep};
0031     ParameterRef<std::size_t> m_mcnh {this, "minClusterNhits", config().minClusterNhits};
0032 
0033     Service<AlgorithmsInit_service> m_algorithmsInit {this};
0034 
0035 public:
0036     void Configure() {
0037         m_algo = std::make_unique<AlgoT>(GetPrefix());
0038         m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
0039         m_algo->applyConfig(config());
0040         m_algo->init();
0041     }
0042 
0043     void ChangeRun(int64_t run_number) {
0044     }
0045 
0046     void Process(int64_t run_number, uint64_t event_number) {
0047         m_algo->process({m_hits_input()}, {m_protos_output().get()});
0048     }
0049 };
0050 
0051 } // namespace eicrecon