CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

L1MuGMTPSB Class Reference

#include <L1MuGMTPSB.h>

List of all members.

Public Member Functions

const L1MuRegionalCandCSCMuon (int index) const
 get CSC muon
const L1MuRegionalCandDTBXMuon (int index) const
 get DTBX muon
bool empty () const
 are there any data in the PSB
const L1MuGMTMatrix< bool > & isolBits () const
 return isolation bits
 L1MuGMTPSB (const L1MuGlobalMuonTrigger &gmt)
 constructor
const L1MuGMTMatrix< bool > & mipBits () const
 return minimum ionizing bits
int numberCSC () const
 return number of non-empty CSC muons
int numberDTBX () const
 return number of non-empty DTBX muons
int numberRPC () const
 return number of non-empty RPC muons
void print () const
 print PSB
void receiveData (edm::Event &e, int bx)
 receive muon candidates
void reset ()
 clear PSB
const L1MuRegionalCandRPCMuon (int index) const
 get RPC muon
virtual ~L1MuGMTPSB ()
 destructor

Private Member Functions

void getCalo (edm::Event &e)
 get Calorimeter Trigger data
void getCSC (std::vector< L1MuRegionalCand > const *data, int bx)
 get muons from endcap Muon Trigger Track Finder
void getDTBX (std::vector< L1MuRegionalCand > const *data, int bx)
 get muons from barrel Muon Trigger Track Finder
void getRPCb (std::vector< L1MuRegionalCand > const *data, int bx)
 get muons from RPCb Trigger
void getRPCf (std::vector< L1MuRegionalCand > const *data, int bx)
 get muons from RPCf Trigger
void printCSC () const
 print CSC muons
void printDTBX () const
 print DTBX muons
void printRPCbarrel () const
 print barrel RPC muons
void printRPCendcap () const
 print endcap RPC muons

Private Attributes

std::vector< L1MuRegionalCandm_CscMuons
std::vector< L1MuRegionalCandm_DtbxMuons
const L1MuGlobalMuonTriggerm_gmt
L1MuGMTMatrix< bool > m_Isol
L1MuGMTMatrix< bool > m_Mip
std::vector< L1MuRegionalCandm_RpcMuons

Detailed Description

L1 Global Muon Trigger Pipelined Synchronising Buffer module.

the PSB receives muon candidates from the barrel track finder, the endcap track finder and from the RPC trigger. In addition it gets isolation and mip bits from the regional Calorimeter Trigger

Definition at line 50 of file L1MuGMTPSB.h.


Constructor & Destructor Documentation

L1MuGMTPSB::L1MuGMTPSB ( const L1MuGlobalMuonTrigger gmt)
L1MuGMTPSB::~L1MuGMTPSB ( ) [virtual]

destructor

Definition at line 72 of file L1MuGMTPSB.cc.

References m_CscMuons, m_DtbxMuons, m_RpcMuons, and reset().

                        { 

  reset();
  m_RpcMuons.clear();
  m_DtbxMuons.clear();
  m_CscMuons.clear();
  
}

Member Function Documentation

const L1MuRegionalCand * L1MuGMTPSB::CSCMuon ( int  index) const

get CSC muon

Definition at line 252 of file L1MuGMTPSB.cc.

References getHLTprescales::index, m_CscMuons, and L1MuGMTConfig::MAXCSC.

Referenced by L1MuGMTMipIsoAU::load(), L1MuGMTMatcher::load(), and L1MuGMTMerger::load().

                                                           {
 
  return ( index < (int)L1MuGMTConfig::MAXCSC && index >= 0 ) ? &(m_CscMuons[index]) : 0;
  
}
const L1MuRegionalCand * L1MuGMTPSB::DTBXMuon ( int  index) const

get DTBX muon

Definition at line 242 of file L1MuGMTPSB.cc.

References getHLTprescales::index, m_DtbxMuons, and L1MuGMTConfig::MAXDTBX.

Referenced by L1MuGMTMipIsoAU::load(), L1MuGMTMatcher::load(), and L1MuGMTMerger::load().

                                                            {
      
  return ( index < (int)L1MuGMTConfig::MAXDTBX && index >= 0 ) ? &(m_DtbxMuons[index]) : 0;
  
}
bool L1MuGMTPSB::empty ( void  ) const

