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");
56 if( myCfg_.existsAs<std::vector<double> >(
"chargeCollectionEfficiencies" ) ) {
57 cce_ = myCfg_.getParameter<std::vector<double> >(
"chargeCollectionEfficiencies");
59 std::vector<double>().
swap(cce_);
62 if(myCfg_.existsAs<
double>(
"noise_fC")) {
64 noise_fC_[0] = myCfg_.getParameter<
double>(
"noise_fC");
65 }
else if ( myCfg_.existsAs<std::vector<double> >(
"noise_fC") ) {
66 const auto& noises = myCfg_.getParameter<std::vector<double> >(
"noise_fC");
68 noise_fC_.reserve(noises.size());
69 for(
auto noise : noises ) { noise_fC_.push_back( noise ); }
82 const std::unordered_set<DetId>& validIds,
84 CLHEP::HepRandomEngine* engine) {
85 if(digitizationType==0) runSimple(digiColl,simData,theGeom,validIds,engine);
86 else runDigitizer(digiColl,simData,theGeom,validIds,digitizationType,engine);
93 const std::unordered_set<DetId>& validIds,
94 CLHEP::HepRandomEngine* engine) {
102 for(
const auto&
id : validIds ) {
103 chargeColl.fill(0.
f);
105 HGCSimHitDataAccumulator::iterator it = simData.find(
id);
106 HGCCellInfo& cell = ( simData.end() == it ? zeroData : it->second );
107 addCellMetadata(cell,theGeom,
id);
119 float totalCharge=rawCharge;
123 totalCharge +=
std::max( (
float)CLHEP::RandGaussQ::shoot(engine,0.0,cell.
size*noise_fC_[cell.
thickness-1]) , 0.f );
124 if(totalCharge<0.
f) totalCharge=0.f;
126 chargeColl[
i]= totalCharge;
130 DFr rawDataFrame(
id );
132 myFEelectronics_->runShaper(rawDataFrame, chargeColl, toa, cell.
thickness, engine, cce_[cell.
thickness-1]);
134 myFEelectronics_->runShaper(rawDataFrame, chargeColl, toa, cell.
thickness, engine);
137 updateOutput(coll,rawDataFrame);
143 const DFr& rawDataFrame) {
145 if(rawDataFrame.size()<=itIdx+2)
return;
147 DFr dataFrame( rawDataFrame.id() );
149 bool putInEvent(
false);
150 for(
int it=0;it<5; it++) {
151 dataFrame.setSample(it, rawDataFrame[itIdx-2+it]);
152 if(it==2) putInEvent = rawDataFrame[itIdx-2+it].threshold();
156 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
void swap(Association< C > &lhs, Association< C > &rhs)
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