CMS 3D CMS Logo

L1MuGMTMIAUPhiPro1LUT Class Reference

MIAUPhiPro1 look-up table. More...

#include <L1Trigger/GlobalMuonTrigger/src/L1MuGMTMIAUPhiPro1LUT.h>

Inheritance diagram for L1MuGMTMIAUPhiPro1LUT:

L1MuGMTLUT

List of all members.

Public Types

enum  {
  MIP_DT, MIP_BRPC, ISO_DT, ISO_BRPC,
  MIP_CSC, MIP_FRPC, ISO_CSC, ISO_FRPC
}

Public Member Functions

 L1MuGMTMIAUPhiPro1LUT ()
 constuctor using function-lookup
virtual unsigned LookupFunctionPacked (int idx, unsigned address) const
 access to lookup function with packed input and output
unsigned SpecificLookup (int idx, unsigned phi_fine, unsigned eta, unsigned pt, unsigned charge) const
 specific lookup function for entire output field
unsigned SpecificLookup_cphi_fine (int idx, unsigned phi_fine, unsigned eta, unsigned pt, unsigned charge) const
 specific lookup function for cphi_fine
unsigned SpecificLookup_cphi_ofs (int idx, unsigned phi_fine, unsigned eta, unsigned pt, unsigned charge) const
 specific lookup function for cphi_ofs
virtual ~L1MuGMTMIAUPhiPro1LUT ()
 destructor

Private Member Functions

void InitParameters ()
 Initialize scales, configuration parameters, alignment constants, ...
unsigned TheLookupFunction (int idx, unsigned phi_fine, unsigned eta, unsigned pt, unsigned charge) const
 The lookup function - here the functionality of the LUT is implemented.

Private Attributes

float m_calo_align
 Private data members (LUT parameters);.


Detailed Description

MIAUPhiPro1 look-up table.

this class was automatically generated by L1MuGMTLUT::MakeSubClass()

Definition at line 42 of file L1MuGMTMIAUPhiPro1LUT.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
MIP_DT 
MIP_BRPC 
ISO_DT 
ISO_BRPC 
MIP_CSC 
MIP_FRPC 
ISO_CSC 
ISO_FRPC 

Definition at line 45 of file L1MuGMTMIAUPhiPro1LUT.h.


Constructor & Destructor Documentation

L1MuGMTMIAUPhiPro1LUT::L1MuGMTMIAUPhiPro1LUT (  )  [inline]

constuctor using function-lookup

Definition at line 48 of file L1MuGMTMIAUPhiPro1LUT.h.

References InitParameters().

00048                           : L1MuGMTLUT("MIAUPhiPro1", 
00049                                        "MIP_DT MIP_BRPC ISO_DT ISO_BRPC MIP_CSC MIP_FRPC ISO_CSC ISO_FRPC",
00050                                        "phi_fine(3) eta(4) pt(5) charge(1)",
00051                                        "cphi_fine(1) cphi_ofs(3)", 11, false) {
00052     InitParameters();
00053   } ;

virtual L1MuGMTMIAUPhiPro1LUT::~L1MuGMTMIAUPhiPro1LUT (  )  [inline, virtual]

destructor

Definition at line 56 of file L1MuGMTMIAUPhiPro1LUT.h.

00056 {};


Member Function Documentation

void L1MuGMTMIAUPhiPro1LUT::InitParameters (  )  [private]

Initialize scales, configuration parameters, alignment constants, ...

Definition at line 43 of file L1MuGMTMIAUPhiPro1LUT.cc.

References m_calo_align.

Referenced by L1MuGMTMIAUPhiPro1LUT().

00043                                            {
00044   m_calo_align = 0.; //***FIXME: read from DB or .orcarc
00045 }

virtual unsigned L1MuGMTMIAUPhiPro1LUT::LookupFunctionPacked ( int  idx,
unsigned  address 
) const [inline, virtual]

access to lookup function with packed input and output

Reimplemented from L1MuGMTLUT.

Definition at line 92 of file L1MuGMTMIAUPhiPro1LUT.h.

