CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/L1Trigger/GlobalMuonTrigger/src/L1MuGMTEtaProjectionUnit.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class: L1MuGMTEtaProjectionUnit
00004 //
00005 //   Description: GMT Eta Projection Unit
00006 //
00007 //
00008 //   $Date: 2007/04/10 09:59:19 $
00009 //   $Revision: 1.4 $
00010 //
00011 //   Author :
00012 //   H. Sakulin                CERN EP 
00013 //
00014 //   Migrated to CMSSW:
00015 //   I. Mikulec
00016 //
00017 //--------------------------------------------------
00018 
00019 //-----------------------
00020 // This Class's Header --
00021 //-----------------------
00022 
00023 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTEtaProjectionUnit.h"
00024 //---------------
00025 // C++ Headers --
00026 //---------------
00027 
00028 #include <iostream>
00029 #include <vector>
00030 #include <cmath>
00031 
00032 //-------------------------------
00033 // Collaborating Class Headers --
00034 //-------------------------------
00035 
00036 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTConfig.h"
00037 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTMipIsoAU.h"
00038 #include "L1Trigger/GlobalMuonTrigger/interface/L1MuGlobalMuonTrigger.h"
00039 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTDebugBlock.h"
00040 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTMIAUEtaProLUT.h"
00041 
00042 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00043 
00044 
00045 // --------------------------------
00046 //       class L1MuGMTEtaProjectionUnit
00047 //---------------------------------
00048 
00049 //----------------
00050 // Constructors --
00051 //----------------
00052 L1MuGMTEtaProjectionUnit::L1MuGMTEtaProjectionUnit(const L1MuGMTMipIsoAU& miau, int id) : 
00053   m_MIAU(miau), m_id(id), m_mu(0) {
00054 
00055 }
00056 
00057 //--------------
00058 // Destructor --
00059 //--------------
00060 L1MuGMTEtaProjectionUnit::~L1MuGMTEtaProjectionUnit() { 
00061 
00062   reset();
00063   
00064 }
00065 
00066 //--------------
00067 // Operations --
00068 //--------------
00069  
00070 //
00071 // run eta projection unit
00072 //
00073 void L1MuGMTEtaProjectionUnit::run() {
00074 
00075   load();
00076   if ( m_mu && ( !m_mu->empty() ) ) {
00077     
00078     int isFwd = m_id / 16;
00079     int lut_id = m_id / 4;
00080 
00081     // obtain inputs as coded in HW
00082     unsigned pt  = m_mu->pt_packed();
00083     unsigned charge  = m_mu->charge_packed();
00084     unsigned eta = m_mu->eta_packed();
00085     
00086     // lookup
00087     L1MuGMTMIAUEtaProLUT* ep_lut = L1MuGMTConfig::getMIAUEtaProLUT();
00088     unsigned eta_sel_bits = ep_lut->SpecificLookup_eta_sel (lut_id, eta, pt, charge);
00089 
00090     // convert to bit array
00091     //
00092     // see comments in L1MuGMTMIAUEtaProLUT.cc
00093     //
00094     m_eta_select = (unsigned) 0;
00095     
00096     if (isFwd) { // forward
00097       for (int i=0; i<5; i++)
00098         if ( (eta_sel_bits & (1 << i))  == (unsigned) (1<<i))
00099           m_eta_select[i] = 1;
00100       
00101       for (int i=5; i<10; i++)
00102         if ( (eta_sel_bits & (1 << i))  == (unsigned) (1<<i))
00103           m_eta_select[i+4] = 1;            
00104     } else { // barrel
00105       for (int i=0; i<10; i++)
00106         if ( (eta_sel_bits & (1 << i))  == (unsigned) (1<<i))
00107           m_eta_select[i+2] = 1;
00108     }
00109     
00110     //    m_MIAU.GMT().DebugBlockForFill()->SetEtaSelBits( m_id, m_eta_select.read(0,14)) ;
00111     m_MIAU.GMT().DebugBlockForFill()->SetEtaSelBits( m_id, m_eta_select.to_ulong()) ;
00112   }
00113 }
00114 
00115 
00116 //
00117 // reset eta projection unit
00118 //
00119 void L1MuGMTEtaProjectionUnit::reset() {
00120 
00121   m_mu = 0;
00122   m_ieta = 0;
00123   m_feta = 0.;
00124   m_eta_select = (unsigned int) 0;
00125 }
00126 
00127 
00128 //
00129 // print results of eta projection
00130 //
00131 void L1MuGMTEtaProjectionUnit::print() const {
00132 
00133   edm::LogVerbatim("GMT_EtaProjection_info") << "Eta select bits: ";
00134   for ( int i=0; i<14; i++ ) {
00135     edm::LogVerbatim("GMT_EtaProjection_info") << m_eta_select[i] << "  ";
00136   }
00137   edm::LogVerbatim("GMT_EtaProjection_info");
00138 }
00139 
00140 
00141 //
00142 // load 1 muon into eta projection unit
00143 //
00144 void L1MuGMTEtaProjectionUnit::load() {
00145 
00146   // retrieve muon from MIP & ISO bit assignment unit   
00147   m_mu = m_MIAU.muon( m_id % 8 );
00148 }
00149 
00150 
00151 
00152 
00153 
00154 
00155 
00156 
00157 
00158 
00159 
00160 
00161 
00162