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 
23 #include <vector>
24 
25 class FlatTrd;
26 
28 
29 public:
30 
31  typedef std::vector<FlatTrd> CellVec ;
32 
36 
37  typedef std::set<DetId> DetIdSet;
38  typedef std::vector<GlobalPoint> CornersVec ;
39 
40  typedef HGCalGeometryRecord AlignedRecord ; // NOTE: not aligned yet
42 
43  enum { k_NumberOfParametersPerShape = 12 } ; // FlatTrd
44  enum { k_NumberOfShapes = 50 } ;
45 
46  static std::string dbString() { return "PHGCalRcd" ; }
47 
49 
50  ~HGCalGeometry() override;
51 
52  void localCorners( Pt3DVec& lc ,
53  const CCGFloat* pv ,
54  unsigned int i ,
55  Pt3D& ref ) ;
56 
57  void newCell( const GlobalPoint& f1 ,
58  const GlobalPoint& f2 ,
59  const GlobalPoint& f3 ,
60  const CCGFloat* parm ,
61  const DetId& detId ) override;
62 
64  std::shared_ptr<const CaloCellGeometry> getGeometry( const DetId& id ) const override;
65 
66  bool present (const DetId& id) const override;
67 
71  CaloSubdetectorGeometry::IVec& dinsVector ) const override;
72 
73  GlobalPoint getPosition( const DetId& id ) const;
74 
76  CornersVec getCorners( const DetId& id ) const;
77 
78  // avoid sorting set in base class
79  const std::vector<DetId>& getValidDetIds( DetId::Detector det = DetId::Detector(0), int subdet = 0) const override { return m_validIds; }
80  const std::vector<DetId>& getValidGeomDetIds( void ) const { return m_validGeomIds; }
81 
82  // Get closest cell, etc...
83  DetId getClosestCell( const GlobalPoint& r ) const override;
84 
91  DetIdSet getCells( const GlobalPoint& r, double dR ) const override;
92 
93  virtual void fillNamedParams (DDFilteredView fv);
94  void initializeParms() override;
95 
96  static std::string producerTag() { return "HGCal" ; }
97  std::string cellElement() const;
98 
99  const HGCalTopology& topology () const {return m_topology;}
100  void sortDetIds();
101 
102 protected:
103 
104  unsigned int indexFor(const DetId& id) const override;
106  unsigned int sizeForDenseIndex() const;
107 
108  // Modify the RawPtr class
109  const CaloCellGeometry* getGeometryRawPtr(uint32_t index) const override;
110 
111  std::shared_ptr<const CaloCellGeometry> cellGeomPtr(uint32_t index) const override;
112 
113  void addValidID(const DetId& id);
114  unsigned int getClosestCellIndex ( const GlobalPoint& r ) const;
115 
116 private:
117 
118  std::shared_ptr<const CaloCellGeometry> cellGeomPtr( uint32_t index, const GlobalPoint& p) const;
119 
121 
122  CellVec m_cellVec ;
123  std::vector<DetId> m_validGeomIds;
126 };
127 
128 #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
std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const override
unsigned int sizeForDenseIndex() const
unsigned int getClosestCellIndex(const GlobalPoint &r) const
const HGCalTopology & m_topology
static std::string producerTag()
Definition: HGCalGeometry.h:96
~HGCalGeometry() override
std::vector< unsigned int > IVec
const std::vector< DetId > & getValidGeomDetIds(void) const
Definition: HGCalGeometry.h:80
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:38
std::vector< CCGFloat > TrVec
GlobalPoint getPosition(const DetId &id) const
HGCalGeometryRecord AlignedRecord
Definition: HGCalGeometry.h:40
std::vector< FlatTrd > CellVec
Definition: HGCalGeometry.h:31
std::vector< Pt3D > Pt3DVec
ForwardSubdetector
CornersVec getCorners(const DetId &id) const
Returns the corner points of this cell&#39;s volume.
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: HGCalGeometry.h:35
HGCalGeometry(const HGCalTopology &topology)
void initializeParms() override
std::vector< DetId > m_validIds
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:99
static std::string dbString()
Definition: HGCalGeometry.h:46
def pv(vc)
Definition: MetAnalyzer.py:6
std::set< DetId > DetIdSet
Definition: HGCalGeometry.h:37
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
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:79
ForwardSubdetector m_subdet
DetId getClosestCell(const GlobalPoint &r) const override
Detector
Definition: DetId.h:24
void getSummary(CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const override
HepGeom::Point3D< CCGFloat > Pt3D
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const override
Get the cell geometry of a given detector id. Should return false if not found.
CaloCellGeometry::Pt3D Pt3D
Definition: HGCalGeometry.h:34
PHGCalRcd PGeometryRecord
Definition: HGCalGeometry.h:41
virtual void fillNamedParams(DDFilteredView fv)
const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const override
void addValidID(const DetId &id)
virtual unsigned int sizeForDenseIndex(const DetId &id) const
unsigned int indexFor(const DetId &id) const override
bool present(const DetId &id) const override
is this detid present in the geometry?
CellVec m_cellVec
CaloCellGeometry::CCGFloat CCGFloat
Definition: HGCalGeometry.h:33