CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/CondFormats/L1TObjects/interface/L1RCTParameters.h

Go to the documentation of this file.
00001 #ifndef L1TObjects_L1RCTParameters_h
00002 #define L1TObjects_L1RCTParameters_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     L1TObjects
00006 // Class  :     L1RCTParameters
00007 // 
00016 //
00017 // Author:      Sridhara Dasu
00018 // Created:     Thu Jun 07 06:35 PDT 2007
00019 // $Id: 
00020 //
00021 
00022 #include <boost/cstdint.hpp>
00023 #include <vector>
00024 #include <ostream>
00025 
00026 class L1RCTParameters {
00027 
00028  public:
00029 
00030   // constructor
00031   L1RCTParameters() {}
00032 
00033   L1RCTParameters(double eGammaLSB,
00034                   double jetMETLSB,
00035                   double eMinForFGCut,
00036                   double eMaxForFGCut,
00037                   double hOeCut,
00038                   double eMinForHoECut,
00039                   double eMaxForHoECut,
00040                   double hMinForHoECut,
00041                   double eActivityCut,
00042                   double hActivityCut,
00043                   unsigned eicIsolationThreshold,
00044                   unsigned jscQuietThresholdBarrel,
00045                   unsigned jscQuietThresholdEndcap,
00046                   bool noiseVetoHB,
00047                   bool noiseVetoHEplus,
00048                   bool noiseVetoHEminus,
00049                   bool useLindsey,
00050                   const std::vector<double>& eGammaECalScaleFactors,
00051                   const std::vector<double>& eGammaHCalScaleFactors,
00052                   const std::vector<double>& jetMETECalScaleFactors,
00053                   const std::vector<double>& jetMETHCalScaleFactors,
00054                   const std::vector<double>& ecal_calib,
00055                   const std::vector<double>& hcal_calib,
00056                   const std::vector<double>& hcal_high_calib,
00057                   const std::vector<double>& cross_terms,
00058                   const std::vector<double>& lowHoverE_smear,
00059                   const std::vector<double>& highHoverE_smear
00060                   );
00061 
00062   // destructor -- no virtual methods in this class
00063   ~L1RCTParameters() {;}
00064   
00065   // accessors
00066   
00067   double eGammaLSB() const {return eGammaLSB_;}
00068   double jetMETLSB() const {return jetMETLSB_;}
00069   double eMinForFGCut() const {return eMinForFGCut_;}
00070   double eMaxForFGCut() const {return eMaxForFGCut_;}
00071   double hOeCut() const {return hOeCut_;}
00072   double eMinForHoECut() const {return eMinForHoECut_;}
00073   double eMaxForHoECut() const {return eMaxForHoECut_;}
00074   double hMinForHoECut() const {return hMinForHoECut_;}
00075   double eActivityCut() const {return eActivityCut_;}
00076   double hActivityCut() const {return hActivityCut_;}
00077   unsigned eicIsolationThreshold() const {return eicIsolationThreshold_;}
00078   unsigned jscQuietThresholdBarrel() const {return jscQuietThresholdBarrel_;}
00079   unsigned jscQuietThresholdEndcap() const {return jscQuietThresholdEndcap_;}
00080   bool noiseVetoHB() const {return noiseVetoHB_;}
00081   bool noiseVetoHEplus() const {return noiseVetoHEplus_;}
00082   bool noiseVetoHEminus() const {return noiseVetoHEminus_;}
00083   const std::vector<double>& eGammaECalScaleFactors() const {return eGammaECalScaleFactors_;}
00084   const std::vector<double>& eGammaHCalScaleFactors() const {return eGammaHCalScaleFactors_;}
00085   const std::vector<double>& jetMETECalScaleFactors() const {return jetMETECalScaleFactors_;}
00086   const std::vector<double>& jetMETHCalScaleFactors() const {return jetMETHCalScaleFactors_;}
00087 
00088   // Helper methods to convert from trigger tower (iphi, ieta) 
00089   // to RCT (crate, card, tower)
00090   
00091   unsigned short calcCrate(unsigned short rct_iphi, short ieta) const;
00092   unsigned short calcCard(unsigned short rct_iphi, unsigned short absIeta) const;
00093   unsigned short calcTower(unsigned short rct_iphi, unsigned short absIeta) const;
00094   short calcIEta(unsigned short iCrate, unsigned short iCard, unsigned short iTower) const; // negative eta is used
00095   unsigned short calcIPhi(unsigned short iCrate, unsigned short iCard, unsigned short iTower) const;
00096   unsigned short calcIAbsEta(unsigned short iCrate, unsigned short iCard, unsigned short iTower) const;
00097   
00098   // Sum ecal and hcal TPGs using JetMET / EGamma Correactions and Lindsey's Calibration if flag is set
00099   float JetMETTPGSum(const float& ecal, const float& hcal, const unsigned& iAbsEta) const;
00100   float EGammaTPGSum(const float& ecal, const float& hcal, const unsigned& iAbsEta) const;
00101 
00102   void print(std::ostream& s) const;
00103 
00104  private:
00105 
00106   // default constructor is not implemented
00107 
00108   //L1RCTParameters();
00109 
00110   // LSB of the eGamma object corresponds to this ET (in GeV)
00111 
00112   double eGammaLSB_;
00113 
00114   // LSB of the jetMET object corresponds to this ET (in GeV)
00115 
00116   double jetMETLSB_;
00117 
00118   // Minimum ET of the eGamma object below which FG cut is ignored (in GeV)
00119 
00120   double eMinForFGCut_;
00121 
00122   // Maximum ET of the eGamma object above which FG cut is ignored (in GeV)
00123 
00124   double eMaxForFGCut_;
00125 
00126   // H/E ratio cut
00127 
00128   double hOeCut_;
00129 
00130   // Minimum ET of the ecal (in GeV) below which H/E always passes
00131 
00132   double eMinForHoECut_;
00133 
00134   // Maximum ET of the ecal (in GeV) above which H/E always passes
00135 
00136   double eMaxForHoECut_;
00137 
00138   // Minimum ET of the hcal (in GeV) above which H/E always fails (veto true)
00139 
00140   double hMinForHoECut_;
00141 
00142   // If the ET of the ECAL trigger tower is above this value
00143   // the tower is deemed active (in GeV)  --  these are used
00144   // for tau pattern logic
00145 
00146   double eActivityCut_;
00147 
00148   // If the ET of the HCAL trigger tower is above this value
00149   // the tower is deemed active (in GeV) -- these are used
00150   // for tau pattern logic
00151   
00152   double hActivityCut_;
00153 
00154   // This parameter is used for the five-tower-corner isolation
00155   // algorithm in the electron isolation card.  If one corner 
00156   // set of five neighbor towers falls below this threshold, 
00157   // the electron candidate is isolated.
00158 
00159   unsigned eicIsolationThreshold_;
00160 
00161   // 9-bit threshold below which quiet bit is set for a barrel region in JSC
00162   // (i.e. receiver cards 0-3)
00163 
00164   unsigned jscQuietThresholdBarrel_;
00165 
00166   // 9-bit threshold below which quiet bit is set for an endcap region in JSC
00167   // (i.e. receiver cards 4-6)
00168 
00169   unsigned jscQuietThresholdEndcap_;
00170 
00171   // Ignores HCAL barrel energy if no ECAL energy in corresponding
00172   // tower -- to reduce HCAL noise.  Endcaps enabled separately
00173   // to allow for lack of one/both ECAL endcaps.
00174 
00175   bool noiseVetoHB_;
00176 
00177   // Ignores HCAL energy in plus endcap if no ECAL energy in
00178   // corresponding tower.  
00179 
00180   bool noiseVetoHEplus_;
00181 
00182   // Ignores HCAL energy in minus endcap if no ECAL energy in
00183   // corresponding tower.
00184 
00185   bool noiseVetoHEminus_;
00186 
00187   // Use Cubic Fitting Corrections ?
00188   bool useCorrections_;
00189 
00190   // eGamma object ET is computed using the trigger tower ET defined as
00191   // ecal * eGammaECalScaleFactors[iEta] + hcal * eGammaHCalScaleFactors[iEta]
00192   // The result is then digitized using the eGamma LSB
00193 
00194   std::vector<double> eGammaECalScaleFactors_;
00195   std::vector<double> eGammaHCalScaleFactors_;
00196 
00197   // jetMET object ET is computed using the trigger tower ET defined as
00198   // ecal * jetMETECalScaleFactors[iEta] + hcal * jetMETHCalScaleFactors[iEta]
00199   // The result is then digitized using the jetMET LSB
00200 
00201   std::vector<double> jetMETECalScaleFactors_;
00202   std::vector<double> jetMETHCalScaleFactors_;
00203 
00204 
00205   // Applies Lindsey's calibration to HCAL and ECAL (ECAL must corrected by eGamma scale factors)
00206   // Provides corrected Et sum.
00207   float correctedTPGSum(const float& ecal, const float& hcal, const unsigned& index) const;
00208 
00209   // Lindsey's Calibration Coefficients
00210   // Basically a higher order approximation of the energy response of the calorimeters.
00211   // Powers in ecal and hcal Et are defined below.
00212   std::vector<std::vector<double> > ecal_calib_;  // [0] = ecal^3, [1] = ecal^2, [2] = ecal
00213   std::vector<std::vector<double> > hcal_calib_;  // [0] = hcal^3, [1] = hcal^2, [2] = hcal
00214   std::vector<std::vector<double> > hcal_high_calib_; // same as above but used to capture Et dependence for large Et
00215   std::vector<std::vector<double> > cross_terms_; // [0] = ecal^2*hcal, [1] = hcal^2*ecal, [2] = ecal*hcal
00216                                                           // [3] = ecal^3*hcal, [1] = hcal^3*ecal, [2] = ecal^2*hcal^2
00217   // These two sets of correction factors help to center the corrected 
00218   // Et distributions for different values of H/E.
00219   std::vector<double> HoverE_smear_low_;
00220   std::vector<double> HoverE_smear_high_;
00221   
00222 
00223 };
00224 
00225 #endif