CMS 3D CMS Logo

HGCalTriggerGeometryBase.h
Go to the documentation of this file.
1 #ifndef __L1Trigger_L1THGCal_HGCalTriggerGeometryBase_h__
2 #define __L1Trigger_L1THGCal_HGCalTriggerGeometryBase_h__
3 
4 #include <iostream>
5 #include <unordered_map>
6 #include <unordered_set>
7 
9 
11 
16 
17 // Pure virtual trigger geometry class
18 // Provides the interface to access trigger cell and module mappings
20 public:
21  typedef std::unordered_map<unsigned, unsigned> geom_map;
22  typedef std::unordered_set<unsigned> geom_set;
23  typedef std::set<unsigned> geom_ordered_set;
24 
27 
28  const std::string& name() const { return name_; }
29 
30  bool isV9Geometry() const { return !calo_geometry_; }
31  bool isWithNoseGeometry() const { return isNose_; }
32 
33  const CaloGeometry* caloGeometry() const { return calo_geometry_; }
34 
35  const HGCalGeometry* noseGeometry() const {
36  return (hgc_nose_geometry_
38  : (static_cast<const HGCalGeometry*>(calo_geometry_->getSubdetectorGeometry(DetId::Forward, HFNose))));
39  }
40 
41  const HGCalGeometry* eeGeometry() const {
42  return (hgc_ee_geometry_
44  : (static_cast<const HGCalGeometry*>(calo_geometry_->getSubdetectorGeometry(DetId::Forward, HGCEE))));
45  }
46  const HGCalGeometry* fhGeometry() const {
47  return (hgc_hsi_geometry_
49  : (static_cast<const HGCalGeometry*>(calo_geometry_->getSubdetectorGeometry(DetId::Forward, HGCHEF))));
50  }
51  const HcalGeometry* bhGeometry() const {
52  if (hgc_hsc_geometry_) {
53  throw cms::Exception("HGCalTriggerGeometry") << "bhGeometry cannot be used with the V9 geometry";
54  }
55  return (static_cast<const HcalGeometry*>(calo_geometry_->getSubdetectorGeometry(DetId::Hcal, HcalEndcap)));
56  }
57  const HGCalGeometry* hsiGeometry() const { return fhGeometry(); }
58  const HGCalGeometry* hscGeometry() const {
59  if (!hgc_hsc_geometry_) {
60  throw cms::Exception("HGCalTriggerGeometry") << "hscGeometry cannot be used with the V7 and V8 geometries";
61  }
62  return hgc_hsc_geometry_;
63  }
64  const HGCalTopology& noseTopology() const { return noseGeometry()->topology(); }
65  const HGCalTopology& eeTopology() const { return eeGeometry()->topology(); }
66  const HGCalTopology& fhTopology() const { return fhGeometry()->topology(); }
67  const HcalTopology& bhTopology() const { return bhGeometry()->topology(); }
68  const HGCalTopology& hsiTopology() const { return hsiGeometry()->topology(); }
69  const HGCalTopology& hscTopology() const { return hscGeometry()->topology(); }
70 
71  void setWithNoseGeometry(const bool isNose) { isNose_ = isNose; }
72 
73  // non-const access to the geometry class
74  virtual void initialize(const CaloGeometry*) = 0;
75  virtual void initialize(const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*) = 0;
76  virtual void initialize(const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*) = 0;
77  virtual void reset();
78 
79  // const access to the geometry class
80  virtual unsigned getTriggerCellFromCell(const unsigned cell_det_id) const = 0;
81  virtual unsigned getModuleFromCell(const unsigned cell_det_id) const = 0;
82  virtual unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const = 0;
83 
84  virtual geom_set getCellsFromTriggerCell(const unsigned cell_det_id) const = 0;
85  virtual geom_set getCellsFromModule(const unsigned cell_det_id) const = 0;
86  virtual geom_set getTriggerCellsFromModule(const unsigned trigger_cell_det_id) const = 0;
87 
88  virtual geom_ordered_set getOrderedCellsFromModule(const unsigned cell_det_id) const = 0;
89  virtual geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned trigger_cell_det_id) const = 0;
90 
91  virtual geom_set getNeighborsFromTriggerCell(const unsigned trigger_cell_det_id) const = 0;
92 
93  virtual unsigned getLinksInModule(const unsigned module_id) const = 0;
94  virtual unsigned getModuleSize(const unsigned module_id) const = 0;
95 
96  virtual GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const = 0;
97  virtual GlobalPoint getModulePosition(const unsigned module_det_id) const = 0;
98 
99  virtual bool validCell(const unsigned cell_id) const = 0;
100  virtual bool validTriggerCell(const unsigned trigger_cell_id) const = 0;
101  virtual bool disconnectedModule(const unsigned module_id) const = 0;
102  virtual unsigned lastTriggerLayer() const = 0;
103  virtual unsigned triggerLayer(const unsigned id) const = 0;
104 
105 protected:
111 
112 private:
114 
115  bool isNose_ = false;
116  const CaloGeometry* calo_geometry_ = nullptr;
117  const HGCalGeometry* hgc_ee_geometry_ = nullptr;
121 };
122 
125 
126 #endif
HGCalTriggerGeometryBase::getTriggerCellsFromModule
virtual geom_set getTriggerCellsFromModule(const unsigned trigger_cell_det_id) const =0
HGCalTriggerGeometryBase::noseGeometry
const HGCalGeometry * noseGeometry() const
Definition: HGCalTriggerGeometryBase.h:35
HGCalTriggerGeometryBase::eeTopology
const HGCalTopology & eeTopology() const
Definition: HGCalTriggerGeometryBase.h:65
HGCalTriggerGeometryBase
Definition: HGCalTriggerGeometryBase.h:19
PluginFactory.h
HGCalTriggerGeometryBase::getOrderedTriggerCellsFromModule
virtual geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned trigger_cell_det_id) const =0
HGCalTriggerGeometryBase::getNeighborsFromTriggerCell
virtual geom_set getNeighborsFromTriggerCell(const unsigned trigger_cell_det_id) const =0
HGCalTriggerGeometryBase::disconnectedModule
virtual bool disconnectedModule(const unsigned module_id) const =0
HGCalTriggerGeometryBase::hsiGeometry
const HGCalGeometry * hsiGeometry() const
Definition: HGCalTriggerGeometryBase.h:57
HGCalTriggerGeometryBase::getCellsFromModule
virtual geom_set getCellsFromModule(const unsigned cell_det_id) const =0
HGCalTriggerGeometryBase::validCell
virtual bool validCell(const unsigned cell_id) const =0
HGCalTriggerGeometryBase::~HGCalTriggerGeometryBase
virtual ~HGCalTriggerGeometryBase()
Definition: HGCalTriggerGeometryBase.h:26
HGCalTriggerGeometryBase::getOrderedCellsFromModule
virtual geom_ordered_set getOrderedCellsFromModule(const unsigned cell_det_id) const =0
HGCalTriggerGeometryBase::initialize
virtual void initialize(const CaloGeometry *)=0
HcalTopology
Definition: HcalTopology.h:26
HGCalTriggerGeometryBase::setNoseGeometry
void setNoseGeometry(const HGCalGeometry *geom)
Definition: HGCalTriggerGeometryBase.h:110
DetId::Hcal
Definition: DetId.h:28
HGCalTriggerGeometryBase::caloGeometry
const CaloGeometry * caloGeometry() const
Definition: HGCalTriggerGeometryBase.h:33
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
HGCalTriggerGeometryBase::getModuleFromCell
virtual unsigned getModuleFromCell(const unsigned cell_det_id) const =0
HGCalTriggerGeometryBase::setEEGeometry
void setEEGeometry(const HGCalGeometry *geom)
Definition: HGCalTriggerGeometryBase.h:107
HGCalTriggerGeometryBase::hgc_ee_geometry_
const HGCalGeometry * hgc_ee_geometry_
Definition: HGCalTriggerGeometryBase.h:117
HcalGeometry.h
HGCalTriggerGeometryBase::getLinksInModule
virtual unsigned getLinksInModule(const unsigned module_id) const =0
CaloGeometry
Definition: CaloGeometry.h:21
HGCalTriggerGeometryBase::setWithNoseGeometry
void setWithNoseGeometry(const bool isNose)
Definition: HGCalTriggerGeometryBase.h:71
HGCalTriggerGeometryBase::triggerLayer
virtual unsigned triggerLayer(const unsigned id) const =0
HGCalTriggerGeometryBase::hgc_hsi_geometry_
const HGCalGeometry * hgc_hsi_geometry_
Definition: HGCalTriggerGeometryBase.h:118
HGCalTopology.h
HGCalTriggerGeometryBase::hgc_hsc_geometry_
const HGCalGeometry * hgc_hsc_geometry_
Definition: HGCalTriggerGeometryBase.h:119
HFNose
Definition: ForwardSubdetector.h:11
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
HGCalTriggerGeometryBase::reset
virtual void reset()
Definition: HGCalTriggerGeometryBase.cc:6
HGCalTriggerGeometryBase::getCellsFromTriggerCell
virtual geom_set getCellsFromTriggerCell(const unsigned cell_det_id) const =0
Point3DBase< float, GlobalTag >
HGCalGeometry
Definition: HGCalGeometry.h:29
HGCalGeometry::topology
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:111
HGCalTriggerGeometryBase::setHSiGeometry
void setHSiGeometry(const HGCalGeometry *geom)
Definition: HGCalTriggerGeometryBase.h:108
HGCalTriggerGeometryBase::calo_geometry_
const CaloGeometry * calo_geometry_
Definition: HGCalTriggerGeometryBase.h:116
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalTriggerGeometryBase::fhGeometry
const HGCalGeometry * fhGeometry() const
Definition: HGCalTriggerGeometryBase.h:46
HGCalTriggerGeometryBase::getTriggerCellFromCell
virtual unsigned getTriggerCellFromCell(const unsigned cell_det_id) const =0
HGCEE
Definition: ForwardSubdetector.h:8
HGCalGeometry.h
edm::ParameterSet
Definition: ParameterSet.h:47
edmplugin::PluginFactory
Definition: PluginFactory.h:34
HGCalTriggerGeometryBase::geom_ordered_set
std::set< unsigned > geom_ordered_set
Definition: HGCalTriggerGeometryBase.h:23
HGCalTriggerGeometryBase::validTriggerCell
virtual bool validTriggerCell(const unsigned trigger_cell_id) const =0
HGCalTriggerGeometryBase::hgc_nose_geometry_
const HGCalGeometry * hgc_nose_geometry_
Definition: HGCalTriggerGeometryBase.h:120
HGCalTriggerGeometryBase::bhTopology
const HcalTopology & bhTopology() const
Definition: HGCalTriggerGeometryBase.h:67
HGCalTriggerGeometryBase::isV9Geometry
bool isV9Geometry() const
Definition: HGCalTriggerGeometryBase.h:30
HGCalTriggerGeometryBase::geom_set
std::unordered_set< unsigned > geom_set
Definition: HGCalTriggerGeometryBase.h:22
HGCalTriggerGeometryBase::setHScGeometry
void setHScGeometry(const HGCalGeometry *geom)
Definition: HGCalTriggerGeometryBase.h:109
HGCalTriggerGeometryBase::name_
const std::string name_
Definition: HGCalTriggerGeometryBase.h:113
HGCalTopology
Definition: HGCalTopology.h:12
HGCalTriggerGeometryBase::eeGeometry
const HGCalGeometry * eeGeometry() const
Definition: HGCalTriggerGeometryBase.h:41
HGCalTriggerGeometryBase::getModuleFromTriggerCell
virtual unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const =0
HGCalTriggerGeometryBase::getModulePosition
virtual GlobalPoint getModulePosition(const unsigned module_det_id) const =0
HcalEndcap
Definition: HcalAssistant.h:34
HGCalTriggerGeometryBase::hsiTopology
const HGCalTopology & hsiTopology() const
Definition: HGCalTriggerGeometryBase.h:68
Exception
Definition: hltDiff.cc:245
CaloGeometry.h
HGCalTriggerGeometryBase::getTriggerCellPosition
virtual GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const =0
HGCalTriggerGeometryBase::geom_map
std::unordered_map< unsigned, unsigned > geom_map
Definition: HGCalTriggerGeometryBase.h:21
HGCalTriggerGeometryBase::setCaloGeometry
void setCaloGeometry(const CaloGeometry *geom)
Definition: HGCalTriggerGeometryBase.h:106
HGCalTriggerGeometryBase::HGCalTriggerGeometryBase
HGCalTriggerGeometryBase(const edm::ParameterSet &conf)
Definition: HGCalTriggerGeometryBase.cc:3
HGCalTriggerGeometryBase::hscGeometry
const HGCalGeometry * hscGeometry() const
Definition: HGCalTriggerGeometryBase.h:58
HGCHEF
Definition: ForwardSubdetector.h:9
HcalGeometry::topology
const HcalTopology & topology() const
Definition: HcalGeometry.h:111
ParameterSet.h
HGCalTriggerGeometryBase::isWithNoseGeometry
bool isWithNoseGeometry() const
Definition: HGCalTriggerGeometryBase.h:31
DetId::Forward
Definition: DetId.h:30
HGCalTriggerGeometryBase::name
const std::string & name() const
Definition: HGCalTriggerGeometryBase.h:28
HGCalTriggerGeometryBase::isNose_
bool isNose_
Definition: HGCalTriggerGeometryBase.h:115
HGCalTriggerGeometryBase::getModuleSize
virtual unsigned getModuleSize(const unsigned module_id) const =0
HcalGeometry
Definition: HcalGeometry.h:17
GlobalPoint.h
HGCalTriggerGeometryBase::bhGeometry
const HcalGeometry * bhGeometry() const
Definition: HGCalTriggerGeometryBase.h:51
HGCalTriggerGeometryBase::noseTopology
const HGCalTopology & noseTopology() const
Definition: HGCalTriggerGeometryBase.h:64
HGCalTriggerGeometryBase::lastTriggerLayer
virtual unsigned lastTriggerLayer() const =0
HGCalTriggerGeometryBase::fhTopology
const HGCalTopology & fhTopology() const
Definition: HGCalTriggerGeometryBase.h:66
HGCalTriggerGeometryBase::hscTopology
const HGCalTopology & hscTopology() const
Definition: HGCalTriggerGeometryBase.h:69