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 #ifndef DDSEGMENTATION_CARTESIANGRIDXYSTAGGERED_H
0019 #define DDSEGMENTATION_CARTESIANGRIDXYSTAGGERED_H
0020
0021 #include <DDSegmentation/CartesianGrid.h>
0022
0023 namespace dd4hep {
0024 namespace DDSegmentation {
0025
0026
0027 class CartesianGridXYStaggered: public CartesianGrid {
0028 public:
0029
0030 CartesianGridXYStaggered(const std::string& cellEncoding = "");
0031
0032 CartesianGridXYStaggered(const BitFieldCoder* decoder);
0033
0034 virtual ~CartesianGridXYStaggered();
0035
0036
0037 virtual Vector3D position(const CellID& cellID) const;
0038
0039 virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const;
0040
0041 double gridSizeX() const {
0042 return _gridSizeX;
0043 }
0044
0045 double gridSizeY() const {
0046 return _gridSizeY;
0047 }
0048
0049 double offsetX() const {
0050 return _offsetX;
0051 }
0052
0053 double offsetY() const {
0054 return _offsetY;
0055 }
0056
0057 const std::string& fieldNameX() const {
0058 return _xId;
0059 }
0060
0061 const std::string& fieldNameY() const {
0062 return _yId;
0063 }
0064
0065 int staggerX() const {
0066 return _staggerX;
0067 }
0068
0069 int staggerY() const {
0070 return _staggerY;
0071 }
0072
0073 const std::string& staggerKeyword() const {
0074 return _staggerKeyword;
0075 }
0076
0077 void setGridSizeX(double cellSize) {
0078 _gridSizeX = cellSize;
0079 }
0080
0081 void setGridSizeY(double cellSize) {
0082 _gridSizeY = cellSize;
0083 }
0084
0085 void setOffsetX(double offset) {
0086 _offsetX = offset;
0087 }
0088
0089 void setOffsetY(double offset) {
0090 _offsetY = offset;
0091 }
0092
0093 void setFieldNameX(const std::string& fieldName) {
0094 _xId = fieldName;
0095 }
0096
0097 void setFieldNameY(const std::string& fieldName) {
0098 _yId = fieldName;
0099 }
0100
0101 void setStaggerX(int staggerX) {
0102 _staggerX = staggerX;
0103 }
0104
0105 void setStaggerY(int staggerY) {
0106 _staggerY = staggerY;
0107 }
0108
0109 void setStaggerKeyword(const std::string& staggerKeyword) {
0110 _staggerKeyword = staggerKeyword;
0111 }
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121 virtual std::vector<double> cellDimensions(const CellID& cellID) const;
0122
0123 protected:
0124
0125 double _gridSizeX;
0126
0127 double _offsetX;
0128
0129 int _staggerX;
0130
0131 double _gridSizeY;
0132
0133 double _offsetY;
0134
0135 int _staggerY;
0136
0137 std::string _xId;
0138
0139 std::string _yId;
0140
0141 std::string _staggerKeyword;
0142 };
0143
0144 }
0145 }
0146 #endif