Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:33

0001 
0002 //HcalFeatureHFEMBit
0003 //version 2.0
0004 
0005 #include "SimCalorimetry/HcalTrigPrimAlgos/interface/HcalFeatureHFEMBit.h"
0006 #include "CondFormats/HcalObjects/interface/HcalQIECoder.h"
0007 
0008 HcalFeatureHFEMBit::HcalFeatureHFEMBit(double ShortMinE,
0009                                        double LongMinE,
0010                                        double ShortLongCutSlope,
0011                                        double ShortLongCutOffset,
0012                                        const HcalDbService& conditions)
0013     : conditions_(conditions) {
0014   ShortMinE_ = ShortMinE;  //minimum energy deposited
0015   LongMinE_ = LongMinE;
0016   ShortLongCutSlope_ =
0017       ShortLongCutSlope;  // this is a the slope of the cut line related to energy deposited in short fibers vrs long fibers
0018   ShortLongCutOffset_ = ShortLongCutOffset;  // this is the offset of said line.
0019 }
0020 
0021 HcalFeatureHFEMBit::~HcalFeatureHFEMBit() {}
0022 
0023 bool HcalFeatureHFEMBit::fineGrainbit(const HFDataFrame& shortDigi, const HFDataFrame& longDigi, int idx) const {
0024   float shortE = getE(shortDigi, idx);
0025   float longE = getE(longDigi, idx);
0026 
0027   if (shortE < ShortMinE_)
0028     return false;
0029   if (longE < LongMinE_)
0030     return false;
0031 
0032   return (shortE < (longE - ShortLongCutOffset_) * ShortLongCutSlope_);
0033 }
0034 
0035 bool HcalFeatureHFEMBit::fineGrainbit(const QIE10DataFrame& short1,
0036                                       const QIE10DataFrame& short2,
0037                                       const QIE10DataFrame& long1,
0038                                       const QIE10DataFrame& long2,
0039                                       bool validShort1,
0040                                       bool validShort2,
0041                                       bool validLong1,
0042                                       bool validLong2,
0043                                       int idx) const {
0044   float shortE = 0;
0045   if (validShort1)
0046     shortE += getE(short1, idx);
0047   if (validShort2)
0048     shortE += getE(short2, idx);
0049   if (validShort1 and validShort2)
0050     shortE *= .5;
0051 
0052   float longE = 0;
0053   if (validLong1)
0054     longE += getE(long1, idx);
0055   if (validLong2)
0056     longE += getE(long2, idx);
0057   if (validLong1 and validLong2)
0058     longE *= .5;
0059 
0060   if (shortE < ShortMinE_)
0061     return false;
0062   if (longE < LongMinE_)
0063     return false;
0064 
0065   return (shortE < (longE - ShortLongCutOffset_) * ShortLongCutSlope_);
0066 }