CMS 3D CMS Logo

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 } // namespace
9 
11  : HGCalTriggerGeometryBase(conf) {}
12 
16  module_map().swap(modules_);
18 }
19 
20 unsigned HGCalTriggerGeometryGenericMapping::getTriggerCellFromCell(const unsigned cell_det_id) const {
21  auto found_tc = cells_to_trigger_cells_.find(cell_det_id);
22  if (found_tc == cells_to_trigger_cells_.end()) {
23  return 0;
24  }
25  return trigger_cells_.find(found_tc->second)->second->triggerCellId();
26 }
27 
28 unsigned HGCalTriggerGeometryGenericMapping::getModuleFromCell(const unsigned cell_det_id) const {
29  auto found_tc = cells_to_trigger_cells_.find(cell_det_id);
30  if (found_tc == cells_to_trigger_cells_.end()) {
31  return 0;
32  }
33  auto found_mod = trigger_cells_to_modules_.find(found_tc->second);
34  if (found_mod == trigger_cells_to_modules_.end()) {
35  return 0;
36  }
37  return modules_.find(found_mod->second)->second->moduleId();
38 }
39 
40 unsigned HGCalTriggerGeometryGenericMapping::getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const {
41  auto found_mod = trigger_cells_to_modules_.find(trigger_cell_det_id);
42  if (found_mod == trigger_cells_to_modules_.end()) {
43  return 0;
44  }
45  return modules_.find(found_mod->second)->second->moduleId();
46 }
47 
49  const unsigned trigger_cell_det_id) const {
50  return trigger_cells_.find(trigger_cell_det_id)->second->components();
51 }
52 
54  const unsigned module_det_id) const {
55  const auto& triggercell_cells = modules_.find(module_det_id)->second->triggerCellComponents();
57  for (const auto& tc_c : triggercell_cells) {
58  cells.emplace(tc_c.second);
59  }
60  return cells;
61 }
62 
64  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 
74  const unsigned module_det_id) const {
75  return modules_.find(module_det_id)->second->components();
76 }
77 
79  const unsigned module_det_id) const {
80  // Build set from unordered_set. Maybe a more efficient to do it
82  for (const auto& tc : modules_.find(module_det_id)->second->components()) {
83  trigger_cells.emplace(tc);
84  }
85  return trigger_cells;
86 }
87 
89  const unsigned trigger_cell_id) const {
90  // empty neighbors
91  return geom_set();
92 }
93 
94 unsigned HGCalTriggerGeometryGenericMapping::getLinksInModule(const unsigned module_id) const { return 1; }
95 
96 unsigned HGCalTriggerGeometryGenericMapping::getModuleSize(const unsigned module_id) const { return 1; }
97 
99  return trigger_cells_.find(trigger_cell_det_id)->second->position();
100 }
101 
103  return modules_.find(module_det_id)->second->position();
104 }
105 
106 bool HGCalTriggerGeometryGenericMapping::validTriggerCell(const unsigned trigger_cell_det_id) const {
107  return (trigger_cells_.find(trigger_cell_det_id) != trigger_cells_.end());
108 }
109 
110 bool HGCalTriggerGeometryGenericMapping::disconnectedModule(const unsigned module_id) const { return false; }
111 
113  return eeTopology().dddConstants().layers(true);
114 }
115 
116 unsigned HGCalTriggerGeometryGenericMapping::triggerLayer(const unsigned id) const { return HGCalDetId(id).layer(); }
GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const final
unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const final
unsigned getTriggerCellFromCell(const unsigned cell_det_id) const final
unsigned getModuleFromCell(const unsigned cell_det_id) const final
const HGCalTopology & eeTopology() const
geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned trigger_cell_det_id) const final
geom_set getCellsFromTriggerCell(const unsigned cell_det_id) const final
HGCalTriggerGeometryGenericMapping(const edm::ParameterSet &conf)
unsigned triggerLayer(const unsigned id) const final
unsigned getModuleSize(const unsigned module_id) const final
std::unordered_map< unsigned, std::unique_ptr< const HGCalTriggerGeometry::Module > > module_map
geom_ordered_set getOrderedCellsFromModule(const unsigned cell_det_id) const final
unsigned int layers(bool reco) const
GlobalPoint getModulePosition(const unsigned module_det_id) const final
geom_set getCellsFromModule(const unsigned cell_det_id) const final
unsigned getLinksInModule(const unsigned module_id) const final
bool validTriggerCell(const unsigned trigger_cell_det_id) const final
std::unordered_map< unsigned, std::unique_ptr< const HGCalTriggerGeometry::TriggerCell > > trigger_cell_map
std::unordered_map< unsigned, unsigned > geom_map
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:96
geom_set getTriggerCellsFromModule(const unsigned trigger_cell_det_id) const final
std::set< unsigned > geom_ordered_set
std::unordered_set< unsigned > geom_set
bool disconnectedModule(const unsigned module_id) const final
geom_set getNeighborsFromTriggerCell(const unsigned trigger_cell_det_id) const final
int layer() const
get the layer #
Definition: HGCalDetId.h:46