File indexing completed on 2024-04-06 12:29:30
0001 template <class C>
0002 void EcalZeroSuppressor<C>::findGain12Pedestal(const DetId &detId, double &ped, double &width) {
0003 ped = 200.;
0004 width = 1.;
0005 EcalPedestalsMapIterator mapItr = thePedestals->getMap().find(detId);
0006
0007 if (mapItr == thePedestals->getMap().end()) {
0008 edm::LogError("SetupInfo") << "Could not find pedestal for " << detId.rawId() << " among the "
0009 << thePedestals->getMap().size();
0010 } else {
0011 ped = (*mapItr).mean_x12;
0012 width = (*mapItr).rms_x12;
0013 }
0014 }
0015
0016 template <class C>
0017 bool EcalZeroSuppressor<C>::accept(const C &frame, const double &threshold) {
0018 bool pass = true;
0019
0020 DetId detId = frame.id();
0021
0022 double ped;
0023 double width;
0024 findGain12Pedestal(detId, ped, width);
0025
0026 double Erec = 0.;
0027 Erec = theEnergy_.energy(frame);
0028
0029 if (Erec <= threshold * width)
0030 pass = false;
0031
0032 return pass;
0033 }