CMS 3D CMS Logo

ME0Motherboard.cc
Go to the documentation of this file.
5 
7  const edm::ParameterSet& conf) :
8  theEndcap(endcap), theChamber(chamber)
9 {
10  edm::ParameterSet tmbParams = conf.getParameter<edm::ParameterSet>("tmbParam");
11  infoV = tmbParams.getParameter<int>("verbosity");
12 }
13 
15  theEndcap(1), theChamber(1)
16 {
17  infoV = 2;
18 }
19 
21 }
22 
24 {
25  for (int bx = 0; bx < MAX_TRIGGER_BINS; bx++) {
26  for (int i = 0; i < MAX_TRIGGERS; i++) {
27  Triggers[bx][i].clear();
28  }
29  }
30 }
31 
32 void
34 {
35  clear();
36 }
37 
38 // Returns vector of read-out correlated Triggers, if any. Starts with
39 // the vector of all found Triggers and selects the ones in the read-out
40 // time window.
41 std::vector<ME0TriggerDigi> ME0Motherboard::readoutTriggers()
42 {
43  std::vector<ME0TriggerDigi> tmpV;
44 
45  std::vector<ME0TriggerDigi> all_trigs = getTriggers();
46  for (auto ptrig = all_trigs.begin(); ptrig != all_trigs.end(); ptrig++) {
47  tmpV.push_back(*ptrig);
48  }
49  return tmpV;
50 }
51 
52 // Returns vector of all found correlated Triggers, if any.
53 std::vector<ME0TriggerDigi> ME0Motherboard::getTriggers()
54 {
55  std::vector<ME0TriggerDigi> tmpV;
56 
57  // Do not report Triggers found in ME1/A if mpc_block_me1/a is set.
58  for (int bx = 0; bx < MAX_TRIGGER_BINS; bx++) {
59  for (int i = 0; i < MAX_TRIGGERS; i++) {
60  tmpV.push_back(Triggers[bx][i]);
61  }
62  }
63  return tmpV;
64 }
65 
66 // compare Triggers by quality
68 {
69  return trig1.getQuality() > trig2.getQuality();
70 }
71 
72 // compare Triggers by GEM bending angle
74 {
75  // todo: In the future I plan a member to be added to ME0TriggerDigi, getME0Dphi().
76  // That function will derive the bending angle from the pattern.
77  // The ME0TriggerDigi pattterns are at this point not defined yet.
78  return true;
79 }
T getParameter(std::string const &) const
static bool sortByME0Dphi(const ME0TriggerDigi &, const ME0TriggerDigi &)
static bool sortByQuality(const ME0TriggerDigi &, const ME0TriggerDigi &)
int getQuality() const
return the Quality
std::vector< ME0TriggerDigi > getTriggers()
const unsigned theEndcap
std::vector< ME0TriggerDigi > readoutTriggers()
void clear()
clear this Trigger
const unsigned theChamber
ME0TriggerDigi Triggers[MAX_TRIGGER_BINS][MAX_TRIGGERS]
void run(const ME0PadDigiCollection *)