CMS 3D CMS Logo

L1MuGMTLFPhiProLUT.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class: L1MuGMTLFPhiProLUT
00004 //
00005 // 
00006 //   $Date: 2008/04/21 17:22:41 $
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/L1MuGMTLFPhiProLUT.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 #include "CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h"
00034 #include "CondFormats/L1TObjects/interface/L1MuPacking.h"
00035 
00036 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTPhiLUT.h"
00037 
00038 //-------------------
00039 // InitParameters  --
00040 //-------------------
00041 
00042 void L1MuGMTLFPhiProLUT::InitParameters() {
00043 }
00044 
00045 //------------------------
00046 // The Lookup Function  --
00047 //------------------------
00048 
00049 //
00050 // Phi projection LUT to project the phi coordinates to the vertex
00051 // 
00052 // The output is 9 bits signed and should be in the range of -32 <= dphi < 32
00053 // (+/- 80 deg)
00054 // 
00055 // The input eta is converted from six to four bits as in the MIP/ISO AU chips
00056 //
00057 // The same parameterization as in the MIP/ISO AU chips can be used (proj. to vertex for ISO).
00058 
00059 unsigned L1MuGMTLFPhiProLUT::TheLookupFunction (int idx, unsigned eta, unsigned pt, unsigned charge) const {
00060   // idx is DT, BRPC, CSC, FRPC
00061   // INPUTS:  eta(4) pt(5) charge(1)
00062   // OUTPUTS: dphi(9) 
00063 
00064 //  const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
00065   const L1MuTriggerPtScale* theTriggerPtScale = L1MuGMTConfig::getTriggerPtScale();
00066 
00067   //  static bool doProjection = SimpleConfigurable<bool> (false, "L1GlobalMuonTrigger:PropagatePhi" );
00068   static bool doProjection = L1MuGMTConfig::getPropagatePhi();
00069 
00070   if (!doProjection) return 0;
00071 
00072   int isRPC = idx % 2;
00073   int isFWD = idx / 2;
00074       
00075   int isys = isFWD + 2 * isRPC; // DT, CSC, BRPC, FRPC
00076   int ch_idx = (charge == 0) ? 1 : 0; // positive charge is 0 (but idx 1)
00077 
00078   // currently only support 3-bit eta (3 lower bits); ignore 4th bit
00079   if (eta>7) eta -= 8;
00080 
00081   float dphi =  L1MuGMTPhiLUT::dphi (isys, 1, ch_idx, (int) eta, 
00082      theTriggerPtScale->getPtScale()->getLowEdge(pt) );  // use old LUT, here
00083   // theTriggerScales->getPtScale()->getLowEdge(pt) );  // use old LUT, here
00084   
00085   int dphi_int = (int) ( (-dphi + 1.25 / 180. * M_PI + 2* M_PI ) / ( 2.5 / 180. * M_PI ) ) - 144;
00086     
00087   L1MuSignedPacking<9> PhiPacking;
00088   return PhiPacking.packedFromIdx(dphi_int);
00089 }
00090 
00091 
00092 
00093 
00094 
00095 
00096 
00097 
00098 
00099 
00100 
00101 
00102 
00103 
00104 
00105 
00106 
00107 
00108 

Generated on Tue Jun 9 17:40:12 2009 for CMSSW by  doxygen 1.5.4