Mantid
Loading...
Searching...
No Matches
Namespaces | Functions
ComponentCreationHelper.h File Reference
#include "MantidGeometry/Instrument.h"
#include "MantidGeometry/Instrument/Detector.h"
#include "MantidGeometry/Objects/CSGObject.h"
#include "MantidKernel/V3D.h"
#include <memory>

Go to the source code of this file.

Namespaces

namespace  ComponentCreationHelper
 
namespace  Mantid
 Helper class which provides the Collimation Length for SANS instruments.
 
namespace  Mantid::Geometry
 
namespace  Mantid::Kernel
 

Functions

void ComponentCreationHelper::addRectangularBank (Mantid::Geometry::Instrument &testInstrument, int idStart, int pixels, double pixelSpacing, const std::string &bankName, const Mantid::Kernel::V3D &bankPos, const Mantid::Kernel::Quat &bankRot)
 
void ComponentCreationHelper::addSampleToInstrument (Mantid::Geometry::Instrument_sptr &instrument, const Mantid::Kernel::V3D &samplePos)
 A set of helper functions for creating various component structures for the unit tests. More...
 
void ComponentCreationHelper::addSourceToInstrument (Mantid::Geometry::Instrument_sptr &instrument, const Mantid::Kernel::V3D &sourcePos, const std::string &name="moderator")
 Add a source with given name and sourcePos to given instrument. More...
 
std::string ComponentCreationHelper::cappedCylinderXML (double radius, double height, const Mantid::Kernel::V3D &baseCentre, const Mantid::Kernel::V3D &axis, const std::string &id)
 Return the appropriate XML for the requested cylinder. More...
 
std::shared_ptr< Mantid::Geometry::CSGObjectComponentCreationHelper::createCappedCylinder (double radius, double height, const Mantid::Kernel::V3D &baseCentre, const Mantid::Kernel::V3D &axis, const std::string &id)
 Create a capped cylinder object. More...
 
std::shared_ptr< Mantid::Geometry::CSGObjectComponentCreationHelper::createCuboid (double xHalfLength, double yHalfLength, double zHalfLength, double angle, const Mantid::Kernel::V3D &axis)
 Create a rotated cuboid shape. More...
 
std::shared_ptr< Mantid::Geometry::CSGObjectComponentCreationHelper::createCuboid (double xHalfLength, double yHalfLength=-1.0, double zHalfLength=-1.0, const Mantid::Kernel::V3D &centre={0.0, 0.0, 0.0}, const std::string &id="detector-shape")
 Create a cuboid shape. More...
 
Mantid::Geometry::Instrument_sptr ComponentCreationHelper::createCylInstrumentWithDetInGivenPositions (const std::vector< double > &L2, const std::vector< double > &polar, const std::vector< double > &azim)
 create instrument with cylindrical detectors located in specific angular positions More...
 
Mantid::Geometry::Instrument_sptr ComponentCreationHelper::createCylInstrumentWithVerticalOffsetsSpecified (size_t nTubes, std::vector< double > verticalOffsets, size_t nDetsPerTube, double xMin, double xMax, double yMin, double yMax)
 Creates a single flat bank with cylindrical (tubes) of detectors. More...
 
std::shared_ptr< Mantid::Geometry::DetectorGroupComponentCreationHelper::createDetectorGroupWith5CylindricalDetectors ()
 Create a detector group containing 5 detectors. More...
 
std::shared_ptr< Mantid::Geometry::DetectorGroupComponentCreationHelper::createDetectorGroupWithNCylindricalDetectorsWithGaps (unsigned int nDet=4, double gap=0.01)
 Create a detector group containing n detectors with gaps. More...
 
Mantid::Geometry::Instrument_sptr ComponentCreationHelper::createEmptyInstrument ()
 Creates a geometrically nonsensical virtual instrument to be populated with detectors later. More...
 
std::shared_ptr< Mantid::Geometry::CSGObjectComponentCreationHelper::createHollowCylinder (double innerRadius, double outerRadius, double height, const Mantid::Kernel::V3D &baseCentre, const Mantid::Kernel::V3D &axis, const std::string &id)
 Create a hollow cylinder object. More...
 
std::shared_ptr< Mantid::Geometry::CSGObjectComponentCreationHelper::createHollowShell (double innerRadius, double outerRadius, const Mantid::Kernel::V3D &centre=Mantid::Kernel::V3D())
 Create a hollow shell, i.e. More...
 
Mantid::Geometry::Instrument_sptr ComponentCreationHelper::createInstrumentWithOptionalComponents (bool haveSource, bool haveSample, bool haveDetector)
 
Mantid::Geometry::Instrument_sptr ComponentCreationHelper::createInstrumentWithPSDTubes (const size_t nTubes=3, const size_t nPixelsPerTube=50, const bool mirrorTubes=false)
 
Mantid::Geometry::Instrument_sptr ComponentCreationHelper::createInstrumentWithSourceRotation (const Mantid::Kernel::V3D &sourcePos, const Mantid::Kernel::V3D &samplePos, const Mantid::Kernel::V3D &detectorPos, const Mantid::Kernel::Quat &relativeSourceRotation)
 createInstrumentWithSourceRotation, from createSimpleInstrumentWithRotation. More...
 
