2 #include "CLHEP/Random/RandPoissonQ.h"
3 #include "CLHEP/Random/RandGaussQ.h"
20 switch(digitizationType) {
32 for(HGCSimHitDataAccumulator::iterator it=simData.begin();
33 it!=simData.end(); it++) {
37 for(
size_t i=0;
i<it->second.size();
i++) {
39 float totalEn( (it->second)[
i]*1e6 );
45 CLHEP::RandPoissonQ randPoissonQ(*engine, totalIniMIPs*
nPEperMIP_);
46 uint32_t npe = (uint32_t)randPoissonQ.fire();
54 nPixel=(uint32_t)
std::max(
float(CLHEP::RandGaussQ::shoot(engine,(
float)nPixel,(
float)
sdPixels_)),
float(0.) );
57 float totalMIPs(totalIniMIPs);
64 double noiseMIPs=CLHEP::RandGaussQ::shoot(engine,0.,1./
mip2noise_);
65 totalMIPs=
std::max(
float(totalMIPs+noiseMIPs),
float(0.));
68 uint16_t totalEnInt = floor( totalMIPs /
lsbInMIP_ );
72 singleSample.
set(0, totalEnInt );
T getParameter(std::string const &) const
void set(uint16_t gain, uint16_t adc)
HGCHEbackDigitizer(const edm::ParameterSet &ps)
void runCaliceLikeDigitizer(std::auto_ptr< HGCHEDigiCollection > &digiColl, HGCSimHitDataAccumulator &simData, CLHEP::HepRandomEngine *engine)
void runDigitizer(std::auto_ptr< HGCHEDigiCollection > &digiColl, HGCSimHitDataAccumulator &simData, uint32_t digitizationType, CLHEP::HepRandomEngine *engine)
void setSample(int i, const S &sample)
std::unordered_map< uint32_t, HGCSimHitData > HGCSimHitDataAccumulator
void runShaper(HGCHEDataFrame &dataFrame)
applies a shape to each time sample and propagates the tails to the subsequent time samples ...
void updateOutput(std::auto_ptr< DColl > &coll, HGCHEDataFramerawDataFrame)
prepares the output according to the number of time samples to produce