are there any data in the PSB

Definition at line 309 of file L1MuGMTPSB.cc.

References numberCSC(), numberDTBX(), and numberRPC().

Referenced by printCSC(), printDTBX(), printRPCbarrel(), printRPCendcap(), L1MuGlobalMuonTrigger::produce(), and receiveData().

                             {

  int number = numberRPC() + numberDTBX() + numberCSC();

  return ( number == 0 );

}
void L1MuGMTPSB::getCalo ( edm::Event e) [private]

get Calorimeter Trigger data

Definition at line 454 of file L1MuGMTPSB.cc.

References L1MuGlobalMuonTrigger::currentReadoutRecord(), L1MuGMTConfig::Debug(), edm::Event::getByLabel(), L1MuGMTConfig::getMipIsoInputTag(), edm::HandleBase::isValid(), m_gmt, m_Isol, m_Mip, edm::Handle< T >::product(), L1MuGMTMatrix< T >::set(), L1MuGMTReadoutRecord::setMIPbit(), and L1MuGMTReadoutRecord::setQuietbit().

Referenced by receiveData().

                                    {
  
  edm::Handle<L1CaloRegionCollection> calocoll_h;
  e.getByLabel(L1MuGMTConfig::getMipIsoInputTag(),calocoll_h);
  if(calocoll_h.isValid())
  {
    L1CaloRegionCollection const* regions = calocoll_h.product();
    L1CaloRegionCollection::const_iterator iter;

    //  edm::LogVerbatim("GMT_PSB_info") << "MIP/QUIET bits rceived by the GMT :";

    for ( iter = regions->begin(); iter != regions->end(); iter++ ) {
      if ( (*iter).id().ieta() < 4 || (*iter).id().ieta() > 17 || (*iter).id().iphi() > 17 ) continue;
      m_Isol.set( (*iter).id().ieta()-4, (*iter).id().iphi(), (*iter).quiet() );
      m_Mip.set( (*iter).id().ieta()-4, (*iter).id().iphi(), (*iter).mip() );

      if ( (*iter).quiet() )
        m_gmt.currentReadoutRecord()->setQuietbit ((*iter).id().ieta()-4, (*iter).id().iphi());

      if ( (*iter).mip() )
        m_gmt.currentReadoutRecord()->setMIPbit ((*iter).id().ieta()-4, (*iter).id().iphi());

      //    edm::LogVerbatim("GMT_PSB_info") << (*iter).id().ieta()-4 << " "
      //                                     << (*iter).id().iphi() << " "
      //                                     << (*iter).quiet() << " "
      //                                     << (*iter).mip();
    }
  } else {
    if( L1MuGMTConfig::Debug(1) ) {
      edm::LogWarning("GlobalMuonTrigger")
      << "\nWarning: GlobalMuonTrigger: input tag " << L1MuGMTConfig::getMipIsoInputTag()
      << "\nrequested, but not found in the event." << std::endl;
    }
  }

}
void L1MuGMTPSB::getCSC ( std::vector< L1MuRegionalCand > const *  data,
int  bx 
) [private]

get muons from endcap Muon Trigger Track Finder

Definition at line 380 of file L1MuGMTPSB.cc.

References m_CscMuons, and MAXCSC.

Referenced by receiveData().

                                                                       {

  int icsc = 0;
  std::vector<L1MuRegionalCand>::const_iterator iter;
  for ( iter = data->begin(); iter != data->end(); iter++ ) {
    if ( (*iter).bx() != bx ) continue;
    if ( icsc < (int)L1MuGMTConfig::MAXCSC ) { 
      m_CscMuons[icsc] = (*iter);
      icsc++;
    }
  }

}
void L1MuGMTPSB::getDTBX ( std::vector< L1MuRegionalCand > const *  data,
int  bx 
) [private]

get muons from barrel Muon Trigger Track Finder

Definition at line 357 of file L1MuGMTPSB.cc.

References L1MuGMTConfig::Debug(), m_DtbxMuons, and MAXDTBX.

