test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 geom_set getCellsFromModule (const unsigned cell_det_id) const overridefinal
 
virtual geom_set getCellsFromTriggerCell (const unsigned cell_det_id) const overridefinal
 
virtual unsigned getModuleFromCell (const unsigned cell_det_id) const overridefinal
 
virtual unsigned getModuleFromTriggerCell (const unsigned trigger_cell_det_id) const overridefinal
 
virtual GlobalPoint getModulePosition (const unsigned module_det_id) const overridefinal
 
virtual geom_ordered_set getOrderedCellsFromModule (const unsigned cell_det_id) const overridefinal
 
virtual geom_ordered_set getOrderedTriggerCellsFromModule (const unsigned trigger_cell_det_id) const overridefinal
 
virtual unsigned getTriggerCellFromCell (const unsigned cell_det_id) const overridefinal
 
virtual GlobalPoint getTriggerCellPosition (const unsigned trigger_cell_det_id) const overridefinal
 
virtual geom_set getTriggerCellsFromModule (const unsigned trigger_cell_det_id) const overridefinal
 
 HGCalTriggerGeometryGenericMapping (const edm::ParameterSet &conf)
 
virtual void reset () overridefinal
 
virtual ~HGCalTriggerGeometryGenericMapping ()
 
- Public Member Functions inherited from HGCalTriggerGeometryBase
const std::string & bhSDName () const
 
const std::string & eeSDName () const
 
const std::string & fhSDName () const
 
 HGCalTriggerGeometryBase (const edm::ParameterSet &conf)
 
virtual void initialize (const es_info &)=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_
 

Detailed Description

Definition at line 124 of file HGCalTriggerGeometryGenericMapping.h.

Member Typedef Documentation

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

Definition at line 127 of file HGCalTriggerGeometryGenericMapping.h.

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

Definition at line 128 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 131 of file HGCalTriggerGeometryGenericMapping.h.

131 {}

Member Function Documentation

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

Implements HGCalTriggerGeometryBase.

Definition at line 64 of file HGCalTriggerGeometryGenericMapping.cc.

References 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::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 trigger_cells_.

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_, modules_, and trigger_cells_to_modules_.

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 modules_, and trigger_cells_to_modules_.

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 109 of file HGCalTriggerGeometryGenericMapping.cc.

References modules_.

109  {
110  return modules_.find(module_det_id)->second->position();
111 }
HGCalTriggerGeometryBase::geom_ordered_set HGCalTriggerGeometryGenericMapping::getOrderedCellsFromModule ( const unsigned  cell_det_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 75 of file HGCalTriggerGeometryGenericMapping.cc.

References modules_.

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 modules_.

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_, and trigger_cells_.

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 103 of file HGCalTriggerGeometryGenericMapping.cc.

References trigger_cells_.

103  {
104  return trigger_cells_.find(trigger_cell_det_id)->second->position();
105 }
HGCalTriggerGeometryBase::geom_set HGCalTriggerGeometryGenericMapping::getTriggerCellsFromModule ( const unsigned  trigger_cell_det_id) const
finaloverridevirtual

Implements HGCalTriggerGeometryBase.

Definition at line 86 of file HGCalTriggerGeometryGenericMapping.cc.

References modules_.

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_, 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

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