Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:56

0001 //-------------------------------------------------
0002 //
0003 //   Class: L1MuGMTLFMergeRankEtaQLUT
0004 //
0005 //
0006 //
0007 //   Author :
0008 //   H. Sakulin            HEPHY Vienna
0009 //
0010 //   Migrated to CMSSW:
0011 //   I. Mikulec
0012 //
0013 //--------------------------------------------------
0014 
0015 //-----------------------
0016 // This Class's Header --
0017 //-----------------------
0018 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTLFMergeRankEtaQLUT.h"
0019 
0020 //---------------
0021 // C++ Headers --
0022 //---------------
0023 
0024 //#include <iostream>
0025 
0026 //-------------------------------
0027 // Collaborating Class Headers --
0028 //-------------------------------
0029 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTConfig.h"
0030 #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h"
0031 
0032 //-------------------
0033 // InitParameters  --
0034 //-------------------
0035 
0036 void L1MuGMTLFMergeRankEtaQLUT::InitParameters() {}
0037 
0038 //------------------------
0039 // The Lookup Function  --
0040 //------------------------
0041 
0042 unsigned L1MuGMTLFMergeRankEtaQLUT::TheLookupFunction(int idx, unsigned eta, unsigned q) const {
0043   // idx is DT, BRPC, CSC, FRPC
0044   // INPUTS:  eta(6) q(3)
0045   // OUTPUTS: flag(1) rank_etaq(7)
0046 
0047   const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
0048 
0049   //  int isRPC = idx % 2;
0050   //  int isFWD = idx / 2;
0051 
0052   float etaValue = theTriggerScales->getRegionalEtaScale(idx)->getCenter(eta);
0053 
0054   unsigned flag = 0;
0055   switch (idx) {
0056     case 0:  // DT
0057              //    if ( (q==1 || q==4 || q==6 || q==7) ||
0058              //        ( (q==2 || q==3) && (fabs(etaValue) < 0.9) ) ) flag=1;
0059       flag = 1;
0060       break;
0061     case 1:  // bRPC
0062       if (q == 0 and fabs(etaValue) > 0.7)
0063         flag = 1;
0064       //    flag =1;
0065       break;
0066     case 2:  // CSC
0067              //    if ( (q==2 || fabs(etaValue) < 1.2) ||  q==3) flag =1;
0068       if (q == 3)
0069         flag = 1;
0070       break;
0071     case 3:  // fRPC
0072              //    if (q==3) flag =1;
0073       flag = 1;
0074   }
0075 
0076   // use local quality as rank
0077   unsigned rank_etaq = q;
0078   // add 1 to RPC in order to promote it in case of equality (should go with the fix in L1MuGMTMerger.cc)
0079   if (idx == 1 || idx == 3)
0080     rank_etaq++;
0081   if (m_GeneralLUTVersion == 0) {
0082     // in the overlap region promote RPC (valid for 2011 data)
0083     if ((idx == 1 || idx == 3) && (fabs(etaValue) > 1. && fabs(etaValue) < 1.23))
0084       rank_etaq = 7;
0085   }
0086 
0087   return flag << 7 | rank_etaq;
0088 }