CMS 3D CMS Logo

HGCalTriggerGeometryV9Imp2.cc
Go to the documentation of this file.
11 
12 #include "tbb/concurrent_unordered_set.h"
13 #include <fstream>
14 #include <iostream>
15 #include <regex>
16 #include <vector>
17 
19 public:
21 
22  void initialize(const CaloGeometry*) final;
23  void initialize(const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*) final;
24  void initialize(const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*) final;
25  void reset() final;
26 
27  unsigned getTriggerCellFromCell(const unsigned) const final;
28  unsigned getModuleFromCell(const unsigned) const final;
29  unsigned getModuleFromTriggerCell(const unsigned) const final;
30 
31  geom_set getCellsFromTriggerCell(const unsigned) const final;
32  geom_set getCellsFromModule(const unsigned) const final;
33  geom_set getTriggerCellsFromModule(const unsigned) const final;
34 
35  geom_ordered_set getOrderedCellsFromModule(const unsigned) const final;
36  geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned) const final;
37 
38  geom_set getNeighborsFromTriggerCell(const unsigned) const final;
39 
40  unsigned getLinksInModule(const unsigned module_id) const final;
41  unsigned getModuleSize(const unsigned module_id) const final;
42 
43  GlobalPoint getTriggerCellPosition(const unsigned) const final;
44  GlobalPoint getModulePosition(const unsigned) const final;
45 
46  bool validCell(const unsigned) const final;
47  bool validTriggerCell(const unsigned) const final;
48  bool disconnectedModule(const unsigned) const final;
49  unsigned lastTriggerLayer() const final { return last_trigger_layer_; }
50  unsigned triggerLayer(const unsigned) const final;
51 
52 private:
53  // HSc trigger cell grouping
54  unsigned hSc_triggercell_size_ = 2;
55  unsigned hSc_module_size_ = 12; // in TC units (144 TC / panel = 36 e-links)
56  unsigned hSc_links_per_module_ = 1;
57  unsigned hSc_wafers_per_module_ = 3;
58 
59  unsigned sector0_mask_ = 0x7f; // 7 bits to encode module number in 60deg sector
60 
63 
64  // module related maps
65  std::unordered_map<unsigned, unsigned> wafer_to_module_;
66  std::unordered_multimap<unsigned, unsigned> module_to_wafers_;
67  std::unordered_map<unsigned, unsigned> links_per_module_;
68  mutable tbb::concurrent_unordered_set<unsigned> cache_missing_wafers_;
69 
70  // Disconnected modules and layers
71  std::unordered_set<unsigned> disconnected_modules_;
72  std::unordered_set<unsigned> disconnected_layers_;
73  std::vector<unsigned> trigger_layers_;
74  std::vector<unsigned> trigger_nose_layers_;
75  unsigned last_trigger_layer_ = 0;
76 
77  // layer offsets
78  unsigned heOffset_ = 0;
79  unsigned noseLayers_ = 0;
80  unsigned totalLayers_ = 0;
81 
82  void fillMaps();
83  bool validCellId(unsigned det, unsigned cell_id) const;
84  bool validTriggerCellFromCells(const unsigned) const;
85 
86  int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const;
87  unsigned packWaferId(int waferU, int waferV) const;
88  unsigned packLayerWaferId(unsigned layer, int waferU, int waferV) const;
89  unsigned packLayerModuleId(unsigned layer, unsigned wafer) const;
90  void unpackWaferId(unsigned wafer, int& waferU, int& waferV) const;
91 
92  unsigned layerWithOffset(unsigned) const;
93 };
94 
97  hSc_triggercell_size_(conf.getParameter<unsigned>("ScintillatorTriggerCellSize")),
98  hSc_module_size_(conf.getParameter<unsigned>("ScintillatorModuleSize")),
99  hSc_links_per_module_(conf.getParameter<unsigned>("ScintillatorLinksPerModule")),
100  l1tModulesMapping_(conf.getParameter<edm::FileInPath>("L1TModulesMapping")),
101  l1tLinksMapping_(conf.getParameter<edm::FileInPath>("L1TLinksMapping")) {
102  const unsigned ntc_per_wafer = 48;
103  hSc_wafers_per_module_ = std::round(hSc_module_size_ * hSc_module_size_ / float(ntc_per_wafer));
104  if (ntc_per_wafer * hSc_wafers_per_module_ < hSc_module_size_ * hSc_module_size_) {
106  }
107  std::vector<unsigned> tmp_vector = conf.getParameter<std::vector<unsigned>>("DisconnectedModules");
108  std::move(tmp_vector.begin(), tmp_vector.end(), std::inserter(disconnected_modules_, disconnected_modules_.end()));
109  tmp_vector = conf.getParameter<std::vector<unsigned>>("DisconnectedLayers");
110  std::move(tmp_vector.begin(), tmp_vector.end(), std::inserter(disconnected_layers_, disconnected_layers_.end()));
111 }
112 
114  wafer_to_module_.clear();
115  module_to_wafers_.clear();
116  cache_missing_wafers_.clear();
117 }
118 
120  throw cms::Exception("BadGeometry")
121  << "HGCalTriggerGeometryV9Imp2 geometry cannot be initialized with the V7/V8 HGCAL geometry";
122 }
123 
125  const HGCalGeometry* hgc_hsi_geometry,
126  const HGCalGeometry* hgc_hsc_geometry) {
127  setEEGeometry(hgc_ee_geometry);
128  setHSiGeometry(hgc_hsi_geometry);
129  setHScGeometry(hgc_hsc_geometry);
132  trigger_layers_.resize(totalLayers_ + 1);
133  trigger_layers_[0] = 0; // layer number 0 doesn't exist
134  unsigned trigger_layer = 1;
135  for (unsigned layer = 1; layer < trigger_layers_.size(); layer++) {
136  if (disconnected_layers_.find(layer) == disconnected_layers_.end()) {
137  // Increase trigger layer number if the layer is not disconnected
138  trigger_layers_[layer] = trigger_layer;
139  trigger_layer++;
140  } else {
141  trigger_layers_[layer] = 0;
142  }
143  }
144  last_trigger_layer_ = trigger_layer - 1;
145  fillMaps();
146 }
147 
149  const HGCalGeometry* hgc_hsi_geometry,
150  const HGCalGeometry* hgc_hsc_geometry,
151  const HGCalGeometry* hgc_nose_geometry) {
152  setEEGeometry(hgc_ee_geometry);
153  setHSiGeometry(hgc_hsi_geometry);
154  setHScGeometry(hgc_hsc_geometry);
155  setNoseGeometry(hgc_nose_geometry);
156 
159 
160  trigger_layers_.resize(totalLayers_ + 1);
161  trigger_layers_[0] = 0; // layer number 0 doesn't exist
162  unsigned trigger_layer = 1;
163  for (unsigned layer = 1; layer < trigger_layers_.size(); layer++) {
164  if (disconnected_layers_.find(layer) == disconnected_layers_.end()) {
165  // Increase trigger layer number if the layer is not disconnected
166  trigger_layers_[layer] = trigger_layer;
167  trigger_layer++;
168  } else {
169  trigger_layers_[layer] = 0;
170  }
171  }
172  last_trigger_layer_ = trigger_layer - 1;
173  fillMaps();
174 
176 
177  trigger_nose_layers_.resize(noseLayers_ + 1);
178  trigger_nose_layers_[0] = 0; // layer number 0 doesn't exist
179  unsigned trigger_nose_layer = 1;
180  for (unsigned layer = 1; layer < trigger_nose_layers_.size(); layer++) {
181  trigger_nose_layers_[layer] = trigger_nose_layer;
182  trigger_nose_layer++;
183  }
184 }
185 
186 unsigned HGCalTriggerGeometryV9Imp2::getTriggerCellFromCell(const unsigned cell_id) const {
187  unsigned det = DetId(cell_id).det();
188  unsigned trigger_cell_id = 0;
189  // Scintillator
190  if (det == DetId::HGCalHSc) {
191  // Very rough mapping from cells to TC
192  HGCScintillatorDetId cell_sc_id(cell_id);
193  int ieta = ((cell_sc_id.ietaAbs() - 1) / hSc_triggercell_size_ + 1) * cell_sc_id.zside();
194  int iphi = (cell_sc_id.iphi() - 1) / hSc_triggercell_size_ + 1;
195  trigger_cell_id = HGCScintillatorDetId(cell_sc_id.type(), cell_sc_id.layer(), ieta, iphi);
196  }
197  // HFNose
198  else if (det == DetId::Forward && DetId(cell_id).subdetId() == ForwardSubdetector::HFNose) {
199  HFNoseDetId cell_nose_id(cell_id);
201  cell_nose_id.zside(),
202  cell_nose_id.type(),
203  cell_nose_id.layer(),
204  cell_nose_id.waferU(),
205  cell_nose_id.waferV(),
206  cell_nose_id.triggerCellU(),
207  cell_nose_id.triggerCellV());
208  }
209  // Silicon
210  else if (det == DetId::HGCalEE || det == DetId::HGCalHSi) {
211  HGCSiliconDetId cell_si_id(cell_id);
212  trigger_cell_id = HGCalTriggerDetId(
214  cell_si_id.zside(),
215  cell_si_id.type(),
216  cell_si_id.layer(),
217  cell_si_id.waferU(),
218  cell_si_id.waferV(),
219  cell_si_id.triggerCellU(),
220  cell_si_id.triggerCellV());
221  }
222  return trigger_cell_id;
223 }
224 
225 unsigned HGCalTriggerGeometryV9Imp2::getModuleFromCell(const unsigned cell_id) const {
227 }
228 
229 unsigned HGCalTriggerGeometryV9Imp2::getModuleFromTriggerCell(const unsigned trigger_cell_id) const {
230  unsigned det = DetId(trigger_cell_id).det();
231  unsigned module = 0;
232  unsigned subdet_old = 0;
233  int zside = 0;
234  unsigned tc_type = 1;
235  unsigned layer = 0;
236  unsigned module_id = 0;
237  // Scintillator
238  if (det == DetId::HGCalHSc) {
239  HGCScintillatorDetId trigger_cell_sc_id(trigger_cell_id);
240  tc_type = trigger_cell_sc_id.type();
241  layer = trigger_cell_sc_id.layer();
242  zside = trigger_cell_sc_id.zside();
243  int ietamin = hscTopology().dddConstants().getREtaRange(layer).first;
244  int ietamin_tc = ((ietamin - 1) / hSc_triggercell_size_ + 1);
245  int ieta = ((trigger_cell_sc_id.ietaAbs() - ietamin_tc) / hSc_module_size_ + 1) * zside;
246  int iphi = (trigger_cell_sc_id.iphi() - 1) / hSc_module_size_ + 1;
247  module_id = HGCScintillatorDetId(tc_type, layer, ieta, iphi);
248  }
249  // HFNose
250  else if (det == DetId::HGCalTrigger and
251  HGCalTriggerDetId(trigger_cell_id).subdet() == HGCalTriggerSubdetector::HFNoseTrigger) {
252  HFNoseTriggerDetId trigger_cell_trig_id(trigger_cell_id);
253  tc_type = trigger_cell_trig_id.type();
254  layer = trigger_cell_trig_id.layer();
255  zside = trigger_cell_trig_id.zside();
256  int waferu = trigger_cell_trig_id.waferU();
257  int waferv = trigger_cell_trig_id.waferV();
258 
260  module_id = hfn.getModule(HFNoseDetId(zside, layer, tc_type, waferu, waferv, 0, 0)).rawId();
261  }
262  // Silicon
263  else {
264  HGCalTriggerDetId trigger_cell_trig_id(trigger_cell_id);
265  unsigned subdet = trigger_cell_trig_id.subdet();
266  subdet_old =
268  layer = trigger_cell_trig_id.layer();
269  zside = trigger_cell_trig_id.zside();
271  int waferu = trigger_cell_trig_id.waferU();
272  int waferv = trigger_cell_trig_id.waferV();
273  unsigned layer_with_offset = layerWithOffset(trigger_cell_id);
274  unsigned packed_wafer = packLayerWaferId(layer_with_offset, waferu, waferv);
275  auto module_itr = wafer_to_module_.find(packed_wafer);
276  if (module_itr == wafer_to_module_.end()) {
277  // return missing modules as disconnected (id=0)
278  module = 0;
279  auto insert_itr = cache_missing_wafers_.emplace(packed_wafer);
280  if (insert_itr.second) {
281  edm::LogWarning("HGCalTriggerGeometry")
282  << "Found missing wafer (layer=" << layer_with_offset << " u=" << waferu << " v=" << waferv
283  << ") in trigger modules mapping";
284  }
285  } else {
286  module = module_itr->second;
287  }
288  }
289  module_id =
290  HGCalDetId((ForwardSubdetector)subdet_old, zside, layer, tc_type, module, HGCalDetId::kHGCalCellMask).rawId();
291  }
292  return module_id;
293 }
294 
296  const unsigned trigger_cell_id) const {
297  DetId trigger_cell_det_id(trigger_cell_id);
298  unsigned det = trigger_cell_det_id.det();
299  geom_set cell_det_ids;
300  // Scintillator
301  if (det == DetId::HGCalHSc) {
302  HGCScintillatorDetId trigger_cell_sc_id(trigger_cell_id);
303  int ieta0 = (trigger_cell_sc_id.ietaAbs() - 1) * hSc_triggercell_size_ + 1;
304  int iphi0 = (trigger_cell_sc_id.iphi() - 1) * hSc_triggercell_size_ + 1;
305  for (int ietaAbs = ieta0; ietaAbs < ieta0 + (int)hSc_triggercell_size_; ietaAbs++) {
306  int ieta = ietaAbs * trigger_cell_sc_id.zside();
307  for (int iphi = iphi0; iphi < iphi0 + (int)hSc_triggercell_size_; iphi++) {
308  unsigned cell_id = HGCScintillatorDetId(trigger_cell_sc_id.type(), trigger_cell_sc_id.layer(), ieta, iphi);
309  if (validCellId(DetId::HGCalHSc, cell_id))
310  cell_det_ids.emplace(cell_id);
311  }
312  }
313  }
314  // HFNose
315  else if (det == DetId::HGCalTrigger and
316  HGCalTriggerDetId(trigger_cell_id).subdet() == HGCalTriggerSubdetector::HFNoseTrigger) {
317  HFNoseTriggerDetId trigger_cell_nose_id(trigger_cell_id);
318  int layer = trigger_cell_nose_id.layer();
319  int zside = trigger_cell_nose_id.zside();
320  int type = trigger_cell_nose_id.type();
321  int waferu = trigger_cell_nose_id.waferU();
322  int waferv = trigger_cell_nose_id.waferV();
323  std::vector<int> cellus = trigger_cell_nose_id.cellU();
324  std::vector<int> cellvs = trigger_cell_nose_id.cellV();
325  for (unsigned ic = 0; ic < cellus.size(); ic++) {
326  HFNoseDetId cell_det_id(zside, type, layer, waferu, waferv, cellus[ic], cellvs[ic]);
327  cell_det_ids.emplace(cell_det_id);
328  }
329  }
330  // Silicon
331  else {
332  HGCalTriggerDetId trigger_cell_trig_id(trigger_cell_id);
333  unsigned subdet = trigger_cell_trig_id.subdet();
336  int layer = trigger_cell_trig_id.layer();
337  int zside = trigger_cell_trig_id.zside();
338  int type = trigger_cell_trig_id.type();
339  int waferu = trigger_cell_trig_id.waferU();
340  int waferv = trigger_cell_trig_id.waferV();
341  std::vector<int> cellus = trigger_cell_trig_id.cellU();
342  std::vector<int> cellvs = trigger_cell_trig_id.cellV();
343  for (unsigned ic = 0; ic < cellus.size(); ic++) {
344  HGCSiliconDetId cell_det_id(cell_det, zside, type, layer, waferu, waferv, cellus[ic], cellvs[ic]);
345  cell_det_ids.emplace(cell_det_id);
346  }
347  }
348  }
349  return cell_det_ids;
350 }
351 
353  geom_set cell_det_ids;
354  geom_set trigger_cells = getTriggerCellsFromModule(module_id);
355  for (auto trigger_cell_id : trigger_cells) {
356  geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
357  cell_det_ids.insert(cells.begin(), cells.end());
358  }
359  return cell_det_ids;
360 }
361 
363  const unsigned module_id) const {
364  geom_ordered_set cell_det_ids;
365  geom_ordered_set trigger_cells = getOrderedTriggerCellsFromModule(module_id);
366  for (auto trigger_cell_id : trigger_cells) {
367  geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
368  cell_det_ids.insert(cells.begin(), cells.end());
369  }
370  return cell_det_ids;
371 }
372 
374  const unsigned module_id) const {
375  DetId module_det_id(module_id);
376  unsigned det = module_det_id.det();
377  geom_set trigger_cell_det_ids;
378  // Scintillator
379  if (det == DetId::HGCalHSc) {
380  HGCScintillatorDetId module_sc_id(module_id);
381  int ietamin = hscTopology().dddConstants().getREtaRange(module_sc_id.layer()).first;
382  int ietamin_tc = ((ietamin - 1) / hSc_triggercell_size_ + 1);
383  int ieta0 = (module_sc_id.ietaAbs() - 1) * hSc_module_size_ + ietamin_tc;
384  int iphi0 = (module_sc_id.iphi() - 1) * hSc_module_size_ + 1;
385  for (int ietaAbs = ieta0; ietaAbs < ieta0 + (int)hSc_module_size_; ietaAbs++) {
386  int ieta = ietaAbs * module_sc_id.zside();
387  for (int iphi = iphi0; iphi < iphi0 + (int)hSc_module_size_; iphi++) {
388  unsigned trigger_cell_id = HGCScintillatorDetId(module_sc_id.type(), module_sc_id.layer(), ieta, iphi);
389  if (validTriggerCellFromCells(trigger_cell_id))
390  trigger_cell_det_ids.emplace(trigger_cell_id);
391  }
392  }
393  }
394  // HFNose
395  else if (det == DetId::Forward && module_det_id.subdetId() == ForwardSubdetector::HFNose) {
396  HFNoseDetId module_nose_id(module_id);
398  std::vector<HFNoseTriggerDetId> ids = hfn.getTriggerDetIds(module_nose_id);
399  for (auto const& idx : ids) {
400  if (validTriggerCellFromCells(idx.rawId()))
401  trigger_cell_det_ids.emplace(idx);
402  }
403  }
404  // Silicon
405  else {
406  HGCalDetId module_si_id(module_id);
407  unsigned module = module_si_id.wafer();
408  HGCSiliconDetIdToROC tc2roc;
409  auto wafer_itrs = module_to_wafers_.equal_range(packLayerModuleId(layerWithOffset(module_id), module));
410  // loop on the wafers included in the module
411  for (auto wafer_itr = wafer_itrs.first; wafer_itr != wafer_itrs.second; wafer_itr++) {
412  int waferu = 0;
413  int waferv = 0;
414  unpackWaferId(wafer_itr->second, waferu, waferv);
416  HGCalTriggerSubdetector subdet =
419  unsigned layer = module_si_id.layer();
420  unsigned wafer_type = detIdWaferType(det, layer, waferu, waferv);
421  int nroc = (wafer_type == HGCSiliconDetId::HGCalFine ? 6 : 3);
422  // Loop on ROCs in wafer
423  for (int roc = 1; roc <= nroc; roc++) {
424  // loop on TCs in ROC
425  auto tc_uvs = tc2roc.getTriggerId(roc, wafer_type);
426  for (const auto& tc_uv : tc_uvs) {
427  HGCalTriggerDetId trigger_cell_id(
428  subdet, module_si_id.zside(), wafer_type, layer, waferu, waferv, tc_uv.first, tc_uv.second);
429  if (validTriggerCellFromCells(trigger_cell_id.rawId()))
430  trigger_cell_det_ids.emplace(trigger_cell_id);
431  }
432  }
433  }
434  }
435 
436  return trigger_cell_det_ids;
437 }
438 
440  const unsigned module_id) const {
441  DetId module_det_id(module_id);
442  unsigned det = module_det_id.det();
443  geom_ordered_set trigger_cell_det_ids;
444  // Scintillator
445  if (det == DetId::HGCalHSc) {
446  HGCScintillatorDetId module_sc_id(module_id);
447  int ieta0 = (module_sc_id.ietaAbs() - 1) * hSc_module_size_ + 1;
448  int iphi0 = (module_sc_id.iphi() - 1) * hSc_module_size_ + 1;
449  for (int ietaAbs = ieta0; ietaAbs < ieta0 + (int)hSc_module_size_; ietaAbs++) {
450  int ieta = ietaAbs * module_sc_id.zside();
451  for (int iphi = iphi0; iphi < iphi0 + (int)hSc_module_size_; iphi++) {
452  unsigned trigger_cell_id = HGCScintillatorDetId(module_sc_id.type(), module_sc_id.layer(), ieta, iphi);
453  if (validTriggerCellFromCells(trigger_cell_id))
454  trigger_cell_det_ids.emplace(trigger_cell_id);
455  }
456  }
457  }
458  // HFNose
459  else if (det == DetId::Forward && DetId(module_det_id).subdetId() == ForwardSubdetector::HFNose) {
460  HFNoseDetId module_nose_id(module_id);
462  std::vector<HFNoseTriggerDetId> ids = hfn.getTriggerDetIds(module_nose_id);
463  for (auto const& idx : ids) {
464  if (validTriggerCellFromCells(idx.rawId()))
465  trigger_cell_det_ids.emplace(idx);
466  }
467  }
468  // EE or FH
469  else {
470  HGCalDetId module_si_id(module_id);
471  unsigned module = module_si_id.wafer();
472  HGCSiliconDetIdToROC tc2roc;
473  auto wafer_itrs = module_to_wafers_.equal_range(packLayerModuleId(layerWithOffset(module_id), module));
474  // loop on the wafers included in the module
475  for (auto wafer_itr = wafer_itrs.first; wafer_itr != wafer_itrs.second; wafer_itr++) {
476  int waferu = 0;
477  int waferv = 0;
478  unpackWaferId(wafer_itr->second, waferu, waferv);
480  HGCalTriggerSubdetector subdet =
483  unsigned layer = module_si_id.layer();
484  unsigned wafer_type = detIdWaferType(det, layer, waferu, waferv);
485  int nroc = (wafer_type == HGCSiliconDetId::HGCalFine ? 6 : 3);
486  // Loop on ROCs in wafer
487  for (int roc = 1; roc <= nroc; roc++) {
488  // loop on TCs in ROC
489  auto tc_uvs = tc2roc.getTriggerId(roc, wafer_type);
490  for (const auto& tc_uv : tc_uvs) {
491  HGCalTriggerDetId trigger_cell_id(
492  subdet, module_si_id.zside(), wafer_type, layer, waferu, waferv, tc_uv.first, tc_uv.second);
493  trigger_cell_det_ids.emplace(trigger_cell_id);
494  }
495  }
496  }
497  }
498  return trigger_cell_det_ids;
499 }
500 
502  const unsigned trigger_cell_id) const {
503  throw cms::Exception("FeatureNotImplemented") << "Neighbor search is not implemented in HGCalTriggerGeometryV9Imp2";
504 }
505 
506 unsigned HGCalTriggerGeometryV9Imp2::getLinksInModule(const unsigned module_id) const {
507  DetId module_det_id(module_id);
508  unsigned links = 0;
509  // Scintillator
510  if (module_det_id.det() == DetId::HGCalHSc) {
512  } else if (module_det_id.det() == DetId::Forward && module_det_id.subdetId() == ForwardSubdetector::HFNose) {
513  links = 1;
514  }
515  // TO ADD HFNOSE : getLinksInModule
516  // Silicon
517  else {
518  HGCalDetId module_det_id_si(module_id);
519  unsigned module = module_det_id_si.wafer();
520  unsigned layer = layerWithOffset(module_id);
521  module = (module & sector0_mask_);
522  links = links_per_module_.at(packLayerModuleId(layer, module));
523  }
524  return links;
525 }
526 
527 unsigned HGCalTriggerGeometryV9Imp2::getModuleSize(const unsigned module_id) const {
528  DetId module_det_id(module_id);
529  unsigned nWafers = 1;
530  // Scintillator
531  if (module_det_id.det() == DetId::HGCalHSc) {
532  nWafers = hSc_wafers_per_module_;
533  }
534  // Check for HFNOSE : getModuleSize
535  // Silicon
536  else {
537  HGCalDetId module_det_id_si(module_id);
538  unsigned module = module_det_id_si.wafer();
539  unsigned layer = layerWithOffset(module_id);
540  nWafers = module_to_wafers_.count(packLayerModuleId(layer, module));
541  }
542  return nWafers;
543 }
544 
545 GlobalPoint HGCalTriggerGeometryV9Imp2::getTriggerCellPosition(const unsigned trigger_cell_det_id) const {
546  unsigned det = DetId(trigger_cell_det_id).det();
547  // Position: barycenter of the trigger cell.
548  Basic3DVector<float> triggerCellVector(0., 0., 0.);
549  const auto cell_ids = getCellsFromTriggerCell(trigger_cell_det_id);
550  // Scintillator
551  if (det == DetId::HGCalHSc) {
552  for (const auto& cell : cell_ids) {
553  triggerCellVector += hscGeometry()->getPosition(cell).basicVector();
554  }
555  }
556  // HFNose
557  else if (det == DetId::HGCalTrigger and
558  HGCalTriggerDetId(trigger_cell_det_id).subdet() == HGCalTriggerSubdetector::HFNoseTrigger) {
559  for (const auto& cell : cell_ids) {
560  HFNoseDetId cellDetId(cell);
561  triggerCellVector += noseGeometry()->getPosition(cellDetId).basicVector();
562  }
563  }
564  // Silicon
565  else {
566  for (const auto& cell : cell_ids) {
567  HGCSiliconDetId cellDetId(cell);
568  triggerCellVector += (cellDetId.det() == DetId::HGCalEE ? eeGeometry()->getPosition(cellDetId)
569  : hsiGeometry()->getPosition(cellDetId))
570  .basicVector();
571  }
572  }
573  return GlobalPoint(triggerCellVector / cell_ids.size());
574 }
575 
576 GlobalPoint HGCalTriggerGeometryV9Imp2::getModulePosition(const unsigned module_det_id) const {
577  unsigned det = DetId(module_det_id).det();
578  // Position: barycenter of the module.
579  Basic3DVector<float> moduleVector(0., 0., 0.);
580  const auto cell_ids = getCellsFromModule(module_det_id);
581  // Scintillator
582  if (det == DetId::HGCalHSc) {
583  for (const auto& cell : cell_ids) {
584  moduleVector += hscGeometry()->getPosition(cell).basicVector();
585  }
586  }
587  // HFNose
588  else if (det == DetId::Forward && DetId(module_det_id).subdetId() == ForwardSubdetector::HFNose) {
589  for (const auto& cell : cell_ids) {
590  HFNoseDetId cellDetId(cell);
591  moduleVector += noseGeometry()->getPosition(cellDetId).basicVector();
592  }
593  } // Silicon
594  else {
595  for (const auto& cell : cell_ids) {
596  HGCSiliconDetId cellDetId(cell);
597  moduleVector += (cellDetId.det() == DetId::HGCalEE ? eeGeometry()->getPosition(cellDetId)
598  : hsiGeometry()->getPosition(cellDetId))
599  .basicVector();
600  }
601  }
602 
603  return GlobalPoint(moduleVector / cell_ids.size());
604 }
605 
607  // read module mapping file
608  std::ifstream l1tModulesMappingStream(l1tModulesMapping_.fullPath());
609  if (!l1tModulesMappingStream.is_open()) {
610  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TModulesMapping file\n";
611  }
612 
613  short waferu = 0;
614  short waferv = 0;
615  short module = 0;
616  short layer = 0;
617  for (; l1tModulesMappingStream >> layer >> waferu >> waferv >> module;) {
618  wafer_to_module_.emplace(packLayerWaferId(layer, waferu, waferv), module);
619  module_to_wafers_.emplace(packLayerModuleId(layer, module), packWaferId(waferu, waferv));
620  }
621  if (!l1tModulesMappingStream.eof()) {
622  throw cms::Exception("BadGeometryFile")
623  << "Error reading L1TModulesMapping '" << layer << " " << waferu << " " << waferv << " " << module << "' \n";
624  }
625  l1tModulesMappingStream.close();
626  // read links mapping file
627  std::ifstream l1tLinksMappingStream(l1tLinksMapping_.fullPath());
628  if (!l1tLinksMappingStream.is_open()) {
629  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TLinksMapping file\n";
630  }
631  short links = 0;
632  const short max_modules_60deg_sector = 127;
633  for (; l1tLinksMappingStream >> layer >> module >> links;) {
634  if (module_to_wafers_.find(packLayerModuleId(layer, module)) == module_to_wafers_.end()) {
635  links = 0;
636  }
637  if (module > max_modules_60deg_sector)
638  sector0_mask_ = 0xff; // Use 8 bits to encode module number in 120deg sector
639  links_per_module_.emplace(packLayerModuleId(layer, module), links);
640  }
641  if (!l1tLinksMappingStream.eof()) {
642  throw cms::Exception("BadGeometryFile")
643  << "Error reading L1TLinksMapping '" << layer << " " << module << " " << links << "' \n";
644  }
645  l1tLinksMappingStream.close();
646 }
647 
648 unsigned HGCalTriggerGeometryV9Imp2::packWaferId(int waferU, int waferV) const {
649  unsigned packed_value = 0;
650  unsigned waferUsign = (waferU >= 0) ? 0 : 1;
651  unsigned waferVsign = (waferV >= 0) ? 0 : 1;
656  return packed_value;
657 }
658 
659 unsigned HGCalTriggerGeometryV9Imp2::packLayerWaferId(unsigned layer, int waferU, int waferV) const {
660  unsigned packed_value = 0;
661  unsigned subdet = ForwardSubdetector::HGCEE;
662  if (layer > heOffset_) {
663  layer -= heOffset_;
665  }
666  unsigned waferUsign = (waferU >= 0) ? 0 : 1;
667  unsigned waferVsign = (waferV >= 0) ? 0 : 1;
673  packed_value |= ((subdet & DetId::kSubdetMask) << DetId::kSubdetOffset);
674  return packed_value;
675 }
676 
677 unsigned HGCalTriggerGeometryV9Imp2::packLayerModuleId(unsigned layer, unsigned module) const {
678  unsigned packed_value = 0;
679  unsigned subdet = ForwardSubdetector::HGCEE;
680  if (layer > heOffset_) {
681  layer -= heOffset_;
683  }
684  packed_value |= ((layer & HGCalDetId::kHGCalLayerMask) << HGCalDetId::kHGCalLayerOffset);
685  packed_value |= ((module & HGCalDetId::kHGCalWaferMask) << HGCalDetId::kHGCalWaferOffset);
686  packed_value |= ((subdet & DetId::kSubdetMask) << DetId::kSubdetOffset);
687  return packed_value;
688 }
689 
690 void HGCalTriggerGeometryV9Imp2::unpackWaferId(unsigned wafer, int& waferU, int& waferV) const {
694  : waferUAbs);
696  : waferVAbs);
697 }
698 
699 bool HGCalTriggerGeometryV9Imp2::validTriggerCell(const unsigned trigger_cell_id) const {
700  return validTriggerCellFromCells(trigger_cell_id);
701 }
702 
703 bool HGCalTriggerGeometryV9Imp2::disconnectedModule(const unsigned module_id) const {
704  bool disconnected = false;
705  if (disconnected_modules_.find(HGCalDetId(module_id).wafer()) != disconnected_modules_.end())
706  disconnected = true;
707  if (disconnected_layers_.find(layerWithOffset(module_id)) != disconnected_layers_.end())
708  disconnected = true;
709  return disconnected;
710 }
711 
712 unsigned HGCalTriggerGeometryV9Imp2::triggerLayer(const unsigned id) const {
713  unsigned layer = layerWithOffset(id);
714 
715  if (DetId(id).det() == DetId::HGCalTrigger and
717  if (layer >= trigger_nose_layers_.size())
718  return 0;
719  return trigger_nose_layers_[layer];
720  }
721  if (layer >= trigger_layers_.size())
722  return 0;
723  return trigger_layers_[layer];
724 }
725 
726 bool HGCalTriggerGeometryV9Imp2::validCell(unsigned cell_id) const {
727  bool is_valid = false;
728  unsigned det = DetId(cell_id).det();
729  switch (det) {
730  case DetId::HGCalEE:
731  is_valid = eeTopology().valid(cell_id);
732  break;
733  case DetId::HGCalHSi:
734  is_valid = hsiTopology().valid(cell_id);
735  break;
736  case DetId::HGCalHSc:
737  is_valid = hscTopology().valid(cell_id);
738  break;
739  case DetId::Forward:
740  is_valid = noseTopology().valid(cell_id);
741  break;
742  default:
743  is_valid = false;
744  break;
745  }
746  return is_valid;
747 }
748 
749 bool HGCalTriggerGeometryV9Imp2::validTriggerCellFromCells(const unsigned trigger_cell_id) const {
750  // Check the validity of a trigger cell with the
751  // validity of the cells. One valid cell in the
752  // trigger cell is enough to make the trigger cell
753  // valid.
754  const geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
755  bool is_valid = false;
756  for (const auto cell_id : cells) {
757  unsigned det = DetId(cell_id).det();
758  is_valid |= validCellId(det, cell_id);
759  if (is_valid)
760  break;
761  }
762  return is_valid;
763 }
764 
765 bool HGCalTriggerGeometryV9Imp2::validCellId(unsigned subdet, unsigned cell_id) const {
766  bool is_valid = false;
767  switch (subdet) {
768  case DetId::HGCalEE:
769  is_valid = eeTopology().valid(cell_id);
770  break;
771  case DetId::HGCalHSi:
772  is_valid = hsiTopology().valid(cell_id);
773  break;
774  case DetId::HGCalHSc:
775  is_valid = hscTopology().valid(cell_id);
776  break;
777  case DetId::Forward:
778  is_valid = noseTopology().valid(cell_id);
779  break;
780  default:
781  is_valid = false;
782  break;
783  }
784  return is_valid;
785 }
786 
787 int HGCalTriggerGeometryV9Imp2::detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const {
788  int wafer_type = 0;
789  switch (det) {
790  case DetId::HGCalEE:
791  wafer_type = eeTopology().dddConstants().getTypeHex(layer, waferU, waferV);
792  break;
793  case DetId::HGCalHSi:
794  wafer_type = hsiTopology().dddConstants().getTypeHex(layer, waferU, waferV);
795  break;
796  default:
797  break;
798  };
799  return wafer_type;
800 }
801 
802 unsigned HGCalTriggerGeometryV9Imp2::layerWithOffset(unsigned id) const {
803  unsigned det = DetId(id).det();
804  unsigned layer = 0;
805 
806  if (det == DetId::HGCalTrigger) {
807  unsigned subdet = HGCalTriggerDetId(id).subdet();
809  layer = HGCalTriggerDetId(id).layer();
810  } else if (subdet == HGCalTriggerSubdetector::HGCalHSiTrigger) {
811  layer = heOffset_ + HGCalTriggerDetId(id).layer();
812  } else if (subdet == HGCalTriggerSubdetector::HFNoseTrigger) {
813  layer = HFNoseTriggerDetId(id).layer();
814  }
815  } else if (det == DetId::HGCalHSc) {
816  layer = heOffset_ + HGCScintillatorDetId(id).layer();
817  } else if (det == DetId::Forward) {
818  unsigned subdet = HGCalDetId(id).subdetId();
819  if (subdet == ForwardSubdetector::HGCEE) {
820  layer = HGCalDetId(id).layer();
821  } else if (subdet == ForwardSubdetector::HGCHEF || subdet == ForwardSubdetector::HGCHEB) {
822  layer = heOffset_ + HGCalDetId(id).layer();
823  } else if (subdet == ForwardSubdetector::HFNose) {
824  layer = HFNoseDetId(id).layer();
825  }
826  }
827  return layer;
828 }
829 
HGCalTriggerGeometryV9Imp2
Definition: HGCalTriggerGeometryV9Imp2.cc:18
HGCalTriggerGeometryV9Imp2::getModuleSize
unsigned getModuleSize(const unsigned module_id) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:527
HGCalTriggerGeometryV9Imp2::detIdWaferType
int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const
Definition: HGCalTriggerGeometryV9Imp2.cc:787
HGCalTriggerGeometryV9Imp2::getModuleFromTriggerCell
unsigned getModuleFromTriggerCell(const unsigned) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:229
HGCSiliconDetId::kHGCalWaferUMask
static const int kHGCalWaferUMask
Definition: HGCSiliconDetId.h:113
HGCalTriggerGeometryBase::noseGeometry
const HGCalGeometry * noseGeometry() const
Definition: HGCalTriggerGeometryBase.h:35
HGCalTriggerGeometryBase::eeTopology
const HGCalTopology & eeTopology() const
Definition: HGCalTriggerGeometryBase.h:65
HGCalTriggerGeometryBase
Definition: HGCalTriggerGeometryBase.h:19
HGCalTriggerGeometryV9Imp2::packLayerModuleId
unsigned packLayerModuleId(unsigned layer, unsigned wafer) const
Definition: HGCalTriggerGeometryV9Imp2.cc:677
HGCalTriggerGeometryV9Imp2::unpackWaferId
void unpackWaferId(unsigned wafer, int &waferU, int &waferV) const
Definition: HGCalTriggerGeometryV9Imp2.cc:690
DetId::HGCalTrigger
Definition: DetId.h:35
HGCalTriggerGeometryV9Imp2::fillMaps
void fillMaps()
Definition: HGCalTriggerGeometryV9Imp2.cc:606
HGCScintillatorDetId::iphi
int iphi() const
get the phi index
Definition: HGCScintillatorDetId.cc:58
HGCalTopology::dddConstants
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98
HGCalTriggerGeometryBase::hsiGeometry
const HGCalGeometry * hsiGeometry() const
Definition: HGCalTriggerGeometryBase.h:57
HGCalTriggerGeometryV9Imp2::hSc_links_per_module_
unsigned hSc_links_per_module_
Definition: HGCalTriggerGeometryV9Imp2.cc:56
HGCalTriggerDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCalTriggerDetId.h:50
HGCalTriggerGeometryV9Imp2::getCellsFromTriggerCell
geom_set getCellsFromTriggerCell(const unsigned) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:295
HGCScintillatorDetId.h
HFNoseTriggerDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HFNoseTriggerDetId.h:50
HGCalTriggerGeometryV9Imp2::HGCalTriggerGeometryV9Imp2
HGCalTriggerGeometryV9Imp2(const edm::ParameterSet &conf)
Definition: HGCalTriggerGeometryV9Imp2.cc:95
HGCalDetId::kHGCalWaferOffset
static const int kHGCalWaferOffset
Definition: HGCalDetId.h:12
HGCalTriggerGeometryV9Imp2::validCellId
bool validCellId(unsigned det, unsigned cell_id) const
Definition: HGCalTriggerGeometryV9Imp2.cc:765
HFNoseDetIdToModule::getModule
static const HFNoseDetId getModule(HFNoseDetId const &id)
Definition: HFNoseDetIdToModule.h:13
HFNoseDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HFNoseDetId.h:53
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
HGCalTriggerGeometryV9Imp2::reset
void reset() final
Definition: HGCalTriggerGeometryV9Imp2.cc:113
ForwardSubdetector
ForwardSubdetector
Definition: ForwardSubdetector.h:4
HGCSiliconDetId::kHGCalLayerOffset
static const int kHGCalLayerOffset
Definition: HGCSiliconDetId.h:120
edm
HLT enums.
Definition: AlignableModifier.h:19
HFNoseDetId::layer
int layer() const
get the layer #
Definition: HFNoseDetId.h:56
HGCSiliconDetId::triggerCellV
int triggerCellV() const
Definition: HGCSiliconDetId.h:91
HGCalTriggerGeometryV9Imp2::sector0_mask_
unsigned sector0_mask_
Definition: HGCalTriggerGeometryV9Imp2.cc:59
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
HGCSiliconDetId::kHGCalWaferUOffset
static const int kHGCalWaferUOffset
Definition: HGCSiliconDetId.h:112
HGCalTriggerGeometryV9Imp2::links_per_module_
std::unordered_map< unsigned, unsigned > links_per_module_
Definition: HGCalTriggerGeometryV9Imp2.cc:67
HGCalTriggerGeometryBase::setNoseGeometry
void setNoseGeometry(const HGCalGeometry *geom)
Definition: HGCalTriggerGeometryBase.h:110
HGCalDDDConstants::getREtaRange
std::pair< int, int > getREtaRange(int lay) const
Definition: HGCalDDDConstants.cc:400
HGCalDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCalDetId.h:49
HGCSiliconDetId::kHGCalWaferUSignMask
static const int kHGCalWaferUSignMask
Definition: HGCSiliconDetId.h:115
HGCalTriggerSubdetector
HGCalTriggerSubdetector
Definition: ForwardSubdetector.h:14
HFNoseDetIdToModule.h
HGCalTriggerGeometryV9Imp2::initialize
void initialize(const CaloGeometry *) final
Definition: HGCalTriggerGeometryV9Imp2.cc:119
HFNoseTriggerDetId::cellU
std::vector< int > cellU() const
Definition: HFNoseTriggerDetId.cc:73
HFNoseTriggerDetId::type
int type() const
get the type
Definition: HFNoseTriggerDetId.h:47
HGCalTriggerDetId::cellV
std::vector< int > cellV() const
Definition: HGCalTriggerDetId.cc:104
HGCalTriggerGeometryV9Imp2::module_to_wafers_
std::unordered_multimap< unsigned, unsigned > module_to_wafers_
Definition: HGCalTriggerGeometryV9Imp2.cc:66
HGCalTriggerDetId::cellU
std::vector< int > cellU() const
Definition: HGCalTriggerDetId.cc:74
HGCalTriggerGeometryV9Imp2::triggerLayer
unsigned triggerLayer(const unsigned) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:712
HGCalDDDConstants::getTypeHex
int getTypeHex(int layer, int waferU, int waferV) const
Definition: HGCalDDDConstants.cc:428
HGCalTriggerGeometryV9Imp2::getModulePosition
GlobalPoint getModulePosition(const unsigned) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:576
HGCalTriggerGeometryV9Imp2::totalLayers_
unsigned totalLayers_
Definition: HGCalTriggerGeometryV9Imp2.cc:80
HGCalTriggerGeometryBase::setEEGeometry
void setEEGeometry(const HGCalGeometry *geom)
Definition: HGCalTriggerGeometryBase.h:107
watchdog.const
const
Definition: watchdog.py:83
HFNoseDetId
Definition: HFNoseDetId.h:22
HFNoseTriggerDetId
Definition: HFNoseTriggerDetId.h:26
HGCalDetId::layer
int layer() const
get the layer #
Definition: HGCalDetId.h:46
dqmdumpme.first
first
Definition: dqmdumpme.py:55
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
HGCalHSiTrigger
Definition: ForwardSubdetector.h:14
DetId::kSubdetMask
static const int kSubdetMask
Definition: DetId.h:20
HGCSiliconDetId
Definition: HGCSiliconDetId.h:22
ForwardSubdetector.h
HGCalTriggerGeometryV9Imp2::validTriggerCellFromCells
bool validTriggerCellFromCells(const unsigned) const
Definition: HGCalTriggerGeometryV9Imp2.cc:749
FileInPath.h
HGCSiliconDetId::triggerCellU
int triggerCellU() const
Definition: HGCSiliconDetId.h:84
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
DetId::kSubdetOffset
static const int kSubdetOffset
Definition: DetId.h:22
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
HGCScintillatorDetId::layer
int layer() const
get the layer #
Definition: HGCScintillatorDetId.h:50
HGCalDetId::kHGCalWaferMask
static const int kHGCalWaferMask
Definition: HGCalDetId.h:13
HFNoseDetId::waferU
int waferU() const
Definition: HFNoseDetId.h:75
DetId
Definition: DetId.h:17
edm::FileInPath
Definition: FileInPath.h:64
DetId::HGCalHSi
Definition: DetId.h:33
DetId::HGCalEE
Definition: DetId.h:32
HGCSiliconDetId::kHGCalWaferVMask
static const int kHGCalWaferVMask
Definition: HGCSiliconDetId.h:117
CaloGeometry
Definition: CaloGeometry.h:21
HGCalTriggerGeometryV9Imp2::getCellsFromModule
geom_set getCellsFromModule(const unsigned) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:352
HGCalTriggerGeometryBase.h
HGCalTriggerGeometryV9Imp2::validTriggerCell
bool validTriggerCell(const unsigned) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:699
HFNose
Definition: ForwardSubdetector.h:11
HGCalTriggerDetId::layer
int layer() const
get the layer #
Definition: HGCalTriggerDetId.h:53
HFNoseTriggerDetId.h
HFNoseTriggerDetId::waferU
int waferU() const
Definition: HFNoseTriggerDetId.h:70
HGCScintillatorDetId::ietaAbs
int ietaAbs() const
Definition: HGCScintillatorDetId.h:55
HGCalEETrigger
Definition: ForwardSubdetector.h:14
HFNoseDetId::triggerCellU
int triggerCellU() const
Definition: HFNoseDetId.h:87
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
HGCalTriggerGeometryV9Imp2::noseLayers_
unsigned noseLayers_
Definition: HGCalTriggerGeometryV9Imp2.cc:79
Point3DBase< float, GlobalTag >
HGCalGeometry
Definition: HGCalGeometry.h:29
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
HGCScintillatorDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCScintillatorDetId.h:47
HGCalTriggerGeometryV9Imp2::getModuleFromCell
unsigned getModuleFromCell(const unsigned) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:225
HGCSiliconDetId::kHGCalWaferVSignOffset
static const int kHGCalWaferVSignOffset
Definition: HGCSiliconDetId.h:118
HGCalTriggerGeometryBase::setHSiGeometry
void setHSiGeometry(const HGCalGeometry *geom)
Definition: HGCalTriggerGeometryBase.h:108
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
HGCSiliconDetId::HGCalFine
Definition: HGCSiliconDetId.h:24
HGCalTriggerDetId
Definition: HGCalTriggerDetId.h:26
HGCSiliconDetId::kHGCalWaferVSignMask
static const int kHGCalWaferVSignMask
Definition: HGCSiliconDetId.h:119
HGCEE
Definition: ForwardSubdetector.h:8
HGCalTriggerGeometryV9Imp2::getTriggerCellsFromModule
geom_set getTriggerCellsFromModule(const unsigned) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:373
HGCalTriggerGeometryV9Imp2::packLayerWaferId
unsigned packLayerWaferId(unsigned layer, int waferU, int waferV) const
Definition: HGCalTriggerGeometryV9Imp2.cc:659
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
HFNoseDetId::type
int type() const
get the type
Definition: HFNoseDetId.h:50
HGCalTriggerGeometryV9Imp2::hSc_wafers_per_module_
unsigned hSc_wafers_per_module_
Definition: HGCalTriggerGeometryV9Imp2.cc:57
HGCalDetId::kHGCalLayerOffset
static const int kHGCalLayerOffset
Definition: HGCalDetId.h:16
edm::ParameterSet
Definition: ParameterSet.h:47
HGCalTriggerDetId::subdet
HGCalTriggerSubdetector subdet() const
get the subdetector
Definition: HGCalTriggerDetId.h:42
HGCalTriggerDetId::waferU
int waferU() const
Definition: HGCalTriggerDetId.h:72
HGCalTriggerGeometryV9Imp2::getOrderedTriggerCellsFromModule
geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:439
HGCalTriggerGeometryV9Imp2::heOffset_
unsigned heOffset_
Definition: HGCalTriggerGeometryV9Imp2.cc:78
HGCalTriggerGeometryV9Imp2::getLinksInModule
unsigned getLinksInModule(const unsigned module_id) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:506
HGCalTriggerGeometryV9Imp2::lastTriggerLayer
unsigned lastTriggerLayer() const final
Definition: HGCalTriggerGeometryV9Imp2.cc:49
HGCalTriggerGeometryV9Imp2::getTriggerCellPosition
GlobalPoint getTriggerCellPosition(const unsigned) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:545
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
HGCalTriggerGeometryV9Imp2::packWaferId
unsigned packWaferId(int waferU, int waferV) const
Definition: HGCalTriggerGeometryV9Imp2.cc:648
edmplugin::PluginFactory
Definition: PluginFactory.h:34
HcalDetId.h
HGCalTriggerGeometryBase::geom_ordered_set
std::set< unsigned > geom_ordered_set
Definition: HGCalTriggerGeometryBase.h:23
HGCalDDDConstants::layers
unsigned int layers(bool reco) const
Definition: HGCalDDDConstants.cc:561
HFNoseTriggerDetId::cellV
std::vector< int > cellV() const
Definition: HFNoseTriggerDetId.cc:102
HGCalTriggerGeometryV9Imp2::hSc_module_size_
unsigned hSc_module_size_
Definition: HGCalTriggerGeometryV9Imp2.cc:55
createfilelist.int
int
Definition: createfilelist.py:10
HGCalTriggerGeometryV9Imp2::disconnected_layers_
std::unordered_set< unsigned > disconnected_layers_
Definition: HGCalTriggerGeometryV9Imp2.cc:72
HFNoseTrigger
Definition: ForwardSubdetector.h:14
HGCScintillatorDetId::type
int type() const
get/set the type
Definition: HGCScintillatorDetId.h:43
HGCalTriggerGeometryV9Imp2::getNeighborsFromTriggerCell
geom_set getNeighborsFromTriggerCell(const unsigned) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:501
HGCalTriggerGeometryBase::geom_set
std::unordered_set< unsigned > geom_set
Definition: HGCalTriggerGeometryBase.h:22
DetId::Detector
Detector
Definition: DetId.h:24
HGCalGeometry::getPosition
GlobalPoint getPosition(const DetId &id) const
Definition: HGCalGeometry.cc:191
HGCSiliconDetId::kHGCalWaferVOffset
static const int kHGCalWaferVOffset
Definition: HGCSiliconDetId.h:116
HGCSiliconDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCSiliconDetId.h:54
HGCalTriggerGeometryV9Imp2::wafer_to_module_
std::unordered_map< unsigned, unsigned > wafer_to_module_
Definition: HGCalTriggerGeometryV9Imp2.cc:65
HGCalTriggerGeometryV9Imp2::last_trigger_layer_
unsigned last_trigger_layer_
Definition: HGCalTriggerGeometryV9Imp2.cc:75
HGCalTriggerGeometryBase::setHScGeometry
void setHScGeometry(const HGCalGeometry *geom)
Definition: HGCalTriggerGeometryBase.h:109
PV3DBase::basicVector
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
HGCalTriggerGeometryV9Imp2::disconnectedModule
bool disconnectedModule(const unsigned) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:703
HGCalDetId::wafer
int wafer() const
get the wafer #
Definition: HGCalDetId.h:40
HGCalTriggerGeometryV9Imp2::validCell
bool validCell(const unsigned) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:726
HGCalDetId
Definition: HGCalDetId.h:8
HGCalTriggerGeometryBase::eeGeometry
const HGCalGeometry * eeGeometry() const
Definition: HGCalTriggerGeometryBase.h:41
HGCalDetId::kHGCalCellMask
static const int kHGCalCellMask
Definition: HGCalDetId.h:11
HGCSiliconDetIdToROC.h
HGCalDetId.h
HGCalTriggerGeometryV9Imp2::hSc_triggercell_size_
unsigned hSc_triggercell_size_
Definition: HGCalTriggerGeometryV9Imp2.cc:54
eostools.move
def move(src, dest)
Definition: eostools.py:511
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
HGCalTriggerDetId::waferV
int waferV() const
Definition: HGCalTriggerDetId.h:73
HGCalDetId::kHGCalLayerMask
static const int kHGCalLayerMask
Definition: HGCalDetId.h:17
HGCSiliconDetId::kHGCalLayerMask
static const int kHGCalLayerMask
Definition: HGCSiliconDetId.h:121
HGCalTriggerGeometryBase::hsiTopology
const HGCalTopology & hsiTopology() const
Definition: HGCalTriggerGeometryBase.h:68
HGCalTriggerGeometryV9Imp2::l1tModulesMapping_
edm::FileInPath l1tModulesMapping_
Definition: HGCalTriggerGeometryV9Imp2.cc:61
HGCScintillatorDetId
Definition: HGCScintillatorDetId.h:23
DetId::HGCalHSc
Definition: DetId.h:34
HFNoseTriggerDetId::waferV
int waferV() const
Definition: HFNoseTriggerDetId.h:73
Exception
Definition: hltDiff.cc:246
postprocess-scan-build.cells
cells
Definition: postprocess-scan-build.py:13
HGCalTriggerGeometryV9Imp2::cache_missing_wafers_
tbb::concurrent_unordered_set< unsigned > cache_missing_wafers_
Definition: HGCalTriggerGeometryV9Imp2.cc:68
electronStore.links
links
Definition: electronStore.py:149
PixelMapPlotter.roc
roc
Definition: PixelMapPlotter.py:498
HGCSiliconDetId::type
int type() const
get the type
Definition: HGCSiliconDetId.h:51
HGCSiliconDetId::waferU
int waferU() const
Definition: HGCSiliconDetId.h:76
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCalTriggerGeometryV9Imp2::trigger_nose_layers_
std::vector< unsigned > trigger_nose_layers_
Definition: HGCalTriggerGeometryV9Imp2.cc:74
HFNoseDetId::triggerCellV
int triggerCellV() const
Definition: HFNoseDetId.h:94
HGCalTopology::valid
bool valid(const DetId &id) const override
Is this a valid cell id.
Definition: HGCalTopology.cc:463
HGCalTriggerGeometryV9Imp2::trigger_layers_
std::vector< unsigned > trigger_layers_
Definition: HGCalTriggerGeometryV9Imp2.cc:73
HGCalTriggerGeometryBase::hscGeometry
const HGCalGeometry * hscGeometry() const
Definition: HGCalTriggerGeometryBase.h:58
HGCSiliconDetId::kHGCalWaferUSignOffset
static const int kHGCalWaferUSignOffset
Definition: HGCSiliconDetId.h:114
HGCHEF
Definition: ForwardSubdetector.h:9
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HGCalTriggerDetId::type
int type() const
get the type
Definition: HGCalTriggerDetId.h:47
HFNoseTriggerDetId::layer
int layer() const
get the layer #
Definition: HFNoseTriggerDetId.h:53
HGCalTriggerGeometryV9Imp2::layerWithOffset
unsigned layerWithOffset(unsigned) const
Definition: HGCalTriggerGeometryV9Imp2.cc:802
HFNoseDetId::waferV
int waferV() const
Definition: HFNoseDetId.h:78
HFNoseDetIdToModule::getTriggerDetIds
std::vector< HFNoseTriggerDetId > getTriggerDetIds(HFNoseDetId const &id) const
Definition: HFNoseDetIdToModule.cc:19
DetId::Forward
Definition: DetId.h:30
HGCSiliconDetIdToROC
Definition: HGCSiliconDetIdToROC.h:14
HGCalTriggerGeometryV9Imp2::disconnected_modules_
std::unordered_set< unsigned > disconnected_modules_
Definition: HGCalTriggerGeometryV9Imp2.cc:71
HGCalTriggerGeometryV9Imp2::getTriggerCellFromCell
unsigned getTriggerCellFromCell(const unsigned) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:186
HFNoseDetIdToModule
Definition: HFNoseDetIdToModule.h:8
Basic3DVector< float >
HGCalTriggerGeometryBase::noseTopology
const HGCalTopology & noseTopology() const
Definition: HGCalTriggerGeometryBase.h:64
HGCalTriggerDetId.h
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163
HGCSiliconDetId::waferV
int waferV() const
Definition: HGCSiliconDetId.h:77
HGCalTriggerGeometryV9Imp2::getOrderedCellsFromModule
geom_ordered_set getOrderedCellsFromModule(const unsigned) const final
Definition: HGCalTriggerGeometryV9Imp2.cc:362
HGCHEB
Definition: ForwardSubdetector.h:10
HGCSiliconDetIdToROC::getTriggerId
std::vector< std::pair< int, int > > getTriggerId(int roc, int type) const
Definition: HGCSiliconDetIdToROC.cc:57
HGCalTriggerGeometryV9Imp2::l1tLinksMapping_
edm::FileInPath l1tLinksMapping_
Definition: HGCalTriggerGeometryV9Imp2.cc:62
HGCSiliconDetId::layer
int layer() const
get the layer #
Definition: HGCSiliconDetId.h:57
HGCalTriggerGeometryBase::hscTopology
const HGCalTopology & hscTopology() const
Definition: HGCalTriggerGeometryBase.h:69