CMS 3D CMS Logo

L1MuGMTCancelOutUnit Class Reference

L1 Global Muon Trigger Cancel-Out Unit. More...

#include <L1Trigger/GlobalMuonTrigger/src/L1MuGMTCancelOutUnit.h>

List of all members.

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

Private Member Functions

void decide ()

Private Attributes

const L1MuGlobalMuonTriggerm_gmt
int m_id
L1MuGMTMatcher m_matcher
std::vector< boolm_MyChipCancelbits
std::vector< boolm_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 69 of file L1MuGMTCancelOutUnit.h.


Constructor & Destructor Documentation

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

constructor

Definition at line 53 of file L1MuGMTCancelOutUnit.cc.

00053                                                                                    : 
00054                m_gmt(gmt), m_id(id), m_matcher(gmt, id+2), m_MyChipCancelbits(4), m_OtherChipCancelbits(4) {
00055 
00056 }

L1MuGMTCancelOutUnit::~L1MuGMTCancelOutUnit (  )  [virtual]

destructor

Definition at line 61 of file L1MuGMTCancelOutUnit.cc.

References reset().

00061                                             { 
00062 
00063   reset();
00064   
00065 }


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 91 of file L1MuGMTCancelOutUnit.h.

References m_MyChipCancelbits.

Referenced by L1MuGMTMerger::merge().

00091 { return m_MyChipCancelbits[idx]; }

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 94 of file L1MuGMTCancelOutUnit.h.

References m_OtherChipCancelbits.

Referenced by L1MuGMTMerger::merge().

00094 { return m_OtherChipCancelbits[idx]; }

void L1MuGMTCancelOutUnit::decide (  )  [private]

Definition at line 128 of file L1MuGMTCancelOutUnit.cc.

References addr, L1MuGlobalMuonTrigger::DebugBlockForFill(), L1MuGMTConfig::getRegCDLConfig(), L1MuGMTReg::getValue(), m_gmt, m_id, m_matcher, m_MyChipCancelbits, m_OtherChipCancelbits, L1MuGlobalMuonTrigger::Matcher(), L1MuGMTMatcher::pairM(), and L1MuGMTDebugBlock::SetCancelBits().

Referenced by run().

00128                                   {
00129 
00130   // CancelDecisionLogic configuration register
00131   //
00132   unsigned CDL_config = L1MuGMTConfig::getRegCDLConfig()->getValue(m_id);
00133 
00134   // compute cancel decsion for my chip muons (mine)
00135 
00136   for(int imine=0; imine<4; imine++) {
00137     int idxother = m_matcher.pairM().rowAny(imine);
00138     if (idxother != -1) {
00139       int mine_is_matched = 0;
00140       switch(m_id) {
00141       case 0: mine_is_matched = m_gmt.Matcher(0)->pairM().rowAny(imine) != -1; break; //DT
00142       case 1: mine_is_matched = m_gmt.Matcher(1)->pairM().rowAny(imine) != -1; break; //CSC
00143       case 2: mine_is_matched = m_gmt.Matcher(0)->pairM().colAny(imine) != -1; break; //bRPC
00144       case 3: mine_is_matched = m_gmt.Matcher(1)->pairM().colAny(imine) != -1; break; //fRPC
00145       }
00146       int other_is_matched = m_gmt.Matcher( 1-(m_id%2) )->pairM().rowAny(idxother) != -1;
00147 
00148       // calculate address of bit in CDL_config register
00149       unsigned addr = (unsigned) (2*mine_is_matched + other_is_matched);
00150       unsigned mask = (unsigned) 1 << addr;
00151       
00152       m_MyChipCancelbits[imine] = (CDL_config & mask) == mask;
00153     }
00154   }
00155 
00156   // compute cancel decsison for other chip muons (other)
00157 
00158   for(int iother=0; iother<4; iother++) {
00159     int idxmine = m_matcher.pairM().colAny(iother);
00160     if (idxmine != -1) {
00161       int mine_is_matched = 0;
00162       switch(m_id) {
00163       case 0: mine_is_matched = m_gmt.Matcher(0)->pairM().rowAny(idxmine) != -1; break; //DT
00164       case 1: mine_is_matched = m_gmt.Matcher(1)->pairM().rowAny(idxmine) != -1; break; //CSC
00165       case 2: mine_is_matched = m_gmt.Matcher(0)->pairM().colAny(idxmine) != -1; break; //bRPC
00166       case 3: mine_is_matched = m_gmt.Matcher(1)->pairM().colAny(idxmine) != -1; break; //fRPC
00167       }
00168       int other_is_matched = m_gmt.Matcher( 1-(m_id%2) )->pairM().rowAny(iother) != -1;
00169 
00170       // calculate address of bit in CDL_config register
00171       unsigned addr = (unsigned) (2*other_is_matched + mine_is_matched);
00172       unsigned mask = (unsigned)1 << (addr+4);
00173       
00174       m_OtherChipCancelbits[iother] = (CDL_config & mask) == mask;
00175     }
00176   }
00177 
00178   m_gmt.DebugBlockForFill()->SetCancelBits( m_id, m_MyChipCancelbits, m_OtherChipCancelbits) ; 
00179 }

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 88 of file L1MuGMTCancelOutUnit.h.

