CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes | Static Private Attributes
HGCalConcentratorProcessorSelection Class Reference

#include <HGCalConcentratorProcessorSelection.h>

Inheritance diagram for HGCalConcentratorProcessorSelection:
HGCalProcessorBaseT< InputCollection, OutputCollection >

Public Member Functions

 HGCalConcentratorProcessorSelection (const edm::ParameterSet &conf)
 
void run (const edm::Handle< l1t::HGCalTriggerCellBxCollection > &triggerCellCollInput, l1t::HGCalTriggerCellBxCollection &triggerCellCollOutput, const edm::EventSetup &es) override
 
- Public Member Functions inherited from HGCalProcessorBaseT< InputCollection, OutputCollection >
 HGCalProcessorBaseT (const edm::ParameterSet &conf)
 
const std::string & name () const
 
virtual void run (const InputCollection &inputColl, OutputCollection &outColl, const edm::EventSetup &es)=0
 
void setGeometry (const HGCalTriggerGeometryBase *const geom)
 
virtual ~HGCalProcessorBaseT ()
 

Private Types

enum  SelectionType { thresholdSelect, bestChoiceSelect, superTriggerCellSelect, mixedBestChoiceSuperTriggerCell }
 

Private Attributes

std::unique_ptr< HGCalConcentratorBestChoiceImplbestChoiceImpl_
 
std::unique_ptr< HGCalConcentratorCoarsenerImplcoarsenerImpl_
 
bool coarsenTriggerCells_
 
bool fixedDataSizePerHGCROC_
 
SelectionType selectionType_
 
std::unique_ptr< HGCalConcentratorSuperTriggerCellImplsuperTriggerCellImpl_
 
std::unique_ptr< HGCalConcentratorThresholdImplthresholdImpl_
 
HGCalTriggerTools triggerTools_
 

Static Private Attributes

static int kHighDensityThickness_ = 0
 

Additional Inherited Members

- Protected Attributes inherited from HGCalProcessorBaseT< InputCollection, OutputCollection >
const HGCalTriggerGeometryBasegeometry_
 

Detailed Description

Definition at line 14 of file HGCalConcentratorProcessorSelection.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

HGCalConcentratorProcessorSelection::HGCalConcentratorProcessorSelection ( const edm::ParameterSet conf)

Definition at line 8 of file HGCalConcentratorProcessorSelection.cc.

References bestChoiceImpl_, bestChoiceSelect, coarsenerImpl_, coarsenTriggerCells_, Exception, fixedDataSizePerHGCROC_, edm::ParameterSet::getParameter(), mixedBestChoiceSuperTriggerCell, muonSelectionTypeValueMapProducer_cff::selectionType, selectionType_, AlCaHLTBitMon_QueryRunRegistry::string, superTriggerCellImpl_, superTriggerCellSelect, thresholdImpl_, and thresholdSelect.

10  fixedDataSizePerHGCROC_(conf.getParameter<bool>("fixedDataSizePerHGCROC")),
11  coarsenTriggerCells_(conf.getParameter<bool>("coarsenTriggerCells")) {
13  if (selectionType == "thresholdSelect") {
15  thresholdImpl_ = std::make_unique<HGCalConcentratorThresholdImpl>(conf);
16  } else if (selectionType == "bestChoiceSelect") {
18  bestChoiceImpl_ = std::make_unique<HGCalConcentratorBestChoiceImpl>(conf);
19  } else if (selectionType == "superTriggerCellSelect") {
21  superTriggerCellImpl_ = std::make_unique<HGCalConcentratorSuperTriggerCellImpl>(conf);
22  } else if (selectionType == "mixedBestChoiceSuperTriggerCell") {
24  bestChoiceImpl_ = std::make_unique<HGCalConcentratorBestChoiceImpl>(conf);
25  superTriggerCellImpl_ = std::make_unique<HGCalConcentratorSuperTriggerCellImpl>(conf);
26  } else {
27  throw cms::Exception("HGCTriggerParameterError")
28  << "Unknown type of concentrator selection '" << selectionType << "'";
29  }
30 
32  coarsenerImpl_ = std::make_unique<HGCalConcentratorCoarsenerImpl>(conf);
33  }
34 }
T getParameter(std::string const &) const
std::unique_ptr< HGCalConcentratorBestChoiceImpl > bestChoiceImpl_
HGCalProcessorBaseT< edm::Handle< l1t::HGCalTriggerCellBxCollection >, l1t::HGCalTriggerCellBxCollection > HGCalConcentratorProcessorBase
std::unique_ptr< HGCalConcentratorSuperTriggerCellImpl > superTriggerCellImpl_
std::unique_ptr< HGCalConcentratorThresholdImpl > thresholdImpl_
std::unique_ptr< HGCalConcentratorCoarsenerImpl > coarsenerImpl_

