CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/CondFormats/L1TObjects/interface/L1MuGMTScales.h

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   \class L1MuGMTScales
00004 //
00010 //
00011 //   $Date: 2008/04/16 23:25:10 $
00012 //   $Revision: 1.2 $
00013 //
00014 //
00015 //   Original Author :
00016 //   Hannes Sakulin      HEPHY / Vienna
00017 //
00018 //   Migrated to CMSSW:
00019 //   I. Mikulec
00020 //
00021 //--------------------------------------------------
00022 #ifndef CondFormatsL1TObjects_L1MuGMTScales_h
00023 #define CondFormatsL1TObjects_L1MuGMTScales_h
00024 
00025 #include <cmath>
00026 #include <iostream>
00027 
00028 #include "CondFormats/L1TObjects/interface/L1MuScale.h"
00029 
00030 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00031 
00032 class L1MuGMTScales {
00033  public:
00034 
00036    L1MuGMTScales() {}
00037 
00038    L1MuGMTScales( int nbitPackingReducedEta,
00039                   int nbinsReducedEta,
00040                   const std::vector<double>& scaleReducedEtaDT,
00041                   const std::vector<double>& scaleReducedEtaBrlRPC,
00042                   const std::vector<double>& scaleReducedEtaCSC,
00043                   const std::vector<double>& scaleReducedEtaFwdRPC,
00044 
00045                   int nbitPackingDeltaEta,
00046                   bool signedPackingDeltaEta,
00047                   int nbinsDeltaEta,
00048                   float minDeltaEta,
00049                   float maxDeltaEta,
00050                   int offsetDeltaEta,
00051 
00052                   int nbitPackingDeltaPhi,
00053                   bool signedPackingDeltaPhi,
00054                   int nbinsDeltaPhi,
00055                   float minDeltaPhi,
00056                   float maxDeltaPhi,
00057                   int offsetDeltaPhi,
00058 
00059                   int nbitPackingOvlEtaDT,
00060                   int nbinsOvlEtaDT,
00061                   float minOvlEtaDT,
00062                   float maxOvlEtaDT,
00063 
00064                   int nbitPackingOvlEtaCSC,
00065                   int nbinsOvlEtaCSC,
00066                   float minOvlEtaCSC,
00067                   float maxOvlEtaCSC,
00068 
00069                   const std::vector<double>& scaleOvlEtaRPC,
00070                   int nbitPackingOvlEtaBrlRPC,
00071                   int nbinsOvlEtaBrlRPC,
00072                   int nbitPackingOvlEtaFwdRPC,
00073                   int nbinsOvlEtaFwdRPC
00074 
00075                 ) {
00076     
00077     // used as a Singleton, the constructor is run when the GMT is first used.
00078     //
00079    
00080 
00081 /*     const float reducedetabins[4][9] = { */
00082 /*       { 0.00, 0.22, 0.27, 0.58, 0.77, 0.87, 0.92, 1.24, 1.3 }, // DT */
00083 /*       { 0.00, 0.06, 0.25, 0.41, 0.54, 0.70, 0.83, 0.93, 1.04}, // bRPC */
00084 /*       { 0.9,  1.06, 1.26, 1.46, 1.66, 1.86, 2.06, 2.26, 2.5 }, // CSC */
00085 /*       { 1.04, 1.24, 1.36, 1.48, 1.61, 1.73, 1.85, 1.97, 2.10}  // fRPC */
00086 /*     }; */
00087     
00088 /*     for (int i=0; i<4; i++)  */
00089 /*       m_ReducedEtaScale[i] = L1MuSymmetricBinnedScale(4, 8, reducedetabins[i]); */
00090 
00091      m_ReducedEtaScale[0] = L1MuSymmetricBinnedScale( nbitPackingReducedEta,
00092                                                       nbinsReducedEta,
00093                                                       scaleReducedEtaDT ) ;
00094      m_ReducedEtaScale[1] = L1MuSymmetricBinnedScale( nbitPackingReducedEta,
00095                                                       nbinsReducedEta,
00096                                                       scaleReducedEtaBrlRPC ) ;
00097      m_ReducedEtaScale[2] = L1MuSymmetricBinnedScale( nbitPackingReducedEta,
00098                                                       nbinsReducedEta,
00099                                                       scaleReducedEtaCSC ) ;
00100      m_ReducedEtaScale[3] = L1MuSymmetricBinnedScale( nbitPackingReducedEta,
00101                                                       nbinsReducedEta,
00102                                                       scaleReducedEtaFwdRPC ) ;
00103   
00104     //
00105     // Scales used in Matching Units
00106     //
00107 /*     float deta_unit = 0.04; */
00108 /*     float deta_min = -7.5 * deta_unit; */
00109 /*     float deta_max = 7.5 * deta_unit; */
00110 /*     m_DeltaEtaScale[0] = L1MuBinnedScale (4, true, 15, deta_min, deta_max, 7); // DT-RPC */
00111 /*     m_DeltaEtaScale[1] = L1MuBinnedScale (4, true, 15, deta_min, deta_max, 7); // CSC-RPC */
00112 /*     m_DeltaEtaScale[2] = L1MuBinnedScale (4, true, 15, deta_min, deta_max, 7); // DT-CSC */
00113 /*     m_DeltaEtaScale[3] = L1MuBinnedScale (4, true, 15, deta_min, deta_max, 7); // CSC-DT */
00114 /*     m_DeltaEtaScale[4] = L1MuBinnedScale (4, true, 15, deta_min, deta_max, 7); // CSC-bRPC */
00115 /*     m_DeltaEtaScale[5] = L1MuBinnedScale (4, true, 15, deta_min, deta_max, 7); // DT-fRPC */
00116 
00117     for( int i = 0 ; i < 6 ; ++i )
00118       m_DeltaEtaScale[i] = L1MuBinnedScale( nbitPackingDeltaEta,
00119                                             signedPackingDeltaEta,
00120                                             nbinsDeltaEta,
00121                                             minDeltaEta,
00122                                             maxDeltaEta,
00123                                             offsetDeltaEta ) ;
00124 
00125     // delta phi scale
00126     // m_DeltaPhiScale = L1MuBinnedScale (3, true, 8, -11.25 * M_PI/180., 8.75 * M_PI/180.0, 4); 
00127     m_DeltaPhiScale = L1MuBinnedScale( nbitPackingDeltaPhi,
00128                                        signedPackingDeltaPhi,
00129                                        nbinsDeltaPhi,
00130                                        minDeltaPhi,
00131                                        maxDeltaPhi,
00132                                        offsetDeltaPhi ) ;
00133 
00134     //
00135     // reduced eta scale for matching in the overlap region
00136     //
00137     // reserve highest code for Out Of Range
00138     // 
00139 /*     const float RpcOvlEtaBins[8] = { */
00140 /*       0.72,  0.83,  0.93,  1.04,  1.14,  1.24,  1.36, 1.48 };   */
00141 
00142 /*     m_OvlEtaScale[0] = L1MuSymmetricBinnedScale (4, 7, 1.3 * 18./32. , 1.3); // DT */
00143 /*     // FIXME **** dt scale: two original bins in one new bin */
00144 /*     // one-to-one mapping should be possible with new eta scale */
00145 
00146 /*     m_OvlEtaScale[1] = L1MuSymmetricBinnedScale (4, 7, RpcOvlEtaBins) ; // bRPC */
00147 /*     m_OvlEtaScale[2] = L1MuSymmetricBinnedScale (4, 7, 0.9, 1.25);    // CSC */
00148 /*     m_OvlEtaScale[3] = L1MuSymmetricBinnedScale (4, 7, RpcOvlEtaBins) ; // fRPC */
00149 
00150     m_OvlEtaScale[0] = L1MuSymmetricBinnedScale (nbitPackingOvlEtaDT,
00151                                                  nbinsOvlEtaDT,
00152                                                  minOvlEtaDT,
00153                                                  maxOvlEtaDT); // DT
00154     // FIXME **** dt scale: two original bins in one new bin
00155     // one-to-one mapping should be possible with new eta scale
00156 
00157     m_OvlEtaScale[1] = L1MuSymmetricBinnedScale (nbitPackingOvlEtaBrlRPC,
00158                                                  nbinsOvlEtaBrlRPC,
00159                                                  scaleOvlEtaRPC) ; // bRPC
00160     m_OvlEtaScale[2] = L1MuSymmetricBinnedScale (nbitPackingOvlEtaCSC,
00161                                                  nbinsOvlEtaCSC,
00162                                                  minOvlEtaCSC,
00163                                                  maxOvlEtaCSC);    // CSC
00164     m_OvlEtaScale[3] = L1MuSymmetricBinnedScale (nbitPackingOvlEtaFwdRPC,
00165                                                  nbinsOvlEtaFwdRPC,
00166                                                  scaleOvlEtaRPC) ; // fRPC
00167 
00168     //
00169 /*     float caloEtaBounds[15] = {  */
00170 /*       -3.000, -2.172, -1.740, -1.392, -1.044, -0.696, -0.348, 0., */
00171 /*       0.348,  0.696, 1.044,  1.392,  1.740,  2.172,  3.000 }; */
00172 
00173 /*     std::vector<double> caloEtaBounds ; */
00174 /*     caloEtaBounds.push_back(-3.000) ; */
00175 /*     caloEtaBounds.push_back(-2.172) ; */
00176 /*     caloEtaBounds.push_back(-1.740) ; */
00177 /*     caloEtaBounds.push_back(-1.392) ; */
00178 /*     caloEtaBounds.push_back(-1.044) ; */
00179 /*     caloEtaBounds.push_back(-0.696) ; */
00180 /*     caloEtaBounds.push_back(-0.348) ; */
00181 /*     caloEtaBounds.push_back(0.) ; */
00182 /*     caloEtaBounds.push_back(0.348) ; */
00183 /*     caloEtaBounds.push_back(0.696) ; */
00184 /*     caloEtaBounds.push_back(1.044) ; */
00185 /*     caloEtaBounds.push_back(1.392) ; */
00186 /*     caloEtaBounds.push_back(1.740) ; */
00187 /*     caloEtaBounds.push_back(2.172) ; */
00188 /*     caloEtaBounds.push_back(3.000) ; */
00189 
00190 /*     m_CaloEtaScale =  L1MuBinnedScale (4, false, 14, caloEtaBounds); */
00191   };
00192 
00194   virtual ~L1MuGMTScales() {
00195 //     for (int i=0; i<4; i++) {
00196 //       delete m_ReducedEtaScale[i];
00197 //       delete m_OvlEtaScale[i];
00198 //     }
00199 //     for (int i=0; i<6; i++) {
00200 //       delete m_DeltaEtaScale[i];
00201 //     }
00202 
00203 //     delete m_DeltaPhiScale;
00204 //     delete m_CaloEtaScale;
00205   };
00206   
00208   const L1MuScale* getReducedEtaScale(int isys) const { 
00209     if (isys<0 || isys>3) edm::LogWarning("GMTScaleRangeViolation") << "Error in L1MuGMTScales:: isys out of range: " << isys; 
00210     return &( m_ReducedEtaScale[isys] ); 
00211   };
00212 
00214   const L1MuScale* getDeltaEtaScale(int idx) const { 
00215     if (idx<0 || idx>5) edm::LogWarning("GMTScaleRangeViolation") << "Error in L1MuGMTScales:: isys out of range: " << idx; 
00216     return &( m_DeltaEtaScale[idx] ); 
00217   };
00218 
00220   const L1MuScale* getDeltaPhiScale() const {     return &m_DeltaPhiScale;   };
00221 
00223   const L1MuScale* getOvlEtaScale(int isys) const { 
00224     if (isys<0 || isys>3) edm::LogWarning("GMTScaleRangeViolation") << "Error in L1MuGMTScales:: isys out of range: " << isys; 
00225     return &( m_OvlEtaScale[isys] ); 
00226   };
00227 
00228 
00229 /*   /// get the calorimeter eta scale */
00230 /*   const L1MuScale *getCaloEtaScale() const { return &m_CaloEtaScale;};  */
00231 
00232 
00233  private:
00234   L1MuSymmetricBinnedScale m_ReducedEtaScale[4];
00235   L1MuBinnedScale m_DeltaEtaScale[6];
00236   L1MuBinnedScale m_DeltaPhiScale;
00237   L1MuSymmetricBinnedScale m_OvlEtaScale[4];
00238 /*   L1MuBinnedScale m_CaloEtaScale; */
00239 };
00240 
00241 
00242 #endif