File indexing completed on 2026-08-18 08:30:33
0001
0002
0003
0004 #pragma once
0005
0006 #include <cstdint>
0007 #include <memory>
0008
0009 #include <edm4hep/EventHeader.h>
0010
0011 #include "algorithms/digi/RandomNoisePixel.h"
0012 #include "algorithms/digi/RandomNoisePixelConfig.h"
0013 #include "extensions/jana/JOmniFactory.h"
0014
0015 namespace eicrecon {
0016
0017 class RandomNoisePixel_factory
0018 : public JOmniFactory<RandomNoisePixel_factory, RandomNoisePixelConfig> {
0019 public:
0020 using AlgoT = eicrecon::RandomNoisePixel;
0021
0022 private:
0023 std::unique_ptr<AlgoT> m_algo;
0024
0025 PodioInput<edm4hep::EventHeader> m_in_event_header{this};
0026 PodioOutput<edm4eic::RawTrackerHit> m_out_hits{this};
0027
0028 ParameterRef<bool> m_addNoise{this, "addNoise", config().addNoise};
0029 ParameterRef<double> m_noise_rate{this, "noiseRate", config().noise_rate_per_pixel_per_event,
0030 "Noise occupancy per pixel per event"};
0031 ParameterRef<std::string> m_readout_name{this, "readout_name", config().readout_name};
0032
0033 public:
0034 void Configure() {
0035 m_algo = std::make_unique<AlgoT>(GetPrefix());
0036 m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
0037 m_algo->applyConfig(config());
0038 m_algo->init();
0039 }
0040
0041 void Process(int32_t , uint64_t ) override {
0042 m_algo->process({m_in_event_header()}, {m_out_hits().get()});
0043 }
0044 };
0045
0046 }