CMS 3D CMS Logo

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