Referenced by receiveData().

                                                                        {

  // temporary hack with bxoffset - to be removed, trigger bx should be 0
  int bxoffset = 0;
  int idtbx = 0;
  std::vector<L1MuRegionalCand>::const_iterator iter;
  for ( iter = data->begin(); iter != data->end(); iter++ ) {
    if ( L1MuGMTConfig::Debug(2) ) edm::LogVerbatim("") << "DTTF BX: " << (*iter).bx() << " my bx: " << bx;
    if ( (*iter).bx() > 10) bxoffset=16;
    if ( (*iter).bx() != bx+bxoffset ) continue;
    if ( idtbx < (int)L1MuGMTConfig::MAXDTBX ) { 
      m_DtbxMuons[idtbx] = (*iter);
      m_DtbxMuons[idtbx].setBx(bx);
      idtbx++;
    }  
  }

}
void L1MuGMTPSB::getRPCb ( std::vector< L1MuRegionalCand > const *  data,
int  bx 
) [private]

get muons from RPCb Trigger

Definition at line 321 of file L1MuGMTPSB.cc.

References m_RpcMuons, and L1MuGMTConfig::MAXRPCbarrel.

Referenced by receiveData().

                                                                        {

  int irpcb = 0;
  std::vector<L1MuRegionalCand>::const_iterator iter;
  for ( iter = data->begin(); iter != data->end(); iter++ ) {
    if ( (*iter).bx() != bx ) continue;
    if ( irpcb < (int)L1MuGMTConfig::MAXRPCbarrel ) { 
      if(!(*iter).empty()) m_RpcMuons[irpcb] = (*iter);
      irpcb++;
    }  
  }
  
}
void L1MuGMTPSB::getRPCf ( std::vector< L1MuRegionalCand > const *  data,
int  bx 
) [private]

get muons from RPCf Trigger

Definition at line 339 of file L1MuGMTPSB.cc.

References m_RpcMuons, and L1MuGMTConfig::MAXRPCendcap.

Referenced by receiveData().

                                                                        {

  int irpcf = 0;
  std::vector<L1MuRegionalCand>::const_iterator iter;
  for ( iter = data->begin(); iter != data->end(); iter++ ) {
    if ( (*iter).bx() != bx ) continue;
    if ( irpcf < (int)L1MuGMTConfig::MAXRPCendcap ) { 
      if(!(*iter).empty()) m_RpcMuons[irpcf+4] = (*iter);
      irpcf++;
    }  
  }
  
}
const L1MuGMTMatrix<bool>& L1MuGMTPSB::isolBits ( ) const [inline]

return isolation bits

Definition at line 91 of file L1MuGMTPSB.h.

References m_Isol.

Referenced by L1MuGMTMipIsoAU::assignISO().

{ return m_Isol; }
const L1MuGMTMatrix<bool>& L1MuGMTPSB::mipBits ( ) const [inline]

return minimum ionizing bits

Definition at line 94 of file L1MuGMTPSB.h.

References m_Mip.

Referenced by L1MuGMTMipIsoAU::assignMIP().

{ return m_Mip; }
int L1MuGMTPSB::numberCSC ( ) const

return number of non-empty CSC muons

Definition at line 293 of file L1MuGMTPSB.cc.

References prof2calltree::count, and m_CscMuons.

Referenced by empty().

                                {

  int count = 0;
  std::vector<L1MuRegionalCand>::const_iterator iter = m_CscMuons.begin();
  while ( iter != m_CscMuons.end() ) {
    if ( !(*iter).empty() ) count++;
    iter++;
  }
  return count;

}
int L1MuGMTPSB::numberDTBX ( ) const

return number of non-empty DTBX muons

Definition at line 277 of file L1MuGMTPSB.cc.

References prof2calltree::count, and m_DtbxMuons.

Referenced by empty().

                                 {

  int count = 0;
  std::vector<L1MuRegionalCand>::const_iterator iter = m_DtbxMuons.begin();
  while ( iter != m_DtbxMuons.end() ) {
    if ( !(*iter).empty() ) count++;
    iter++;
  }
  return count;

}
int L1MuGMTPSB::numberRPC ( ) const

return number of non-empty RPC muons

Definition at line 261 of file L1MuGMTPSB.cc.

References prof2calltree::count, and m_RpcMuons.

