CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
CSCMuonPortCard Class Reference

#include <CSCMuonPortCard.h>

Public Types

typedef CSCTriggerContainer
< csctf::TrackStub
TrackStubList
 

Public Member Functions

void clear ()
 
 CSCMuonPortCard ()
 
void loadDigis (const CSCCorrelatedLCTDigiCollection &thedigis)
 
std::vector< csctf::TrackStubsort (const unsigned endcap, const unsigned station, const unsigned sector, const unsigned subsector, const int bx)
 

Private Attributes

CSCTriggerContainer
< csctf::TrackStub
_stubs
 

Detailed Description

Simulates the functionality of the Muon Port Card (MPC). Each MPC is responsible for 9 Trigger Mother Boards (TMBs). It takes the up to 18 LCTs (2/TMB) in each (sub)sector every bunch crossing, sorts them, selects up to three best, and puts them into an output collection.

A port/reworking of the muon port card from ORCA.

Author
L. Gray (UF)

Definition at line 24 of file CSCMuonPortCard.h.

Member Typedef Documentation

Definition at line 27 of file CSCMuonPortCard.h.

Constructor & Destructor Documentation

CSCMuonPortCard::CSCMuonPortCard ( )
inline

Definition at line 27 of file CSCMuonPortCard.h.

27 {};

Member Function Documentation

void CSCMuonPortCard::clear ( void  )
inline

Definition at line 42 of file CSCMuonPortCard.h.

References _stubs, and CSCTriggerContainer< T >::clear().

Referenced by loadDigis().

42 { _stubs.clear(); }
CSCTriggerContainer< csctf::TrackStub > _stubs
void CSCMuonPortCard::loadDigis ( const CSCCorrelatedLCTDigiCollection thedigis)

Definition at line 27 of file CSCMuonPortCard.cc.

References _stubs, clear(), and CSCTriggerContainer< T >::push_back().

Referenced by CSCTriggerPrimitivesBuilder::build().

28 {
29  // Put everything from the digi container into a trigger container.
30  // This allows us to sort per BX more easily.
31  clear();
32 
34 
35  for (Citer = thedigis.begin(); Citer != thedigis.end(); Citer++) {
36  CSCCorrelatedLCTDigiCollection::const_iterator Diter = (*Citer).second.first;
37  CSCCorrelatedLCTDigiCollection::const_iterator Dend = (*Citer).second.second;
38 
39  for (; Diter != Dend; Diter++) {
40  csctf::TrackStub theStub((*Diter), (*Citer).first);
41  _stubs.push_back(theStub);
42  }
43  }
44 }
void push_back(const T data)
CSCTriggerContainer< csctf::TrackStub > _stubs
std::vector< DigiType >::const_iterator const_iterator
std::vector< csctf::TrackStub > CSCMuonPortCard::sort ( const unsigned  endcap,
const unsigned  station,
const unsigned  sector,
const unsigned  subsector,
const int  bx 
)

Definition at line 46 of file CSCMuonPortCard.cc.

References _stubs, CSCTriggerContainer< T >::get(), i, CSCConstants::maxStubs, query::result, and python.multivaluedict::sort().

Referenced by CSCTriggerPrimitivesBuilder::build().

48 {
49  std::vector<csctf::TrackStub> result;
50  std::vector<csctf::TrackStub>::iterator LCT;
51 
52  result = _stubs.get(endcap, station, sector, subsector, bx);
53 
54  // Make sure no Quality 0 or non-valid LCTs come through the portcard.
55  for (LCT = result.begin(); LCT != result.end(); LCT++) {
56  if ( !(LCT->getQuality() && LCT->isValid()) )
57  result.erase(LCT, LCT);
58  }
59 
60  if (result.size()) {
61  std::sort(result.begin(), result.end(), std::greater<csctf::TrackStub>());
62  // Can only return maxStubs or less LCTs per bunch crossing.
63  if (result.size() > CSCConstants::maxStubs)
64  result.erase(result.begin() + CSCConstants::maxStubs, result.end());
65 
66 
67  // Go through the sorted list and label the LCTs with a sorting number.
68  unsigned i = 0;
69  for (LCT = result.begin(); LCT != result.end(); LCT++)
70  LCT->setMPCLink(++i);
71  }
72 
73  return result;
74 }
int i
Definition: DBlmapReader.cc:9
std::vector< T > get() const
tuple result
Definition: query.py:137
CSCTriggerContainer< csctf::TrackStub > _stubs

Member Data Documentation

CSCTriggerContainer<csctf::TrackStub> CSCMuonPortCard::_stubs
private

Definition at line 45 of file CSCMuonPortCard.h.

Referenced by clear(), loadDigis(), and sort().