Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:49:59

0001 // Author: Aurora Perego, Fabio Cossutti - aurora.perego@cern.ch, fabio.cossutti@ts.infn.it
0002 // Date: 05/2023
0003 
0004 #ifndef __RecoLocalFastTime_FTLCommonAlgos_MTDGeomUtil_h__
0005 #define __RecoLocalFastTime_FTLCommonAlgos_MTDGeomUtil_h__
0006 
0007 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0008 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0009 #include "DataFormats/ForwardDetId/interface/BTLDetId.h"
0010 #include "DataFormats/ForwardDetId/interface/ETLDetId.h"
0011 
0012 #include "Geometry/MTDGeometryBuilder/interface/MTDGeometry.h"
0013 #include "Geometry/MTDGeometryBuilder/interface/ProxyMTDTopology.h"
0014 #include "Geometry/MTDGeometryBuilder/interface/RectangularMTDTopology.h"
0015 #include "Geometry/MTDNumberingBuilder/interface/MTDTopology.h"
0016 
0017 namespace edm {
0018   class Event;
0019   class EventSetup;
0020 }  // namespace edm
0021 
0022 namespace mtd {
0023   class MTDGeomUtil {
0024   public:
0025     MTDGeomUtil() : geom_(nullptr), topology_(nullptr) {}
0026     ~MTDGeomUtil() {}
0027 
0028     void setGeometry(MTDGeometry const* geom);
0029     void setTopology(MTDTopology const* topo);
0030 
0031     bool isETL(const DetId&) const;
0032     bool isBTL(const DetId&) const;
0033 
0034     std::pair<LocalPoint, GlobalPoint> position(const DetId& id, int row = 0, int column = 0) const;
0035     GlobalPoint globalPosition(const DetId& id, const LocalPoint& local_point) const;
0036 
0037     // zside returns +/- 1
0038     int zside(const DetId& id) const;
0039 
0040     unsigned int layer(const DetId&) const;
0041     int module(const DetId&) const;
0042     std::pair<float, float> pixelInModule(const DetId& id, const int row, const int column) const;
0043     std::pair<uint8_t, uint8_t> pixelInModule(const DetId& id, const LocalPoint& local_point) const;
0044     int crystalInModule(const DetId&) const;
0045 
0046     // 4-vector helper functions using GlobalPoint
0047     float eta(const GlobalPoint& position, const float& vertex_z = 0.) const;
0048     float phi(const GlobalPoint& position) const;
0049     float pt(const GlobalPoint& position, const float& hitEnergy, const float& vertex_z = 0.) const;
0050 
0051     // 4-vector helper functions using DetId
0052     float eta(const DetId& id, const LocalPoint& local_point, const float& vertex_z = 0.) const;
0053     float phi(const DetId& id, const LocalPoint& local_point) const;
0054     float pt(const DetId& id, const LocalPoint& local_point, const float& hitEnergy, const float& vertex_z = 0.) const;
0055 
0056     inline const MTDGeometry* geometry() const { return geom_; };
0057     inline const MTDTopology* topology() const { return topology_; };
0058 
0059   private:
0060     const MTDGeometry* geom_;
0061     const MTDTopology* topology_;
0062   };
0063 }  // namespace mtd
0064 
0065 #endif