CMS 3D CMS Logo

HGCalTriggerGeometryHexImp2.cc
Go to the documentation of this file.
2 
6 
7 #include <fstream>
8 #include <iostream>
9 #include <regex>
10 #include <vector>
11 
13 public:
15 
16  void initialize(const CaloGeometry*) final;
17  void initialize(const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*) final;
18  void initialize(const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*) final;
19  void reset() final;
20 
21  unsigned getTriggerCellFromCell(const unsigned) const final;
22  unsigned getModuleFromCell(const unsigned) const final;
23  unsigned getModuleFromTriggerCell(const unsigned) const final;
24 
25  geom_set getCellsFromTriggerCell(const unsigned) const final;
26  geom_set getCellsFromModule(const unsigned) const final;
27  geom_set getTriggerCellsFromModule(const unsigned) const final;
28 
29  geom_ordered_set getOrderedCellsFromModule(const unsigned) const final;
30  geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned) const final;
31 
32  geom_set getNeighborsFromTriggerCell(const unsigned) const final;
33 
34  unsigned getLinksInModule(const unsigned module_id) const final;
35  unsigned getModuleSize(const unsigned module_id) const final;
36 
37  GlobalPoint getTriggerCellPosition(const unsigned) const final;
38  GlobalPoint getModulePosition(const unsigned) const final;
39 
40  bool validCell(const unsigned) const final;
41  bool validTriggerCell(const unsigned) const final;
42  bool disconnectedModule(const unsigned) const final;
43  unsigned lastTriggerLayer() const final;
44  unsigned triggerLayer(const unsigned) const final;
45 
46 private:
51 
52  // module related maps
53  std::unordered_map<short, short> wafer_to_module_ee_;
54  std::unordered_map<short, short> wafer_to_module_fh_;
55  std::unordered_multimap<short, short> module_to_wafers_ee_;
56  std::unordered_multimap<short, short> module_to_wafers_fh_;
57 
58  // trigger cell related maps
59  std::map<std::pair<short, short>, short> cells_to_trigger_cells_; // FIXME: something else than map<pair,short>?
60  std::multimap<std::pair<short, short>, short> trigger_cells_to_cells_; // FIXME: something else than map<pair,short>?
61  std::unordered_map<short, short> number_trigger_cells_in_wafers_; // the map key is the wafer type
62  std::unordered_map<short, short> number_cells_in_wafers_; // the map key is the wafer type
63  std::unordered_set<unsigned> invalid_triggercells_;
64 
65  // neighbor related maps
66  // trigger cell neighbors:
67  // - The key includes the trigger cell id and the wafer configuration.
68  // The wafer configuration is a 7 bits word encoding the type
69  // (small or large cells) of the wafer containing the trigger cell
70  // (central wafer) as well as the type of the 6 surrounding wafers
71  // - The value is a set of (wafer_idx, trigger_cell_id)
72  // wafer_idx is a number between 0 and 7. 0=central wafer, 1..7=surrounding
73  // wafers
74  std::unordered_map<int, std::set<std::pair<short, short>>> trigger_cell_neighbors_;
75  // wafer neighbors:
76  // List of the 6 surrounding neighbors around each wafer
77  std::unordered_map<short, std::vector<short>> wafer_neighbors_ee_;
78  std::unordered_map<short, std::vector<short>> wafer_neighbors_fh_;
79 
80  void fillMaps();
81  void fillNeighborMaps();
83  unsigned packTriggerCell(unsigned, const std::vector<int>&) const;
84  // returns transverse wafer type: -1=coarse, 1=fine, 0=undefined
85  int detIdWaferType(unsigned subdet, short wafer) const;
86  bool validCellId(unsigned subdet, unsigned cell_id) const;
87  bool validTriggerCellFromCells(const unsigned) const;
88 };
89 
92  l1tCellsMapping_(conf.getParameter<edm::FileInPath>("L1TCellsMapping")),
93  l1tCellNeighborsMapping_(conf.getParameter<edm::FileInPath>("L1TCellNeighborsMapping")),
94  l1tWaferNeighborsMapping_(conf.getParameter<edm::FileInPath>("L1TWaferNeighborsMapping")),
95  l1tModulesMapping_(conf.getParameter<edm::FileInPath>("L1TModulesMapping")) {}
96 
98  wafer_to_module_ee_.clear();
99  wafer_to_module_fh_.clear();
100  module_to_wafers_ee_.clear();
101  module_to_wafers_fh_.clear();
102  cells_to_trigger_cells_.clear();
103  trigger_cells_to_cells_.clear();
105  number_cells_in_wafers_.clear();
106 }
107 
109  setCaloGeometry(calo_geometry);
110  fillMaps();
113 }
114 
116  const HGCalGeometry* hgc_hsi_geometry,
117  const HGCalGeometry* hgc_hsc_geometry) {
118  throw cms::Exception("BadGeometry")
119  << "HGCalTriggerGeometryHexImp2 geometry cannot be initialized with the V9 HGCAL geometry";
120 }
121 
123  const HGCalGeometry* hgc_hsi_geometry,
124  const HGCalGeometry* hgc_hsc_geometry,
125  const HGCalGeometry* hgc_nose_geometry) {
126  throw cms::Exception("BadGeometry")
127  << "HGCalTriggerGeometryHexImp2 geometry cannot be initialized with the V9 HGCAL+Nose geometry";
128 }
129 
130 unsigned HGCalTriggerGeometryHexImp2::getTriggerCellFromCell(const unsigned cell_id) const {
131  if (DetId(cell_id).det() == DetId::Hcal)
132  return 0;
133  HGCalDetId cell_det_id(cell_id);
134  int wafer_type = cell_det_id.waferType();
135  unsigned cell = cell_det_id.cell();
136  // FIXME: better way to do this cell->TC mapping?
137  auto trigger_cell_itr = cells_to_trigger_cells_.find(std::make_pair(wafer_type, cell));
138  if (trigger_cell_itr == cells_to_trigger_cells_.end()) {
139  throw cms::Exception("BadGeometry") << "HGCalTriggerGeometry: HGCal cell " << cell
140  << " is not mapped to any trigger cell for the wafer type " << wafer_type
141  << ". The trigger cell mapping should be modified.\n";
142  }
143  unsigned trigger_cell = trigger_cell_itr->second;
144  return HGCalDetId((ForwardSubdetector)cell_det_id.subdetId(),
145  cell_det_id.zside(),
146  cell_det_id.layer(),
147  cell_det_id.waferType(),
148  cell_det_id.wafer(),
149  trigger_cell)
150  .rawId();
151 }
152 
153 unsigned HGCalTriggerGeometryHexImp2::getModuleFromCell(const unsigned cell_id) const {
154  if (DetId(cell_id).det() == DetId::Hcal)
155  return 0;
156  HGCalDetId cell_det_id(cell_id);
157  unsigned wafer = cell_det_id.wafer();
158  unsigned subdet = cell_det_id.subdetId();
159  std::unordered_map<short, short>::const_iterator module_itr;
160  bool out_of_range_error = false;
161  switch (subdet) {
163  module_itr = wafer_to_module_ee_.find(wafer);
164  if (module_itr == wafer_to_module_ee_.end())
165  out_of_range_error = true;
166  break;
168  module_itr = wafer_to_module_fh_.find(wafer);
169  if (module_itr == wafer_to_module_fh_.end())
170  out_of_range_error = true;
171  break;
172  default:
173  edm::LogError("HGCalTriggerGeometry") << "Unknown wafer->module mapping for subdet " << subdet << "\n";
174  return 0;
175  };
176  if (out_of_range_error) {
177  throw cms::Exception("BadGeometry") << "HGCalTriggerGeometry: Wafer " << wafer
178  << " is not mapped to any trigger module for subdetector " << subdet
179  << ". The module mapping should be modified. See "
180  "https://twiki.cern.ch/twiki/bin/viewauth/CMS/"
181  "HGCALTriggerPrimitivesSimulation#Trigger_geometry for details.\n";
182  }
183  unsigned module = module_itr->second;
184  return HGCalDetId((ForwardSubdetector)cell_det_id.subdetId(),
185  cell_det_id.zside(),
186  cell_det_id.layer(),
187  cell_det_id.waferType(),
188  module,
190  .rawId();
191 }
192 
193 unsigned HGCalTriggerGeometryHexImp2::getModuleFromTriggerCell(const unsigned trigger_cell_id) const {
194  HGCalDetId trigger_cell_det_id(trigger_cell_id);
195  unsigned wafer = trigger_cell_det_id.wafer();
196  unsigned subdet = trigger_cell_det_id.subdetId();
197  if (subdet == ForwardSubdetector::HGCHEB)
198  return 0;
199  std::unordered_map<short, short>::const_iterator module_itr;
200  bool out_of_range_error = false;
201  switch (subdet) {
203  module_itr = wafer_to_module_ee_.find(wafer);
204  if (module_itr == wafer_to_module_ee_.end())
205  out_of_range_error = true;
206  break;
208  module_itr = wafer_to_module_fh_.find(wafer);
209  if (module_itr == wafer_to_module_fh_.end())
210  out_of_range_error = true;
211  break;
212  default:
213  edm::LogError("HGCalTriggerGeometry") << "Unknown wafer->module mapping for subdet " << subdet << "\n";
214  return 0;
215  };
216  if (out_of_range_error) {
217  throw cms::Exception("BadGeometry") << "HGCalTriggerGeometry: Wafer " << wafer
218  << " is not mapped to any trigger module for subdetector " << subdet
219  << ". The module mapping should be modified. See "
220  "https://twiki.cern.ch/twiki/bin/viewauth/CMS/"
221  "HGCALTriggerPrimitivesSimulation#Trigger_geometry for details.\n";
222  }
223  unsigned module = module_itr->second;
224  return HGCalDetId((ForwardSubdetector)trigger_cell_det_id.subdetId(),
225  trigger_cell_det_id.zside(),
226  trigger_cell_det_id.layer(),
227  trigger_cell_det_id.waferType(),
228  module,
230  .rawId();
231 }
232 
234  const unsigned trigger_cell_id) const {
235  HGCalDetId trigger_cell_det_id(trigger_cell_id);
236  unsigned subdet = trigger_cell_det_id.subdetId();
237  if (subdet == ForwardSubdetector::HGCHEB)
238  return geom_set();
239  int wafer_type = trigger_cell_det_id.waferType();
240  unsigned trigger_cell = trigger_cell_det_id.cell();
241  // FIXME: better way to do this TC->cell mapping?
242  const auto& cell_range = trigger_cells_to_cells_.equal_range(std::make_pair(wafer_type, trigger_cell));
243  geom_set cell_det_ids;
244  for (auto tc_c_itr = cell_range.first; tc_c_itr != cell_range.second; tc_c_itr++) {
245  cell_det_ids.emplace(HGCalDetId((ForwardSubdetector)trigger_cell_det_id.subdetId(),
246  trigger_cell_det_id.zside(),
247  trigger_cell_det_id.layer(),
248  trigger_cell_det_id.waferType(),
249  trigger_cell_det_id.wafer(),
250  tc_c_itr->second)
251  .rawId());
252  }
253  return cell_det_ids;
254 }
255 
257  HGCalDetId module_det_id(module_id);
258  unsigned subdet = module_det_id.subdetId();
259  if (subdet == ForwardSubdetector::HGCHEB)
260  return geom_set();
261  unsigned module = module_det_id.wafer();
262  std::pair<std::unordered_multimap<short, short>::const_iterator, std::unordered_multimap<short, short>::const_iterator>
263  wafer_itrs;
264  switch (subdet) {
266  wafer_itrs = module_to_wafers_ee_.equal_range(module);
267  break;
269  wafer_itrs = module_to_wafers_fh_.equal_range(module);
270  break;
271  default:
272  edm::LogError("HGCalTriggerGeometry") << "Unknown module->wafers mapping for subdet " << subdet << "\n";
273  return geom_set();
274  };
275  geom_set cell_det_ids;
276  for (auto wafer_itr = wafer_itrs.first; wafer_itr != wafer_itrs.second; wafer_itr++) {
277  int wafer_type = detIdWaferType(subdet, wafer_itr->second);
278  if (wafer_type == 0)
279  wafer_type = module_det_id.waferType();
280  // loop on the cells in each wafer and return valid ones
281  for (int cell = 0; cell < number_cells_in_wafers_.at(wafer_type); cell++) {
282  HGCalDetId cell_id((ForwardSubdetector)module_det_id.subdetId(),
283  module_det_id.zside(),
284  module_det_id.layer(),
285  wafer_type,
286  wafer_itr->second,
287  cell);
288  if (validCellId(subdet, cell_id))
289  cell_det_ids.emplace(cell_id.rawId());
290  }
291  }
292  return cell_det_ids;
293 }
294 
296  const unsigned module_id) const {
297  HGCalDetId module_det_id(module_id);
298  unsigned subdet = module_det_id.subdetId();
299  if (subdet == ForwardSubdetector::HGCHEB)
300  return geom_ordered_set();
301  unsigned module = module_det_id.wafer();
302  std::pair<std::unordered_multimap<short, short>::const_iterator, std::unordered_multimap<short, short>::const_iterator>
303  wafer_itrs;
304  switch (subdet) {
306  wafer_itrs = module_to_wafers_ee_.equal_range(module);
307  break;
309  wafer_itrs = module_to_wafers_fh_.equal_range(module);
310  break;
311  default:
312  edm::LogError("HGCalTriggerGeometry") << "Unknown module->wafers mapping for subdet " << subdet << "\n";
313  return geom_ordered_set();
314  };
315  geom_ordered_set cell_det_ids;
316  for (auto wafer_itr = wafer_itrs.first; wafer_itr != wafer_itrs.second; wafer_itr++) {
317  int wafer_type = detIdWaferType(subdet, wafer_itr->second);
318  if (wafer_type == 0)
319  wafer_type = module_det_id.waferType();
320  // loop on the cells in each wafer
321  for (int cell = 0; cell < number_cells_in_wafers_.at(wafer_type); cell++) {
322  HGCalDetId cell_id((ForwardSubdetector)module_det_id.subdetId(),
323  module_det_id.zside(),
324  module_det_id.layer(),
325  wafer_type,
326  wafer_itr->second,
327  cell);
328  if (validCellId(subdet, cell_id))
329  cell_det_ids.emplace(cell_id.rawId());
330  }
331  }
332  return cell_det_ids;
333 }
334 
336  const unsigned module_id) const {
337  HGCalDetId module_det_id(module_id);
338  unsigned subdet = module_det_id.subdetId();
339  if (subdet == ForwardSubdetector::HGCHEB)
340  return geom_set();
341  unsigned module = module_det_id.wafer();
342  std::pair<std::unordered_multimap<short, short>::const_iterator, std::unordered_multimap<short, short>::const_iterator>
343  wafer_itrs;
344  switch (subdet) {
346  wafer_itrs = module_to_wafers_ee_.equal_range(module);
347  break;
349  wafer_itrs = module_to_wafers_fh_.equal_range(module);
350  break;
351  default:
352  edm::LogError("HGCalTriggerGeometry") << "Unknown module->wafers mapping for subdet " << subdet << "\n";
353  return geom_set();
354  };
355  geom_set trigger_cell_det_ids;
356  // loop on the wafers included in the module
357  for (auto wafer_itr = wafer_itrs.first; wafer_itr != wafer_itrs.second; wafer_itr++) {
358  int wafer_type = detIdWaferType(subdet, wafer_itr->second);
359  if (wafer_type == 0)
360  wafer_type = module_det_id.waferType();
361  // loop on the trigger cells in each wafer
362  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_.at(wafer_type); trigger_cell++) {
363  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(),
364  module_det_id.zside(),
365  module_det_id.layer(),
366  wafer_type,
367  wafer_itr->second,
368  trigger_cell);
369  if (validTriggerCell(trigger_cell_id))
370  trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
371  }
372  }
373  return trigger_cell_det_ids;
374 }
375 
377  const unsigned module_id) const {
378  HGCalDetId module_det_id(module_id);
379  unsigned subdet = module_det_id.subdetId();
380  if (subdet == ForwardSubdetector::HGCHEB)
381  return geom_ordered_set();
382  unsigned module = module_det_id.wafer();
383  std::pair<std::unordered_multimap<short, short>::const_iterator, std::unordered_multimap<short, short>::const_iterator>
384  wafer_itrs;
385  switch (subdet) {
387  wafer_itrs = module_to_wafers_ee_.equal_range(module);
388  break;
390  wafer_itrs = module_to_wafers_fh_.equal_range(module);
391  break;
392  default:
393  edm::LogError("HGCalTriggerGeometry") << "Unknown module->wafers mapping for subdet " << subdet << "\n";
394  return geom_ordered_set();
395  };
396  geom_ordered_set trigger_cell_det_ids;
397  // loop on the wafers included in the module
398  for (auto wafer_itr = wafer_itrs.first; wafer_itr != wafer_itrs.second; wafer_itr++) {
399  int wafer_type = detIdWaferType(subdet, wafer_itr->second);
400  if (wafer_type == 0)
401  wafer_type = module_det_id.waferType();
402  // loop on the trigger cells in each wafer
403  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_.at(wafer_type); trigger_cell++) {
404  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(),
405  module_det_id.zside(),
406  module_det_id.layer(),
407  wafer_type,
408  wafer_itr->second,
409  trigger_cell);
410  if (validTriggerCell(trigger_cell_id))
411  trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
412  }
413  }
414  return trigger_cell_det_ids;
415 }
416 
418  const unsigned trigger_cell_id) const {
419  HGCalDetId trigger_cell_det_id(trigger_cell_id);
420  unsigned wafer = trigger_cell_det_id.wafer();
421  int wafer_type = trigger_cell_det_id.waferType();
422  unsigned subdet = trigger_cell_det_id.subdetId();
423  unsigned trigger_cell = trigger_cell_det_id.cell();
424  if (subdet == ForwardSubdetector::HGCHEB)
425  return geom_set();
426  // Retrieve surrounding wafers (around the wafer containing
427  // the trigger cell)
428  std::unordered_map<short, std::vector<short>>::const_iterator surrounding_wafers_itr;
429  bool out_of_range_error = false;
430  switch (subdet) {
432  surrounding_wafers_itr = wafer_neighbors_ee_.find(wafer);
433  if (surrounding_wafers_itr == wafer_neighbors_ee_.end())
434  out_of_range_error = true;
435  break;
437  surrounding_wafers_itr = wafer_neighbors_fh_.find(wafer);
438  if (surrounding_wafers_itr == wafer_neighbors_fh_.end())
439  out_of_range_error = true;
440  break;
441  default:
442  edm::LogError("HGCalTriggerGeometry") << "Unknown wafer neighbours for subdet " << subdet << "\n";
443  return geom_set();
444  }
445  if (out_of_range_error) {
446  throw cms::Exception("BadGeometry") << "HGCalTriggerGeometry: Neighbors are not defined for wafer " << wafer
447  << " in subdetector " << subdet
448  << ". The wafer neighbor mapping should be modified. \n";
449  };
450  const std::vector<short>& surrounding_wafers = surrounding_wafers_itr->second;
451  // Find the types of the surrounding wafers
452  std::vector<int> types;
453  types.reserve(surrounding_wafers.size() + 1); // includes the central wafer -> +1
454  types.emplace_back(wafer_type);
455  for (const auto w : surrounding_wafers) {
456  // if no neighbor, use the same type as the central one
457  // to create the wafer configuration
458  int wt = wafer_type;
459  if (w != -1)
460  wt = detIdWaferType(subdet, w);
461  if (wt == 0)
462  return geom_set(); // invalid wafer type
463  types.emplace_back(wt);
464  }
465  // retrieve neighbors
466  unsigned trigger_cell_key = packTriggerCell(trigger_cell, types);
467  geom_set neighbor_detids;
468  auto neighbors_itr = trigger_cell_neighbors_.find(trigger_cell_key);
469  if (neighbors_itr == trigger_cell_neighbors_.end()) {
470  throw cms::Exception("BadGeometry") << "HGCalTriggerGeometry: Neighbors are not defined for trigger cell "
471  << trigger_cell << " with wafer configuration "
472  << std::bitset<7>(trigger_cell_key >> 8)
473  << ". The trigger cell neighbor mapping should be modified. \n";
474  }
475  const auto& neighbors = neighbors_itr->second;
476  // create HGCalDetId of neighbors and check their validity
477  neighbor_detids.reserve(neighbors.size());
478  for (const auto& wafer_tc : neighbors) {
479  if (wafer_tc.first - 1 >= (int)surrounding_wafers.size()) {
480  throw cms::Exception("BadGeometry")
481  << "HGCalTriggerGeometry: Undefined wafer neighbor number " << wafer_tc.first << " for wafer " << wafer
482  << " and trigger cell " << trigger_cell << ". The neighbor mapping files should be modified.";
483  }
484  int neighbor_wafer = (wafer_tc.first == 0 ? wafer : surrounding_wafers.at(wafer_tc.first - 1));
485  if (neighbor_wafer == -1)
486  continue; // non-existing wafer
487  int type = types.at(wafer_tc.first);
488  HGCalDetId neighbor_det_id((ForwardSubdetector)trigger_cell_det_id.subdetId(),
489  trigger_cell_det_id.zside(),
490  trigger_cell_det_id.layer(),
491  type,
492  neighbor_wafer,
493  wafer_tc.second);
494  if (validTriggerCell(neighbor_det_id.rawId())) {
495  neighbor_detids.emplace(neighbor_det_id.rawId());
496  }
497  }
498  return neighbor_detids;
499 }
500 
501 unsigned HGCalTriggerGeometryHexImp2::getLinksInModule(const unsigned module_id) const { return 1; }
502 
503 unsigned HGCalTriggerGeometryHexImp2::getModuleSize(const unsigned module_id) const { return 1; }
504 
505 GlobalPoint HGCalTriggerGeometryHexImp2::getTriggerCellPosition(const unsigned trigger_cell_det_id) const {
506  // Position: barycenter of the trigger cell.
507  Basic3DVector<float> triggerCellVector(0., 0., 0.);
508  const auto cell_ids = getCellsFromTriggerCell(trigger_cell_det_id);
509  if (cell_ids.empty())
510  return GlobalPoint(0, 0, 0);
511  for (const auto& cell : cell_ids) {
512  HGCalDetId cellDetId(cell);
513  triggerCellVector += (cellDetId.subdetId() == ForwardSubdetector::HGCEE ? eeGeometry()->getPosition(cellDetId)
514  : fhGeometry()->getPosition(cellDetId))
515  .basicVector();
516  }
517  return GlobalPoint(triggerCellVector / cell_ids.size());
518 }
519 
520 GlobalPoint HGCalTriggerGeometryHexImp2::getModulePosition(const unsigned module_det_id) const {
521  // Position: barycenter of the module.
522  Basic3DVector<float> moduleVector(0., 0., 0.);
523  const auto cell_ids = getCellsFromModule(module_det_id);
524  if (cell_ids.empty())
525  return GlobalPoint(0, 0, 0);
526  for (const auto& cell : cell_ids) {
527  HGCalDetId cellDetId(cell);
528  moduleVector += (cellDetId.subdetId() == ForwardSubdetector::HGCEE ? eeGeometry()->getPosition(cellDetId)
529  : fhGeometry()->getPosition(cellDetId))
530  .basicVector();
531  }
532  return GlobalPoint(moduleVector / cell_ids.size());
533 }
534 
536  //
537  // read module mapping file
538  std::ifstream l1tModulesMappingStream(l1tModulesMapping_.fullPath());
539  if (!l1tModulesMappingStream.is_open()) {
540  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TModulesMapping file\n";
541  }
542  short subdet = 0;
543  short wafer = 0;
544  short module = 0;
545  for (; l1tModulesMappingStream >> subdet >> wafer >> module;) {
546  int wafer_type = detIdWaferType(subdet, wafer);
547  switch (subdet) {
549  // fill module <-> wafers mappings
550  wafer_to_module_ee_.emplace(wafer, module);
551  module_to_wafers_ee_.emplace(module, wafer);
552  // fill number of cells for a given wafer type
553  number_cells_in_wafers_.emplace(wafer_type, eeTopology().dddConstants().numberCellsHexagon(wafer));
554  break;
555  }
557  // fill module <-> wafers mappings
558  wafer_to_module_fh_.emplace(wafer, module);
559  module_to_wafers_fh_.emplace(module, wafer);
560  // fill number of cells for a given wafer type
561  number_cells_in_wafers_.emplace(wafer_type, fhTopology().dddConstants().numberCellsHexagon(wafer));
562  break;
563  }
564  default:
565  edm::LogWarning("HGCalTriggerGeometry")
566  << "Unsupported subdetector number (" << subdet << ") in L1TModulesMapping file\n";
567  break;
568  }
569  }
570  if (!l1tModulesMappingStream.eof())
571  edm::LogWarning("HGCalTriggerGeometry") << "Error reading L1TModulesMapping '" << wafer << " " << module << "' \n";
572  l1tModulesMappingStream.close();
573  // read trigger cell mapping file
574  std::ifstream l1tCellsMappingStream(l1tCellsMapping_.fullPath());
575  if (!l1tCellsMappingStream.is_open()) {
576  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TCellsMapping file\n";
577  }
578  short waferType = 0;
579  short cell = 0;
580  short triggerCell = 0;
581  for (; l1tCellsMappingStream >> waferType >> cell >> triggerCell;) {
582  // fill cell <-> trigger cell mappings
583  cells_to_trigger_cells_.emplace(std::make_pair((waferType ? 1 : -1), cell), triggerCell);
584  trigger_cells_to_cells_.emplace(std::make_pair((waferType ? 1 : -1), triggerCell), cell);
585  // fill number of cells for a given wafer type
586  auto itr_insert = number_trigger_cells_in_wafers_.emplace((waferType ? 1 : -1), 0);
587  if (triggerCell + 1 > itr_insert.first->second)
588  itr_insert.first->second = triggerCell + 1;
589  }
590  if (!l1tCellsMappingStream.eof())
591  edm::LogWarning("HGCalTriggerGeometry")
592  << "Error reading L1TCellsMapping'" << waferType << " " << cell << " " << triggerCell << "' \n";
593  l1tCellsMappingStream.close();
594 }
595 
597  // Fill trigger neighbor map
598  std::ifstream l1tCellNeighborsMappingStream(l1tCellNeighborsMapping_.fullPath());
599  if (!l1tCellNeighborsMappingStream.is_open()) {
600  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TCellNeighborsMapping file\n";
601  }
602  for (std::array<char, 512> buffer; l1tCellNeighborsMappingStream.getline(&buffer[0], 512);) {
603  std::string line(&buffer[0]);
604  // Extract keys consisting of the wafer configuration
605  // and of the trigger cell id
606  // Match patterns (X,Y)
607  // where X is a set of 7 bits
608  // and Y is a number with less than 4 digits
609  std::regex key_regex("\\(\\s*[01]{7}\\s*,\\s*\\d{1,3}\\s*\\)");
610  std::vector<std::string> key_tokens{std::sregex_token_iterator(line.begin(), line.end(), key_regex), {}};
611  if (key_tokens.size() != 1) {
612  throw cms::Exception("BadGeometry") << "Syntax error in the L1TCellNeighborsMapping:\n"
613  << " Cannot find the trigger cell key in line:\n"
614  << " '" << &buffer[0] << "'\n";
615  }
616  std::regex digits_regex("([01]{7})|(\\d{1,3})");
617  std::vector<std::string> type_tc{
618  std::sregex_token_iterator(key_tokens[0].begin(), key_tokens[0].end(), digits_regex), {}};
619  // get cell id and wafer configuration
620  int trigger_cell = std::stoi(type_tc[1]);
621  std::vector<int> wafer_types;
622  wafer_types.reserve(type_tc[0].size());
623  // Convert waferType coarse=0, fine=1 to coarse=-1, fine=1
624  for (const char c : type_tc[0])
625  wafer_types.emplace_back((std::stoi(std::string(&c)) ? 1 : -1));
626  unsigned map_key = packTriggerCell(trigger_cell, wafer_types);
627  // Extract neighbors
628  // Match patterns (X,Y)
629  // where X is a number with less than 4 digits
630  // and Y is one single digit (the neighbor wafer, between 0 and 6)
631  std::regex neighbors_regex("\\(\\s*\\d{1,3}\\s*,\\s*\\d\\s*\\)");
632  std::vector<std::string> neighbors_tokens{std::sregex_token_iterator(line.begin(), line.end(), neighbors_regex),
633  {}};
634  if (neighbors_tokens.empty()) {
635  throw cms::Exception("BadGeometry") << "Syntax error in the L1TCellNeighborsMapping:\n"
636  << " Cannot find any neighbor in line:\n"
637  << " '" << &buffer[0] << "'\n";
638  }
639  auto itr_insert = trigger_cell_neighbors_.emplace(map_key, std::set<std::pair<short, short>>());
640  for (const auto& neighbor : neighbors_tokens) {
641  std::vector<std::string> pair_neighbor{std::sregex_token_iterator(neighbor.begin(), neighbor.end(), digits_regex),
642  {}};
643  short neighbor_wafer(std::stoi(pair_neighbor[1]));
644  short neighbor_cell(std::stoi(pair_neighbor[0]));
645  itr_insert.first->second.emplace(neighbor_wafer, neighbor_cell);
646  }
647  }
648  if (!l1tCellNeighborsMappingStream.eof())
649  edm::LogWarning("HGCalTriggerGeometry") << "Error reading L1TCellNeighborsMapping'\n";
650  l1tCellNeighborsMappingStream.close();
651 
652  // Fill wafer neighbor map
653  std::ifstream l1tWaferNeighborsMappingStream(l1tWaferNeighborsMapping_.fullPath());
654  if (!l1tWaferNeighborsMappingStream.is_open()) {
655  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TWaferNeighborsMapping file\n";
656  }
657  for (std::array<char, 512> buffer; l1tWaferNeighborsMappingStream.getline(&buffer[0], 512);) {
658  std::string line(&buffer[0]);
659  // split line using spaces as delimiter
660  std::regex delimiter("\\s+");
661  std::vector<std::string> tokens{std::sregex_token_iterator(line.begin(), line.end(), delimiter, -1), {}};
662  if (tokens.size() != 8) {
663  throw cms::Exception("BadGeometry")
664  << "Syntax error in the L1TWaferNeighborsMapping in line:\n"
665  << " '" << &buffer[0] << "'\n"
666  << " A line should be composed of 8 integers separated by spaces:\n"
667  << " subdet waferid neighbor1 neighbor2 neighbor3 neighbor4 neighbor5 neighbor6\n";
668  }
669  short subdet(std::stoi(tokens[0]));
670  short wafer(std::stoi(tokens[1]));
671 
672  std::unordered_map<short, std::vector<short>>* wafer_neighbors;
673  switch (subdet) {
675  wafer_neighbors = &wafer_neighbors_ee_;
676  break;
678  wafer_neighbors = &wafer_neighbors_fh_;
679  break;
680  default:
681  throw cms::Exception("BadGeometry") << "Unknown subdet " << subdet << " in L1TWaferNeighborsMapping:\n"
682  << " '" << &buffer[0] << "'\n";
683  };
684  auto wafer_itr = wafer_neighbors->emplace(wafer, std::vector<short>());
685  for (auto neighbor_itr = tokens.cbegin() + 2; neighbor_itr != tokens.cend(); ++neighbor_itr) {
686  wafer_itr.first->second.emplace_back(std::stoi(*neighbor_itr));
687  }
688  }
689 }
690 
692  unsigned n_layers_ee = eeTopology().dddConstants().layers(true);
693  for (unsigned layer = 1; layer <= n_layers_ee; layer++) {
694  for (const auto& wafer_module : wafer_to_module_ee_) {
695  unsigned wafer = wafer_module.first;
696  int wafer_type = detIdWaferType(ForwardSubdetector::HGCEE, wafer);
697  // loop on the trigger cells in each wafer
698  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_.at(wafer_type); trigger_cell++) {
699  HGCalDetId trigger_cell_id_neg(ForwardSubdetector::HGCEE, -1, layer, wafer_type, wafer, trigger_cell);
700  HGCalDetId trigger_cell_id_pos(ForwardSubdetector::HGCEE, 1, layer, wafer_type, wafer, trigger_cell);
701  if (!validTriggerCellFromCells(trigger_cell_id_neg))
702  invalid_triggercells_.emplace(trigger_cell_id_neg.rawId());
703  if (!validTriggerCellFromCells(trigger_cell_id_pos))
704  invalid_triggercells_.emplace(trigger_cell_id_pos.rawId());
705  }
706  }
707  }
708  unsigned n_layers_fh = fhTopology().dddConstants().layers(true);
709  for (unsigned layer = 1; layer <= n_layers_fh; layer++) {
710  for (const auto& wafer_module : wafer_to_module_fh_) {
711  unsigned wafer = wafer_module.first;
712  int wafer_type = detIdWaferType(ForwardSubdetector::HGCHEF, wafer);
713  // loop on the trigger cells in each wafer
714  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_.at(wafer_type); trigger_cell++) {
715  HGCalDetId trigger_cell_id_neg(ForwardSubdetector::HGCHEF, -1, layer, wafer_type, wafer, trigger_cell);
716  HGCalDetId trigger_cell_id_pos(ForwardSubdetector::HGCHEF, 1, layer, wafer_type, wafer, trigger_cell);
717  if (!validTriggerCellFromCells(trigger_cell_id_neg))
718  invalid_triggercells_.emplace(trigger_cell_id_neg.rawId());
719  if (!validTriggerCellFromCells(trigger_cell_id_pos))
720  invalid_triggercells_.emplace(trigger_cell_id_pos.rawId());
721  }
722  }
723  }
724 }
725 
726 unsigned HGCalTriggerGeometryHexImp2::packTriggerCell(unsigned trigger_cell,
727  const std::vector<int>& wafer_types) const {
728  unsigned packed_value = trigger_cell;
729  for (unsigned i = 0; i < wafer_types.size(); i++) {
730  // trigger cell id on 8 bits
731  // wafer configuration bits: 0=coarse, 1=fine
732  if (wafer_types.at(i) == 1)
733  packed_value += (0x1 << (8 + i));
734  }
735  return packed_value;
736 }
737 
738 int HGCalTriggerGeometryHexImp2::detIdWaferType(unsigned subdet, short wafer) const {
739  int wafer_type = 0;
740  switch (subdet) {
741  // HGCalDDDConstants::waferTypeT() returns 2=coarse, 1=fine
742  // HGCalDetId::waferType() returns -1=coarse, 1=fine
743  // Convert to HGCalDetId waferType
745  wafer_type = (eeTopology().dddConstants().waferTypeT(wafer) == 2 ? -1 : 1);
746  break;
748  wafer_type = (fhTopology().dddConstants().waferTypeT(wafer) == 2 ? -1 : 1);
749  break;
750  default:
751  break;
752  };
753  return wafer_type;
754 }
755 
756 bool HGCalTriggerGeometryHexImp2::validCell(unsigned cell_id) const {
757  bool is_valid = false;
758  if (DetId(cell_id).det() == DetId::Hcal) {
759  HcalDetId cell_det_id(cell_id);
760  if (cell_det_id.subdetId() != HcalEndcap)
761  is_valid = false;
762  else
763  is_valid = bhTopology().valid(cell_id);
764  } else if (DetId(cell_id).det() == DetId::Forward) {
765  HGCalDetId cell_det_id(cell_id);
766  unsigned subdet = cell_det_id.subdetId();
767  switch (subdet) {
769  is_valid = eeTopology().valid(cell_id);
770  break;
772  is_valid = fhTopology().valid(cell_id);
773  break;
774  default:
775  is_valid = false;
776  break;
777  }
778  }
779  return is_valid;
780 }
781 
782 bool HGCalTriggerGeometryHexImp2::validTriggerCell(const unsigned trigger_cell_id) const {
783  return invalid_triggercells_.find(trigger_cell_id) == invalid_triggercells_.end();
784 }
785 
786 bool HGCalTriggerGeometryHexImp2::disconnectedModule(const unsigned module_id) const { return false; }
787 
789 
790 unsigned HGCalTriggerGeometryHexImp2::triggerLayer(const unsigned id) const { return HGCalDetId(id).layer(); }
791 
792 bool HGCalTriggerGeometryHexImp2::validTriggerCellFromCells(const unsigned trigger_cell_id) const {
793  // Check the validity of a trigger cell with the
794  // validity of the cells. One valid cell in the
795  // trigger cell is enough to make the trigger cell
796  // valid.
797  HGCalDetId trigger_cell_det_id(trigger_cell_id);
798  unsigned subdet = trigger_cell_det_id.subdetId();
799  const geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
800  bool is_valid = false;
801  for (const auto cell_id : cells) {
802  is_valid |= validCellId(subdet, cell_id);
803  if (is_valid)
804  break;
805  }
806  return is_valid;
807 }
808 
809 bool HGCalTriggerGeometryHexImp2::validCellId(unsigned subdet, unsigned cell_id) const {
810  bool is_valid = false;
811  switch (subdet) {
813  is_valid = eeTopology().valid(cell_id);
814  break;
816  is_valid = fhTopology().valid(cell_id);
817  break;
818  default:
819  is_valid = false;
820  break;
821  }
822  return is_valid;
823 }
824 
HGCalTriggerGeometryHexImp2::number_trigger_cells_in_wafers_
std::unordered_map< short, short > number_trigger_cells_in_wafers_
Definition: HGCalTriggerGeometryHexImp2.cc:61
HGCalTriggerGeometryBase::eeTopology
const HGCalTopology & eeTopology() const
Definition: HGCalTriggerGeometryBase.h:65
HGCalTriggerGeometryBase
Definition: HGCalTriggerGeometryBase.h:19
mps_fire.i
i
Definition: mps_fire.py:355
HGCalTopology::dddConstants
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98
HGCalTriggerGeometryHexImp2::trigger_cell_neighbors_
std::unordered_map< int, std::set< std::pair< short, short > > > trigger_cell_neighbors_
Definition: HGCalTriggerGeometryHexImp2.cc:74
HGCalTriggerGeometryHexImp2::l1tCellNeighborsMapping_
edm::FileInPath l1tCellNeighborsMapping_
Definition: HGCalTriggerGeometryHexImp2.cc:48
HGCalDDDConstants::waferTypeT
int waferTypeT(int wafer) const
Definition: HGCalDDDConstants.h:169
HGCalTriggerGeometryHexImp2::getTriggerCellPosition
GlobalPoint getTriggerCellPosition(const unsigned) const final
Definition: HGCalTriggerGeometryHexImp2.cc:505
HGCalTriggerGeometryHexImp2::getOrderedTriggerCellsFromModule
geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned) const final
Definition: HGCalTriggerGeometryHexImp2.cc:376
makeHLTPrescaleTable.delimiter
delimiter
Definition: makeHLTPrescaleTable.py:181
ForwardSubdetector
ForwardSubdetector
Definition: ForwardSubdetector.h:4
HGCalTriggerGeometryHexImp2::wafer_neighbors_fh_
std::unordered_map< short, std::vector< short > > wafer_neighbors_fh_
Definition: HGCalTriggerGeometryHexImp2.cc:78
edm
HLT enums.
Definition: AlignableModifier.h:19
DetId::Hcal
Definition: DetId.h:28
HGCalDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCalDetId.h:49
HGCalTriggerGeometryHexImp2::disconnectedModule
bool disconnectedModule(const unsigned) const final
Definition: HGCalTriggerGeometryHexImp2.cc:786
HGCalTriggerGeometryHexImp2::validTriggerCell
bool validTriggerCell(const unsigned) const final
Definition: HGCalTriggerGeometryHexImp2.cc:782
HGCalTriggerGeometryHexImp2::wafer_neighbors_ee_
std::unordered_map< short, std::vector< short > > wafer_neighbors_ee_
Definition: HGCalTriggerGeometryHexImp2.cc:77
HGCalTriggerGeometryHexImp2::HGCalTriggerGeometryHexImp2
HGCalTriggerGeometryHexImp2(const edm::ParameterSet &conf)
Definition: HGCalTriggerGeometryHexImp2.cc:90
HGCalTriggerGeometryHexImp2::fillMaps
void fillMaps()
Definition: HGCalTriggerGeometryHexImp2.cc:535
HGCalDetId::layer
int layer() const
get the layer #
Definition: HGCalDetId.h:46
HGCalTriggerGeometryHexImp2::getTriggerCellFromCell
unsigned getTriggerCellFromCell(const unsigned) const final
Definition: HGCalTriggerGeometryHexImp2.cc:130
end
#define end
Definition: vmac.h:39
ForwardSubdetector.h
FileInPath.h
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
DetId
Definition: DetId.h:17
edm::FileInPath
Definition: FileInPath.h:64
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
CaloGeometry
Definition: CaloGeometry.h:21
HGCalTriggerGeometryBase.h
HGCalTriggerGeometryHexImp2::invalid_triggercells_
std::unordered_set< unsigned > invalid_triggercells_
Definition: HGCalTriggerGeometryHexImp2.cc:63
w
const double w
Definition: UKUtility.cc:23
HGCalTriggerGeometryHexImp2::getLinksInModule
unsigned getLinksInModule(const unsigned module_id) const final
Definition: HGCalTriggerGeometryHexImp2.cc:501
HGCalTriggerGeometryHexImp2::module_to_wafers_ee_
std::unordered_multimap< short, short > module_to_wafers_ee_
Definition: HGCalTriggerGeometryHexImp2.cc:55
HGCalTriggerGeometryHexImp2::getCellsFromModule
geom_set getCellsFromModule(const unsigned) const final
Definition: HGCalTriggerGeometryHexImp2.cc:256
HGCalTriggerGeometryHexImp2::getTriggerCellsFromModule
geom_set getTriggerCellsFromModule(const unsigned) const final
Definition: HGCalTriggerGeometryHexImp2.cc:335
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
HGCalTriggerGeometryHexImp2::getModuleFromTriggerCell
unsigned getModuleFromTriggerCell(const unsigned) const final
Definition: HGCalTriggerGeometryHexImp2.cc:193
Point3DBase< float, GlobalTag >
HGCalGeometry
Definition: HGCalGeometry.h:30
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
HGCalTriggerGeometryHexImp2::detIdWaferType
int detIdWaferType(unsigned subdet, short wafer) const
Definition: HGCalTriggerGeometryHexImp2.cc:738
HGCalTriggerGeometryHexImp2::reset
void reset() final
Definition: HGCalTriggerGeometryHexImp2.cc:97
HGCalTriggerGeometryHexImp2::validCell
bool validCell(const unsigned) const final
Definition: HGCalTriggerGeometryHexImp2.cc:756
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
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalTriggerGeometryBase::fhGeometry
const HGCalGeometry * fhGeometry() const
Definition: HGCalTriggerGeometryBase.h:46
HGCalTriggerGeometryHexImp2::packTriggerCell
unsigned packTriggerCell(unsigned, const std::vector< int > &) const
Definition: HGCalTriggerGeometryHexImp2.cc:726
HGCEE
Definition: ForwardSubdetector.h:8
edm::LogWarning
Definition: MessageLogger.h:141
HGCalDetId::waferType
int waferType() const
get the wafer type
Definition: HGCalDetId.h:43
HGCalTriggerGeometryHexImp2::getModulePosition
GlobalPoint getModulePosition(const unsigned) const final
Definition: HGCalTriggerGeometryHexImp2.cc:520
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
HGCalTriggerGeometryHexImp2::getNeighborsFromTriggerCell
geom_set getNeighborsFromTriggerCell(const unsigned) const final
Definition: HGCalTriggerGeometryHexImp2.cc:417
HGCalTriggerGeometryHexImp2::getModuleSize
unsigned getModuleSize(const unsigned module_id) const final
Definition: HGCalTriggerGeometryHexImp2.cc:503
HGCalTriggerGeometryHexImp2::lastTriggerLayer
unsigned lastTriggerLayer() const final
Definition: HGCalTriggerGeometryHexImp2.cc:788
edmplugin::PluginFactory
Definition: PluginFactory.h:34
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:558
HcalDetId
Definition: HcalDetId.h:12
HGCalTriggerGeometryHexImp2::getModuleFromCell
unsigned getModuleFromCell(const unsigned) const final
Definition: HGCalTriggerGeometryHexImp2.cc:153
HGCalTriggerGeometryHexImp2::validCellId
bool validCellId(unsigned subdet, unsigned cell_id) const
Definition: HGCalTriggerGeometryHexImp2.cc:809
HGCalTriggerGeometryBase::bhTopology
const HcalTopology & bhTopology() const
Definition: HGCalTriggerGeometryBase.h:67
HGCalTriggerGeometryBase::geom_set
std::unordered_set< unsigned > geom_set
Definition: HGCalTriggerGeometryBase.h:22
HGCalGeometry::getPosition
GlobalPoint getPosition(const DetId &id) const
Definition: HGCalGeometry.cc:192
HGCalTriggerGeometryHexImp2::cells_to_trigger_cells_
std::map< std::pair< short, short >, short > cells_to_trigger_cells_
Definition: HGCalTriggerGeometryHexImp2.cc:59
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
HGCalTriggerGeometryHexImp2::triggerLayer
unsigned triggerLayer(const unsigned) const final
Definition: HGCalTriggerGeometryHexImp2.cc:790
module
Definition: vlib.h:198
types
types
Definition: AlignPCLThresholds_PayloadInspector.cc:30
HGCalTriggerGeometryHexImp2::fillInvalidTriggerCells
void fillInvalidTriggerCells()
Definition: HGCalTriggerGeometryHexImp2.cc:691
HcalTopology::valid
bool valid(const DetId &id) const override
Definition: HcalTopology.cc:225
HGCalDetId::wafer
int wafer() const
get the wafer #
Definition: HGCalDetId.h:40
HGCalDetId
Definition: HGCalDetId.h:8
HGCalTriggerGeometryHexImp2::fillNeighborMaps
void fillNeighborMaps()
Definition: HGCalTriggerGeometryHexImp2.cc:596
HGCalTriggerGeometryBase::eeGeometry
const HGCalGeometry * eeGeometry() const
Definition: HGCalTriggerGeometryBase.h:41
HGCalDetId::kHGCalCellMask
static const int kHGCalCellMask
Definition: HGCalDetId.h:11
type
type
Definition: HCALResponse.h:21
HGCalDetId.h
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
HGCalTriggerGeometryHexImp2::validTriggerCellFromCells
bool validTriggerCellFromCells(const unsigned) const
Definition: HGCalTriggerGeometryHexImp2.cc:792
HcalEndcap
Definition: HcalAssistant.h:34
HGCalTriggerGeometryHexImp2::l1tWaferNeighborsMapping_
edm::FileInPath l1tWaferNeighborsMapping_
Definition: HGCalTriggerGeometryHexImp2.cc:49
Exception
Definition: hltDiff.cc:246
HGCalTriggerGeometryHexImp2
Definition: HGCalTriggerGeometryHexImp2.cc:12
postprocess-scan-build.cells
cells
Definition: postprocess-scan-build.py:13
HGCalTriggerGeometryHexImp2::wafer_to_module_fh_
std::unordered_map< short, short > wafer_to_module_fh_
Definition: HGCalTriggerGeometryHexImp2.cc:54
HGCalTriggerGeometryBase::setCaloGeometry
void setCaloGeometry(const CaloGeometry *geom)
Definition: HGCalTriggerGeometryBase.h:106
HGCalTriggerGeometryHexImp2::getCellsFromTriggerCell
geom_set getCellsFromTriggerCell(const unsigned) const final
Definition: HGCalTriggerGeometryHexImp2.cc:233
HGCalTopology::valid
bool valid(const DetId &id) const override
Is this a valid cell id.
Definition: HGCalTopology.cc:464
HGCHEF
Definition: ForwardSubdetector.h:9
HGCalTriggerGeometryHexImp2::l1tModulesMapping_
edm::FileInPath l1tModulesMapping_
Definition: HGCalTriggerGeometryHexImp2.cc:50
HGCalTriggerGeometryHexImp2::wafer_to_module_ee_
std::unordered_map< short, short > wafer_to_module_ee_
Definition: HGCalTriggerGeometryHexImp2.cc:53
DetId::Forward
Definition: DetId.h:30
HGCalTriggerGeometryHexImp2::initialize
void initialize(const CaloGeometry *) final
Definition: HGCalTriggerGeometryHexImp2.cc:108
mps_splice.line
line
Definition: mps_splice.py:76
HGCalTriggerGeometryHexImp2::number_cells_in_wafers_
std::unordered_map< short, short > number_cells_in_wafers_
Definition: HGCalTriggerGeometryHexImp2.cc:62
begin
#define begin
Definition: vmac.h:32
HGCalDetId::cell
int cell() const
get the absolute value of the cell #'s in x and y
Definition: HGCalDetId.h:37
HGCalTriggerGeometryHexImp2::module_to_wafers_fh_
std::unordered_multimap< short, short > module_to_wafers_fh_
Definition: HGCalTriggerGeometryHexImp2.cc:56
Basic3DVector< float >
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163
HGCalTriggerGeometryHexImp2::getOrderedCellsFromModule
geom_ordered_set getOrderedCellsFromModule(const unsigned) const final
Definition: HGCalTriggerGeometryHexImp2.cc:295
HGCHEB
Definition: ForwardSubdetector.h:10
HGCalTriggerGeometryHexImp2::trigger_cells_to_cells_
std::multimap< std::pair< short, short >, short > trigger_cells_to_cells_
Definition: HGCalTriggerGeometryHexImp2.cc:60
HGCalTriggerGeometryHexImp2::l1tCellsMapping_
edm::FileInPath l1tCellsMapping_
Definition: HGCalTriggerGeometryHexImp2.cc:47
HGCalTriggerGeometryBase::fhTopology
const HGCalTopology & fhTopology() const
Definition: HGCalTriggerGeometryBase.h:66
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443