CMS 3D CMS Logo

HGCalVFESummationImpl.cc
Go to the documentation of this file.
2 
5  thickness_corrections_(conf.getParameter<std::vector<double>>("ThicknessCorrections"))
6 {}
7 
8 void
11  const std::vector<std::pair<DetId, uint32_t > >& linearized_dataframes,
12  std::map<HGCalDetId, uint32_t>& payload)
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 }
HGCalVFESummationImpl(const edm::ParameterSet &conf)
const HGCalTopology & eeTopology() const
int type() const
get the type
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
std::vector< double > thickness_corrections_
int waferTypeL(int wafer) const
Definition: value.py:1
Definition: DetId.h:18
const HGCalDDDConstants & dddConstants() const
void triggerCellSums(const HGCalTriggerGeometryBase &, const std::vector< std::pair< DetId, uint32_t > > &, std::map< HGCalDetId, uint32_t > &payload)
virtual unsigned getTriggerCellFromCell(const unsigned cell_det_id) const =0
const HGCalTopology & fhTopology() const
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39