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  uint32_t sensorModuleId(const DetId& id) const;
47 
48  // 4-vector helper functions using GlobalPoint
49  float eta(const GlobalPoint& position, const float& vertex_z = 0.) const;
50  float phi(const GlobalPoint& position) const;
51  float pt(const GlobalPoint& position, const float& hitEnergy, const float& vertex_z = 0.) const;
52 
53  // 4-vector helper functions using DetId
54  float eta(const DetId& id, const LocalPoint& local_point, const float& vertex_z = 0.) const;
55  float phi(const DetId& id, const LocalPoint& local_point) const;
56  float pt(const DetId& id, const LocalPoint& local_point, const float& hitEnergy, const float& vertex_z = 0.) const;
57 
58  inline const MTDGeometry* geometry() const { return geom_; };
59  inline const MTDTopology* topology() const { return topology_; };
60 
61  private:
62  const MTDGeometry* geom_;
64  };
65 } // namespace mtd
66 
67 #endif
int crystalInModule(const DetId &) const
Definition: MTDGeomUtil.cc:159
const MTDGeometry * geometry() const
Definition: MTDGeomUtil.h:58
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:188
uint32_t sensorModuleId(const DetId &id) const
Definition: MTDGeomUtil.cc:165
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:63
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:59
int module(const DetId &) const
Definition: MTDGeomUtil.cc:98
const MTDTopology * topology() const
Definition: MTDGeomUtil.h:59