CMS 3D CMS Logo

HGCalVFESummationImpl.cc
Go to the documentation of this file.
2 
4  : thickness_corrections_(conf.getParameter<std::vector<double>>("ThicknessCorrections")),
5  lsb_silicon_fC_(conf.getParameter<double>("siliconCellLSB_fC")),
6  lsb_scintillator_MIP_(conf.getParameter<double>("scintillatorCellLSB_MIP")) {
7  const unsigned nThickness = 3;
8  if (thickness_corrections_.size() != nThickness) {
9  throw cms::Exception("Configuration")
10  << thickness_corrections_.size() << " thickness corrections are given instead of " << nThickness
11  << " (the number of sensor thicknesses)";
12  }
14  conf.getParameter<edm::ParameterSet>("noiseSilicon").getParameter<std::vector<double>>("values");
15  if (thresholds_silicon_.size() != nThickness) {
16  throw cms::Exception("Configuration") << thresholds_silicon_.size() << " silicon thresholds are given instead of "
17  << nThickness << " (the number of sensor thicknesses)";
18  }
19  threshold_scintillator_ = conf.getParameter<edm::ParameterSet>("noiseScintillator").getParameter<double>("noise_MIP");
20  const auto threshold = conf.getParameter<double>("noiseThreshold");
23  return noise * threshold;
24  });
26 }
27 
29  const std::vector<std::pair<DetId, uint32_t>>& linearized_dataframes,
30  std::unordered_map<uint32_t, uint32_t>& payload) {
31  if (linearized_dataframes.empty())
32  return;
33  // sum energies in trigger cells
34  for (const auto& frame : linearized_dataframes) {
35  DetId cellid(frame.first);
36  uint32_t value = frame.second;
37 
38  // Apply noise threshold before summing into trigger cells
39  if (triggerTools_.isSilicon(cellid)) {
43  } else if (triggerTools_.isScintillator(cellid)) {
45  }
46  if (value == 0)
47  continue;
48 
49  // find trigger cell associated to cell
50  uint32_t tcid = geometry.getTriggerCellFromCell(cellid);
51  payload.emplace(tcid, 0); // do nothing if key exists already
52 
53  // equalize value among cell thicknesses for Silicon parts
54  if (triggerTools_.isSilicon(cellid) && !triggerTools_.isNose(cellid)) {
56  double thickness_correction = thickness_corrections_.at(thickness);
57  value = (double)value * thickness_correction;
58  }
59 
60  // sums energy for the same trigger cell id
61  payload[tcid] += value; // 32 bits integer should be largely enough
62  }
63 }
HGCalTriggerGeometryBase
Definition: HGCalTriggerGeometryBase.h:19
HGCalVFESummationImpl::triggerCellSums
void triggerCellSums(const HGCalTriggerGeometryBase &, const std::vector< std::pair< DetId, uint32_t > > &, std::unordered_map< uint32_t, uint32_t > &payload)
Definition: HGCalVFESummationImpl.cc:28
HGCalVFESummationImpl::lsb_silicon_fC_
double lsb_silicon_fC_
Definition: HGCalVFESummationImpl.h:25
geometry
Definition: geometry.py:1
HGCalVFESummationImpl::thresholds_silicon_
std::vector< double > thresholds_silicon_
Definition: HGCalVFESummationImpl.h:27
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
DetId
Definition: DetId.h:17
HGCalVFESummationImpl::HGCalVFESummationImpl
HGCalVFESummationImpl(const edm::ParameterSet &conf)
Definition: HGCalVFESummationImpl.cc:3
HGCalVFESummationImpl::lsb_scintillator_MIP_
double lsb_scintillator_MIP_
Definition: HGCalVFESummationImpl.h:26
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:114
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
jets_cff.payload
payload
Definition: jets_cff.py:34
HGCalTriggerTools::isNose
bool isNose(const DetId &) const
Definition: HGCalTriggerTools.cc:170
edm::ParameterSet
Definition: ParameterSet.h:36
value
Definition: value.py:1
HGCalVFESummationImpl.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
std
Definition: JetResolutionObject.h:76
relativeConstraints.value
value
Definition: relativeConstraints.py:53
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
Exception
Definition: hltDiff.cc:246
HGCalVFESummationImpl::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalVFESummationImpl.h:29
HGCalVFESummationImpl::threshold_scintillator_
double threshold_scintillator_
Definition: HGCalVFESummationImpl.h:28
hgchebackDigitizer_cfi.noise
noise
Definition: hgchebackDigitizer_cfi.py:42
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
HGCalVFESummationImpl::thickness_corrections_
std::vector< double > thickness_corrections_
Definition: HGCalVFESummationImpl.h:24