CMS 3D CMS Logo

HGCalGeometry.h
Go to the documentation of this file.
1 #ifndef GeometryHGCalGeometryHGCalGeometry_h
2 #define GeometryHGCalGeometryHGCalGeometry_h
3 
4 /*
5  * Geometry for High Granularity Calorimeter
6  * This geometry is essentially driven by topology,
7  * which is thus encapsulated in this class.
8  * This makes this geometry not suitable to be loaded
9  * by regular CaloGeometryLoader<T>
10  */
11 
22 #include <vector>
23 
24 class FlatTrd;
25 
27 
28 public:
29 
30  typedef std::vector<FlatTrd> CellVec ;
31 
35 
36  typedef std::set<DetId> DetIdSet;
37  typedef std::vector<GlobalPoint> CornersVec ;
38 
39  typedef HGCalGeometryRecord AlignedRecord ; // NOTE: not aligned yet
41 
42  enum { k_NumberOfParametersPerShape = 12 } ; // FlatTrd
43  enum { k_NumberOfShapes = 50 } ;
44 
45  static std::string dbString() { return "PHGCalRcd" ; }
46 
48 
49  virtual ~HGCalGeometry();
50 
51  void localCorners( Pt3DVec& lc ,
52  const CCGFloat* pv ,
53  unsigned int i ,
54  Pt3D& ref ) ;
55 
56  virtual void newCell( const GlobalPoint& f1 ,
57  const GlobalPoint& f2 ,
58  const GlobalPoint& f3 ,
59  const CCGFloat* parm ,
60  const DetId& detId ) override;
61 
63  virtual const CaloCellGeometry* getGeometry( const DetId& id ) const override;
64 
65  virtual void getSummary( CaloSubdetectorGeometry::TrVec& trVector,
68  CaloSubdetectorGeometry::IVec& dinsVector ) const override;
69 
70  GlobalPoint getPosition( const DetId& id ) const;
71 
73  CornersVec getCorners( const DetId& id ) const;
74 
75  // avoid sorting set in base class
76  virtual const std::vector<DetId>& getValidDetIds( DetId::Detector det = DetId::Detector(0), int subdet = 0) const override { return m_validIds; }
77  const std::vector<DetId>& getValidGeomDetIds( void ) const { return m_validGeomIds; }
78 
79  // Get closest cell, etc...
80  virtual DetId getClosestCell( const GlobalPoint& r ) const override;
81 
88  virtual DetIdSet getCells( const GlobalPoint& r, double dR ) const override;
89 
90  virtual void fillNamedParams (DDFilteredView fv);
91  virtual void initializeParms() override;
92 
93  static std::string producerTag() { return "HGCal" ; }
94  std::string cellElement() const;
95 
96  const HGCalTopology& topology () const {return m_topology;}
97  void sortDetIds();
98 
99 protected:
100 
101  virtual unsigned int indexFor(const DetId& id) const override;
103  unsigned int sizeForDenseIndex() const;
104 
105  virtual const CaloCellGeometry* cellGeomPtr( uint32_t index ) const override;
106 
107  void addValidID(const DetId& id);
108  unsigned int getClosestCellIndex ( const GlobalPoint& r ) const;
109 
110 private:
112 
113  CellVec m_cellVec ;
114  std::vector<DetId> m_validGeomIds;
117 };
118 
119 #endif
std::vector< DetId > m_validGeomIds
A base class to handle the particular shape of HGCal volumes.
Definition: FlatTrd.h:19
std::vector< CCGFloat > DimVec
std::string cellElement() const
unsigned int sizeForDenseIndex() const
unsigned int getClosestCellIndex(const GlobalPoint &r) const
const HGCalTopology & m_topology
static std::string producerTag()
Definition: HGCalGeometry.h:93
std::vector< unsigned int > IVec
const std::vector< DetId > & getValidGeomDetIds(void) const
Definition: HGCalGeometry.h:77
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
std::vector< GlobalPoint > CornersVec
Definition: HGCalGeometry.h:37
std::vector< CCGFloat > TrVec
GlobalPoint getPosition(const DetId &id) const
HGCalGeometryRecord AlignedRecord
Definition: HGCalGeometry.h:39
std::vector< FlatTrd > CellVec
Definition: HGCalGeometry.h:30
std::vector< Pt3D > Pt3DVec
ForwardSubdetector
CornersVec getCorners(const DetId &id) const
Returns the corner points of this cell&#39;s volume.
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const override
Get a list of valid detector ids (for the given subdetector)
Definition: HGCalGeometry.h:76
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: HGCalGeometry.h:34
HGCalGeometry(const HGCalTopology &topology)
virtual void initializeParms() override
std::vector< DetId > m_validIds
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:96
static std::string dbString()
Definition: HGCalGeometry.h:45
def pv(vc)
Definition: MetAnalyzer.py:6
std::set< DetId > DetIdSet
Definition: HGCalGeometry.h:36
virtual DetIdSet getCells(const GlobalPoint &r, double dR) const override
Get a list of all cells within a dR of the given cell.
void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
Definition: DetId.h:18
ForwardSubdetector m_subdet
virtual DetId getClosestCell(const GlobalPoint &r) const override
Detector
Definition: DetId.h:24
virtual void getSummary(CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const override
HepGeom::Point3D< CCGFloat > Pt3D
CaloCellGeometry::Pt3D Pt3D
Definition: HGCalGeometry.h:33
PHGCalRcd PGeometryRecord
Definition: HGCalGeometry.h:40
virtual void fillNamedParams(DDFilteredView fv)
void addValidID(const DetId &id)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const override
Get the cell geometry of a given detector id. Should return false if not found.
virtual unsigned int sizeForDenseIndex(const DetId &id) const
virtual unsigned int indexFor(const DetId &id) const override
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const override
CellVec m_cellVec
virtual ~HGCalGeometry()
CaloCellGeometry::CCGFloat CCGFloat
Definition: HGCalGeometry.h:32