File indexing completed on 2024-04-06 12:19:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTPhiProjectionUnit.h"
0022
0023
0024
0025
0026
0027 #include <iostream>
0028 #include <vector>
0029 #include <cmath>
0030
0031
0032
0033
0034
0035 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTConfig.h"
0036 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTMipIsoAU.h"
0037
0038 #include "L1Trigger/GlobalMuonTrigger/interface/L1MuGlobalMuonTrigger.h"
0039
0040 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTDebugBlock.h"
0041 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTMIAUEtaConvLUT.h"
0042 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTMIAUPhiPro1LUT.h"
0043 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTMIAUPhiPro2LUT.h"
0044
0045 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0046
0047
0048
0049
0050
0051
0052
0053
0054 L1MuGMTPhiProjectionUnit::L1MuGMTPhiProjectionUnit(const L1MuGMTMipIsoAU& miau, int id)
0055 : m_MIAU(miau), m_id(id), m_mu(nullptr) {}
0056
0057
0058
0059
0060 L1MuGMTPhiProjectionUnit::~L1MuGMTPhiProjectionUnit() { reset(); }
0061
0062
0063
0064
0065
0066
0067
0068
0069 void L1MuGMTPhiProjectionUnit::run() {
0070 load();
0071 if (m_mu && (!m_mu->empty())) {
0072 int lut_id = m_id / 4;
0073
0074
0075 unsigned pt = m_mu->pt_packed();
0076 unsigned charge = m_mu->charge_packed();
0077 unsigned eta = m_mu->eta_packed();
0078 unsigned phi = m_mu->phi_packed();
0079
0080
0081 unsigned phi_fine = phi & ((1 << 3) - 1);
0082 unsigned phi_coarse = phi >> 3;
0083
0084
0085 L1MuGMTMIAUEtaConvLUT* etaconv_lut = L1MuGMTConfig::getMIAUEtaConvLUT();
0086 unsigned eta4bit = etaconv_lut->SpecificLookup_eta_out(lut_id, eta);
0087
0088
0089 L1MuGMTMIAUPhiPro1LUT* phipro1_lut = L1MuGMTConfig::getMIAUPhiPro1LUT();
0090 unsigned cphi_fine = phipro1_lut->SpecificLookup_cphi_fine(lut_id, phi_fine, eta4bit, pt, charge);
0091 unsigned cphi_ofs = phipro1_lut->SpecificLookup_cphi_ofs(lut_id, phi_fine, eta4bit, pt, charge);
0092
0093
0094 L1MuGMTMIAUPhiPro2LUT* phipro2_lut = L1MuGMTConfig::getMIAUPhiPro2LUT();
0095 unsigned phi_sel_bits = phipro2_lut->SpecificLookup_phi_sel(lut_id, phi_coarse, cphi_fine, cphi_ofs, charge);
0096
0097
0098
0099
0100
0101 m_phi_select = (unsigned)0;
0102
0103
0104 for (unsigned int i = 0; i < 9; i++)
0105 if ((phi_sel_bits & (1 << i)) == (unsigned)(1 << i))
0106 m_phi_select[i + 9] = true;
0107
0108 for (unsigned int i = 9; i < 18; i++)
0109 if ((phi_sel_bits & (1 << i)) == (unsigned)(1 << i))
0110 m_phi_select[i - 9] = true;
0111
0112 m_MIAU.GMT().DebugBlockForFill()->SetPhiSelBits(m_id, m_phi_select.to_ulong());
0113 }
0114 }
0115
0116
0117
0118
0119 void L1MuGMTPhiProjectionUnit::reset() {
0120 m_mu = nullptr;
0121 m_iphi = 0;
0122 m_fphi = 0.;
0123 m_phi_select = (unsigned int)0;
0124 }
0125
0126
0127
0128
0129 void L1MuGMTPhiProjectionUnit::print() const {
0130 edm::LogVerbatim("GMT_PhiProjection_info") << "Phi select bits: ";
0131 for (int i = 0; i < 18; i++) {
0132 edm::LogVerbatim("GMT_PhiProjection_info") << m_phi_select[i] << " ";
0133 }
0134 edm::LogVerbatim("GMT_PhiProjection_info") << " ";
0135 }
0136
0137
0138
0139
0140 void L1MuGMTPhiProjectionUnit::load() {
0141
0142 m_mu = m_MIAU.muon(m_id % 8);
0143 }