CMS 3D CMS Logo

HGCalTriggerGeometryV9Imp1.cc
Go to the documentation of this file.
2 
7 
8 #include <vector>
9 #include <iostream>
10 #include <fstream>
11 #include <regex>
12 
14 public:
16 
17  void initialize(const edm::ESHandle<CaloGeometry>&) final;
20  const edm::ESHandle<HGCalGeometry>&) final;
21  void reset() final;
22 
23  unsigned getTriggerCellFromCell(const unsigned) const final;
24  unsigned getModuleFromCell(const unsigned) const final;
25  unsigned getModuleFromTriggerCell(const unsigned) const final;
26 
27  geom_set getCellsFromTriggerCell(const unsigned) const final;
28  geom_set getCellsFromModule(const unsigned) const final;
29  geom_set getTriggerCellsFromModule(const unsigned) const final;
30 
31  geom_ordered_set getOrderedCellsFromModule(const unsigned) const final;
32  geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned) const final;
33 
34  geom_set getNeighborsFromTriggerCell(const unsigned) const final;
35 
36  GlobalPoint getTriggerCellPosition(const unsigned) const final;
37  GlobalPoint getModulePosition(const unsigned) const final;
38 
39  bool validTriggerCell(const unsigned) const final;
40  bool disconnectedModule(const unsigned) const final;
41  unsigned triggerLayer(const unsigned) const final;
42 
43 private:
50 
51  // module related maps
52  std::unordered_map<unsigned, unsigned> wafer_to_module_;
53  std::unordered_multimap<unsigned, unsigned> module_to_wafers_;
54 
55  // trigger cell related maps
56  std::unordered_map<unsigned, unsigned> cells_to_trigger_cells_;
57  std::unordered_multimap<unsigned, unsigned> trigger_cells_to_cells_;
58  std::unordered_map<unsigned, unsigned> cells_to_trigger_cells_sci_;
59  std::unordered_multimap<unsigned, unsigned> trigger_cells_to_cells_sci_;
60  std::unordered_map<unsigned, unsigned short> number_trigger_cells_in_wafers_;
61  std::unordered_map<unsigned, unsigned short> number_trigger_cells_in_wafers_sci_;
62  std::unordered_map<unsigned, unsigned> wafers_to_wafers_old_;
63  std::unordered_map<unsigned, unsigned> wafers_old_to_wafers_;
64  std::unordered_set<unsigned> invalid_triggercells_;
65 
66  // neighbor related maps
67  // trigger cell neighbors:
68  // - The key includes the module and trigger cell id
69  // - The value is a set of (module_id, trigger_cell_id)
70  typedef std::unordered_map<int, std::set<std::pair<short, short>>> neighbor_map;
73 
74  // Disconnected modules and layers
75  std::unordered_set<unsigned> disconnected_modules_;
76  std::unordered_set<unsigned> disconnected_layers_;
77  std::vector<unsigned> trigger_layers_;
78 
79  // layer offsets
80  unsigned heOffset_;
81  unsigned totalLayers_;
82 
83  void fillMaps();
84  void fillNeighborMap(const edm::FileInPath&, neighbor_map&, bool);
86  unsigned packTriggerCell(unsigned, unsigned) const;
87  unsigned packTriggerCellWithType(unsigned, unsigned, unsigned) const;
88  bool validCellId(unsigned det, unsigned cell_id) const;
89  bool validTriggerCellFromCells(const unsigned) const;
90 
91  int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const;
92  unsigned packWaferCellId(unsigned subdet, unsigned wafer, unsigned cell) const;
93  unsigned packWaferId(int waferU, int waferV) const;
94  unsigned packCellId(unsigned type, unsigned cellU, unsigned cellV) const;
95  unsigned packCellId(unsigned type, unsigned cell) const;
96  unsigned packIetaIphi(unsigned ieta, unsigned iphi) const;
97  void unpackWaferCellId(unsigned wafer_cell, unsigned& wafer, unsigned& cell) const;
98  void unpackWaferId(unsigned wafer, int& waferU, int& waferV) const;
99  void unpackCellId(unsigned cell, unsigned& cellU, unsigned& cellV) const;
100  void unpackIetaIphi(unsigned ieta_iphi, unsigned& ieta, unsigned& iphi) const;
101 
102  unsigned layerWithOffset(unsigned) const;
103 };
104 
106  : HGCalTriggerGeometryBase(conf),
107  l1tCellsMapping_(conf.getParameter<edm::FileInPath>("L1TCellsMapping")),
108  l1tCellsSciMapping_(conf.getParameter<edm::FileInPath>("L1TCellsSciMapping")),
109  l1tWafersMapping_(conf.getParameter<edm::FileInPath>("L1TWafersMapping")),
110  l1tModulesMapping_(conf.getParameter<edm::FileInPath>("L1TModulesMapping")),
111  l1tCellNeighborsMapping_(conf.getParameter<edm::FileInPath>("L1TCellNeighborsMapping")),
112  l1tCellNeighborsSciMapping_(conf.getParameter<edm::FileInPath>("L1TCellNeighborsSciMapping")) {
113  std::vector<unsigned> tmp_vector = conf.getParameter<std::vector<unsigned>>("DisconnectedModules");
114  std::move(tmp_vector.begin(), tmp_vector.end(), std::inserter(disconnected_modules_, disconnected_modules_.end()));
115  tmp_vector = conf.getParameter<std::vector<unsigned>>("DisconnectedLayers");
116  std::move(tmp_vector.begin(), tmp_vector.end(), std::inserter(disconnected_layers_, disconnected_layers_.end()));
117 }
118 
120  cells_to_trigger_cells_.clear();
121  trigger_cells_to_cells_.clear();
124  wafers_to_wafers_old_.clear();
125  wafers_old_to_wafers_.clear();
126  wafer_to_module_.clear();
127  module_to_wafers_.clear();
130  trigger_cell_neighbors_.clear();
132 }
133 
135  throw cms::Exception("BadGeometry")
136  << "HGCalTriggerGeometryV9Imp1 geometry cannot be initialized with the V7/V8 HGCAL geometry";
137 }
138 
140  const edm::ESHandle<HGCalGeometry>& hgc_hsi_geometry,
141  const edm::ESHandle<HGCalGeometry>& hgc_hsc_geometry) {
142  setEEGeometry(hgc_ee_geometry);
143  setHSiGeometry(hgc_hsi_geometry);
144  setHScGeometry(hgc_hsc_geometry);
147  trigger_layers_.resize(totalLayers_ + 1);
148  trigger_layers_[0] = 0; // layer number 0 doesn't exist
149  unsigned trigger_layer = 1;
150  for (unsigned layer = 1; layer < trigger_layers_.size(); layer++) {
151  if (disconnected_layers_.find(layer) == disconnected_layers_.end()) {
152  // Increase trigger layer number if the layer is not disconnected
153  trigger_layers_[layer] = trigger_layer;
154  trigger_layer++;
155  } else {
156  trigger_layers_[layer] = 0;
157  }
158  }
159  fillMaps();
163 }
164 
165 unsigned HGCalTriggerGeometryV9Imp1::getTriggerCellFromCell(const unsigned cell_id) const {
166  unsigned det = DetId(cell_id).det();
167  unsigned subdet = 0;
168  int zside = 0;
169  unsigned tc_type = 1;
170  unsigned layer = 0;
171  unsigned wafer_trigger_cell = 0;
172  unsigned trigger_cell = 0;
173  // Scintillator
174  if (det == DetId::HGCalHSc) {
175  HGCScintillatorDetId cell_det_id(cell_id);
176  unsigned ieta = cell_det_id.ietaAbs();
177  unsigned iphi = cell_det_id.iphi();
178  tc_type = cell_det_id.type();
179  layer = cell_det_id.layer();
181  zside = cell_det_id.zside();
182  auto trigger_cell_itr = cells_to_trigger_cells_sci_.find(packIetaIphi(ieta, iphi));
183  if (trigger_cell_itr == cells_to_trigger_cells_sci_.end()) {
184  throw cms::Exception("BadGeometry")
185  << "HGCalTriggerGeometry: scintillator cell ieta=" << ieta << ", iphi=" << iphi
186  << " is not mapped to any trigger cell. The trigger cell mapping should be modified.\n";
187  }
188  trigger_cell = 0;
189  wafer_trigger_cell = 0;
190  unpackWaferCellId(trigger_cell_itr->second, wafer_trigger_cell, trigger_cell);
191  }
192  // Silicon
193  else if (det == DetId::HGCalEE || det == DetId::HGCalHSi) {
194  HGCSiliconDetId cell_det_id(cell_id);
196  layer = cell_det_id.layer();
197  zside = cell_det_id.zside();
198  int type = cell_det_id.type();
199  int waferu = cell_det_id.waferU();
200  int waferv = cell_det_id.waferV();
201  unsigned cellu = cell_det_id.cellU();
202  unsigned cellv = cell_det_id.cellV();
203  auto trigger_cell_itr = cells_to_trigger_cells_.find(packCellId(type, cellu, cellv));
204  if (trigger_cell_itr == cells_to_trigger_cells_.end()) {
205  throw cms::Exception("BadGeometry")
206  << "HGCalTriggerGeometry: HGCal cell " << cellu << "," << cellv << " in wafer type " << type
207  << " is not mapped to any trigger cell. The trigger cell mapping should be modified.\n";
208  }
209  auto wafer_trigger_cell_itr = wafers_to_wafers_old_.find(packWaferId(waferu, waferv));
210  if (wafer_trigger_cell_itr == wafers_to_wafers_old_.end()) {
211  throw cms::Exception("BadGeometry")
212  << "HGCalTriggerGeometry: Wafer " << waferu << "," << waferv
213  << " is not mapped to any trigger wafer ID. The wafer mapping should be modified.\n";
214  }
215  trigger_cell = trigger_cell_itr->second;
216  wafer_trigger_cell = wafer_trigger_cell_itr->second;
217  }
218  // Using the old HGCalDetId for trigger cells is temporary
219  // For easy switch between V8 and V9 geometries
220  return HGCalDetId((ForwardSubdetector)subdet, zside, layer, tc_type, wafer_trigger_cell, trigger_cell).rawId();
221 }
222 
223 unsigned HGCalTriggerGeometryV9Imp1::getModuleFromCell(const unsigned cell_id) const {
225 }
226 
227 unsigned HGCalTriggerGeometryV9Imp1::getModuleFromTriggerCell(const unsigned trigger_cell_id) const {
228  HGCalDetId trigger_cell_det_id(trigger_cell_id);
229  unsigned module = 0;
230  // Scintillator
231  if (trigger_cell_det_id.subdetId() == ForwardSubdetector::HGCHEB) {
232  // For scintillator, the module ID is currently encoded as the wafer in HGCalDetId
233  module = trigger_cell_det_id.wafer();
234  }
235  // Silicon
236  else {
237  auto module_itr = wafer_to_module_.find(trigger_cell_det_id.wafer());
238  if (module_itr == wafer_to_module_.end()) {
239  throw cms::Exception("BadGeometry")
240  << trigger_cell_det_id << "HGCalTriggerGeometry: Wafer " << trigger_cell_det_id.wafer()
241  << " is not mapped to any trigger module. The module mapping should be modified. See "
242  "https://twiki.cern.ch/twiki/bin/viewauth/CMS/HGCALTriggerPrimitivesSimulation#Trigger_geometry for "
243  "details.\n";
244  }
245  module = module_itr->second;
246  }
247  return HGCalDetId((ForwardSubdetector)trigger_cell_det_id.subdetId(),
248  trigger_cell_det_id.zside(),
249  trigger_cell_det_id.layer(),
250  trigger_cell_det_id.waferType(),
251  module,
253  .rawId();
254 }
255 
257  const unsigned trigger_cell_id) const {
258  HGCalDetId trigger_cell_det_id(trigger_cell_id);
259  geom_set cell_det_ids;
260  unsigned subdet = trigger_cell_det_id.subdetId();
261  unsigned trigger_wafer = trigger_cell_det_id.wafer();
262  unsigned trigger_cell = trigger_cell_det_id.cell();
263  unsigned layer = trigger_cell_det_id.layer();
264  // Scintillator
265  if (subdet == ForwardSubdetector::HGCHEB) {
266  int type = hscTopology().dddConstants().getTypeTrap(layer);
267  const auto& cell_range =
268  trigger_cells_to_cells_sci_.equal_range(packWaferCellId(subdet, trigger_wafer, trigger_cell));
269  for (auto tc_c_itr = cell_range.first; tc_c_itr != cell_range.second; tc_c_itr++) {
270  unsigned ieta = 0;
271  unsigned iphi = 0;
272  unpackIetaIphi(tc_c_itr->second, ieta, iphi);
273  unsigned cell_det_id = HGCScintillatorDetId(type, layer, trigger_cell_det_id.zside() * ieta, iphi).rawId();
274  if (validCellId(subdet, cell_det_id))
275  cell_det_ids.emplace(cell_det_id);
276  }
277  }
278  // Silicon
279  else {
280  int waferu = 0;
281  int waferv = 0;
282  auto wafer_itr = wafers_old_to_wafers_.find(trigger_wafer);
283  if (wafer_itr == wafers_old_to_wafers_.end()) {
284  throw cms::Exception("BadGeometry") << "HGCalTriggerGeometry: Trigger wafer ID " << trigger_wafer
285  << " is not mapped to any wafer. The wafer mapping should be modified.\n";
286  }
287  unpackWaferId(wafer_itr->second, waferu, waferv);
288  DetId::Detector det =
289  (trigger_cell_det_id.subdetId() == ForwardSubdetector::HGCEE ? DetId::HGCalEE : DetId::HGCalHSi);
290  unsigned wafer_type = detIdWaferType(det, layer, waferu, waferv);
291  const auto& cell_range = trigger_cells_to_cells_.equal_range(packCellId(wafer_type, trigger_cell));
292  for (auto tc_c_itr = cell_range.first; tc_c_itr != cell_range.second; tc_c_itr++) {
293  unsigned cellu = 0;
294  unsigned cellv = 0;
295  unpackCellId(tc_c_itr->second, cellu, cellv);
296  unsigned cell_det_id =
297  HGCSiliconDetId(det, trigger_cell_det_id.zside(), wafer_type, layer, waferu, waferv, cellu, cellv).rawId();
298  if (validCellId(subdet, cell_det_id))
299  cell_det_ids.emplace(cell_det_id);
300  }
301  }
302  return cell_det_ids;
303 }
304 
306  geom_set cell_det_ids;
307  geom_set trigger_cells = getTriggerCellsFromModule(module_id);
308  for (auto trigger_cell_id : trigger_cells) {
309  geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
310  cell_det_ids.insert(cells.begin(), cells.end());
311  }
312  return cell_det_ids;
313 }
314 
316  const unsigned module_id) const {
317  geom_ordered_set cell_det_ids;
318  geom_ordered_set trigger_cells = getOrderedTriggerCellsFromModule(module_id);
319  for (auto trigger_cell_id : trigger_cells) {
320  geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
321  cell_det_ids.insert(cells.begin(), cells.end());
322  }
323  return cell_det_ids;
324 }
325 
327  const unsigned module_id) const {
328  HGCalDetId module_det_id(module_id);
329  geom_set trigger_cell_det_ids;
330  unsigned module = module_det_id.wafer();
331  // Scintillator
332  if (module_det_id.subdetId() == ForwardSubdetector::HGCHEB) {
333  // loop on the trigger cells in each module
334  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_sci_.at(module); trigger_cell++) {
335  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(),
336  module_det_id.zside(),
337  module_det_id.layer(),
338  module_det_id.waferType(),
339  module,
340  trigger_cell);
341  if (validTriggerCell(trigger_cell_id))
342  trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
343  }
344  }
345  // Silicon
346  else {
347  auto wafer_itrs = module_to_wafers_.equal_range(module);
348  // loop on the wafers included in the module
349  for (auto wafer_itr = wafer_itrs.first; wafer_itr != wafer_itrs.second; wafer_itr++) {
350  unsigned wafer = wafer_itr->second;
351  auto waferuv_itr = wafers_old_to_wafers_.find(wafer);
352  if (waferuv_itr == wafers_old_to_wafers_.end())
353  continue;
354  int waferu = 0;
355  int waferv = 0;
356  unpackWaferId(waferuv_itr->second, waferu, waferv);
358  unsigned layer = module_det_id.layer();
359  unsigned wafer_type = detIdWaferType(det, layer, waferu, waferv);
360  // loop on the trigger cells in each wafer
361  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_.at(wafer_type); trigger_cell++) {
362  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(),
363  module_det_id.zside(),
364  module_det_id.layer(),
365  module_det_id.waferType(),
366  wafer,
367  trigger_cell);
368  if (validTriggerCell(trigger_cell_id))
369  trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
370  }
371  }
372  }
373  return trigger_cell_det_ids;
374 }
375 
377  const unsigned module_id) const {
378  HGCalDetId module_det_id(module_id);
379  geom_ordered_set trigger_cell_det_ids;
380  unsigned module = module_det_id.wafer();
381  // Scintillator
382  if (module_det_id.subdetId() == ForwardSubdetector::HGCHEB) {
383  // loop on the trigger cells in each module
384  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_sci_.at(module); trigger_cell++) {
385  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(),
386  module_det_id.zside(),
387  module_det_id.layer(),
388  module_det_id.waferType(),
389  module,
390  trigger_cell);
391  if (validTriggerCell(trigger_cell_id))
392  trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
393  }
394  }
395  // EE or FH
396  else {
397  auto wafer_itrs = module_to_wafers_.equal_range(module);
398  // loop on the wafers included in the module
399  for (auto wafer_itr = wafer_itrs.first; wafer_itr != wafer_itrs.second; wafer_itr++) {
400  unsigned wafer = wafer_itr->second;
401  auto waferuv_itr = wafers_old_to_wafers_.find(wafer);
402  if (waferuv_itr == wafers_old_to_wafers_.end())
403  continue;
404  int waferu = 0;
405  int waferv = 0;
406  unpackWaferId(waferuv_itr->second, waferu, waferv);
408  unsigned layer = module_det_id.layer();
409  unsigned wafer_type = detIdWaferType(det, layer, waferu, waferv);
410  // loop on the trigger cells in each wafer
411  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_.at(wafer_type); trigger_cell++) {
412  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(),
413  module_det_id.zside(),
414  module_det_id.layer(),
415  module_det_id.waferType(),
416  wafer,
417  trigger_cell);
418  if (validTriggerCell(trigger_cell_id))
419  trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
420  }
421  }
422  }
423  return trigger_cell_det_ids;
424 }
425 
427  const unsigned trigger_cell_id) const {
428  HGCalDetId trigger_cell_det_id(trigger_cell_id);
429  // Choose scintillator or silicon map
430  const auto& neighbors_map =
433  unsigned layer = trigger_cell_det_id.layer();
434  unsigned type =
435  (trigger_cell_det_id.subdetId() == ForwardSubdetector::HGCHEB ? hscTopology().dddConstants().getTypeTrap(layer)
436  : 1);
437  unsigned module = trigger_cell_det_id.wafer();
438  unsigned trigger_cell = trigger_cell_det_id.cell();
439  // retrieve neighbors
440  unsigned trigger_cell_key = (trigger_cell_det_id.subdetId() == ForwardSubdetector::HGCHEB
441  ? packTriggerCellWithType(type, module, trigger_cell)
442  : packTriggerCell(module, trigger_cell));
443  geom_set neighbor_detids;
444  auto neighbors_itr = neighbors_map.find(trigger_cell_key);
445  if (neighbors_itr == neighbors_map.end()) {
446  throw cms::Exception("BadGeometry") << "HGCalTriggerGeometry: Neighbors are not defined for trigger cell "
447  << trigger_cell << " in module " << module
448  << ". The trigger cell neighbor mapping should be modified. \n";
449  }
450  const auto& neighbors = neighbors_itr->second;
451  // create HGCalDetId of neighbors and check their validity
452  neighbor_detids.reserve(neighbors.size());
453  for (const auto& module_tc : neighbors) {
454  HGCalDetId neighbor_det_id((ForwardSubdetector)trigger_cell_det_id.subdetId(),
455  trigger_cell_det_id.zside(),
456  layer,
457  type,
458  module_tc.first,
459  module_tc.second);
460  if (validTriggerCell(neighbor_det_id.rawId())) {
461  neighbor_detids.emplace(neighbor_det_id.rawId());
462  }
463  }
464  return neighbor_detids;
465 }
466 
467 GlobalPoint HGCalTriggerGeometryV9Imp1::getTriggerCellPosition(const unsigned trigger_cell_det_id) const {
468  unsigned subdet = HGCalDetId(trigger_cell_det_id).subdetId();
469  // Position: barycenter of the trigger cell.
470  Basic3DVector<float> triggerCellVector(0., 0., 0.);
471  const auto cell_ids = getCellsFromTriggerCell(trigger_cell_det_id);
472  // Scintillator
473  if (subdet == ForwardSubdetector::HGCHEB) {
474  for (const auto& cell : cell_ids) {
475  HcalDetId cellDetId(cell);
476  triggerCellVector += hscGeometry()->getPosition(cellDetId).basicVector();
477  }
478  }
479  // Silicon
480  else {
481  for (const auto& cell : cell_ids) {
482  HGCSiliconDetId cellDetId(cell);
483  triggerCellVector += (cellDetId.det() == DetId::HGCalEE ? eeGeometry()->getPosition(cellDetId)
484  : hsiGeometry()->getPosition(cellDetId))
485  .basicVector();
486  }
487  }
488  return GlobalPoint(triggerCellVector / cell_ids.size());
489 }
490 
491 GlobalPoint HGCalTriggerGeometryV9Imp1::getModulePosition(const unsigned module_det_id) const {
492  unsigned subdet = HGCalDetId(module_det_id).subdetId();
493  // Position: barycenter of the module.
494  Basic3DVector<float> moduleVector(0., 0., 0.);
495  const auto cell_ids = getCellsFromModule(module_det_id);
496  // Scintillator
497  if (subdet == ForwardSubdetector::HGCHEB) {
498  for (const auto& cell : cell_ids) {
499  HGCScintillatorDetId cellDetId(cell);
500  moduleVector += hscGeometry()->getPosition(cellDetId).basicVector();
501  }
502  }
503  // Silicon
504  else {
505  for (const auto& cell : cell_ids) {
506  HGCSiliconDetId cellDetId(cell);
507  moduleVector += (cellDetId.det() == DetId::HGCalEE ? eeGeometry()->getPosition(cellDetId)
508  : hsiGeometry()->getPosition(cellDetId))
509  .basicVector();
510  }
511  }
512  return GlobalPoint(moduleVector / cell_ids.size());
513 }
514 
516  //
517  // read module mapping file
518  std::ifstream l1tModulesMappingStream(l1tModulesMapping_.fullPath());
519  if (!l1tModulesMappingStream.is_open()) {
520  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TModulesMapping file\n";
521  }
522  short trigger_wafer = 0;
523  short module = 0;
524  for (; l1tModulesMappingStream >> trigger_wafer >> module;) {
525  wafer_to_module_.emplace(trigger_wafer, module);
526  module_to_wafers_.emplace(module, trigger_wafer);
527  }
528  if (!l1tModulesMappingStream.eof()) {
529  throw cms::Exception("BadGeometryFile")
530  << "Error reading L1TModulesMapping '" << trigger_wafer << " " << module << "' \n";
531  }
532  l1tModulesMappingStream.close();
533  // read trigger cell mapping file
534  std::ifstream l1tCellsMappingStream(l1tCellsMapping_.fullPath());
535  if (!l1tCellsMappingStream.is_open()) {
536  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TCellsMapping file\n";
537  }
538  short type = 0;
539  short cellu = 0;
540  short cellv = 0;
541  short trigger_cell = 0;
542  for (; l1tCellsMappingStream >> type >> cellu >> cellv >> trigger_cell;) {
543  unsigned cell_key = packCellId(type, cellu, cellv);
544  unsigned trigger_cell_key = packCellId(type, trigger_cell);
545  // fill cell <-> trigger cell mappings
546  cells_to_trigger_cells_.emplace(cell_key, trigger_cell);
547  trigger_cells_to_cells_.emplace(trigger_cell_key, cell_key);
548  // fill number of trigger cells in wafers
549  auto itr_insert = number_trigger_cells_in_wafers_.emplace(type, 0);
550  if (trigger_cell + 1 > itr_insert.first->second)
551  itr_insert.first->second = trigger_cell + 1;
552  }
553  if (!l1tCellsMappingStream.eof()) {
554  throw cms::Exception("BadGeometryFile")
555  << "Error reading L1TCellsMapping '" << type << " " << cellu << " " << cellv << " " << trigger_cell << "' \n";
556  }
557  l1tCellsMappingStream.close();
558  // read scintillator trigger cell mapping file
559  std::ifstream l1tCellsSciMappingStream(l1tCellsSciMapping_.fullPath());
560  if (!l1tCellsSciMappingStream.is_open()) {
561  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TCellsSciMapping file\n";
562  }
563  short ieta = 0;
564  short iphi = 0;
565  trigger_wafer = 0;
566  trigger_cell = 0;
567  for (; l1tCellsSciMappingStream >> ieta >> iphi >> trigger_wafer >> trigger_cell;) {
568  unsigned cell_key = packIetaIphi(ieta, iphi);
569  unsigned trigger_cell_key = packWaferCellId(ForwardSubdetector::HGCHEB, trigger_wafer, trigger_cell);
570  // fill cell <-> trigger cell mappings
571  cells_to_trigger_cells_sci_.emplace(cell_key, trigger_cell_key);
572  trigger_cells_to_cells_sci_.emplace(trigger_cell_key, cell_key);
573  // fill number of trigger cells in wafers
574  auto itr_insert = number_trigger_cells_in_wafers_sci_.emplace(trigger_wafer, 0);
575  if (trigger_cell + 1 > itr_insert.first->second)
576  itr_insert.first->second = trigger_cell + 1;
577  }
578  if (!l1tCellsSciMappingStream.eof()) {
579  throw cms::Exception("BadGeometryFile") << "Error reading L1TCellsSciMapping '" << ieta << " " << iphi << " "
580  << trigger_wafer << " " << trigger_cell << "' \n";
581  }
582  l1tCellsSciMappingStream.close();
583  // read wafer mapping file
584  std::ifstream l1tWafersMappingStream(l1tWafersMapping_.fullPath());
585  if (!l1tWafersMappingStream.is_open()) {
586  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TWafersMapping file\n";
587  }
588  short waferu = 0;
589  short waferv = 0;
590  trigger_wafer = 0;
591  for (; l1tWafersMappingStream >> waferu >> waferv >> trigger_wafer;) {
592  unsigned wafer_key = packWaferId(waferu, waferv);
593  // fill wafer u,v <-> old wafer ID mappings
594  wafers_to_wafers_old_.emplace(wafer_key, trigger_wafer);
595  wafers_old_to_wafers_.emplace(trigger_wafer, wafer_key);
596  }
597  if (!l1tWafersMappingStream.eof()) {
598  throw cms::Exception("BadGeometryFile")
599  << "Error reading L1TWafersMapping '" << waferu << " " << waferv << " " << trigger_wafer << "' \n";
600  }
601  l1tWafersMappingStream.close();
602 }
603 
605  neighbor_map& neighbors_map,
606  bool scintillator) {
607  // Fill trigger neighbor map
608  std::ifstream l1tCellNeighborsMappingStream(file.fullPath());
609  if (!l1tCellNeighborsMappingStream.is_open()) {
610  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TCellNeighborsMapping file\n";
611  }
612  const unsigned line_size = 512;
613  for (std::array<char, line_size> buffer; l1tCellNeighborsMappingStream.getline(&buffer[0], line_size);) {
614  std::string line(&buffer[0]);
615  // Extract keys consisting of the module id
616  // and of the trigger cell id
617  // Match patterns (X,Y)
618  // where X is a number with less than 4 digis
619  // and Y is a number with less than 4 digits
620  // For the scintillator case, match instead (X,Y,Z) patterns
621  std::regex key_regex(scintillator ? "\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\)"
622  : "\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\)");
623  std::vector<std::string> key_tokens{std::sregex_token_iterator(line.begin(), line.end(), key_regex), {}};
624  if (key_tokens.empty()) {
625  throw cms::Exception("BadGeometry") << "Syntax error in the L1TCellNeighborsMapping:\n"
626  << " Cannot find the trigger cell key in line:\n"
627  << " '" << &buffer[0] << "'\n";
628  }
629  std::regex digits_regex("\\d{1,3}");
630  std::vector<std::string> module_tc{
631  std::sregex_token_iterator(key_tokens[0].begin(), key_tokens[0].end(), digits_regex), {}};
632  // get module and cell id
633  unsigned map_key = 0;
634  if (scintillator) {
635  int type = std::stoi(module_tc[0]);
636  int module = std::stoi(module_tc[1]);
637  int trigger_cell = std::stoi(module_tc[2]);
638  map_key = packTriggerCellWithType(type, module, trigger_cell);
639  } else {
640  int module = std::stoi(module_tc[0]);
641  int trigger_cell = std::stoi(module_tc[1]);
642  map_key = packTriggerCell(module, trigger_cell);
643  }
644  // Extract neighbors
645  // Match patterns (X,Y)
646  // where X is a number with less than 4 digits
647  // and Y is a number with less than 4 digits
648  std::regex neighbors_regex("\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\)");
649  std::vector<std::string> neighbors_tokens{std::sregex_token_iterator(line.begin(), line.end(), neighbors_regex),
650  {}};
651  if ((scintillator && neighbors_tokens.empty()) || (!scintillator && neighbors_tokens.size() < 2)) {
652  throw cms::Exception("BadGeometry") << "Syntax error in the L1TCellNeighborsMapping:\n"
653  << " Cannot find any neighbor in line:\n"
654  << " '" << &buffer[0] << "'\n";
655  }
656  auto itr_insert = neighbors_map.emplace(map_key, std::set<std::pair<short, short>>());
657  // The first element for silicon neighbors is the key, so start at index 1
658  unsigned first_element = (scintillator ? 0 : 1);
659  for (unsigned i = first_element; i < neighbors_tokens.size(); i++) {
660  const auto& neighbor = neighbors_tokens[i];
661  std::vector<std::string> pair_neighbor{std::sregex_token_iterator(neighbor.begin(), neighbor.end(), digits_regex),
662  {}};
663  short neighbor_module(std::stoi(pair_neighbor[0]));
664  short neighbor_cell(std::stoi(pair_neighbor[1]));
665  itr_insert.first->second.emplace(neighbor_module, neighbor_cell);
666  }
667  }
668  if (!l1tCellNeighborsMappingStream.eof()) {
669  throw cms::Exception("BadGeometryFile") << "Error reading L1TCellNeighborsMapping'\n";
670  }
671  l1tCellNeighborsMappingStream.close();
672 }
673 
675  unsigned n_layers_ee = eeTopology().dddConstants().layers(true);
676  for (unsigned layer = 1; layer <= n_layers_ee; layer++) {
677  for (const auto& waferuv_wafer : wafers_to_wafers_old_) {
678  int waferu = 0;
679  int waferv = 0;
680  unpackWaferId(waferuv_wafer.first, waferu, waferv);
681  unsigned waferee_type = detIdWaferType(DetId::HGCalEE, layer, waferu, waferv);
682  unsigned waferfh_type = detIdWaferType(DetId::HGCalHSi, layer, waferu, waferv);
683  unsigned trigger_wafer = waferuv_wafer.second;
684  // loop on the trigger cells in each wafer
685  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_.at(waferee_type); trigger_cell++) {
686  for (int zside : {-1, 1}) {
687  HGCalDetId trigger_cell_id(ForwardSubdetector::HGCEE, zside, layer, 1, trigger_wafer, trigger_cell);
688  if (!validTriggerCellFromCells(trigger_cell_id))
689  invalid_triggercells_.emplace(trigger_cell_id);
690  for (unsigned neighbor : getNeighborsFromTriggerCell(trigger_cell_id)) {
691  auto wafer_itr = wafers_old_to_wafers_.find(HGCalDetId(neighbor).wafer());
692  if (wafer_itr == wafers_old_to_wafers_.end())
693  invalid_triggercells_.emplace(neighbor);
694  else if (!validTriggerCellFromCells(neighbor))
695  invalid_triggercells_.emplace(neighbor);
696  }
697  }
698  }
699  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_.at(waferfh_type); trigger_cell++) {
700  for (int zside : {-1, 1}) {
701  HGCalDetId trigger_cell_id(ForwardSubdetector::HGCHEF, zside, layer, 1, trigger_wafer, trigger_cell);
702  if (!validTriggerCellFromCells(trigger_cell_id))
703  invalid_triggercells_.emplace(trigger_cell_id);
704  for (unsigned neighbor : getNeighborsFromTriggerCell(trigger_cell_id)) {
705  auto wafer_itr = wafers_old_to_wafers_.find(HGCalDetId(neighbor).wafer());
706  if (wafer_itr == wafers_old_to_wafers_.end())
707  invalid_triggercells_.emplace(neighbor);
708  else if (!validTriggerCellFromCells(neighbor))
709  invalid_triggercells_.emplace(neighbor);
710  }
711  }
712  }
713  }
714  }
715  unsigned n_layers_hsc = hscTopology().dddConstants().layers(true);
716  unsigned first_layer_hsc = hscTopology().dddConstants().firstLayer();
717  for (unsigned layer = first_layer_hsc; layer <= first_layer_hsc + n_layers_hsc; layer++) {
718  int type = hscTopology().dddConstants().getTypeTrap(layer);
719  for (const auto& module_ncells : number_trigger_cells_in_wafers_sci_) {
720  unsigned trigger_wafer = module_ncells.first;
721  // loop on the trigger cells in each wafer
722  for (int trigger_cell = 1; trigger_cell < module_ncells.second; trigger_cell++) {
723  for (int zside : {-1, 1}) {
724  HGCalDetId trigger_cell_id(ForwardSubdetector::HGCHEB, zside, layer, type, trigger_wafer, trigger_cell);
725  if (!validTriggerCellFromCells(trigger_cell_id))
726  invalid_triggercells_.emplace(trigger_cell_id);
727  for (unsigned neighbor : getNeighborsFromTriggerCell(trigger_cell_id)) {
728  if (!validTriggerCellFromCells(neighbor))
729  invalid_triggercells_.emplace(neighbor);
730  }
731  }
732  }
733  }
734  }
735 }
736 
737 unsigned HGCalTriggerGeometryV9Imp1::packWaferCellId(unsigned subdet, unsigned wafer, unsigned cell) const {
738  unsigned packed_value = 0;
739  const int kSubdetMask = 0x7;
740  packed_value |= ((cell & HGCalDetId::kHGCalCellMask) << HGCalDetId::kHGCalCellOffset);
741  packed_value |= ((wafer & HGCalDetId::kHGCalWaferMask) << HGCalDetId::kHGCalWaferOffset);
742  packed_value |= ((subdet & kSubdetMask) << (HGCalDetId::kHGCalWaferTypeOffset));
743  return packed_value;
744 }
745 
746 unsigned HGCalTriggerGeometryV9Imp1::packCellId(unsigned type, unsigned cell) const {
747  unsigned packed_value = 0;
748  packed_value |= ((cell & HGCalDetId::kHGCalCellMask) << HGCalDetId::kHGCalCellOffset);
750  return packed_value;
751 }
752 
753 unsigned HGCalTriggerGeometryV9Imp1::packCellId(unsigned type, unsigned cellU, unsigned cellV) const {
754  unsigned packed_value = 0;
758  return packed_value;
759 }
760 
761 unsigned HGCalTriggerGeometryV9Imp1::packWaferId(int waferU, int waferV) const {
762  unsigned packed_value = 0;
763  unsigned waferUabs = std::abs(waferU);
764  unsigned waferVabs = std::abs(waferV);
765  unsigned waferUsign = (waferU >= 0) ? 0 : 1;
766  unsigned waferVsign = (waferV >= 0) ? 0 : 1;
771  return packed_value;
772 }
773 
774 unsigned HGCalTriggerGeometryV9Imp1::packIetaIphi(unsigned ieta, unsigned iphi) const {
775  unsigned packed_value = 0;
778  return packed_value;
779 }
780 
781 void HGCalTriggerGeometryV9Imp1::unpackWaferCellId(unsigned wafer_cell, unsigned& wafer, unsigned& cell) const {
782  cell = wafer_cell & HGCalDetId::kHGCalCellMask;
784 }
785 
786 void HGCalTriggerGeometryV9Imp1::unpackCellId(unsigned cell, unsigned& cellU, unsigned& cellV) const {
789 }
790 
791 void HGCalTriggerGeometryV9Imp1::unpackWaferId(unsigned wafer, int& waferU, int& waferV) const {
795  : waferUAbs);
797  : waferVAbs);
798 }
799 
800 void HGCalTriggerGeometryV9Imp1::unpackIetaIphi(unsigned ieta_iphi, unsigned& ieta, unsigned& iphi) const {
803 }
804 
805 bool HGCalTriggerGeometryV9Imp1::validTriggerCell(const unsigned trigger_cell_id) const {
806  return invalid_triggercells_.find(trigger_cell_id) == invalid_triggercells_.end();
807 }
808 
809 bool HGCalTriggerGeometryV9Imp1::disconnectedModule(const unsigned module_id) const {
810  bool disconnected = false;
811  if (disconnected_modules_.find(HGCalDetId(module_id).wafer()) != disconnected_modules_.end())
812  disconnected = true;
813  if (disconnected_layers_.find(layerWithOffset(module_id)) != disconnected_layers_.end())
814  disconnected = true;
815  return disconnected;
816 }
817 
818 unsigned HGCalTriggerGeometryV9Imp1::triggerLayer(const unsigned id) const {
819  unsigned layer = layerWithOffset(id);
820  if (layer >= trigger_layers_.size())
821  return 0;
822  return trigger_layers_[layer];
823 }
824 
825 bool HGCalTriggerGeometryV9Imp1::validTriggerCellFromCells(const unsigned trigger_cell_id) const {
826  // Check the validity of a trigger cell with the
827  // validity of the cells. One valid cell in the
828  // trigger cell is enough to make the trigger cell
829  // valid.
830  HGCalDetId trigger_cell_det_id(trigger_cell_id);
831  unsigned subdet = trigger_cell_det_id.subdetId();
832  const geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
833  bool is_valid = false;
834  for (const auto cell_id : cells) {
835  is_valid |= validCellId(subdet, cell_id);
836  if (is_valid)
837  break;
838  }
839  return is_valid;
840 }
841 
842 bool HGCalTriggerGeometryV9Imp1::validCellId(unsigned subdet, unsigned cell_id) const {
843  bool is_valid = false;
844  switch (subdet) {
846  is_valid = eeTopology().valid(cell_id);
847  break;
849  is_valid = hsiTopology().valid(cell_id);
850  break;
852  is_valid = hscTopology().valid(cell_id);
853  break;
854  default:
855  is_valid = false;
856  break;
857  }
858  return is_valid;
859 }
860 
861 unsigned HGCalTriggerGeometryV9Imp1::packTriggerCell(unsigned module, unsigned trigger_cell) const {
862  unsigned packed_value = 0;
863  packed_value |= ((trigger_cell & HGCalDetId::kHGCalCellMask) << HGCalDetId::kHGCalCellOffset);
864  packed_value |= ((module & HGCalDetId::kHGCalWaferMask) << HGCalDetId::kHGCalWaferOffset);
865  return packed_value;
866 }
867 
869  unsigned module,
870  unsigned trigger_cell) const {
871  unsigned packed_value = 0;
872  packed_value |= ((trigger_cell & HGCalDetId::kHGCalCellMask) << HGCalDetId::kHGCalCellOffset);
873  packed_value |= ((module & HGCalDetId::kHGCalWaferMask) << HGCalDetId::kHGCalWaferOffset);
875  return packed_value;
876 }
877 
878 int HGCalTriggerGeometryV9Imp1::detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const {
879  int wafer_type = 0;
880  switch (det) {
881  case DetId::HGCalEE:
882  wafer_type = eeTopology().dddConstants().getTypeHex(layer, waferU, waferV);
883  break;
884  case DetId::HGCalHSi:
885  wafer_type = hsiTopology().dddConstants().getTypeHex(layer, waferU, waferV);
886  break;
887  default:
888  break;
889  };
890  return wafer_type;
891 }
892 
893 unsigned HGCalTriggerGeometryV9Imp1::layerWithOffset(unsigned id) const {
894  HGCalDetId detid(id);
895  unsigned layer = 0;
896  switch (detid.subdetId()) {
898  layer = detid.layer();
899  break;
901  layer = heOffset_ + detid.layer();
902  break;
904  layer = heOffset_ + detid.layer();
905  break;
906  };
907  return layer;
908 }
909 
int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
unsigned packCellId(unsigned type, unsigned cellU, unsigned cellV) const
static const int kHGCalWaferVOffset
GlobalPoint getTriggerCellPosition(const unsigned) const final
unsigned getModuleFromCell(const unsigned) const final
int getTypeTrap(int layer) const
std::unordered_set< unsigned > disconnected_layers_
GlobalPoint getModulePosition(const unsigned) const final
std::unordered_map< unsigned, unsigned > cells_to_trigger_cells_sci_
std::unordered_multimap< unsigned, unsigned > trigger_cells_to_cells_
static const int kHGCalTypeMask
bool is_valid(const Digi &d)
Definition: GenericDigi.h:64
bool validTriggerCell(const unsigned) const final
int waferU() const
int cellV() const
const HGCalGeometry * eeGeometry() const
const HGCalTopology & eeTopology() const
static const int kHGCalWaferVSignOffset
unsigned getModuleFromTriggerCell(const unsigned) const final
std::unordered_map< unsigned, unsigned > cells_to_trigger_cells_
std::unordered_map< unsigned, unsigned short > number_trigger_cells_in_wafers_
static const int kHGCalCellUMask
std::vector< unsigned > trigger_layers_
unsigned packWaferId(int waferU, int waferV) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
int getTypeHex(int layer, int waferU, int waferV) const
void initialize(const edm::ESHandle< CaloGeometry > &) final
geom_set getCellsFromModule(const unsigned) const final
static const int kHGCalWaferTypeOffset
Definition: HGCalDetId.h:16
int type() const
get the type
GlobalPoint getPosition(const DetId &id) const
int zside() const
get the z-side of the cell (1/-1)
bool validCellId(unsigned det, unsigned cell_id) const
std::unordered_map< unsigned, unsigned > wafer_to_module_
int zside(DetId const &)
const HGCalTopology & hsiTopology() const
void setEEGeometry(const edm::ESHandle< HGCalGeometry > &geom)
std::unordered_map< int, std::set< std::pair< short, short > > > neighbor_map
static const int kHGCalCellVOffset
ForwardSubdetector
unsigned packTriggerCellWithType(unsigned, unsigned, unsigned) const
void unpackIetaIphi(unsigned ieta_iphi, unsigned &ieta, unsigned &iphi) const
int cellU() const
get the cell #&#39;s in u,v or in x,y
static const int kHGCalTypeOffset
static const int kHGCalCellOffset
Definition: HGCalDetId.h:12
static const int kHGCalCellMask
Definition: HGCalDetId.h:13
std::unordered_set< unsigned > disconnected_modules_
unsigned int layers(bool reco) const
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCalDetId.h:51
std::unordered_multimap< unsigned, unsigned > module_to_wafers_
static const int kHGCalCellVMask
static const int kHGCalWaferTypeMask
Definition: HGCalDetId.h:17
void unpackWaferCellId(unsigned wafer_cell, unsigned &wafer, unsigned &cell) const
int type() const
get the type
int layer() const
get the layer #
int waferV() const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
void unpackCellId(unsigned cell, unsigned &cellU, unsigned &cellV) const
static const int kHGCalRadiusOffset
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int iphi() const
get the phi index
#define end
Definition: vmac.h:39
int wafer() const
get the wafer #
Definition: HGCalDetId.h:42
unsigned packIetaIphi(unsigned ieta, unsigned iphi) const
geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned) const final
unsigned packWaferCellId(unsigned subdet, unsigned wafer, unsigned cell) const
const HGCalGeometry * hsiGeometry() const
geom_ordered_set getOrderedCellsFromModule(const unsigned) const final
std::unordered_multimap< unsigned, unsigned > trigger_cells_to_cells_sci_
Definition: DetId.h:18
static const int kHGCalRadiusMask
static const int kHGCalWaferVMask
static const int kHGCalWaferUSignMask
unsigned layerWithOffset(unsigned) const
static const int kHGCalWaferUMask
int cell() const
get the absolute value of the cell #&#39;s in x and y
Definition: HGCalDetId.h:39
const HGCalDDDConstants & dddConstants() const
std::unordered_map< unsigned, unsigned short > number_trigger_cells_in_wafers_sci_
const HGCalGeometry * hscGeometry() const
const HGCalTopology & hscTopology() const
static const int kHGCalWaferVSignMask
Detector
Definition: DetId.h:26
void unpackWaferId(unsigned wafer, int &waferU, int &waferV) const
unsigned packTriggerCell(unsigned, unsigned) const
void fillNeighborMap(const edm::FileInPath &, neighbor_map &, bool)
static const int kHGCalCellUOffset
bool validTriggerCellFromCells(const unsigned) const
static const int kHGCalWaferOffset
Definition: HGCalDetId.h:14
std::set< unsigned > geom_ordered_set
static const int kHGCalPhiMask
void setHScGeometry(const edm::ESHandle< HGCalGeometry > &geom)
int layer() const
get the layer #
std::unordered_map< unsigned, unsigned > wafers_to_wafers_old_
#define begin
Definition: vmac.h:32
HLT enums.
int zside() const
get the z-side of the cell (1/-1)
std::unordered_set< unsigned > geom_set
geom_set getTriggerCellsFromModule(const unsigned) const final
std::string fullPath() const
Definition: FileInPath.cc:163
int waferType() const
get the wafer type
Definition: HGCalDetId.h:45
bool disconnectedModule(const unsigned) const final
#define DEFINE_EDM_PLUGIN(factory, type, name)
HGCalTriggerGeometryV9Imp1(const edm::ParameterSet &conf)
static const int kHGCalWaferUOffset
int firstLayer() const
bool valid(const DetId &id) const override
Is this a valid cell id.
static const int kHGCalPhiOffset
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
Definition: vlib.h:208
std::unordered_map< unsigned, unsigned > wafers_old_to_wafers_
static const int kHGCalWaferUSignOffset
void setHSiGeometry(const edm::ESHandle< HGCalGeometry > &geom)
def move(src, dest)
Definition: eostools.py:511
int layer() const
get the layer #
Definition: HGCalDetId.h:48
geom_set getNeighborsFromTriggerCell(const unsigned) const final
static const int kHGCalWaferMask
Definition: HGCalDetId.h:15
unsigned triggerLayer(const unsigned) const final
std::unordered_set< unsigned > invalid_triggercells_
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
unsigned getTriggerCellFromCell(const unsigned) const final
geom_set getCellsFromTriggerCell(const unsigned) const final