File indexing completed on 2025-01-18 09:55:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef DDSEGMENTATION_TILEDLAYERGRIDXY_H
0020 #define DDSEGMENTATION_TILEDLAYERGRIDXY_H
0021
0022 #include <DDSegmentation/CartesianGrid.h>
0023
0024
0025 #include <string>
0026 #include <vector>
0027
0028 namespace dd4hep {
0029 namespace DDSegmentation {
0030
0031
0032 class TiledLayerGridXY: public CartesianGrid {
0033 public:
0034
0035 TiledLayerGridXY(const std::string& cellEncoding = "");
0036
0037 TiledLayerGridXY(const BitFieldCoder* decoder);
0038
0039 virtual ~TiledLayerGridXY();
0040
0041
0042 virtual Vector3D position(const CellID& cellID) const;
0043
0044 virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const;
0045
0046 double gridSizeX() const {
0047 return _gridSizeX;
0048 }
0049
0050 double gridSizeY() const {
0051 return _gridSizeY;
0052 }
0053
0054 double offsetX() const {
0055 return _offsetX;
0056 }
0057
0058 double offsetY() const {
0059 return _offsetY;
0060 }
0061
0062 std::vector<double> layerOffsetX() const {
0063 return _layerOffsetX;
0064 }
0065
0066 std::vector<double> layerOffsetY() const {
0067 return _layerOffsetY;
0068 }
0069
0070 std::vector<double> boundaryLayerX() const {
0071 return _layerDimX;
0072 }
0073
0074 std::vector<double> FractCellSizeXPerLayer() const {
0075 return _fractCellSizeXPerLayer;
0076 }
0077
0078 const std::string& fieldNameX() const {
0079 return _xId;
0080 }
0081
0082 const std::string& fieldNameY() const {
0083 return _yId;
0084 }
0085
0086 const std::string& fieldNameLayer() const {
0087 return _identifierLayer;
0088 }
0089
0090 void setGridSizeX(double cellSize) {
0091 _gridSizeX = cellSize;
0092 }
0093
0094 void setGridSizeY(double cellSize) {
0095 _gridSizeY = cellSize;
0096 }
0097
0098 void setOffsetX(double offset) {
0099 _offsetX = offset;
0100 }
0101
0102 void setOffsetY(double offset) {
0103 _offsetY = offset;
0104 }
0105
0106 void setLayerOffsetX(double offset) {
0107 _layerOffsetX.emplace_back(offset);
0108 }
0109
0110 void setLayerOffsetY(double offset) {
0111 _layerOffsetY.emplace_back(offset);
0112 }
0113
0114 void setFieldNameX(const std::string& fieldName) {
0115 _xId = fieldName;
0116 }
0117
0118 void setFieldNameY(const std::string& fieldName) {
0119 _yId = fieldName;
0120 }
0121
0122 void setFieldNameLayer(const std::string& fieldName) {
0123 _identifierLayer= fieldName;
0124 }
0125
0126 void setBoundaryLayerX(double halfX)
0127 {
0128 _layerDimX.emplace_back(halfX);
0129 };
0130
0131 void setFractCellSizeXPerLayer(double newFractCellSizeX)
0132 {
0133 _fractCellSizeXPerLayer.emplace_back(newFractCellSizeX);
0134 }
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144 virtual std::vector<double> cellDimensions(const CellID& cellID) const;
0145
0146 protected:
0147
0148 double _gridSizeX;
0149
0150 double _offsetX;
0151
0152 double _gridSizeY;
0153
0154 double _offsetY;
0155
0156 std::string _xId;
0157
0158 std::string _yId;
0159
0160 std::string _identifierLayer;
0161
0162 std::vector<double> _layerOffsetX;
0163
0164 std::vector<double> _layerOffsetY;
0165
0166 std::vector<double> _layerDimX;
0167
0168 std::vector<double> _fractCellSizeXPerLayer;
0169 };
0170
0171 }
0172 }
0173 #endif