CMS 3D CMS Logo

HGCalConcentratorSelectionImpl.cc
Go to the documentation of this file.
2 
5  nData_(conf.getParameter<uint32_t>("NData")),
6  nCellsInModule_(conf.getParameter<uint32_t>("MaxCellsInModule")),
7  linLSB_(conf.getParameter<double>("linLSB")),
8  adcsaturationBH_(conf.getParameter<double>("adcsaturationBH")),
9  adcnBitsBH_(conf.getParameter<uint32_t>("adcnBitsBH")),
10  TCThreshold_fC_(conf.getParameter<double>("TCThreshold_fC")),
11  TCThresholdBH_MIP_(conf.getParameter<double>("TCThresholdBH_MIP")),
12  triggercell_threshold_silicon_( conf.getParameter<double>("triggercell_threshold_silicon") ),
13  triggercell_threshold_scintillator_( conf.getParameter<double>("triggercell_threshold_scintillator"))
14 {
15  // Cannot have more selected cells than the max number of cells
20 }
21 
22 void
24 thresholdSelectImpl(const std::vector<l1t::HGCalTriggerCell>& trigCellVecInput, std::vector<l1t::HGCalTriggerCell>& trigCellVecOutput)
25 {
26  for (const auto& trigCell: trigCellVecInput){
27 
28  int threshold = (HGCalDetId(trigCell.detId()).subdetId()==ForwardSubdetector::HGCHEB ? TCThresholdBH_ADC_ : TCThreshold_ADC_);
29  double triggercell_threshold = (HGCalDetId(trigCell.detId()).subdetId()==HGCHEB ? triggercell_threshold_scintillator_ : triggercell_threshold_silicon_);
30 
31  if ((trigCell.hwPt() >= threshold) && (trigCell.mipPt() >= triggercell_threshold)){
32  trigCellVecOutput.push_back(trigCell);
33  }
34  }
35 }
36 
37 void
39 bestChoiceSelectImpl(const std::vector<l1t::HGCalTriggerCell>& trigCellVecInput, std::vector<l1t::HGCalTriggerCell>& trigCellVecOutput)
40 {
41  trigCellVecOutput = trigCellVecInput;
42  // sort, reverse order
43  std::sort(trigCellVecOutput.begin(), trigCellVecOutput.end(),
44  [](const l1t::HGCalTriggerCell& a,
45  const l1t::HGCalTriggerCell& b) -> bool
46  {
47  return a.hwPt() > b.hwPt();
48  }
49  );
50 
51  // keep only the first trigger cells
52  if(trigCellVecOutput.size()>nData_) trigCellVecOutput.resize(nData_);
53 
54 }
55 
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