References addr, L1MuGMTLUT::m_Inputs, TheLookupFunction(), and L1MuGMTLUT::u2vec().

00092                                                                           {
00093     std::vector<unsigned> addr = u2vec(address, m_Inputs);
00094     return TheLookupFunction(idx ,addr[0] ,addr[1] ,addr[2] ,addr[3]);
00095 
00096   };

unsigned L1MuGMTMIAUPhiPro1LUT::SpecificLookup ( int  idx,
unsigned  phi_fine,
unsigned  eta,
unsigned  pt,
unsigned  charge 
) const [inline]

specific lookup function for entire output field

Definition at line 79 of file L1MuGMTMIAUPhiPro1LUT.h.

References addr, and L1MuGMTLUT::LookupPacked().

00079                                                                                                          {
00080     std::vector<unsigned> addr(4);
00081     addr[0] = phi_fine;
00082     addr[1] = eta;
00083     addr[2] = pt;
00084     addr[3] = charge;
00085     return LookupPacked(idx, addr);
00086   };

unsigned L1MuGMTMIAUPhiPro1LUT::SpecificLookup_cphi_fine ( int  idx,
unsigned  phi_fine,
unsigned  eta,
unsigned  pt,
unsigned  charge 
) const [inline]

specific lookup function for cphi_fine

Definition at line 59 of file L1MuGMTMIAUPhiPro1LUT.h.

References addr, and L1MuGMTLUT::Lookup().

Referenced by L1MuGMTPhiProjectionUnit::run().

00059                                                                                                                    {
00060     std::vector<unsigned> addr(4);
00061     addr[0] = phi_fine;
00062     addr[1] = eta;
00063     addr[2] = pt;
00064     addr[3] = charge;
00065     return Lookup(idx, addr) [0];
00066   };

unsigned L1MuGMTMIAUPhiPro1LUT::SpecificLookup_cphi_ofs ( int  idx,
unsigned  phi_fine,
unsigned  eta,
unsigned  pt,
unsigned  charge 
) const [inline]

specific lookup function for cphi_ofs

Definition at line 69 of file L1MuGMTMIAUPhiPro1LUT.h.

References addr, and L1MuGMTLUT::Lookup().

Referenced by L1MuGMTPhiProjectionUnit::run().

00069                                                                                                                   {
00070     std::vector<unsigned> addr(4);
00071     addr[0] = phi_fine;
00072     addr[1] = eta;
00073     addr[2] = pt;
00074     addr[3] = charge;
00075     return Lookup(idx, addr) [1];
00076   };

unsigned L1MuGMTMIAUPhiPro1LUT::TheLookupFunction ( int  idx,
unsigned  phi_fine,
unsigned  eta,
unsigned  pt,
unsigned  charge 
) const [private]

The lookup function - here the functionality of the LUT is implemented.

Definition at line 85 of file L1MuGMTMIAUPhiPro1LUT.cc.

References L1MuGMTPhiLUT::dphi(), lat::endl(), L1MuScale::getLowEdge(), L1MuTriggerPtScale::getPtScale(), L1MuGMTConfig::getTriggerPtScale(), int, and m_calo_align.

Referenced by LookupFunctionPacked().

