CMS 3D CMS Logo

HGCalConcentratorProcessorSelection.cc
Go to the documentation of this file.
2 #include <limits>
3 
5 
7 
11  if (selectionType == "thresholdSelect") {
13  concentratorProcImpl_ = std::make_unique<HGCalConcentratorSelectionImpl>(conf);
14  } else if (selectionType == "bestChoiceSelect") {
16  concentratorProcImpl_ = std::make_unique<HGCalConcentratorSelectionImpl>(conf);
17  } else if (selectionType == "superTriggerCellSelect") {
19  concentratorSTCImpl_ = std::make_unique<HGCalConcentratorSuperTriggerCellImpl>(conf);
20  } else {
21  throw cms::Exception("HGCTriggerParameterError")
22  << "Unknown type of concentrator selection '" << selectionType << "'";
23  }
24 }
25 
27  l1t::HGCalTriggerCellBxCollection& triggerCellCollOutput,
28  const edm::EventSetup& es) {
30  concentratorProcImpl_->eventSetup(es);
31  const l1t::HGCalTriggerCellBxCollection& collInput = *triggerCellCollInput;
32 
33  std::unordered_map<uint32_t, std::vector<l1t::HGCalTriggerCell>> tc_modules;
34  for (const auto& trigCell : collInput) {
35  uint32_t module = geometry_->getModuleFromTriggerCell(trigCell.detId());
36  tc_modules[module].push_back(trigCell);
37  }
39  concentratorSTCImpl_->eventSetup(es);
40 
41  for (const auto& module_trigcell : tc_modules) {
42  std::vector<l1t::HGCalTriggerCell> trigCellVecOutput;
43  switch (selectionType_) {
44  case thresholdSelect:
45  concentratorProcImpl_->thresholdSelectImpl(module_trigcell.second, trigCellVecOutput);
46  break;
47  case bestChoiceSelect:
48  concentratorProcImpl_->bestChoiceSelectImpl(module_trigcell.second, trigCellVecOutput);
49  break;
51  concentratorSTCImpl_->superTriggerCellSelectImpl(module_trigcell.second, trigCellVecOutput);
52  break;
53  default:
54  // Should not happen, selection type checked in constructor
55  break;
56  }
57  for (const auto& trigCell : trigCellVecOutput) {
58  triggerCellCollOutput.push_back(0, trigCell);
59  }
60  }
61 }
T getParameter(std::string const &) const
const HGCalTriggerGeometryBase * geometry_
HGCalConcentratorProcessorSelection(const edm::ParameterSet &conf)
void run(const edm::Handle< l1t::HGCalTriggerCellBxCollection > &triggerCellCollInput, l1t::HGCalTriggerCellBxCollection &triggerCellCollOutput, const edm::EventSetup &es) override
std::unique_ptr< HGCalConcentratorSelectionImpl > concentratorProcImpl_
std::unique_ptr< HGCalConcentratorSuperTriggerCellImpl > concentratorSTCImpl_
virtual unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const =0
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: vlib.h:208
void push_back(int bx, T object)