CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1MuGMTCancelOutUnit Class Reference

#include <L1MuGMTCancelOutUnit.h>

Public Member Functions

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 More...
 
const bool cancelOtherChipMuon (int idx) const
 return cancel bit for barrel RPC (m_id==2) or forward RPC (m_id==3) muon More...
 
int id () const
 return ID (0..DT/CSC in barrel chip, 1..DT/CSC in fwd chip, 2..CSC/bRPC, 3..DT/fRPC) More...
 
 L1MuGMTCancelOutUnit (const L1MuGlobalMuonTrigger &gmt, int id)
 constructor More...
 
void print ()
 print cancel-out bits More...
 
void reset ()
 clear cancel-out unit More...
 
void run ()
 run cancel-out unit More...
 
virtual ~L1MuGMTCancelOutUnit ()
 destructor More...
 

Private Member Functions

void decide ()
 

Private Attributes

const L1MuGlobalMuonTriggerm_gmt
 
int m_id
 
L1MuGMTMatcher m_matcher
 
std::vector< bool > m_MyChipCancelbits
 
std::vector< bool > m_OtherChipCancelbits
 

Detailed Description

L1 Global Muon Trigger Cancel-Out Unit.

It compares (attempts to match) muons in the overlap region in order to cancel out duplicates. The following four instances exist:

                  INPUTS

idx unit where mu1 mu2

0 DT/CSC brl DT CSC 1 CSC/DT fwd CSC DT 2 bRPC/CSC brl bRPC CSC 3 fRPC/DT fwd fRPC DT (mine) (other chip)

The first input muons are direct inputs to the chip where the COU is located, while the second muons are CSC or DT muon from the other Logic FPGA.

Along with the input muons to be compared the COU accesses information on whether the input muons are matched with a cnadiate from the complementary system in the respective main matcher.

The output are cancel-bits which indicate whether to delete one of the inputs.

Definition at line 66 of file L1MuGMTCancelOutUnit.h.

Constructor & Destructor Documentation

L1MuGMTCancelOutUnit::L1MuGMTCancelOutUnit ( const L1MuGlobalMuonTrigger gmt,
int  id 
)

constructor

Definition at line 51 of file L1MuGMTCancelOutUnit.cc.

52  : m_gmt(gmt), m_id(id), m_matcher(gmt, id + 2), m_MyChipCancelbits(4), m_OtherChipCancelbits(4) {}
const L1MuGlobalMuonTrigger & m_gmt
std::vector< bool > m_MyChipCancelbits
std::vector< bool > m_OtherChipCancelbits
L1MuGMTCancelOutUnit::~L1MuGMTCancelOutUnit ( )
virtual

destructor

Definition at line 57 of file L1MuGMTCancelOutUnit.cc.

References reset().

57 { reset(); }
void reset()
clear cancel-out unit

Member Function Documentation

const bool L1MuGMTCancelOutUnit::cancelMyChipMuon ( int  idx) const
inline

return cancel bit for DT (m_id==0 || m_id==3) or CSC (m_id==1 || m_id==2) muon

Definition at line 87 of file L1MuGMTCancelOutUnit.h.

References training_settings::idx, and m_MyChipCancelbits.

Referenced by L1MuGMTMerger::merge().

const bool L1MuGMTCancelOutUnit::cancelOtherChipMuon ( int  idx) const
inline

return cancel bit for barrel RPC (m_id==2) or forward RPC (m_id==3) muon

Definition at line 90 of file L1MuGMTCancelOutUnit.h.

References decide(), training_settings::idx, and m_OtherChipCancelbits.

Referenced by L1MuGMTMerger::merge().

void L1MuGMTCancelOutUnit::decide ( )
private

Definition at line 124 of file L1MuGMTCancelOutUnit.cc.

References generateTowerEtThresholdLUT::addr, L1MuGMTMatrix< T >::colAny(), L1MuGlobalMuonTrigger::DebugBlockForFill(), L1MuGMTConfig::getRegCDLConfig(), L1MuGMTReg::getValue(), m_gmt, m_id, m_matcher, m_MyChipCancelbits, m_OtherChipCancelbits, L1MuGlobalMuonTrigger::Matcher(), L1MuGMTMatcher::pairM(), L1MuGMTMatrix< T >::rowAny(), and L1MuGMTDebugBlock::SetCancelBits().

