CMS 3D CMS Logo

FWL1THGCalProxyTemplate.cc
Go to the documentation of this file.
2 // #include "Fireworks/Calo/interface/FWHeatmapProxyBuilderTemplate.h"
5 
9 
10 template <typename T>
12 protected:
13  void setItem(const FWEventItem *iItem) override {
15  if (iItem) {
16  iItem->getConfig()->keepEntries(true);
17  iItem->getConfig()->assertParam("Layer", 0L, 0L, 52L);
18  iItem->getConfig()->assertParam("EnergyCutOff", 0.5, 0.2, 5.0);
19  iItem->getConfig()->assertParam("Heatmap", true);
20  iItem->getConfig()->assertParam("Z+", true);
21  iItem->getConfig()->assertParam("Z-", true);
22  }
23  }
24 
25  std::unordered_set<unsigned> getCellsFromTriggerCell(const unsigned trigger_cell_id) const {
26  constexpr unsigned hSc_triggercell_size_ = 2;
27  // constexpr unsigned hSc_module_size_ = 12; // in TC units (144 TC / panel = 36 e-links)
28 
29  DetId trigger_cell_det_id(trigger_cell_id);
30  unsigned det = trigger_cell_det_id.det();
31 
32  std::unordered_set<unsigned> cell_det_ids;
33 
34  // Scintillator
35  if (det == DetId::HGCalHSc) {
36  HGCScintillatorDetId trigger_cell_sc_id(trigger_cell_id);
37  int ieta0 = (trigger_cell_sc_id.ietaAbs() - 1) * hSc_triggercell_size_ + 1;
38  int iphi0 = (trigger_cell_sc_id.iphi() - 1) * hSc_triggercell_size_ + 1;
39  for (int ietaAbs = ieta0; ietaAbs < ieta0 + (int)hSc_triggercell_size_; ietaAbs++) {
40  int ieta = ietaAbs * trigger_cell_sc_id.zside();
41  for (int iphi = iphi0; iphi < iphi0 + (int)hSc_triggercell_size_; iphi++) {
42  unsigned cell_id = HGCScintillatorDetId(trigger_cell_sc_id.type(), trigger_cell_sc_id.layer(), ieta, iphi);
43 #if 0
44  if (validCellId(DetId::HGCalHSc, cell_id))
45 #endif
46  cell_det_ids.emplace(cell_id);
47  }
48  }
49  }
50  // Silicon
51  else {
52  HGCalTriggerDetId trigger_cell_trig_id(trigger_cell_id);
53  unsigned subdet = trigger_cell_trig_id.subdet();
55  DetId::Detector cell_det =
57  int layer = trigger_cell_trig_id.layer();
58  int zside = trigger_cell_trig_id.zside();
59  int type = trigger_cell_trig_id.type();
60  int waferu = trigger_cell_trig_id.waferU();
61  int waferv = trigger_cell_trig_id.waferV();
62  std::vector<int> cellus = trigger_cell_trig_id.cellU();
63  std::vector<int> cellvs = trigger_cell_trig_id.cellV();
64  for (unsigned ic = 0; ic < cellus.size(); ic++) {
65  HGCSiliconDetId cell_det_id(cell_det, zside, type, layer, waferu, waferv, cellus[ic], cellvs[ic]);
66  cell_det_ids.emplace(cell_det_id.rawId());
67  }
68  }
69  }
70  return cell_det_ids;
71  }
72 };
std::unordered_set< unsigned > getCellsFromTriggerCell(const unsigned trigger_cell_id) const
type
Definition: HCALResponse.h:21
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:150
HGCalTriggerSubdetector subdet() const
get the subdetector
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
void setItem(const FWEventItem *iItem) override
int type() const
get the type
int zside() const
get the z-side of the cell (1/-1)
int zside(DetId const &)
int type() const
get the type
int layer() const
get the layer #
virtual void setItem(const FWEventItem *iItem)
std::vector< int > cellV() const
int iphi() const
get the phi index
FWGenericParameter< T > * assertParam(const std::string &name, T def)
Definition: DetId.h:17
Detector
Definition: DetId.h:24
int layer() const
get the layer #
std::vector< int > cellU() const
int zside() const
get the z-side of the cell (1/-1)
#define constexpr
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46