Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-12 04:16:16

0001 //-------------------------------------------------
0002 //
0003 //   \class L1MuTriggerScales
0004 //
0005 /**   Description:  Class that creates all scales used to pass 
0006  *                  data from the regional muon triggers to
0007  *                  the Global Muon Trigger and from the latter 
0008  *                  to the Global Trigger
0009 */
0010 //
0011 //   $Date: 2008/11/24 10:26:31 $
0012 //   $Revision: 1.5 $
0013 //
0014 //   Original Author :
0015 //   Hannes Sakulin      HEPHY / Vienna
0016 //
0017 //   Migrated to CMSSW:
0018 //   I. Mikulec
0019 //
0020 //--------------------------------------------------
0021 #ifndef CondFormatsL1TObjects_L1MuTriggerScales_h
0022 #define CondFormatsL1TObjects_L1MuTriggerScales_h
0023 
0024 #include "CondFormats/Serialization/interface/Serializable.h"
0025 
0026 #include <cmath>
0027 #include <iostream>
0028 #include <vector>
0029 
0030 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0031 #include "CondFormats/L1TObjects/interface/L1MuScale.h"
0032 
0033 class L1MuTriggerScales {
0034 public:
0035   /// constructor
0036   L1MuTriggerScales() {}
0037 
0038   L1MuTriggerScales(int nbitPackingDTEta,
0039                     bool signedPackingDTEta,
0040                     int nbinsDTEta,
0041                     float minDTEta,
0042                     float maxDTEta,
0043                     int offsetDTEta,
0044 
0045                     int nbitPackingCSCEta,
0046                     int nbinsCSCEta,
0047                     float minCSCEta,
0048                     float maxCSCEta,
0049 
0050                     const std::vector<double>& scaleRPCEta,
0051                     int nbitPackingBrlRPCEta,
0052                     bool signedPackingBrlRPCEta,
0053                     int nbinsBrlRPCEta,
0054                     int offsetBrlRPCEta,
0055                     int nbitPackingFwdRPCEta,
0056                     bool signedPackingFwdRPCEta,
0057                     int nbinsFwdRPCEta,
0058                     int offsetFwdRPCEta,
0059 
0060                     int nbitPackingGMTEta,
0061                     int nbinsGMTEta,
0062                     const std::vector<double>& scaleGMTEta,
0063 
0064                     int nbitPackingPhi,
0065                     bool signedPackingPhi,
0066                     int nbinsPhi,
0067                     float minPhi,
0068                     float maxPhi
0069 
0070                     /*            int nbitPackingPt, */
0071                     /*            bool signedPackingPt, */
0072                     /*            int nbinsPt, */
0073                     /*            const std::vector<double>& scalePt */
0074 
0075   ) {
0076     //
0077     // Regional Muon Trigger Eta Scales
0078     //
0079     /*     const float rpcetabins[34]= { */
0080     /*       -2.10, -1.97, -1.85, -1.73, -1.61, -1.48, */
0081     /*       -1.36, -1.24, -1.14, -1.04, -0.93, -0.83,  */
0082     /*       -0.72, -0.58, -0.44, -0.27, -0.07,      */
0083     /*               0.07,  0.27,  0.44,  0.58,  0.72, */
0084     /*        0.83,  0.93,  1.04,  1.14,  1.24,  1.36, */
0085     /*        1.48,  1.61,  1.73,  1.85,  1.97,  2.10}; */
0086 
0087     // DT
0088     //m_RegionalEtaScale[0] = L1MuBinnedScale( 6, true, 64, -1.2, 1.2, 32);
0089     m_RegionalEtaScale[0] =
0090         L1MuBinnedScale(nbitPackingDTEta, signedPackingDTEta, nbinsDTEta, minDTEta, maxDTEta, offsetDTEta);
0091 
0092     // RPC index -16 .. 16, brl RPC
0093     // m_RegionalEtaScale[1] = L1MuBinnedScale (6, true, 33, rpcetabins, 16);
0094     m_RegionalEtaScale[1] =
0095         L1MuBinnedScale(nbitPackingBrlRPCEta, signedPackingBrlRPCEta, nbinsBrlRPCEta, scaleRPCEta, offsetBrlRPCEta);
0096 
0097     // CSC
0098     m_RegionalEtaScale[2] = L1MuBinnedScale();
0099     // // m_RegionalEtaScale[2] = L1MuSymmetricBinnedScale ( 6, 32, 0.9, 2.5);
0100     //    m_RegionalEtaScaleCSC = L1MuSymmetricBinnedScale ( 6, 32, 0.9, 2.5);
0101     m_RegionalEtaScaleCSC = L1MuSymmetricBinnedScale(nbitPackingCSCEta, nbinsCSCEta, minCSCEta, maxCSCEta);
0102 
0103     // RPC index -16 .. 16, fwd RPC
0104     // m_RegionalEtaScale[3] = L1MuBinnedScale (6, true, 33, rpcetabins, 16);
0105     m_RegionalEtaScale[3] =
0106         L1MuBinnedScale(nbitPackingFwdRPCEta, signedPackingFwdRPCEta, nbinsFwdRPCEta, scaleRPCEta, offsetFwdRPCEta);
0107 
0108     //
0109     // Eta scale at GMT output
0110     //
0111 
0112     /*     const float gmt_outputetascale[32] = {  0.00, */
0113     /*             0.10,  0.20,  0.30,  0.40,  0.50,  0.60,  0.70,  0.80,  */
0114     /*             0.90,  1.00,  1.10,  1.20,  1.30,  1.40,  1.50,  1.60, */
0115     /*             1.70,  1.75,  1.80,  1.85,  1.90,  1.95,  2.00,  2.05, */
0116     /*             2.10,  2.15,  2.20,  2.25,  2.30,  2.35,  2.40 }; */
0117 
0118     // m_GMTEtaScale = L1MuSymmetricBinnedScale (6, 31, gmt_outputetascale);
0119     m_GMTEtaScale = L1MuSymmetricBinnedScale(nbitPackingGMTEta, nbinsGMTEta, scaleGMTEta);
0120 
0121     //
0122     // Phi Scale. Common to all Regioanl Muon Triggers and GMT
0123     //
0124 
0125     // m_PhiScale = L1MuBinnedScale (8, false, 144, 0., 2. * M_PI);
0126     m_PhiScale = L1MuBinnedScale(nbitPackingPhi, signedPackingPhi, nbinsPhi, minPhi, maxPhi);
0127 
0128     //
0129     // Pt Scale. Common to all Regioanl Muon Triggers and GMT
0130     //
0131 
0132     // pt scale in GeV
0133     // low edges of pt bins
0134     /*     const float ptscale[33] = {  */
0135     /*       -1.,   0.0,   1.5,   2.0,   2.5,   3.0,   3.5,   4.0, */
0136     /*       4.5,   5.0,   6.0,   7.0,   8.0,  10.0,  12.0,  14.0,   */
0137     /*       16.0,  18.0,  20.0,  25.0,  30.0,  35.0,  40.0,  45.0,  */
0138     /*       50.0,  60.0,  70.0,  80.0,  90.0, 100.0, 120.0, 140.0, 1.E6 }; */
0139 
0140     // m_PtScale = L1MuBinnedScale ( 5, false, 32, ptscale) ;
0141     /*     m_PtScale = L1MuBinnedScale ( nbitPackingPt, */
0142     /*                signedPackingPt, */
0143     /*                nbinsPt, */
0144     /*                scalePt ) ; */
0145   };
0146 
0147   /// destructor
0148   virtual ~L1MuTriggerScales() {
0149     //     for (int i=0; i<4; i++)
0150     //       delete m_RegionalEtaScale[i];
0151 
0152     //     delete m_GMTEtaScale;
0153     //     delete m_PhiScale;
0154     //     delete m_PtScale;
0155   };
0156 
0157   /// get the regioanl muon trigger eta scale, isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC)
0158   const L1MuScale* getRegionalEtaScale(int isys) const {
0159     if (isys < 0 || isys > 3)
0160       edm::LogWarning("ScaleRangeViolation") << "Error in L1MuTriggerScales:: isys out of range: " << isys;
0161     if (isys == 2) {
0162       return &m_RegionalEtaScaleCSC;
0163     } else {
0164       return &(m_RegionalEtaScale[isys]);
0165     }
0166   };
0167 
0168   /// get the GMT eta scale
0169   const L1MuScale* getGMTEtaScale() const { return &m_GMTEtaScale; };
0170 
0171   /// set the GMT eta scale
0172   void setGMTEtaScale(const L1MuSymmetricBinnedScale& scale) { m_GMTEtaScale = scale; };
0173 
0174   /// get the phi scale
0175   const L1MuScale* getPhiScale() const { return &m_PhiScale; };
0176 
0177   /// set the phi scale
0178   void setPhiScale(const L1MuBinnedScale& scale) { m_PhiScale = scale; };
0179 
0180   /*   /// get the Pt scale */
0181   /*   const L1MuScale* getPtScale() const { return &m_PtScale;}; */
0182 
0183 private:
0184   L1MuBinnedScale m_RegionalEtaScale[4];  // 2=csc will be empty
0185   L1MuSymmetricBinnedScale m_RegionalEtaScaleCSC;
0186   L1MuSymmetricBinnedScale m_GMTEtaScale;
0187   L1MuBinnedScale m_PhiScale;
0188   //  L1MuBinnedScale m_PtScale;
0189 
0190   COND_SERIALIZABLE;
0191 };
0192 
0193 #endif