12 doTimeSamples_ = myCfg_.
getParameter<
bool >(
"doTimeSamples");
13 if(myCfg_.exists(
"keV2fC")) keV2fC_ = myCfg_.getParameter<
double>(
"keV2fC");
17 cce_ = myCfg_.getParameter<
edm::ParameterSet>(
"chargeCollectionEfficiencies").
template getParameter<std::vector<double>>(
"values");
20 if(myCfg_.existsAs<
double>(
"noise_fC")) {
22 noise_fC_.push_back(myCfg_.getParameter<
double>(
"noise_fC"));
23 }
else if ( myCfg_.existsAs<std::vector<double> >(
"noise_fC") ) {
24 const auto&
noises = myCfg_.getParameter<std::vector<double> >(
"noise_fC");
25 noise_fC_ = std::vector<float>(
noises.begin(),
noises.end());
27 const auto&
noises = myCfg_.getParameter<
edm::ParameterSet>(
"noise_fC").
template getParameter<std::vector<double> >(
"values");
28 noise_fC_ = std::vector<float>(
noises.begin(),
noises.end());
30 noise_fC_.resize(1,1.
f);
34 myFEelectronics_->SetNoiseValues(noise_fC_);
41 const std::unordered_set<DetId>& validIds,
43 CLHEP::HepRandomEngine* engine) {
44 if(digitizationType==0) runSimple(digiColl,simData,theGeom,validIds,engine);
45 else runDigitizer(digiColl,simData,theGeom,validIds,digitizationType,engine);
52 const std::unordered_set<DetId>& validIds,
53 CLHEP::HepRandomEngine* engine) {
61 for(
const auto&
id : validIds ) {
64 HGCSimHitDataAccumulator::iterator it = simData.find(
id);
65 HGCCellInfo& cell = ( simData.end() == it ? zeroData : it->second );
78 float totalCharge=rawCharge;
84 totalCharge +=
std::max( (
float)CLHEP::RandGaussQ::shoot(engine,0.0,cell.
size*noise_fC_[cell.
thickness-1]) , 0.f );
85 if(totalCharge<0.
f) totalCharge=0.f;
87 chargeColl[
i]= totalCharge;
91 DFr rawDataFrame(
id );
93 myFEelectronics_->runShaper(rawDataFrame, chargeColl, toa, cell.
thickness, engine, cce_[cell.
thickness-1]);
95 myFEelectronics_->runShaper(rawDataFrame, chargeColl, toa, cell.
thickness, engine);
98 updateOutput(coll,rawDataFrame);
104 const DFr& rawDataFrame) {
106 if(rawDataFrame.size()<=itIdx+2)
return;
108 DFr dataFrame( rawDataFrame.id() );
110 bool putInEvent(
false);
111 for(
int it=0;it<5; it++) {
112 dataFrame.setSample(it, rawDataFrame[itIdx-2+it]);
113 if(it==2) putInEvent = rawDataFrame[itIdx-2+it].threshold();
117 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
void addCellMetadata(HGCCellInfo &info, const HcalGeometry *geom, const DetId &detid)
std::array< HGCSimHitData, 2 > hit_info
std::array< HGCSimData_t, nSamples > HGCSimHitData
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
HGCDigitizerBase(const edm::ParameterSet &ps)
CTOR.
models the behavior of the front-end electronics