8#include "MantidGeometry/DllConfig.h"
20class ComponentVisitor;
38 std::string
type()
const override {
return "GridDetector"; }
47 static bool compareName(
const std::string &proposedMatch);
50 void initialize(std::shared_ptr<IObject> shape,
int xpixels,
double xstart,
double xstep,
int ypixels,
double ystart,
51 double ystep,
int zpixels,
double zstart,
double zstep,
int idstart,
const std::string &idFillOrder,
52 int idstepbyrow,
int idstep = 1);
57 std::shared_ptr<Detector> getAtXYZ(
const int x,
const int y,
const int z)
const;
59 detid_t getDetectorIDAtXYZ(
const int x,
const int y,
const int z)
const;
60 std::tuple<int, int, int> getXYZForDetectorID(
const detid_t detectorID)
const;
70 double xstart()
const;
71 double ystart()
const;
72 double zstart()
const;
82 bool idfillbyfirst_y()
const;
83 std::string idFillOrder()
const;
84 int idstepbyrow()
const;
87 Kernel::V3D getRelativePosAtXYZ(
int x,
int y,
int z)
const;
92 std::shared_ptr<const IComponent> getComponentByName(
const std::string &cname,
int nlevels = 0)
const override;
97 using CompAssembly::getBoundingBox;
99 void testIntersectionWithChildren(
Track &testRay, std::deque<IComponent_const_sptr> &searchQueue)
const override;
104 bool isValid(
const Kernel::V3D &point)
const override;
107 bool isOnSide(
const Kernel::V3D &point)
const override;
110 int interceptSurface(
Track &track)
const override;
116 void getBoundingBox(
BoundingBox &assemblyBox)
const override;
119 int getPointInObject(
Kernel::V3D &point)
const override;
123 void draw()
const override;
126 void drawObject()
const override;
130 void initDraw()
const override;
133 const std::shared_ptr<const IObject> shape()
const override;
137 virtual size_t registerContents(
class ComponentVisitor &componentVisitor)
const override;
143 void createLayer(
const std::string &
name,
CompAssembly *parent,
int iz,
int &minDetID,
int &maxDetID);
146 void initializeValues(std::shared_ptr<IObject> shape,
int xpixels,
double xstart,
double xstep,
int ypixels,
147 double ystart,
double ystep,
int zpixels,
double zstart,
double zstep,
int idstart,
148 const std::string &idFillOrder,
int idstepbyrow,
int idstep);
150 void validateInput()
const;
A simple structure that defines an axis-aligned cuboid shaped bounding box for a geometrical object.
Class for Assembly of geometric components.
ComponentVisitor : Visitor for IComponents.
GridrDetectorPixel: a sub-class of Detector that is one pixel inside a GridDetector.
GridDetector is a type of CompAssembly, an assembly of components.
double m_zstart
Z position of the 0-th pixel.
bool m_idfillbyfirst_y
IDs are filled in Y fastest.
int m_xpixels
The number of pixels in the X (horizontal) direction.
double m_ysize
Size in Y of the detector.
std::shared_ptr< IObject > m_shape
Pointer to the shape of the pixels in this detector array.
int m_ypixels
The number of pixels in the Y (vertical) direction.
double m_ystart
Y position of the 0-th pixel.
int m_idstep
Step size in ID in each col.
double m_zstep
Step size in the Z direction of the detector.
GridDetector & operator=(const ICompAssembly &)
Private copy assignment operator.
detid_t m_minDetId
minimum detector id
double m_ystep
Step size in the Y direction of detector.
double m_xsize
Size in X of the detector.
std::string m_idFillOrder
The order in which to fill IDs.
const GridDetector * m_gridBase
Pointer to the base GridDetector, for parametrized instruments.
double m_xstart
X position of the 0-th pixel.
double m_zsize
Size in Z of the detector.
int m_idstart
IDs start here.
std::string type() const override
String description of the type of component.
double m_xstep
Step size in the X direction of detector.
int m_idstepbyrow
Step size in ID in each row.
int m_zpixels
The number of pixels in the Z (usually beam) direction.
detid_t m_maxDetId
maximum detector id
Class for Assembly of geometric components.
base class for Geometric IComponent
Object Component class, this class brings together the physical attributes of the component to the po...
Defines a track as a start point and a direction.
A material is defined as being composed of a given element, defined as a PhysicalConstants::NeutronAt...
std::shared_ptr< const GridDetector > GridDetector_const_sptr
MANTID_GEOMETRY_DLL std::ostream & operator<<(std::ostream &stream, const PointGroup &self)
Returns a streamed representation of the PointGroup object.
std::shared_ptr< GridDetector > GridDetector_sptr
Helper class which provides the Collimation Length for SANS instruments.
int32_t detid_t
Typedef for a detector ID.