CMS 3D CMS Logo

ME0TriggerBuilder.cc
Go to the documentation of this file.
6 
8 {
9  config_ = conf;
10 
11  for (int endc = 0; endc < 2; endc++)
12  {
13  for (int cham = 0; cham < 18; cham++)
14  {
15  if ((endc <= 0 || endc > MAX_ENDCAPS) ||
16  (cham <= 0 || cham > MAX_CHAMBERS))
17  {
18  edm::LogError("L1ME0TPEmulatorSetupError")
19  << "+++ trying to instantiate TMB of illegal ME0 id ["
20  << " endcap = " << endc
21  << " chamber = " << cham
22  << "]; skipping it... +++\n";
23  continue;
24  }
25  tmb_[endc][cham].reset( new ME0Motherboard(endc, cham, config_) );
26  }
27  }
28 }
29 
31 {
32 }
33 
35  ME0TriggerDigiCollection& oc_trig)
36 {
37  for (int endc = 0; endc < 2; endc++)
38  {
39  for (int cham = 0; cham < 18; cham++)
40  {
41  ME0Motherboard* tmb = tmb_[endc][cham].get();
42  tmb->setME0Geometry(me0_g);
43 
44  // 0th layer means whole chamber.
45  const int region(endc == 0 ? -1 : 1);
46  ME0DetId detid(region, 0, cham, 0);
47 
48  // Run processors only if chamber exists in geometry.
49  if (tmb == nullptr || me0_g->chamber(detid) == nullptr) continue;
50 
51  tmb->run(me0Pads);
52 
53  std::vector<ME0TriggerDigi> trigV = tmb->readoutTriggers();
54 
55  if (!trigV.empty()) {
56  LogTrace("L1ME0Trigger")
57  << "ME0TriggerBuilder got results in " <<detid
58  << std::endl
59  << "Put " << trigV.size() << " Trigger digi"
60  << ((trigV.size() > 1) ? "s " : " ") << "in collection\n";
61  oc_trig.put(std::make_pair(trigV.begin(),trigV.end()), detid);
62  }
63  }
64  }
65 }
66 
const ME0Chamber * chamber(ME0DetId id) const
Return a chamber given its id.
Definition: ME0Geometry.cc:73
edm::ParameterSet config_
void setME0Geometry(const ME0Geometry *g)
#define LogTrace(id)
std::vector< ME0TriggerDigi > readoutTriggers()
ME0TriggerBuilder(const edm::ParameterSet &)
const ME0Geometry * me0_g
std::unique_ptr< ME0Motherboard > tmb_[MAX_ENDCAPS][MAX_CHAMBERS]
void run(const ME0PadDigiCollection *)
void build(const ME0PadDigiClusterCollection *me0Pads, ME0TriggerDigiCollection &oc_trig)