CMS 3D CMS Logo

FastTimeGeometry.h
Go to the documentation of this file.
1 #ifndef GeometryHGCalGeometryFastTimeGeometry_h
2 #define GeometryHGCalGeometryFastTimeGeometry_h
3 
4 /*
5  * Geometry for Fast Timing Layer
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 
20 #include <vector>
21 
22 class FlatTrd;
23 
25 
26 public:
27 
28  typedef std::vector<FlatTrd> CellVec ;
29 
33 
34  typedef std::set<DetId> DetIdSet;
35  typedef std::vector<GlobalPoint> CornersVec ;
36 
37  typedef FastTimeGeometryRecord AlignedRecord ; // NOTE: not aligned yet
39 
40  enum { k_NumberOfParametersPerShape = 12 } ; // FlatTrd
41  enum { k_NumberOfShapes = 50 } ;
42 
43  static std::string dbString() { return "PFastTimeRcd" ; }
44 
46 
47  ~FastTimeGeometry() override;
48 
49  void localCorners(Pt3DVec& lc,
50  const CCGFloat* pv,
51  unsigned int i,
52  Pt3D& ref) ;
53 
54  void newCell(const GlobalPoint& f1 ,
55  const GlobalPoint& f2 ,
56  const GlobalPoint& f3 ,
57  const CCGFloat* parm ,
58  const DetId& detId) override;
59 
61  std::shared_ptr<const CaloCellGeometry> getGeometry(const DetId& id) const override;
62 
63  bool present (const DetId& id) const override;
64 
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  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  DetId getClosestCell(const GlobalPoint& r) const override;
81 
88  DetIdSet getCells(const GlobalPoint& r, double dR) const override;
89 
90  virtual void fillNamedParams (DDFilteredView fv);
91  void initializeParms() override;
92 
93  static std::string producerTag() { return "FastTime" ; }
94  std::string cellElement() const;
95 
96  const FastTimeTopology& topology () const {return m_topology;}
97  void sortDetIds();
98 
99 protected:
100 
101  unsigned int indexFor(const DetId& id) const override;
103  unsigned int sizeForDenseIndex() const;
104 
105  // Modify the RawPtr class
106  const CaloCellGeometry* getGeometryRawPtr(uint32_t index) const override;
107  std::shared_ptr<const CaloCellGeometry> cellGeomPtr( uint32_t index ) const override;
108 
109  void addValidID(const DetId& id);
110 
111 private:
112 
113  std::shared_ptr<const CaloCellGeometry> cellGeomPtr( uint32_t index, const GlobalPoint& p) const;
114 
116 
117  CellVec m_cellVec ;
118  std::vector<DetId> m_validGeomIds;
119  int m_Type;
121 };
122 
123 #endif
void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
std::set< DetId > DetIdSet
A base class to handle the particular shape of HGCal volumes.
Definition: FlatTrd.h:19
std::vector< CCGFloat > DimVec
DetId getClosestCell(const GlobalPoint &r) const override
std::vector< GlobalPoint > CornersVec
CaloCellGeometry::Pt3DVec Pt3DVec
void getSummary(CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const override
CaloCellGeometry::CCGFloat CCGFloat
static std::string dbString()
std::vector< unsigned int > IVec
virtual void fillNamedParams(DDFilteredView fv)
const FastTimeTopology & topology() const
void addValidID(const DetId &id)
std::vector< CCGFloat > TrVec
std::vector< Pt3D > Pt3DVec
FastTimeGeometryRecord AlignedRecord
ForwardSubdetector
GlobalPoint getPosition(const DetId &id) const
CaloCellGeometry::Pt3D Pt3D
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)
FastTimeGeometry(const FastTimeTopology &topology)
PFastTimeRcd PGeometryRecord
DetIdSet getCells(const GlobalPoint &r, double dR) const override
Get a list of all cells within a dR of the given cell.
~FastTimeGeometry() override
std::vector< FlatTrd > CellVec
std::string cellElement() const
std::vector< DetId > m_validIds
def pv(vc)
Definition: MetAnalyzer.py:6
bool present(const DetId &id) const override
is this detid present in the geometry?
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.
Definition: DetId.h:18
unsigned int indexFor(const DetId &id) const override
void initializeParms() override
Detector
Definition: DetId.h:24
HepGeom::Point3D< CCGFloat > Pt3D
static std::string producerTag()
void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const override
const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const override
ForwardSubdetector m_subdet
virtual unsigned int sizeForDenseIndex(const DetId &id) const
const std::vector< DetId > & getValidGeomDetIds(void) const
std::vector< DetId > m_validGeomIds
unsigned int sizeForDenseIndex() const
const FastTimeTopology & m_topology
CornersVec getCorners(const DetId &id) const
Returns the corner points of this cell&#39;s volume.