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 ()
 
 CSCMuonPortCard (const edm::ParameterSet &conf)
 
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

unsigned int max_stubs_
 
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 25 of file CSCMuonPortCard.h.

Member Typedef Documentation

Definition at line 31 of file CSCMuonPortCard.h.

Constructor & Destructor Documentation

CSCMuonPortCard::CSCMuonPortCard ( )

Definition at line 27 of file CSCMuonPortCard.cc.

References max_stubs_, and CSCConstants::maxStubs.

CSCMuonPortCard::CSCMuonPortCard ( const edm::ParameterSet conf)

Definition at line 32 of file CSCMuonPortCard.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), max_stubs_, and CSCConstants::maxStubs.

33 {
35 
36  edm::ParameterSet commonParams = conf.getParameter<edm::ParameterSet>("commonParam");
37  if (commonParams.getUntrackedParameter<bool>("isSLHC",false))
38  {
39  edm::ParameterSet mpcParams = conf.getParameter<edm::ParameterSet>("mpcSLHC");
40  max_stubs_ = mpcParams.getUntrackedParameter<unsigned int>("mpcMaxStubs", CSCConstants::maxStubs);
41  }
42 }
unsigned int max_stubs_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const

Member Function Documentation

void CSCMuonPortCard::clear ( void  )
inline

Definition at line 44 of file CSCMuonPortCard.h.

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

Referenced by loadDigis().

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

Definition at line 44 of file CSCMuonPortCard.cc.

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

Referenced by CSCTriggerPrimitivesBuilder::build().

45 {
46  // Put everything from the digi container into a trigger container.
47  // This allows us to sort per BX more easily.
48  clear();
49 
51 
52  for (Citer = thedigis.begin(); Citer != thedigis.end(); Citer++) {
53  CSCCorrelatedLCTDigiCollection::const_iterator Diter = (*Citer).second.first;
54  CSCCorrelatedLCTDigiCollection::const_iterator Dend = (*Citer).second.second;
55 
56  for (; Diter != Dend; Diter++) {
57  csctf::TrackStub theStub((*Diter), (*Citer).first);
58  stubs_.push_back(theStub);
59  }
60  }
61 }
void push_back(const T data)
std::vector< DigiType >::const_iterator const_iterator
CSCTriggerContainer< csctf::TrackStub > stubs_
std::vector< csctf::TrackStub > CSCMuonPortCard::sort ( const unsigned  endcap,
const unsigned  station,
const unsigned  sector,
const unsigned  subsector,
const int  bx 
)

Definition at line 63 of file CSCMuonPortCard.cc.

References CSCTriggerContainer< T >::get(), i, max_stubs_, query::result, python.multivaluedict::sort(), and stubs_.

Referenced by CSCTriggerPrimitivesBuilder::build().

65 {
66  std::vector<csctf::TrackStub> result;
67  std::vector<csctf::TrackStub>::iterator LCT;
68 
69  result = stubs_.get(endcap, station, sector, subsector, bx);
70 
71  // Make sure no Quality 0 or non-valid LCTs come through the portcard.
72  for (LCT = result.begin(); LCT != result.end(); LCT++) {
73  if ( !(LCT->getQuality() && LCT->isValid()) )
74  result.erase(LCT, LCT);
75  }
76 
77  if (result.size()) {
78  std::sort(result.begin(), result.end(), std::greater<csctf::TrackStub>());
79  // Can only return maxStubs or less LCTs per bunch crossing.
80  if (result.size() > max_stubs_)
81  result.erase(result.begin() + max_stubs_, result.end());
82 
83 
84  // Go through the sorted list and label the LCTs with a sorting number.
85  unsigned i = 0;
86  for (LCT = result.begin(); LCT != result.end(); LCT++)
87  LCT->setMPCLink(++i);
88  }
89 
90  return result;
91 }
unsigned int max_stubs_
int i
Definition: DBlmapReader.cc:9
std::vector< T > get() const
tuple result
Definition: query.py:137
CSCTriggerContainer< csctf::TrackStub > stubs_

Member Data Documentation

unsigned int CSCMuonPortCard::max_stubs_
private

Definition at line 48 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sort().

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

Definition at line 47 of file CSCMuonPortCard.h.

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