CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 (unsigned endcap, unsigned station, unsigned sector, const edm::ParameterSet &conf)
 
 CSCMuonPortCard ()
 
std::vector< csctf::TrackStubgetLCTs () const
 
void loadLCTs (const CSCCorrelatedLCTDigiCollection &thedigis)
 
void sortLCTs ()
 
void sortLCTs (const unsigned subsector, const int bx)
 

Private Attributes

bool drop_invalid_stubs_
 
bool drop_low_quality_stubs_
 
unsigned max_stubs_
 
int maxBX_
 
int minBX_
 
std::vector< csctf::TrackStubselectedStubs_
 
bool sort_stubs_
 
CSCTriggerContainer
< csctf::TrackStub
stubs_
 
unsigned theEndcap
 
unsigned theSector
 
unsigned theStation
 
std::string vmeName_
 

Detailed Description

Definition at line 36 of file CSCMuonPortCard.h.

Member Typedef Documentation

Definition at line 38 of file CSCMuonPortCard.h.

Constructor & Destructor Documentation

CSCMuonPortCard::CSCMuonPortCard ( unsigned  endcap,
unsigned  station,
unsigned  sector,
const edm::ParameterSet conf 
)

Definition at line 7 of file CSCMuonPortCard.cc.

References drop_invalid_stubs_, drop_low_quality_stubs_, edm::ParameterSet::getParameter(), max_stubs_, maxBX_, minBX_, sort_stubs_, AlCaHLTBitMon_QueryRunRegistry::string, theSector, theStation, and vmeName_.

9  // Get min and max BX to sort LCTs in MPC.
10  minBX_ = conf.getParameter<int>("MinBX");
11  maxBX_ = conf.getParameter<int>("MaxBX");
12 
13  const auto& mpcParams = conf.getParameter<edm::ParameterSet>("mpcParam");
14  sort_stubs_ = mpcParams.getParameter<bool>("sortStubs");
15  drop_invalid_stubs_ = mpcParams.getParameter<bool>("dropInvalidStubs");
16  drop_low_quality_stubs_ = mpcParams.getParameter<bool>("dropLowQualityStubs");
17  max_stubs_ = mpcParams.getParameter<unsigned>("maxStubs");
18 
19  const std::string eSign = endcap == 1 ? "+" : "-";
20  vmeName_ = "VME" + eSign + std::to_string(theStation) + "/" + std::to_string(theSector);
21 }
bool drop_low_quality_stubs_
std::string vmeName_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CSCMuonPortCard::CSCMuonPortCard ( )

Definition at line 5 of file CSCMuonPortCard.cc.

5 {}

Member Function Documentation

void CSCMuonPortCard::clear ( void  )

Definition at line 23 of file CSCMuonPortCard.cc.

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

Referenced by loadLCTs().

23  {
24  stubs_.clear();
25  selectedStubs_.clear();
26 }
CSCTriggerContainer< csctf::TrackStub > stubs_
std::vector< csctf::TrackStub > selectedStubs_
std::vector<csctf::TrackStub> CSCMuonPortCard::getLCTs ( ) const
inline

Definition at line 58 of file CSCMuonPortCard.h.

References selectedStubs_.

58 { return selectedStubs_; }
std::vector< csctf::TrackStub > selectedStubs_
void CSCMuonPortCard::loadLCTs ( const CSCCorrelatedLCTDigiCollection thedigis)

Definition at line 28 of file CSCMuonPortCard.cc.

References clear(), Reference_intrackfit_cff::endcap, CSCDetId::endcap(), or, CSCTriggerContainer< T >::push_back(), relativeConstraints::station, CSCDetId::station(), stubs_, theEndcap, theSector, theStation, and CSCDetId::triggerSector().

28  {
29  // clear the input and output collection
30  clear();
31 
32  for (auto Citer = thedigis.begin(); Citer != thedigis.end(); Citer++) {
33  const CSCDetId& detid((*Citer).first);
34  const unsigned endcap = detid.endcap();
35  const unsigned station = detid.station();
36  const unsigned sector = detid.triggerSector();
37 
38  // select stubs by region
39  if (endcap != theEndcap or station != theStation or sector != theSector)
40  continue;
41 
42  // Put everything from the digi container into a trigger container.
43  // This allows us to sort per BX more easily.
44  for (auto Diter = (*Citer).second.first; Diter != (*Citer).second.second; Diter++) {
45  stubs_.push_back(csctf::TrackStub((*Diter), (*Citer).first));
46  }
47  }
48 }
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
void push_back(const T &data)
CSCTriggerContainer< csctf::TrackStub > stubs_
void CSCMuonPortCard::sortLCTs ( )

