Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:37:14

0001 //-------------------------------------------------
0002 //
0003 //   \class L1MuGMTScales
0004 //
0005 /**   Description:  Class that creates all scales used inside the GMT
0006  *                  
0007  *
0008  *   An automatic check is done for the calo eta scales.
0009 */
0010 //
0011 //   $Date: 2007/03/23 15:22:01 $
0012 //   $Revision: 1.1 $
0013 //
0014 //
0015 //   Original Author :
0016 //   Hannes Sakulin      HEPHY / Vienna
0017 //
0018 //   Migrated to CMSSW:
0019 //   I. Mikulec
0020 //
0021 //--------------------------------------------------
0022 #ifndef CondFormatsL1TObjects_L1MuGMTScales_h
0023 #define CondFormatsL1TObjects_L1MuGMTScales_h
0024 
0025 #include "CondFormats/Serialization/interface/Serializable.h"
0026 
0027 #include <cmath>
0028 #include <iostream>
0029 
0030 #include "CondFormats/L1TObjects/interface/L1MuScale.h"
0031 
0032 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0033 
0034 class L1MuGMTScales {
0035 public:
0036   /// constructor
0037   L1MuGMTScales() {}
0038 
0039   L1MuGMTScales(int nbitPackingReducedEta,
0040                 int nbinsReducedEta,
0041                 const std::vector<double>& scaleReducedEtaDT,
0042                 const std::vector<double>& scaleReducedEtaBrlRPC,
0043                 const std::vector<double>& scaleReducedEtaCSC,
0044                 const std::vector<double>& scaleReducedEtaFwdRPC,
0045 
0046                 int nbitPackingDeltaEta,
0047                 bool signedPackingDeltaEta,
0048                 int nbinsDeltaEta,
0049                 float minDeltaEta,
0050                 float maxDeltaEta,
0051                 int offsetDeltaEta,
0052 
0053                 int nbitPackingDeltaPhi,
0054                 bool signedPackingDeltaPhi,
0055                 int nbinsDeltaPhi,
0056                 float minDeltaPhi,
0057                 float maxDeltaPhi,
0058                 int offsetDeltaPhi,
0059 
0060                 int nbitPackingOvlEtaDT,
0061                 int nbinsOvlEtaDT,
0062                 float minOvlEtaDT,
0063                 float maxOvlEtaDT,
0064 
0065                 int nbitPackingOvlEtaCSC,
0066                 int nbinsOvlEtaCSC,
0067                 float minOvlEtaCSC,
0068                 float maxOvlEtaCSC,
0069 
0070                 const std::vector<double>& scaleOvlEtaRPC,
0071                 int nbitPackingOvlEtaBrlRPC,
0072                 int nbinsOvlEtaBrlRPC,
0073                 int nbitPackingOvlEtaFwdRPC,
0074                 int nbinsOvlEtaFwdRPC
0075 
0076   ) {
0077     // used as a Singleton, the constructor is run when the GMT is first used.
0078     //
0079 
0080     /*     const float reducedetabins[4][9] = { */
0081     /*       { 0.00, 0.22, 0.27, 0.58, 0.77, 0.87, 0.92, 1.24, 1.3 }, // DT */
0082     /*       { 0.00, 0.06, 0.25, 0.41, 0.54, 0.70, 0.83, 0.93, 1.04}, // bRPC */
0083     /*       { 0.9,  1.06, 1.26, 1.46, 1.66, 1.86, 2.06, 2.26, 2.5 }, // CSC */
0084     /*       { 1.04, 1.24, 1.36, 1.48, 1.61, 1.73, 1.85, 1.97, 2.10}  // fRPC */
0085     /*     }; */
0086 
0087     /*     for (int i=0; i<4; i++)  */
0088     /*       m_ReducedEtaScale[i] = L1MuSymmetricBinnedScale(4, 8, reducedetabins[i]); */
0089 
0090     m_ReducedEtaScale[0] = L1MuSymmetricBinnedScale(nbitPackingReducedEta, nbinsReducedEta, scaleReducedEtaDT);
0091     m_ReducedEtaScale[1] = L1MuSymmetricBinnedScale(nbitPackingReducedEta, nbinsReducedEta, scaleReducedEtaBrlRPC);
0092     m_ReducedEtaScale[2] = L1MuSymmetricBinnedScale(nbitPackingReducedEta, nbinsReducedEta, scaleReducedEtaCSC);
0093     m_ReducedEtaScale[3] = L1MuSymmetricBinnedScale(nbitPackingReducedEta, nbinsReducedEta, scaleReducedEtaFwdRPC);
0094 
0095     //
0096     // Scales used in Matching Units
0097     //
0098     /*     float deta_unit = 0.04; */
0099     /*     float deta_min = -7.5 * deta_unit; */
0100     /*     float deta_max = 7.5 * deta_unit; */
0101     /*     m_DeltaEtaScale[0] = L1MuBinnedScale (4, true, 15, deta_min, deta_max, 7); // DT-RPC */
0102     /*     m_DeltaEtaScale[1] = L1MuBinnedScale (4, true, 15, deta_min, deta_max, 7); // CSC-RPC */
0103     /*     m_DeltaEtaScale[2] = L1MuBinnedScale (4, true, 15, deta_min, deta_max, 7); // DT-CSC */
0104     /*     m_DeltaEtaScale[3] = L1MuBinnedScale (4, true, 15, deta_min, deta_max, 7); // CSC-DT */
0105     /*     m_DeltaEtaScale[4] = L1MuBinnedScale (4, true, 15, deta_min, deta_max, 7); // CSC-bRPC */
0106     /*     m_DeltaEtaScale[5] = L1MuBinnedScale (4, true, 15, deta_min, deta_max, 7); // DT-fRPC */
0107 
0108     for (int i = 0; i < 6; ++i)
0109       m_DeltaEtaScale[i] = L1MuBinnedScale(
0110           nbitPackingDeltaEta, signedPackingDeltaEta, nbinsDeltaEta, minDeltaEta, maxDeltaEta, offsetDeltaEta);
0111 
0112     // delta phi scale
0113     // m_DeltaPhiScale = L1MuBinnedScale (3, true, 8, -11.25 * M_PI/180., 8.75 * M_PI/180.0, 4);
0114     m_DeltaPhiScale = L1MuBinnedScale(
0115         nbitPackingDeltaPhi, signedPackingDeltaPhi, nbinsDeltaPhi, minDeltaPhi, maxDeltaPhi, offsetDeltaPhi);
0116 
0117     //
0118     // reduced eta scale for matching in the overlap region
0119     //
0120     // reserve highest code for Out Of Range
0121     //
0122     /*     const float RpcOvlEtaBins[8] = { */
0123     /*       0.72,  0.83,  0.93,  1.04,  1.14,  1.24,  1.36, 1.48 };   */
0124 
0125     /*     m_OvlEtaScale[0] = L1MuSymmetricBinnedScale (4, 7, 1.3 * 18./32. , 1.3); // DT */
0126     /*     // FIXME **** dt scale: two original bins in one new bin */
0127     /*     // one-to-one mapping should be possible with new eta scale */
0128 
0129     /*     m_OvlEtaScale[1] = L1MuSymmetricBinnedScale (4, 7, RpcOvlEtaBins) ; // bRPC */
0130     /*     m_OvlEtaScale[2] = L1MuSymmetricBinnedScale (4, 7, 0.9, 1.25);    // CSC */
0131     /*     m_OvlEtaScale[3] = L1MuSymmetricBinnedScale (4, 7, RpcOvlEtaBins) ; // fRPC */
0132 
0133     m_OvlEtaScale[0] = L1MuSymmetricBinnedScale(nbitPackingOvlEtaDT, nbinsOvlEtaDT, minOvlEtaDT,
0134                                                 maxOvlEtaDT);  // DT
0135     // FIXME **** dt scale: two original bins in one new bin
0136     // one-to-one mapping should be possible with new eta scale
0137 
0138     m_OvlEtaScale[1] = L1MuSymmetricBinnedScale(nbitPackingOvlEtaBrlRPC, nbinsOvlEtaBrlRPC,
0139                                                 scaleOvlEtaRPC);  // bRPC
0140     m_OvlEtaScale[2] = L1MuSymmetricBinnedScale(nbitPackingOvlEtaCSC,
0141                                                 nbinsOvlEtaCSC,
0142                                                 minOvlEtaCSC,
0143                                                 maxOvlEtaCSC);  // CSC
0144     m_OvlEtaScale[3] = L1MuSymmetricBinnedScale(nbitPackingOvlEtaFwdRPC, nbinsOvlEtaFwdRPC,
0145                                                 scaleOvlEtaRPC);  // fRPC
0146 
0147     //
0148     /*     float caloEtaBounds[15] = {  */
0149     /*       -3.000, -2.172, -1.740, -1.392, -1.044, -0.696, -0.348, 0., */
0150     /*       0.348,  0.696, 1.044,  1.392,  1.740,  2.172,  3.000 }; */
0151 
0152     /*     std::vector<double> caloEtaBounds ; */
0153     /*     caloEtaBounds.push_back(-3.000) ; */
0154     /*     caloEtaBounds.push_back(-2.172) ; */
0155     /*     caloEtaBounds.push_back(-1.740) ; */
0156     /*     caloEtaBounds.push_back(-1.392) ; */
0157     /*     caloEtaBounds.push_back(-1.044) ; */
0158     /*     caloEtaBounds.push_back(-0.696) ; */
0159     /*     caloEtaBounds.push_back(-0.348) ; */
0160     /*     caloEtaBounds.push_back(0.) ; */
0161     /*     caloEtaBounds.push_back(0.348) ; */
0162     /*     caloEtaBounds.push_back(0.696) ; */
0163     /*     caloEtaBounds.push_back(1.044) ; */
0164     /*     caloEtaBounds.push_back(1.392) ; */
0165     /*     caloEtaBounds.push_back(1.740) ; */
0166     /*     caloEtaBounds.push_back(2.172) ; */
0167     /*     caloEtaBounds.push_back(3.000) ; */
0168 
0169     /*     m_CaloEtaScale =  L1MuBinnedScale (4, false, 14, caloEtaBounds); */
0170   };
0171 
0172   /// destructor
0173   virtual ~L1MuGMTScales(){
0174       //     for (int i=0; i<4; i++) {
0175       //       delete m_ReducedEtaScale[i];
0176       //       delete m_OvlEtaScale[i];
0177       //     }
0178       //     for (int i=0; i<6; i++) {
0179       //       delete m_DeltaEtaScale[i];
0180       //     }
0181 
0182       //     delete m_DeltaPhiScale;
0183       //     delete m_CaloEtaScale;
0184   };
0185 
0186   /// get the recuced eta scale for matching in the overlap region (4 bit); isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC)
0187   const L1MuScale* getReducedEtaScale(int isys) const {
0188     if (isys < 0 || isys > 3)
0189       edm::LogWarning("GMTScaleRangeViolation") << "Error in L1MuGMTScales:: isys out of range: " << isys;
0190     return &(m_ReducedEtaScale[isys]);
0191   };
0192 
0193   /// get the delta eta scale; idx = 0(DT=RPC), 1(CSC-RPC), 2(DT-CSC), 3(CSC-DT), 4(bRPC-CSC), 5(fRPC-DT)
0194   const L1MuScale* getDeltaEtaScale(int idx) const {
0195     if (idx < 0 || idx > 5)
0196       edm::LogWarning("GMTScaleRangeViolation") << "Error in L1MuGMTScales:: isys out of range: " << idx;
0197     return &(m_DeltaEtaScale[idx]);
0198   };
0199 
0200   /// get the delta phi scale ( 3 bits)
0201   const L1MuScale* getDeltaPhiScale() const { return &m_DeltaPhiScale; };
0202 
0203   /// get the overlap eta scale (4 bits);  isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC)
0204   const L1MuScale* getOvlEtaScale(int isys) const {
0205     if (isys < 0 || isys > 3)
0206       edm::LogWarning("GMTScaleRangeViolation") << "Error in L1MuGMTScales:: isys out of range: " << isys;
0207     return &(m_OvlEtaScale[isys]);
0208   };
0209 
0210   /*   /// get the calorimeter eta scale */
0211   /*   const L1MuScale *getCaloEtaScale() const { return &m_CaloEtaScale;};  */
0212 
0213 private:
0214   L1MuSymmetricBinnedScale m_ReducedEtaScale[4];
0215   L1MuBinnedScale m_DeltaEtaScale[6];
0216   L1MuBinnedScale m_DeltaPhiScale;
0217   L1MuSymmetricBinnedScale m_OvlEtaScale[4];
0218   /*   L1MuBinnedScale m_CaloEtaScale; */
0219 
0220   COND_SERIALIZABLE;
0221 };
0222 
0223 #endif