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, std::pair< l1t::HGCalTriggerCellBxCollection, l1t::HGCalTriggerSumsBxCollection > &triggerCollOutput, 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, noSelection }
 

Private Attributes

std::unique_ptr< HGCalConcentratorBestChoiceImplbestChoiceImpl_
 
std::unique_ptr< HGCalConcentratorCoarsenerImplcoarsenerImpl_
 
std::vector< unsigned > coarsenTriggerCells_
 
bool fixedDataSizePerHGCROC_
 
std::vector< SelectionTypeselectionType_
 
std::unique_ptr< HGCalConcentratorSuperTriggerCellImplsuperTriggerCellImpl_
 
std::unique_ptr< HGCalConcentratorThresholdImplthresholdImpl_
 
HGCalTriggerTools triggerTools_
 
std::unique_ptr< HGCalConcentratorTrigSumImpltrigSumImpl_
 

Static Private Attributes

static constexpr int kHighDensityThickness_ = 0
 
static constexpr int kNSubDetectors_ = 3
 

Additional Inherited Members

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

Detailed Description

Definition at line 17 of file HGCalConcentratorProcessorSelection.h.

Member Enumeration Documentation

◆ SelectionType

Enumerator
thresholdSelect 
bestChoiceSelect 
superTriggerCellSelect 
noSelection 

Definition at line 19 of file HGCalConcentratorProcessorSelection.h.

Constructor & Destructor Documentation

◆ HGCalConcentratorProcessorSelection()

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

Definition at line 8 of file HGCalConcentratorProcessorSelection.cc.

10  fixedDataSizePerHGCROC_(conf.getParameter<bool>("fixedDataSizePerHGCROC")),
11  coarsenTriggerCells_(conf.getParameter<std::vector<unsigned>>("coarsenTriggerCells")),
13  std::vector<std::string> selectionType(conf.getParameter<std::vector<std::string>>("Method"));
15  throw cms::Exception("HGCTriggerParameterError")
16  << "Inconsistent number of sub-detectors (should be " << kNSubDetectors_ << ")";
17  }
18 
19  for (int subdet = 0; subdet < kNSubDetectors_; subdet++) {
20  if (selectionType[subdet] == "thresholdSelect") {
22  if (!thresholdImpl_)
23  thresholdImpl_ = std::make_unique<HGCalConcentratorThresholdImpl>(conf);
24  if (!trigSumImpl_)
25  trigSumImpl_ = std::make_unique<HGCalConcentratorTrigSumImpl>(conf);
26  } else if (selectionType[subdet] == "bestChoiceSelect") {
28  if (!bestChoiceImpl_)
29  bestChoiceImpl_ = std::make_unique<HGCalConcentratorBestChoiceImpl>(conf);
30  if (!trigSumImpl_)
31  trigSumImpl_ = std::make_unique<HGCalConcentratorTrigSumImpl>(conf);
32  } else if (selectionType[subdet] == "superTriggerCellSelect") {
35  superTriggerCellImpl_ = std::make_unique<HGCalConcentratorSuperTriggerCellImpl>(conf);
36  } else if (selectionType[subdet] == "noSelection") {
37  selectionType_[subdet] = noSelection;
38  } else {
39  throw cms::Exception("HGCTriggerParameterError")
40  << "Unknown type of concentrator selection '" << selectionType[subdet] << "'";
41  }
42  }
43 
44  if (std::find(coarsenTriggerCells_.begin(), coarsenTriggerCells_.end(), true) != coarsenTriggerCells_.end() ||
46  coarsenerImpl_ = std::make_unique<HGCalConcentratorCoarsenerImpl>(conf);
47  }
48 }

References bestChoiceImpl_, bestChoiceSelect, coarsenerImpl_, coarsenTriggerCells_, Exception, spr::find(), fixedDataSizePerHGCROC_, edm::ParameterSet::getParameter(), kNSubDetectors_, noSelection, muonSelectionTypeValueMapProducer_cff::selectionType, selectionType_, superTriggerCellImpl_, superTriggerCellSelect, thresholdImpl_, thresholdSelect, and trigSumImpl_.

Member Function Documentation

◆ run()

void HGCalConcentratorProcessorSelection::run ( const edm::Handle< l1t::HGCalTriggerCellBxCollection > &  triggerCellCollInput,
std::pair< l1t::HGCalTriggerCellBxCollection, l1t::HGCalTriggerSumsBxCollection > &  triggerCollOutput,
const edm::EventSetup es 
)
override

Definition at line 50 of file HGCalConcentratorProcessorSelection.cc.

