CMS 3D CMS Logo

MTDGeomUtil.h
Go to the documentation of this file.
1 // Author: Aurora Perego, Fabio Cossutti - aurora.perego@cern.ch, fabio.cossutti@ts.infn.it
2 // Date: 05/2023
3 
4 #ifndef __RecoLocalFastTime_FTLCommonAlgos_MTDGeomUtil_h__
5 #define __RecoLocalFastTime_FTLCommonAlgos_MTDGeomUtil_h__
6 
11 
16 
17 namespace edm {
18  class Event;
19  class EventSetup;
20 } // namespace edm
21 
22 namespace mtd {
23  class MTDGeomUtil {
24  public:
25  MTDGeomUtil() : geom_(nullptr), topology_(nullptr) {}
27 
28  void setGeometry(MTDGeometry const* geom);
29  void setTopology(MTDTopology const* topo);
30 
31  bool isETL(const DetId&) const;
32  bool isBTL(const DetId&) const;
33 
34  std::pair<LocalPoint, GlobalPoint> position(const DetId& id, int row = 0, int column = 0) const;
35  GlobalPoint globalPosition(const DetId& id, const LocalPoint& local_point) const;
36 
37  // zside returns +/- 1
38  int zside(const DetId& id) const;
39 
40  unsigned int layer(const DetId&) const;
41  int module(const DetId&) const;
42  std::pair<float, float> pixelInModule(const DetId& id, const int row, const int column) const;
43  std::pair<uint8_t, uint8_t> pixelInModule(const DetId& id, const LocalPoint& local_point) const;
44  int crystalInModule(const DetId&) const;
45 
46  // 4-vector helper functions using GlobalPoint
47  float eta(const GlobalPoint& position, const float& vertex_z = 0.) const;
48  float phi(const GlobalPoint& position) const;
49  float pt(const GlobalPoint& position, const float& hitEnergy, const float& vertex_z = 0.) const;
50 
51  // 4-vector helper functions using DetId
52  float eta(const DetId& id, const LocalPoint& local_point, const float& vertex_z = 0.) const;
53  float phi(const DetId& id, const LocalPoint& local_point) const;
54  float pt(const DetId& id, const LocalPoint& local_point, const float& hitEnergy, const float& vertex_z = 0.) const;
55 
56  inline const MTDGeometry* geometry() const { return geom_; };
57  inline const MTDTopology* topology() const { return topology_; };
58 
59  private:
60  const MTDGeometry* geom_;
62  };
63 } // namespace mtd
64 
65 #endif
int crystalInModule(const DetId &) const
Definition: MTDGeomUtil.cc:157
const MTDGeometry * geometry() const
Definition: MTDGeomUtil.h:56
GlobalPoint globalPosition(const DetId &id, const LocalPoint &local_point) const
Definition: MTDGeomUtil.cc:58
std::pair< float, float > pixelInModule(const DetId &id, const int row, const int column) const
Definition: MTDGeomUtil.cc:111
void setTopology(MTDTopology const *topo)
Definition: MTDGeomUtil.cc:12
unsigned int layer(const DetId &) const
Definition: MTDGeomUtil.cc:89
bool isBTL(const DetId &) const
Definition: MTDGeomUtil.cc:24
float phi(const GlobalPoint &position) const
Definition: MTDGeomUtil.cc:173
std::pair< LocalPoint, GlobalPoint > position(const DetId &id, int row=0, int column=0) const
Definition: MTDGeomUtil.cc:27
void setGeometry(MTDGeometry const *geom)
Definition: MTDGeomUtil.cc:10
const MTDTopology * topology_
Definition: MTDGeomUtil.h:61
Definition: DetId.h:17
int zside(const DetId &id) const
Definition: MTDGeomUtil.cc:84
bool isETL(const DetId &) const
Definition: MTDGeomUtil.cc:14
float pt(const GlobalPoint &position, const float &hitEnergy, const float &vertex_z=0.) const
HLT enums.
float eta(const GlobalPoint &position, const float &vertex_z=0.) const
const MTDGeometry * geom_
Definition: MTDGeomUtil.h:57
int module(const DetId &) const
Definition: MTDGeomUtil.cc:98
const MTDTopology * topology() const
Definition: MTDGeomUtil.h:57