CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/L1Trigger/GlobalMuonTrigger/src/L1MuGMTLFMergeRankEtaQLUT.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class: L1MuGMTLFMergeRankEtaQLUT
00004 //
00005 // 
00006 //   $Date: 2011/09/06 08:48:59 $
00007 //   $Revision: 1.5 $
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     break;
00064   case 1: // bRPC
00065     if (q==0) flag=1; 
00066     break;  
00067   case 2: // CSC
00068     if ( (q==2 || fabs(etaValue) < 1.2) || 
00069          q==3) flag =1; 
00070     break; 
00071   case 3: // fRPC
00072     if (q==3) flag =1;
00073   }
00074 
00075   // use local quality as rank
00076   unsigned rank_etaq = q;
00077   // add 1 to RPC in order to promote it in case of equality (should go with the fix in L1MuGMTMerger.cc)
00078   if( idx==1 || idx==3 ) rank_etaq++;
00079   // in the overlap region promote RPC
00080   if( (idx==1 || idx==3) && (fabs(etaValue)>1. && fabs(etaValue)<1.23) ) rank_etaq=7;
00081 
00082   return flag << 7 | rank_etaq;
00083 }
00084 
00085 
00086 
00087 
00088 
00089 
00090 
00091 
00092 
00093 
00094 
00095 
00096 
00097 
00098 
00099 
00100 
00101 
00102