53  {
54  if (thresholdImpl_)
55  thresholdImpl_->eventSetup(es);
56  if (bestChoiceImpl_)
57  bestChoiceImpl_->eventSetup(es);
59  superTriggerCellImpl_->eventSetup(es);
60  if (coarsenerImpl_)
61  coarsenerImpl_->eventSetup(es);
62  if (trigSumImpl_)
63  trigSumImpl_->eventSetup(es);
65 
66  auto& triggerCellCollOutput = triggerCollOutput.first;
67  auto& triggerSumCollOutput = triggerCollOutput.second;
68 
69  const l1t::HGCalTriggerCellBxCollection& collInput = *triggerCellCollInput;
70 
71  std::unordered_map<uint32_t, std::vector<l1t::HGCalTriggerCell>> tc_modules;
72  for (const auto& trigCell : collInput) {
73  uint32_t module = geometry_->getModuleFromTriggerCell(trigCell.detId());
74  tc_modules[module].push_back(trigCell);
75  }
76 
77  for (const auto& module_trigcell : tc_modules) {
78  std::vector<l1t::HGCalTriggerCell> trigCellVecOutput;
79  std::vector<l1t::HGCalTriggerCell> trigCellVecCoarsened;
80  std::vector<l1t::HGCalTriggerCell> trigCellVecNotSelected;
81  std::vector<l1t::HGCalTriggerSums> trigSumsVecOutput;
82 
83  int thickness = triggerTools_.thicknessIndex(module_trigcell.second.at(0).detId(), true);
84 
85  HGCalTriggerTools::SubDetectorType subdet = triggerTools_.getSubDetectorType(module_trigcell.second.at(0).detId());
86 
88  coarsenerImpl_->coarsen(module_trigcell.second, trigCellVecCoarsened);
89 
90  switch (selectionType_[subdet]) {
91  case thresholdSelect:
92  thresholdImpl_->select(trigCellVecCoarsened, trigCellVecOutput, trigCellVecNotSelected);
93  break;
94  case bestChoiceSelect:
95  if (triggerTools_.isEm(module_trigcell.first)) {
96  bestChoiceImpl_->select(geometry_->getLinksInModule(module_trigcell.first),
97  geometry_->getModuleSize(module_trigcell.first),
98  module_trigcell.second,
99  trigCellVecOutput,
100  trigCellVecNotSelected);
101  } else {
102  bestChoiceImpl_->select(geometry_->getLinksInModule(module_trigcell.first),
103  geometry_->getModuleSize(module_trigcell.first),
104  trigCellVecCoarsened,
105  trigCellVecOutput,
106  trigCellVecNotSelected);
107  }
108  break;
110  superTriggerCellImpl_->select(trigCellVecCoarsened, trigCellVecOutput);
111  break;
112  case noSelection:
113  trigCellVecOutput = trigCellVecCoarsened;
114  break;
115  default:
116  // Should not happen, selection type checked in constructor
117  break;
118  }
119 
120  } else {
121  switch (selectionType_[subdet]) {
122  case thresholdSelect:
123  thresholdImpl_->select(module_trigcell.second, trigCellVecOutput, trigCellVecNotSelected);
124  break;
125  case bestChoiceSelect:
126  bestChoiceImpl_->select(geometry_->getLinksInModule(module_trigcell.first),
127  geometry_->getModuleSize(module_trigcell.first),
128  module_trigcell.second,
129  trigCellVecOutput,
130  trigCellVecNotSelected);
131  break;
133  superTriggerCellImpl_->select(module_trigcell.second, trigCellVecOutput);
134  break;
135  case noSelection:
136  trigCellVecOutput = module_trigcell.second;
137  break;
138  default:
139  // Should not happen, selection type checked in constructor
140  break;
141  }
142  }
143 
144  // trigger sum
145  if (trigSumImpl_) {
146  trigSumImpl_->doSum(module_trigcell.first, trigCellVecNotSelected, trigSumsVecOutput);
147  }
148 
149  for (const auto& trigCell : trigCellVecOutput) {
150  triggerCellCollOutput.push_back(0, trigCell);
151  }
152  for (const auto& trigSums : trigSumsVecOutput) {
153  triggerSumCollOutput.push_back(0, trigSums);
154  }
155  }
156 }

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

Member Data Documentation

◆ bestChoiceImpl_

std::unique_ptr<HGCalConcentratorBestChoiceImpl> HGCalConcentratorProcessorSelection::bestChoiceImpl_
private

◆ coarsenerImpl_

std::unique_ptr<HGCalConcentratorCoarsenerImpl> HGCalConcentratorProcessorSelection::coarsenerImpl_
private

◆ coarsenTriggerCells_

std::vector<unsigned> HGCalConcentratorProcessorSelection::coarsenTriggerCells_
private

◆ fixedDataSizePerHGCROC_

bool HGCalConcentratorProcessorSelection::fixedDataSizePerHGCROC_
private

◆ kHighDensityThickness_

constexpr int HGCalConcentratorProcessorSelection::kHighDensityThickness_ = 0
staticconstexprprivate

Definition at line 31 of file HGCalConcentratorProcessorSelection.h.

Referenced by run().

◆ kNSubDetectors_

constexpr int HGCalConcentratorProcessorSelection::kNSubDetectors_ = 3
staticconstexprprivate

◆ selectionType_

std::vector<SelectionType> HGCalConcentratorProcessorSelection::selectionType_
private

◆ superTriggerCellImpl_

std::unique_ptr<HGCalConcentratorSuperTriggerCellImpl> HGCalConcentratorProcessorSelection::superTriggerCellImpl_
private

