CMS 3D CMS Logo

CSCMuonPortCard.cc
Go to the documentation of this file.
3 #include <algorithm>
4 
6 
8  edm::ParameterSet mpcRun2Params = conf.getParameter<edm::ParameterSet>("mpcRun2");
9  sort_stubs_ = mpcRun2Params.getParameter<bool>("sortStubs");
10  drop_invalid_stubs_ = mpcRun2Params.getParameter<bool>("dropInvalidStubs");
11  drop_low_quality_stubs_ = mpcRun2Params.getParameter<bool>("dropLowQualityStubs");
12 }
13 
15  // Put everything from the digi container into a trigger container.
16  // This allows us to sort per BX more easily.
17  clear();
18 
20 
21  for (Citer = thedigis.begin(); Citer != thedigis.end(); Citer++) {
22  CSCCorrelatedLCTDigiCollection::const_iterator Diter = (*Citer).second.first;
23  CSCCorrelatedLCTDigiCollection::const_iterator Dend = (*Citer).second.second;
24 
25  for (; Diter != Dend; Diter++) {
26  csctf::TrackStub theStub((*Diter), (*Citer).first);
27  stubs_.push_back(theStub);
28  }
29  }
30 }
31 
32 std::vector<csctf::TrackStub> CSCMuonPortCard::sort(
33  const unsigned endcap, const unsigned station, const unsigned sector, const unsigned subsector, const int bx) {
34  std::vector<csctf::TrackStub> result;
35  std::vector<csctf::TrackStub>::iterator LCT;
36 
37  result = stubs_.get(endcap, station, sector, subsector, bx);
38 
39  // Make sure no Quality 0 or non-valid LCTs come through the portcard.
40  for (LCT = result.begin(); LCT != result.end(); LCT++) {
41  if ((drop_invalid_stubs_ && !LCT->isValid()) || (drop_low_quality_stubs_ && LCT->getQuality() == 0))
42  result.erase(LCT, LCT);
43  }
44 
45  if (!result.empty()) {
46  if (sort_stubs_)
47  std::sort(result.begin(), result.end(), std::greater<csctf::TrackStub>());
48 
49  // Can return up to MAX_LCTS_PER_MPC (default 18) per bunch crossing.
51  result.erase(result.begin() + CSCConstants::MAX_LCTS_PER_MPC, result.end());
52 
53  // Go through the sorted list and label the LCTs with a sorting number.
54  unsigned i = 0;
55  for (LCT = result.begin(); LCT != result.end(); LCT++)
56  LCT->setMPCLink(++i);
57  }
58 
59  return result;
60 }
mps_fire.i
i
Definition: mps_fire.py:355
CSCMuonPortCard::sort
std::vector< csctf::TrackStub > sort(const unsigned endcap, const unsigned station, const unsigned sector, const unsigned subsector, const int bx)
Definition: CSCMuonPortCard.cc:32
relativeConstraints.station
station
Definition: relativeConstraints.py:67
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCMuonPortCard::drop_low_quality_stubs_
bool drop_low_quality_stubs_
Definition: CSCMuonPortCard.h:61
csctf::TrackStub
Definition: TrackStub.h:22
MuonDigiCollection::const_iterator
std::vector< DigiType >::const_iterator const_iterator
Definition: MuonDigiCollection.h:94
CSCConstants.h
CSCMuonPortCard::loadDigis
void loadDigis(const CSCCorrelatedLCTDigiCollection &thedigis)
Definition: CSCMuonPortCard.cc:14
CSCMuonPortCard.h
edm::ParameterSet
Definition: ParameterSet.h:36
CSCMuonPortCard::clear
void clear()
Definition: CSCMuonPortCard.h:52
CSCMuonPortCard::drop_invalid_stubs_
bool drop_invalid_stubs_
Definition: CSCMuonPortCard.h:60
CSCCorrelatedLCTDigiCollection
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
CSCMuonPortCard::CSCMuonPortCard
CSCMuonPortCard()
Definition: CSCMuonPortCard.cc:5
CSCTriggerContainer::push_back
void push_back(const T &data)
Definition: CSCTriggerContainer.h:51
CSCConstants::MAX_LCTS_PER_MPC
Definition: CSCConstants.h:75
mps_fire.result
result
Definition: mps_fire.py:303
CSCMuonPortCard::stubs_
CSCTriggerContainer< csctf::TrackStub > stubs_
Definition: CSCMuonPortCard.h:56
DigiContainerIterator
Definition: MuonDigiCollection.h:30
CSCTriggerContainer::get
std::vector< T > get() const
Definition: CSCTriggerContainer.h:83
CSCMuonPortCard::sort_stubs_
bool sort_stubs_
Definition: CSCMuonPortCard.h:59