File indexing completed on 2025-07-12 08:34:01
0001
0002
0003
0004 #pragma once
0005
0006 #include "algorithms/calorimetry/CalorimeterClusterShape.h"
0007 #include "extensions/jana/JOmniFactory.h"
0008 #include "services/algorithms_init/AlgorithmsInit_service.h"
0009
0010 namespace eicrecon {
0011
0012 class CalorimeterClusterShape_factory
0013 : public JOmniFactory<CalorimeterClusterShape_factory, CalorimeterClusterShapeConfig> {
0014
0015 public:
0016 using AlgoT = eicrecon::CalorimeterClusterShape;
0017
0018 private:
0019
0020 std::unique_ptr<AlgoT> m_algo;
0021
0022
0023 PodioInput<edm4eic::Cluster> m_clusters_input{this};
0024 PodioInput<edm4eic::MCRecoClusterParticleAssociation> m_assocs_input{this};
0025
0026
0027 PodioOutput<edm4eic::Cluster> m_clusters_output{this};
0028 PodioOutput<edm4eic::MCRecoClusterParticleAssociation> m_assocs_output{this};
0029
0030
0031 ParameterRef<bool> m_longitudinalShowerInfoAvailable{this, "longitudinalShowerInfoAvailable",
0032 config().longitudinalShowerInfoAvailable};
0033 ParameterRef<std::string> m_energyWeight{this, "energyWeight", config().energyWeight};
0034 ParameterRef<double> m_sampFrac{this, "sampFrac", config().sampFrac};
0035 ParameterRef<std::vector<double>> m_logWeightBaseCoeffs{this, "logWeightBaseCoeffs",
0036 config().logWeightBaseCoeffs};
0037 ParameterRef<double> m_logWeightBase_Eref{this, "logWeightBase_Eref",
0038 config().logWeightBase_Eref};
0039 ParameterRef<double> m_logWeightBase{this, "logWeightBase", config().logWeightBase};
0040
0041
0042 Service<AlgorithmsInit_service> m_algoInitSvc{this};
0043
0044 public:
0045 void Configure() {
0046 m_algo = std::make_unique<AlgoT>(GetPrefix());
0047 m_algo->applyConfig(config());
0048 m_algo->init();
0049 }
0050
0051 void ChangeRun(int32_t ) {
0052
0053 }
0054
0055 void Process(int32_t , uint64_t ) {
0056 m_algo->process({m_clusters_input(), m_assocs_input()},
0057 {m_clusters_output().get(), m_assocs_output().get()});
0058 }
0059
0060 };
0061
0062 }