File indexing completed on 2026-09-17 09:10:35
0001
0002
0003
0004 #pragma once
0005
0006 #include <edm4eic/EDM4eicVersion.h>
0007 #include "algorithms/calorimetry/CalorimeterHitDigi.h"
0008 #include "services/algorithms_init/AlgorithmsInit_service.h"
0009 #include "extensions/jana/JOmniFactory.h"
0010
0011 namespace eicrecon {
0012
0013 class CalorimeterHitDigi_factory
0014 : public JOmniFactory<CalorimeterHitDigi_factory, CalorimeterHitDigiConfig> {
0015
0016 public:
0017 using AlgoT = eicrecon::CalorimeterHitDigi;
0018
0019 private:
0020 std::unique_ptr<AlgoT> m_algo;
0021
0022 PodioInput<edm4hep::EventHeader> m_event_headers_input{this};
0023 PodioInput<edm4hep::SimCalorimeterHit> m_hits_input{this};
0024 PodioOutput<edm4hep::RawCalorimeterHit> m_hits_output{this};
0025 PodioOutput<edm4eic::MCRecoCalorimeterHitLink> m_links_output{this};
0026 PodioOutput<edm4eic::MCRecoCalorimeterHitAssociation> m_hit_assocs_output{this};
0027
0028 ParameterRef<std::vector<double>> m_energyResolutions{this, "energyResolutions", config().eRes};
0029 ParameterRef<double> m_timeResolution{this, "timeResolution", config().tRes};
0030 ParameterRef<unsigned int> m_capADC{this, "capacityADC", config().capADC};
0031 ParameterRef<double> m_dyRangeADC{this, "dynamicRangeADC", config().dyRangeADC};
0032 ParameterRef<unsigned int> m_pedMeanADC{this, "pedestalMean", config().pedMeanADC};
0033 ParameterRef<double> m_pedSigmaADC{this, "pedestalSigma", config().pedSigmaADC};
0034 ParameterRef<double> m_resolutionTDC{this, "resolutionTDC", config().resolutionTDC};
0035 ParameterRef<std::string> m_corrMeanScale{this, "scaleResponse", config().corrMeanScale};
0036 ParameterRef<std::vector<std::string>> m_fields{this, "signalSumFields", config().fields};
0037 ParameterRef<std::string> m_readout{this, "readoutClass", config().readout};
0038 ParameterRef<std::string> m_readoutType{this, "readoutType", config().readoutType};
0039 ParameterRef<double> m_lightYield{this, "lightYield", config().lightYield};
0040 ParameterRef<double> m_photonDetectionEfficiency{this, "photonDetectionEfficiency",
0041 config().photonDetectionEfficiency};
0042 ParameterRef<unsigned long long> m_numEffectiveSipmPixels{this, "numEffectiveSipmPixels",
0043 config().numEffectiveSipmPixels};
0044
0045 Service<AlgorithmsInit_service> m_algorithmsInit{this};
0046
0047 public:
0048 void Configure() {
0049 m_algo = std::make_unique<AlgoT>(GetPrefix());
0050 m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
0051 m_algo->applyConfig(config());
0052 m_algo->init();
0053 }
0054
0055 void Process(int32_t , uint64_t ) {
0056 m_algo->process({m_event_headers_input(), m_hits_input()},
0057 {m_hits_output().get(), m_links_output().get(), m_hit_assocs_output().get()});
0058 }
0059 };
0060
0061 }