Mantid::Geometry::Instrument_sptr ComponentCreationHelper::createMinimalInstrument (const Mantid::Kernel::V3D &sourcePos, const Mantid::Kernel::V3D &samplePos, const Mantid::Kernel::V3D &detectorPos)
 Creates a mimimal valid virtual instrument. More...
 
Mantid::Geometry::Instrument_sptr ComponentCreationHelper::createMinimalInstrumentWithMonitor (const Mantid::Kernel::V3D &monitorPos, const Mantid::Kernel::Quat &monitorRot)
 createMinimalInstrumentWithMonitor, creates the most simple possible definition of an instrument with a Monitor. More...
 
std::shared_ptr< Mantid::Geometry::DetectorGroupComponentCreationHelper::createRingOfCylindricalDetectors (const double R_min=4.5, const double R_max=5, const double z000000000000000=4)
 Create a detector group containing detectors ring R_min – min radius of the ring R_max – max radius of the ring, center has to be in 0 position, z – axial z-coordinate of the detectors position; The detectors are the cylinders with 1.5cm height and 0.5 cm radius. More...
 
Mantid::Geometry::Instrument_sptr ComponentCreationHelper::createSimpleInstrumentWithRotation (const Mantid::Kernel::V3D &sourcePos, const Mantid::Kernel::V3D &samplePos, const Mantid::Kernel::V3D &detectorPos, const Mantid::Kernel::Quat &relativeBankRotation, const Mantid::Kernel::Quat &relativeDetRotation, const Mantid::Kernel::V3D &detOffset)
 createSimpleInstrumentWithRotation, creates the most simple possible definition of an instrument in which we can extract a valid L1 and L2 distance for unit calculations. More...
 
std::shared_ptr< Mantid::Geometry::CSGObjectComponentCreationHelper::createSphere (double radius, const Mantid::Kernel::V3D &centre=Mantid::Kernel::V3D(), const std::string &id="sp-1")
 Create a sphere object. More...
 
std::shared_ptr< Mantid::Geometry::CompAssemblyComponentCreationHelper::createTestAssemblyOfFourCylinders ()
 Create a component assembly at the origin made up of 4 cylindrical detectors. More...
 
Mantid::Geometry::Instrument_sptr ComponentCreationHelper::createTestInstrumentCylindrical (int num_banks, const Mantid::Kernel::V3D &sourcePos=Mantid::Kernel::V3D(0.0, 0.0, -10.), const Mantid::Kernel::V3D &samplePos=Mantid::Kernel::V3D(), const double cylRadius=0.004, const double cylHeight=0.0002)
 Create an test instrument with n panels of 9 cylindrical detectors, a source and a sample position. More...
 
Mantid::Geometry::Instrument_sptr ComponentCreationHelper::createTestInstrumentRectangular (int num_banks, int pixels, double pixelSpacing=0.008, double bankDistanceFromSample=5.0, bool addMonitor=false)
 Create a test instrument with n panels of rectangular detectors, pixels*pixels in size, a source and spherical sample shape. More...
 
Mantid::Geometry::Instrument_sptr ComponentCreationHelper::createTestInstrumentRectangular2 (int num_banks, int pixels, double pixelSpacing)
 Create an test instrument with n panels of rectangular detectors, pixels*pixels in size, a source and spherical sample shape. More...
 
Mantid::Geometry::Instrument_sptr ComponentCreationHelper::createTestUnnamedRectangular2 (int num_banks, int pixels, double pixelSpacing)
 Create an test instrument with multiple nameless banks. More...
 
std::vector< std::unique_ptr< Mantid::Geometry::IDetector > > ComponentCreationHelper::createVectorOfCylindricalDetectors (const double R_min=4.5, const double R_max=5, const double z000000000000000=4)
 Create a detector vector containing detectors ring R_min – min radius of the ring R_max – max radius of the ring, center has to be in 0 position, z – axial z-coordinate of the detectors position; The detectors are the cylinders with 1.5cm height and 0.5 cm radius. More...
 
std::string ComponentCreationHelper::cuboidXML (double xHalfLength, double yHalfLength=-1.0, double zHalfLength=-1.0, const Mantid::Kernel::V3D &centre={0.0, 0.0, 0.0}, const std::string &id="detector-shape")
 
std::string ComponentCreationHelper::hollowCylinderXML (double innerRadius, double outerRadius, double height, const Mantid::Kernel::V3D &baseCentre, const Mantid::Kernel::V3D &axis, const std::string &id)
 Return the XML for a hollow cylinder. More...
 
Mantid::Geometry::Instrument_sptr ComponentCreationHelper::sansInstrument (const Mantid::Kernel::V3D &sourcePos, const Mantid::Kernel::V3D &samplePos, const Mantid::Kernel::V3D &trolley1Pos, const Mantid::Kernel::V3D &trolley2Pos)
 
std::string ComponentCreationHelper::sphereXML (double radius, const Mantid::Kernel::V3D &centre, const std::string &id)
 Return the XML for a sphere. More...