CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HGCalVFESummationImpl Class Reference

#include <HGCalVFESummationImpl.h>

Public Member Functions

 HGCalVFESummationImpl (const edm::ParameterSet &conf)
 
void setGeometry (const HGCalTriggerGeometryBase *const geom)
 
void triggerCellSums (const std::vector< std::pair< DetId, uint32_t > > &, std::unordered_map< uint32_t, uint32_t > &)
 

Private Attributes

double lsb_scintillator_MIP_
 
double lsb_silicon_fC_
 
double threshold_scintillator_
 
std::vector< double > thresholds_silicon_
 
HGCalTriggerTools triggerTools_
 

Detailed Description

Definition at line 12 of file HGCalVFESummationImpl.h.

Constructor & Destructor Documentation

◆ HGCalVFESummationImpl()

HGCalVFESummationImpl::HGCalVFESummationImpl ( const edm::ParameterSet conf)

Definition at line 3 of file HGCalVFESummationImpl.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), Exception, edm::ParameterSet::getParameter(), hgchebackDigitizer_cfi::noise, DiMuonV_cfg::threshold, threshold_scintillator_, thresholds_silicon_, and HcalDetIdTransform::transform().

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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::vector< double > thresholds_silicon_
unsigned transform(const HcalDetId &id, unsigned transformCode)

Member Function Documentation

◆ setGeometry()

void HGCalVFESummationImpl::setGeometry ( const HGCalTriggerGeometryBase *const  geom)
inline

Definition at line 16 of file HGCalVFESummationImpl.h.

References relativeConstraints::geom, HGCalTriggerTools::setGeometry(), and triggerTools_.

HGCalTriggerTools triggerTools_
void setGeometry(const HGCalTriggerGeometryBase *const)

◆ triggerCellSums()

void HGCalVFESummationImpl::triggerCellSums ( const std::vector< std::pair< DetId, uint32_t > > &  ,
std::unordered_map< uint32_t, uint32_t > &   
)

Definition at line 22 of file HGCalVFESummationImpl.cc.

References HGCalTriggerGeometryBase::getTriggerCellFromCell(), HGCalTriggerTools::getTriggerGeometry(), HGCalTriggerTools::isScintillator(), HGCalTriggerTools::isSilicon(), lsb_scintillator_MIP_, lsb_silicon_fC_, Calorimetry_cff::thickness, HGCalTriggerTools::thicknessIndex(), DiMuonV_cfg::threshold, threshold_scintillator_, thresholds_silicon_, triggerTools_, and relativeConstraints::value.

23  {
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 }
bool isScintillator(const DetId &id) const
bool isSilicon(const DetId &) const
HGCalTriggerTools triggerTools_
int thicknessIndex(const DetId &) const
const HGCalTriggerGeometryBase * getTriggerGeometry() const
virtual unsigned getTriggerCellFromCell(const unsigned cell_det_id) const =0
std::vector< double > thresholds_silicon_
Definition: value.py:1

Member Data Documentation

◆ lsb_scintillator_MIP_

double HGCalVFESummationImpl::lsb_scintillator_MIP_
private

Definition at line 21 of file HGCalVFESummationImpl.h.

Referenced by triggerCellSums().

◆ lsb_silicon_fC_

double HGCalVFESummationImpl::lsb_silicon_fC_
private

Definition at line 20 of file HGCalVFESummationImpl.h.

Referenced by triggerCellSums().

◆ threshold_scintillator_

double HGCalVFESummationImpl::threshold_scintillator_
private

Definition at line 23 of file HGCalVFESummationImpl.h.

Referenced by HGCalVFESummationImpl(), and triggerCellSums().

◆ thresholds_silicon_

std::vector<double> HGCalVFESummationImpl::thresholds_silicon_
private

Definition at line 22 of file HGCalVFESummationImpl.h.

Referenced by HGCalVFESummationImpl(), and triggerCellSums().

◆ triggerTools_

HGCalTriggerTools HGCalVFESummationImpl::triggerTools_
private

Definition at line 25 of file HGCalVFESummationImpl.h.

Referenced by setGeometry(), and triggerCellSums().