CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Attributes
HGCalTriggerGeometryGenericMapping Class Reference

#include <HGCalTriggerGeometryGenericMapping.h>

Inheritance diagram for HGCalTriggerGeometryGenericMapping:
HGCalTriggerGeometryBase HGCalTriggerGeometryHexImp1 HGCalTriggerGeometryImp1 NullGeometry TrivialGeometry

Public Types

typedef std::unordered_map< unsigned, std::unique_ptr< const HGCalTriggerGeometry::Module > > module_map
 
typedef std::unordered_map< unsigned, std::unique_ptr< const HGCalTriggerGeometry::TriggerCell > > trigger_cell_map
 
- Public Types inherited from HGCalTriggerGeometryBase
typedef std::unordered_map< unsigned, unsigned > geom_map
 
typedef std::set< unsigned > geom_ordered_set
 
typedef std::unordered_set< unsigned > geom_set
 

Public Member Functions

bool disconnectedModule (const unsigned module_id) const final
 
geom_set getCellsFromModule (const unsigned cell_det_id) const final
 
geom_set getCellsFromTriggerCell (const unsigned cell_det_id) const final
 
unsigned getLinksInModule (const unsigned module_id) const final
 
unsigned getModuleFromCell (const unsigned cell_det_id) const final
 
unsigned getModuleFromTriggerCell (const unsigned trigger_cell_det_id) const final
 
GlobalPoint getModulePosition (const unsigned module_det_id) const final
 
unsigned getModuleSize (const unsigned module_id) const final
 
geom_set getNeighborsFromTriggerCell (const unsigned trigger_cell_det_id) const final
 
geom_ordered_set getOrderedCellsFromModule (const unsigned cell_det_id) const final
 
geom_ordered_set getOrderedTriggerCellsFromModule (const unsigned trigger_cell_det_id) const final
 
unsigned getTriggerCellFromCell (const unsigned cell_det_id) const final
 
GlobalPoint getTriggerCellPosition (const unsigned trigger_cell_det_id) const final
 
geom_set getTriggerCellsFromModule (const unsigned trigger_cell_det_id) const final
 
 HGCalTriggerGeometryGenericMapping (const edm::ParameterSet &conf)
 
unsigned lastTriggerLayer () const final
 
void reset () final
 
unsigned triggerLayer (const unsigned id) const final
 
bool validCell (const unsigned cell_det_id) const final
 
bool validTriggerCell (const unsigned trigger_cell_det_id) const final
 
 ~HGCalTriggerGeometryGenericMapping () override
 
- Public Member Functions inherited from HGCalTriggerGeometryBase
const HcalGeometrybhGeometry () const
 
const HcalTopologybhTopology () const
 
const CaloGeometrycaloGeometry () const
 
const HGCalGeometryeeGeometry () const
 
const HGCalTopologyeeTopology () const
 
const HGCalGeometryfhGeometry () const
 
const HGCalTopologyfhTopology () const
 
 HGCalTriggerGeometryBase (const edm::ParameterSet &conf)
 
const HGCalGeometryhscGeometry () const
 
const HGCalTopologyhscTopology () const
 
const HGCalGeometryhsiGeometry () const
 
const HGCalTopologyhsiTopology () const
 
virtual void initialize (const CaloGeometry *)=0
 
virtual void initialize (const HGCalGeometry *, const HGCalGeometry *, const HGCalGeometry *)=0
 
virtual void initialize (const HGCalGeometry *, const HGCalGeometry *, const HGCalGeometry *, const HGCalGeometry *)=0
 
bool isV9Geometry () const
 
bool isWithNoseGeometry () const
 
const std::string & name () const
 
const HGCalGeometrynoseGeometry () const
 
const HGCalTopologynoseTopology () const
 
void setWithNoseGeometry (const bool isNose)
 
virtual ~HGCalTriggerGeometryBase ()
 

Protected Attributes

geom_map cells_to_trigger_cells_
 
module_map modules_
 
trigger_cell_map trigger_cells_
 
geom_map trigger_cells_to_modules_
 

Additional Inherited Members

