Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:24:26

0001 #include "RecoLocalCalo/HcalRecAlgos/interface/HBHENegativeFlag.h"
0002 #include "CalibFormats/CaloObjects/interface/CaloSamples.h"
0003 #include "DataFormats/METReco/interface/HcalCaloFlagLabels.h"
0004 
0005 void HBHENegativeFlagSetter::setPulseShapeFlags(HBHERecHit &hbhe,
0006                                                 const HBHEDataFrame &digi,
0007                                                 const HcalCoder &coder,
0008                                                 const HcalCalibrations &calib) {
0009   if (filter_) {
0010     CaloSamples cs;
0011     coder.adc2fC(digi, cs);
0012     const int nRead = cs.size();
0013 
0014     double ts[CaloSamples::MAXSAMPLES];
0015     for (int i = 0; i < nRead; i++) {
0016       const int capid = digi[i].capid();
0017       ts[i] = cs[i] - calib.pedestal(capid);
0018     }
0019 
0020     const bool passes = filter_->checkPassFilter(hbhe.id(), &ts[0], nRead);
0021     if (!passes)
0022       hbhe.setFlagField(1, HcalCaloFlagLabels::HBHENegativeNoise);
0023   }
0024 }