File indexing completed on 2025-01-18 09:14:07
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <DD4hep/InstanceCount.h>
0016 #include <DDDigi/noise/DigiPoissonNoise.h>
0017 #include <DDDigi/DigiSegmentation.h>
0018 #include <DDDigi/DigiRandomGenerator.h>
0019
0020 using namespace dd4hep::digi;
0021
0022
0023 DigiPoissonNoise::DigiPoissonNoise(const DigiKernel& krnl, const std::string& nam)
0024 : DigiSignalProcessor(krnl, nam)
0025 {
0026 declareProperty("meam", m_mean);
0027 declareProperty("cutoff", m_cutoff);
0028 InstanceCount::increment(this);
0029 }
0030
0031
0032 DigiPoissonNoise::~DigiPoissonNoise() {
0033 InstanceCount::decrement(this);
0034 }
0035
0036
0037 double DigiPoissonNoise::operator()(DigiCellContext& context) const {
0038 if ( context.data.signal >= m_cutoff )
0039 return 0;
0040 return context.context.randomGenerator().poisson(m_mean);
0041 }