CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/L1Trigger/GlobalMuonTrigger/src/L1MuGMTLFMergeRankEtaQLUT.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class: L1MuGMTLFMergeRankEtaQLUT
00004 //
00005 // 
00006 //   $Date: 2012/03/14 13:52:09 $
00007 //   $Revision: 1.8 $
00008 //
00009 //   Author :
00010 //   H. Sakulin            HEPHY Vienna
00011 //
00012 //   Migrated to CMSSW:
00013 //   I. Mikulec
00014 //
00015 //--------------------------------------------------
00016 
00017 //-----------------------
00018 // This Class's Header --
00019 //-----------------------
00020 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTLFMergeRankEtaQLUT.h"
00021 
00022 //---------------
00023 // C++ Headers --
00024 //---------------
00025 
00026 //#include <iostream>
00027 
00028 //-------------------------------
00029 // Collaborating Class Headers --
00030 //-------------------------------
00031 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTConfig.h"
00032 #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h"
00033 
00034 //-------------------
00035 // InitParameters  --
00036 //-------------------
00037 
00038 void L1MuGMTLFMergeRankEtaQLUT::InitParameters() {
00039 }
00040 
00041 //------------------------
00042 // The Lookup Function  --
00043 //------------------------
00044 
00045 unsigned L1MuGMTLFMergeRankEtaQLUT::TheLookupFunction (int idx, unsigned eta, unsigned q) const {
00046   // idx is DT, BRPC, CSC, FRPC
00047   // INPUTS:  eta(6) q(3)
00048   // OUTPUTS: flag(1) rank_etaq(7) 
00049 
00050   const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
00051 
00052   //  int isRPC = idx % 2;
00053   //  int isFWD = idx / 2;
00054  
00055   float etaValue = theTriggerScales->getRegionalEtaScale(idx)->getCenter( eta );
00056   
00057   
00058   unsigned flag = 0;
00059   switch (idx) {
00060   case 0: // DT
00061 //    if ( (q==1 || q==4 || q==6 || q==7) ||
00062 //             ( (q==2 || q==3) && (fabs(etaValue) < 0.9) ) ) flag=1;
00063         flag =1;
00064     break;
00065   case 1: // bRPC
00066     if (q==0 and fabs(etaValue)>0.7) flag=1;
00067 //    flag =1;
00068     break;  
00069   case 2: // CSC
00070 //    if ( (q==2 || fabs(etaValue) < 1.2) ||  q==3) flag =1;
00071     if (q==3) flag =1;
00072     break; 
00073   case 3: // fRPC
00074 //    if (q==3) flag =1;
00075         flag =1;
00076   }
00077 
00078   // use local quality as rank
00079   unsigned rank_etaq = q;
00080   // add 1 to RPC in order to promote it in case of equality (should go with the fix in L1MuGMTMerger.cc)
00081   if( idx==1 || idx==3 ) rank_etaq++;
00082   if(m_GeneralLUTVersion == 0) {
00083           // in the overlap region promote RPC (valid for 2011 data)
00084           if( (idx==1 || idx==3) && (fabs(etaValue)>1. && fabs(etaValue)<1.23) ) rank_etaq=7;
00085   }
00086 
00087   return flag << 7 | rank_etaq;
00088 }
00089 
00090 
00091 
00092 
00093 
00094 
00095 
00096 
00097 
00098 
00099 
00100 
00101 
00102 
00103 
00104 
00105 
00106 
00107