CMS 3D CMS Logo

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