File indexing completed on 2025-04-03 08:49:44
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
0011
0012 namespace eicrecon {
0013
0014 class CalorimeterClusterShape_factory
0015 : public JOmniFactory<CalorimeterClusterShape_factory, CalorimeterClusterShapeConfig>
0016 {
0017
0018 public:
0019
0020 using AlgoT = eicrecon::CalorimeterClusterShape;
0021
0022 private:
0023
0024
0025 std::unique_ptr<AlgoT> m_algo;
0026
0027
0028 PodioInput<edm4eic::Cluster> m_clusters_input {this};
0029 PodioInput<edm4eic::MCRecoClusterParticleAssociation> m_assocs_input {this};
0030
0031
0032 PodioOutput<edm4eic::Cluster> m_clusters_output {this};
0033 PodioOutput<edm4eic::MCRecoClusterParticleAssociation> m_assocs_output {this};
0034
0035
0036 ParameterRef<bool> m_longitudinalShowerInfoAvailable {this, "longitudinalShowerInfoAvailable", config().longitudinalShowerInfoAvailable};
0037 ParameterRef<std::string> m_energyWeight {this, "energyWeight", config().energyWeight};
0038 ParameterRef<double> m_sampFrac {this, "sampFrac", config().sampFrac};
0039 ParameterRef<std::vector<double>> m_logWeightBaseCoeffs {this, "logWeightBaseCoeffs", config().logWeightBaseCoeffs};
0040 ParameterRef<double> m_logWeightBase_Eref {this, "logWeightBase_Eref", config().logWeightBase_Eref};
0041 ParameterRef<double> m_logWeightBase {this, "logWeightBase", config().logWeightBase};
0042
0043
0044 Service<AlgorithmsInit_service> m_algoInitSvc {this};
0045
0046 public:
0047
0048 void Configure() {
0049 m_algo = std::make_unique<AlgoT>( GetPrefix() );
0050 m_algo->applyConfig( config() );
0051 m_algo->init();
0052 }
0053
0054 void ChangeRun(int64_t run_number) {
0055
0056 }
0057
0058 void Process(int64_t run_number, int64_t event_number) {
0059 m_algo->process(
0060 {m_clusters_input(), m_assocs_input()},
0061 {m_clusters_output().get(), m_assocs_output().get()}
0062 );
0063 }
0064
0065 };
0066
0067 }