CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HGCalTriggerGeometryV9Imp3.cc
Go to the documentation of this file.
13 
14 #include <fstream>
15 #include <vector>
16 
17 #include <nlohmann/json.hpp>
19 
21 public:
23 
24  void initialize(const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*) final;
25  void initialize(const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*) final;
26  void reset() final;
27 
28  unsigned getTriggerCellFromCell(const unsigned) const final;
29  unsigned getModuleFromCell(const unsigned) const final;
30  unsigned getModuleFromTriggerCell(const unsigned) const final;
31 
32  geom_set getCellsFromTriggerCell(const unsigned) const final;
33  geom_set getCellsFromModule(const unsigned) const final;
34  geom_set getTriggerCellsFromModule(const unsigned) const final;
35 
36  geom_ordered_set getOrderedCellsFromModule(const unsigned) const final;
37  geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned) const final;
38 
39  geom_set getNeighborsFromTriggerCell(const unsigned) const final;
40 
41  geom_set getStage1FpgasFromStage2Fpga(const unsigned) const final;
42  geom_set getStage2FpgasFromStage1Fpga(const unsigned) const final;
43 
44  geom_set getStage1LinksFromStage2Fpga(const unsigned) const final;
45  unsigned getStage1FpgaFromStage1Link(const unsigned) const final;
46  unsigned getStage2FpgaFromStage1Link(const unsigned) const final;
47  geom_set getStage1LinksFromStage1Fpga(const unsigned) const final;
48  geom_set getLpgbtsFromStage1Fpga(const unsigned) const final;
49  unsigned getStage1FpgaFromLpgbt(const unsigned) const final;
50  geom_set getModulesFromLpgbt(const unsigned) const final;
51  geom_set getLpgbtsFromModule(const unsigned) const final;
52  unsigned getStage1FpgaFromModule(const unsigned module_id) const final;
53 
54  unsigned getLinksInModule(const unsigned module_id) const final;
55  unsigned getModuleSize(const unsigned module_id) const final;
56 
57  GlobalPoint getTriggerCellPosition(const unsigned) const final;
58  GlobalPoint getModulePosition(const unsigned) const final;
59 
60  bool validCell(const unsigned) const final;
61  bool validTriggerCell(const unsigned) const final;
62  bool disconnectedModule(const unsigned) const final;
63  unsigned lastTriggerLayer() const final { return last_trigger_layer_; }
64  unsigned triggerLayer(const unsigned) const final;
65 
66 private:
67  // HSc trigger cell grouping
68  unsigned hSc_triggercell_size_ = 2;
69  unsigned hSc_module_size_ = 12; // in TC units (144 TC / panel = 36 e-links)
70  unsigned hSc_wafers_per_module_ = 3;
71 
72  edm::FileInPath jsonMappingFile_;
73 
74  // rotation class
76 
77  // module related maps
78  std::unordered_map<unsigned, unsigned> links_per_module_;
79 
80  std::unordered_multimap<unsigned, unsigned> stage2_to_stage1links_;
81  std::unordered_map<unsigned, unsigned> stage1link_to_stage2_;
82  std::unordered_map<unsigned, unsigned> stage1link_to_stage1_;
83  std::unordered_multimap<unsigned, unsigned> stage1_to_stage1links_;
84  std::unordered_multimap<unsigned, unsigned> stage1_to_lpgbts_;
85  std::unordered_map<unsigned, unsigned> lpgbt_to_stage1_;
86  std::unordered_multimap<unsigned, unsigned> lpgbt_to_modules_;
87  std::unordered_multimap<unsigned, unsigned> module_to_lpgbts_;
88  std::unordered_map<unsigned, unsigned> module_to_stage1_;
89 
90  // Disconnected modules and layers
91  std::unordered_set<unsigned> disconnected_layers_;
92  std::vector<unsigned> trigger_layers_;
93  std::vector<unsigned> trigger_nose_layers_;
94  unsigned last_trigger_layer_ = 0;
95 
96  //Scintillator layout
98 
99  // layer offsets
100  unsigned heOffset_ = 0;
101  unsigned noseLayers_ = 0;
102  unsigned totalLayers_ = 0;
103 
104  void fillMaps();
105  bool validCellId(unsigned det, unsigned cell_id) const;
106  bool validTriggerCellFromCells(const unsigned) const;
107 
108  int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const;
109  void layerWithoutOffsetAndSubdetId(unsigned& layer, int& subdetId, bool isSilicon) const;
110  unsigned packLayerSubdetWaferId(unsigned layer, int subdet, int waferU, int waferV) const;
111  void unpackLayerSubdetWaferId(unsigned wafer, unsigned& layer, int& subdet, int& waferU, int& waferV) const;
112  HGCalGeomRotation::WaferCentring getWaferCentring(unsigned layer, int subdet) const;
113  void etaphiMappingFromSector0(int& ieta, int& iphi, unsigned sector) const;
114  unsigned etaphiMappingToSector0(int& ieta, int& iphi) const;
115  unsigned layerWithOffset(unsigned) const;
116  unsigned getNextSector(const unsigned sector) const;
117  unsigned getPreviousSector(const unsigned sector) const;
118 };
119 
121  : HGCalTriggerGeometryBase(conf),
122  hSc_triggercell_size_(conf.getParameter<unsigned>("ScintillatorTriggerCellSize")),
123  hSc_module_size_(conf.getParameter<unsigned>("ScintillatorModuleSize")),
124  jsonMappingFile_(conf.getParameter<edm::FileInPath>("JsonMappingFile")) {
125  const unsigned ntc_per_wafer = 48;
126  hSc_wafers_per_module_ = std::round(hSc_module_size_ * hSc_module_size_ / float(ntc_per_wafer));
127  if (ntc_per_wafer * hSc_wafers_per_module_ < hSc_module_size_ * hSc_module_size_) {
129  }
130  std::vector<unsigned> tmp_vector = conf.getParameter<std::vector<unsigned>>("DisconnectedLayers");
131  std::move(tmp_vector.begin(), tmp_vector.end(), std::inserter(disconnected_layers_, disconnected_layers_.end()));
132 }
133 
135  stage2_to_stage1links_.clear();
136  stage1link_to_stage2_.clear();
137  stage1link_to_stage1_.clear();
138  stage1_to_stage1links_.clear();
139  stage1_to_lpgbts_.clear();
140  lpgbt_to_stage1_.clear();
141  lpgbt_to_modules_.clear();
142  module_to_lpgbts_.clear();
143  module_to_stage1_.clear();
144 }
145 
147  const HGCalGeometry* hgc_hsi_geometry,
148  const HGCalGeometry* hgc_hsc_geometry) {
149  setEEGeometry(hgc_ee_geometry);
150  setHSiGeometry(hgc_hsi_geometry);
151  setHScGeometry(hgc_hsc_geometry);
154  trigger_layers_.resize(totalLayers_ + 1);
155  trigger_layers_[0] = 0; // layer number 0 doesn't exist
156  unsigned trigger_layer = 1;
157  for (unsigned layer = 1; layer < trigger_layers_.size(); layer++) {
158  if (disconnected_layers_.find(layer) == disconnected_layers_.end()) {
159  // Increase trigger layer number if the layer is not disconnected
160  trigger_layers_[layer] = trigger_layer;
161  trigger_layer++;
162  } else {
163  trigger_layers_[layer] = 0;
164  }
165  }
166  last_trigger_layer_ = trigger_layer - 1;
167  fillMaps();
168 }
169 
171  const HGCalGeometry* hgc_hsi_geometry,
172  const HGCalGeometry* hgc_hsc_geometry,
173  const HGCalGeometry* hgc_nose_geometry) {
174  setEEGeometry(hgc_ee_geometry);
175  setHSiGeometry(hgc_hsi_geometry);
176  setHScGeometry(hgc_hsc_geometry);
177  setNoseGeometry(hgc_nose_geometry);
178 
181 
182  trigger_layers_.resize(totalLayers_ + 1);
183  trigger_layers_[0] = 0; // layer number 0 doesn't exist
184  unsigned trigger_layer = 1;
185  for (unsigned layer = 1; layer < trigger_layers_.size(); layer++) {
186  if (disconnected_layers_.find(layer) == disconnected_layers_.end()) {
187  // Increase trigger layer number if the layer is not disconnected
188  trigger_layers_[layer] = trigger_layer;
189  trigger_layer++;
190  } else {
191  trigger_layers_[layer] = 0;
192  }
193  }
194  last_trigger_layer_ = trigger_layer - 1;
195  fillMaps();
196 
198 
199  trigger_nose_layers_.resize(noseLayers_ + 1);
200  trigger_nose_layers_[0] = 0; // layer number 0 doesn't exist
201  unsigned trigger_nose_layer = 1;
202  for (unsigned layer = 1; layer < trigger_nose_layers_.size(); layer++) {
203  trigger_nose_layers_[layer] = trigger_nose_layer;
204  trigger_nose_layer++;
205  }
206 }
207 
208 unsigned HGCalTriggerGeometryV9Imp3::getTriggerCellFromCell(const unsigned cell_id) const {
209  unsigned det = DetId(cell_id).det();
210  unsigned trigger_cell_id = 0;
211  // Scintillator
212  if (det == DetId::HGCalHSc) {
213  // Very rough mapping from cells to TC
214  HGCScintillatorDetId cell_sc_id(cell_id);
215  int ieta = ((cell_sc_id.ietaAbs() - 1) / hSc_triggercell_size_ + 1) * cell_sc_id.zside();
216  int iphi = (cell_sc_id.iphi() - 1) / hSc_triggercell_size_ + 1;
217  trigger_cell_id = HGCScintillatorDetId(cell_sc_id.type(), cell_sc_id.layer(), ieta, iphi);
218  }
219  // HFNose
220  else if (det == DetId::Forward && DetId(cell_id).subdetId() == ForwardSubdetector::HFNose) {
221  HFNoseDetId cell_nose_id(cell_id);
223  cell_nose_id.zside(),
224  cell_nose_id.type(),
225  cell_nose_id.layer(),
226  cell_nose_id.waferU(),
227  cell_nose_id.waferV(),
228  cell_nose_id.triggerCellU(),
229  cell_nose_id.triggerCellV());
230  }
231  // Silicon
232  else if (det == DetId::HGCalEE || det == DetId::HGCalHSi) {
233  HGCSiliconDetId cell_si_id(cell_id);
234  trigger_cell_id = HGCalTriggerDetId(
236  cell_si_id.zside(),
237  cell_si_id.type(),
238  cell_si_id.layer(),
239  cell_si_id.waferU(),
240  cell_si_id.waferV(),
241  cell_si_id.triggerCellU(),
242  cell_si_id.triggerCellV());
243  }
244  return trigger_cell_id;
245 }
246 
247 unsigned HGCalTriggerGeometryV9Imp3::getModuleFromCell(const unsigned cell_id) const {
249 }
250 
251 unsigned HGCalTriggerGeometryV9Imp3::getModuleFromTriggerCell(const unsigned trigger_cell_id) const {
252  unsigned det = DetId(trigger_cell_id).det();
253  int zside = 0;
254  unsigned tc_type = 1;
255  unsigned layer = 0;
256  unsigned module_id = 0;
257 
258  // Scintillator
259  if (det == DetId::HGCalHSc) {
260  HGCScintillatorDetId trigger_cell_sc_id(trigger_cell_id);
261  tc_type = trigger_cell_sc_id.type();
262  layer = trigger_cell_sc_id.layer();
263  zside = trigger_cell_sc_id.zside();
264  int ietamin = hscTopology().dddConstants().getREtaRange(layer).first;
265  int ietamin_tc = ((ietamin - 1) / hSc_triggercell_size_ + 1);
266  int ieta = ((trigger_cell_sc_id.ietaAbs() - ietamin_tc) / hSc_module_size_ + 1);
267  int iphi = (trigger_cell_sc_id.iphi() - 1) / hSc_module_size_ + 1;
268  unsigned sector = etaphiMappingToSector0(ieta, iphi);
269  module_id =
270  HGCalTriggerModuleDetId(HGCalTriggerSubdetector::HGCalHScTrigger, zside, tc_type, layer, sector, ieta, iphi);
271  }
272  // HFNose
273  else if (det == DetId::HGCalTrigger and
274  HGCalTriggerDetId(trigger_cell_id).subdet() == HGCalTriggerSubdetector::HFNoseTrigger) {
275  HFNoseTriggerDetId trigger_cell_trig_id(trigger_cell_id);
276  tc_type = trigger_cell_trig_id.type();
277  layer = trigger_cell_trig_id.layer();
278  zside = trigger_cell_trig_id.zside();
279  int waferu = trigger_cell_trig_id.waferU();
280  int waferv = trigger_cell_trig_id.waferV();
281  unsigned sector = geom_rotation_120_.uvMappingToSector0(
283  module_id =
284  HGCalTriggerModuleDetId(HGCalTriggerSubdetector::HFNoseTrigger, zside, tc_type, layer, sector, waferu, waferv);
285  }
286  // Silicon
287  else {
288  HGCalTriggerDetId trigger_cell_trig_id(trigger_cell_id);
289  unsigned subdet = trigger_cell_trig_id.subdet();
290  tc_type = trigger_cell_trig_id.type();
291  layer = trigger_cell_trig_id.layer();
292  zside = trigger_cell_trig_id.zside();
293  int waferu = trigger_cell_trig_id.waferU();
294  int waferv = trigger_cell_trig_id.waferV();
295  unsigned sector = geom_rotation_120_.uvMappingToSector0(getWaferCentring(layer, subdet), waferu, waferv);
296  module_id = HGCalTriggerModuleDetId(HGCalTriggerSubdetector(subdet), zside, tc_type, layer, sector, waferu, waferv);
297  }
298  return module_id;
299 }
300 
302  const unsigned trigger_cell_id) const {
303  DetId trigger_cell_det_id(trigger_cell_id);
304  unsigned det = trigger_cell_det_id.det();
305  geom_set cell_det_ids;
306  // Scintillator
307  if (det == DetId::HGCalHSc) {
308  HGCScintillatorDetId trigger_cell_sc_id(trigger_cell_id);
309  int ieta0 = (trigger_cell_sc_id.ietaAbs() - 1) * hSc_triggercell_size_ + 1;
310  int iphi0 = (trigger_cell_sc_id.iphi() - 1) * hSc_triggercell_size_ + 1;
311  for (int ietaAbs = ieta0; ietaAbs < ieta0 + (int)hSc_triggercell_size_; ietaAbs++) {
312  int ieta = ietaAbs * trigger_cell_sc_id.zside();
313  for (int iphi = iphi0; iphi < iphi0 + (int)hSc_triggercell_size_; iphi++) {
314  unsigned cell_id = HGCScintillatorDetId(trigger_cell_sc_id.type(), trigger_cell_sc_id.layer(), ieta, iphi);
315  if (validCellId(DetId::HGCalHSc, cell_id))
316  cell_det_ids.emplace(cell_id);
317  }
318  }
319  }
320  // HFNose
321  else if (det == DetId::HGCalTrigger and
322  HGCalTriggerDetId(trigger_cell_id).subdet() == HGCalTriggerSubdetector::HFNoseTrigger) {
323  HFNoseTriggerDetId trigger_cell_nose_id(trigger_cell_id);
324  int layer = trigger_cell_nose_id.layer();
325  int zside = trigger_cell_nose_id.zside();
326  int type = trigger_cell_nose_id.type();
327  int waferu = trigger_cell_nose_id.waferU();
328  int waferv = trigger_cell_nose_id.waferV();
329  std::vector<int> cellus = trigger_cell_nose_id.cellU();
330  std::vector<int> cellvs = trigger_cell_nose_id.cellV();
331  for (unsigned ic = 0; ic < cellus.size(); ic++) {
332  HFNoseDetId cell_det_id(zside, type, layer, waferu, waferv, cellus[ic], cellvs[ic]);
333  cell_det_ids.emplace(cell_det_id);
334  }
335  }
336  // Silicon
337  else {
338  HGCalTriggerDetId trigger_cell_trig_id(trigger_cell_id);
339  unsigned subdet = trigger_cell_trig_id.subdet();
342  int layer = trigger_cell_trig_id.layer();
343  int zside = trigger_cell_trig_id.zside();
344  int type = trigger_cell_trig_id.type();
345  int waferu = trigger_cell_trig_id.waferU();
346  int waferv = trigger_cell_trig_id.waferV();
347  std::vector<int> cellus = trigger_cell_trig_id.cellU();
348  std::vector<int> cellvs = trigger_cell_trig_id.cellV();
349  for (unsigned ic = 0; ic < cellus.size(); ic++) {
350  HGCSiliconDetId cell_det_id(cell_det, zside, type, layer, waferu, waferv, cellus[ic], cellvs[ic]);
351  cell_det_ids.emplace(cell_det_id);
352  }
353  }
354  }
355  return cell_det_ids;
356 }
357 
359  geom_set cell_det_ids;
360  geom_set trigger_cells = getTriggerCellsFromModule(module_id);
361 
362  for (auto trigger_cell_id : trigger_cells) {
363  geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
364  cell_det_ids.insert(cells.begin(), cells.end());
365  }
366  return cell_det_ids;
367 }
368 
370  const unsigned module_id) const {
371  geom_ordered_set cell_det_ids;
372  geom_ordered_set trigger_cells = getOrderedTriggerCellsFromModule(module_id);
373  for (auto trigger_cell_id : trigger_cells) {
374  geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
375  cell_det_ids.insert(cells.begin(), cells.end());
376  }
377  return cell_det_ids;
378 }
379 
381  const unsigned module_id) const {
382  HGCalTriggerModuleDetId hgc_module_id(module_id);
383  unsigned subdet = hgc_module_id.triggerSubdetId();
384 
385  geom_set trigger_cell_det_ids;
386  // Scintillator
388  int ietamin = hscTopology().dddConstants().getREtaRange(hgc_module_id.layer()).first;
389  int ietamin_tc = ((ietamin - 1) / hSc_triggercell_size_ + 1);
390  int ieta0 = (hgc_module_id.eta() - 1) * hSc_module_size_ + ietamin_tc;
391  int iphi0 = hgc_module_id.phi();
392  etaphiMappingFromSector0(ieta0, iphi0, hgc_module_id.sector());
393  iphi0 = (iphi0 - 1) * hSc_module_size_ + 1;
394  for (int ietaAbs = ieta0; ietaAbs < ieta0 + (int)hSc_module_size_; ietaAbs++) {
395  int ieta = ietaAbs * hgc_module_id.zside();
396  for (int iphi = iphi0; iphi < iphi0 + (int)hSc_module_size_; iphi++) {
397  unsigned trigger_cell_id = HGCScintillatorDetId(hgc_module_id.type(), hgc_module_id.layer(), ieta, iphi);
398  if (validTriggerCellFromCells(trigger_cell_id))
399  trigger_cell_det_ids.emplace(trigger_cell_id);
400  }
401  }
402  }
403  // HFNose
404  else if (subdet == HGCalTriggerSubdetector::HFNoseTrigger) {
405  HFNoseDetId module_nose_id(module_id);
407  std::vector<HFNoseTriggerDetId> ids = hfn.getTriggerDetIds(module_nose_id);
408  for (auto const& idx : ids) {
409  if (validTriggerCellFromCells(idx.rawId()))
410  trigger_cell_det_ids.emplace(idx);
411  }
412  }
413  // Silicon
414  else {
415  HGCSiliconDetIdToROC tc2roc;
416  int moduleU = hgc_module_id.moduleU();
417  int moduleV = hgc_module_id.moduleV();
418  unsigned layer = hgc_module_id.layer();
419 
420  //Rotate to sector
421  geom_rotation_120_.uvMappingFromSector0(getWaferCentring(layer, subdet), moduleU, moduleV, hgc_module_id.sector());
422 
424 
425  unsigned wafer_type = detIdWaferType(det, layer, moduleU, moduleV);
426  int nroc = (wafer_type == HGCSiliconDetId::HGCalFine ? 6 : 3);
427  // Loop on ROCs in wafer
428  for (int roc = 1; roc <= nroc; roc++) {
429  // loop on TCs in ROC
430  auto tc_uvs = tc2roc.getTriggerId(roc, wafer_type);
431  for (const auto& tc_uv : tc_uvs) {
432  HGCalTriggerDetId trigger_cell_id(
433  subdet, hgc_module_id.zside(), wafer_type, layer, moduleU, moduleV, tc_uv.first, tc_uv.second);
434  if (validTriggerCellFromCells(trigger_cell_id.rawId()))
435  trigger_cell_det_ids.emplace(trigger_cell_id);
436  }
437  }
438  }
439 
440  return trigger_cell_det_ids;
441 }
442 
444  const unsigned module_id) const {
445  HGCalTriggerModuleDetId hgc_module_id(module_id);
446  unsigned subdet = hgc_module_id.triggerSubdetId();
447 
448  geom_ordered_set trigger_cell_det_ids;
449 
450  // Scintillator
452  int ieta0 = hgc_module_id.eta() * hSc_module_size_;
453  int iphi0 = (hgc_module_id.phi() * (hgc_module_id.sector() + 1)) * hSc_module_size_;
454 
455  for (int ietaAbs = ieta0; ietaAbs < ieta0 + (int)hSc_module_size_; ietaAbs++) {
456  int ieta = ietaAbs * hgc_module_id.zside();
457  for (int iphi = iphi0; iphi < iphi0 + (int)hSc_module_size_; iphi++) {
458  unsigned trigger_cell_id = HGCScintillatorDetId(hgc_module_id.type(), hgc_module_id.layer(), ieta, iphi);
459  if (validTriggerCellFromCells(trigger_cell_id))
460  trigger_cell_det_ids.emplace(trigger_cell_id);
461  }
462  }
463  }
464 
465  // HFNose
466  else if (subdet == HGCalTriggerSubdetector::HFNoseTrigger) {
467  HFNoseDetId module_nose_id(module_id);
469  std::vector<HFNoseTriggerDetId> ids = hfn.getTriggerDetIds(module_nose_id);
470  for (auto const& idx : ids) {
471  if (validTriggerCellFromCells(idx.rawId()))
472  trigger_cell_det_ids.emplace(idx);
473  }
474  }
475  // Silicon
476  else {
477  HGCSiliconDetIdToROC tc2roc;
478  int moduleU = hgc_module_id.moduleU();
479  int moduleV = hgc_module_id.moduleV();
480  unsigned layer = hgc_module_id.layer();
481 
482  //Rotate to sector
483  geom_rotation_120_.uvMappingFromSector0(getWaferCentring(layer, subdet), moduleU, moduleV, hgc_module_id.sector());
484 
486 
487  unsigned wafer_type = detIdWaferType(det, layer, moduleU, moduleV);
488  int nroc = (wafer_type == HGCSiliconDetId::HGCalFine ? 6 : 3);
489  // Loop on ROCs in wafer
490  for (int roc = 1; roc <= nroc; roc++) {
491  // loop on TCs in ROC
492  auto tc_uvs = tc2roc.getTriggerId(roc, wafer_type);
493  for (const auto& tc_uv : tc_uvs) {
494  HGCalTriggerDetId trigger_cell_id(
495  subdet, hgc_module_id.zside(), wafer_type, layer, moduleU, moduleV, tc_uv.first, tc_uv.second);
496  if (validTriggerCellFromCells(trigger_cell_id.rawId()))
497  trigger_cell_det_ids.emplace(trigger_cell_id);
498  }
499  }
500  }
501 
502  return trigger_cell_det_ids;
503 }
504 
506  const unsigned trigger_cell_id) const {
507  throw cms::Exception("FeatureNotImplemented") << "Neighbor search is not implemented in HGCalTriggerGeometryV9Imp3";
508 }
509 
510 unsigned HGCalTriggerGeometryV9Imp3::getLinksInModule(const unsigned module_id) const {
511  HGCalTriggerModuleDetId module_det_id(module_id);
512  unsigned subdet = module_det_id.triggerSubdetId();
513 
514  unsigned links = 0;
515  // HF Nose
517  links = 1;
518  }
519  // TO ADD HFNOSE : getLinksInModule
520  // Silicon and Scintillator
521  else {
522  int packed_module =
523  packLayerSubdetWaferId(module_det_id.layer(), subdet, module_det_id.moduleU(), module_det_id.moduleV());
524  links = links_per_module_.at(packed_module);
525  }
526  return links;
527 }
528 
529 unsigned HGCalTriggerGeometryV9Imp3::getModuleSize(const unsigned module_id) const {
530  unsigned nWafers = 1;
531  return nWafers;
532 }
533 
534 unsigned HGCalTriggerGeometryV9Imp3::getNextSector(const unsigned sector) const {
535  unsigned next_sector = 0;
536  if (sector < 2) {
537  next_sector = sector + 1;
538  }
539  return next_sector;
540 }
541 
542 unsigned HGCalTriggerGeometryV9Imp3::getPreviousSector(const unsigned sector) const {
543  unsigned previous_sector = 2;
544  if (sector > 0) {
545  previous_sector = sector - 1;
546  }
547  return previous_sector;
548 }
549 
551  const unsigned stage2_id) const {
552  geom_set stage1_ids;
553 
554  geom_set stage1_links = getStage1LinksFromStage2Fpga(stage2_id);
555  for (const auto& stage1_link : stage1_links) {
556  stage1_ids.emplace(getStage1FpgaFromStage1Link(stage1_link));
557  }
558 
559  return stage1_ids;
560 }
561 
563  const unsigned stage1_id) const {
564  geom_set stage2_ids;
565 
566  geom_set stage1_links = getStage1LinksFromStage1Fpga(stage1_id);
567  for (const auto& stage1_link : stage1_links) {
568  stage2_ids.emplace(getStage2FpgaFromStage1Link(stage1_link));
569  }
570 
571  return stage2_ids;
572 }
573 
575  const unsigned stage2_id) const {
576  geom_set stage1link_ids;
577  HGCalTriggerBackendDetId id(stage2_id);
578 
579  auto stage2_itrs = stage2_to_stage1links_.equal_range(id.label());
580  for (auto stage2_itr = stage2_itrs.first; stage2_itr != stage2_itrs.second; stage2_itr++) {
581  if (stage2_itr->second == true) { //link and stage2 FPGA are the same sector
582  stage1link_ids.emplace(HGCalTriggerBackendDetId(
583  id.zside(), HGCalTriggerBackendDetId::BackendType::Stage1Link, id.sector(), stage2_itr->second));
584  } else { //link is from the next sector (anti-clockwise)
585  stage1link_ids.emplace(HGCalTriggerBackendDetId(id.zside(),
586  HGCalTriggerBackendDetId::BackendType::Stage1Link,
587  getNextSector(id.sector()),
588  stage2_itr->second));
589  }
590  }
591 
592  return stage1link_ids;
593 }
594 
595 unsigned HGCalTriggerGeometryV9Imp3::getStage1FpgaFromStage1Link(const unsigned link_id) const {
596  HGCalTriggerBackendDetId id(link_id);
597  unsigned stage1_label = stage1link_to_stage1_.at(id.label());
598 
600  id.zside(), HGCalTriggerBackendDetId::BackendType::Stage1FPGA, id.sector(), stage1_label);
601 }
602 
603 unsigned HGCalTriggerGeometryV9Imp3::getStage2FpgaFromStage1Link(const unsigned link_id) const {
604  HGCalTriggerBackendDetId id(link_id);
605  bool same_sector = stage1link_to_stage2_.at(id.label());
606  unsigned sector = id.sector();
607 
608  if (!same_sector) {
609  sector = getPreviousSector(sector);
610  }
611 
612  return HGCalTriggerBackendDetId(id.zside(), HGCalTriggerBackendDetId::BackendType::Stage2FPGA, sector, 0);
613 }
614 
616  const unsigned stage1_id) const {
617  geom_set stage1link_ids;
618 
619  HGCalTriggerBackendDetId id(stage1_id);
620 
621  auto stage1_itrs = stage1_to_stage1links_.equal_range(id.label());
622  for (auto stage1_itr = stage1_itrs.first; stage1_itr != stage1_itrs.second; stage1_itr++) {
623  stage1link_ids.emplace(HGCalTriggerBackendDetId(
624  id.zside(), HGCalTriggerBackendDetId::BackendType::Stage1Link, id.sector(), stage1_itr->second));
625  }
626 
627  return stage1link_ids;
628 }
629 
631  geom_set lpgbt_ids;
632  HGCalTriggerBackendDetId id(stage1_id);
633 
634  auto stage1_itrs = stage1_to_lpgbts_.equal_range(id.label());
635  for (auto stage1_itr = stage1_itrs.first; stage1_itr != stage1_itrs.second; stage1_itr++) {
636  lpgbt_ids.emplace(HGCalTriggerBackendDetId(
637  id.zside(), HGCalTriggerBackendDetId::BackendType::LpGBT, id.sector(), stage1_itr->second));
638  }
639 
640  return lpgbt_ids;
641 }
642 
643 unsigned HGCalTriggerGeometryV9Imp3::getStage1FpgaFromLpgbt(const unsigned lpgbt_id) const {
644  HGCalTriggerBackendDetId id(lpgbt_id);
645  unsigned stage1_label = lpgbt_to_stage1_.at(id.label());
646 
648  id.zside(), HGCalTriggerBackendDetId::BackendType::Stage1FPGA, id.sector(), stage1_label);
649 }
650 
653  HGCalTriggerBackendDetId id(lpgbt_id);
654 
655  auto lpgbt_itrs = lpgbt_to_modules_.equal_range(id.label());
656  for (auto lpgbt_itr = lpgbt_itrs.first; lpgbt_itr != lpgbt_itrs.second; lpgbt_itr++) {
657  unsigned layer = 0;
658  int moduleU = 0;
659  int moduleV = 0;
660  int subdet = 0;
661  unpackLayerSubdetWaferId(lpgbt_itr->second, layer, subdet, moduleU, moduleV);
662  unsigned det = 0;
663  switch (subdet) {
665  det = DetId::HGCalEE;
666  break;
668  det = DetId::HGCalHSi;
669  break;
671  det = DetId::HGCalHSc;
672  break;
673  default:
674  det = DetId::HGCalEE;
675  break;
676  }
677 
678  int type = detIdWaferType(det, layer, moduleU, moduleV);
679  modules.emplace(HGCalTriggerModuleDetId(
680  HGCalTriggerSubdetector(subdet), id.zside(), type, layer, id.sector(), moduleU, moduleV));
681  }
682 
683  return modules;
684 }
685 
687  geom_set lpgbt_ids;
688  HGCalTriggerModuleDetId id(module_id);
689 
690  auto module_itrs = module_to_lpgbts_.equal_range(
691  packLayerSubdetWaferId(id.layer(), id.triggerSubdetId(), id.moduleU(), id.moduleV()));
692  for (auto module_itr = module_itrs.first; module_itr != module_itrs.second; module_itr++) {
693  lpgbt_ids.emplace(HGCalTriggerBackendDetId(
694  id.zside(), HGCalTriggerBackendDetId::BackendType::LpGBT, id.sector(), module_itr->second));
695  }
696 
697  return lpgbt_ids;
698 }
699 
700 unsigned HGCalTriggerGeometryV9Imp3::getStage1FpgaFromModule(const unsigned module_id) const {
701  HGCalTriggerModuleDetId id(module_id);
702 
703  unsigned stage1_label =
704  module_to_stage1_.at(packLayerSubdetWaferId(id.layer(), id.triggerSubdetId(), id.moduleU(), id.moduleV()));
705 
707  id.zside(), HGCalTriggerBackendDetId::BackendType::Stage1FPGA, id.sector(), stage1_label);
708 }
709 
710 GlobalPoint HGCalTriggerGeometryV9Imp3::getTriggerCellPosition(const unsigned trigger_cell_det_id) const {
711  unsigned det = DetId(trigger_cell_det_id).det();
712 
713  // Position: barycenter of the trigger cell.
714  Basic3DVector<float> triggerCellVector(0., 0., 0.);
715  const auto cell_ids = getCellsFromTriggerCell(trigger_cell_det_id);
716  // Scintillator
717  if (det == DetId::HGCalHSc) {
718  for (const auto& cell : cell_ids) {
719  triggerCellVector += hscGeometry()->getPosition(cell).basicVector();
720  }
721  }
722  // HFNose
723  else if (det == DetId::HGCalTrigger and
724  HGCalTriggerDetId(trigger_cell_det_id).subdet() == HGCalTriggerSubdetector::HFNoseTrigger) {
725  for (const auto& cell : cell_ids) {
726  HFNoseDetId cellDetId(cell);
727  triggerCellVector += noseGeometry()->getPosition(cellDetId).basicVector();
728  }
729  }
730  // Silicon
731  else {
732  for (const auto& cell : cell_ids) {
733  HGCSiliconDetId cellDetId(cell);
734  triggerCellVector += (cellDetId.det() == DetId::HGCalEE ? eeGeometry()->getPosition(cellDetId)
735  : hsiGeometry()->getPosition(cellDetId))
736  .basicVector();
737  }
738  }
739  return GlobalPoint(triggerCellVector / cell_ids.size());
740 }
741 
742 GlobalPoint HGCalTriggerGeometryV9Imp3::getModulePosition(const unsigned module_det_id) const {
743  unsigned subdet = HGCalTriggerModuleDetId(module_det_id).triggerSubdetId();
744  // Position: barycenter of the module.
745  Basic3DVector<float> moduleVector(0., 0., 0.);
746  const auto cell_ids = getCellsFromModule(module_det_id);
747  // Scintillator
749  for (const auto& cell : cell_ids) {
750  moduleVector += hscGeometry()->getPosition(cell).basicVector();
751  }
752  }
753  // HFNose
754  else if (subdet == HGCalTriggerSubdetector::HFNoseTrigger) {
755  for (const auto& cell : cell_ids) {
756  HFNoseDetId cellDetId(cell);
757  moduleVector += noseGeometry()->getPosition(cellDetId).basicVector();
758  }
759  } // Silicon
760  else {
761  for (const auto& cell : cell_ids) {
762  HGCSiliconDetId cellDetId(cell);
763  moduleVector += (cellDetId.det() == DetId::HGCalEE ? eeGeometry()->getPosition(cellDetId)
764  : hsiGeometry()->getPosition(cellDetId))
765  .basicVector();
766  }
767  }
768 
769  return GlobalPoint(moduleVector / cell_ids.size());
770 }
771 
773  // read json mapping file
774  json mapping_config;
775  std::ifstream json_input_file(jsonMappingFile_.fullPath());
776  if (!json_input_file.is_open()) {
777  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TMapping file\n";
778  }
779  json_input_file >> mapping_config;
780 
781  try {
782  //Stage 2 to Stage 1 links mapping
783  for (unsigned stage2_id = 0; stage2_id < mapping_config.at("Stage2").size(); stage2_id++) {
784  for (auto& link : mapping_config.at("Stage2").at(stage2_id).at("Stage1Links")) {
785  stage2_to_stage1links_.emplace(stage2_id, link.at("SameSector"));
786  }
787  }
788  } catch (const json::exception& e) {
789  edm::LogError("HGCalTriggerGeometryV9Imp3")
790  << "The mapping input json file does not have the expected structure for the Stage2 block";
791  }
792 
793  try {
794  for (unsigned link_id = 0; link_id < mapping_config.at("Stage1Links").size(); link_id++) {
795  //Stage 1 links to Stage 1 FPGAs mapping
796  stage1link_to_stage1_.emplace(link_id, mapping_config.at("Stage1Links").at(link_id).at("Stage1"));
797 
798  //Stage 1 links to Stage 2 mapping
799  stage1link_to_stage2_.emplace(link_id, mapping_config.at("Stage1Links").at(link_id).at("Stage2SameSector"));
800  }
801  } catch (const json::exception& e) {
802  edm::LogError("HGCalTriggerGeometryV9Imp3")
803  << "The mapping input json file does not have the expected structure for the Stage1Links block";
804  }
805 
806  try {
807  for (unsigned stage1_id = 0; stage1_id < mapping_config.at("Stage1").size(); stage1_id++) {
808  //Stage 1 to Stage 1 links mapping
809  for (auto& link_id : mapping_config.at("Stage1").at(stage1_id).at("Stage1Links")) {
810  stage1_to_stage1links_.emplace(stage1_id, link_id);
811  }
812 
813  //Stage 1 to lpgbt mapping
814  for (auto& lpgbt_id : mapping_config.at("Stage1").at(stage1_id).at("lpgbts")) {
815  stage1_to_lpgbts_.emplace(stage1_id, lpgbt_id);
816  }
817  }
818 
819  } catch (const json::exception& e) {
820  edm::LogError("HGCalTriggerGeometryV9Imp3")
821  << "The mapping input json file does not have the expected structure for the Stage1 block";
822  }
823 
824  try {
825  for (unsigned lpgbt_id = 0; lpgbt_id < mapping_config.at("lpgbt").size(); lpgbt_id++) {
826  //lpgbt to Stage 1 mapping
827  unsigned stage1_id = mapping_config.at("lpgbt").at(lpgbt_id).at("Stage1");
828  lpgbt_to_stage1_.emplace(lpgbt_id, stage1_id);
829 
830  //lpgbt to module mapping
831  for (auto& modules : mapping_config.at("lpgbt").at(lpgbt_id).at("Modules")) {
832  unsigned layer = modules.at("layer");
833  int subdetId = 0;
834  bool isSilicon = modules.at("isSilicon");
835  layerWithoutOffsetAndSubdetId(layer, subdetId, isSilicon);
836  unsigned packed_value = packLayerSubdetWaferId(layer, subdetId, modules.at("u"), modules.at("v"));
837  lpgbt_to_modules_.emplace(lpgbt_id, packed_value);
838 
839  //fill subsiduary module to stage 1 mapping
840  auto result = module_to_stage1_.emplace(packed_value, stage1_id);
841  if (result.second == false &&
842  stage1_id != result.first->second) { //check that the stage1_id is the same as in the existing map
843  edm::LogError("HGCalTriggerGeometryV9Imp3") << "One module is connected to two separate Stage1 FPGAs";
844  }
845  }
846  }
847 
848  } catch (const json::exception& e) {
849  edm::LogError("HGCalTriggerGeometryV9Imp3")
850  << "The mapping input json file does not have the expected structure for the lpGBT block";
851  }
852 
853  try {
854  //module to lpgbt mapping
855  for (unsigned module = 0; module < mapping_config.at("Module").size(); module++) {
856  unsigned num_elinks = 0; //Sum number of e-links in each module over lpGBTs
857  unsigned layer = mapping_config.at("Module").at(module).at("layer");
858  unsigned moduleU = mapping_config.at("Module").at(module).at("u");
859  unsigned moduleV = mapping_config.at("Module").at(module).at("v");
860  bool isSilicon = mapping_config.at("Module").at(module).at("isSilicon");
861  int subdetId = 0;
862  layerWithoutOffsetAndSubdetId(layer, subdetId, isSilicon);
863 
864  for (auto& lpgbt : mapping_config.at("Module").at(module).at("lpgbts")) {
865  module_to_lpgbts_.emplace(packLayerSubdetWaferId(layer, subdetId, moduleU, moduleV), lpgbt.at("id"));
866  num_elinks += unsigned(lpgbt.at("nElinks"));
867  }
868  int packed_module = packLayerSubdetWaferId(layer, subdetId, moduleU, moduleV);
869  links_per_module_.emplace(packed_module, num_elinks);
870  }
871  } catch (const json::exception& e) {
872  edm::LogError("HGCalTriggerGeometryV9Imp3")
873  << "The mapping input json file does not have the expected structure for the Module block";
874  }
875 
876  json_input_file.close();
877 }
878 
879 unsigned HGCalTriggerGeometryV9Imp3::packLayerSubdetWaferId(unsigned layer, int subdet, int waferU, int waferV) const {
880  unsigned packed_value = 0;
881 
882  packed_value |=
884  packed_value |=
886  packed_value |= ((subdet & HGCalTriggerModuleDetId::kHGCalTriggerSubdetMask)
889  return packed_value;
890 }
891 
893  unsigned wafer, unsigned& layer, int& subdet, int& waferU, int& waferV) const {
896  subdet =
899 }
900 
901 void HGCalTriggerGeometryV9Imp3::etaphiMappingFromSector0(int& ieta, int& iphi, unsigned sector) const {
902  if (sector == 0) {
903  return;
904  }
905  iphi = iphi + (sector * hSc_num_panels_per_sector_);
906 }
907 
909  if (subdet == HGCalTriggerSubdetector::HGCalEETrigger) { // CE-E
911  } else if (subdet == HGCalTriggerSubdetector::HGCalHSiTrigger) {
912  if ((layer % 2) == 1) { // CE-H Odd
914  } else { // CE-H Even
916  }
917  } else if (subdet == HGCalTriggerSubdetector::HFNoseTrigger) { //HFNose
919  } else {
920  edm::LogError("HGCalTriggerGeometryV9Imp3")
921  << "HGCalTriggerGeometryV9Imp3: trigger sub-detector expected to be silicon";
923  }
924 }
925 
926 unsigned HGCalTriggerGeometryV9Imp3::etaphiMappingToSector0(int& ieta, int& iphi) const {
927  unsigned sector = 0;
928 
929  if (unsigned(std::abs(iphi)) > 2 * hSc_num_panels_per_sector_)
930  sector = 2;
931  else if (unsigned(std::abs(iphi)) > hSc_num_panels_per_sector_)
932  sector = 1;
933  else
934  sector = 0;
935 
936  iphi = iphi - (sector * hSc_num_panels_per_sector_);
937 
938  return sector;
939 }
940 
941 bool HGCalTriggerGeometryV9Imp3::validTriggerCell(const unsigned trigger_cell_id) const {
942  return validTriggerCellFromCells(trigger_cell_id);
943 }
944 
945 bool HGCalTriggerGeometryV9Imp3::disconnectedModule(const unsigned module_id) const {
946  bool disconnected = false;
947  HGCalTriggerModuleDetId id(module_id);
948  if (module_to_stage1_.find(packLayerSubdetWaferId(id.layer(), id.triggerSubdetId(), id.moduleU(), id.moduleV())) ==
949  module_to_stage1_.end()) {
950  disconnected = true;
951  }
952  if (disconnected_layers_.find(layerWithOffset(module_id)) != disconnected_layers_.end()) {
953  disconnected = true;
954  }
955  return disconnected;
956 }
957 
958 unsigned HGCalTriggerGeometryV9Imp3::triggerLayer(const unsigned id) const {
959  unsigned layer = layerWithOffset(id);
960 
961  if (DetId(id).det() == DetId::HGCalTrigger and
963  if (layer >= trigger_nose_layers_.size())
964  return 0;
965  return trigger_nose_layers_[layer];
966  }
967  if (layer >= trigger_layers_.size())
968  return 0;
969  return trigger_layers_[layer];
970 }
971 
972 bool HGCalTriggerGeometryV9Imp3::validCell(unsigned cell_id) const {
973  bool is_valid = false;
974  unsigned det = DetId(cell_id).det();
975  switch (det) {
976  case DetId::HGCalEE:
977  is_valid = eeTopology().valid(cell_id);
978  break;
979  case DetId::HGCalHSi:
980  is_valid = hsiTopology().valid(cell_id);
981  break;
982  case DetId::HGCalHSc:
983  is_valid = hscTopology().valid(cell_id);
984  break;
985  case DetId::Forward:
986  is_valid = noseTopology().valid(cell_id);
987  break;
988  default:
989  is_valid = false;
990  break;
991  }
992  return is_valid;
993 }
994 
995 bool HGCalTriggerGeometryV9Imp3::validTriggerCellFromCells(const unsigned trigger_cell_id) const {
996  // Check the validity of a trigger cell with the
997  // validity of the cells. One valid cell in the
998  // trigger cell is enough to make the trigger cell
999  // valid.
1000  const geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
1001  bool is_valid = false;
1002  for (const auto cell_id : cells) {
1003  unsigned det = DetId(cell_id).det();
1004  is_valid |= validCellId(det, cell_id);
1005  if (is_valid)
1006  break;
1007  }
1008  return is_valid;
1009 }
1010 
1011 bool HGCalTriggerGeometryV9Imp3::validCellId(unsigned subdet, unsigned cell_id) const {
1012  bool is_valid = false;
1013  switch (subdet) {
1014  case DetId::HGCalEE:
1015  is_valid = eeTopology().valid(cell_id);
1016  break;
1017  case DetId::HGCalHSi:
1018  is_valid = hsiTopology().valid(cell_id);
1019  break;
1020  case DetId::HGCalHSc:
1021  is_valid = hscTopology().valid(cell_id);
1022  break;
1023  case DetId::Forward:
1024  is_valid = noseTopology().valid(cell_id);
1025  break;
1026  default:
1027  is_valid = false;
1028  break;
1029  }
1030  return is_valid;
1031 }
1032 
1033 int HGCalTriggerGeometryV9Imp3::detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const {
1034  int wafer_type = 0;
1035  switch (det) {
1036  case DetId::HGCalEE:
1037  wafer_type = eeTopology().dddConstants().getTypeHex(layer, waferU, waferV);
1038  break;
1039  case DetId::HGCalHSi:
1040  wafer_type = hsiTopology().dddConstants().getTypeHex(layer, waferU, waferV);
1041  break;
1042  case DetId::HGCalHSc:
1043  wafer_type = hscTopology().dddConstants().getTypeTrap(layer);
1044  break;
1045  default:
1046  break;
1047  };
1048  return wafer_type;
1049 }
1050 
1051 void HGCalTriggerGeometryV9Imp3::layerWithoutOffsetAndSubdetId(unsigned& layer, int& subdetId, bool isSilicon) const {
1052  if (!isSilicon) {
1053  layer = layer - heOffset_;
1055  } else {
1056  if (layer > heOffset_) {
1058  layer = layer - heOffset_;
1059  } else {
1061  }
1062  }
1063 }
1064 
1065 unsigned HGCalTriggerGeometryV9Imp3::layerWithOffset(unsigned id) const {
1066  unsigned det = DetId(id).det();
1067  unsigned layer = 0;
1068 
1069  if (det == DetId::HGCalTrigger) {
1070  unsigned subdet = HGCalTriggerDetId(id).subdet();
1072  layer = HGCalTriggerDetId(id).layer();
1073  } else if (subdet == HGCalTriggerSubdetector::HGCalHSiTrigger) {
1074  layer = heOffset_ + HGCalTriggerDetId(id).layer();
1075  } else if (subdet == HGCalTriggerSubdetector::HFNoseTrigger) {
1076  layer = HFNoseTriggerDetId(id).layer();
1077  }
1078  } else if (det == DetId::HGCalHSc) {
1079  layer = heOffset_ + HGCScintillatorDetId(id).layer();
1080  } else if (det == DetId::Forward) {
1081  unsigned subdet = HGCalTriggerModuleDetId(id).triggerSubdetId();
1083  layer = HGCalTriggerModuleDetId(id).layer();
1084  } else if (subdet == HGCalTriggerSubdetector::HGCalHSiTrigger ||
1086  layer = heOffset_ + HGCalDetId(id).layer();
1087  } else if (subdet == HGCalTriggerSubdetector::HFNoseTrigger) {
1088  layer = HGCalTriggerModuleDetId(id).layer();
1089  }
1090  }
1091  return layer;
1092 }
1093 
HGCalTriggerSubdetector
geom_set getNeighborsFromTriggerCell(const unsigned) const final
geom_set getLpgbtsFromModule(const unsigned) const final
GlobalPoint getTriggerCellPosition(const unsigned) const final
int zside() const
get the z-side of the module (1/-1)
std::unordered_map< unsigned, unsigned > links_per_module_
geom_set getLpgbtsFromStage1Fpga(const unsigned) const final
std::unordered_map< unsigned, unsigned > stage1link_to_stage1_
int triggerCellU() const
Definition: HFNoseDetId.h:87
int getTypeTrap(int layer) const
static const int kHGCalTriggerSubdetMask
geom_set getStage2FpgasFromStage1Fpga(const unsigned) const final
geom_set getTriggerCellsFromModule(const unsigned) const final
int zside() const
get the z-side of the cell (1/-1)
Definition: HFNoseDetId.h:53
geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned) const final
int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const
HGCalTriggerSubdetector subdet() const
get the subdetector
std::unordered_multimap< unsigned, unsigned > stage1_to_stage1links_
uint16_t *__restrict__ id
void setEEGeometry(const HGCalGeometry *geom)
int type() const
get the type
Definition: HFNoseDetId.h:50
nlohmann::json json
unsigned getStage1FpgaFromLpgbt(const unsigned) const final
int32_t waferU(const int32_t index)
GlobalPoint getModulePosition(const unsigned) const final
int waferU() const
const HGCalGeometry * eeGeometry() const
const HGCalTopology & eeTopology() const
bool valid(const DetId &id) const override
Is this a valid cell id.
std::unordered_multimap< unsigned, unsigned > lpgbt_to_modules_
unsigned getTriggerCellFromCell(const unsigned) const final
HGCalGeomRotation::WaferCentring getWaferCentring(unsigned layer, int subdet) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
static const int kHGCalModuleVOffset
void layerWithoutOffsetAndSubdetId(unsigned &layer, int &subdetId, bool isSilicon) const
int getTypeHex(int layer, int waferU, int waferV) const
void uvMappingFromSector0(WaferCentring waferCentring, int &moduleU, int &moduleV, unsigned sector) const
std::unordered_map< unsigned, unsigned > lpgbt_to_stage1_
int type() const
get/set the type
unsigned getNextSector(const unsigned sector) const
unsigned triggerLayer(const unsigned) const final
std::unordered_multimap< unsigned, unsigned > stage2_to_stage1links_
std::vector< int > cellV() const
GlobalPoint getPosition(const DetId &id) const
int zside() const
get the z-side of the cell (1/-1)
int zside() const
get the z-side of the cell (1/-1)
void unpackLayerSubdetWaferId(unsigned wafer, unsigned &layer, int &subdet, int &waferU, int &waferV) const
int zside(DetId const &)
const HGCalTopology & hsiTopology() const
Log< level::Error, false > LogError
void setHSiGeometry(const HGCalGeometry *geom)
bool validCell(const unsigned) const final
unsigned getStage2FpgaFromStage1Link(const unsigned) const final
std::vector< HFNoseTriggerDetId > getTriggerDetIds(HFNoseDetId const &id) const
int type() const
get the type
std::unordered_multimap< unsigned, unsigned > module_to_lpgbts_
static const int kHGCalModuleUOffset
void setNoseGeometry(const HGCalGeometry *geom)
bool validTriggerCell(const unsigned) const final
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< std::pair< int, int > > getTriggerId(int roc, int type) const
tuple result
Definition: mps_fire.py:311
unsigned getModuleSize(const unsigned module_id) const final
int layer() const
get the layer #
geom_ordered_set getOrderedCellsFromModule(const unsigned) const final
char const * label
const HGCalGeometry * noseGeometry() const
int type() const
get the type
unsigned getModuleFromTriggerCell(const unsigned) const final
unsigned int layers(bool reco) const
unsigned getModuleFromCell(const unsigned) const final
unsigned lastTriggerLayer() const final
unsigned getPreviousSector(const unsigned sector) const
int waferV() const
Definition: HFNoseDetId.h:78
int layer() const
get the layer #
Definition: HFNoseDetId.h:56
int type() const
get the type
int waferU() const
Definition: HFNoseDetId.h:75
int layer() const
get the layer #
void etaphiMappingFromSector0(int &ieta, int &iphi, unsigned sector) const
bool disconnectedModule(const unsigned) const final
int zside() const
get the z-side of the cell (1/-1)
int waferV() const
def move
Definition: eostools.py:511
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
int eta() const
get the scintillator panel eta
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< int > cellV() const
void setHScGeometry(const HGCalGeometry *geom)
int phi() const
get the scintillator panel phi
int iphi() const
get the phi index
std::vector< unsigned > trigger_layers_
unsigned etaphiMappingToSector0(int &ieta, int &iphi) const
int sector() const
get the sector #
std::pair< int, int > getREtaRange(int lay) const
int layer() const
get the layer #
unsigned getLinksInModule(const unsigned module_id) const final
int moduleU() const
get the module U
HGCalTriggerGeometryV9Imp3(const edm::ParameterSet &conf)
unsigned getStage1FpgaFromModule(const unsigned module_id) const final
const HGCalGeometry * hsiGeometry() const
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ cells
Definition: DetId.h:17
std::vector< int > cellU() const
std::unordered_multimap< unsigned, unsigned > stage1_to_lpgbts_
int moduleV() const
get the module V
geom_set getStage1FpgasFromStage2Fpga(const unsigned) const final
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98
const HGCalGeometry * hscGeometry() const
const HGCalTopology & hscTopology() const
Detector
Definition: DetId.h:24
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
int triggerSubdetId() const
get the trigger sub-detector
std::set< unsigned > geom_ordered_set
int layer() const
get the layer #
int layer() const
get the layer #
unsigned packLayerSubdetWaferId(unsigned layer, int subdet, int waferU, int waferV) const
int triggerCellU() const
bool validCellId(unsigned det, unsigned cell_id) const
std::vector< int > cellU() const
int zside() const
get the z-side of the cell (1/-1)
std::unordered_set< unsigned > geom_set
int32_t waferV(const int32_t index)
bool validTriggerCellFromCells(const unsigned) const
const HGCalTopology & noseTopology() const
int triggerCellV() const
geom_set getStage1LinksFromStage2Fpga(const unsigned) const final
geom_set getModulesFromLpgbt(const unsigned) const final
std::unordered_map< unsigned, unsigned > stage1link_to_stage2_
std::string fullPath() const
Definition: FileInPath.cc:161
geom_set getCellsFromModule(const unsigned) const final
std::vector< unsigned > trigger_nose_layers_
#define DEFINE_EDM_PLUGIN(factory, type, name)
unsigned layerWithOffset(unsigned) const
unsigned getStage1FpgaFromStage1Link(const unsigned) const final
int type() const
get the type
geom_set getStage1LinksFromStage1Fpga(const unsigned) const final
void initialize(const HGCalGeometry *, const HGCalGeometry *, const HGCalGeometry *) final
geom_set getCellsFromTriggerCell(const unsigned) const final
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
unsigned uvMappingToSector0(WaferCentring waferCentring, int &moduleU, int &moduleV) const
std::unordered_map< unsigned, unsigned > module_to_stage1_
int layer() const
get the layer #
Definition: HGCalDetId.h:46
std::unordered_set< unsigned > disconnected_layers_
tuple module
Definition: callgraph.py:69
static const int kHGCalTriggerSubdetOffset
int triggerCellV() const
Definition: HFNoseDetId.h:94
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46