Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef L1TObjects_L1CaloHcalScale_h
0002 #define L1TObjects_L1CaloHcalScale_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     L1TObjects
0006 // Class  :     L1CaloHcalScale
0007 //
0008 /**\class L1CaloHcalScale L1CaloHcalScale.h CondFormats/L1TObjects/interface/L1CaloHcalScale.h
0009 
0010  Description: Class to handle conversion between Et scales in L1 hardware
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Author:      Jim Brooke
0018 // Created:     Wed Sep 27 17:18:27 CEST 2006
0019 // $Id:
0020 //
0021 
0022 #include "CondFormats/Serialization/interface/Serializable.h"
0023 
0024 #include <vector>
0025 #include <ostream>
0026 #include <cstdint>
0027 
0028 class L1CaloHcalScale {
0029 public:
0030   //  static const unsigned short nBinRank = 0xff;
0031   static const unsigned short nBinRank = 1 << 8;
0032   static const unsigned short nBinEta = 32;  // per half, includes HF, eta index is 1-32
0033 
0034   /// constructor (creates a linear scale with an LSB - no LSB gives identity)
0035   L1CaloHcalScale(double lsb = 1.0);
0036 
0037   /// destructor
0038   ~L1CaloHcalScale();
0039 
0040   // eta = |eta|
0041   // etaSign = +1 or -1
0042 
0043   /// set scale element; use this to create non-linear scales
0044   void setBin(unsigned short rank,
0045               unsigned short eta,  // input eta index is 1-28
0046               short etaSign,
0047               double et);
0048 
0049   /// convert from physical Et in GeV to rank scale
0050   uint16_t rank(double et,
0051                 unsigned short eta,  // input eta index is 1-28
0052                 short etaSign) const;
0053 
0054   /// convert from rank to physically meaningful quantity
0055   double et(unsigned short rank,
0056             unsigned short eta,  // input eta index is 1-28
0057             short etaSign) const;
0058 
0059   void print(std::ostream& s) const;
0060 
0061 private:
0062   /// thresholds associated with rank scale in GeV
0063   // First nBinEta eta bins for positive eta, second nBinEta bins for negative
0064   double m_scale[nBinRank][2 * nBinEta];
0065 
0066   COND_SERIALIZABLE;
0067 };
0068 
0069 #endif