References m_id.

00088 { return m_id; } 

void L1MuGMTCancelOutUnit::print ( void   ) 

print cancel-out bits

Definition at line 101 of file L1MuGMTCancelOutUnit.cc.

References lat::endl(), i, m_id, m_MyChipCancelbits, and m_OtherChipCancelbits.

Referenced by L1MuGlobalMuonTrigger::produce().

00101                                  {
00102 
00103   std::stringstream outmy;
00104   switch (m_id) {
00105     case 0 : outmy << "DT  " ; break;
00106     case 1 : outmy << "CSC " ; break;
00107     case 2 : outmy << "bRPC" ; break;
00108     case 3 : outmy << "fRPC" ; break;
00109   }
00110   outmy << "(my chip) cancel-bits : " ;
00111   for ( int i = 0; i < 4; i++ ) outmy << m_MyChipCancelbits[i] << "  ";
00112   edm::LogVerbatim("GMT_CancelOut_info") << outmy.str();
00113 
00114   std::stringstream outother;
00115   if (m_id==2 || m_id==3) {
00116     outother << (m_id==2 ? "CSC" : "DT" ) <<  "(other chip) cancel-bits : " ;
00117     for ( int i = 0; i < 4; i++ ) outother << m_OtherChipCancelbits[i] << "  ";
00118     outother << std::endl;
00119   }
00120   edm::LogVerbatim("GMT_CancelOut_info") << outother.str();
00121 }

void L1MuGMTCancelOutUnit::reset ( void   ) 

clear cancel-out unit

Definition at line 87 of file L1MuGMTCancelOutUnit.cc.

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

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

00087                                  {
00088 
00089   m_matcher.reset();
00090   
00091   for ( int i = 0; i < 4; i++ ) {
00092     m_MyChipCancelbits[i] = false;
00093     m_OtherChipCancelbits[i] = false;
00094   }  
00095 }

void L1MuGMTCancelOutUnit::run ( void   ) 

run cancel-out unit

Definition at line 74 of file L1MuGMTCancelOutUnit.cc.

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

Referenced by L1MuGlobalMuonTrigger::produce().

00074                                {
00075 
00076   m_matcher.run();
00077   if (L1MuGMTConfig::Debug(3)) {
00078     edm::LogVerbatim("GMT_CancelOut_info") << "result of cancel-out matcher: ";
00079     m_matcher.print();
00080   }
00081   decide(); 
00082 }


Member Data Documentation

const L1MuGlobalMuonTrigger& L1MuGMTCancelOutUnit::m_gmt [private]

Definition at line 101 of file L1MuGMTCancelOutUnit.h.

Referenced by decide().

int L1MuGMTCancelOutUnit::m_id [private]

Definition at line 102 of file L1MuGMTCancelOutUnit.h.

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

L1MuGMTMatcher L1MuGMTCancelOutUnit::m_matcher [private]

Definition at line 104 of file L1MuGMTCancelOutUnit.h.

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

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

Definition at line 105 of file L1MuGMTCancelOutUnit.h.

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

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

Definition at line 106 of file L1MuGMTCancelOutUnit.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:26:50 2009 for CMSSW by  doxygen 1.5.4