- Protected Member Functions inherited from HGCalTriggerGeometryBase
void setCaloGeometry (const CaloGeometry *geom)
 
void setEEGeometry (const HGCalGeometry *geom)
 
void setHScGeometry (const HGCalGeometry *geom)
 
void setHSiGeometry (const HGCalGeometry *geom)
 
void setNoseGeometry (const HGCalGeometry *geom)
 

Detailed Description

Definition at line 101 of file HGCalTriggerGeometryGenericMapping.h.

Member Typedef Documentation

◆ module_map

typedef std::unordered_map<unsigned, std::unique_ptr<const HGCalTriggerGeometry::Module> > HGCalTriggerGeometryGenericMapping::module_map

Definition at line 103 of file HGCalTriggerGeometryGenericMapping.h.

◆ trigger_cell_map

typedef std::unordered_map<unsigned, std::unique_ptr<const HGCalTriggerGeometry::TriggerCell> > HGCalTriggerGeometryGenericMapping::trigger_cell_map

Definition at line 104 of file HGCalTriggerGeometryGenericMapping.h.

Constructor & Destructor Documentation

◆ HGCalTriggerGeometryGenericMapping()

HGCalTriggerGeometryGenericMapping::HGCalTriggerGeometryGenericMapping ( const edm::ParameterSet conf)

Definition at line 10 of file HGCalTriggerGeometryGenericMapping.cc.

11  : HGCalTriggerGeometryBase(conf) {}

◆ ~HGCalTriggerGeometryGenericMapping()

HGCalTriggerGeometryGenericMapping::~HGCalTriggerGeometryGenericMapping ( )
inlineoverride

Definition at line 107 of file HGCalTriggerGeometryGenericMapping.h.

108 {}

Member Function Documentation

◆ disconnectedModule()

bool HGCalTriggerGeometryGenericMapping::disconnectedModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 110 of file HGCalTriggerGeometryGenericMapping.cc.

110 { return false; }

◆ getCellsFromModule()

HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryGenericMapping::getCellsFromModule ( const unsigned  cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 53 of file HGCalTriggerGeometryGenericMapping.cc.

54  {
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 }

References postprocess-scan-build::cells, and modules_.

◆ getCellsFromTriggerCell()

HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryGenericMapping::getCellsFromTriggerCell ( const unsigned  cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 48 of file HGCalTriggerGeometryGenericMapping.cc.

49  {
50  return trigger_cells_.find(trigger_cell_det_id)->second->components();
51 }

References trigger_cells_.

◆ getLinksInModule()

unsigned HGCalTriggerGeometryGenericMapping::getLinksInModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 94 of file HGCalTriggerGeometryGenericMapping.cc.

94 { return 1; }

◆ getModuleFromCell()

unsigned HGCalTriggerGeometryGenericMapping::getModuleFromCell ( const unsigned  cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 28 of file HGCalTriggerGeometryGenericMapping.cc.

28  {
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 }

References cells_to_trigger_cells_, modules_, and trigger_cells_to_modules_.

◆ getModuleFromTriggerCell()

unsigned HGCalTriggerGeometryGenericMapping::getModuleFromTriggerCell ( const unsigned  trigger_cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 40 of file HGCalTriggerGeometryGenericMapping.cc.

40  {
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 }

References modules_, and trigger_cells_to_modules_.

◆ getModulePosition()

GlobalPoint HGCalTriggerGeometryGenericMapping::getModulePosition ( const unsigned  module_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 102 of file HGCalTriggerGeometryGenericMapping.cc.

102  {
103  return modules_.find(module_det_id)->second->position();
104 }

References modules_.

◆ getModuleSize()

unsigned HGCalTriggerGeometryGenericMapping::getModuleSize ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 96 of file HGCalTriggerGeometryGenericMapping.cc.

96 { return 1; }

◆ getNeighborsFromTriggerCell()

HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryGenericMapping::getNeighborsFromTriggerCell ( const unsigned  trigger_cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 88 of file HGCalTriggerGeometryGenericMapping.cc.

89  {
90  // empty neighbors
91  return geom_set();
92 }

◆ getOrderedCellsFromModule()

HGCalTriggerGeometryBase::geom_ordered_set HGCalTriggerGeometryGenericMapping::getOrderedCellsFromModule ( const unsigned  cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 63 of file HGCalTriggerGeometryGenericMapping.cc.

64  {
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 }

References postprocess-scan-build::cells, and modules_.

◆ getOrderedTriggerCellsFromModule()

HGCalTriggerGeometryBase::geom_ordered_set HGCalTriggerGeometryGenericMapping::getOrderedTriggerCellsFromModule ( const unsigned  trigger_cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 78 of file HGCalTriggerGeometryGenericMapping.cc.

79  {
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 }

References modules_.

◆ getTriggerCellFromCell()

unsigned HGCalTriggerGeometryGenericMapping::getTriggerCellFromCell ( const unsigned  cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 20 of file HGCalTriggerGeometryGenericMapping.cc.

20  {
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 }

References cells_to_trigger_cells_, and trigger_cells_.

◆ getTriggerCellPosition()

GlobalPoint HGCalTriggerGeometryGenericMapping::getTriggerCellPosition ( const unsigned  trigger_cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 98 of file HGCalTriggerGeometryGenericMapping.cc.

98  {
99  return trigger_cells_.find(trigger_cell_det_id)->second->position();
100 }

References trigger_cells_.

◆ getTriggerCellsFromModule()

HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryGenericMapping::getTriggerCellsFromModule ( const unsigned  trigger_cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 73 of file HGCalTriggerGeometryGenericMapping.cc.

74  {
75  return modules_.find(module_det_id)->second->components();
76 }

References modules_.

◆ lastTriggerLayer()

unsigned HGCalTriggerGeometryGenericMapping::lastTriggerLayer ( ) const
finalvirtual

◆ reset()

void HGCalTriggerGeometryGenericMapping::reset ( void  )
finalvirtual

◆ triggerLayer()

unsigned HGCalTriggerGeometryGenericMapping::triggerLayer ( const unsigned  id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 116 of file HGCalTriggerGeometryGenericMapping.cc.

116 { return HGCalDetId(id).layer(); }

References HGCalDetId::layer().

◆ validCell()

bool HGCalTriggerGeometryGenericMapping::validCell ( const unsigned  cell_det_id) const
inlinefinalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 131 of file HGCalTriggerGeometryGenericMapping.h.

132 { return true; }

◆ validTriggerCell()

bool HGCalTriggerGeometryGenericMapping::validTriggerCell ( const unsigned  trigger_cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 106 of file HGCalTriggerGeometryGenericMapping.cc.

106  {
107  return (trigger_cells_.find(trigger_cell_det_id) != trigger_cells_.end());
108 }

References trigger_cells_.

Member Data Documentation

◆ cells_to_trigger_cells_

geom_map HGCalTriggerGeometryGenericMapping::cells_to_trigger_cells_
protected

◆ modules_

module_map HGCalTriggerGeometryGenericMapping::modules_
protected

◆ trigger_cells_

trigger_cell_map HGCalTriggerGeometryGenericMapping::trigger_cells_
protected

◆ trigger_cells_to_modules_

geom_map HGCalTriggerGeometryGenericMapping::trigger_cells_to_modules_
protected
HGCalTriggerGeometryBase::eeTopology
const HGCalTopology & eeTopology() const
Definition: HGCalTriggerGeometryBase.h:65
HGCalTopology::dddConstants
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98
HGCalTriggerGeometryGenericMapping::trigger_cell_map
std::unordered_map< unsigned, std::unique_ptr< const HGCalTriggerGeometry::TriggerCell > > trigger_cell_map
Definition: HGCalTriggerGeometryGenericMapping.h:104
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
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::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
HGCalDetId
Definition: HGCalDetId.h:8
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
HGCalTriggerGeometryBase::HGCalTriggerGeometryBase
HGCalTriggerGeometryBase(const edm::ParameterSet &conf)
Definition: HGCalTriggerGeometryBase.cc:3
HGCalTriggerGeometryGenericMapping::modules_
module_map modules_
Definition: HGCalTriggerGeometryGenericMapping.h:141