CMS 3D CMS Logo

HGCalTriggerGeometryHexLayerBasedImp1.cc
Go to the documentation of this file.
2 
7 
8 #include <fstream>
9 #include <iostream>
10 #include <regex>
11 #include <vector>
12 
14 public:
16 
17  void initialize(const CaloGeometry*) final;
18  void initialize(const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*) final;
19  void initialize(const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*) final;
20  void reset() final;
21 
22  unsigned getTriggerCellFromCell(const unsigned) const final;
23  unsigned getModuleFromCell(const unsigned) const final;
24  unsigned getModuleFromTriggerCell(const unsigned) const final;
25 
26  geom_set getCellsFromTriggerCell(const unsigned) const final;
27  geom_set getCellsFromModule(const unsigned) const final;
28  geom_set getTriggerCellsFromModule(const unsigned) const final;
29 
30  geom_ordered_set getOrderedCellsFromModule(const unsigned) const final;
31  geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned) const final;
32 
33  geom_set getNeighborsFromTriggerCell(const unsigned) const final;
34 
35  unsigned getLinksInModule(const unsigned module_id) const final;
36  unsigned getModuleSize(const unsigned module_id) const final;
37 
38  GlobalPoint getTriggerCellPosition(const unsigned) const final;
39  GlobalPoint getModulePosition(const unsigned) const final;
40 
41  bool validCell(const unsigned) const final;
42  bool validTriggerCell(const unsigned) const final;
43  bool disconnectedModule(const unsigned) const final;
44  unsigned lastTriggerLayer() const final { return last_trigger_layer_; }
45  unsigned triggerLayer(const unsigned) const final;
46 
47 private:
53 
54  // module related maps
55  std::unordered_map<unsigned, unsigned> wafer_to_module_;
56  std::unordered_multimap<unsigned, unsigned> module_to_wafers_;
57 
58  // trigger cell related maps
59  std::unordered_map<unsigned, unsigned> cells_to_trigger_cells_;
60  std::unordered_multimap<unsigned, unsigned> trigger_cells_to_cells_;
61  std::unordered_map<unsigned, unsigned> cells_to_trigger_cells_bh_;
62  std::unordered_multimap<unsigned, unsigned> trigger_cells_to_cells_bh_;
63  std::unordered_map<unsigned, unsigned short> number_trigger_cells_in_wafers_;
64  std::unordered_map<unsigned, unsigned short> number_trigger_cells_in_wafers_bh_;
65  std::unordered_set<unsigned> invalid_triggercells_;
66 
67  // neighbor related maps
68  // trigger cell neighbors:
69  // - The key includes the module and trigger cell id
70  // - The value is a set of (module_id, trigger_cell_id)
71  std::unordered_map<int, std::set<std::pair<short, short>>> trigger_cell_neighbors_;
72  std::unordered_map<int, std::set<std::pair<short, short>>> trigger_cell_neighbors_bh_;
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  unsigned last_trigger_layer_ = 0;
79 
80  // layer offsets
81  unsigned fhOffset_ = 0;
82  unsigned bhOffset_ = 0;
83  unsigned totalLayers_ = 0;
84 
85  void fillMaps();
86  void fillNeighborMaps(const edm::FileInPath&, std::unordered_map<int, std::set<std::pair<short, short>>>&);
88  unsigned packTriggerCell(unsigned, unsigned) const;
89  bool validCellId(unsigned subdet, unsigned cell_id) const;
90  bool validTriggerCellFromCells(const unsigned) const;
91 
92  // returns transverse wafer type: -1=coarse, 1=fine, 0=undefined
93  int detIdWaferType(unsigned subdet, short wafer) const;
94  unsigned packWaferCellId(unsigned subdet, unsigned wafer, unsigned cell) const;
95  unsigned packIetaIphi(unsigned ieta, unsigned iphi) const;
96  void unpackWaferCellId(unsigned wafer_cell, unsigned& wafer, unsigned& cell) const;
97  void unpackIetaIphi(unsigned ieta_iphi, unsigned& ieta, unsigned& iphi) const;
98 
99  unsigned layerWithOffset(unsigned) const;
100 };
101 
103  : HGCalTriggerGeometryBase(conf),
104  l1tCellsMapping_(conf.getParameter<edm::FileInPath>("L1TCellsMapping")),
105  l1tCellsBHMapping_(conf.getParameter<edm::FileInPath>("L1TCellsBHMapping")),
106  l1tModulesMapping_(conf.getParameter<edm::FileInPath>("L1TModulesMapping")),
107  l1tCellNeighborsMapping_(conf.getParameter<edm::FileInPath>("L1TCellNeighborsMapping")),
108  l1tCellNeighborsBHMapping_(conf.getParameter<edm::FileInPath>("L1TCellNeighborsBHMapping")) {
109  std::vector<unsigned> tmp_vector = conf.getParameter<std::vector<unsigned>>("DisconnectedModules");
110  std::move(tmp_vector.begin(), tmp_vector.end(), std::inserter(disconnected_modules_, disconnected_modules_.end()));
111  tmp_vector = conf.getParameter<std::vector<unsigned>>("DisconnectedLayers");
112  std::move(tmp_vector.begin(), tmp_vector.end(), std::inserter(disconnected_layers_, disconnected_layers_.end()));
113 }
114 
116  cells_to_trigger_cells_.clear();
117  trigger_cells_to_cells_.clear();
120  wafer_to_module_.clear();
121  module_to_wafers_.clear();
124  trigger_cell_neighbors_.clear();
126 }
127 
129  setCaloGeometry(calo_geometry);
133  trigger_layers_.resize(totalLayers_ + 1);
134  trigger_layers_[0] = 0; // layer number 0 doesn't exist
135  unsigned trigger_layer = 1;
136  for (unsigned layer = 1; layer < trigger_layers_.size(); layer++) {
137  if (disconnected_layers_.find(layer) == disconnected_layers_.end()) {
138  // Increase trigger layer number if the layer is not disconnected
139  trigger_layers_[layer] = trigger_layer;
140  trigger_layer++;
141  } else {
142  trigger_layers_[layer] = 0;
143  }
144  }
145  last_trigger_layer_ = trigger_layer - 1;
146  fillMaps();
150 }
151 
153  const HGCalGeometry* hgc_hsi_geometry,
154  const HGCalGeometry* hgc_hsc_geometry) {
155  throw cms::Exception("BadGeometry")
156  << "HGCalTriggerGeometryHexLayerBasedImp1 geometry cannot be initialized with the V9 HGCAL geometry";
157 }
158 
160  const HGCalGeometry* hgc_hsi_geometry,
161  const HGCalGeometry* hgc_hsc_geometry,
162  const HGCalGeometry* hgc_nose_geometry) {
163  throw cms::Exception("BadGeometry")
164  << "HGCalTriggerGeometryHexLayerBasedImp1 geometry cannot be initialized with the V9 HGCAL+Nose geometry";
165 }
166 
168  unsigned subdet = 0;
169  int zside = 0;
170  unsigned layer = 0;
171  unsigned wafer_trigger_cell = 0;
172  unsigned trigger_cell = 0;
173  // BH
174  if (DetId(cell_id).det() == DetId::Hcal) {
175  HcalDetId cell_det_id(cell_id);
176  if (cell_det_id.subdetId() != HcalEndcap)
177  return 0;
178  unsigned ieta = cell_det_id.ietaAbs();
179  unsigned iphi = cell_det_id.iphi();
180  layer = cell_det_id.depth();
182  zside = cell_det_id.zside();
183  auto trigger_cell_itr = cells_to_trigger_cells_bh_.find(packIetaIphi(ieta, iphi));
184  if (trigger_cell_itr == cells_to_trigger_cells_bh_.end()) {
185  throw cms::Exception("BadGeometry")
186  << "HGCalTriggerGeometry: Hcal cell ieta=" << ieta << ", iphi=" << iphi
187  << " is not mapped to any trigger cell. The trigger cell mapping should be modified.\n";
188  }
189  trigger_cell = 0;
190  wafer_trigger_cell = 0;
191  unpackWaferCellId(trigger_cell_itr->second, wafer_trigger_cell, trigger_cell);
192  }
193  // EE or FH
194  else if (DetId(cell_id).det() == DetId::Forward) {
195  HGCalDetId cell_det_id(cell_id);
196  subdet = cell_det_id.subdetId();
197  layer = cell_det_id.layer();
198  zside = cell_det_id.zside();
199  unsigned wafer = cell_det_id.wafer();
200  unsigned cell = cell_det_id.cell();
201  auto trigger_cell_itr = cells_to_trigger_cells_.find(packWaferCellId(subdet, wafer, cell));
202  if (trigger_cell_itr == cells_to_trigger_cells_.end()) {
203  throw cms::Exception("BadGeometry")
204  << "HGCalTriggerGeometry: HGCal cell " << cell << " in wafer " << wafer
205  << " is not mapped to any trigger cell. The trigger cell mapping should be modified.\n";
206  }
207  trigger_cell = 0;
208  wafer_trigger_cell = 0;
209  unpackWaferCellId(trigger_cell_itr->second, wafer_trigger_cell, trigger_cell);
210  }
211  return HGCalDetId((ForwardSubdetector)subdet, zside, layer, 1, wafer_trigger_cell, trigger_cell).rawId();
212 }
213 
214 unsigned HGCalTriggerGeometryHexLayerBasedImp1::getModuleFromCell(const unsigned cell_id) const {
216 }
217 
218 unsigned HGCalTriggerGeometryHexLayerBasedImp1::getModuleFromTriggerCell(const unsigned trigger_cell_id) const {
219  HGCalDetId trigger_cell_det_id(trigger_cell_id);
220  unsigned module = 0;
221  // BH
222  if (trigger_cell_det_id.subdetId() == ForwardSubdetector::HGCHEB) {
223  // For BH, the module ID is currently encoded as the wafer in HGCalDetId
224  module = trigger_cell_det_id.wafer();
225  }
226  // EE or FH
227  else {
228  auto module_itr = wafer_to_module_.find(trigger_cell_det_id.wafer());
229  if (module_itr == wafer_to_module_.end()) {
230  throw cms::Exception("BadGeometry")
231  << trigger_cell_det_id << "HGCalTriggerGeometry: Wafer " << trigger_cell_det_id.wafer()
232  << " is not mapped to any trigger module. The module mapping should be modified. See "
233  "https://twiki.cern.ch/twiki/bin/viewauth/CMS/HGCALTriggerPrimitivesSimulation#Trigger_geometry for "
234  "details.\n";
235  }
236  module = module_itr->second;
237  }
238  return HGCalDetId((ForwardSubdetector)trigger_cell_det_id.subdetId(),
239  trigger_cell_det_id.zside(),
240  trigger_cell_det_id.layer(),
241  (trigger_cell_det_id.waferType() == 1 ? 1 : 0),
242  module,
244  .rawId();
245 }
246 
248  const unsigned trigger_cell_id) const {
249  HGCalDetId trigger_cell_det_id(trigger_cell_id);
250  geom_set cell_det_ids;
251  // BH
252  if (trigger_cell_det_id.subdetId() == ForwardSubdetector::HGCHEB) {
253  unsigned subdet = trigger_cell_det_id.subdetId();
254  unsigned trigger_wafer = trigger_cell_det_id.wafer();
255  unsigned trigger_cell = trigger_cell_det_id.cell();
256  const auto& cell_range =
257  trigger_cells_to_cells_bh_.equal_range(packWaferCellId(subdet, trigger_wafer, trigger_cell));
258  for (auto tc_c_itr = cell_range.first; tc_c_itr != cell_range.second; tc_c_itr++) {
259  unsigned ieta = 0;
260  unsigned iphi = 0;
261  unpackIetaIphi(tc_c_itr->second, ieta, iphi);
262  unsigned cell_det_id =
263  HcalDetId(HcalEndcap, trigger_cell_det_id.zside() * ieta, iphi, trigger_cell_det_id.layer()).rawId();
264  if (validCellId(subdet, cell_det_id))
265  cell_det_ids.emplace(cell_det_id);
266  }
267  }
268  // EE or FH
269  else {
270  unsigned subdet = trigger_cell_det_id.subdetId();
271  unsigned trigger_wafer = trigger_cell_det_id.wafer();
272  unsigned trigger_cell = trigger_cell_det_id.cell();
273  const auto& cell_range = trigger_cells_to_cells_.equal_range(packWaferCellId(subdet, trigger_wafer, trigger_cell));
274  for (auto tc_c_itr = cell_range.first; tc_c_itr != cell_range.second; tc_c_itr++) {
275  unsigned wafer = 0;
276  unsigned cell = 0;
277  unpackWaferCellId(tc_c_itr->second, wafer, cell);
278  unsigned wafer_type = (detIdWaferType(subdet, wafer) == 1 ? 1 : 0);
279  unsigned cell_det_id = HGCalDetId((ForwardSubdetector)trigger_cell_det_id.subdetId(),
280  trigger_cell_det_id.zside(),
281  trigger_cell_det_id.layer(),
282  wafer_type,
283  wafer,
284  cell)
285  .rawId();
286  if (validCellId(subdet, cell_det_id))
287  cell_det_ids.emplace(cell_det_id);
288  }
289  }
290  return cell_det_ids;
291 }
292 
294  const unsigned module_id) const {
295  geom_set cell_det_ids;
296  geom_set trigger_cells = getTriggerCellsFromModule(module_id);
297  for (auto trigger_cell_id : trigger_cells) {
298  geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
299  cell_det_ids.insert(cells.begin(), cells.end());
300  }
301  return cell_det_ids;
302 }
303 
305  const unsigned module_id) const {
306  geom_ordered_set cell_det_ids;
307  geom_ordered_set trigger_cells = getOrderedTriggerCellsFromModule(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  HGCalDetId module_det_id(module_id);
318  geom_set trigger_cell_det_ids;
319  // BH
320  if (module_det_id.subdetId() == ForwardSubdetector::HGCHEB) {
321  unsigned module = module_det_id.wafer();
322  // loop on the trigger cells in each module
323  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_bh_.at(module); trigger_cell++) {
324  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(),
325  module_det_id.zside(),
326  module_det_id.layer(),
327  1,
328  module,
329  trigger_cell);
330  if (validTriggerCell(trigger_cell_id))
331  trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
332  }
333  }
334  // EE or FH
335  else {
336  unsigned module = module_det_id.wafer();
337  auto wafer_itrs = module_to_wafers_.equal_range(module);
338  // loop on the wafers included in the module
339  for (auto wafer_itr = wafer_itrs.first; wafer_itr != wafer_itrs.second; wafer_itr++) {
340  unsigned wafer = wafer_itr->second;
341  // loop on the trigger cells in each wafer
342  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_.at(wafer); trigger_cell++) {
343  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(),
344  module_det_id.zside(),
345  module_det_id.layer(),
346  1,
347  wafer,
348  trigger_cell);
349  if (validTriggerCell(trigger_cell_id))
350  trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
351  }
352  }
353  }
354  return trigger_cell_det_ids;
355 }
356 
358  const unsigned module_id) const {
359  HGCalDetId module_det_id(module_id);
360  geom_ordered_set trigger_cell_det_ids;
361  // BH
362  if (module_det_id.subdetId() == ForwardSubdetector::HGCHEB) {
363  unsigned module = module_det_id.wafer();
364  // loop on the trigger cells in each module
365  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_bh_.at(module); trigger_cell++) {
366  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(),
367  module_det_id.zside(),
368  module_det_id.layer(),
369  1,
370  module,
371  trigger_cell);
372  if (validTriggerCell(trigger_cell_id))
373  trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
374  }
375  }
376  // EE or FH
377  else {
378  unsigned module = module_det_id.wafer();
379  auto wafer_itrs = module_to_wafers_.equal_range(module);
380  // loop on the wafers included in the module
381  for (auto wafer_itr = wafer_itrs.first; wafer_itr != wafer_itrs.second; wafer_itr++) {
382  unsigned wafer = wafer_itr->second;
383  // loop on the trigger cells in each wafer
384  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_.at(wafer); trigger_cell++) {
385  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(),
386  module_det_id.zside(),
387  module_det_id.layer(),
388  1,
389  wafer,
390  trigger_cell);
391  if (validTriggerCell(trigger_cell_id))
392  trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
393  }
394  }
395  }
396  return trigger_cell_det_ids;
397 }
398 
400  const unsigned trigger_cell_id) const {
401  HGCalDetId trigger_cell_det_id(trigger_cell_id);
402  // Choose scintillator or silicon map
403  const auto& neighbors_map = (trigger_cell_det_id.subdetId() == ForwardSubdetector::HGCHEB ? trigger_cell_neighbors_bh_
405  unsigned module = trigger_cell_det_id.wafer();
406  unsigned trigger_cell = trigger_cell_det_id.cell();
407  // retrieve neighbors
408  unsigned trigger_cell_key = packTriggerCell(module, trigger_cell);
409  geom_set neighbor_detids;
410  auto neighbors_itr = neighbors_map.find(trigger_cell_key);
411  if (neighbors_itr == neighbors_map.end()) {
412  throw cms::Exception("BadGeometry") << "HGCalTriggerGeometry: Neighbors are not defined for trigger cell "
413  << trigger_cell << " in module " << module
414  << ". The trigger cell neighbor mapping should be modified. \n";
415  }
416  const auto& neighbors = neighbors_itr->second;
417  // create HGCalDetId of neighbors and check their validity
418  neighbor_detids.reserve(neighbors.size());
419  for (const auto& module_tc : neighbors) {
420  HGCalDetId neighbor_det_id((ForwardSubdetector)trigger_cell_det_id.subdetId(),
421  trigger_cell_det_id.zside(),
422  trigger_cell_det_id.layer(),
423  1,
424  module_tc.first,
425  module_tc.second);
426  if (validTriggerCell(neighbor_det_id.rawId())) {
427  neighbor_detids.emplace(neighbor_det_id.rawId());
428  }
429  }
430  return neighbor_detids;
431 }
432 
433 unsigned HGCalTriggerGeometryHexLayerBasedImp1::getLinksInModule(const unsigned module_id) const { return 1; }
434 
435 unsigned HGCalTriggerGeometryHexLayerBasedImp1::getModuleSize(const unsigned module_id) const { return 1; }
436 
438  unsigned subdet = HGCalDetId(trigger_cell_det_id).subdetId();
439  // Position: barycenter of the trigger cell.
440  Basic3DVector<float> triggerCellVector(0., 0., 0.);
441  const auto cell_ids = getCellsFromTriggerCell(trigger_cell_det_id);
442  // BH
443  if (subdet == ForwardSubdetector::HGCHEB) {
444  for (const auto& cell : cell_ids) {
445  HcalDetId cellDetId(cell);
446  triggerCellVector += bhGeometry()->getPosition(cellDetId).basicVector();
447  }
448  }
449  // EE or FH
450  else {
451  for (const auto& cell : cell_ids) {
452  HGCalDetId cellDetId(cell);
453  triggerCellVector += (cellDetId.subdetId() == ForwardSubdetector::HGCEE ? eeGeometry()->getPosition(cellDetId)
454  : fhGeometry()->getPosition(cellDetId))
455  .basicVector();
456  }
457  }
458  return GlobalPoint(triggerCellVector / cell_ids.size());
459 }
460 
462  unsigned subdet = HGCalDetId(module_det_id).subdetId();
463  // Position: barycenter of the module.
464  Basic3DVector<float> moduleVector(0., 0., 0.);
465  const auto cell_ids = getCellsFromModule(module_det_id);
466  // BH
467  if (subdet == ForwardSubdetector::HGCHEB) {
468  for (const auto& cell : cell_ids) {
469  HcalDetId cellDetId(cell);
470  moduleVector += bhGeometry()->getPosition(cellDetId).basicVector();
471  }
472  }
473  // EE or FH
474  else {
475  for (const auto& cell : cell_ids) {
476  HGCalDetId cellDetId(cell);
477  moduleVector += (cellDetId.subdetId() == ForwardSubdetector::HGCEE ? eeGeometry()->getPosition(cellDetId)
478  : fhGeometry()->getPosition(cellDetId))
479  .basicVector();
480  }
481  }
482  return GlobalPoint(moduleVector / cell_ids.size());
483 }
484 
486  //
487  // read module mapping file
488  std::ifstream l1tModulesMappingStream(l1tModulesMapping_.fullPath());
489  if (!l1tModulesMappingStream.is_open()) {
490  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TModulesMapping file\n";
491  }
492  short trigger_wafer = 0;
493  short module = 0;
494  for (; l1tModulesMappingStream >> trigger_wafer >> module;) {
495  wafer_to_module_.emplace(trigger_wafer, module);
496  module_to_wafers_.emplace(module, trigger_wafer);
497  // Default number of trigger cell in wafer is 0
498  number_trigger_cells_in_wafers_.emplace(trigger_wafer, 0);
499  }
500  if (!l1tModulesMappingStream.eof())
501  edm::LogWarning("HGCalTriggerGeometry")
502  << "Error reading L1TModulesMapping '" << trigger_wafer << " " << module << "' \n";
503  l1tModulesMappingStream.close();
504  // read trigger cell mapping file
505  std::ifstream l1tCellsMappingStream(l1tCellsMapping_.fullPath());
506  if (!l1tCellsMappingStream.is_open()) {
507  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TCellsMapping file\n";
508  }
509  short subdet = 0;
510  short wafer = 0;
511  short cell = 0;
512  trigger_wafer = 0;
513  short trigger_cell = 0;
514  for (; l1tCellsMappingStream >> subdet >> wafer >> cell >> trigger_wafer >> trigger_cell;) {
515  unsigned cell_key = packWaferCellId(subdet, wafer, cell);
516  unsigned trigger_cell_key = packWaferCellId(subdet, trigger_wafer, trigger_cell);
517  // fill cell <-> trigger cell mappings
518  cells_to_trigger_cells_.emplace(cell_key, trigger_cell_key);
519  trigger_cells_to_cells_.emplace(trigger_cell_key, cell_key);
520  // fill number of trigger cells in wafers
521  auto itr_insert = number_trigger_cells_in_wafers_.emplace(trigger_wafer, 0);
522  if (trigger_cell + 1 > itr_insert.first->second)
523  itr_insert.first->second = trigger_cell + 1;
524  }
525  if (!l1tCellsMappingStream.eof())
526  edm::LogWarning("HGCalTriggerGeometry") << "Error reading L1TCellsMapping '" << subdet << " " << wafer << " "
527  << cell << " " << trigger_wafer << " " << trigger_cell << "' \n";
528  l1tCellsMappingStream.close();
529  // read BH trigger cell mapping file
530  std::ifstream l1tCellsBHMappingStream(l1tCellsBHMapping_.fullPath());
531  if (!l1tCellsBHMappingStream.is_open()) {
532  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TCellsBHMapping file\n";
533  }
534  short ieta = 0;
535  short iphi = 0;
536  trigger_wafer = 0;
537  trigger_cell = 0;
538  for (; l1tCellsBHMappingStream >> ieta >> iphi >> trigger_wafer >> trigger_cell;) {
539  unsigned cell_key = packIetaIphi(ieta, iphi);
540  unsigned trigger_cell_key = packWaferCellId(ForwardSubdetector::HGCHEB, trigger_wafer, trigger_cell);
541  // fill cell <-> trigger cell mappings
542  cells_to_trigger_cells_bh_.emplace(cell_key, trigger_cell_key);
543  trigger_cells_to_cells_bh_.emplace(trigger_cell_key, cell_key);
544  // fill number of trigger cells in wafers
545  auto itr_insert = number_trigger_cells_in_wafers_bh_.emplace(trigger_wafer, 0);
546  if (trigger_cell + 1 > itr_insert.first->second)
547  itr_insert.first->second = trigger_cell + 1;
548  }
549  if (!l1tCellsBHMappingStream.eof())
550  edm::LogWarning("HGCalTriggerGeometry") << "Error reading L1TCellsBHMapping '" << ieta << " " << iphi << " "
551  << trigger_wafer << " " << trigger_cell << "' \n";
552  l1tCellsBHMappingStream.close();
553 }
554 
556  const edm::FileInPath& file, std::unordered_map<int, std::set<std::pair<short, short>>>& neighbors_map) {
557  // Fill trigger neighbor map
558  std::ifstream l1tCellNeighborsMappingStream(file.fullPath());
559  if (!l1tCellNeighborsMappingStream.is_open()) {
560  throw cms::Exception("MissingDataFile") << "Cannot open HGCalTriggerGeometry L1TCellNeighborsMapping file\n";
561  }
562  for (std::array<char, 512> buffer; l1tCellNeighborsMappingStream.getline(&buffer[0], 512);) {
563  std::string line(&buffer[0]);
564  // Extract keys consisting of the module id
565  // and of the trigger cell id
566  // Match patterns (X,Y)
567  // where X is a number with less than 4 digis
568  // and Y is a number with less than 4 digits
569  std::regex key_regex("\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\)");
570  std::vector<std::string> key_tokens{std::sregex_token_iterator(line.begin(), line.end(), key_regex), {}};
571  if (key_tokens.empty()) {
572  throw cms::Exception("BadGeometry") << "Syntax error in the L1TCellNeighborsMapping:\n"
573  << " Cannot find the trigger cell key in line:\n"
574  << " '" << &buffer[0] << "'\n";
575  }
576  std::regex digits_regex("\\d{1,3}");
577  std::vector<std::string> module_tc{
578  std::sregex_token_iterator(key_tokens[0].begin(), key_tokens[0].end(), digits_regex), {}};
579  // get module and cell id
580  int module = std::stoi(module_tc[0]);
581  int trigger_cell = std::stoi(module_tc[1]);
582  unsigned map_key = packTriggerCell(module, trigger_cell);
583  // Extract neighbors
584  // Match patterns (X,Y)
585  // where X is a number with less than 4 digits
586  // and Y is a number with less than 4 digits
587  std::regex neighbors_regex("\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\)");
588  std::vector<std::string> neighbors_tokens{std::sregex_token_iterator(line.begin(), line.end(), neighbors_regex),
589  {}};
590  if (neighbors_tokens.size() < 2) {
591  throw cms::Exception("BadGeometry") << "Syntax error in the L1TCellNeighborsMapping:\n"
592  << " Cannot find any neighbor in line:\n"
593  << " '" << &buffer[0] << "'\n";
594  }
595  auto itr_insert = neighbors_map.emplace(map_key, std::set<std::pair<short, short>>());
596  // The first element is the key, so start at index 1
597  for (unsigned i = 1; i < neighbors_tokens.size(); i++) {
598  const auto& neighbor = neighbors_tokens[i];
599  std::vector<std::string> pair_neighbor{std::sregex_token_iterator(neighbor.begin(), neighbor.end(), digits_regex),
600  {}};
601  short neighbor_module(std::stoi(pair_neighbor[0]));
602  short neighbor_cell(std::stoi(pair_neighbor[1]));
603  itr_insert.first->second.emplace(neighbor_module, neighbor_cell);
604  }
605  }
606  if (!l1tCellNeighborsMappingStream.eof())
607  edm::LogWarning("HGCalTriggerGeometry") << "Error reading L1TCellNeighborsMapping'\n";
608  l1tCellNeighborsMappingStream.close();
609 }
610 
612  unsigned n_layers_ee = eeTopology().dddConstants().layers(true);
613  for (unsigned layer = 1; layer <= n_layers_ee; layer++) {
614  for (const auto& wafer_module : wafer_to_module_) {
615  unsigned wafer = wafer_module.first;
616  // loop on the trigger cells in each wafer
617  for (int trigger_cell = 0; trigger_cell < number_trigger_cells_in_wafers_.at(wafer); trigger_cell++) {
618  std::set<unsigned> trigger_cell_ids;
619  trigger_cell_ids.emplace(HGCalDetId(ForwardSubdetector::HGCEE, -1, layer, 1, wafer, trigger_cell));
620  trigger_cell_ids.emplace(HGCalDetId(ForwardSubdetector::HGCEE, 1, layer, 1, wafer, trigger_cell));
621  trigger_cell_ids.emplace(HGCalDetId(ForwardSubdetector::HGCHEF, -1, layer, 1, wafer, trigger_cell));
622  trigger_cell_ids.emplace(HGCalDetId(ForwardSubdetector::HGCHEF, 1, layer, 1, wafer, trigger_cell));
623  for (unsigned trigger_cell : trigger_cell_ids) {
624  if (!validTriggerCellFromCells(trigger_cell))
625  invalid_triggercells_.emplace(trigger_cell);
626  for (unsigned neighbor : getNeighborsFromTriggerCell(trigger_cell)) {
627  if (!validTriggerCellFromCells(neighbor))
628  invalid_triggercells_.emplace(neighbor);
629  }
630  }
631  }
632  }
633  }
634 }
635 
636 unsigned HGCalTriggerGeometryHexLayerBasedImp1::packWaferCellId(unsigned subdet, unsigned wafer, unsigned cell) const {
637  unsigned packed_value = 0;
638  const int kSubdetMask = 0x7;
639  packed_value |= ((cell & HGCalDetId::kHGCalCellMask) << HGCalDetId::kHGCalCellOffset);
640  packed_value |= ((wafer & HGCalDetId::kHGCalWaferMask) << HGCalDetId::kHGCalWaferOffset);
641  packed_value |= ((subdet & kSubdetMask) << (HGCalDetId::kHGCalWaferTypeOffset));
642  return packed_value;
643 }
644 
646  unsigned packed_value = 0;
647  packed_value |= (iphi & HcalDetId::kHcalPhiMask2);
649  return packed_value;
650 }
651 
653  unsigned& wafer,
654  unsigned& cell) const {
655  cell = wafer_cell & HGCalDetId::kHGCalCellMask;
657 }
658 
659 void HGCalTriggerGeometryHexLayerBasedImp1::unpackIetaIphi(unsigned ieta_iphi, unsigned& ieta, unsigned& iphi) const {
660  iphi = ieta_iphi & HcalDetId::kHcalPhiMask2;
662 }
663 
665  bool is_valid = false;
666  if (DetId(cell_id).det() == DetId::Hcal) {
667  HcalDetId cell_det_id(cell_id);
668  if (cell_det_id.subdetId() != HcalEndcap)
669  is_valid = false;
670  else
671  is_valid = bhTopology().valid(cell_id);
672  } else if (DetId(cell_id).det() == DetId::Forward) {
673  HGCalDetId cell_det_id(cell_id);
674  unsigned subdet = cell_det_id.subdetId();
675  switch (subdet) {
677  is_valid = eeTopology().valid(cell_id);
678  break;
680  is_valid = fhTopology().valid(cell_id);
681  break;
682  default:
683  is_valid = false;
684  break;
685  }
686  }
687  return is_valid;
688 }
689 
690 bool HGCalTriggerGeometryHexLayerBasedImp1::validTriggerCell(const unsigned trigger_cell_id) const {
691  return invalid_triggercells_.find(trigger_cell_id) == invalid_triggercells_.end();
692 }
693 
694 bool HGCalTriggerGeometryHexLayerBasedImp1::disconnectedModule(const unsigned module_id) const {
695  bool disconnected = false;
696  if (disconnected_modules_.find(HGCalDetId(module_id).wafer()) != disconnected_modules_.end())
697  disconnected = true;
698  if (disconnected_layers_.find(layerWithOffset(module_id)) != disconnected_layers_.end())
699  disconnected = true;
700  return disconnected;
701 }
702 
703 unsigned HGCalTriggerGeometryHexLayerBasedImp1::triggerLayer(const unsigned id) const {
704  unsigned layer = layerWithOffset(id);
705  if (layer >= trigger_layers_.size())
706  return 0;
707  return trigger_layers_[layer];
708 }
709 
710 bool HGCalTriggerGeometryHexLayerBasedImp1::validTriggerCellFromCells(const unsigned trigger_cell_id) const {
711  // Check the validity of a trigger cell with the
712  // validity of the cells. One valid cell in the
713  // trigger cell is enough to make the trigger cell
714  // valid.
715  HGCalDetId trigger_cell_det_id(trigger_cell_id);
716  unsigned subdet = trigger_cell_det_id.subdetId();
717  const geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
718  bool is_valid = false;
719  for (const auto cell_id : cells) {
720  is_valid |= validCellId(subdet, cell_id);
721  if (is_valid)
722  break;
723  }
724  return is_valid;
725 }
726 
727 bool HGCalTriggerGeometryHexLayerBasedImp1::validCellId(unsigned subdet, unsigned cell_id) const {
728  bool is_valid = false;
729  switch (subdet) {
731  is_valid = eeTopology().valid(cell_id);
732  break;
734  is_valid = fhTopology().valid(cell_id);
735  break;
737  is_valid = bhTopology().valid(cell_id);
738  break;
739  default:
740  is_valid = false;
741  break;
742  }
743  return is_valid;
744 }
745 
746 unsigned HGCalTriggerGeometryHexLayerBasedImp1::packTriggerCell(unsigned module, unsigned trigger_cell) const {
747  unsigned packed_value = 0;
748  packed_value |= ((trigger_cell & HGCalDetId::kHGCalCellMask) << HGCalDetId::kHGCalCellOffset);
749  packed_value |= ((module & HGCalDetId::kHGCalWaferMask) << HGCalDetId::kHGCalWaferOffset);
750  return packed_value;
751 }
752 
753 int HGCalTriggerGeometryHexLayerBasedImp1::detIdWaferType(unsigned subdet, short wafer) const {
754  int wafer_type = 0;
755  switch (subdet) {
756  // HGCalDDDConstants::waferTypeT() returns 2=coarse, 1=fine
757  // HGCalDetId::waferType() returns -1=coarse, 1=fine
758  // Convert to HGCalDetId waferType
760  wafer_type = (eeTopology().dddConstants().waferTypeT(wafer) == 2 ? -1 : 1);
761  break;
763  wafer_type = (fhTopology().dddConstants().waferTypeT(wafer) == 2 ? -1 : 1);
764  break;
765  default:
766  break;
767  };
768  return wafer_type;
769 }
770 
772  HGCalDetId detid(id);
773  unsigned layer = 0;
774  switch (detid.subdetId()) {
776  layer = detid.layer();
777  break;
779  layer = fhOffset_ + detid.layer();
780  break;
782  layer = bhOffset_ + detid.layer();
783  break;
784  };
785  return layer;
786 }
787 
790  "HGCalTriggerGeometryHexLayerBasedImp1");
HGCalTriggerGeometryHexLayerBasedImp1::validTriggerCell
bool validTriggerCell(const unsigned) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:690
HGCalTriggerGeometryHexLayerBasedImp1::trigger_cell_neighbors_bh_
std::unordered_map< int, std::set< std::pair< short, short > > > trigger_cell_neighbors_bh_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:72
HGCalTriggerGeometryBase::eeTopology
const HGCalTopology & eeTopology() const
Definition: HGCalTriggerGeometryBase.h:65
HGCalTriggerGeometryBase
Definition: HGCalTriggerGeometryBase.h:19
mps_fire.i
i
Definition: mps_fire.py:428
HGCalTriggerGeometryHexLayerBasedImp1::getModulePosition
GlobalPoint getModulePosition(const unsigned) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:461
HGCalTopology::dddConstants
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98
HGCalTriggerGeometryHexLayerBasedImp1::reset
void reset() final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:115
HGCalDDDConstants::waferTypeT
int waferTypeT(int wafer) const
Definition: HGCalDDDConstants.h:179
HGCalDetId::kHGCalWaferOffset
static const int kHGCalWaferOffset
Definition: HGCalDetId.h:12
HcalDetId::iphi
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
ForwardSubdetector
ForwardSubdetector
Definition: ForwardSubdetector.h:4
HGCalTriggerGeometryHexLayerBasedImp1::l1tCellNeighborsBHMapping_
edm::FileInPath l1tCellNeighborsBHMapping_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:52
HGCalTriggerGeometryHexLayerBasedImp1
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:13
edm
HLT enums.
Definition: AlignableModifier.h:19
HGCalTriggerGeometryHexLayerBasedImp1::validTriggerCellFromCells
bool validTriggerCellFromCells(const unsigned) const
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:710
HGCalTriggerGeometryHexLayerBasedImp1::packTriggerCell
unsigned packTriggerCell(unsigned, unsigned) const
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:746
DetId::Hcal
Definition: DetId.h:28
HGCalDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCalDetId.h:49
HGCalTriggerGeometryHexLayerBasedImp1::bhOffset_
unsigned bhOffset_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:82
HGCalTriggerGeometryHexLayerBasedImp1::disconnectedModule
bool disconnectedModule(const unsigned) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:694
HGCalTriggerGeometryHexLayerBasedImp1::number_trigger_cells_in_wafers_
std::unordered_map< unsigned, unsigned short > number_trigger_cells_in_wafers_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:63
HcalDetId::depth
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164
HcalDetId::kHcalEtaOffset2
static constexpr uint32_t kHcalEtaOffset2
Definition: HcalDetId.h:17
HGCalTriggerGeometryHexLayerBasedImp1::totalLayers_
unsigned totalLayers_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:83
watchdog.const
const
Definition: watchdog.py:83
HGCalTriggerGeometryHexLayerBasedImp1::l1tCellsBHMapping_
edm::FileInPath l1tCellsBHMapping_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:49
HGCalDetId::layer
int layer() const
get the layer #
Definition: HGCalDetId.h:46
HGCalTriggerGeometryHexLayerBasedImp1::triggerLayer
unsigned triggerLayer(const unsigned) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:703
HGCalTriggerGeometryHexLayerBasedImp1::trigger_cells_to_cells_
std::unordered_multimap< unsigned, unsigned > trigger_cells_to_cells_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:60
HGCalTriggerGeometryHexLayerBasedImp1::validCell
bool validCell(const unsigned) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:664
HGCalTriggerGeometryHexLayerBasedImp1::getCellsFromModule
geom_set getCellsFromModule(const unsigned) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:293
HGCalTriggerGeometryHexLayerBasedImp1::packWaferCellId
unsigned packWaferCellId(unsigned subdet, unsigned wafer, unsigned cell) const
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:636
HGCalTriggerGeometryHexLayerBasedImp1::HGCalTriggerGeometryHexLayerBasedImp1
HGCalTriggerGeometryHexLayerBasedImp1(const edm::ParameterSet &conf)
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:102
HGCalTriggerGeometryHexLayerBasedImp1::packIetaIphi
unsigned packIetaIphi(unsigned ieta, unsigned iphi) const
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:645
ForwardSubdetector.h
FileInPath.h
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
HGCalTriggerGeometryHexLayerBasedImp1::fillMaps
void fillMaps()
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:485
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
HGCalDetId::kHGCalWaferMask
static const int kHGCalWaferMask
Definition: HGCalDetId.h:13
HGCalTriggerGeometryHexLayerBasedImp1::unpackIetaIphi
void unpackIetaIphi(unsigned ieta_iphi, unsigned &ieta, unsigned &iphi) const
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:659
DetId
Definition: DetId.h:17
edm::FileInPath
Definition: FileInPath.h:64
CaloGeometry
Definition: CaloGeometry.h:21
HGCalTriggerGeometryHexLayerBasedImp1::l1tModulesMapping_
edm::FileInPath l1tModulesMapping_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:50
HGCalTriggerGeometryHexLayerBasedImp1::l1tCellsMapping_
edm::FileInPath l1tCellsMapping_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:48
HGCalTriggerGeometryHexLayerBasedImp1::validCellId
bool validCellId(unsigned subdet, unsigned cell_id) const
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:727
HGCalTriggerGeometryHexLayerBasedImp1::layerWithOffset
unsigned layerWithOffset(unsigned) const
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:771
HGCalTriggerGeometryBase.h
HcalDetId::kHcalPhiMask2
static constexpr uint32_t kHcalPhiMask2
Definition: HcalDetId.h:15
HGCalTriggerGeometryHexLayerBasedImp1::getModuleSize
unsigned getModuleSize(const unsigned module_id) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:435
HGCalTriggerGeometryHexLayerBasedImp1::cells_to_trigger_cells_
std::unordered_map< unsigned, unsigned > cells_to_trigger_cells_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:59
mps_fire.end
end
Definition: mps_fire.py:242
HGCalTriggerGeometryHexLayerBasedImp1::getModuleFromTriggerCell
unsigned getModuleFromTriggerCell(const unsigned) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:218
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
HGCalTriggerGeometryHexLayerBasedImp1::getOrderedTriggerCellsFromModule
geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:357
Point3DBase< float, GlobalTag >
HGCalGeometry
Definition: HGCalGeometry.h:29
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
HGCalTriggerGeometryHexLayerBasedImp1::number_trigger_cells_in_wafers_bh_
std::unordered_map< unsigned, unsigned short > number_trigger_cells_in_wafers_bh_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:64
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
HGCEE
Definition: ForwardSubdetector.h:8
HGCalTriggerGeometryHexLayerBasedImp1::getTriggerCellFromCell
unsigned getTriggerCellFromCell(const unsigned) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:167
HGCalDetId::waferType
int waferType() const
get the wafer type
Definition: HGCalDetId.h:43
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
edm::ParameterSet
Definition: ParameterSet.h:47
HGCalTriggerGeometryHexLayerBasedImp1::getCellsFromTriggerCell
geom_set getCellsFromTriggerCell(const unsigned) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:247
HcalGeometry::getPosition
GlobalPoint getPosition(const DetId &id) const
Definition: HcalGeometry.cc:179
HGCalTriggerGeometryHexLayerBasedImp1::wafer_to_module_
std::unordered_map< unsigned, unsigned > wafer_to_module_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:55
HGCalTriggerGeometryHexLayerBasedImp1::trigger_layers_
std::vector< unsigned > trigger_layers_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:77
HGCalTriggerGeometryHexLayerBasedImp1::getTriggerCellsFromModule
geom_set getTriggerCellsFromModule(const unsigned) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:315
HGCalTriggerGeometryHexLayerBasedImp1::getNeighborsFromTriggerCell
geom_set getNeighborsFromTriggerCell(const unsigned) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:399
edmplugin::PluginFactory
Definition: PluginFactory.h:34
HcalDetId.h
HGCalTriggerGeometryHexLayerBasedImp1::getTriggerCellPosition
GlobalPoint getTriggerCellPosition(const unsigned) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:437
HGCalTriggerGeometryBase::geom_ordered_set
std::set< unsigned > geom_ordered_set
Definition: HGCalTriggerGeometryBase.h:23
HcalTopology::dddConstants
const HcalDDDRecConstants * dddConstants() const
Definition: HcalTopology.h:164
HGCalTriggerGeometryHexLayerBasedImp1::unpackWaferCellId
void unpackWaferCellId(unsigned wafer_cell, unsigned &wafer, unsigned &cell) const
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:652
HGCalDDDConstants::layers
unsigned int layers(bool reco) const
Definition: HGCalDDDConstants.cc:561
HGCalTriggerGeometryHexLayerBasedImp1::disconnected_layers_
std::unordered_set< unsigned > disconnected_layers_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:76
HcalDetId
Definition: HcalDetId.h:12
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
HGCalTriggerGeometryHexLayerBasedImp1::invalid_triggercells_
std::unordered_set< unsigned > invalid_triggercells_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:65
HGCalTriggerGeometryHexLayerBasedImp1::trigger_cell_neighbors_
std::unordered_map< int, std::set< std::pair< short, short > > > trigger_cell_neighbors_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:71
HGCalTriggerGeometryHexLayerBasedImp1::getLinksInModule
unsigned getLinksInModule(const unsigned module_id) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:433
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:191
HGCalDetId::kHGCalWaferTypeOffset
static const int kHGCalWaferTypeOffset
Definition: HGCalDetId.h:14
PV3DBase::basicVector
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
HGCalTriggerGeometryHexLayerBasedImp1::detIdWaferType
int detIdWaferType(unsigned subdet, short wafer) const
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:753
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
HGCalTriggerGeometryHexLayerBasedImp1::module_to_wafers_
std::unordered_multimap< unsigned, unsigned > module_to_wafers_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:56
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
HGCalDetId.h
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
HGCalTriggerGeometryHexLayerBasedImp1::l1tCellNeighborsMapping_
edm::FileInPath l1tCellNeighborsMapping_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:51
HcalEndcap
Definition: HcalAssistant.h:34
HGCalTriggerGeometryHexLayerBasedImp1::cells_to_trigger_cells_bh_
std::unordered_map< unsigned, unsigned > cells_to_trigger_cells_bh_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:61
Exception
Definition: hltDiff.cc:246
postprocess-scan-build.cells
cells
Definition: postprocess-scan-build.py:13
HGCalDetId::kHGCalCellOffset
static const int kHGCalCellOffset
Definition: HGCalDetId.h:10
HGCalTriggerGeometryHexLayerBasedImp1::getModuleFromCell
unsigned getModuleFromCell(const unsigned) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:214
HGCalTriggerGeometryHexLayerBasedImp1::getOrderedCellsFromModule
geom_ordered_set getOrderedCellsFromModule(const unsigned) const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:304
HGCalTriggerGeometryHexLayerBasedImp1::fillNeighborMaps
void fillNeighborMaps(const edm::FileInPath &, std::unordered_map< int, std::set< std::pair< short, short >>> &)
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:555
HGCalTriggerGeometryHexLayerBasedImp1::initialize
void initialize(const CaloGeometry *) final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:128
HGCalTriggerGeometryBase::setCaloGeometry
void setCaloGeometry(const CaloGeometry *geom)
Definition: HGCalTriggerGeometryBase.h:106
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCalTriggerGeometryHexLayerBasedImp1::trigger_cells_to_cells_bh_
std::unordered_multimap< unsigned, unsigned > trigger_cells_to_cells_bh_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:62
HcalDDDRecConstants::getMaxDepth
int getMaxDepth(const int &type) const
Definition: HcalDDDRecConstants.h:88
HcalDetId::kHcalEtaMask2
static constexpr uint32_t kHcalEtaMask2
Definition: HcalDetId.h:19
HGCalTopology::valid
bool valid(const DetId &id) const override
Is this a valid cell id.
Definition: HGCalTopology.cc:463
HGCHEF
Definition: ForwardSubdetector.h:9
HGCalTriggerGeometryHexLayerBasedImp1::lastTriggerLayer
unsigned lastTriggerLayer() const final
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:44
HcalDetId::ietaAbs
constexpr int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:148
HGCalTriggerGeometryHexLayerBasedImp1::last_trigger_layer_
unsigned last_trigger_layer_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:78
DetId::Forward
Definition: DetId.h:30
HcalDetId::zside
constexpr int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:141
mps_splice.line
line
Definition: mps_splice.py:76
edm::Log
Definition: MessageLogger.h:70
HGCalTriggerGeometryHexLayerBasedImp1::fillInvalidTriggerCells
void fillInvalidTriggerCells()
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:611
HGCalDetId::cell
int cell() const
get the absolute value of the cell #'s in x and y
Definition: HGCalDetId.h:37
HGCalTriggerGeometryHexLayerBasedImp1::fhOffset_
unsigned fhOffset_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:81
HGCalTriggerGeometryBase::bhGeometry
const HcalGeometry * bhGeometry() const
Definition: HGCalTriggerGeometryBase.h:51
Basic3DVector< float >
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163
HGCalTriggerGeometryHexLayerBasedImp1::disconnected_modules_
std::unordered_set< unsigned > disconnected_modules_
Definition: HGCalTriggerGeometryHexLayerBasedImp1.cc:75
HGCHEB
Definition: ForwardSubdetector.h:10
HGCalTriggerGeometryBase::fhTopology
const HGCalTopology & fhTopology() const
Definition: HGCalTriggerGeometryBase.h:66