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 
13 
14 // Pure virtual trigger geometry class
15 // Provides the interface to access trigger cell and module mappings
17 public:
18  typedef std::unordered_map<unsigned, unsigned> geom_map;
19  typedef std::unordered_set<unsigned> geom_set;
20  typedef std::set<unsigned> geom_ordered_set;
21 
24 
25  const std::string& name() const { return name_; }
26 
27  bool isWithNoseGeometry() const { return isNose_; }
28 
29  const HGCalGeometry* noseGeometry() const { return hgc_nose_geometry_; }
30  const HGCalGeometry* eeGeometry() const { return hgc_ee_geometry_; }
31  const HGCalGeometry* fhGeometry() const { return hgc_hsi_geometry_; }
32  const HGCalGeometry* hsiGeometry() const { return fhGeometry(); }
33  const HGCalGeometry* hscGeometry() const { return hgc_hsc_geometry_; }
34  const HGCalTopology& noseTopology() const { return noseGeometry()->topology(); }
35  const HGCalTopology& eeTopology() const { return eeGeometry()->topology(); }
36  const HGCalTopology& fhTopology() const { return fhGeometry()->topology(); }
37  const HGCalTopology& hsiTopology() const { return hsiGeometry()->topology(); }
38  const HGCalTopology& hscTopology() const { return hscGeometry()->topology(); }
39 
40  void setWithNoseGeometry(const bool isNose) { isNose_ = isNose; }
41 
42  // non-const access to the geometry class
43  virtual void initialize(const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*) = 0;
44  virtual void initialize(const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*, const HGCalGeometry*) = 0;
45  virtual void reset();
46 
47  // const access to the geometry class
48  virtual unsigned getTriggerCellFromCell(const unsigned cell_det_id) const = 0;
49  virtual unsigned getModuleFromCell(const unsigned cell_det_id) const = 0;
50  virtual unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const = 0;
51 
52  virtual geom_set getCellsFromTriggerCell(const unsigned cell_det_id) const = 0;
53  virtual geom_set getCellsFromModule(const unsigned cell_det_id) const = 0;
54  virtual geom_set getTriggerCellsFromModule(const unsigned trigger_cell_det_id) const = 0;
55 
56  virtual geom_set getStage1FpgasFromStage2Fpga(const unsigned stage2_id) const = 0;
57  virtual geom_set getStage2FpgasFromStage1Fpga(const unsigned stage1_id) const = 0;
58 
59  virtual geom_set getStage1LinksFromStage2Fpga(const unsigned) const = 0;
60  virtual unsigned getStage1FpgaFromStage1Link(const unsigned) const = 0;
61  virtual unsigned getStage2FpgaFromStage1Link(const unsigned) const = 0;
62  virtual geom_set getStage1LinksFromStage1Fpga(const unsigned) const = 0;
63  virtual std::vector<unsigned> getLpgbtsFromStage1Fpga(const unsigned stage1_id) const = 0;
64  virtual unsigned getStage1FpgaFromLpgbt(const unsigned lpgbt_id) const = 0;
65  virtual geom_set getModulesFromLpgbt(const unsigned lpgbt_id) const = 0;
66  virtual geom_set getLpgbtsFromModule(const unsigned module_id) const = 0;
67  virtual unsigned getStage1FpgaFromModule(const unsigned module_id) const = 0;
68 
69  virtual geom_ordered_set getOrderedCellsFromModule(const unsigned cell_det_id) const = 0;
70  virtual geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned trigger_cell_det_id) const = 0;
71 
72  virtual geom_set getNeighborsFromTriggerCell(const unsigned trigger_cell_det_id) const = 0;
73 
74  virtual unsigned getLinksInModule(const unsigned module_id) const = 0;
75  virtual unsigned getModuleSize(const unsigned module_id) const = 0;
76 
77  virtual GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const = 0;
78  virtual GlobalPoint getModulePosition(const unsigned module_det_id) const = 0;
79 
80  virtual bool validCell(const unsigned cell_id) const = 0;
81  virtual bool validTriggerCell(const unsigned trigger_cell_id) const = 0;
82  virtual bool disconnectedModule(const unsigned module_id) const = 0;
83  virtual unsigned lastTriggerLayer() const = 0;
84  virtual unsigned triggerLayer(const unsigned id) const = 0;
85 
86 protected:
91 
92 private:
94 
95  bool isNose_ = false;
96  const HGCalGeometry* hgc_ee_geometry_ = nullptr;
97  const HGCalGeometry* hgc_hsi_geometry_ = nullptr;
98  const HGCalGeometry* hgc_hsc_geometry_ = nullptr;
100 };
101 
104 
105 #endif
HGCalTriggerGeometryBase(const edm::ParameterSet &conf)
virtual GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const =0
const HGCalGeometry * hgc_ee_geometry_
virtual unsigned getModuleSize(const unsigned module_id) const =0
virtual unsigned getModuleFromCell(const unsigned cell_det_id) const =0
void setEEGeometry(const HGCalGeometry *geom)
virtual unsigned getStage1FpgaFromModule(const unsigned module_id) const =0
const std::string & name() const
auto module_id(edm::ModuleCallingContext const &mcc)
void setWithNoseGeometry(const bool isNose)
const HGCalGeometry * hgc_hsi_geometry_
const HGCalTopology & eeTopology() const
virtual unsigned lastTriggerLayer() const =0
const HGCalGeometry * hgc_hsc_geometry_
virtual unsigned triggerLayer(const unsigned id) const =0
virtual unsigned getStage1FpgaFromLpgbt(const unsigned lpgbt_id) const =0
virtual geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned trigger_cell_det_id) const =0
virtual geom_set getNeighborsFromTriggerCell(const unsigned trigger_cell_det_id) const =0
virtual geom_set getCellsFromTriggerCell(const unsigned cell_det_id) const =0
virtual geom_set getLpgbtsFromModule(const unsigned module_id) const =0
virtual bool disconnectedModule(const unsigned module_id) const =0
void setHSiGeometry(const HGCalGeometry *geom)
virtual geom_ordered_set getOrderedCellsFromModule(const unsigned cell_det_id) const =0
virtual unsigned getTriggerCellFromCell(const unsigned cell_det_id) const =0
virtual void initialize(const HGCalGeometry *, const HGCalGeometry *, const HGCalGeometry *)=0
void setNoseGeometry(const HGCalGeometry *geom)
virtual bool validTriggerCell(const unsigned trigger_cell_id) const =0
const HGCalGeometry * hgc_nose_geometry_
virtual geom_set getStage2FpgasFromStage1Fpga(const unsigned stage1_id) const =0
void setHScGeometry(const HGCalGeometry *geom)
virtual geom_set getStage1LinksFromStage2Fpga(const unsigned) const =0
virtual unsigned getLinksInModule(const unsigned module_id) const =0
virtual unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const =0
virtual GlobalPoint getModulePosition(const unsigned module_det_id) const =0
virtual std::vector< unsigned > getLpgbtsFromStage1Fpga(const unsigned stage1_id) const =0
virtual unsigned getStage2FpgaFromStage1Link(const unsigned) const =0
const HGCalTopology & topology() const
edmplugin::PluginFactory< HGCalTriggerGeometryBase *(const edm::ParameterSet &)> HGCalTriggerGeometryFactory
const HGCalGeometry * fhGeometry() const
std::unordered_map< unsigned, unsigned > geom_map
virtual geom_set getModulesFromLpgbt(const unsigned lpgbt_id) const =0
const HGCalGeometry * hscGeometry() const
std::set< unsigned > geom_ordered_set
const HGCalTopology & noseTopology() const
const HGCalTopology & fhTopology() const
virtual geom_set getStage1LinksFromStage1Fpga(const unsigned) const =0
virtual unsigned getStage1FpgaFromStage1Link(const unsigned) const =0
const HGCalTopology & hscTopology() const
std::unordered_set< unsigned > geom_set
virtual geom_set getTriggerCellsFromModule(const unsigned trigger_cell_det_id) const =0
virtual geom_set getStage1FpgasFromStage2Fpga(const unsigned stage2_id) const =0
const HGCalGeometry * noseGeometry() const
virtual geom_set getCellsFromModule(const unsigned cell_det_id) const =0
const HGCalGeometry * hsiGeometry() const
const HGCalTopology & hsiTopology() const
virtual bool validCell(const unsigned cell_id) const =0
const HGCalGeometry * eeGeometry() const