3 #include "CLHEP/Random/RandPoissonQ.h"
4 #include "CLHEP/Random/RandGaussQ.h"
9 #include "vdt/vdtMath.h"
11 using namespace hgc_digi;
16 const DetId& detid ) {
24 const DetId& detid ) {
27 uint32_t id(detid.
rawId());
32 waferTypeL = dddConst.waferTypeL(wafer);
33 isHalf = dddConst.isHalfCell(wafer,hid.cell());
35 info.
size = (isHalf ? 0.5 : 1.0);
41 const DetId& detid ) {
44 addCellMetadata(info,hc,detid);
47 addCellMetadata(info,hg,detid);
69 uint32_t digitizationType, CLHEP::HepRandomEngine* engine)
77 CLHEP::HepRandomEngine* engine)
89 for(
const auto&
id : validIds ) {
91 HGCSimHitDataAccumulator::iterator it = simData.find(
id);
92 HGCCellInfo& cell = ( simData.end() == it ? zeroData : it->second );
93 addCellMetadata(cell,theGeom,
id);
102 const uint32_t npe = std::floor(CLHEP::RandPoissonQ::shoot(engine,totalIniMIPs*
nPEperMIP_));
110 nPixel = (uint32_t)
std::max( CLHEP::RandGaussQ::shoot(engine,(
double)nPixel,
sdPixels_), 0. );
113 float totalMIPs(0.
f), xtalk = 0.f;
114 const float peDiff =
nTotalPE_ - (float) nPixel;
117 if( xtalk > 0.
f && nPEperMIP_ != 0.
f)
124 std::cout <<
"[runCaliceLikeDigitizer] xtalk=" << xtalk <<
" En=" << cell.
hit_info[0][
i] <<
" keV -> " << totalIniMIPs <<
" raw-MIPs -> " << chargeColl[
i] <<
" digi-MIPs" << std::endl;
T getParameter(std::string const &) const
void updateOutput(std::unique_ptr< DColl > &coll, const HGCBHDataFrame &rawDataFrame)
prepares the output according to the number of time samples to produce
std::array< HGCSimHitData, 2 > hit_info
std::array< HGCSimData_t, nSamples > HGCSimHitData
uint32_t rawId() const
get the raw id
HGCHEbackDigitizer(const edm::ParameterSet &ps)
std::unordered_map< uint32_t, HGCCellInfo > HGCSimHitDataAccumulator
void runDigitizer(std::unique_ptr< HGCBHDigiCollection > &digiColl, hgc::HGCSimHitDataAccumulator &simData, const CaloSubdetectorGeometry *theGeom, const std::unordered_set< DetId > &validIds, uint32_t digitizationType, CLHEP::HepRandomEngine *engine) override
const HGCalTopology & topology() const
std::unique_ptr< HGCFEElectronics< HGCBHDataFrame > > myFEelectronics_
int wafer() const
get the wafer #
const HGCalDDDConstants & dddConstants() const
void runCaliceLikeDigitizer(std::unique_ptr< HGCBHDigiCollection > &digiColl, hgc::HGCSimHitDataAccumulator &simData, const CaloSubdetectorGeometry *theGeom, const std::unordered_set< DetId > &validIds, CLHEP::HepRandomEngine *engine)
Detector det() const
get the detector field from this detid