Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTPhiProjectionUnit.h"
00024
00025
00026
00027
00028
00029 #include <iostream>
00030 #include <vector>
00031 #include <cmath>
00032
00033
00034
00035
00036
00037 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTConfig.h"
00038 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTMipIsoAU.h"
00039
00040 #include "L1Trigger/GlobalMuonTrigger/interface/L1MuGlobalMuonTrigger.h"
00041
00042 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTDebugBlock.h"
00043 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTMIAUEtaConvLUT.h"
00044 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTMIAUPhiPro1LUT.h"
00045 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTMIAUPhiPro2LUT.h"
00046
00047 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00048
00049
00050
00051
00052
00053
00054
00055
00056 L1MuGMTPhiProjectionUnit::L1MuGMTPhiProjectionUnit(const L1MuGMTMipIsoAU& miau, int id) :
00057 m_MIAU(miau), m_id(id), m_mu(0) {
00058 }
00059
00060
00061
00062
00063 L1MuGMTPhiProjectionUnit::~L1MuGMTPhiProjectionUnit() {
00064
00065 reset();
00066
00067 }
00068
00069
00070
00071
00072
00073
00074
00075
00076 void L1MuGMTPhiProjectionUnit::run() {
00077
00078 load();
00079 if (m_mu && ( !m_mu->empty() ) ) {
00080 int lut_id = m_id / 4;
00081
00082
00083 unsigned pt = m_mu->pt_packed();
00084 unsigned charge = m_mu->charge_packed();
00085 unsigned eta = m_mu->eta_packed();
00086 unsigned phi = m_mu->phi_packed();
00087
00088
00089 unsigned phi_fine = phi & ( (1<<3) - 1 );
00090 unsigned phi_coarse = phi >> 3;
00091
00092
00093 L1MuGMTMIAUEtaConvLUT* etaconv_lut = L1MuGMTConfig::getMIAUEtaConvLUT();
00094 unsigned eta4bit = etaconv_lut->SpecificLookup_eta_out (lut_id, eta);
00095
00096
00097 L1MuGMTMIAUPhiPro1LUT* phipro1_lut = L1MuGMTConfig::getMIAUPhiPro1LUT();
00098 unsigned cphi_fine = phipro1_lut->SpecificLookup_cphi_fine (lut_id, phi_fine, eta4bit, pt, charge);
00099 unsigned cphi_ofs = phipro1_lut->SpecificLookup_cphi_ofs (lut_id, phi_fine, eta4bit, pt, charge);
00100
00101
00102 L1MuGMTMIAUPhiPro2LUT* phipro2_lut = L1MuGMTConfig::getMIAUPhiPro2LUT();
00103 unsigned phi_sel_bits = phipro2_lut->SpecificLookup_phi_sel (lut_id, phi_coarse, cphi_fine, cphi_ofs, charge);
00104
00105
00106
00107
00108
00109 m_phi_select = (unsigned) 0;
00110
00111
00112 for (unsigned int i=0; i<9; i++)
00113 if ( (phi_sel_bits & (1 << i)) == (unsigned) (1<<i))
00114 m_phi_select[i+9] = 1;
00115
00116 for (unsigned int i=9; i<18; i++)
00117 if ( (phi_sel_bits & (1 << i)) == (unsigned) (1<<i))
00118 m_phi_select[i-9] = 1;
00119
00120 m_MIAU.GMT().DebugBlockForFill()->SetPhiSelBits( m_id, m_phi_select.to_ulong()) ;
00121 }
00122 }
00123
00124
00125
00126
00127
00128 void L1MuGMTPhiProjectionUnit::reset() {
00129
00130 m_mu = 0;
00131 m_iphi = 0;
00132 m_fphi = 0.;
00133 m_phi_select = (unsigned int) 0;
00134 }
00135
00136
00137
00138
00139
00140 void L1MuGMTPhiProjectionUnit::print() const {
00141
00142 edm::LogVerbatim("GMT_PhiProjection_info") << "Phi select bits: ";
00143 for ( int i=0; i<18; i++ ) {
00144 edm::LogVerbatim("GMT_PhiProjection_info") << m_phi_select[i] << " ";
00145 }
00146 edm::LogVerbatim("GMT_PhiProjection_info") << " ";
00147 }
00148
00149
00150
00151
00152
00153 void L1MuGMTPhiProjectionUnit::load() {
00154
00155
00156 m_mu = m_MIAU.muon( m_id % 8 );
00157 }
00158
00159