96 for (
int i = 0;
i < 4;
i++) {
101 std::vector<L1MuGMTExtendedCand*>::iterator iter;
117 std::vector<L1MuGMTExtendedCand*>::const_iterator iter;
119 if (*iter && !(*iter)->empty())
173 unsigned HaloOverwritesMatched = 1;
176 for (
int i = 0;
i < 4;
i++) {
178 int match_idx = pairM.
rowAny(
i);
180 int csc_is_halo = (
m_id == 1) && (
dtcsc_mu[
i]->finehalo_packed() == 1);
182 if ((match_idx != -1) &&
183 (!(csc_is_halo && HaloOverwritesMatched)))
195 for (
int j = 0;
j < 4;
j++) {
197 int match_idx = pairM.
colAny(
j);
199 if (match_idx == -1) {
210 std::vector<L1MuGMTExtendedCand*>::const_iterator icand;
248 if ((
m_id == 1) && (
dtcsc_mu[idx_dtcsc]->finehalo_packed() == 1))
298 return ((MMconfig & 32) == 32) || (((MMconfig & 8) == 8) && by_rank) || (((MMconfig & 4) == 4) && by_pt) ||
299 (((MMconfig & 2) == 2) && by_combi);
331 return (
unsigned)newphi;
356 int selected_by_rank =
abs(merge_rank_dtcsc) >=
abs(merge_rank_rpc);
357 int selected_by_pt =
dtcsc_mu[idx_dtcsc]->pt_packed() <=
rpc_mu[idx_rpc]->pt_packed();
362 int selected_by_combi = (merge_rank_dtcsc < 0 && merge_rank_rpc < 0) ? selected_by_rank : selected_by_pt;
374 if (
selectDTCSC(MMConfig_phi, selected_by_rank, selected_by_pt, selected_by_combi))
387 if ((
m_id == 1) ||
dtcsc_mu[idx_dtcsc]->finehalo_packed())
392 if (
selectDTCSC(MMConfig_eta, selected_by_rank, selected_by_pt, selected_by_combi))
408 if (
selectDTCSC(MMConfig_pt, selected_by_rank, selected_by_pt, selected_by_combi))
409 pt =
dtcsc_mu[idx_dtcsc]->pt_packed();
411 pt =
rpc_mu[idx_rpc]->pt_packed();
418 unsigned sy_sign = 0;
422 if (
rpc_mu[idx_rpc]->charge_valid_packed() == 1 &&
dtcsc_mu[idx_dtcsc]->charge_valid_packed() == 0)
427 if (
selectDTCSC(MMConfig_charge, selected_by_rank, selected_by_pt, selected_by_combi))
439 bool mip_bit =
false;
446 mip_bit = mip_bit_dtcsc && mip_bit_rpc;
448 mip_bit = mip_bit_dtcsc || mip_bit_rpc;
450 if (
selectDTCSC(MMConfig_MIP, selected_by_rank, selected_by_pt, selected_by_combi))
451 mip_bit = mip_bit_dtcsc;
453 mip_bit = mip_bit_rpc;
461 bool iso_bit =
false;
468 iso_bit = iso_bit_dtcsc && iso_bit_rpc;
470 iso_bit = iso_bit_dtcsc || iso_bit_rpc;
472 if (
selectDTCSC(MMConfig_ISO, selected_by_rank, selected_by_pt, selected_by_combi))
473 iso_bit = iso_bit_dtcsc;
475 iso_bit = iso_bit_rpc;
486 if (
selectDTCSC(MMConfig_SRK, selected_by_rank, selected_by_pt, selected_by_combi))
507 if (muon ==
nullptr || muon->
empty())
510 unsigned lut_idx = muon->
type_idx();
535 int rank_signed = rank;
unsigned charge_valid_packed() const
return charge valid packed as in hardware (1=valid, 0=not valid)
Log< level::Info, true > LogVerbatim
static L1MuGMTRegMMConfigISO * getRegMMConfigISO()
void setPtPacked(unsigned pt)
set packed pt-code of muon candidate
unsigned SpecificLookup_rank_ptq(int idx, unsigned q, unsigned pt) const
specific lookup function for rank_ptq
static L1MuGMTRegMMConfigCharge * getRegMMConfigCharge()
unsigned SpecificLookup_rank_etaphi(int idx, unsigned eta, unsigned phi) const
specific lookup function for rank_etaphi
const L1MuGMTMatcher * Matcher(int id) const
return pointer to Matcher
void setMIP(bool mip)
set min ionizing bit for muon candidate
std::vector< L1MuGMTExtendedCand * > m_MuonCands
static L1MuGMTLFMergeRankPtQLUT * getLFMergeRankPtQLUT()
const L1MuScale * getPtScale() const
get the Pt scale
static L1MuGMTRegMMConfigEta * getRegMMConfigEta()
unsigned SpecificLookup_eta_gmt(int idx, unsigned eta_regional) const
specific lookup function for eta_gmt
unsigned int phiIndex() const
get phi-code
uint32_t const *__restrict__ Quality * quality
static bool isDisabled(const L1MuRegionalCand *)
Diable bit.
virtual bool empty() const
return empty flag
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
unsigned charge_packed() const
return charge packed as in hardware (0=pos, 1=neg)
void createMergedCand(int idx_dtcsc, int idx_rpc)
unsigned getValue(int idx)
get Value
void setDTCSCIndex(unsigned int idxdtcsc)
set index of contributing DT/CSC muon
unsigned int etaIndex() const
get eta-code
int rowAny(int r) const
is any element in row r > 0 ? return index or -1
bool MIP(int idx) const
return select matrix (idx 0..3: DT/CSC, idx 4..7: RPC)
int selectDTCSC(unsigned MMconfig, int by_rank, int by_pt, int by_combi) const
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
unsigned projectedPhi(const L1MuRegionalCand *mu) const
unsigned SpecificLookup_dphi(int idx, unsigned eta, unsigned pt, unsigned charge) const
specific lookup function for dphi
const L1MuRegionalCand * CSCMuon(int index) const
get CSC muon
static unsigned getVeryLowQualityLevel(const L1MuRegionalCand *)
Very low quality bits.
void createDTCSCCand(int idx_dtcsc)
virtual ~L1MuGMTMerger()
destructor
unsigned SpecificLookup_merge_rank(int idx, unsigned rank_etaq, unsigned rank_ptq, unsigned rank_etaphi) const
specific lookup function for merge_rank
std::vector< const L1MuRegionalCand * > dtcsc_mu
static L1MuGMTRegMMConfigSRK * getRegMMConfigSRK()
const L1MuGlobalMuonTrigger & m_gmt
unsigned SpecificLookup_eta_out(int idx, unsigned eta_in) const
specific lookup function for eta_out
void setPhiValue(float phiVal)
Setters for physical values.
void setFwdBit(unsigned int fwdbit)
set forward bit (1=forward, 0=barrel)
const L1MuGMTPSB * Data() const
return pointer to PSB
static L1MuGMTRegMMConfigPhi * getRegMMConfigPhi()
const bool cancelMyChipMuon(int idx) const
return cancel bit for DT (m_id==0 || m_id==3) or CSC (m_id==1 || m_id==2) muon
static L1MuGMTLFPhiProLUT * getLFPhiProLUT()
const L1MuScale * getPhiScale() const
get the phi scale
static L1MuGMTRegMMConfigPt * getRegMMConfigPt()
Abs< T >::type abs(const T &t)
const L1MuRegionalCand * RPCMuon(int index) const
get RPC muon
const L1MuGMTCancelOutUnit * CancelOutUnit(int id) const
return pointer to Cancel Out Unit
unsigned eta_packed() const
return eta packed as in hardware
static const unsigned int MAXCSC
static unsigned sort_rank(const L1MuRegionalCand *)
Sort Rank Table.
static const unsigned int MAXDTBX
static const unsigned int MAXRPCendcap
unsigned SpecificLookup_rank_etaq(int idx, unsigned eta, unsigned q) const
specific lookup function for rank_etaq
void setBx(int bx)
set bunch crossing identifier
static L1MuGMTLFPtMixLUT * getLFPtMixLUT()
unsigned sysign(const L1MuRegionalCand *mu) const
void print() const
print results after selection
int doANDMerge(unsigned MMconfig) const
void setChargePacked(unsigned ch)
set packed charge/synchronization word of muon candidate (0=POS, 1=NEG, 2=UNDEF, 3=SYNC) ...
static L1MuGMTLFMergeRankEtaPhiLUT * getLFMergeRankEtaPhiLUT()
unsigned SpecificLookup_pt_mixed(int idx, unsigned pt_dtcsc, unsigned pt_rpc) const
specific lookup function for pt_mixed
unsigned convertedEta(const L1MuRegionalCand *mu) const
static const L1MuTriggerPtScale * getTriggerPtScale()
int idxFromPacked(unsigned packed) const override
get the value from the packed notation (+/-)
int merge_rank(const L1MuRegionalCand *) const
Merge Rank Table.
std::vector< const L1MuRegionalCand * > rpc_mu
const L1MuGMTMipIsoAU * MipIsoAU(int id) const
return pointer to MIP & ISO bit assignment unit
void setQuality(unsigned quality)
set quality of muon candidate
unsigned SpecificLookup_flag(int idx, unsigned eta, unsigned q) const
specific lookup function for flag
static L1MuGMTLFMergeRankCombineLUT * getLFMergeRankCombineLUT()
static const L1MuTriggerScales * getTriggerScales()
void setEtaPacked(unsigned eta)
set packed eta-code of muon candidate
void setEtaValue(float etaVal)
Set Eta Value (need to set type, first)
void setRPCBit(unsigned int rpcbit)
set RPC bit (1=RPC, 0=DT/CSC or matched)
const bool cancelOtherChipMuon(int idx) const
return cancel bit for barrel RPC (m_id==2) or forward RPC (m_id==3) muon
static L1MuGMTLFEtaConvLUT * getLFEtaConvLUT()
const L1MuRegionalCand * DTBXMuon(int index) const
get DTBX muon
void setRank(unsigned int rank)
set rank
bool ISO(int idx) const
return select matrix (idx 0..3: DT/CSC, idx 4..7: RPC)
unsigned int quality_packed() const
return quality packed as in hardware
const L1MuGMTMatrix< bool > & pairM() const
return pair matrix
static L1MuGMTRegSortRankOffset * getRegSortRankOffset()
static L1MuGMTRegMMConfigMIP * getRegMMConfigMIP()
L1MuGMTMerger(const L1MuGlobalMuonTrigger &gmt, int id)
constructor
const L1MuScale * getGMTEtaScale() const
get the GMT eta scale
static const unsigned int MAXRPCbarrel
void setPtValue(float ptVal)
Set Pt Value.
unsigned pt_packed() const
return pt packed as in hardware
unsigned int ptIndex() const
get pt-code
int colAny(int c) const
is any element in column c > 0 ? return index or -1
static L1MuGMTLFPhiProEtaConvLUT * getLFPhiProEtaConvLUT()
void setRPCIndex(unsigned int idxrpc)
set index of contributing RPC muon
void setPhiPacked(unsigned phi)
set packed phi-code of muon candidate
unsigned type_idx() const
return type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC
static L1MuGMTLFMergeRankEtaQLUT * getLFMergeRankEtaQLUT()
void setIsolation(bool isol)
set isolation of muon candidate
int doSpecialMerge(unsigned MMconfig) const
void createRPCCand(int idx_rpc)
unsigned phi_packed() const
return phi packed as in hardware