test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HGCalTriggerGeometryGenericMapping.cc
Go to the documentation of this file.
2 
3 using namespace HGCalTriggerGeometry;
4 
5 namespace {
6  std::unique_ptr<const TriggerCell> null_tc;
7  std::unique_ptr<const Module> null_mod;
8 }
9 
13 }
14 
18  module_map().swap(modules_);
20 }
21 
22 unsigned
24 getTriggerCellFromCell( const unsigned cell_det_id ) const {
25  auto found_tc = cells_to_trigger_cells_.find(cell_det_id);
26  if( found_tc == cells_to_trigger_cells_.end() ) {
27  return 0;
28  }
29  return trigger_cells_.find(found_tc->second)->second->triggerCellId();
30 }
31 
32 unsigned
34 getModuleFromCell( const unsigned cell_det_id ) const {
35  auto found_tc = cells_to_trigger_cells_.find(cell_det_id);
36  if( found_tc == cells_to_trigger_cells_.end() ) {
37  return 0;
38  }
39  auto found_mod = trigger_cells_to_modules_.find(found_tc->second);
40  if( found_mod == trigger_cells_to_modules_.end() ) {
41  return 0;
42  }
43  return modules_.find(found_mod->second)->second->moduleId();
44 }
45 
46 unsigned
48 getModuleFromTriggerCell( const unsigned trigger_cell_det_id ) const {
49  auto found_mod = trigger_cells_to_modules_.find(trigger_cell_det_id);
50  if( found_mod == trigger_cells_to_modules_.end() ) {
51  return 0;
52  }
53  return modules_.find(found_mod->second)->second->moduleId();
54 }
55 
58 getCellsFromTriggerCell( const unsigned trigger_cell_det_id ) const {
59  return trigger_cells_.find(trigger_cell_det_id)->second->components();
60 }
61 
64 getCellsFromModule( const unsigned module_det_id ) const {
65  const auto& triggercell_cells = modules_.find(module_det_id)->second->triggerCellComponents();
67  for(const auto& tc_c : triggercell_cells) {
68  cells.emplace(tc_c.second);
69  }
70  return cells;
71 }
72 
75 getOrderedCellsFromModule( const unsigned module_det_id ) const {
76  const auto& triggercell_cells = modules_.find(module_det_id)->second->triggerCellComponents();
78  for(const auto& tc_c : triggercell_cells) {
79  cells.emplace(tc_c.second);
80  }
81  return cells;
82 }
83 
86 getTriggerCellsFromModule( const unsigned module_det_id ) const {
87  return modules_.find(module_det_id)->second->components();
88 }
89 
92 getOrderedTriggerCellsFromModule( const unsigned module_det_id ) const {
93  // Build set from unordered_set. Maybe a more efficient to do it
95  for(const auto& tc : modules_.find(module_det_id)->second->components()) {
96  trigger_cells.emplace(tc);
97  }
98  return trigger_cells;
99 }
100 
103 getTriggerCellPosition(const unsigned trigger_cell_det_id) const {
104  return trigger_cells_.find(trigger_cell_det_id)->second->position();
105 }
106 
109 getModulePosition(const unsigned module_det_id) const {
110  return modules_.find(module_det_id)->second->position();
111 }
112 
113 
std::unordered_map< unsigned, unsigned > geom_map
virtual geom_ordered_set getOrderedCellsFromModule(const unsigned cell_det_id) const overridefinal
virtual GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const overridefinal
virtual geom_set getTriggerCellsFromModule(const unsigned trigger_cell_det_id) const overridefinal
virtual geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned trigger_cell_det_id) const overridefinal
virtual unsigned getModuleFromCell(const unsigned cell_det_id) const overridefinal
HGCalTriggerGeometryGenericMapping(const edm::ParameterSet &conf)
virtual unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const overridefinal
std::unordered_map< unsigned, std::unique_ptr< const HGCalTriggerGeometry::TriggerCell > > trigger_cell_map
std::unordered_map< unsigned, std::unique_ptr< const HGCalTriggerGeometry::Module > > module_map
std::set< unsigned > geom_ordered_set
virtual GlobalPoint getModulePosition(const unsigned module_det_id) const overridefinal
std::unordered_set< unsigned > geom_set
virtual unsigned getTriggerCellFromCell(const unsigned cell_det_id) const overridefinal
virtual geom_set getCellsFromModule(const unsigned cell_det_id) const overridefinal
virtual geom_set getCellsFromTriggerCell(const unsigned cell_det_id) const overridefinal