CMS 3D CMS Logo

ME0TriggerBuilder.cc
Go to the documentation of this file.
2 
4  config_ = conf;
5 
6  for (int endc = 0; endc < MAX_ENDCAPS; endc++) {
7  for (int cham = 0; cham < MAX_CHAMBERS; cham++) {
8  tmb_[endc][cham].reset(new ME0Motherboard(endc, cham, config_));
9  }
10  }
11 }
12 
14 
16  for (int endc = 0; endc < 2; endc++) {
18  ME0Motherboard* tmb = tmb_[endc][cham].get();
19  tmb->setME0Geometry(me0_g);
20 
21  // 0th layer means whole chamber.
22  const int region(endc == 0 ? -1 : 1);
23  ME0DetId detid(region, 0, cham + 1, 0);
24 
25  // Run processors only if chamber exists in geometry.
26  if (tmb == nullptr || me0_g->chamber(detid) == nullptr)
27  continue;
28 
29  tmb->run(me0Pads);
30 
31  const std::vector<ME0TriggerDigi>& trigV = tmb->readoutTriggers();
32 
33  if (!trigV.empty()) {
34  LogTrace("L1ME0Trigger") << "ME0TriggerBuilder got results in " << detid << std::endl
35  << "Put " << trigV.size() << " Trigger digi" << ((trigV.size() > 1) ? "s " : " ")
36  << "in collection\n";
37  oc_trig.put(std::make_pair(trigV.begin(), trigV.end()), detid);
38  }
39  }
40  }
41 }
static const int minChamberId
Definition: ME0DetId.h:66
static const int maxChamberId
Definition: ME0DetId.h:67
const ME0Chamber * chamber(ME0DetId id) const
Return a chamber given its id.
Definition: ME0Geometry.cc:43
edm::ParameterSet config_
void setME0Geometry(const ME0Geometry *g)
#define LogTrace(id)
std::vector< ME0TriggerDigi > readoutTriggers()
ME0TriggerBuilder(const edm::ParameterSet &)
void build(const ME0PadDigiCollection *me0Pads, ME0TriggerDigiCollection &oc_trig)
const ME0Geometry * me0_g
std::unique_ptr< ME0Motherboard > tmb_[MAX_ENDCAPS][MAX_CHAMBERS]
void run(const ME0PadDigiCollection *)