Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:18

0001 #ifndef L1TObjects_L1RCTParameters_h
0002 #define L1TObjects_L1RCTParameters_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     L1TObjects
0006 // Class  :     L1RCTParameters
0007 //
0008 /**\class L1RCTParameters L1RCTParameters.h CondFormats/L1TObjects/interface/L1RCTParameters.h
0009 
0010  Description: Class to contain parameters which define RCT Lookup Tables
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Author:      Sridhara Dasu
0018 // Created:     Thu Jun 07 06:35 PDT 2007
0019 // $Id:
0020 //
0021 
0022 #include "CondFormats/Serialization/interface/Serializable.h"
0023 
0024 #include <vector>
0025 #include <ostream>
0026 
0027 class L1RCTParameters {
0028 public:
0029   // constructor
0030   L1RCTParameters() {}
0031 
0032   L1RCTParameters(double eGammaLSB,
0033                   double jetMETLSB,
0034                   double eMinForFGCut,
0035                   double eMaxForFGCut,
0036                   double hOeCut,
0037                   double eMinForHoECut,
0038                   double eMaxForHoECut,
0039                   double hMinForHoECut,
0040                   double eActivityCut,
0041                   double hActivityCut,
0042                   unsigned eicIsolationThreshold,
0043                   unsigned jscQuietThresholdBarrel,
0044                   unsigned jscQuietThresholdEndcap,
0045                   bool noiseVetoHB,
0046                   bool noiseVetoHEplus,
0047                   bool noiseVetoHEminus,
0048                   bool useLindsey,
0049                   const std::vector<double>& eGammaECalScaleFactors,
0050                   const std::vector<double>& eGammaHCalScaleFactors,
0051                   const std::vector<double>& jetMETECalScaleFactors,
0052                   const std::vector<double>& jetMETHCalScaleFactors,
0053                   const std::vector<double>& ecal_calib,
0054                   const std::vector<double>& hcal_calib,
0055                   const std::vector<double>& hcal_high_calib,
0056                   const std::vector<double>& cross_terms,
0057                   const std::vector<double>& lowHoverE_smear,
0058                   const std::vector<double>& highHoverE_smear);
0059 
0060   // destructor -- no virtual methods in this class
0061   ~L1RCTParameters() { ; }
0062 
0063   // accessors
0064 
0065   double eGammaLSB() const { return eGammaLSB_; }
0066   double jetMETLSB() const { return jetMETLSB_; }
0067   double eMinForFGCut() const { return eMinForFGCut_; }
0068   double eMaxForFGCut() const { return eMaxForFGCut_; }
0069   double hOeCut() const { return hOeCut_; }
0070   double eMinForHoECut() const { return eMinForHoECut_; }
0071   double eMaxForHoECut() const { return eMaxForHoECut_; }
0072   double hMinForHoECut() const { return hMinForHoECut_; }
0073   double eActivityCut() const { return eActivityCut_; }
0074   double hActivityCut() const { return hActivityCut_; }
0075   unsigned eicIsolationThreshold() const { return eicIsolationThreshold_; }
0076   unsigned jscQuietThresholdBarrel() const { return jscQuietThresholdBarrel_; }
0077   unsigned jscQuietThresholdEndcap() const { return jscQuietThresholdEndcap_; }
0078   bool noiseVetoHB() const { return noiseVetoHB_; }
0079   bool noiseVetoHEplus() const { return noiseVetoHEplus_; }
0080   bool noiseVetoHEminus() const { return noiseVetoHEminus_; }
0081   const std::vector<double>& eGammaECalScaleFactors() const { return eGammaECalScaleFactors_; }
0082   const std::vector<double>& eGammaHCalScaleFactors() const { return eGammaHCalScaleFactors_; }
0083   const std::vector<double>& jetMETECalScaleFactors() const { return jetMETECalScaleFactors_; }
0084   const std::vector<double>& jetMETHCalScaleFactors() const { return jetMETHCalScaleFactors_; }
0085 
0086   // Helper methods to convert from trigger tower (iphi, ieta)
0087   // to RCT (crate, card, tower)
0088 
0089   unsigned short calcCrate(unsigned short rct_iphi, short ieta) const;
0090   unsigned short calcCard(unsigned short rct_iphi, unsigned short absIeta) const;
0091   unsigned short calcTower(unsigned short rct_iphi, unsigned short absIeta) const;
0092   short calcIEta(unsigned short iCrate, unsigned short iCard, unsigned short iTower) const;  // negative eta is used
0093   unsigned short calcIPhi(unsigned short iCrate, unsigned short iCard, unsigned short iTower) const;
0094   unsigned short calcIAbsEta(unsigned short iCrate, unsigned short iCard, unsigned short iTower) const;
0095 
0096   // Sum ecal and hcal TPGs using JetMET / EGamma Correactions and Lindsey's Calibration if flag is set
0097   float JetMETTPGSum(const float& ecal, const float& hcal, const unsigned& iAbsEta) const;
0098   float EGammaTPGSum(const float& ecal, const float& hcal, const unsigned& iAbsEta) const;
0099 
0100   void print(std::ostream& s) const;
0101 
0102 private:
0103   // default constructor is not implemented
0104 
0105   //L1RCTParameters();
0106 
0107   // LSB of the eGamma object corresponds to this ET (in GeV)
0108 
0109   double eGammaLSB_;
0110 
0111   // LSB of the jetMET object corresponds to this ET (in GeV)
0112 
0113   double jetMETLSB_;
0114 
0115   // Minimum ET of the eGamma object below which FG cut is ignored (in GeV)
0116 
0117   double eMinForFGCut_;
0118 
0119   // Maximum ET of the eGamma object above which FG cut is ignored (in GeV)
0120 
0121   double eMaxForFGCut_;
0122 
0123   // H/E ratio cut
0124 
0125   double hOeCut_;
0126 
0127   // Minimum ET of the ecal (in GeV) below which H/E always passes
0128 
0129   double eMinForHoECut_;
0130 
0131   // Maximum ET of the ecal (in GeV) above which H/E always passes
0132 
0133   double eMaxForHoECut_;
0134 
0135   // Minimum ET of the hcal (in GeV) above which H/E always fails (veto true)
0136 
0137   double hMinForHoECut_;
0138 
0139   // If the ET of the ECAL trigger tower is above this value
0140   // the tower is deemed active (in GeV)  --  these are used
0141   // for tau pattern logic
0142 
0143   double eActivityCut_;
0144 
0145   // If the ET of the HCAL trigger tower is above this value
0146   // the tower is deemed active (in GeV) -- these are used
0147   // for tau pattern logic
0148 
0149   double hActivityCut_;
0150 
0151   // This parameter is used for the five-tower-corner isolation
0152   // algorithm in the electron isolation card.  If one corner
0153   // set of five neighbor towers falls below this threshold,
0154   // the electron candidate is isolated.
0155 
0156   unsigned eicIsolationThreshold_;
0157 
0158   // 9-bit threshold below which quiet bit is set for a barrel region in JSC
0159   // (i.e. receiver cards 0-3)
0160 
0161   unsigned jscQuietThresholdBarrel_;
0162 
0163   // 9-bit threshold below which quiet bit is set for an endcap region in JSC
0164   // (i.e. receiver cards 4-6)
0165 
0166   unsigned jscQuietThresholdEndcap_;
0167 
0168   // Ignores HCAL barrel energy if no ECAL energy in corresponding
0169   // tower -- to reduce HCAL noise.  Endcaps enabled separately
0170   // to allow for lack of one/both ECAL endcaps.
0171 
0172   bool noiseVetoHB_;
0173 
0174   // Ignores HCAL energy in plus endcap if no ECAL energy in
0175   // corresponding tower.
0176 
0177   bool noiseVetoHEplus_;
0178 
0179   // Ignores HCAL energy in minus endcap if no ECAL energy in
0180   // corresponding tower.
0181 
0182   bool noiseVetoHEminus_;
0183 
0184   // Use Cubic Fitting Corrections ?
0185   bool useCorrections_;
0186 
0187   // eGamma object ET is computed using the trigger tower ET defined as
0188   // ecal * eGammaECalScaleFactors[iEta] + hcal * eGammaHCalScaleFactors[iEta]
0189   // The result is then digitized using the eGamma LSB
0190 
0191   std::vector<double> eGammaECalScaleFactors_;
0192   std::vector<double> eGammaHCalScaleFactors_;
0193 
0194   // jetMET object ET is computed using the trigger tower ET defined as
0195   // ecal * jetMETECalScaleFactors[iEta] + hcal * jetMETHCalScaleFactors[iEta]
0196   // The result is then digitized using the jetMET LSB
0197 
0198   std::vector<double> jetMETECalScaleFactors_;
0199   std::vector<double> jetMETHCalScaleFactors_;
0200 
0201   // Applies Lindsey's calibration to HCAL and ECAL (ECAL must corrected by eGamma scale factors)
0202   // Provides corrected Et sum.
0203   float correctedTPGSum(const float& ecal, const float& hcal, const unsigned& index) const;
0204 
0205   // Lindsey's Calibration Coefficients
0206   // Basically a higher order approximation of the energy response of the calorimeters.
0207   // Powers in ecal and hcal Et are defined below.
0208   std::vector<std::vector<double> > ecal_calib_;       // [0] = ecal^3, [1] = ecal^2, [2] = ecal
0209   std::vector<std::vector<double> > hcal_calib_;       // [0] = hcal^3, [1] = hcal^2, [2] = hcal
0210   std::vector<std::vector<double> > hcal_high_calib_;  // same as above but used to capture Et dependence for large Et
0211   std::vector<std::vector<double> > cross_terms_;      // [0] = ecal^2*hcal, [1] = hcal^2*ecal, [2] = ecal*hcal
0212                                                        // [3] = ecal^3*hcal, [1] = hcal^3*ecal, [2] = ecal^2*hcal^2
0213   // These two sets of correction factors help to center the corrected
0214   // Et distributions for different values of H/E.
0215   std::vector<double> HoverE_smear_low_;
0216   std::vector<double> HoverE_smear_high_;
0217 
0218   COND_SERIALIZABLE;
0219 };
0220 
0221 #endif