Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:18:48

0001 #ifndef GUARD_HCALHF_PETALGORITHM_H
0002 #define GUARD_HCALHF_PETALGORITHM_H 1
0003 
0004 #include "DataFormats/HcalRecHit/interface/HFRecHit.h"
0005 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0006 #include "DataFormats/METReco/interface/HcalCaloFlagLabels.h"
0007 
0008 // Forward declarations
0009 class HcalChannelQuality;
0010 class HcalSeverityLevelComputer;
0011 
0012 /**  \class HcalHF_PETalgorithm
0013 
0014    Class evaluates the ratio |(L-S)/(L+S)| for a given cell, and flags the 
0015    cell if the threshold exceeds a given maximum value R(Energy).
0016    Each cell must also pass ieta-dependent energy and ET cuts to be considered for flagging.
0017 
0018    \author J. Temple and D. Ferencek
0019 */
0020 
0021 class HcalHF_PETalgorithm {
0022 public:
0023   /** Constructors **/
0024   HcalHF_PETalgorithm();
0025 
0026   HcalHF_PETalgorithm(const std::vector<double>& short_R,
0027                       const std::vector<double>& short_Energy,
0028                       const std::vector<double>& short_ET,
0029                       const std::vector<double>& long_R,
0030                       const std::vector<double>& long_Energy,
0031                       const std::vector<double>& long_ET,
0032                       int HcalAcceptSeverityLevel,
0033                       // special case for ieta=29
0034                       const std::vector<double>& short_R_29,
0035                       const std::vector<double>& long_R_29);
0036 
0037   // Destructor
0038   ~HcalHF_PETalgorithm();
0039 
0040   void HFSetFlagFromPET(HFRecHit& hf,
0041                         HFRecHitCollection& rec,
0042                         const HcalChannelQuality* myqual,
0043                         const HcalSeverityLevelComputer* mySeverity);
0044   double CalcThreshold(double abs_energy, const std::vector<double>& params);
0045 
0046   void SetShort_R(const std::vector<double>& x) { short_R = x; }
0047   void SetShort_ET_Thresh(const std::vector<double>& x) { short_ET_Thresh = x; }
0048   void SetShort_Energy_Thresh(const std::vector<double>& x) { short_Energy_Thresh = x; }
0049   void SetLong_R(const std::vector<double>& x) { long_R = x; }
0050   void SetLong_ET_Thresh(const std::vector<double>& x) { long_ET_Thresh = x; }
0051   void SetLong_Energy_Thresh(const std::vector<double>& x) { long_Energy_Thresh = x; }
0052 
0053   std::vector<double> GetShort_R() { return short_R; }
0054   std::vector<double> GetShort_ET_Thresh() { return short_ET_Thresh; }
0055   std::vector<double> GetShort_Energy_Thresh() { return short_Energy_Thresh; }
0056   std::vector<double> GetLong_R() { return long_R; }
0057   std::vector<double> GetLong_ET_Thresh() { return long_ET_Thresh; }
0058   std::vector<double> GetLong_Energy_Thresh() { return long_Energy_Thresh; }
0059 
0060   double bit() { return HcalCaloFlagLabels::HFLongShort; }
0061 
0062 private:
0063   std::vector<double> short_R;
0064   std::vector<double> short_ET_Thresh;
0065   std::vector<double> short_Energy_Thresh;
0066 
0067   std::vector<double> long_R;
0068   std::vector<double> long_ET_Thresh;
0069   std::vector<double> long_Energy_Thresh;
0070   int HcalAcceptSeverityLevel_;
0071   std::vector<double> short_R_29;
0072   std::vector<double> long_R_29;
0073 };
0074 
0075 #endif