00085                                                                                                                                {
00086   // idx is MIP_DT, MIP_BRPC, ISO_DT, ISO_BRPC, MIP_CSC, MIP_FRPC, ISO_CSC, ISO_FRPC
00087   // INPUTS:  phi_fine(3) eta(4) pt(5) charge(1)
00088   // OUTPUTS: cphi_fine(1) cphi_ofs(3) 
00089 
00090 //  const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
00091   const L1MuTriggerPtScale* theTriggerPtScale = L1MuGMTConfig::getTriggerPtScale();
00092 
00093   int isRPC = idx % 2;
00094   int isFWD = idx / 4;
00095       
00096   int isys = isFWD + 2 * isRPC; // DT, CSC, BRPC, FRPC
00097   int isISO = (idx / 2) % 2;
00098 
00099   int ch_idx = (charge == 0) ? 1 : 0; // positive charge is 0 (but idx 1)
00100 
00101   // currently only support 3-bit eta (3 lower bits); ignore 4th bit
00102   if (eta>7) eta -= 8;
00103 
00104   float dphi =  L1MuGMTPhiLUT::dphi (isys, isISO, ch_idx, (int) eta, 
00105      theTriggerPtScale->getPtScale()->getLowEdge(pt) );  // use old LUT, here
00106   // theTriggerScales->getPtScale()->getLowEdge(pt) );  // use old LUT, here
00107       
00108   // calculate phi in calo relative to low edge of start region
00109   // == use low edge of muon phi bin as dphi was calculated with this assumption
00110 
00111   float calophi = phi_fine *  2.5 / 180. * M_PI - dphi - m_calo_align;
00112 
00113   if (charge == 0 && calophi < 0.) { // plus charge
00114     edm::LogWarning("LUTMismatch")
00115          << "warning: calo offset goes into wrong direction. charge is plus and calophi < 0deg" << endl
00116          << "SYS=" << ( isys==0?"DT":isys==1? "CSC" : isys== 2? "BRPC" : "FRPC" )
00117          << " ISO = " << isISO
00118          << " etabin = " << eta
00119          << " pval = " << theTriggerPtScale->getPtScale()->getLowEdge(pt)
00120       // << " pval = " << theTriggerScales->getPtScale()->getLowEdge(pt)
00121          << " charge = " << ( charge==0?"pos":"neg" )
00122          << " phi_fine = " << phi_fine
00123          << " calophi(deg) = " << calophi * 180. / M_PI
00124          << endl;
00125   }
00126   else if (charge == 1 && calophi > 20. / 180. * M_PI) { // neg charge
00127      edm::LogWarning("LUTMismatch")
00128          << "warning: calo offset goes into wrong direction. charge is minus and calophi > 20deg" << endl       
00129          << "SYS=" << ( isys==0?"DT":isys==1? "CSC" : isys== 2? "BRPC" : "FRPC" )
00130          << " ISO = " << isISO
00131          << " etabin = " << eta
00132          << " pval = " << theTriggerPtScale->getPtScale()->getLowEdge(pt)
00133        // << " pval = " << theTriggerScales->getPtScale()->getLowEdge(pt)
00134          << " charge = " << ( charge==0?"pos":"neg" )
00135          << " phi_fine = " << phi_fine
00136          << " calophi(deg) = " << calophi * 180. / M_PI
00137          << endl;
00138   }
00139       
00140   // which half of calo region
00141   int cphi_fine = (int) ( ( calophi + 2. * M_PI ) /  ( 10. / 180. * M_PI )  );
00142   cphi_fine %= 2;
00143 
00144   // shift by one region so that an offset in wrong direction w.r.t. bending becomes possible
00145   // (may be necessary to accomodate a calo alignment)
00146   if (charge == 1) // neg charge
00147     calophi = 20. / 180 * M_PI - calophi;
00148   calophi += 20. / 180 * M_PI;
00149 
00150   if (calophi < 0.) {
00151     edm::LogWarning("LUTMismatch")
00152         << "warning: calo offset goes into wrong direction by more than 20deg !!!! please correct!" << endl;    
00153     calophi = 0.;
00154   }
00155   int cphi_ofs =  (int) ( calophi / ( 20. / 180. * M_PI) ); // in 20 deg regions
00156   // 0; -1 region; 1 no offset; 2: +1 region , ... 7: +6 regions
00157 
00158   if (cphi_ofs > 7) {
00159     edm::LogWarning("LUTMismatch")
00160         << "warning: calo offset is larger than 6 regions !!!! please correct!" << endl;        
00161     cphi_ofs = 7;
00162   }
00163 
00164   return (  (cphi_fine << 3) + cphi_ofs  );
00165 }


Member Data Documentation

float L1MuGMTMIAUPhiPro1LUT::m_calo_align [private]

Private data members (LUT parameters);.

Definition at line 106 of file L1MuGMTMIAUPhiPro1LUT.h.

Referenced by InitParameters(), and TheLookupFunction().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:26:55 2009 for CMSSW by  doxygen 1.5.4