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)
 
const std::vector< double > & thicknessCorrections () const
 
void triggerCellSums (const HGCalTriggerGeometryBase &, const std::vector< std::pair< DetId, uint32_t > > &, std::map< HGCalDetId, uint32_t > &payload)
 

Private Attributes

std::vector< double > thickness_corrections_
 

Detailed Description

Definition at line 13 of file HGCalVFESummationImpl.h.

Constructor & Destructor Documentation

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

Definition at line 4 of file HGCalVFESummationImpl.cc.

References triggerCellSums().

4  :
5  thickness_corrections_(conf.getParameter<std::vector<double>>("ThicknessCorrections"))
6 {}
T getParameter(std::string const &) const
std::vector< double > thickness_corrections_

Member Function Documentation

const std::vector<double>& HGCalVFESummationImpl::thicknessCorrections ( ) const
inline

Definition at line 22 of file HGCalVFESummationImpl.h.

References thickness_corrections_.

22 {return thickness_corrections_;}
std::vector< double > thickness_corrections_
void HGCalVFESummationImpl::triggerCellSums ( const HGCalTriggerGeometryBase geometry,
const std::vector< std::pair< DetId, uint32_t > > &  linearized_dataframes,
std::map< HGCalDetId, uint32_t > &  payload 
)

Definition at line 10 of file HGCalVFESummationImpl.cc.

References HGCalTopology::dddConstants(), DetId::det(), HGCalTriggerGeometryBase::eeTopology(), HGCalTriggerGeometryBase::fhTopology(), DetId::Forward, HGCalTriggerGeometryBase::getTriggerCellFromCell(), DetId::HGCalEE, DetId::HGCalHSi, HGCEE, HGCHEF, DetId::subdetId(), thickness_corrections_, HGCSiliconDetId::type(), relativeConstraints::value, and HGCalDDDConstants::waferTypeL().

Referenced by HGCalVFESummationImpl(), and HGCalVFEProcessorSums::run().

13 {
14  if(linearized_dataframes.empty()) return;
15  // sum energies in trigger cells
16  for(const auto& frame : linearized_dataframes)
17  {
18  DetId cellid(frame.first);
19 
20  // find trigger cell associated to cell
21  uint32_t tcid = geometry.getTriggerCellFromCell(cellid);
22  HGCalDetId triggercellid( tcid );
23  payload.emplace(triggercellid, 0); // do nothing if key exists already
24  uint32_t value = frame.second;
25  unsigned det = cellid.det();
26  // equalize value among cell thicknesses for Silicon parts
27  if(det==DetId::Forward || det==DetId::HGCalEE || det==DetId::HGCalHSi)
28  {
29  int thickness = 0;
30  // For the v8 geometry
31  if(det==DetId::Forward)
32  {
33  switch(cellid.subdetId())
34  {
36  thickness = geometry.eeTopology().dddConstants().waferTypeL(HGCalDetId(cellid).wafer())-1;
37  break;
39  thickness = geometry.fhTopology().dddConstants().waferTypeL(HGCalDetId(cellid).wafer())-1;
40  break;
41  default:
42  break;
43  };
44  }
45  // For the v9 geometry
46  else if(det==DetId::HGCalEE || det==DetId::HGCalHSi)
47  {
48  thickness = HGCSiliconDetId(cellid).type();
49  }
50 
51  double thickness_correction = thickness_corrections_.at(thickness);
52  value = (double)value*thickness_correction;
53  }
54 
55  // sums energy for the same triggercellid
56  payload[triggercellid] += value; // 32 bits integer should be largely enough
57  }
58 
59 }
const HGCalTopology & eeTopology() const
int type() const
get the type
std::vector< double > thickness_corrections_
int waferTypeL(int wafer) const
Definition: value.py:1
Definition: DetId.h:18
const HGCalDDDConstants & dddConstants() const
virtual unsigned getTriggerCellFromCell(const unsigned cell_det_id) const =0
const HGCalTopology & fhTopology() const

Member Data Documentation

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

Definition at line 25 of file HGCalVFESummationImpl.h.

Referenced by thicknessCorrections(), and triggerCellSums().