CMS 3D CMS Logo

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

#include <CSCMuonPortCard.h>

Public Types

typedef CSCTriggerContainer< csctf::TrackStubTrackStubList
 

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

bool drop_invalid_stubs_
 
bool drop_low_quality_stubs_
 
unsigned int max_stubs_
 
bool sort_stubs_
 
CSCTriggerContainer< csctf::TrackStubstubs_
 

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 25 of file CSCMuonPortCard.cc.

References max_stubs_, and CSCConstants::maxStubs.

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

Definition at line 30 of file CSCMuonPortCard.cc.

References drop_invalid_stubs_, drop_low_quality_stubs_, edm::ParameterSet::getParameter(), max_stubs_, CSCConstants::maxStubs, and sort_stubs_.

31 {
33 
34  edm::ParameterSet commonParams = conf.getParameter<edm::ParameterSet>("commonParam");
35  if (commonParams.getParameter<bool>("isSLHC"))
36  {
37  edm::ParameterSet mpcParams = conf.getParameter<edm::ParameterSet>("mpcSLHC");
38  max_stubs_ = mpcParams.getParameter<unsigned int>("mpcMaxStubs");
39  }
40  edm::ParameterSet mpcRun2Params = conf.getParameter<edm::ParameterSet>("mpcRun2");
41  sort_stubs_ = mpcRun2Params.getParameter<bool>("sortStubs");
42  drop_invalid_stubs_ = mpcRun2Params.getParameter<bool>("dropInvalidStubs");
43  drop_low_quality_stubs_ = mpcRun2Params.getParameter<bool>("dropLowQualityStubs");
44 }
unsigned int max_stubs_
T getParameter(std::string const &) const
bool drop_low_quality_stubs_

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 46 of file CSCMuonPortCard.cc.

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

47 {
48  // Put everything from the digi container into a trigger container.
49  // This allows us to sort per BX more easily.
50  clear();
51 
53 
54  for (Citer = thedigis.begin(); Citer != thedigis.end(); Citer++) {
55  CSCCorrelatedLCTDigiCollection::const_iterator Diter = (*Citer).second.first;
56  CSCCorrelatedLCTDigiCollection::const_iterator Dend = (*Citer).second.second;
57 
58  for (; Diter != Dend; Diter++) {
59  csctf::TrackStub theStub((*Diter), (*Citer).first);
60  stubs_.push_back(theStub);
61  }
62  }
63 }
void push_back(const T &data)
std::vector< CSCCorrelatedLCTDigi >::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 65 of file CSCMuonPortCard.cc.

References drop_invalid_stubs_, drop_low_quality_stubs_, CSCTriggerContainer< T >::get(), mps_fire::i, max_stubs_, mps_fire::result, sort_stubs_, and stubs_.

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

Member Data Documentation

bool CSCMuonPortCard::drop_invalid_stubs_
private

Definition at line 50 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sort().

bool CSCMuonPortCard::drop_low_quality_stubs_
private

Definition at line 51 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sort().

unsigned int CSCMuonPortCard::max_stubs_
private

Definition at line 48 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sort().

bool CSCMuonPortCard::sort_stubs_
private

Definition at line 49 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().