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 
13 
15 {
16  public:
18 
19  void initialize(const edm::ESHandle<CaloGeometry>& ) final;
22  const edm::ESHandle<HGCalGeometry>&) final;
23  void reset() final;
24 
25  unsigned getTriggerCellFromCell( const unsigned ) const final;
26  unsigned getModuleFromCell( const unsigned ) const final;
27  unsigned getModuleFromTriggerCell( const unsigned ) const final;
28 
29  geom_set getCellsFromTriggerCell( const unsigned ) const final;
30  geom_set getCellsFromModule( const unsigned ) const final;
31  geom_set getTriggerCellsFromModule( const unsigned ) const final;
32 
33  geom_ordered_set getOrderedCellsFromModule( const unsigned ) const final;
34  geom_ordered_set getOrderedTriggerCellsFromModule( const unsigned ) const final;
35 
36  geom_set getNeighborsFromTriggerCell( const unsigned ) const final;
37 
38  GlobalPoint getTriggerCellPosition(const unsigned ) const final;
39  GlobalPoint getModulePosition(const unsigned ) const final;
40 
41  bool validTriggerCell( const unsigned ) const final;
42  bool disconnectedModule(const unsigned) const final;
43  unsigned triggerLayer(const unsigned) const final;
44 
45  private:
52 
53  // module related maps
54  std::unordered_map<unsigned, unsigned> wafer_to_module_;
55  std::unordered_multimap<unsigned, unsigned> module_to_wafers_;
56 
57  // trigger cell related maps
58  std::unordered_map<unsigned, unsigned> cells_to_trigger_cells_;
59  std::unordered_multimap<unsigned, unsigned> trigger_cells_to_cells_;
60  std::unordered_map<unsigned, unsigned> cells_to_trigger_cells_sci_;
61  std::unordered_multimap<unsigned, unsigned> trigger_cells_to_cells_sci_;
62  std::unordered_map<unsigned, unsigned short> number_trigger_cells_in_wafers_;
63  std::unordered_map<unsigned, unsigned short> number_trigger_cells_in_wafers_sci_;
64  std::unordered_map<unsigned, unsigned> wafers_to_wafers_old_;
65  std::unordered_map<unsigned, unsigned> wafers_old_to_wafers_;
66  std::unordered_set<unsigned> invalid_triggercells_;
67 
68  // neighbor related maps
69  // trigger cell neighbors:
70  // - The key includes the module and trigger cell id
71  // - The value is a set of (module_id, trigger_cell_id)
72  typedef std::unordered_map<int, std::set<std::pair<short,short>>> neighbor_map;
75 
76  // Disconnected modules and layers
77  std::unordered_set<unsigned> disconnected_modules_;
78  std::unordered_set<unsigned> disconnected_layers_;
79  std::vector<unsigned> trigger_layers_;
80 
81  // layer offsets
82  unsigned heOffset_;
83  unsigned totalLayers_;
84 
85  void fillMaps();
86  void fillNeighborMap(const edm::FileInPath&, neighbor_map&, bool);
88  unsigned packTriggerCell(unsigned, unsigned) const;
89  unsigned packTriggerCellWithType(unsigned, unsigned, unsigned) const;
90  bool validCellId(unsigned det, unsigned cell_id) const;
91  bool validTriggerCellFromCells( const unsigned ) const;
92 
93  int detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const;
94  unsigned packWaferCellId(unsigned subdet, unsigned wafer, unsigned cell) const;
95  unsigned packWaferId(int waferU, int waferV) const;
96  unsigned packCellId(unsigned type, unsigned cellU, unsigned cellV) const;
97  unsigned packCellId(unsigned type, unsigned cell) const;
98  unsigned packIetaIphi(unsigned ieta, unsigned iphi) const;
99  void unpackWaferCellId(unsigned wafer_cell, unsigned& wafer, unsigned& cell) const;
100  void unpackWaferId(unsigned wafer, int& waferU, int& waferV) const;
101  void unpackCellId(unsigned cell, unsigned& cellU, unsigned& cellV) const;
102  void unpackIetaIphi(unsigned ieta_iphi, unsigned& ieta, unsigned& iphi) const;
103 
104  unsigned layerWithOffset(unsigned) const;
105 };
106 
107 
111  l1tCellsMapping_(conf.getParameter<edm::FileInPath>("L1TCellsMapping")),
112  l1tCellsSciMapping_(conf.getParameter<edm::FileInPath>("L1TCellsSciMapping")),
113  l1tWafersMapping_(conf.getParameter<edm::FileInPath>("L1TWafersMapping")),
114  l1tModulesMapping_(conf.getParameter<edm::FileInPath>("L1TModulesMapping")),
115  l1tCellNeighborsMapping_(conf.getParameter<edm::FileInPath>("L1TCellNeighborsMapping")),
116  l1tCellNeighborsSciMapping_(conf.getParameter<edm::FileInPath>("L1TCellNeighborsSciMapping"))
117 {
118  std::vector<unsigned> tmp_vector = conf.getParameter<std::vector<unsigned>>("DisconnectedModules");
119  std::move(tmp_vector.begin(), tmp_vector.end(), std::inserter(disconnected_modules_, disconnected_modules_.end()));
120  tmp_vector = conf.getParameter<std::vector<unsigned>>("DisconnectedLayers");
121  std::move(tmp_vector.begin(), tmp_vector.end(), std::inserter(disconnected_layers_, disconnected_layers_.end()));
122 }
123 
124 void
127 {
128  cells_to_trigger_cells_.clear();
129  trigger_cells_to_cells_.clear();
132  wafers_to_wafers_old_.clear();
133  wafers_old_to_wafers_.clear();
134  wafer_to_module_.clear();
135  module_to_wafers_.clear();
138  trigger_cell_neighbors_.clear();
140 }
141 
142 void
145 {
146  throw cms::Exception("BadGeometry")
147  << "HGCalTriggerGeometryV9Imp1 geometry cannot be initialized with the V7/V8 HGCAL geometry";
148 }
149 
150 void
153  const edm::ESHandle<HGCalGeometry>& hgc_hsi_geometry,
154  const edm::ESHandle<HGCalGeometry>& hgc_hsc_geometry
155  )
156 {
157  setEEGeometry(hgc_ee_geometry);
158  setHSiGeometry(hgc_hsi_geometry);
159  setHScGeometry(hgc_hsc_geometry);
162  trigger_layers_.resize(totalLayers_+1);
163  unsigned trigger_layer = 0;
164  for(unsigned layer=0; layer<totalLayers_; layer++)
165  {
166  if(disconnected_layers_.find(layer)==disconnected_layers_.end())
167  {
168  // Increase trigger layer number if the layer is not disconnected
169  trigger_layers_[layer] = trigger_layer;
170  trigger_layer++;
171  }
172  else
173  {
174  trigger_layers_[layer] = 0;
175  }
176  }
177  fillMaps();
181 
182 }
183 
184 unsigned
186 getTriggerCellFromCell( const unsigned cell_id ) const
187 {
188  unsigned det = DetId(cell_id).det();
189  unsigned subdet = 0;
190  int zside = 0;
191  unsigned tc_type = 1;
192  unsigned layer = 0;
193  unsigned wafer_trigger_cell = 0;
194  unsigned trigger_cell = 0;
195  // Scintillator
196  if(det == DetId::HGCalHSc)
197  {
198  HGCScintillatorDetId cell_det_id(cell_id);
199  unsigned ieta = cell_det_id.ietaAbs();
200  unsigned iphi = cell_det_id.iphi();
201  tc_type = cell_det_id.type();
202  layer = cell_det_id.layer();
204  zside = cell_det_id.zside();
205  auto trigger_cell_itr = cells_to_trigger_cells_sci_.find(packIetaIphi(ieta, iphi));
206  if(trigger_cell_itr==cells_to_trigger_cells_sci_.end())
207  {
208  throw cms::Exception("BadGeometry")
209  << "HGCalTriggerGeometry: scintillator cell ieta=" << ieta << ", iphi="<<iphi<<" is not mapped to any trigger cell. The trigger cell mapping should be modified.\n";
210  }
211  trigger_cell = 0;
212  wafer_trigger_cell = 0;
213  unpackWaferCellId(trigger_cell_itr->second, wafer_trigger_cell, trigger_cell);
214  }
215  // Silicon
216  else if(det == DetId::HGCalEE || det == DetId::HGCalHSi)
217  {
218  HGCSiliconDetId cell_det_id(cell_id);
220  layer = cell_det_id.layer();
221  zside = cell_det_id.zside();
222  int type = cell_det_id.type();
223  int waferu = cell_det_id.waferU();
224  int waferv = cell_det_id.waferV();
225  unsigned cellu = cell_det_id.cellU();
226  unsigned cellv = cell_det_id.cellV();
227  auto trigger_cell_itr = cells_to_trigger_cells_.find(packCellId(type, cellu, cellv));
228  if(trigger_cell_itr==cells_to_trigger_cells_.end())
229  {
230  throw cms::Exception("BadGeometry")
231  << "HGCalTriggerGeometry: HGCal cell " << cellu << "," << cellv << " in wafer type "<<type<<" is not mapped to any trigger cell. The trigger cell mapping should be modified.\n";
232  }
233  auto wafer_trigger_cell_itr = wafers_to_wafers_old_.find(packWaferId(waferu, waferv));
234  if(wafer_trigger_cell_itr==wafers_to_wafers_old_.end())
235  {
236  throw cms::Exception("BadGeometry")
237  << "HGCalTriggerGeometry: Wafer "<<waferu<<","<<waferv<<" is not mapped to any trigger wafer ID. The wafer mapping should be modified.\n";
238  }
239  trigger_cell = trigger_cell_itr->second;
240  wafer_trigger_cell = wafer_trigger_cell_itr->second;
241  }
242  // Using the old HGCalDetId for trigger cells is temporary
243  // For easy switch between V8 and V9 geometries
244  return HGCalDetId((ForwardSubdetector)subdet, zside, layer, tc_type, wafer_trigger_cell, trigger_cell).rawId();
245 
246 }
247 
248 unsigned
250 getModuleFromCell( const unsigned cell_id ) const
251 {
253 }
254 
255 unsigned
257 getModuleFromTriggerCell( const unsigned trigger_cell_id ) const
258 {
259  HGCalDetId trigger_cell_det_id(trigger_cell_id);
260  unsigned module = 0;
261  // Scintillator
262  if(trigger_cell_det_id.subdetId()==ForwardSubdetector::HGCHEB)
263  {
264  // For scintillator, the module ID is currently encoded as the wafer in HGCalDetId
265  module = trigger_cell_det_id.wafer();
266  }
267  // Silicon
268  else
269  {
270  auto module_itr = wafer_to_module_.find(trigger_cell_det_id.wafer());
271  if(module_itr==wafer_to_module_.end())
272  {
273  throw cms::Exception("BadGeometry")
274  <<trigger_cell_det_id
275  << "HGCalTriggerGeometry: Wafer " << trigger_cell_det_id.wafer() << " is not mapped to any trigger module. The module mapping should be modified. See https://twiki.cern.ch/twiki/bin/viewauth/CMS/HGCALTriggerPrimitivesSimulation#Trigger_geometry for details.\n";
276  }
277  module = module_itr->second;
278  }
279  return HGCalDetId((ForwardSubdetector)trigger_cell_det_id.subdetId(), trigger_cell_det_id.zside(), trigger_cell_det_id.layer(), trigger_cell_det_id.waferType(), module, HGCalDetId::kHGCalCellMask).rawId();
280 }
281 
284 getCellsFromTriggerCell( const unsigned trigger_cell_id ) const
285 {
286  HGCalDetId trigger_cell_det_id(trigger_cell_id);
287  geom_set cell_det_ids;
288  unsigned subdet = trigger_cell_det_id.subdetId();
289  unsigned trigger_wafer = trigger_cell_det_id.wafer();
290  unsigned trigger_cell = trigger_cell_det_id.cell();
291  unsigned layer = trigger_cell_det_id.layer();
292  // Scintillator
293  if(subdet==ForwardSubdetector::HGCHEB)
294  {
295  int type = hscTopology().dddConstants().getTypeTrap(layer);
296  const auto& cell_range = trigger_cells_to_cells_sci_.equal_range(packWaferCellId(subdet, trigger_wafer, trigger_cell));
297  for(auto tc_c_itr=cell_range.first; tc_c_itr!=cell_range.second; tc_c_itr++)
298  {
299  unsigned ieta = 0;
300  unsigned iphi = 0;
301  unpackIetaIphi(tc_c_itr->second, ieta, iphi);
302  unsigned cell_det_id = HGCScintillatorDetId(type, layer, trigger_cell_det_id.zside()*ieta, iphi).rawId();
303  if(validCellId(subdet, cell_det_id)) cell_det_ids.emplace(cell_det_id);
304  }
305  }
306  // Silicon
307  else
308  {
309  int waferu = 0;
310  int waferv = 0;
311  auto wafer_itr = wafers_old_to_wafers_.find(trigger_wafer);
312  if(wafer_itr==wafers_old_to_wafers_.end())
313  {
314  throw cms::Exception("BadGeometry")
315  << "HGCalTriggerGeometry: Trigger wafer ID "<<trigger_wafer<<" is not mapped to any wafer. The wafer mapping should be modified.\n";
316  }
317  unpackWaferId(wafer_itr->second, waferu, waferv);
319  unsigned wafer_type = detIdWaferType(det, layer, waferu, waferv);
320  const auto& cell_range = trigger_cells_to_cells_.equal_range(packCellId(wafer_type, trigger_cell));
321  for(auto tc_c_itr=cell_range.first; tc_c_itr!=cell_range.second; tc_c_itr++)
322  {
323  unsigned cellu = 0;
324  unsigned cellv = 0;
325  unpackCellId(tc_c_itr->second, cellu, cellv);
326  unsigned cell_det_id = HGCSiliconDetId(det, trigger_cell_det_id.zside(), wafer_type, layer, waferu, waferv, cellu, cellv).rawId();
327  if(validCellId(subdet, cell_det_id)) cell_det_ids.emplace(cell_det_id);
328  }
329  }
330  return cell_det_ids;
331 }
332 
335 getCellsFromModule( const unsigned module_id ) const
336 {
337  geom_set cell_det_ids;
338  geom_set trigger_cells = getTriggerCellsFromModule(module_id);
339  for(auto trigger_cell_id : trigger_cells)
340  {
341  geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
342  cell_det_ids.insert(cells.begin(), cells.end());
343  }
344  return cell_det_ids;
345 }
346 
349 getOrderedCellsFromModule( const unsigned module_id ) const
350 {
351  geom_ordered_set cell_det_ids;
352  geom_ordered_set trigger_cells = getOrderedTriggerCellsFromModule(module_id);
353  for(auto trigger_cell_id : trigger_cells)
354  {
355  geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
356  cell_det_ids.insert(cells.begin(), cells.end());
357  }
358  return cell_det_ids;
359 }
360 
363 getTriggerCellsFromModule( const unsigned module_id ) const
364 {
365  HGCalDetId module_det_id(module_id);
366  geom_set trigger_cell_det_ids;
367  unsigned module = module_det_id.wafer();
368  // Scintillator
369  if(module_det_id.subdetId()==ForwardSubdetector::HGCHEB)
370  {
371  // loop on the trigger cells in each module
372  for(int trigger_cell=0; trigger_cell<number_trigger_cells_in_wafers_sci_.at(module); trigger_cell++)
373  {
374  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(), module_det_id.zside(), module_det_id.layer(), module_det_id.waferType(), module, trigger_cell);
375  if(validTriggerCell(trigger_cell_id)) trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
376  }
377  }
378  // Silicon
379  else
380  {
381  auto wafer_itrs = module_to_wafers_.equal_range(module);
382  // loop on the wafers included in the module
383  for(auto wafer_itr=wafer_itrs.first; wafer_itr!=wafer_itrs.second; wafer_itr++)
384  {
385  unsigned wafer = wafer_itr->second;
386  auto waferuv_itr = wafers_old_to_wafers_.find(wafer);
387  if(waferuv_itr==wafers_old_to_wafers_.end()) continue;
388  int waferu = 0;
389  int waferv = 0;
390  unpackWaferId(waferuv_itr->second, waferu, waferv);
392  unsigned layer = module_det_id.layer();
393  unsigned wafer_type = detIdWaferType(det, layer, waferu, waferv);
394  // loop on the trigger cells in each wafer
395  for(int trigger_cell=0; trigger_cell<number_trigger_cells_in_wafers_.at(wafer_type); trigger_cell++)
396  {
397  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(), module_det_id.zside(), module_det_id.layer(), module_det_id.waferType(), wafer, trigger_cell);
398  if(validTriggerCell(trigger_cell_id)) trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
399  }
400  }
401  }
402  return trigger_cell_det_ids;
403 }
404 
407 getOrderedTriggerCellsFromModule( const unsigned module_id ) const
408 {
409  HGCalDetId module_det_id(module_id);
410  geom_ordered_set trigger_cell_det_ids;
411  unsigned module = module_det_id.wafer();
412  // Scintillator
413  if(module_det_id.subdetId()==ForwardSubdetector::HGCHEB)
414  {
415  // loop on the trigger cells in each module
416  for(int trigger_cell=0; trigger_cell<number_trigger_cells_in_wafers_sci_.at(module); trigger_cell++)
417  {
418  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(), module_det_id.zside(), module_det_id.layer(), module_det_id.waferType(), module, trigger_cell);
419  if(validTriggerCell(trigger_cell_id)) trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
420  }
421  }
422  // EE or FH
423  else
424  {
425  auto wafer_itrs = module_to_wafers_.equal_range(module);
426  // loop on the wafers included in the module
427  for(auto wafer_itr=wafer_itrs.first; wafer_itr!=wafer_itrs.second; wafer_itr++)
428  {
429  unsigned wafer = wafer_itr->second;
430  auto waferuv_itr = wafers_old_to_wafers_.find(wafer);
431  if(waferuv_itr==wafers_old_to_wafers_.end()) continue;
432  int waferu = 0;
433  int waferv = 0;
434  unpackWaferId(waferuv_itr->second, waferu, waferv);
436  unsigned layer = module_det_id.layer();
437  unsigned wafer_type = detIdWaferType(det, layer, waferu, waferv);
438  // loop on the trigger cells in each wafer
439  for(int trigger_cell=0; trigger_cell<number_trigger_cells_in_wafers_.at(wafer_type); trigger_cell++)
440  {
441  HGCalDetId trigger_cell_id((ForwardSubdetector)module_det_id.subdetId(), module_det_id.zside(), module_det_id.layer(), module_det_id.waferType(), wafer, trigger_cell);
442  if(validTriggerCell(trigger_cell_id)) trigger_cell_det_ids.emplace(trigger_cell_id.rawId());
443  }
444  }
445  }
446  return trigger_cell_det_ids;
447 }
448 
449 
450 
453 getNeighborsFromTriggerCell( const unsigned trigger_cell_id ) const
454 {
455  HGCalDetId trigger_cell_det_id(trigger_cell_id);
456  // Choose scintillator or silicon map
457  const auto& neighbors_map = (trigger_cell_det_id.subdetId()==ForwardSubdetector::HGCHEB ? trigger_cell_neighbors_sci_ : trigger_cell_neighbors_);
458  unsigned layer = trigger_cell_det_id.layer();
459  unsigned type = (trigger_cell_det_id.subdetId()==ForwardSubdetector::HGCHEB ? hscTopology().dddConstants().getTypeTrap(layer): 1);
460  unsigned module = trigger_cell_det_id.wafer();
461  unsigned trigger_cell = trigger_cell_det_id.cell();
462  // retrieve neighbors
463  unsigned trigger_cell_key = (trigger_cell_det_id.subdetId()==ForwardSubdetector::HGCHEB ? packTriggerCellWithType(type, module, trigger_cell) : packTriggerCell(module, trigger_cell));
464  geom_set neighbor_detids;
465  auto neighbors_itr = neighbors_map.find(trigger_cell_key);
466  if(neighbors_itr==neighbors_map.end())
467  {
468  throw cms::Exception("BadGeometry")
469  << "HGCalTriggerGeometry: Neighbors are not defined for trigger cell " << trigger_cell << " in module "
470  << module << ". The trigger cell neighbor mapping should be modified. \n";
471  }
472  const auto& neighbors = neighbors_itr->second;
473  // create HGCalDetId of neighbors and check their validity
474  neighbor_detids.reserve(neighbors.size());
475  for(const auto& module_tc : neighbors)
476  {
477  HGCalDetId neighbor_det_id((ForwardSubdetector)trigger_cell_det_id.subdetId(), trigger_cell_det_id.zside(), layer, type, module_tc.first, module_tc.second);
478  if(validTriggerCell(neighbor_det_id.rawId()))
479  {
480  neighbor_detids.emplace(neighbor_det_id.rawId());
481  }
482  }
483  return neighbor_detids;
484 }
485 
486 
489 getTriggerCellPosition(const unsigned trigger_cell_det_id) const
490 {
491  unsigned subdet = HGCalDetId(trigger_cell_det_id).subdetId();
492  // Position: barycenter of the trigger cell.
493  Basic3DVector<float> triggerCellVector(0.,0.,0.);
494  const auto cell_ids = getCellsFromTriggerCell(trigger_cell_det_id);
495  // Scintillator
496  if(subdet==ForwardSubdetector::HGCHEB)
497  {
498  for(const auto& cell : cell_ids)
499  {
500  HcalDetId cellDetId(cell);
501  triggerCellVector += hscGeometry()->getPosition(cellDetId).basicVector();
502  }
503  }
504  // Silicon
505  else
506  {
507  for(const auto& cell : cell_ids)
508  {
509  HGCSiliconDetId cellDetId(cell);
510  triggerCellVector += (cellDetId.det()==DetId::HGCalEE ? eeGeometry()->getPosition(cellDetId) : hsiGeometry()->getPosition(cellDetId)).basicVector();
511  }
512  }
513  return GlobalPoint( triggerCellVector/cell_ids.size() );
514 
515 }
516 
519 getModulePosition(const unsigned module_det_id) const
520 {
521  unsigned subdet = HGCalDetId(module_det_id).subdetId();
522  // Position: barycenter of the module.
523  Basic3DVector<float> moduleVector(0.,0.,0.);
524  const auto cell_ids = getCellsFromModule(module_det_id);
525  // Scintillator
526  if(subdet==ForwardSubdetector::HGCHEB)
527  {
528  for(const auto& cell : cell_ids)
529  {
530  HGCScintillatorDetId cellDetId(cell);
531  moduleVector += hscGeometry()->getPosition(cellDetId).basicVector();
532  }
533  }
534  // Silicon
535  else
536  {
537  for(const auto& cell : cell_ids)
538  {
539  HGCSiliconDetId cellDetId(cell);
540  moduleVector += (cellDetId.det()==DetId::HGCalEE ? eeGeometry()->getPosition(cellDetId) : hsiGeometry()->getPosition(cellDetId)).basicVector();
541  }
542  }
543  return GlobalPoint( moduleVector/cell_ids.size() );
544 }
545 
546 
547 void
550 {
551  //
552  // read module mapping file
553  std::ifstream l1tModulesMappingStream(l1tModulesMapping_.fullPath());
554  if(!l1tModulesMappingStream.is_open())
555  {
556  throw cms::Exception("MissingDataFile")
557  << "Cannot open HGCalTriggerGeometry L1TModulesMapping file\n";
558  }
559  short trigger_wafer = 0;
560  short module = 0;
561  for(; l1tModulesMappingStream>>trigger_wafer>>module; )
562  {
563  wafer_to_module_.emplace(trigger_wafer,module);
564  module_to_wafers_.emplace(module, trigger_wafer);
565  }
566  if(!l1tModulesMappingStream.eof())
567  {
568  throw cms::Exception("BadGeometryFile")
569  << "Error reading L1TModulesMapping '"<<trigger_wafer<<" "<<module<<"' \n";
570  }
571  l1tModulesMappingStream.close();
572  // read trigger cell mapping file
573  std::ifstream l1tCellsMappingStream(l1tCellsMapping_.fullPath());
574  if(!l1tCellsMappingStream.is_open())
575  {
576  throw cms::Exception("MissingDataFile")
577  << "Cannot open HGCalTriggerGeometry L1TCellsMapping file\n";
578  }
579  short type = 0;
580  short cellu = 0;
581  short cellv = 0;
582  short trigger_cell = 0;
583  for(; l1tCellsMappingStream>>type>>cellu>>cellv>>trigger_cell; )
584  {
585  unsigned cell_key = packCellId(type,cellu,cellv);
586  unsigned trigger_cell_key = packCellId(type,trigger_cell);
587  // fill cell <-> trigger cell mappings
588  cells_to_trigger_cells_.emplace(cell_key, trigger_cell);
589  trigger_cells_to_cells_.emplace(trigger_cell_key, cell_key);
590  // fill number of trigger cells in wafers
591  auto itr_insert = number_trigger_cells_in_wafers_.emplace(type, 0);
592  if(trigger_cell+1 > itr_insert.first->second) itr_insert.first->second = trigger_cell+1;
593  }
594  if(!l1tCellsMappingStream.eof())
595  {
596  throw cms::Exception("BadGeometryFile")
597  << "Error reading L1TCellsMapping '"<<type<<" "<<cellu<<" "<<cellv<<" "<<trigger_cell<<"' \n";
598  }
599  l1tCellsMappingStream.close();
600  // read scintillator trigger cell mapping file
601  std::ifstream l1tCellsSciMappingStream(l1tCellsSciMapping_.fullPath());
602  if(!l1tCellsSciMappingStream.is_open())
603  {
604  throw cms::Exception("MissingDataFile")
605  << "Cannot open HGCalTriggerGeometry L1TCellsSciMapping file\n";
606  }
607  short ieta = 0;
608  short iphi = 0;
609  trigger_wafer = 0;
610  trigger_cell = 0;
611  for(; l1tCellsSciMappingStream>>ieta>>iphi>>trigger_wafer>>trigger_cell; )
612  {
613  unsigned cell_key = packIetaIphi(ieta,iphi);
614  unsigned trigger_cell_key = packWaferCellId(ForwardSubdetector::HGCHEB,trigger_wafer,trigger_cell);
615  // fill cell <-> trigger cell mappings
616  cells_to_trigger_cells_sci_.emplace(cell_key, trigger_cell_key);
617  trigger_cells_to_cells_sci_.emplace(trigger_cell_key, cell_key);
618  // fill number of trigger cells in wafers
619  auto itr_insert = number_trigger_cells_in_wafers_sci_.emplace(trigger_wafer, 0);
620  if(trigger_cell+1 > itr_insert.first->second) itr_insert.first->second = trigger_cell+1;
621  }
622  if(!l1tCellsSciMappingStream.eof())
623  {
624  throw cms::Exception("BadGeometryFile")
625  << "Error reading L1TCellsSciMapping '"<<ieta<<" "<<iphi<<" "<<trigger_wafer<<" "<<trigger_cell<<"' \n";
626  }
627  l1tCellsSciMappingStream.close();
628  // read wafer mapping file
629  std::ifstream l1tWafersMappingStream(l1tWafersMapping_.fullPath());
630  if(!l1tWafersMappingStream.is_open())
631  {
632  throw cms::Exception("MissingDataFile")
633  << "Cannot open HGCalTriggerGeometry L1TWafersMapping file\n";
634  }
635  short waferu = 0;
636  short waferv = 0;
637  trigger_wafer = 0;
638  for(; l1tWafersMappingStream>>waferu>>waferv>>trigger_wafer; )
639  {
640  unsigned wafer_key = packWaferId(waferu,waferv);
641  // fill wafer u,v <-> old wafer ID mappings
642  wafers_to_wafers_old_.emplace(wafer_key, trigger_wafer);
643  wafers_old_to_wafers_.emplace(trigger_wafer, wafer_key);
644  }
645  if(!l1tWafersMappingStream.eof())
646  {
647  throw cms::Exception("BadGeometryFile")
648  << "Error reading L1TWafersMapping '"<<waferu<<" "<<waferv<<" "<<trigger_wafer<<"' \n";
649  }
650  l1tWafersMappingStream.close();
651 }
652 
653 
654 void
656 fillNeighborMap(const edm::FileInPath& file, neighbor_map& neighbors_map, bool scintillator)
657 {
658  // Fill trigger neighbor map
659  std::ifstream l1tCellNeighborsMappingStream(file.fullPath());
660  if(!l1tCellNeighborsMappingStream.is_open())
661  {
662  throw cms::Exception("MissingDataFile")
663  << "Cannot open HGCalTriggerGeometry L1TCellNeighborsMapping file\n";
664  }
665  const unsigned line_size = 512;
666  for(std::array<char,line_size> buffer; l1tCellNeighborsMappingStream.getline(&buffer[0], line_size); )
667  {
668  std::string line(&buffer[0]);
669  // Extract keys consisting of the module id
670  // and of the trigger cell id
671  // Match patterns (X,Y)
672  // where X is a number with less than 4 digis
673  // and Y is a number with less than 4 digits
674  // For the scintillator case, match instead (X,Y,Z) patterns
675  std::regex key_regex(scintillator ? "\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\)" : "\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\)");
676  std::vector<std::string> key_tokens {
677  std::sregex_token_iterator(line.begin(), line.end(), key_regex), {}
678  };
679  if(key_tokens.empty())
680  {
681  throw cms::Exception("BadGeometry")
682  << "Syntax error in the L1TCellNeighborsMapping:\n"
683  << " Cannot find the trigger cell key in line:\n"
684  << " '"<<&buffer[0]<<"'\n";
685  }
686  std::regex digits_regex("\\d{1,3}");
687  std::vector<std::string> module_tc {
688  std::sregex_token_iterator(key_tokens[0].begin(), key_tokens[0].end(), digits_regex), {}
689  };
690  // get module and cell id
691  unsigned map_key = 0;
692  if(scintillator)
693  {
694  int type = std::stoi(module_tc[0]);
695  int module = std::stoi(module_tc[1]);
696  int trigger_cell = std::stoi(module_tc[2]);
697  map_key = packTriggerCellWithType(type, module, trigger_cell);
698  }
699  else
700  {
701  int module = std::stoi(module_tc[0]);
702  int trigger_cell = std::stoi(module_tc[1]);
703  map_key = packTriggerCell(module, trigger_cell);
704  }
705  // Extract neighbors
706  // Match patterns (X,Y)
707  // where X is a number with less than 4 digits
708  // and Y is a number with less than 4 digits
709  std::regex neighbors_regex("\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\)");
710  std::vector<std::string> neighbors_tokens {
711  std::sregex_token_iterator(line.begin(), line.end(), neighbors_regex), {}
712  };
713  if( (scintillator && neighbors_tokens.empty()) ||
714  (!scintillator && neighbors_tokens.size()<2)
715  )
716  {
717  throw cms::Exception("BadGeometry")
718  << "Syntax error in the L1TCellNeighborsMapping:\n"
719  << " Cannot find any neighbor in line:\n"
720  << " '"<<&buffer[0]<<"'\n";
721  }
722  auto itr_insert = neighbors_map.emplace(map_key, std::set<std::pair<short,short>>());
723  // The first element for silicon neighbors is the key, so start at index 1
724  unsigned first_element = (scintillator ? 0 : 1);
725  for(unsigned i=first_element; i<neighbors_tokens.size(); i++)
726  {
727  const auto& neighbor = neighbors_tokens[i];
728  std::vector<std::string> pair_neighbor {
729  std::sregex_token_iterator(neighbor.begin(), neighbor.end(), digits_regex), {}
730  };
731  short neighbor_module(std::stoi(pair_neighbor[0]));
732  short neighbor_cell(std::stoi(pair_neighbor[1]));
733  itr_insert.first->second.emplace(neighbor_module, neighbor_cell);
734  }
735  }
736  if(!l1tCellNeighborsMappingStream.eof())
737  {
738  throw cms::Exception("BadGeometryFile")
739  << "Error reading L1TCellNeighborsMapping'\n";
740  }
741  l1tCellNeighborsMappingStream.close();
742 
743 }
744 
745 
746 void
749 {
750  unsigned n_layers_ee = eeTopology().dddConstants().layers(true);
751  for(unsigned layer=1; layer<=n_layers_ee; layer++)
752  {
753  for(const auto& waferuv_wafer : wafers_to_wafers_old_)
754  {
755  int waferu = 0;
756  int waferv = 0;
757  unpackWaferId(waferuv_wafer.first, waferu, waferv);
758  unsigned waferee_type = detIdWaferType(DetId::HGCalEE, layer, waferu, waferv);
759  unsigned waferfh_type = detIdWaferType(DetId::HGCalHSi, layer, waferu, waferv);
760  unsigned trigger_wafer = waferuv_wafer.second;
761  // loop on the trigger cells in each wafer
762  for(int trigger_cell=0; trigger_cell<number_trigger_cells_in_wafers_.at(waferee_type); trigger_cell++)
763  {
764  for(int zside : {-1,1})
765  {
766  HGCalDetId trigger_cell_id(ForwardSubdetector::HGCEE, zside, layer, 1, trigger_wafer, trigger_cell);
767  if(!validTriggerCellFromCells(trigger_cell_id)) invalid_triggercells_.emplace(trigger_cell_id);
768  for(unsigned neighbor : getNeighborsFromTriggerCell(trigger_cell_id))
769  {
770  auto wafer_itr = wafers_old_to_wafers_.find(HGCalDetId(neighbor).wafer());
771  if(wafer_itr==wafers_old_to_wafers_.end()) invalid_triggercells_.emplace(neighbor);
772  else if(!validTriggerCellFromCells(neighbor)) invalid_triggercells_.emplace(neighbor);
773  }
774  }
775  }
776  for(int trigger_cell=0; trigger_cell<number_trigger_cells_in_wafers_.at(waferfh_type); trigger_cell++)
777  {
778  for(int zside : {-1,1})
779  {
780  HGCalDetId trigger_cell_id(ForwardSubdetector::HGCHEF, zside, layer, 1, trigger_wafer, trigger_cell);
781  if(!validTriggerCellFromCells(trigger_cell_id)) invalid_triggercells_.emplace(trigger_cell_id);
782  for(unsigned neighbor : getNeighborsFromTriggerCell(trigger_cell_id))
783  {
784  auto wafer_itr = wafers_old_to_wafers_.find(HGCalDetId(neighbor).wafer());
785  if(wafer_itr==wafers_old_to_wafers_.end()) invalid_triggercells_.emplace(neighbor);
786  else if(!validTriggerCellFromCells(neighbor)) invalid_triggercells_.emplace(neighbor);
787  }
788  }
789  }
790  }
791  }
792  unsigned n_layers_hsc = hscTopology().dddConstants().layers(true);
793  unsigned first_layer_hsc = hscTopology().dddConstants().firstLayer();
794  for(unsigned layer=first_layer_hsc; layer<=first_layer_hsc+n_layers_hsc; layer++)
795  {
796  int type = hscTopology().dddConstants().getTypeTrap(layer);
797  for(const auto& module_ncells : number_trigger_cells_in_wafers_sci_)
798  {
799  unsigned trigger_wafer = module_ncells.first;
800  // loop on the trigger cells in each wafer
801  for(int trigger_cell=1; trigger_cell<module_ncells.second; trigger_cell++)
802  {
803  for(int zside : {-1,1})
804  {
805  HGCalDetId trigger_cell_id(ForwardSubdetector::HGCHEB, zside, layer, type, trigger_wafer, trigger_cell);
806  if(!validTriggerCellFromCells(trigger_cell_id)) invalid_triggercells_.emplace(trigger_cell_id);
807  for(unsigned neighbor : getNeighborsFromTriggerCell(trigger_cell_id))
808  {
809  if(!validTriggerCellFromCells(neighbor)) invalid_triggercells_.emplace(neighbor);
810  }
811  }
812  }
813  }
814  }
815 }
816 
817 unsigned
819 packWaferCellId(unsigned subdet, unsigned wafer, unsigned cell) const
820 {
821  unsigned packed_value = 0;
822  const int kSubdetMask = 0x7;
823  packed_value |= ((cell & HGCalDetId::kHGCalCellMask) << HGCalDetId::kHGCalCellOffset);
824  packed_value |= ((wafer & HGCalDetId::kHGCalWaferMask) << HGCalDetId::kHGCalWaferOffset);
825  packed_value |= ((subdet & kSubdetMask) << (HGCalDetId::kHGCalWaferTypeOffset));
826  return packed_value;
827 }
828 
829 unsigned
831 packCellId(unsigned type, unsigned cell) const
832 {
833  unsigned packed_value = 0;
834  packed_value |= ((cell & HGCalDetId::kHGCalCellMask) << HGCalDetId::kHGCalCellOffset);
836  return packed_value;
837 }
838 
839 unsigned
841 packCellId(unsigned type, unsigned cellU, unsigned cellV) const
842 {
843  unsigned packed_value = 0;
847  return packed_value;
848 }
849 
850 unsigned
852 packWaferId(int waferU, int waferV) const
853 {
854  unsigned packed_value = 0;
855  unsigned waferUabs = std::abs(waferU);
856  unsigned waferVabs = std::abs(waferV);
857  unsigned waferUsign = (waferU >= 0) ? 0 : 1;
858  unsigned waferVsign = (waferV >= 0) ? 0 : 1;
863  return packed_value;
864 }
865 
866 unsigned
868 packIetaIphi(unsigned ieta, unsigned iphi) const
869 {
870  unsigned packed_value = 0;
873  return packed_value;
874 }
875 
876 void
878 unpackWaferCellId(unsigned wafer_cell, unsigned& wafer, unsigned& cell) const
879 {
880  cell = wafer_cell & HGCalDetId::kHGCalCellMask;
882 }
883 
884 void
886 unpackCellId(unsigned cell, unsigned& cellU, unsigned& cellV) const
887 {
890 }
891 
892 
893 void
895 unpackWaferId(unsigned wafer, int& waferU, int& waferV) const
896 {
899  waferU = ( ((wafer >> HGCSiliconDetId::kHGCalWaferUSignOffset) & HGCSiliconDetId::kHGCalWaferUSignMask) ? -waferUAbs : waferUAbs );
900  waferV = ( ((wafer >> HGCSiliconDetId::kHGCalWaferVSignOffset) & HGCSiliconDetId::kHGCalWaferVSignMask) ? -waferVAbs : waferVAbs );
901 }
902 
903 
904 void
906 unpackIetaIphi(unsigned ieta_iphi, unsigned& ieta, unsigned& iphi) const
907 {
910 }
911 
912 bool
914 validTriggerCell(const unsigned trigger_cell_id) const
915 {
916  return invalid_triggercells_.find(trigger_cell_id)==invalid_triggercells_.end();
917 }
918 
919 bool
921 disconnectedModule(const unsigned module_id) const
922 {
923  bool disconnected = false;
924  if(disconnected_modules_.find(HGCalDetId(module_id).wafer())!=disconnected_modules_.end()) disconnected = true;
925  if(disconnected_layers_.find(layerWithOffset(module_id))!=disconnected_layers_.end()) disconnected = true;
926  return disconnected;
927 }
928 
929 unsigned
931 triggerLayer(const unsigned id) const
932 {
933  unsigned layer = layerWithOffset(id);
934  if(layer>=trigger_layers_.size()) return 0;
935  return trigger_layers_[layer];
936 }
937 
938 bool
940 validTriggerCellFromCells(const unsigned trigger_cell_id) const
941 {
942  // Check the validity of a trigger cell with the
943  // validity of the cells. One valid cell in the
944  // trigger cell is enough to make the trigger cell
945  // valid.
946  HGCalDetId trigger_cell_det_id(trigger_cell_id);
947  unsigned subdet = trigger_cell_det_id.subdetId();
948  const geom_set cells = getCellsFromTriggerCell(trigger_cell_id);
949  bool is_valid = false;
950  for(const auto cell_id : cells)
951  {
952  is_valid |= validCellId(subdet, cell_id);
953  if(is_valid) break;
954  }
955  return is_valid;
956 }
957 
958 bool
960 validCellId(unsigned subdet, unsigned cell_id) const
961 {
962  bool is_valid = false;
963  switch(subdet)
964  {
966  is_valid = eeTopology().valid(cell_id);
967  break;
969  is_valid = hsiTopology().valid(cell_id);
970  break;
972  is_valid = hscTopology().valid(cell_id);
973  break;
974  default:
975  is_valid = false;
976  break;
977  }
978  return is_valid;
979 }
980 
981 
982 unsigned
984 packTriggerCell(unsigned module, unsigned trigger_cell) const
985 {
986  unsigned packed_value = 0;
987  packed_value |= ((trigger_cell & HGCalDetId::kHGCalCellMask) << HGCalDetId::kHGCalCellOffset);
988  packed_value |= ((module & HGCalDetId::kHGCalWaferMask) << HGCalDetId::kHGCalWaferOffset);
989  return packed_value;
990 }
991 
992 unsigned
994 packTriggerCellWithType(unsigned type, unsigned module, unsigned trigger_cell) const
995 {
996  unsigned packed_value = 0;
997  packed_value |= ((trigger_cell & HGCalDetId::kHGCalCellMask) << HGCalDetId::kHGCalCellOffset);
998  packed_value |= ((module & HGCalDetId::kHGCalWaferMask) << HGCalDetId::kHGCalWaferOffset);
1000  return packed_value;
1001 }
1002 
1003 int
1005 detIdWaferType(unsigned det, unsigned layer, short waferU, short waferV) const
1006 {
1007  int wafer_type = 0;
1008  switch(det)
1009  {
1010  case DetId::HGCalEE:
1011  wafer_type = eeTopology().dddConstants().getTypeHex(layer, waferU, waferV);
1012  break;
1013  case DetId::HGCalHSi:
1014  wafer_type = hsiTopology().dddConstants().getTypeHex(layer, waferU, waferV);
1015  break;
1016  default:
1017  break;
1018  };
1019  return wafer_type;
1020 }
1021 
1022 
1023 unsigned
1025 layerWithOffset(unsigned id) const
1026 {
1027  HGCalDetId detid(id);
1028  unsigned layer = 0;
1029  switch(detid.subdetId())
1030  {
1032  layer = detid.layer();
1033  break;
1035  layer = heOffset_ + detid.layer();
1036  break;
1038  layer = heOffset_ + detid.layer();
1039  break;
1040  };
1041  return layer;
1042 }
1043 
1044 
1045 
1048  "HGCalTriggerGeometryV9Imp1");
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
std::unordered_map< int, std::set< std::pair< short, short > > > neighbor_map
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:44
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)
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:197
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