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 };
dttmaxenums::L
Definition: DTTMax.h:29
HGCScintillatorDetId::iphi
int iphi() const
get the phi index
Definition: HGCScintillatorDetId.cc:57
FWL1THGCalProxyTemplate
Definition: FWL1THGCalProxyTemplate.cc:12
FWSimpleProxyBuilderTemplate.h
HGCalTriggerDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCalTriggerDetId.h:50
HGCScintillatorDetId.h
FWEventItem::getConfig
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:150
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
HGCSiliconDetId.h
FWL1THGCalProxyTemplate::getCellsFromTriggerCell
std::unordered_set< unsigned > getCellsFromTriggerCell(const unsigned trigger_cell_id) const
Definition: FWL1THGCalProxyTemplate.cc:26
HGCalTriggerDetId::cellV
std::vector< int > cellV() const
Definition: HGCalTriggerDetId.cc:104
HGCalTriggerDetId::cellU
std::vector< int > cellU() const
Definition: HGCalTriggerDetId.cc:74
FWL1THGCalProxyTemplate::setItem
void setItem(const FWEventItem *iItem) override
Definition: FWL1THGCalProxyTemplate.cc:14
HGCalHSiTrigger
Definition: ForwardSubdetector.h:14
HGCSiliconDetId
Definition: HGCSiliconDetId.h:22
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
HGCScintillatorDetId::layer
int layer() const
get the layer #
Definition: HGCScintillatorDetId.h:47
DetId
Definition: DetId.h:17
DetId::HGCalHSi
Definition: DetId.h:33
DetId::HGCalEE
Definition: DetId.h:32
FWProxyBuilderBase::layer
int layer() const
Definition: FWProxyBuilderBase.cc:414
HGCalTriggerDetId::layer
int layer() const
get the layer #
Definition: HGCalTriggerDetId.h:53
HGCScintillatorDetId::ietaAbs
int ietaAbs() const
Definition: HGCScintillatorDetId.h:52
HGCalEETrigger
Definition: ForwardSubdetector.h:14
FWProxyBuilderConfiguration::keepEntries
void keepEntries(bool b)
Definition: FWProxyBuilderConfiguration.cc:78
HGCScintillatorDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCScintillatorDetId.h:44
HGCalTriggerDetId
Definition: HGCalTriggerDetId.h:26
FWProxyBuilderConfiguration::assertParam
FWGenericParameter< T > * assertParam(const std::string &name, T def)
Definition: FWProxyBuilderConfiguration.cc:83
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
HGCalTriggerDetId::subdet
HGCalTriggerSubdetector subdet() const
get the subdetector
Definition: HGCalTriggerDetId.h:42
HGCalTriggerDetId::waferU
int waferU() const
Definition: HGCalTriggerDetId.h:72
HcalDetId.h
FWProxyBuilderConfiguration.h
createfilelist.int
int
Definition: createfilelist.py:10
HGCScintillatorDetId::type
int type() const
get the type
Definition: HGCScintillatorDetId.h:41
DetId::Detector
Detector
Definition: DetId.h:24
FWEventItem.h
FWEventItem
Definition: FWEventItem.h:56
type
type
Definition: HCALResponse.h:21
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
HGCalTriggerDetId::waferV
int waferV() const
Definition: HGCalTriggerDetId.h:73
HGCScintillatorDetId
Definition: HGCScintillatorDetId.h:21
DetId::HGCalHSc
Definition: DetId.h:34
FWSimpleProxyBuilderTemplate
Definition: FWSimpleProxyBuilderTemplate.h:30
HGCalTriggerDetId::type
int type() const
get the type
Definition: HGCalTriggerDetId.h:47
FWProxyBuilderBase::setItem
virtual void setItem(const FWEventItem *iItem)
Definition: FWProxyBuilderBase.cc:83
HGCalTriggerDetId.h