Member Function Documentation

void HGCalConcentratorProcessorSelection::run ( const edm::Handle< l1t::HGCalTriggerCellBxCollection > &  triggerCellCollInput,
l1t::HGCalTriggerCellBxCollection triggerCellCollOutput,
const edm::EventSetup es 
)
override

Definition at line 36 of file HGCalConcentratorProcessorSelection.cc.

References bestChoiceImpl_, bestChoiceSelect, coarsenerImpl_, coarsenTriggerCells_, HGCalTriggerTools::eventSetup(), fixedDataSizePerHGCROC_, HGCalProcessorBaseT< InputCollection, OutputCollection >::geometry_, HGCalTriggerGeometryBase::getLinksInModule(), HGCalTriggerGeometryBase::getModuleFromTriggerCell(), HGCalTriggerGeometryBase::getModuleSize(), HGCalTriggerTools::isEm(), kHighDensityThickness_, mixedBestChoiceSuperTriggerCell, BXVector< T >::push_back(), selectionType_, superTriggerCellImpl_, superTriggerCellSelect, Calorimetry_cff::thickness, HGCalTriggerTools::thicknessIndex(), thresholdImpl_, thresholdSelect, and triggerTools_.

38  {
39  if (thresholdImpl_)
40  thresholdImpl_->eventSetup(es);
41  if (bestChoiceImpl_)
42  bestChoiceImpl_->eventSetup(es);
44  superTriggerCellImpl_->eventSetup(es);
45  if (coarsenerImpl_)
46  coarsenerImpl_->eventSetup(es);
48 
49  const l1t::HGCalTriggerCellBxCollection& collInput = *triggerCellCollInput;
50 
51  std::unordered_map<uint32_t, std::vector<l1t::HGCalTriggerCell>> tc_modules;
52  for (const auto& trigCell : collInput) {
53  uint32_t module = geometry_->getModuleFromTriggerCell(trigCell.detId());
54  tc_modules[module].push_back(trigCell);
55  }
56 
57  for (const auto& module_trigcell : tc_modules) {
58  std::vector<l1t::HGCalTriggerCell> trigCellVecOutput;
59  std::vector<l1t::HGCalTriggerCell> trigCellVecCoarsened;
60 
61  int thickness = triggerTools_.thicknessIndex(module_trigcell.second.at(0).detId(), true);
62 
64  coarsenerImpl_->coarsen(module_trigcell.second, trigCellVecCoarsened);
65 
66  switch (selectionType_) {
67  case thresholdSelect:
68  thresholdImpl_->select(trigCellVecCoarsened, trigCellVecOutput);
69  break;
70  case bestChoiceSelect:
71  if (triggerTools_.isEm(module_trigcell.first)) {
72  bestChoiceImpl_->select(geometry_->getLinksInModule(module_trigcell.first),
73  geometry_->getModuleSize(module_trigcell.first),
74  module_trigcell.second,
75  trigCellVecOutput);
76  } else {
77  bestChoiceImpl_->select(geometry_->getLinksInModule(module_trigcell.first),
78  geometry_->getModuleSize(module_trigcell.first),
79  trigCellVecCoarsened,
80  trigCellVecOutput);
81  }
82  break;
84  superTriggerCellImpl_->select(trigCellVecCoarsened, trigCellVecOutput);
85  break;
87  if (triggerTools_.isEm(module_trigcell.first)) {
88  bestChoiceImpl_->select(geometry_->getLinksInModule(module_trigcell.first),
89  geometry_->getModuleSize(module_trigcell.first),
90  trigCellVecCoarsened,
91  trigCellVecOutput);
92  } else {
93  superTriggerCellImpl_->select(trigCellVecCoarsened, trigCellVecOutput);
94  }
95  break;
96  default:
97  // Should not happen, selection type checked in constructor
98  break;
99  }
100 
101  } else {
102  switch (selectionType_) {
103  case thresholdSelect:
104  thresholdImpl_->select(module_trigcell.second, trigCellVecOutput);
105  break;
106  case bestChoiceSelect:
107  bestChoiceImpl_->select(geometry_->getLinksInModule(module_trigcell.first),
108  geometry_->getModuleSize(module_trigcell.first),
109  module_trigcell.second,
110  trigCellVecOutput);
111  break;
113  superTriggerCellImpl_->select(module_trigcell.second, trigCellVecOutput);
114  break;
116  if (triggerTools_.isEm(module_trigcell.first)) {
117  bestChoiceImpl_->select(geometry_->getLinksInModule(module_trigcell.first),
118  geometry_->getModuleSize(module_trigcell.first),
119  module_trigcell.second,
120  trigCellVecOutput);
121  } else {
122  superTriggerCellImpl_->select(module_trigcell.second, trigCellVecOutput);
123  }
124  break;
125  default:
126  // Should not happen, selection type checked in constructor
127  break;
128  }
129  }
130 
131  for (const auto& trigCell : trigCellVecOutput) {
132  triggerCellCollOutput.push_back(0, trigCell);
133  }
134  }
135 }
std::unique_ptr< HGCalConcentratorBestChoiceImpl > bestChoiceImpl_
void eventSetup(const edm::EventSetup &)
const HGCalTriggerGeometryBase * geometry_
std::unique_ptr< HGCalConcentratorSuperTriggerCellImpl > superTriggerCellImpl_
std::unique_ptr< HGCalConcentratorThresholdImpl > thresholdImpl_
virtual unsigned getLinksInModule(const unsigned module_id) const =0
virtual unsigned getModuleSize(const unsigned module_id) const =0
int thicknessIndex(const DetId &, bool tc=false) const
virtual unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const =0
std::unique_ptr< HGCalConcentratorCoarsenerImpl > coarsenerImpl_
bool isEm(const DetId &) const
Definition: vlib.h:198
void push_back(int bx, T object)

Member Data Documentation

std::unique_ptr<HGCalConcentratorBestChoiceImpl> HGCalConcentratorProcessorSelection::bestChoiceImpl_
private
std::unique_ptr<HGCalConcentratorCoarsenerImpl> HGCalConcentratorProcessorSelection::coarsenerImpl_
private
bool HGCalConcentratorProcessorSelection::coarsenTriggerCells_
private
bool HGCalConcentratorProcessorSelection::fixedDataSizePerHGCROC_
private
int HGCalConcentratorProcessorSelection::kHighDensityThickness_ = 0
staticprivate

Definition at line 29 of file HGCalConcentratorProcessorSelection.h.

Referenced by run().

SelectionType HGCalConcentratorProcessorSelection::selectionType_
private
std::unique_ptr<HGCalConcentratorSuperTriggerCellImpl> HGCalConcentratorProcessorSelection::superTriggerCellImpl_
private
std::unique_ptr<HGCalConcentratorThresholdImpl> HGCalConcentratorProcessorSelection::thresholdImpl_
private
HGCalTriggerTools HGCalConcentratorProcessorSelection::triggerTools_
private

Definition at line 36 of file HGCalConcentratorProcessorSelection.h.

Referenced by run().