CMS 3D CMS Logo

HGCalVFESummationImpl.cc
Go to the documentation of this file.
2 
4  : lsb_silicon_fC_(conf.getParameter<double>("siliconCellLSB_fC")),
5  lsb_scintillator_MIP_(conf.getParameter<double>("scintillatorCellLSB_MIP")) {
6  constexpr unsigned nThickness = 3;
8  conf.getParameter<edm::ParameterSet>("noiseSilicon").getParameter<std::vector<double>>("values");
9  if (thresholds_silicon_.size() != nThickness) {
10  throw cms::Exception("Configuration") << thresholds_silicon_.size() << " silicon thresholds are given instead of "
11  << nThickness << " (the number of sensor thicknesses)";
12  }
13  threshold_scintillator_ = conf.getParameter<edm::ParameterSet>("noiseScintillator").getParameter<double>("noise_MIP");
14  const auto threshold = conf.getParameter<double>("noiseThreshold");
17  return noise * threshold;
18  });
20 }
21 
22 void HGCalVFESummationImpl::triggerCellSums(const std::vector<std::pair<DetId, uint32_t>>& input_dataframes,
23  std::unordered_map<uint32_t, uint32_t>& triggercells) {
24  if (input_dataframes.empty())
25  return;
26  // sum energies in trigger cells
27  for (const auto& [cellid, value] : input_dataframes) {
28  // Apply noise threshold before summing into trigger cells
29  uint32_t value_zero_suppressed = value;
30  if (triggerTools_.isSilicon(cellid)) {
33  value_zero_suppressed = (value * lsb_silicon_fC_ > threshold ? value : 0);
34  } else if (triggerTools_.isScintillator(cellid)) {
35  value_zero_suppressed = (value * lsb_scintillator_MIP_ > threshold_scintillator_ ? value : 0);
36  }
37  if (value_zero_suppressed == 0)
38  continue;
39 
40  // find trigger cell associated to cell
41  uint32_t tcid = triggerTools_.getTriggerGeometry()->getTriggerCellFromCell(cellid);
42  triggercells.emplace(tcid, 0); // do nothing if key exists already
43 
44  // sums energy for the same trigger cell id
45  triggercells[tcid] += value_zero_suppressed; // 32 bits integer should be largely enough
46  }
47 }
HGCalVFESummationImpl::lsb_silicon_fC_
double lsb_silicon_fC_
Definition: HGCalVFESummationImpl.h:20
HGCalVFESummationImpl::thresholds_silicon_
std::vector< double > thresholds_silicon_
Definition: HGCalVFESummationImpl.h:22
HGCalTriggerTools::thicknessIndex
int thicknessIndex(const DetId &, bool tc=false) const
Definition: HGCalTriggerTools.cc:233
HGCalTriggerTools::isScintillator
bool isScintillator(const DetId &id) const
Definition: HGCalTriggerTools.h:46
HGCalTriggerTools::isSilicon
bool isSilicon(const DetId &) const
Definition: HGCalTriggerTools.cc:181
HGCalVFESummationImpl::HGCalVFESummationImpl
HGCalVFESummationImpl(const edm::ParameterSet &conf)
Definition: HGCalVFESummationImpl.cc:3
HGCalTriggerTools::getTriggerGeometry
const HGCalTriggerGeometryBase * getTriggerGeometry() const
Definition: HGCalTriggerTools.h:69
HGCalVFESummationImpl::lsb_scintillator_MIP_
double lsb_scintillator_MIP_
Definition: HGCalVFESummationImpl.h:21
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:115
HGCalVFESummationImpl::triggerCellSums
void triggerCellSums(const std::vector< std::pair< DetId, uint32_t > > &, std::unordered_map< uint32_t, uint32_t > &)
Definition: HGCalVFESummationImpl.cc:22
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
HGCalTriggerGeometryBase::getTriggerCellFromCell
virtual unsigned getTriggerCellFromCell(const unsigned cell_det_id) const =0
edm::ParameterSet
Definition: ParameterSet.h:47
value
Definition: value.py:1
HGCalVFESummationImpl.h
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
gpuVertexFinder::noise
__shared__ int noise
Definition: gpuFitVertices.h:50
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Exception
Definition: hltDiff.cc:245
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCalVFESummationImpl::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalVFESummationImpl.h:25
HGCalVFESummationImpl::threshold_scintillator_
double threshold_scintillator_
Definition: HGCalVFESummationImpl.h:23
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430