10 : scaleByDose_(
false), NoiseMean_(0.0), NoiseStd_(1.0) {
16 if (myCfg_.exists(
"keV2fC"))
17 keV2fC_ = myCfg_.getParameter<
double>(
"keV2fC");
23 .
template getParameter<std::vector<double>>(
"values");
26 if (myCfg_.existsAs<
double>(
"noise_fC")) {
28 noise_fC_.push_back(myCfg_.getParameter<
double>(
"noise_fC"));
29 }
else if (myCfg_.existsAs<std::vector<double>>(
"noise_fC")) {
30 const auto&
noises = myCfg_.getParameter<std::vector<double>>(
"noise_fC");
34 myCfg_.getParameter<
edm::ParameterSet>(
"noise_fC").
template getParameter<std::vector<double>>(
"values");
38 myCfg_.getParameter<
edm::ParameterSet>(
"noise_fC").
template getParameter<uint32_t>(
"scaleByDoseAlgo");
46 myCfg_.getParameter<
edm::ParameterSet>(
"ileakParam").template getParameter<std::vector<double>>(
"ileakParam"));
50 myCfg_.getParameter<
edm::ParameterSet>(
"cceParams").template getParameter<std::vector<double>>(
"cceParamFine"),
56 myFEelectronics_->SetNoiseValues(
noise_fC_);
62 const double NoiseMean,
63 const double NoiseStd) {
75 const std::unordered_set<DetId>& validIds,
77 CLHEP::HepRandomEngine* engine) {
86 if (digitizationType == 0)
87 runSimple(digiColl, simData, theGeom, validIds, engine);
89 runDigitizer(digiColl, simData, theGeom, validIds, digitizationType, engine);
96 const std::unordered_set<DetId>& validIds,
97 CLHEP::HepRandomEngine* engine) {
104 std::array<double, samplesize_> cellNoiseArray;
106 cellNoiseArray[
i] = 0.0;
107 for (
const auto&
id : validIds) {
108 chargeColl.fill(0.
f);
110 HGCSimHitDataAccumulator::iterator it = simData.find(
id);
111 HGCCellInfo& cell = (simData.end() == it ? zeroData : it->second);
119 float cce(1.
f), noiseWidth(0.
f), lsbADC(-1.
f), maxADC(-1.
f);
122 uint32_t gainIdx = 0;
128 noiseWidth = siop.
noise;
148 for (
size_t i = 0;
i < cell.
hit_info[0].size();
i++) {
161 noise = CLHEP::RandGaussQ::shoot(engine, cellNoiseArray[
i], noiseWidth);
162 float totalCharge(rawCharge * cce +
noise);
163 if (totalCharge < 0.
f)
165 chargeColl[
i] = totalCharge;
169 DFr rawDataFrame(
id);
171 myFEelectronics_->runShaper(rawDataFrame, chargeColl, toa, engine, thrADC, lsbADC, gainIdx, maxADC, thickness);
181 if (rawDataFrame.size() <= itIdx + 2)
184 DFr dataFrame(rawDataFrame.id());
186 bool putInEvent(
false);
187 for (
int it = 0; it < 5; it++) {
188 dataFrame.setSample(it, rawDataFrame[itIdx - 2 + it]);
190 putInEvent = rawDataFrame[itIdx - 2 + it].threshold();
194 coll->push_back(dataFrame);
void setIleakParam(const std::vector< double > &pars)
set the ileak parameters to use
std::vector< float > noise_fC_
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 setGeometry(const CaloSubdetectorGeometry *)
std::unordered_map< uint32_t, HGCCellInfo > HGCSimHitDataAccumulator
std::vector< double > & getMaxADCPerGain()
void addCellMetadata(HGCCellInfo &info, const HcalGeometry *geom, const DetId &detid)
std::vector< double > & getLSBPerGain()
std::array< HGCSimData_t, nSamples > HGCSimHitData
void setDoseMap(const std::string &, const unsigned int &)
overrides base class method with specifics for the configuration of the algo
SiCellOpCharacteristics getSiCellOpCharacteristics(const HGCSiliconDetId &did, GainRange_t gain=GainRange_t::AUTO, int aimMIPtoADC=10)
returns the charge collection efficiency and noise if gain range is set to auto, it will find the mos...
bool thresholdFollowsMIP_
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
std::array< HGCSimHitData, 2 > hit_info
bool RandNoiseGenerationFlag_
std::unique_ptr< HGCFEElectronics< DFr > > myFEelectronics_
void setCceParam(const std::vector< double > &parsFine, const std::vector< double > &parsThin, const std::vector< double > &parsThick)
set the cce parameters to use
std::array< std::array< double, samplesize_ >, NoiseArrayLength_ > GaussianNoiseArray_
HGCDigitizerBase(const edm::ParameterSet &ps)
CTOR.
std::vector< double > cce_
bool NoiseGeneration_Method_
void GenerateGaussianNoise(CLHEP::HepRandomEngine *engine, const double NoiseMean, const double NoiseStd)
Gaussian Noise Generation Member Function.
virtual void runDigitizer(std::unique_ptr< DColl > &coll, hgc::HGCSimHitDataAccumulator &simData, const CaloSubdetectorGeometry *theGeom, const std::unordered_set< DetId > &validIds, uint32_t digitizerType, CLHEP::HepRandomEngine *engine)
to be specialized by top class
static const size_t NoiseArrayLength_
models the behavior of the front-end electronics
static const size_t samplesize_