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_set>
6 #include <unordered_map>
7 
9 
12 
17 
18 // Pure virtual trigger geometry class
19 // Provides the interface to access trigger cell and module mappings
21 public:
22  typedef std::unordered_map<unsigned, unsigned> geom_map;
23  typedef std::unordered_set<unsigned> geom_set;
24  typedef std::set<unsigned> geom_ordered_set;
25 
28 
29  const std::string& name() const { return name_; }
30 
31  bool isV9Geometry() const { return !calo_geometry_.isValid(); }
33  const HGCalGeometry* eeGeometry() const {
34  return (hgc_ee_geometry_.isValid()
37  }
38  const HGCalGeometry* fhGeometry() const {
39  return (hgc_hsi_geometry_.isValid()
42  }
43  const HcalGeometry* bhGeometry() const {
44  if (hgc_hsc_geometry_.isValid()) {
45  throw cms::Exception("HGCalTriggerGeometry") << "bhGeometry cannot be used with the V9 geometry";
46  }
47  return (static_cast<const HcalGeometry*>(calo_geometry_->getSubdetectorGeometry(DetId::Hcal, HcalEndcap)));
48  }
49  const HGCalGeometry* hsiGeometry() const { return fhGeometry(); }
50  const HGCalGeometry* hscGeometry() const {
51  if (!hgc_hsc_geometry_.isValid()) {
52  throw cms::Exception("HGCalTriggerGeometry") << "hscGeometry cannot be used with the V7 and V8 geometries";
53  }
54  return hgc_hsc_geometry_.product();
55  }
56  const HGCalTopology& eeTopology() const { return eeGeometry()->topology(); }
57  const HGCalTopology& fhTopology() const { return fhGeometry()->topology(); }
58  const HcalTopology& bhTopology() const { return bhGeometry()->topology(); }
59  const HGCalTopology& hsiTopology() const { return hsiGeometry()->topology(); }
60  const HGCalTopology& hscTopology() const { return hscGeometry()->topology(); }
61 
62  // non-const access to the geometry class
63  virtual void initialize(const edm::ESHandle<CaloGeometry>&) = 0;
64  virtual void initialize(const edm::ESHandle<HGCalGeometry>&,
66  const edm::ESHandle<HGCalGeometry>&) = 0;
67  virtual void reset();
68 
69  // const access to the geometry class
70  virtual unsigned getTriggerCellFromCell(const unsigned cell_det_id) const = 0;
71  virtual unsigned getModuleFromCell(const unsigned cell_det_id) const = 0;
72  virtual unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const = 0;
73 
74  virtual geom_set getCellsFromTriggerCell(const unsigned cell_det_id) const = 0;
75  virtual geom_set getCellsFromModule(const unsigned cell_det_id) const = 0;
76  virtual geom_set getTriggerCellsFromModule(const unsigned trigger_cell_det_id) const = 0;
77 
78  virtual geom_ordered_set getOrderedCellsFromModule(const unsigned cell_det_id) const = 0;
79  virtual geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned trigger_cell_det_id) const = 0;
80 
81  virtual geom_set getNeighborsFromTriggerCell(const unsigned trigger_cell_det_id) const = 0;
82 
83  virtual GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const = 0;
84  virtual GlobalPoint getModulePosition(const unsigned module_det_id) const = 0;
85 
86  virtual bool validTriggerCell(const unsigned trigger_cell_id) const = 0;
87  virtual bool disconnectedModule(const unsigned module_id) const = 0;
88  virtual unsigned triggerLayer(const unsigned id) const = 0;
89 
90 protected:
95 
96 private:
98 
103 };
104 
107 
108 #endif
HGCalTriggerGeometryBase(const edm::ParameterSet &conf)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
virtual geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned trigger_cell_det_id) const =0
virtual geom_set getCellsFromTriggerCell(const unsigned cell_det_id) const =0
virtual geom_set getCellsFromModule(const unsigned cell_det_id) const =0
virtual GlobalPoint getModulePosition(const unsigned module_det_id) const =0
const HGCalGeometry * eeGeometry() const
const HGCalTopology & eeTopology() const
virtual geom_set getNeighborsFromTriggerCell(const unsigned trigger_cell_det_id) const =0
const HGCalTopology & hsiTopology() const
void setEEGeometry(const edm::ESHandle< HGCalGeometry > &geom)
const HcalTopology & topology() const
Definition: HcalGeometry.h:117
virtual geom_set getTriggerCellsFromModule(const unsigned trigger_cell_det_id) const =0
const HGCalGeometry * fhGeometry() const
edm::ESHandle< HGCalGeometry > hgc_hsc_geometry_
const HcalTopology & bhTopology() const
const HGCalTopology & topology() const
virtual unsigned triggerLayer(const unsigned id) const =0
void setCaloGeometry(const edm::ESHandle< CaloGeometry > &geom)
const HcalGeometry * bhGeometry() const
const HGCalGeometry * hsiGeometry() const
edmplugin::PluginFactory< HGCalTriggerGeometryBase *(const edm::ParameterSet &)> HGCalTriggerGeometryFactory
virtual bool disconnectedModule(const unsigned module_id) const =0
virtual unsigned getModuleFromCell(const unsigned cell_det_id) const =0
std::unordered_map< unsigned, unsigned > geom_map
virtual unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const =0
const HGCalGeometry * hscGeometry() const
const HGCalTopology & hscTopology() const
virtual geom_ordered_set getOrderedCellsFromModule(const unsigned cell_det_id) const =0
std::set< unsigned > geom_ordered_set
virtual bool validTriggerCell(const unsigned trigger_cell_id) const =0
void setHScGeometry(const edm::ESHandle< HGCalGeometry > &geom)
edm::ESHandle< CaloGeometry > calo_geometry_
std::unordered_set< unsigned > geom_set
const std::string & name() const
bool isValid() const
Definition: ESHandle.h:44
T const * product() const
Definition: ESHandle.h:86
virtual void initialize(const edm::ESHandle< CaloGeometry > &)=0
edm::ESHandle< HGCalGeometry > hgc_hsi_geometry_
edm::ESHandle< HGCalGeometry > hgc_ee_geometry_
virtual unsigned getTriggerCellFromCell(const unsigned cell_det_id) const =0
void setHSiGeometry(const edm::ESHandle< HGCalGeometry > &geom)
const HGCalTopology & fhTopology() const
virtual GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const =0
const edm::ESHandle< CaloGeometry > & caloGeometry() const