CMS 3D CMS Logo

HGCalConcentratorSelectionImpl.cc
Go to the documentation of this file.
2 
4  : nData_(conf.getParameter<uint32_t>("NData")),
5  nCellsInModule_(conf.getParameter<uint32_t>("MaxCellsInModule")),
6  linLSB_(conf.getParameter<double>("linLSB")),
7  adcsaturationBH_(conf.getParameter<double>("adcsaturationBH")),
8  adcnBitsBH_(conf.getParameter<uint32_t>("adcnBitsBH")),
9  TCThreshold_fC_(conf.getParameter<double>("TCThreshold_fC")),
10  TCThresholdBH_MIP_(conf.getParameter<double>("TCThresholdBH_MIP")),
11  triggercell_threshold_silicon_(conf.getParameter<double>("triggercell_threshold_silicon")),
12  triggercell_threshold_scintillator_(conf.getParameter<double>("triggercell_threshold_scintillator")) {
13  // Cannot have more selected cells than the max number of cells
14  if (nData_ > nCellsInModule_)
19 }
20 
21 void HGCalConcentratorSelectionImpl::thresholdSelectImpl(const std::vector<l1t::HGCalTriggerCell>& trigCellVecInput,
22  std::vector<l1t::HGCalTriggerCell>& trigCellVecOutput) {
23  for (const auto& trigCell : trigCellVecInput) {
24  bool isScintillator = triggerTools_.isScintillator(trigCell.detId());
25  int threshold = (isScintillator ? TCThresholdBH_ADC_ : TCThreshold_ADC_);
26  double triggercell_threshold =
28 
29  if ((trigCell.hwPt() >= threshold) && (trigCell.mipPt() >= triggercell_threshold)) {
30  trigCellVecOutput.push_back(trigCell);
31  }
32  }
33 }
34 
35 void HGCalConcentratorSelectionImpl::bestChoiceSelectImpl(const std::vector<l1t::HGCalTriggerCell>& trigCellVecInput,
36  std::vector<l1t::HGCalTriggerCell>& trigCellVecOutput) {
37  trigCellVecOutput = trigCellVecInput;
38  // sort, reverse order
39  std::sort(trigCellVecOutput.begin(),
40  trigCellVecOutput.end(),
41  [](const l1t::HGCalTriggerCell& a, const l1t::HGCalTriggerCell& b) -> bool { return a.hwPt() > b.hwPt(); });
42 
43  // keep only the first trigger cells
44  if (trigCellVecOutput.size() > nData_)
45  trigCellVecOutput.resize(nData_);
46 }
bool isScintillator(const DetId &id) const
int hwPt() const
Definition: L1Candidate.h:48
HGCalConcentratorSelectionImpl(const edm::ParameterSet &conf)
double b
Definition: hdecay.h:120
void thresholdSelectImpl(const std::vector< l1t::HGCalTriggerCell > &trigCellVecInput, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput)
void bestChoiceSelectImpl(const std::vector< l1t::HGCalTriggerCell > &trigCellVecInput, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput)
double a
Definition: hdecay.h:121
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40