Referenced by cancelOtherChipMuon(), and run().

124  {
125  // CancelDecisionLogic configuration register
126  //
127  unsigned CDL_config = L1MuGMTConfig::getRegCDLConfig()->getValue(m_id);
128 
129  // compute cancel decsion for my chip muons (mine)
130 
131  for (int imine = 0; imine < 4; imine++) {
132  int idxother = m_matcher.pairM().rowAny(imine);
133  if (idxother != -1) {
134  int mine_is_matched = 0;
135  switch (m_id) {
136  case 0:
137  mine_is_matched = m_gmt.Matcher(0)->pairM().rowAny(imine) != -1;
138  break; //DT
139  case 1:
140  mine_is_matched = m_gmt.Matcher(1)->pairM().rowAny(imine) != -1;
141  break; //CSC
142  case 2:
143  mine_is_matched = m_gmt.Matcher(0)->pairM().colAny(imine) != -1;
144  break; //bRPC
145  case 3:
146  mine_is_matched = m_gmt.Matcher(1)->pairM().colAny(imine) != -1;
147  break; //fRPC
148  }
149  int other_is_matched = m_gmt.Matcher(1 - (m_id % 2))->pairM().rowAny(idxother) != -1;
150 
151  // calculate address of bit in CDL_config register
152  unsigned addr = (unsigned)(2 * mine_is_matched + other_is_matched);
153  unsigned mask = (unsigned)1 << addr;
154 
155  m_MyChipCancelbits[imine] = (CDL_config & mask) == mask;
156  }
157  }
158 
159  // compute cancel decsison for other chip muons (other)
160 
161  for (int iother = 0; iother < 4; iother++) {
162  int idxmine = m_matcher.pairM().colAny(iother);
163  if (idxmine != -1) {
164  int mine_is_matched = 0;
165  switch (m_id) {
166  case 0:
167  mine_is_matched = m_gmt.Matcher(0)->pairM().rowAny(idxmine) != -1;
168  break; //DT
169  case 1:
170  mine_is_matched = m_gmt.Matcher(1)->pairM().rowAny(idxmine) != -1;
171  break; //CSC
172  case 2:
173  mine_is_matched = m_gmt.Matcher(0)->pairM().colAny(idxmine) != -1;
174  break; //bRPC
175  case 3:
176  mine_is_matched = m_gmt.Matcher(1)->pairM().colAny(idxmine) != -1;
177  break; //fRPC
178  }
179  int other_is_matched = m_gmt.Matcher(1 - (m_id % 2))->pairM().rowAny(iother) != -1;
180 
181  // calculate address of bit in CDL_config register
182  unsigned addr = (unsigned)(2 * other_is_matched + mine_is_matched);
183  unsigned mask = (unsigned)1 << (addr + 4);
184 
185  m_OtherChipCancelbits[iother] = (CDL_config & mask) == mask;
186  }
187  }
188 
190 }
const L1MuGMTMatcher * Matcher(int id) const
return pointer to Matcher
unsigned getValue(int idx)
get Value
Definition: L1MuGMTReg.h:53
const L1MuGlobalMuonTrigger & m_gmt
int rowAny(int r) const
is any element in row r > 0 ? return index or -1
std::vector< bool > m_MyChipCancelbits
void SetCancelBits(int idx, const std::vector< bool > &mine, const std::vector< bool > &others)
Set cancel bits.
const L1MuGMTMatrix< bool > & pairM() const
return pair matrix
std::vector< bool > m_OtherChipCancelbits
static L1MuGMTRegCDLConfig * getRegCDLConfig()
int colAny(int c) const
is any element in column c > 0 ? return index or -1
L1MuGMTDebugBlock * DebugBlockForFill() const
for debug: return the debug block (in order to fill it)
int L1MuGMTCancelOutUnit::id ( void  ) const
inline

return ID (0..DT/CSC in barrel chip, 1..DT/CSC in fwd chip, 2..CSC/bRPC, 3..DT/fRPC)

