File indexing completed on 2025-07-11 07:52:11
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include <DDSegmentation/CartesianStripX.h>
0018
0019 namespace dd4hep {
0020 namespace DDSegmentation {
0021
0022 CartesianStripX::CartesianStripX(const std::string& cellEncoding) : CartesianStrip(cellEncoding) {
0023
0024 _type = "CartesianStripX";
0025 _description = "Cartesian segmentation on the local X axis";
0026
0027
0028 registerParameter("strip_size_x", "Cell size in X", _stripSizeX, 1., SegmentationParameter::LengthUnit);
0029 registerParameter("offset_x", "Cell offset in X", _offsetX, 0., SegmentationParameter::LengthUnit, true);
0030 registerIdentifier("identifier_x", "Cell ID identifier for X", _xId, "strip");
0031 }
0032
0033
0034 CartesianStripX::CartesianStripX(const BitFieldCoder* decode) : CartesianStrip(decode) {
0035
0036 _type = "CartesianStripX";
0037 _description = "Cartesian segmentation on the local X axis";
0038
0039
0040 registerParameter("strip_size_x", "Cell size in X", _stripSizeX, 1., SegmentationParameter::LengthUnit);
0041 registerParameter("offset_x", "Cell offset in X", _offsetX, 0., SegmentationParameter::LengthUnit, true);
0042 registerIdentifier("identifier_x", "Cell ID identifier for X", _xId, "strip");
0043 }
0044
0045
0046 CartesianStripX::~CartesianStripX() {}
0047
0048
0049 Vector3D CartesianStripX::position(const CellID& cID) const {
0050 Vector3D cellPosition;
0051 cellPosition.X = binToPosition(_decoder->get(cID, _xId), _stripSizeX, _offsetX);
0052 return cellPosition;
0053 }
0054
0055
0056 CellID CartesianStripX::cellID(const Vector3D& localPosition, const Vector3D& ,
0057 const VolumeID& vID) const {
0058 CellID cID = vID;
0059 _decoder->set(cID, _xId, positionToBin(localPosition.X, _stripSizeX, _offsetX));
0060 return cID;
0061 }
0062
0063 std::vector<double> CartesianStripX::cellDimensions(const CellID&) const {
0064 return {_stripSizeX};
0065 }
0066
0067 }
0068 }