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

virtual bool disconnectedModule (const unsigned module_id) const override final
 
virtual geom_set getCellsFromModule (const unsigned cell_det_id) const override final
 
virtual geom_set getCellsFromTriggerCell (const unsigned cell_det_id) const override final
 
virtual unsigned getModuleFromCell (const unsigned cell_det_id) const override final
 
virtual unsigned getModuleFromTriggerCell (const unsigned trigger_cell_det_id) const override final
 
virtual GlobalPoint getModulePosition (const unsigned module_det_id) const override final
 
virtual geom_set getNeighborsFromTriggerCell (const unsigned trigger_cell_det_id) const override final
 
virtual geom_ordered_set getOrderedCellsFromModule (const unsigned cell_det_id) const override final
 
virtual geom_ordered_set getOrderedTriggerCellsFromModule (const unsigned trigger_cell_det_id) const override final
 
virtual unsigned getTriggerCellFromCell (const unsigned cell_det_id) const override final
 
virtual GlobalPoint getTriggerCellPosition (const unsigned trigger_cell_det_id) const override final
 
virtual geom_set getTriggerCellsFromModule (const unsigned trigger_cell_det_id) const override final
 
 HGCalTriggerGeometryGenericMapping (const edm::ParameterSet &conf)
 
virtual void reset () override final
 
virtual bool validTriggerCell (const unsigned trigger_cell_det_id) const override final
 
virtual ~HGCalTriggerGeometryGenericMapping ()
 
- Public Member Functions inherited from HGCalTriggerGeometryBase
const HcalGeometrybhGeometry () const
 
const HcalTopologybhTopology () const
 
const edm::ESHandle< CaloGeometry > & caloGeometry () const
 
const HGCalGeometryeeGeometry () const
 
const HGCalTopologyeeTopology () const
 
const HGCalGeometryfhGeometry () const
 
const HGCalTopologyfhTopology () const
 
 HGCalTriggerGeometryBase (const edm::ParameterSet &conf)
 
virtual void initialize (const edm::ESHandle< CaloGeometry > &)=0
 
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 edm::ESHandle< CaloGeometry > &geom)
 

Detailed Description

Definition at line 112 of file HGCalTriggerGeometryGenericMapping.h.

Member Typedef Documentation

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

Definition at line 115 of file HGCalTriggerGeometryGenericMapping.h.

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

Definition at line 116 of file HGCalTriggerGeometryGenericMapping.h.

Constructor & Destructor Documentation

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

Definition at line 11 of file HGCalTriggerGeometryGenericMapping.cc.

11  :
13 }
HGCalTriggerGeometryBase(const edm::ParameterSet &conf)
virtual HGCalTriggerGeometryGenericMapping::~HGCalTriggerGeometryGenericMapping ( )
inlinevirtual

Definition at line 119 of file HGCalTriggerGeometryGenericMapping.h.

References reset().

119 {}

Member Function Documentation

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

Implements HGCalTriggerGeometryBase.

Definition at line 130 of file HGCalTriggerGeometryGenericMapping.cc.

Referenced by validTriggerCell().

130  {
131  return false;
132 }
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryGenericMapping::getCellsFromModule ( const unsigned  cell_det_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 64 of file HGCalTriggerGeometryGenericMapping.cc.

References getOrderedCellsFromModule(), and modules_.

Referenced by getCellsFromTriggerCell().

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

Implements HGCalTriggerGeometryBase.

Definition at line 58 of file HGCalTriggerGeometryGenericMapping.cc.

References getCellsFromModule(), and trigger_cells_.

Referenced by getModuleFromTriggerCell().

58  {
59  return trigger_cells_.find(trigger_cell_det_id)->second->components();
60 }
unsigned HGCalTriggerGeometryGenericMapping::getModuleFromCell ( const unsigned  cell_det_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 34 of file HGCalTriggerGeometryGenericMapping.cc.

References cells_to_trigger_cells_, getModuleFromTriggerCell(), modules_, and trigger_cells_to_modules_.

Referenced by getTriggerCellFromCell().

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

Implements HGCalTriggerGeometryBase.

Definition at line 48 of file HGCalTriggerGeometryGenericMapping.cc.

References getCellsFromTriggerCell(), modules_, and trigger_cells_to_modules_.

Referenced by getModuleFromCell().

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

Implements HGCalTriggerGeometryBase.

Definition at line 117 of file HGCalTriggerGeometryGenericMapping.cc.

References modules_, and validTriggerCell().

Referenced by getTriggerCellPosition().

117  {
118  return modules_.find(module_det_id)->second->position();
119 }
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryGenericMapping::getNeighborsFromTriggerCell ( const unsigned  trigger_cell_det_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 103 of file HGCalTriggerGeometryGenericMapping.cc.

References getTriggerCellPosition().

Referenced by getOrderedTriggerCellsFromModule().

104 {
105  // empty neighbors
106  return geom_set();
107 }
std::unordered_set< unsigned > geom_set
HGCalTriggerGeometryBase::geom_ordered_set HGCalTriggerGeometryGenericMapping::getOrderedCellsFromModule ( const unsigned  cell_det_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 75 of file HGCalTriggerGeometryGenericMapping.cc.

References getTriggerCellsFromModule(), and modules_.

Referenced by getCellsFromModule().

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

Implements HGCalTriggerGeometryBase.

Definition at line 92 of file HGCalTriggerGeometryGenericMapping.cc.

References getNeighborsFromTriggerCell(), and modules_.

Referenced by getTriggerCellsFromModule().

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

Implements HGCalTriggerGeometryBase.

Definition at line 24 of file HGCalTriggerGeometryGenericMapping.cc.

References cells_to_trigger_cells_, getModuleFromCell(), and trigger_cells_.

Referenced by reset().

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

Implements HGCalTriggerGeometryBase.

Definition at line 111 of file HGCalTriggerGeometryGenericMapping.cc.

References getModulePosition(), and trigger_cells_.

Referenced by getNeighborsFromTriggerCell().

111  {
112  return trigger_cells_.find(trigger_cell_det_id)->second->position();
113 }
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryGenericMapping::getTriggerCellsFromModule ( const unsigned  trigger_cell_det_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 86 of file HGCalTriggerGeometryGenericMapping.cc.

References getOrderedTriggerCellsFromModule(), and modules_.

Referenced by getOrderedCellsFromModule().

86  {
87  return modules_.find(module_det_id)->second->components();
88 }
void HGCalTriggerGeometryGenericMapping::reset ( void  )
finaloverridevirtual

Reimplemented from HGCalTriggerGeometryBase.

Definition at line 15 of file HGCalTriggerGeometryGenericMapping.cc.

References cells_to_trigger_cells_, getTriggerCellFromCell(), modules_, trigger_cells_, and trigger_cells_to_modules_.

15  {
18  module_map().swap(modules_);
20 }
std::unordered_map< unsigned, unsigned > geom_map
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
bool HGCalTriggerGeometryGenericMapping::validTriggerCell ( const unsigned  trigger_cell_det_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 124 of file HGCalTriggerGeometryGenericMapping.cc.

References disconnectedModule(), and trigger_cells_.

Referenced by getModulePosition().

124  {
125  return (trigger_cells_.find(trigger_cell_det_id)!=trigger_cells_.end());
126 }

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