File indexing completed on 2025-02-21 09:58:01
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef DD4HEP_GRIDPHIETA_H
0016 #define DD4HEP_GRIDPHIETA_H 1
0017
0018
0019 #include <DDSegmentation/GridPhiEta.h>
0020 #include <DD4hep/Segmentations.h>
0021
0022
0023 namespace dd4hep {
0024
0025
0026 typedef Handle<SegmentationWrapper<DDSegmentation::GridPhiEta>> GridPhiEtaHandle;
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048 class GridPhiEta : public GridPhiEtaHandle {
0049 public:
0050
0051 GridPhiEta() = default;
0052
0053 GridPhiEta(const GridPhiEta& e) = default;
0054
0055 GridPhiEta(const Segmentation& e) : Handle<Object>(e) {}
0056
0057 GridPhiEta(const Handle<Object>& e) : Handle<Object>(e) {}
0058
0059 template <typename Q>
0060 GridPhiEta(const Handle<Q>& e) : Handle<Object>(e) {}
0061
0062 GridPhiEta& operator=(const GridPhiEta& seg) = default;
0063
0064 bool operator==(const GridPhiEta& seg) const { return m_element == seg.m_element; }
0065
0066 inline Position position(const CellID& id) const { return Position(access()->implementation->position(id)); }
0067
0068
0069 inline dd4hep::CellID cellID(const Position& local, const Position& global, const VolumeID& volID) const {
0070 return access()->implementation->cellID(local, global, volID);
0071 }
0072
0073
0074 inline double gridSizeEta() const { return access()->implementation->gridSizeEta(); }
0075
0076
0077 inline int phiBins() const { return access()->implementation->phiBins(); }
0078
0079
0080 inline double offsetEta() const { return access()->implementation->offsetEta(); }
0081
0082
0083 inline double offsetPhi() const { return access()->implementation->offsetPhi(); }
0084
0085
0086 inline void setOffsetEta(double offset) const { access()->implementation->setOffsetEta(offset); }
0087
0088
0089 inline void setOffsetPhi(double offset) const { access()->implementation->setOffsetPhi(offset); }
0090
0091
0092 inline void setGridSizeEta(double cellSize) const { access()->implementation->setGridSizeEta(cellSize); }
0093
0094
0095 inline void setPhiBins(int cellSize) const { access()->implementation->setPhiBins(cellSize); }
0096
0097
0098 inline const std::string& fieldNameEta() const { return access()->implementation->fieldNameEta(); }
0099
0100
0101 inline const std::string& fieldNamePhi() const { return access()->implementation->fieldNamePhi(); }
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112 inline std::vector<double> cellDimensions(const CellID& ) const {
0113 return {access()->implementation->gridSizePhi(), access()->implementation->gridSizeEta()};
0114 }
0115 };
0116 }
0117 #endif