Definition at line 50 of file CSCMuonPortCard.cc.

References makePileupJSON::bx, maxBX_, minBX_, and theStation.

50  {
51  // sort the LCTs per BX and subsector
52  for (int bx = minBX_; bx <= maxBX_; ++bx) {
53  // station 1 case with all 10 degree chambers
54  if (theStation == 1) {
55  sortLCTs(1, bx);
56  sortLCTs(2, bx);
57  }
58  // station 2,3,4 case with mixture of 10 and 20 degree chambers
59  else {
60  sortLCTs(0, bx);
61  }
62  }
63 }
void CSCMuonPortCard::sortLCTs ( 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, CSCConstants::MAX_LCTS_PER_MPC, max_stubs_, min(), mps_fire::result, selectedStubs_, sort_stubs_, stubs_, theEndcap, theSector, and theStation.

65  {
66  // temporary vector
67  std::vector<csctf::TrackStub> result = stubs_.get(theEndcap, theStation, theSector, subsector, bx);
68 
69  // pre-selection step
70  for (auto LCT = result.begin(); LCT != result.end(); LCT++) {
71  // step 1: no invalid stubs
72  if (drop_invalid_stubs_ && !LCT->isValid()) {
73  result.erase(LCT, LCT);
74  }
75 
76  // step 2: no low-quality stubs
77  if (drop_low_quality_stubs_ && LCT->getQuality() == 0) {
78  result.erase(LCT, LCT);
79  }
80  }
81 
82  // sort+select
83  if (!result.empty()) {
84  // sort according to quality and CSCDetId
85  if (sort_stubs_) {
86  std::sort(result.begin(), result.end(), std::greater<csctf::TrackStub>());
87  }
88 
89  // select up to MAX_LCTS_PER_MPC (default 18) per bunch crossing.
90  const unsigned maxStubs = std::min(max_stubs_, unsigned(CSCConstants::MAX_LCTS_PER_MPC));
91  if (result.size() > maxStubs) {
92  result.erase(result.begin() + maxStubs, result.end());
93  }
94 
95  // Go through the sorted list and label the LCTs with a sorting number.
96  unsigned i = 0;
97  for (auto LCT = result.begin(); LCT != result.end(); LCT++) {
98  LCT->setMPCLink(++i);
99  }
100 
101  // now insert the temporary vector in the output collection
102  selectedStubs_.insert(selectedStubs_.end(), result.begin(), result.end());
103  }
104 }
std::vector< T > get() const
tuple result
Definition: mps_fire.py:311
bool drop_low_quality_stubs_
T min(T a, T b)
Definition: MathUtil.h:58
CSCTriggerContainer< csctf::TrackStub > stubs_
std::vector< csctf::TrackStub > selectedStubs_

Member Data Documentation

bool CSCMuonPortCard::drop_invalid_stubs_
private

Definition at line 74 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sortLCTs().

bool CSCMuonPortCard::drop_low_quality_stubs_
private

Definition at line 75 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sortLCTs().

unsigned CSCMuonPortCard::max_stubs_
private

Definition at line 76 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sortLCTs().

int CSCMuonPortCard::maxBX_
private

Definition at line 78 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sortLCTs().

int CSCMuonPortCard::minBX_
private

Definition at line 78 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sortLCTs().

std::vector<csctf::TrackStub> CSCMuonPortCard::selectedStubs_
private

Definition at line 70 of file CSCMuonPortCard.h.

Referenced by clear(), getLCTs(), and sortLCTs().

bool CSCMuonPortCard::sort_stubs_
private

Definition at line 73 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), and sortLCTs().

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

Definition at line 67 of file CSCMuonPortCard.h.

Referenced by clear(), loadLCTs(), and sortLCTs().

unsigned CSCMuonPortCard::theEndcap
private

Chamber id (trigger-type labels).

Definition at line 62 of file CSCMuonPortCard.h.

Referenced by loadLCTs(), and sortLCTs().

unsigned CSCMuonPortCard::theSector
private

Definition at line 64 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), loadLCTs(), and sortLCTs().

unsigned CSCMuonPortCard::theStation
private

Definition at line 63 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard(), loadLCTs(), and sortLCTs().

std::string CSCMuonPortCard::vmeName_
private

Definition at line 80 of file CSCMuonPortCard.h.

Referenced by CSCMuonPortCard().