Referenced by empty().

                                {

  int count = 0;
  std::vector<L1MuRegionalCand>::const_iterator iter = m_RpcMuons.begin();
  while ( iter != m_RpcMuons.end() ) {
    if ( !(*iter).empty() ) count++;
    iter++;
  }
  return count;

}
void L1MuGMTPSB::print ( void  ) const

print PSB

Definition at line 217 of file L1MuGMTPSB.cc.

References printCSC(), printDTBX(), printRPCbarrel(), and printRPCendcap().

Referenced by L1MuGlobalMuonTrigger::produce().

                             {

  edm::LogVerbatim("GMT_PSB_info") << " ";
  printDTBX();
  printRPCbarrel();
  printCSC();
  printRPCendcap();
  edm::LogVerbatim("GMT_PSB_info") << " ";
  
}
void L1MuGMTPSB::printCSC ( ) const [private]

print CSC muons

Definition at line 440 of file L1MuGMTPSB.cc.

References empty(), i, m_CscMuons, and MAXCSC.

Referenced by print().

                                {

  edm::LogVerbatim("GMT_PSB_info") << "CSC  muons received by the GMT :";

  for ( unsigned i = 0; i < L1MuGMTConfig::MAXCSC; i++ ) {
    if (!m_CscMuons[i].empty()) m_CscMuons[i].print();
  }

}
void L1MuGMTPSB::printDTBX ( ) const [private]

print DTBX muons

Definition at line 426 of file L1MuGMTPSB.cc.

References empty(), i, m_DtbxMuons, and MAXDTBX.

Referenced by print().

                                 {

  edm::LogVerbatim("GMT_PSB_info") << "DTBX muons received by the GMT :";

  for ( unsigned i = 0; i < L1MuGMTConfig::MAXDTBX; i++ ) {
    if (!m_DtbxMuons[i].empty()) m_DtbxMuons[i].print();
  }
  
}
void L1MuGMTPSB::printRPCbarrel ( ) const [private]

print barrel RPC muons

Definition at line 398 of file L1MuGMTPSB.cc.

References empty(), i, m_RpcMuons, and L1MuGMTConfig::MAXRPCbarrel.

Referenced by print().

                                      {

  edm::LogVerbatim("GMT_PSB_info") << "RPC barrel  muons received by the GMT :";

  for ( unsigned i = 0; i < L1MuGMTConfig::MAXRPCbarrel; i++ ) {
    if (!m_RpcMuons[i].empty()) m_RpcMuons[i].print();
  }
  
}
void L1MuGMTPSB::printRPCendcap ( ) const [private]

print endcap RPC muons

Definition at line 412 of file L1MuGMTPSB.cc.

References empty(), i, m_RpcMuons, and L1MuGMTConfig::MAXRPCendcap.

Referenced by print().

                                      {

  edm::LogVerbatim("GMT_PSB_info") << "RPC endcap  muons received by the GMT :";

  for ( unsigned i = 0; i < L1MuGMTConfig::MAXRPCendcap; i++ ) {
    if (!m_RpcMuons[i+4].empty()) m_RpcMuons[i+4].print();
  }

}
void L1MuGMTPSB::receiveData ( edm::Event e,
int  bx 
)

receive muon candidates

Definition at line 88 of file L1MuGMTPSB.cc.

References L1MuGlobalMuonTrigger::currentReadoutRecord(), L1MuGMTConfig::Debug(), empty(), L1MuRegionalCand::eta_packed(), edm::Event::getByLabel(), getCalo(), L1MuGMTConfig::getCaloTrigger(), getCSC(), L1MuGMTConfig::getCSCInputTag(), getDTBX(), L1MuGMTConfig::getDTInputTag(), L1MuGMTConfig::getGMTChanMask(), L1MuScale::getLowEdge(), L1MuTriggerScales::getPhiScale(), L1MuTriggerPtScale::getPtScale(), L1MuTriggerScales::getRegionalEtaScale(), getRPCb(), L1MuGMTConfig::getRPCbInputTag(), getRPCf(), L1MuGMTConfig::getRPCfInputTag(), L1MuGMTChannelMask::getSubsystemMask(), L1MuGMTConfig::getTriggerPtScale(), L1MuGMTConfig::getTriggerScales(), i, edm::HandleBase::isValid(), diffTwoXMLs::label, m_CscMuons, m_DtbxMuons, m_gmt, m_RpcMuons, L1MuRegionalCand::phi_packed(), edm::Handle< T >::product(), L1MuRegionalCand::pt_packed(), L1MuRegionalCand::setEtaValue(), L1MuGMTReadoutRecord::setInputCand(), L1MuRegionalCand::setPhiValue(), L1MuRegionalCand::setPtValue(), and L1MuRegionalCand::type_idx().