◆ thresholdImpl_

std::unique_ptr<HGCalConcentratorThresholdImpl> HGCalConcentratorProcessorSelection::thresholdImpl_
private

◆ triggerTools_

HGCalTriggerTools HGCalConcentratorProcessorSelection::triggerTools_
private

Definition at line 42 of file HGCalConcentratorProcessorSelection.h.

Referenced by run().

◆ trigSumImpl_

std::unique_ptr<HGCalConcentratorTrigSumImpl> HGCalConcentratorProcessorSelection::trigSumImpl_
private
HGCalTriggerTools::eventSetup
void eventSetup(const edm::EventSetup &)
Definition: HGCalTriggerTools.cc:35
HGCalConcentratorProcessorSelection::coarsenTriggerCells_
std::vector< unsigned > coarsenTriggerCells_
Definition: HGCalConcentratorProcessorSelection.h:30
HGCalConcentratorProcessorSelection::kHighDensityThickness_
static constexpr int kHighDensityThickness_
Definition: HGCalConcentratorProcessorSelection.h:31
HGCalConcentratorProcessorSelection::thresholdImpl_
std::unique_ptr< HGCalConcentratorThresholdImpl > thresholdImpl_
Definition: HGCalConcentratorProcessorSelection.h:36
HGCalConcentratorProcessorSelection::kNSubDetectors_
static constexpr int kNSubDetectors_
Definition: HGCalConcentratorProcessorSelection.h:32
HGCalTriggerTools::thicknessIndex
int thicknessIndex(const DetId &, bool tc=false) const
Definition: HGCalTriggerTools.cc:233
HGCalConcentratorProcessorSelection::fixedDataSizePerHGCROC_
bool fixedDataSizePerHGCROC_
Definition: HGCalConcentratorProcessorSelection.h:29
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
HGCalConcentratorProcessorSelection::superTriggerCellImpl_
std::unique_ptr< HGCalConcentratorSuperTriggerCellImpl > superTriggerCellImpl_
Definition: HGCalConcentratorProcessorSelection.h:38
HGCalTriggerGeometryBase::getLinksInModule
virtual unsigned getLinksInModule(const unsigned module_id) const =0
BXVector
Definition: BXVector.h:15
HGCalConcentratorProcessorSelection::bestChoiceSelect
Definition: HGCalConcentratorProcessorSelection.h:19
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:114
HGCalTriggerTools::getSubDetectorType
SubDetectorType getSubDetectorType(const DetId &id) const
Definition: HGCalTriggerTools.cc:198
HGCalTriggerTools::isEm
bool isEm(const DetId &) const
Definition: HGCalTriggerTools.cc:151
HGCalConcentratorProcessorSelection::superTriggerCellSelect
Definition: HGCalConcentratorProcessorSelection.h:19
HGCalConcentratorProcessorSelection::coarsenerImpl_
std::unique_ptr< HGCalConcentratorCoarsenerImpl > coarsenerImpl_
Definition: HGCalConcentratorProcessorSelection.h:39
HGCalProcessorBaseT::geometry_
const HGCalTriggerGeometryBase * geometry_
Definition: HGCalProcessorBaseT.h:24
module
Definition: vlib.h:198
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
HGCalConcentratorProcessorBase
HGCalProcessorBaseT< edm::Handle< l1t::HGCalTriggerCellBxCollection >, std::pair< l1t::HGCalTriggerCellBxCollection, l1t::HGCalTriggerSumsBxCollection > > HGCalConcentratorProcessorBase
Definition: HGCalProcessorBase.h:19
HGCalConcentratorProcessorSelection::trigSumImpl_
std::unique_ptr< HGCalConcentratorTrigSumImpl > trigSumImpl_
Definition: HGCalConcentratorProcessorSelection.h:40
HGCalTriggerGeometryBase::getModuleFromTriggerCell
virtual unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const =0
HGCalTriggerTools::SubDetectorType
SubDetectorType
Definition: HGCalTriggerTools.h:88
Exception
Definition: hltDiff.cc:246
HGCalConcentratorProcessorSelection::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalConcentratorProcessorSelection.h:42
HGCalConcentratorProcessorSelection::noSelection
Definition: HGCalConcentratorProcessorSelection.h:19
HGCalConcentratorProcessorSelection::thresholdSelect
Definition: HGCalConcentratorProcessorSelection.h:19
HGCalConcentratorProcessorSelection::selectionType_
std::vector< SelectionType > selectionType_
Definition: HGCalConcentratorProcessorSelection.h:34
HGCalTriggerGeometryBase::getModuleSize
virtual unsigned getModuleSize(const unsigned module_id) const =0
muonSelectionTypeValueMapProducer_cff.selectionType
selectionType
Definition: muonSelectionTypeValueMapProducer_cff.py:6
HGCalConcentratorProcessorSelection::bestChoiceImpl_
std::unique_ptr< HGCalConcentratorBestChoiceImpl > bestChoiceImpl_
Definition: HGCalConcentratorProcessorSelection.h:37