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 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
 
bool isV9Geometry () const
 
const std::string & name () const
 
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)
 

Detailed Description

Definition at line 102 of file HGCalTriggerGeometryGenericMapping.h.

Member Typedef Documentation

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

Definition at line 104 of file HGCalTriggerGeometryGenericMapping.h.

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

Definition at line 105 of file HGCalTriggerGeometryGenericMapping.h.

Constructor & Destructor Documentation

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

Definition at line 10 of file HGCalTriggerGeometryGenericMapping.cc.

11  : HGCalTriggerGeometryBase(conf) {}
HGCalTriggerGeometryBase(const edm::ParameterSet &conf)
HGCalTriggerGeometryGenericMapping::~HGCalTriggerGeometryGenericMapping ( )
inlineoverride

Definition at line 108 of file HGCalTriggerGeometryGenericMapping.h.

References reset().

108 {}

Member Function Documentation

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

Implements HGCalTriggerGeometryBase.

Definition at line 110 of file HGCalTriggerGeometryGenericMapping.cc.

110 { return false; }
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryGenericMapping::getCellsFromModule ( const unsigned  cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 53 of file HGCalTriggerGeometryGenericMapping.cc.

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

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 }
std::unordered_set< unsigned > geom_set
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryGenericMapping::getCellsFromTriggerCell ( const unsigned  cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 48 of file HGCalTriggerGeometryGenericMapping.cc.

References trigger_cells_.

49  {
50  return trigger_cells_.find(trigger_cell_det_id)->second->components();
51 }
unsigned HGCalTriggerGeometryGenericMapping::getLinksInModule ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 94 of file HGCalTriggerGeometryGenericMapping.cc.

94 { return 1; }
unsigned HGCalTriggerGeometryGenericMapping::getModuleFromCell ( const unsigned  cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 28 of file HGCalTriggerGeometryGenericMapping.cc.

References cells_to_trigger_cells_, modules_, and trigger_cells_to_modules_.

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 }
unsigned HGCalTriggerGeometryGenericMapping::getModuleFromTriggerCell ( const unsigned  trigger_cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 40 of file HGCalTriggerGeometryGenericMapping.cc.

References modules_, and trigger_cells_to_modules_.

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 }
GlobalPoint HGCalTriggerGeometryGenericMapping::getModulePosition ( const unsigned  module_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 102 of file HGCalTriggerGeometryGenericMapping.cc.

References modules_.

102  {
103  return modules_.find(module_det_id)->second->position();
104 }
unsigned HGCalTriggerGeometryGenericMapping::getModuleSize ( const unsigned  module_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 96 of file HGCalTriggerGeometryGenericMapping.cc.

96 { return 1; }
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 }
std::unordered_set< unsigned > geom_set
HGCalTriggerGeometryBase::geom_ordered_set HGCalTriggerGeometryGenericMapping::getOrderedCellsFromModule ( const unsigned  cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 63 of file HGCalTriggerGeometryGenericMapping.cc.

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

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 }
std::set< unsigned > geom_ordered_set
HGCalTriggerGeometryBase::geom_ordered_set HGCalTriggerGeometryGenericMapping::getOrderedTriggerCellsFromModule ( const unsigned  trigger_cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 78 of file HGCalTriggerGeometryGenericMapping.cc.

References modules_.

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 }
std::set< unsigned > geom_ordered_set
unsigned HGCalTriggerGeometryGenericMapping::getTriggerCellFromCell ( const unsigned  cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 20 of file HGCalTriggerGeometryGenericMapping.cc.

References cells_to_trigger_cells_, and trigger_cells_.

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 }
GlobalPoint HGCalTriggerGeometryGenericMapping::getTriggerCellPosition ( const unsigned  trigger_cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 98 of file HGCalTriggerGeometryGenericMapping.cc.

References trigger_cells_.

98  {
99  return trigger_cells_.find(trigger_cell_det_id)->second->position();
100 }
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryGenericMapping::getTriggerCellsFromModule ( const unsigned  trigger_cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 73 of file HGCalTriggerGeometryGenericMapping.cc.

References modules_.

74  {
75  return modules_.find(module_det_id)->second->components();
76 }
unsigned HGCalTriggerGeometryGenericMapping::lastTriggerLayer ( ) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 112 of file HGCalTriggerGeometryGenericMapping.cc.

References HGCalTopology::dddConstants(), HGCalTriggerGeometryBase::eeTopology(), and HGCalDDDConstants::layers().

112  {
113  return eeTopology().dddConstants().layers(true);
114 }
const HGCalTopology & eeTopology() const
unsigned int layers(bool reco) const
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:96
void HGCalTriggerGeometryGenericMapping::reset ( void  )
finalvirtual

Reimplemented from HGCalTriggerGeometryBase.

Definition at line 13 of file HGCalTriggerGeometryGenericMapping.cc.

References cells_to_trigger_cells_, modules_, trigger_cells_, and trigger_cells_to_modules_.

13  {
16  module_map().swap(modules_);
18 }
std::unordered_map< unsigned, std::unique_ptr< const HGCalTriggerGeometry::Module > > module_map
std::unordered_map< unsigned, std::unique_ptr< const HGCalTriggerGeometry::TriggerCell > > trigger_cell_map
std::unordered_map< unsigned, unsigned > geom_map
unsigned HGCalTriggerGeometryGenericMapping::triggerLayer ( const unsigned  id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 116 of file HGCalTriggerGeometryGenericMapping.cc.

References HGCalDetId::layer().

116 { return HGCalDetId(id).layer(); }
int layer() const
get the layer #
Definition: HGCalDetId.h:46
bool HGCalTriggerGeometryGenericMapping::validTriggerCell ( const unsigned  trigger_cell_det_id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 106 of file HGCalTriggerGeometryGenericMapping.cc.

References trigger_cells_.

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

Member Data Documentation

geom_map HGCalTriggerGeometryGenericMapping::cells_to_trigger_cells_
protected
module_map HGCalTriggerGeometryGenericMapping::modules_
protected
trigger_cell_map HGCalTriggerGeometryGenericMapping::trigger_cells_
protected
geom_map HGCalTriggerGeometryGenericMapping::trigger_cells_to_modules_
protected