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 public:
26  typedef std::vector<FlatTrd> CellVec;
27 
31 
32  typedef std::set<DetId> DetIdSet;
33  typedef std::vector<GlobalPoint> CornersVec;
34 
35  typedef FastTimeGeometryRecord AlignedRecord; // NOTE: not aligned yet
37 
38  enum { k_NumberOfParametersPerShape = 12 }; // FlatTrd
39  enum { k_NumberOfShapes = 50 };
40 
41  static std::string dbString() { return "PFastTimeRcd"; }
42 
44 
45  ~FastTimeGeometry() override;
46 
47  void localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int i, Pt3D& ref);
48 
49  void newCell(const GlobalPoint& f1,
50  const GlobalPoint& f2,
51  const GlobalPoint& f3,
52  const CCGFloat* parm,
53  const DetId& detId) override;
54 
56  std::shared_ptr<const CaloCellGeometry> getGeometry(const DetId& id) const override;
57 
58  bool present(const DetId& id) const override;
59 
63  CaloSubdetectorGeometry::IVec& dinsVector) const override;
64 
65  GlobalPoint getPosition(const DetId& id) const;
66 
68  CornersVec getCorners(const DetId& id) const;
69 
70  // avoid sorting set in base class
71  const std::vector<DetId>& getValidDetIds(DetId::Detector det = DetId::Detector(0), int subdet = 0) const override {
72  return m_validIds;
73  }
74  const std::vector<DetId>& getValidGeomDetIds(void) const { return m_validGeomIds; }
75 
76  // Get closest cell, etc...
77  DetId getClosestCell(const GlobalPoint& r) const override;
78 
85  DetIdSet getCells(const GlobalPoint& r, double dR) const override;
86 
87  virtual void fillNamedParams(DDFilteredView fv);
88  void initializeParms() override;
89 
90  static std::string producerTag() { return "FastTime"; }
91  std::string cellElement() const;
92 
93  const FastTimeTopology& topology() const { return m_topology; }
94  void sortDetIds();
95 
96 protected:
97  unsigned int indexFor(const DetId& id) const override;
99  unsigned int sizeForDenseIndex() const;
100 
101  // Modify the RawPtr class
102  const CaloCellGeometry* getGeometryRawPtr(uint32_t index) const override;
103  std::shared_ptr<const CaloCellGeometry> cellGeomPtr(uint32_t index) const override;
104 
105  void addValidID(const DetId& id);
106 
107 private:
108  std::shared_ptr<const CaloCellGeometry> cellGeomPtr(uint32_t index, const GlobalPoint& p) const;
109 
111 
112  CellVec m_cellVec;
113  std::vector<DetId> m_validGeomIds;
114  int m_Type;
116 };
117 
118 #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:7
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:17
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.