Referenced by L1MuGlobalMuonTrigger::produce().

                                                {


  edm::Handle<std::vector<L1MuRegionalCand> > rc_handle;

  const L1MuGMTChannelMask* theChannelMask = L1MuGMTConfig::getGMTChanMask();
  unsigned mask = theChannelMask->getSubsystemMask();
  
  if((L1MuGMTConfig::getDTInputTag()).label() != "none" && !(mask&1) ) {
    e.getByLabel(L1MuGMTConfig::getDTInputTag(),rc_handle);
    if(rc_handle.isValid()) {
      getDTBX(rc_handle.product(),bx);
    } else {
      if( L1MuGMTConfig::Debug(1) ) {
        edm::LogWarning("GlobalMuonTrigger")
        << "\nWarning: GlobalMuonTrigger: input tag " << L1MuGMTConfig::getDTInputTag()
        << "\nrequested, but not found in the event." << std::endl;      
      }
    }
  }
  if((L1MuGMTConfig::getCSCInputTag()).label() != "none" && !(mask&4) ) {
    e.getByLabel(L1MuGMTConfig::getCSCInputTag(),rc_handle);
    if(rc_handle.isValid()) {
      getCSC(rc_handle.product(),bx);
    } else {
      if( L1MuGMTConfig::Debug(1) ) {
        edm::LogWarning("GlobalMuonTrigger")
        << "\nWarning: GlobalMuonTrigger: input tag " << L1MuGMTConfig::getCSCInputTag()
        << "\nrequested, but not found in the event." << std::endl;      
      }
    }
  }
  if((L1MuGMTConfig::getRPCbInputTag()).label() != "none" && !(mask&2) ) {
    e.getByLabel(L1MuGMTConfig::getRPCbInputTag(),rc_handle);
    if(rc_handle.isValid()) {
      getRPCb(rc_handle.product(),bx);
    } else {
      if( L1MuGMTConfig::Debug(1) ) {
        edm::LogWarning("GlobalMuonTrigger")
        << "\nWarning: GlobalMuonTrigger: input tag " << L1MuGMTConfig::getRPCbInputTag()
        << "\nrequested, but not found in the event." << std::endl;      
      }
    }
  }
  if((L1MuGMTConfig::getRPCfInputTag()).label() != "none" && !(mask&8) ) {
    e.getByLabel(L1MuGMTConfig::getRPCfInputTag(),rc_handle);
    if(rc_handle.isValid()) {
      getRPCf(rc_handle.product(),bx);
    } else {
      if( L1MuGMTConfig::Debug(1) ) {
        edm::LogWarning("GlobalMuonTrigger")
        << "\nWarning: GlobalMuonTrigger: input tag " << L1MuGMTConfig::getRPCfInputTag()
        << "\nrequested, but not found in the event." << std::endl;      
      }
    }
  }


  const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
  const L1MuTriggerPtScale* theTriggerPtScale = L1MuGMTConfig::getTriggerPtScale();

  // store data in readout record
  for (int i=0; i<4; i++) {
    L1MuRegionalCand* cand = &(m_DtbxMuons[i]);
    cand->setPhiValue( theTriggerScales->getPhiScale()->getLowEdge(cand->phi_packed()) );
    cand->setEtaValue( theTriggerScales->getRegionalEtaScale(cand->type_idx())->getCenter(cand->eta_packed()) );
    cand->setPtValue( theTriggerPtScale->getPtScale()->getLowEdge(cand->pt_packed()) );
    // cand->setPtValue( theTriggerScales->getPtScale()->getLowEdge(cand->pt_packed()) );
    m_gmt.currentReadoutRecord()->setInputCand ( i, *cand );
  }
  for (int i=0; i<4; i++) {
    L1MuRegionalCand* cand = &(m_RpcMuons[i]);
    cand->setPhiValue( theTriggerScales->getPhiScale()->getLowEdge(cand->phi_packed()) );
    cand->setEtaValue( theTriggerScales->getRegionalEtaScale(cand->type_idx())->getCenter(cand->eta_packed()) );
    cand->setPtValue( theTriggerPtScale->getPtScale()->getLowEdge(cand->pt_packed()) );
    // cand->setPtValue( theTriggerScales->getPtScale()->getLowEdge(cand->pt_packed()) );
    m_gmt.currentReadoutRecord()->setInputCand ( i+4, *cand );
  }
  for (int i=0; i<4; i++) {
    L1MuRegionalCand* cand = &(m_CscMuons[i]);
    cand->setPhiValue( theTriggerScales->getPhiScale()->getLowEdge(cand->phi_packed()) );
    cand->setEtaValue( theTriggerScales->getRegionalEtaScale(cand->type_idx())->getCenter(cand->eta_packed()) );
    cand->setPtValue( theTriggerPtScale->getPtScale()->getLowEdge(cand->pt_packed()) );
    // cand->setPtValue( theTriggerScales->getPtScale()->getLowEdge(cand->pt_packed()) );
    m_gmt.currentReadoutRecord()->setInputCand ( i+8, *cand );
  }
  for (int i=0; i<4; i++) {
    L1MuRegionalCand* cand = &(m_RpcMuons[i+4]);
    cand->setPhiValue( theTriggerScales->getPhiScale()->getLowEdge(cand->phi_packed()) );
    cand->setEtaValue( theTriggerScales->getRegionalEtaScale(cand->type_idx())->getCenter(cand->eta_packed()) );
    cand->setPtValue( theTriggerPtScale->getPtScale()->getLowEdge(cand->pt_packed()) );
    // cand->setPtValue( theTriggerScales->getPtScale()->getLowEdge(cand->pt_packed()) );
    m_gmt.currentReadoutRecord()->setInputCand ( i+12, *cand );
  }


  // if there is at least one muon start the calorimeter trigger 

  if ( L1MuGMTConfig::getCaloTrigger() && !empty() ) getCalo(e);

}
void L1MuGMTPSB::reset ( void  )

