Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 //-------------------------------------------------
0002 //
0003 //   Class: L1MuGMTLFPhiProLUT
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/L1MuGMTLFPhiProLUT.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 #include "CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h"
0032 #include "CondFormats/L1TObjects/interface/L1MuPacking.h"
0033 
0034 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTPhiLUT.h"
0035 
0036 //-------------------
0037 // InitParameters  --
0038 //-------------------
0039 
0040 void L1MuGMTLFPhiProLUT::InitParameters() {}
0041 
0042 //------------------------
0043 // The Lookup Function  --
0044 //------------------------
0045 
0046 //
0047 // Phi projection LUT to project the phi coordinates to the vertex
0048 //
0049 // The output is 9 bits signed and should be in the range of -32 <= dphi < 32
0050 // (+/- 80 deg)
0051 //
0052 // The input eta is converted from six to four bits as in the MIP/ISO AU chips
0053 //
0054 // The same parameterization as in the MIP/ISO AU chips can be used (proj. to vertex for ISO).
0055 
0056 unsigned L1MuGMTLFPhiProLUT::TheLookupFunction(int idx, unsigned eta, unsigned pt, unsigned charge) const {
0057   // idx is DT, BRPC, CSC, FRPC
0058   // INPUTS:  eta(4) pt(5) charge(1)
0059   // OUTPUTS: dphi(9)
0060 
0061   //  const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
0062   const L1MuTriggerPtScale* theTriggerPtScale = L1MuGMTConfig::getTriggerPtScale();
0063 
0064   //  static bool doProjection = SimpleConfigurable<bool> (false, "L1GlobalMuonTrigger:PropagatePhi" );
0065   static bool doProjection = L1MuGMTConfig::getPropagatePhi();
0066 
0067   if (!doProjection)
0068     return 0;
0069 
0070   int isRPC = idx % 2;
0071   int isFWD = idx / 2;
0072 
0073   int isys = isFWD + 2 * isRPC;        // DT, CSC, BRPC, FRPC
0074   int ch_idx = (charge == 0) ? 1 : 0;  // positive charge is 0 (but idx 1)
0075 
0076   // currently only support 3-bit eta (3 lower bits); ignore 4th bit
0077   if (eta > 7)
0078     eta -= 8;
0079 
0080   float dphi = L1MuGMTPhiLUT::dphi(isys,
0081                                    1,
0082                                    ch_idx,
0083                                    (int)eta,
0084                                    theTriggerPtScale->getPtScale()->getLowEdge(pt));  // use old LUT, here
0085   // theTriggerScales->getPtScale()->getLowEdge(pt) );  // use old LUT, here
0086 
0087   int dphi_int = (int)((-dphi + 1.25 / 180. * M_PI + 2 * M_PI) / (2.5 / 180. * M_PI)) - 144;
0088 
0089   L1MuSignedPacking<9> PhiPacking;
0090   return PhiPacking.packedFromIdx(dphi_int);
0091 }