Definition at line 84 of file L1MuGMTCancelOutUnit.h.

References m_id.

84 { return m_id; }
void L1MuGMTCancelOutUnit::print ( void  )

print cancel-out bits

Definition at line 90 of file L1MuGMTCancelOutUnit.cc.

References mps_fire::i, m_id, m_MyChipCancelbits, and m_OtherChipCancelbits.

Referenced by L1MuGlobalMuonTrigger::produce().

90  {
91  std::stringstream outmy;
92  switch (m_id) {
93  case 0:
94  outmy << "DT ";
95  break;
96  case 1:
97  outmy << "CSC ";
98  break;
99  case 2:
100  outmy << "bRPC";
101  break;
102  case 3:
103  outmy << "fRPC";
104  break;
105  }
106  outmy << "(my chip) cancel-bits : ";
107  for (int i = 0; i < 4; i++)
108  outmy << m_MyChipCancelbits[i] << " ";
109  edm::LogVerbatim("GMT_CancelOut_info") << outmy.str();
110 
111  std::stringstream outother;
112  if (m_id == 2 || m_id == 3) {
113  outother << (m_id == 2 ? "CSC" : "DT") << "(other chip) cancel-bits : ";
114  for (int i = 0; i < 4; i++)
115  outother << m_OtherChipCancelbits[i] << " ";
116  outother << std::endl;
117  }
118  edm::LogVerbatim("GMT_CancelOut_info") << outother.str();
119 }
std::vector< bool > m_MyChipCancelbits
std::vector< bool > m_OtherChipCancelbits
void L1MuGMTCancelOutUnit::reset ( void  )

clear cancel-out unit

Definition at line 78 of file L1MuGMTCancelOutUnit.cc.

References mps_fire::i, m_matcher, m_MyChipCancelbits, m_OtherChipCancelbits, and L1MuGMTMatcher::reset().

Referenced by L1MuGlobalMuonTrigger::reset(), and ~L1MuGMTCancelOutUnit().

78  {
79  m_matcher.reset();
80 
81  for (int i = 0; i < 4; i++) {
82  m_MyChipCancelbits[i] = false;
83  m_OtherChipCancelbits[i] = false;
84  }
85 }
std::vector< bool > m_MyChipCancelbits
void reset()
clear Matcher
std::vector< bool > m_OtherChipCancelbits
void L1MuGMTCancelOutUnit::run ( )

run cancel-out unit

Definition at line 66 of file L1MuGMTCancelOutUnit.cc.

References L1MuGMTConfig::Debug(), decide(), m_matcher, L1MuGMTMatcher::print(), and L1MuGMTMatcher::run().

Referenced by L1MuGlobalMuonTrigger::produce().

66  {
67  m_matcher.run();
68  if (L1MuGMTConfig::Debug(3)) {
69  edm::LogVerbatim("GMT_CancelOut_info") << "result of cancel-out matcher: ";
70  m_matcher.print();
71  }
72  decide();
73 }
void run()
run Matcher
void print()
print matching results
static bool Debug()

Member Data Documentation

const L1MuGlobalMuonTrigger& L1MuGMTCancelOutUnit::m_gmt
private

Definition at line 96 of file L1MuGMTCancelOutUnit.h.

Referenced by decide().

int L1MuGMTCancelOutUnit::m_id
private

Definition at line 97 of file L1MuGMTCancelOutUnit.h.

Referenced by decide(), id(), and print().

L1MuGMTMatcher L1MuGMTCancelOutUnit::m_matcher
private

Definition at line 99 of file L1MuGMTCancelOutUnit.h.

Referenced by decide(), reset(), and run().

std::vector<bool> L1MuGMTCancelOutUnit::m_MyChipCancelbits
private

Definition at line 100 of file L1MuGMTCancelOutUnit.h.

Referenced by cancelMyChipMuon(), decide(), print(), and reset().

std::vector<bool> L1MuGMTCancelOutUnit::m_OtherChipCancelbits
private

Definition at line 101 of file L1MuGMTCancelOutUnit.h.

Referenced by cancelOtherChipMuon(), decide(), print(), and reset().