clear PSB

Definition at line 196 of file L1MuGMTPSB.cc.

References L1MuGMTMatrix< T >::init(), m_CscMuons, m_DtbxMuons, m_Isol, m_Mip, and m_RpcMuons.

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

                       {

  std::vector<L1MuRegionalCand>::iterator iter; 
  iter = m_RpcMuons.begin();
  while ( iter != m_RpcMuons.end() ) (*(iter++)).reset();

  iter = m_DtbxMuons.begin();
  while ( iter != m_DtbxMuons.end() )(*(iter++)).reset();

  iter = m_CscMuons.begin();
  while ( iter != m_CscMuons.end() ) (*(iter++)).reset();
  
  m_Isol.init(false);
  m_Mip.init(false);

}
const L1MuRegionalCand * L1MuGMTPSB::RPCMuon ( int  index) const

get RPC muon

Definition at line 232 of file L1MuGMTPSB.cc.

References getHLTprescales::index, m_RpcMuons, and L1MuGMTConfig::MAXRPC.

Referenced by L1MuGMTMipIsoAU::load(), L1MuGMTMatcher::load(), and L1MuGMTMerger::load().

                                                           {
  
  return ( index < (int)L1MuGMTConfig::MAXRPC && index >= 0 ) ? &(m_RpcMuons[index]) : 0;
  
}

Member Data Documentation

std::vector<L1MuRegionalCand> L1MuGMTPSB::m_CscMuons [private]
std::vector<L1MuRegionalCand> L1MuGMTPSB::m_DtbxMuons [private]

Definition at line 127 of file L1MuGMTPSB.h.

Referenced by getCalo(), and receiveData().

Definition at line 133 of file L1MuGMTPSB.h.

Referenced by getCalo(), isolBits(), L1MuGMTPSB(), and reset().

Definition at line 134 of file L1MuGMTPSB.h.

Referenced by getCalo(), L1MuGMTPSB(), mipBits(), and reset().

std::vector<L1MuRegionalCand> L1MuGMTPSB::m_RpcMuons [private]