72 m_gmt(gmt),
m_id(id), dtcsc_mu(4), rpc_mu(4) {
104 for (
int i = 0;
i < 4;
i++ ) {
109 std::vector<L1MuGMTExtendedCand*>::iterator
iter;
111 if ( *iter )
delete (*iter);
127 std::vector<L1MuGMTExtendedCand*>::const_iterator
iter;
129 if ( *iter && !(*iter)->empty() ) (*iter)->print();
188 unsigned HaloOverwritesMatched = 1;
191 for (
int i=0;
i<4;
i++) {
194 int match_idx = pairM.
rowAny(
i);
196 int csc_is_halo = (
m_id==1) && (
dtcsc_mu[
i]->finehalo_packed() == 1);
198 if ( (match_idx != -1) &&
199 (! (csc_is_halo && HaloOverwritesMatched) ) )
212 for (
int j=0;
j<4;
j++) {
215 int match_idx = pairM.
colAny(
j);
217 if (match_idx == -1) {
229 std::vector<L1MuGMTExtendedCand*>::const_iterator icand;
254 case 0: quality = 6;
break;
255 case 1: quality = 2;
break;
256 case 2: quality = 3;
break;
257 case 3: quality = 4;
break;
260 if ( (
m_id==1) && (
dtcsc_mu[idx_dtcsc]->finehalo_packed() == 1) )
287 case 0: quality = 5;
break;
288 case 1: quality = 2;
break;
289 case 2: quality = 3;
break;
290 case 3: quality = 4;
break;
304 ( (MMconfig & 32) == 32 ) ||
305 ( ( (MMconfig & 8) == 8 ) && by_rank ) ||
306 ( ( (MMconfig & 4) == 4 ) && by_pt ) ||
307 ( ( (MMconfig & 2) == 2 ) && by_combi);
312 return (MMconfig & 1) == 1;
316 return (MMconfig & 64) == 64;
340 if (newphi < 0) newphi += 144;
341 if (newphi >= 144) newphi -= 144;
343 return (
unsigned) newphi;
371 int selected_by_rank =
abs(merge_rank_dtcsc) >=
abs(merge_rank_rpc);
372 int selected_by_pt =
dtcsc_mu[idx_dtcsc]->pt_packed() <=
rpc_mu[idx_rpc]->pt_packed();
377 int selected_by_combi = (merge_rank_dtcsc<0 && merge_rank_rpc<0) ? selected_by_rank : selected_by_pt;
391 if (
selectDTCSC(MMConfig_phi, selected_by_rank, selected_by_pt, selected_by_combi) )
404 if ( (
m_id == 1) ||
dtcsc_mu[idx_dtcsc]->finehalo_packed() )
410 if (
selectDTCSC(MMConfig_eta, selected_by_rank, selected_by_pt, selected_by_combi) )
425 rpc_mu[idx_rpc]->pt_packed());
428 if (
selectDTCSC(MMConfig_pt, selected_by_rank, selected_by_pt, selected_by_combi) )
429 pt =
dtcsc_mu[idx_dtcsc]->pt_packed();
431 pt =
rpc_mu[idx_rpc]->pt_packed();
438 unsigned sy_sign = 0;
442 if (
rpc_mu[idx_rpc]->charge_valid_packed()==1 &&
dtcsc_mu[idx_dtcsc]->charge_valid_packed()==0 )
448 if (
selectDTCSC(MMConfig_charge, selected_by_rank, selected_by_pt, selected_by_combi) )
461 bool mip_bit =
false;
468 mip_bit = mip_bit_dtcsc && mip_bit_rpc;
470 mip_bit = mip_bit_dtcsc || mip_bit_rpc;
473 if (
selectDTCSC(MMConfig_MIP, selected_by_rank, selected_by_pt, selected_by_combi) )
474 mip_bit = mip_bit_dtcsc;
476 mip_bit = mip_bit_rpc;
484 bool iso_bit =
false;
491 iso_bit = iso_bit_dtcsc && iso_bit_rpc;
493 iso_bit = iso_bit_dtcsc || iso_bit_rpc;
496 if (
selectDTCSC(MMConfig_ISO, selected_by_rank, selected_by_pt, selected_by_combi) )
497 iso_bit = iso_bit_dtcsc;
499 iso_bit = iso_bit_rpc;
510 if (
selectDTCSC(MMConfig_SRK, selected_by_rank, selected_by_pt, selected_by_combi) )
532 if ( muon == 0 || muon->
empty() )
return 0;
559 int rank_signed = rank;
561 if (flag == 1) rank_signed *= -1;
unsigned charge_valid_packed() const
return charge valid packed as in hardware (1=valid, 0=not valid)
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
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)
virtual int idxFromPacked(unsigned packed) const
get the value from the packed notation (+/-)
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 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