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
 
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
 
unsigned triggerLayer (const unsigned id) const final
 
bool validTriggerCell (const unsigned trigger_cell_det_id) const 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 12 of file HGCalTriggerGeometryGenericMapping.cc.

12  :
14 }
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
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 131 of file HGCalTriggerGeometryGenericMapping.cc.

References triggerLayer().

Referenced by validTriggerCell().

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

Implements HGCalTriggerGeometryBase.

Definition at line 65 of file HGCalTriggerGeometryGenericMapping.cc.

References getOrderedCellsFromModule(), and modules_.

Referenced by getCellsFromTriggerCell().

65  {
66  const auto& triggercell_cells = modules_.find(module_det_id)->second->triggerCellComponents();
68  for(const auto& tc_c : triggercell_cells) {
69  cells.emplace(tc_c.second);
70  }
71  return cells;
72 }
std::unordered_set< unsigned > geom_set
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryGenericMapping::getCellsFromTriggerCell ( const unsigned  cell_det_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 59 of file HGCalTriggerGeometryGenericMapping.cc.

References getCellsFromModule(), and trigger_cells_.

Referenced by getModuleFromTriggerCell().

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

Implements HGCalTriggerGeometryBase.

Definition at line 35 of file HGCalTriggerGeometryGenericMapping.cc.

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

Referenced by getTriggerCellFromCell().

35  {
36  auto found_tc = cells_to_trigger_cells_.find(cell_det_id);
37  if( found_tc == cells_to_trigger_cells_.end() ) {
38  return 0;
39  }
40  auto found_mod = trigger_cells_to_modules_.find(found_tc->second);
41  if( found_mod == trigger_cells_to_modules_.end() ) {
42  return 0;
43  }
44  return modules_.find(found_mod->second)->second->moduleId();
45 }
unsigned HGCalTriggerGeometryGenericMapping::getModuleFromTriggerCell ( const unsigned  trigger_cell_det_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 49 of file HGCalTriggerGeometryGenericMapping.cc.

References getCellsFromTriggerCell(), modules_, and trigger_cells_to_modules_.

Referenced by getModuleFromCell().

49  {
50  auto found_mod = trigger_cells_to_modules_.find(trigger_cell_det_id);
51  if( found_mod == trigger_cells_to_modules_.end() ) {
52  return 0;
53  }
54  return modules_.find(found_mod->second)->second->moduleId();
55 }
GlobalPoint HGCalTriggerGeometryGenericMapping::getModulePosition ( const unsigned  module_det_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 118 of file HGCalTriggerGeometryGenericMapping.cc.

References modules_, and validTriggerCell().

Referenced by getTriggerCellPosition().

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

Implements HGCalTriggerGeometryBase.

Definition at line 104 of file HGCalTriggerGeometryGenericMapping.cc.

References getTriggerCellPosition().

Referenced by getOrderedTriggerCellsFromModule().

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

Implements HGCalTriggerGeometryBase.

Definition at line 76 of file HGCalTriggerGeometryGenericMapping.cc.

References getTriggerCellsFromModule(), and modules_.

Referenced by getCellsFromModule().

76  {
77  const auto& triggercell_cells = modules_.find(module_det_id)->second->triggerCellComponents();
79  for(const auto& tc_c : triggercell_cells) {
80  cells.emplace(tc_c.second);
81  }
82  return cells;
83 }
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 93 of file HGCalTriggerGeometryGenericMapping.cc.

References getNeighborsFromTriggerCell(), and modules_.

Referenced by getTriggerCellsFromModule().

93  {
94  // Build set from unordered_set. Maybe a more efficient to do it
96  for(const auto& tc : modules_.find(module_det_id)->second->components()) {
97  trigger_cells.emplace(tc);
98  }
99  return trigger_cells;
100 }
std::set< unsigned > geom_ordered_set
unsigned HGCalTriggerGeometryGenericMapping::getTriggerCellFromCell ( const unsigned  cell_det_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 25 of file HGCalTriggerGeometryGenericMapping.cc.

References cells_to_trigger_cells_, getModuleFromCell(), and trigger_cells_.

Referenced by reset().

25  {
26  auto found_tc = cells_to_trigger_cells_.find(cell_det_id);
27  if( found_tc == cells_to_trigger_cells_.end() ) {
28  return 0;
29  }
30  return trigger_cells_.find(found_tc->second)->second->triggerCellId();
31 }
GlobalPoint HGCalTriggerGeometryGenericMapping::getTriggerCellPosition ( const unsigned  trigger_cell_det_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 112 of file HGCalTriggerGeometryGenericMapping.cc.

References getModulePosition(), and trigger_cells_.

Referenced by getNeighborsFromTriggerCell().

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

Implements HGCalTriggerGeometryBase.

Definition at line 87 of file HGCalTriggerGeometryGenericMapping.cc.

References getOrderedTriggerCellsFromModule(), and modules_.

Referenced by getOrderedCellsFromModule().

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

Reimplemented from HGCalTriggerGeometryBase.

Definition at line 16 of file HGCalTriggerGeometryGenericMapping.cc.

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

16  {
19  module_map().swap(modules_);
21 }
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
unsigned HGCalTriggerGeometryGenericMapping::triggerLayer ( const unsigned  id) const
finalvirtual

Implements HGCalTriggerGeometryBase.

Definition at line 138 of file HGCalTriggerGeometryGenericMapping.cc.

References HGCalDetId::layer().

Referenced by disconnectedModule().

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

Implements HGCalTriggerGeometryBase.

Definition at line 125 of file HGCalTriggerGeometryGenericMapping.cc.

References disconnectedModule(), and trigger_cells_.

Referenced by getModulePosition().

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

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