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_
 
bool sort_stubs_
 
CSCTriggerContainer< csctf::TrackStubstubs_
 

Detailed Description

Definition at line 35 of file CSCMuonPortCard.h.

Member Typedef Documentation

Definition at line 41 of file CSCMuonPortCard.h.

Constructor & Destructor Documentation

CSCMuonPortCard::CSCMuonPortCard ( )

Definition at line 5 of file CSCMuonPortCard.cc.

6 {
7 }
CSCMuonPortCard::CSCMuonPortCard ( const edm::ParameterSet conf)

Definition at line 9 of file CSCMuonPortCard.cc.

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

10 {
11  edm::ParameterSet mpcRun2Params = conf.getParameter<edm::ParameterSet>("mpcRun2");
12  sort_stubs_ = mpcRun2Params.getParameter<bool>("sortStubs");
13  drop_invalid_stubs_ = mpcRun2Params.getParameter<bool>("dropInvalidStubs");
14  drop_low_quality_stubs_ = mpcRun2Params.getParameter<bool>("dropLowQualityStubs");
15 }
T getParameter(std::string const &) const
bool drop_low_quality_stubs_

Member Function Documentation

void CSCMuonPortCard::clear ( void  )
inline

Definition at line 55 of file CSCMuonPortCard.h.

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

Referenced by loadDigis().

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

Definition at line 17 of file CSCMuonPortCard.cc.

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

18 {
19  // Put everything from the digi container into a trigger container.
20  // This allows us to sort per BX more easily.
21  clear();
22 
24 
25  for (Citer = thedigis.begin(); Citer != thedigis.end(); Citer++) {
26  CSCCorrelatedLCTDigiCollection::const_iterator Diter = (*Citer).second.first;
27  CSCCorrelatedLCTDigiCollection::const_iterator Dend = (*Citer).second.second;
28 
29  for (; Diter != Dend; Diter++) {
30  csctf::TrackStub theStub((*Diter), (*Citer).first);
31  stubs_.push_back(theStub);
32  }
33  }
34 }
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 36 of file CSCMuonPortCard.cc.

References drop_invalid_stubs_, drop_low_quality_stubs_, CSCTriggerContainer< T >::get(), mps_fire::i, CSCConstants::MAX_LCTS_PER_MPC, mps_fire::result, jetUpdater_cfi::sort, sort_stubs_, and stubs_.

38 {
39  std::vector<csctf::TrackStub> result;
40  std::vector<csctf::TrackStub>::iterator LCT;
41 
42  result = stubs_.get(endcap, station, sector, subsector, bx);
43 
44  // Make sure no Quality 0 or non-valid LCTs come through the portcard.
45  for (LCT = result.begin(); LCT != result.end(); LCT++) {
46  if ( (drop_invalid_stubs_ && !LCT->isValid()) ||
47  (drop_low_quality_stubs_ && LCT->getQuality()==0) )
48  result.erase(LCT, LCT);
49  }
50 
51  if (!result.empty()) {
52  if (sort_stubs_) std::sort(result.begin(), result.end(), std::greater<csctf::TrackStub>());
53 
54  // Can return up to MAX_LCTS_PER_MPC (default 18) per bunch crossing.
55  if (result.size() > CSCConstants::MAX_LCTS_PER_MPC)
56  result.erase(result.begin() + CSCConstants::MAX_LCTS_PER_MPC, result.end());
57 
58  // Go through the sorted list and label the LCTs with a sorting number.
59  unsigned i = 0;
60  for (LCT = result.begin(); LCT != result.end(); LCT++)
61  LCT->setMPCLink(++i);
62  }
63 
64  return result;
65 }
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 64 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sort().

bool CSCMuonPortCard::drop_low_quality_stubs_
private

Definition at line 65 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sort().

bool CSCMuonPortCard::sort_stubs_
private

Definition at line 63 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sort().

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

Definition at line 60 of file CSCMuonPortCard.h.

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