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(); }
HGCalTriggerGeometryBase::eeTopology
const HGCalTopology & eeTopology() const
Definition: HGCalTriggerGeometryBase.h:65
HGCalTriggerGeometryBase
Definition: HGCalTriggerGeometryBase.h:19
HGCalTopology::dddConstants
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98
HGCalTriggerGeometryGenericMapping::getNeighborsFromTriggerCell
geom_set getNeighborsFromTriggerCell(const unsigned trigger_cell_det_id) const final
Definition: HGCalTriggerGeometryGenericMapping.cc:88
HGCalTriggerGeometryGenericMapping::trigger_cell_map
std::unordered_map< unsigned, std::unique_ptr< const HGCalTriggerGeometry::TriggerCell > > trigger_cell_map
Definition: HGCalTriggerGeometryGenericMapping.h:104
HGCalTriggerGeometryGenericMapping.h
HGCalTriggerGeometryGenericMapping::trigger_cells_to_modules_
geom_map trigger_cells_to_modules_
Definition: HGCalTriggerGeometryGenericMapping.h:139
HGCalDetId::layer
int layer() const
get the layer #
Definition: HGCalDetId.h:46
HGCalTriggerGeometryGenericMapping::validTriggerCell
bool validTriggerCell(const unsigned trigger_cell_det_id) const final
Definition: HGCalTriggerGeometryGenericMapping.cc:106
HGCalTriggerGeometryGenericMapping::reset
void reset() final
Definition: HGCalTriggerGeometryGenericMapping.cc:13
HGCalTriggerGeometryGenericMapping::lastTriggerLayer
unsigned lastTriggerLayer() const final
Definition: HGCalTriggerGeometryGenericMapping.cc:112
HGCalTriggerGeometryGenericMapping::getModuleFromCell
unsigned getModuleFromCell(const unsigned cell_det_id) const final
Definition: HGCalTriggerGeometryGenericMapping.cc:28
HGCalTriggerGeometryGenericMapping::getModuleFromTriggerCell
unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const final
Definition: HGCalTriggerGeometryGenericMapping.cc:40
Point3DBase< float, GlobalTag >
HGCalTriggerGeometryGenericMapping::getCellsFromModule
geom_set getCellsFromModule(const unsigned cell_det_id) const final
Definition: HGCalTriggerGeometryGenericMapping.cc:53
HGCalTriggerGeometryGenericMapping::HGCalTriggerGeometryGenericMapping
HGCalTriggerGeometryGenericMapping(const edm::ParameterSet &conf)
Definition: HGCalTriggerGeometryGenericMapping.cc:10
HGCalTriggerGeometryGenericMapping::disconnectedModule
bool disconnectedModule(const unsigned module_id) const final
Definition: HGCalTriggerGeometryGenericMapping.cc:110
HGCalTriggerGeometryGenericMapping::getOrderedTriggerCellsFromModule
geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned trigger_cell_det_id) const final
Definition: HGCalTriggerGeometryGenericMapping.cc:78
HGCalTriggerGeometryGenericMapping::getTriggerCellsFromModule
geom_set getTriggerCellsFromModule(const unsigned trigger_cell_det_id) const final
Definition: HGCalTriggerGeometryGenericMapping.cc:73
edm::ParameterSet
Definition: ParameterSet.h:36
HGCalTriggerGeometryGenericMapping::getCellsFromTriggerCell
geom_set getCellsFromTriggerCell(const unsigned cell_det_id) const final
Definition: HGCalTriggerGeometryGenericMapping.cc:48
HGCalTriggerGeometryGenericMapping::getModuleSize
unsigned getModuleSize(const unsigned module_id) const final
Definition: HGCalTriggerGeometryGenericMapping.cc:96
HGCalTriggerGeometryBase::geom_ordered_set
std::set< unsigned > geom_ordered_set
Definition: HGCalTriggerGeometryBase.h:23
HGCalDDDConstants::layers
unsigned int layers(bool reco) const
Definition: HGCalDDDConstants.cc:558
HGCalTriggerGeometryGenericMapping::getTriggerCellFromCell
unsigned getTriggerCellFromCell(const unsigned cell_det_id) const final
Definition: HGCalTriggerGeometryGenericMapping.cc:20
HGCalTriggerGeometryGenericMapping::cells_to_trigger_cells_
geom_map cells_to_trigger_cells_
Definition: HGCalTriggerGeometryGenericMapping.h:138
HGCalTriggerGeometryGenericMapping::module_map
std::unordered_map< unsigned, std::unique_ptr< const HGCalTriggerGeometry::Module > > module_map
Definition: HGCalTriggerGeometryGenericMapping.h:103
HGCalTriggerGeometryBase::geom_set
std::unordered_set< unsigned > geom_set
Definition: HGCalTriggerGeometryBase.h:22
HGCalTriggerGeometryGenericMapping::trigger_cells_
trigger_cell_map trigger_cells_
Definition: HGCalTriggerGeometryGenericMapping.h:142
HGCalTriggerGeometry
Definition: HGCalTriggerGeometryGenericMapping.h:30
HGCalTriggerGeometryGenericMapping::getLinksInModule
unsigned getLinksInModule(const unsigned module_id) const final
Definition: HGCalTriggerGeometryGenericMapping.cc:94
HGCalDetId
Definition: HGCalDetId.h:8
HGCalTriggerGeometryGenericMapping::getOrderedCellsFromModule
geom_ordered_set getOrderedCellsFromModule(const unsigned cell_det_id) const final
Definition: HGCalTriggerGeometryGenericMapping.cc:63
HGCalTriggerGeometryGenericMapping::getTriggerCellPosition
GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const final
Definition: HGCalTriggerGeometryGenericMapping.cc:98
postprocess-scan-build.cells
cells
Definition: postprocess-scan-build.py:13
HGCalTriggerGeometryBase::geom_map
std::unordered_map< unsigned, unsigned > geom_map
Definition: HGCalTriggerGeometryBase.h:21
HGCalTriggerGeometryGenericMapping::getModulePosition
GlobalPoint getModulePosition(const unsigned module_det_id) const final
Definition: HGCalTriggerGeometryGenericMapping.cc:102
HGCalTriggerGeometryGenericMapping::triggerLayer
unsigned triggerLayer(const unsigned id) const final
Definition: HGCalTriggerGeometryGenericMapping.cc:116
HGCalTriggerGeometryGenericMapping::modules_
module_map modules_
Definition: HGCalTriggerGeometryGenericMapping.h:141