00001 //------------------------------------------------- 00002 // 00003 // Class: L1MuGMTLFDeltaEtaLUT 00004 // 00005 // this class was automatically generated by L1MuGMTLUT::MakeSubClass() 00006 // 00007 // $Date: 2007/04/02 15:45:38 $ 00008 // $Revision: 1.3 $ 00009 // 00010 // Author : 00011 // H. Sakulin HEPHY Vienna 00012 // 00013 // Migrated to CMSSW: 00014 // I. Mikulec 00015 // 00016 //-------------------------------------------------- 00017 00018 //----------------------- 00019 // This Class's Header -- 00020 //----------------------- 00021 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTLFDeltaEtaLUT.h" 00022 00023 //------------------------------------ 00024 // Collaborating Class Declarations -- 00025 //------------------------------------ 00026 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTConfig.h" 00027 #include "CondFormats/L1TObjects/interface/L1MuGMTScales.h" 00028 #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h" 00029 #include "CondFormats/L1TObjects/interface/L1MuPacking.h" 00030 00031 void L1MuGMTLFDeltaEtaLUT::InitParameters() { 00032 } 00033 00034 unsigned L1MuGMTLFDeltaEtaLUT::TheLookupFunction (int idx, unsigned eta_dtcsc, unsigned eta_rpc) const { 00035 const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales(); 00036 const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales(); 00037 00038 // idx is DTRPC CSCRPC 00039 00040 float etaValue_dtcsc = theTriggerScales->getRegionalEtaScale(idx*2)->getCenter(eta_dtcsc); 00041 float etaValue_rpc = theTriggerScales->getRegionalEtaScale(idx*2+1)->getCenter(eta_rpc); 00042 00043 float delta_eta = etaValue_dtcsc - etaValue_rpc; 00044 00045 00046 unsigned delta_eta_4bit = 0; 00047 00048 // check out of range 00049 if (delta_eta < theGMTScales->getDeltaEtaScale(idx)->getScaleMin() || 00050 delta_eta > theGMTScales->getDeltaEtaScale(idx)->getScaleMax()) { 00051 L1MuSignedPacking<4> pack; 00052 delta_eta_4bit = pack.packedFromIdx (-8); 00053 } 00054 else { 00055 delta_eta_4bit = theGMTScales->getDeltaEtaScale(idx)->getPacked( delta_eta ); 00056 } 00057 00058 // cout << "delta-eta LUT : idx= " << idx 00059 // << ", etaValue_dtcsc = " << etaValue_dtcsc 00060 // << ", etaValue_rpc = " << etaValue_rpc 00061 // << ", delta_eta = " << delta_eta 00062 // << ", packed = " << delta_eta_4bit 00063 // << endl; 00064 00065 00066 return delta_eta_4bit; 00067 } 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086