CMS 3D CMS Logo

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

#include <HGCalVFESummationImpl.h>

Public Member Functions

void eventSetup (const edm::EventSetup &es)
 
 HGCalVFESummationImpl (const edm::ParameterSet &conf)
 
void triggerCellSums (const HGCalTriggerGeometryBase &, const std::vector< std::pair< DetId, uint32_t > > &, std::unordered_map< uint32_t, uint32_t > &payload)
 

Private Attributes

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

Detailed Description

Definition at line 14 of file HGCalVFESummationImpl.h.

Constructor & Destructor Documentation

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

Definition at line 3 of file HGCalVFESummationImpl.cc.

References Exception, thickness_corrections_, and thresholds_silicon_.

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  thresholds_silicon_(conf.getParameter<std::vector<double>>("thresholdsSilicon")),
8  threshold_scintillator_(conf.getParameter<double>("thresholdScintillator")) {
9  const unsigned nThickness = 3;
10  if (thickness_corrections_.size() != nThickness) {
11  throw cms::Exception("Configuration")
12  << thickness_corrections_.size() << " thickness corrections are given instead of " << nThickness
13  << " (the number of sensor thicknesses)";
14  }
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 }
T getParameter(std::string const &) const
std::vector< double > thresholds_silicon_
std::vector< double > thickness_corrections_

Member Function Documentation

void HGCalVFESummationImpl::eventSetup ( const edm::EventSetup es)
inline

Definition at line 18 of file HGCalVFESummationImpl.h.

References HGCalTriggerTools::eventSetup(), jets_cff::payload, triggerCellSums(), and triggerTools_.

void eventSetup(const edm::EventSetup &)
HGCalTriggerTools triggerTools_
void HGCalVFESummationImpl::triggerCellSums ( const HGCalTriggerGeometryBase ,
const std::vector< std::pair< DetId, uint32_t > > &  ,
std::unordered_map< uint32_t, uint32_t > &  payload 
)

Definition at line 21 of file HGCalVFESummationImpl.cc.

References HGCalTriggerGeometryBase::getTriggerCellFromCell(), HGCalTriggerTools::isScintillator(), HGCalTriggerTools::isSilicon(), lsb_scintillator_MIP_, lsb_silicon_fC_, thickness_corrections_, HGCalTriggerTools::thicknessIndex(), electronIdCutBased_cfi::threshold, threshold_scintillator_, thresholds_silicon_, triggerTools_, and relativeConstraints::value.

Referenced by eventSetup().

23  {
24  if (linearized_dataframes.empty())
25  return;
26  // sum energies in trigger cells
27  for (const auto& frame : linearized_dataframes) {
28  DetId cellid(frame.first);
29  uint32_t value = frame.second;
30 
31  // Apply noise threshold before summing into trigger cells
32  if (triggerTools_.isSilicon(cellid)) {
33  int thickness = triggerTools_.thicknessIndex(cellid);
34  double threshold = thresholds_silicon_.at(thickness);
35  value = (value * lsb_silicon_fC_ > threshold ? value : 0);
36  } else if (triggerTools_.isScintillator(cellid)) {
37  value = (value * lsb_scintillator_MIP_ > threshold_scintillator_ ? value : 0);
38  }
39  if (value == 0)
40  continue;
41 
42  // find trigger cell associated to cell
43  uint32_t tcid = geometry.getTriggerCellFromCell(cellid);
44  payload.emplace(tcid, 0); // do nothing if key exists already
45 
46  // equalize value among cell thicknesses for Silicon parts
47  if (triggerTools_.isSilicon(cellid)) {
48  int thickness = triggerTools_.thicknessIndex(cellid);
49  double thickness_correction = thickness_corrections_.at(thickness);
50  value = (double)value * thickness_correction;
51  }
52 
53  // sums energy for the same trigger cell id
54  payload[tcid] += value; // 32 bits integer should be largely enough
55  }
56 }
bool isScintillator(const DetId &id) const
HGCalTriggerTools triggerTools_
std::vector< double > thresholds_silicon_
std::vector< double > thickness_corrections_
Definition: value.py:1
Definition: DetId.h:18
int thicknessIndex(const DetId &, bool tc=false) const
bool isSilicon(const DetId &) const

Member Data Documentation

double HGCalVFESummationImpl::lsb_scintillator_MIP_
private

Definition at line 26 of file HGCalVFESummationImpl.h.

Referenced by triggerCellSums().

double HGCalVFESummationImpl::lsb_silicon_fC_
private

Definition at line 25 of file HGCalVFESummationImpl.h.

Referenced by triggerCellSums().

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

Definition at line 24 of file HGCalVFESummationImpl.h.

Referenced by HGCalVFESummationImpl(), and triggerCellSums().

double HGCalVFESummationImpl::threshold_scintillator_
private

Definition at line 28 of file HGCalVFESummationImpl.h.

Referenced by triggerCellSums().

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

Definition at line 27 of file HGCalVFESummationImpl.h.

Referenced by HGCalVFESummationImpl(), and triggerCellSums().

HGCalTriggerTools HGCalVFESummationImpl::triggerTools_
private

Definition at line 29 of file HGCalVFESummationImpl.h.

Referenced by eventSetup(), and triggerCellSums().