10 const DetId& detid ) {
18 const DetId& detid ) {
26 waferTypeL = dddConst.waferTypeL(wafer);
27 isHalf = dddConst.isHalfCell(wafer,hid.cell());
29 info.
size = (isHalf ? 0.5 : 1.0);
35 const DetId& detid ) {
38 addCellMetadata(info,hc,detid);
41 addCellMetadata(info,hg,detid);
52 doTimeSamples_ = myCfg_.
getParameter<
bool >(
"doTimeSamples");
53 if(myCfg_.exists(
"keV2fC")) keV2fC_ = myCfg_.getParameter<
double>(
"keV2fC");
55 if(myCfg_.existsAs<
double>(
"noise_fC")) {
57 noise_fC_[0] = myCfg_.getParameter<
double>(
"noise_fC");
58 }
else if ( myCfg_.existsAs<std::vector<double> >(
"noise_fC") ) {
59 const auto& noises = myCfg_.getParameter<std::vector<double> >(
"noise_fC");
61 noise_fC_.reserve(noises.size());
62 for(
auto noise : noises ) { noise_fC_.push_back( noise ); }
75 const std::unordered_set<DetId>& validIds,
77 CLHEP::HepRandomEngine* engine) {
78 if(digitizationType==0) runSimple(digiColl,simData,theGeom,validIds,engine);
79 else runDigitizer(digiColl,simData,theGeom,validIds,digitizationType,engine);
86 const std::unordered_set<DetId>& validIds,
87 CLHEP::HepRandomEngine* engine) {
95 for(
const auto&
id : validIds ) {
98 HGCSimHitDataAccumulator::iterator it = simData.find(
id);
99 HGCCellInfo& cell = ( simData.end() == it ? zeroData : it->second );
100 addCellMetadata(cell,theGeom,
id);
112 float totalCharge=rawCharge;
116 totalCharge +=
std::max( (
float)CLHEP::RandGaussQ::shoot(engine,0.0,cell.
size*noise_fC_[cell.
thickness-1]) , 0.f );
117 if(totalCharge<0.
f) totalCharge=0.f;
119 chargeColl[
i]= totalCharge;
123 DFr rawDataFrame(
id );
124 myFEelectronics_->runShaper(rawDataFrame, chargeColl, toa, cell.
thickness, engine);
127 updateOutput(coll,rawDataFrame);
133 const DFr& rawDataFrame) {
135 if(rawDataFrame.size()<=itIdx+2)
return;
137 DFr dataFrame( rawDataFrame.id() );
139 bool putInEvent(
false);
140 for(
int it=0;it<5; it++) {
141 dataFrame.setSample(it, rawDataFrame[itIdx-2+it]);
142 if(it==2) putInEvent = rawDataFrame[itIdx-2+it].threshold();
146 coll->push_back(dataFrame);
T getParameter(std::string const &) const
void runSimple(std::unique_ptr< DColl > &coll, hgc::HGCSimHitDataAccumulator &simData, const CaloSubdetectorGeometry *theGeom, const std::unordered_set< DetId > &validIds, CLHEP::HepRandomEngine *engine)
a trivial digitization: sum energies and digitize without noise
void updateOutput(std::unique_ptr< DColl > &coll, const DFr &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
std::unordered_map< uint32_t, HGCCellInfo > HGCSimHitDataAccumulator
void run(std::unique_ptr< DColl > &digiColl, hgc::HGCSimHitDataAccumulator &simData, const CaloSubdetectorGeometry *theGeom, const std::unordered_set< DetId > &validIds, uint32_t digitizationType, CLHEP::HepRandomEngine *engine)
steer digitization mode
const HGCalTopology & topology() const
int wafer() const
get the wafer #
HGCDigitizerBase(const edm::ParameterSet &ps)
CTOR.
const HGCalDDDConstants & dddConstants() const
models the behavior of the front-end electronics
Detector det() const
get the detector field from this detid