10 : scaleByDose_(
false), NoiseMean_(0.0), NoiseStd_(1.0) {
23 .
template getParameter<std::vector<double>>(
"values");
62 const double NoiseMean,
63 const double NoiseStd) {
64 for (
size_t i = 0;
i < NoiseArrayLength_;
i++) {
65 for (
size_t j = 0;
j < samplesize_;
j++) {
66 GaussianNoiseArray_[
i][
j] = CLHEP::RandGaussQ::shoot(engine, NoiseMean, NoiseStd);
75 const std::unordered_set<DetId>& validIds,
77 CLHEP::HepRandomEngine* engine) {
79 scal_.setGeometry(theGeom);
80 if (NoiseGeneration_Method_ ==
true) {
81 if (RandNoiseGenerationFlag_ ==
false) {
82 GenerateGaussianNoise(engine, NoiseMean_, NoiseStd_);
83 RandNoiseGenerationFlag_ =
true;
87 runSimple(
digiColl, simData, theGeom, validIds, engine);
96 const std::unordered_set<DetId>& validIds,
97 CLHEP::HepRandomEngine* engine) {
104 std::array<double, samplesize_> cellNoiseArray;
105 for (
size_t i = 0;
i < samplesize_;
i++)
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);
113 if (NoiseGeneration_Method_ ==
true) {
114 size_t hash_index = (CLHEP::RandFlat::shootInt(engine, (NoiseArrayLength_ - 1)) +
id) % NoiseArrayLength_;
116 cellNoiseArray = GaussianNoiseArray_[hash_index];
119 float cce(1.
f), noiseWidth(0.
f), lsbADC(-1.
f), maxADC(-1.
f);
121 uint32_t thrADC(std::floor(myFEelectronics_->getTargetMipValue() / 2));
122 uint32_t gainIdx = 0;
126 scal_.getSiCellOpCharacteristics(detId,
HGCalSiNoiseMap::AUTO, myFEelectronics_->getTargetMipValue());
128 noiseWidth = siop.
noise;
133 if (thresholdFollowsMIP_)
135 }
else if (noise_fC_[cell.
thickness - 1] != 0) {
139 cce = (cce_.empty() ? 1.f : cce_[cell.
thickness - 1]);
143 ? std::floor(cell.
thickness * cce * myFEelectronics_->getADCThreshold() / myFEelectronics_->getADClsb())
144 : std::floor(cell.
thickness * myFEelectronics_->getADCThreshold() / myFEelectronics_->getADClsb());
148 for (
size_t i = 0;
i < cell.
hit_info[0].size();
i++) {
158 if (NoiseGeneration_Method_ ==
true)
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);
174 updateOutput(coll, rawDataFrame);
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);