CMS 3D CMS Logo

ME0Motherboard.cc
Go to the documentation of this file.
5 
7  : theEndcap(endcap), theChamber(chamber) {
9  infoV = tmbParams.getParameter<int>("verbosity");
10 }
11 
12 ME0Motherboard::ME0Motherboard() : theEndcap(1), theChamber(1) { infoV = 2; }
13 
15 
17  for (int bx = 0; bx < MAX_TRIGGER_BINS; bx++) {
18  for (int i = 0; i < MAX_TRIGGERS; i++) {
19  Triggers[bx][i].clear();
20  }
21  }
22 }
23 
25 
26 // Returns vector of read-out correlated Triggers, if any. Starts with
27 // the vector of all found Triggers and selects the ones in the read-out
28 // time window.
29 std::vector<ME0TriggerDigi> ME0Motherboard::readoutTriggers() {
30  std::vector<ME0TriggerDigi> tmpV;
31 
32  std::vector<ME0TriggerDigi> all_trigs = getTriggers();
33  tmpV.reserve(all_trigs.size());
34  for (const auto& ptrig : all_trigs) {
35  // in the future, add a selection on the BX
36  tmpV.push_back(ptrig);
37  }
38  return tmpV;
39 }
40 
41 // Returns vector of all found correlated Triggers, if any.
42 std::vector<ME0TriggerDigi> ME0Motherboard::getTriggers() {
43  std::vector<ME0TriggerDigi> tmpV;
44 
45  for (int bx = 0; bx < MAX_TRIGGER_BINS; bx++) {
46  for (int i = 0; i < MAX_TRIGGERS; i++) {
47  tmpV.push_back(Triggers[bx][i]);
48  }
49  }
50  return tmpV;
51 }
52 
53 // compare Triggers by quality
55  return trig1.getQuality() > trig2.getQuality();
56 }
57 
58 // compare Triggers by GEM bending angle
60  // todo: In the future I plan a member to be added to ME0TriggerDigi, getME0Dphi().
61  // That function will derive the bending angle from the pattern.
62  // The ME0TriggerDigi pattterns are at this point not defined yet.
63  return true;
64 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
int getQuality() const
return the Quality
static bool sortByME0Dphi(const ME0TriggerDigi &, const ME0TriggerDigi &)
static bool sortByQuality(const ME0TriggerDigi &, const ME0TriggerDigi &)
std::vector< ME0TriggerDigi > getTriggers()
std::vector< ME0TriggerDigi > readoutTriggers()
void clear()
clear this Trigger
ME0TriggerDigi Triggers[MAX_TRIGGER_BINS][MAX_TRIGGERS]
void run(const ME0PadDigiCollection *)