Mantid
Loading...
Searching...
No Matches
Functions
ComponentCreationHelper Namespace Reference

Functions

void 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 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 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 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::CSGObjectcreateCappedCylinder (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::CSGObjectcreateCuboid (double xHalfLength, double yHalfLength, double zHalfLength, double angle, const Mantid::Kernel::V3D &axis)
 Create a rotated cuboid shape. More...
 
std::shared_ptr< Mantid::Geometry::CSGObjectcreateCuboid (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 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 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::DetectorGroupcreateDetectorGroupWith5CylindricalDetectors ()
 Create a detector group containing 5 detectors. More...
 
std::shared_ptr< Mantid::Geometry::DetectorGroupcreateDetectorGroupWithNCylindricalDetectorsWithGaps (unsigned int nDet=4, double gap=0.01)
 Create a detector group containing n detectors with gaps. More...
 
Mantid::Geometry::Instrument_sptr createEmptyInstrument ()
 Creates a geometrically nonsensical virtual instrument to be populated with detectors later. More...
 
std::shared_ptr< Mantid::Geometry::CSGObjectcreateHollowCylinder (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::CSGObjectcreateHollowShell (double innerRadius, double outerRadius, const Mantid::Kernel::V3D &centre=Mantid::Kernel::V3D())
 Create a hollow shell, i.e. More...
 
Mantid::Geometry::Instrument_sptr createInstrumentWithOptionalComponents (bool haveSource, bool haveSample, bool haveDetector)
 
Mantid::Geometry::Instrument_sptr createInstrumentWithPSDTubes (const size_t nTubes=3, const size_t nPixelsPerTube=50, const bool mirrorTubes=false)
 
Mantid::Geometry::Instrument_sptr 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 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 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::DetectorGroupcreateRingOfCylindricalDetectors (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 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::CSGObjectcreateSphere (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::CompAssemblycreateTestAssemblyOfFourCylinders ()
 Create a component assembly at the origin made up of 4 cylindrical detectors. More...
 
Mantid::Geometry::Instrument_sptr 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 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 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 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 > > 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 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")
 
bool double_cmprsn (double x1, double x2)
 create instrument with cylindrical detectors located in specific positions More...
 
std::string 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...
 
CompAssemblymakeBank (size_t width, size_t height, Instrument *instrument)
 
Mantid::Geometry::Instrument_sptr sansInstrument (const Mantid::Kernel::V3D &sourcePos, const Mantid::Kernel::V3D &samplePos, const Mantid::Kernel::V3D &trolley1Pos, const Mantid::Kernel::V3D &trolley2Pos)
 
std::string sphereXML (double radius, const Mantid::Kernel::V3D &centre, const std::string &id)
 Return the XML for a sphere. More...
 

Function Documentation

◆ addRectangularBank()

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 
)

◆ addSampleToInstrument()

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.

Add a sample at samplePos to given instrument.

Definition at line 108 of file ComponentCreationHelper.cpp.

Referenced by createCylInstrumentWithDetInGivenPositions(), createCylInstrumentWithVerticalOffsetsSpecified(), createInstrumentWithPSDTubes(), createTestInstrumentCylindrical(), createTestInstrumentRectangular(), createTestInstrumentRectangular2(), createTestUnnamedRectangular2(), and sansInstrument().

◆ addSourceToInstrument()

void ComponentCreationHelper::addSourceToInstrument ( Mantid::Geometry::Instrument_sptr instrument,
const Mantid::Kernel::V3D sourcePos,
const std::string &  name = "moderator" 
)

◆ cappedCylinderXML()

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.

Return the XML for a capped cylinder.

Definition at line 53 of file ComponentCreationHelper.cpp.

References height, radius, Mantid::Kernel::V3D::X(), Mantid::Kernel::V3D::Y(), and Mantid::Kernel::V3D::Z().

Referenced by createCappedCylinder().

◆ createCappedCylinder()

std::shared_ptr< CSGObject > ComponentCreationHelper::createCappedCylinder ( double  radius,
double  height,
const Mantid::Kernel::V3D baseCentre,
const Mantid::Kernel::V3D axis,
const std::string &  id 
)

◆ createCuboid() [1/2]

std::shared_ptr< CSGObject > ComponentCreationHelper::createCuboid ( double  xHalfLength,
double  yHalfLength,
double  zHalfLength,
double  angle,
const Mantid::Kernel::V3D axis 
)

Create a rotated cuboid shape.

Create a cuboid shape rotated around supplied axis and centered at the origin.

Parameters
xHalfLengththickness
yHalfLengthwidth
zHalfLengthheight
anglerotation angle in radians
axisthe axis to rotate around
Returns
a pointer to the cuboid shape

Definition at line 187 of file ComponentCreationHelper.cpp.

References Mantid::Geometry::ShapeFactory::createShape(), Mantid::Kernel::Quat::getRotation(), and rotation.

◆ createCuboid() [2/2]

std::shared_ptr< CSGObject > ComponentCreationHelper::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.

Create a cuboid shape for your pixels.

Definition at line 171 of file ComponentCreationHelper.cpp.

References Mantid::Geometry::ShapeFactory::createShape(), and cuboidXML().

Referenced by InstrumentCreationHelper::addDetector().

◆ createCylInstrumentWithDetInGivenPositions()

Mantid::Geometry::Instrument_sptr ComponentCreationHelper::createCylInstrumentWithDetInGivenPositions ( const std::vector< double > &  L2,
const std::vector< double > &  polar,
const std::vector< double > &  azim 
)

◆ createCylInstrumentWithVerticalOffsetsSpecified()

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.

Vertical y offsets can be used to vertically offset individual tubes.

Parameters
nTubes:: number of tubes in the bank
verticalOffsets:: vertical offsets vector one element per tube. Fixed size to the number of tubes.
nDetsPerTube:: number of detector pixels per tube
xMin:: x-min for bank
xMax:: x-max for bank
yMin:: y-min for bank (use offsets to shift individual tubes)
yMax:: y-max for bank (use offsets to shift individual tubes)
Returns
Instrument with single bank as described by parameters.

Definition at line 383 of file ComponentCreationHelper.cpp.

References Mantid::Geometry::CompAssembly::add(), Mantid::Geometry::ObjCompAssembly::add(), addSampleToInstrument(), addSourceToInstrument(), createCappedCylinder(), Mantid::Geometry::ObjCompAssembly::createOutline(), Mantid::Geometry::Left, Mantid::Geometry::ObjCompAssembly::setOutline(), Mantid::Geometry::Component::setPos(), Mantid::Geometry::IComponent::setPos(), Mantid::Geometry::ObjComponent::shape(), tmp, std::to_string(), Mantid::Geometry::Y, and Mantid::Geometry::Z.

◆ createDetectorGroupWith5CylindricalDetectors()

std::shared_ptr< DetectorGroup > ComponentCreationHelper::createDetectorGroupWith5CylindricalDetectors ( )

Create a detector group containing 5 detectors.

Definition at line 253 of file ComponentCreationHelper.cpp.

References createCappedCylinder().

◆ createDetectorGroupWithNCylindricalDetectorsWithGaps()

std::shared_ptr< DetectorGroup > ComponentCreationHelper::createDetectorGroupWithNCylindricalDetectorsWithGaps ( unsigned int  nDet = 4,
double  gap = 0.01 
)

Create a detector group containing n detectors with gaps.

Create a detector group containing N cylindrical detectors with gaps.

Definition at line 273 of file ComponentCreationHelper.cpp.

References createCappedCylinder().

◆ createEmptyInstrument()

Instrument_sptr ComponentCreationHelper::createEmptyInstrument ( )

Creates a geometrically nonsensical virtual instrument to be populated with detectors later.

createEmptyInstrument, creates a geometrically nonsensical instrument specifically to be populated with detectors.

Components are added to satisfy basic checks in algorithms.

Definition at line 675 of file ComponentCreationHelper.cpp.

References createSphere(), Mantid::Geometry::Component::setPos(), and Mantid::Geometry::ObjComponent::setShape().

◆ createHollowCylinder()

std::shared_ptr< CSGObject > ComponentCreationHelper::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.

Definition at line 103 of file ComponentCreationHelper.cpp.

References Mantid::Geometry::ShapeFactory::createShape(), height, hollowCylinderXML(), and innerRadius.

◆ createHollowShell()

std::shared_ptr< CSGObject > ComponentCreationHelper::createHollowShell ( double  innerRadius,
double  outerRadius,
const Mantid::Kernel::V3D centre = Mantid::Kernel::V3D() 
)

Create a hollow shell, i.e.

the intersection of two spheres or radius r1 and r2

Definition at line 241 of file ComponentCreationHelper.cpp.

References Mantid::Geometry::ShapeFactory::createShape(), innerRadius, and sphereXML().

◆ createInstrumentWithOptionalComponents()

Instrument_sptr ComponentCreationHelper::createInstrumentWithOptionalComponents ( bool  haveSource,
bool  haveSample,
bool  haveDetector 
)

Definition at line 795 of file ComponentCreationHelper.cpp.

◆ createInstrumentWithPSDTubes()

Mantid::Geometry::Instrument_sptr ComponentCreationHelper::createInstrumentWithPSDTubes ( const size_t  nTubes = 3,
const size_t  nPixelsPerTube = 50,
const bool  mirrorTubes = false 
)

◆ createInstrumentWithSourceRotation()

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.

Rotate source and sample.

Beam direction is along Z, Up direction is Y

Parameters
sourcePos: V3D position
samplePos: V3D sample position
detectorPos: V3D detector position
relativeSourceRotation: Quat relative source rotation
Returns
Instrument generated.

Definition at line 897 of file ComponentCreationHelper.cpp.

References createSphere(), Mantid::Geometry::Left, Mantid::Geometry::Component::setPos(), Mantid::Geometry::Component::setRot(), Mantid::Geometry::ObjComponent::setShape(), Mantid::Geometry::Y, and Mantid::Geometry::Z.

◆ createMinimalInstrument()

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.

createMinimalInstrument, creates the most simple possible definition of an instrument in which we can extract a valid L1 and L2 distance for unit calculations.

Beam direction is along X, Up direction is Y

Parameters
sourcePos: V3D position
samplePos: V3D sample position
detectorPos: V3D detector position
Returns
Instrument generated.

Definition at line 708 of file ComponentCreationHelper.cpp.

References createSphere(), Mantid::Geometry::Left, Mantid::Geometry::Component::setPos(), Mantid::Geometry::ObjComponent::setShape(), Mantid::Geometry::X, and Mantid::Geometry::Y.

◆ createMinimalInstrumentWithMonitor()

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.

Beam direction is along X, Up direction is Y

Parameters
monitorPos: V3D monitor position
monitorRot: V3D monitor rotation
Returns
Instrument generated.

Definition at line 748 of file ComponentCreationHelper.cpp.

References createSphere(), Mantid::Geometry::Left, Mantid::Geometry::X, and Mantid::Geometry::Y.

◆ createRingOfCylindricalDetectors()

std::shared_ptr< DetectorGroup > ComponentCreationHelper::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.

Create a group of detectors arranged in a ring;.

Definition at line 328 of file ComponentCreationHelper.cpp.

References createVectorOfCylindricalDetectors().

◆ createSimpleInstrumentWithRotation()

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.

Beam direction is along Z, Up direction is Y

Parameters
sourcePos: V3D position
samplePos: V3D sample position
detectorPos: V3D detector bank position
relativeBankRotation: Quat relative bank rotation
relativeDetRotation: Quat relative detector rotation
detOffset: V3D offset of detector from bank
Returns
Instrument generated.

Definition at line 842 of file ComponentCreationHelper.cpp.

References createSphere(), Mantid::Geometry::Left, Mantid::Geometry::Component::setPos(), Mantid::Geometry::Component::setRot(), Mantid::Geometry::ObjComponent::setShape(), Mantid::Geometry::Y, and Mantid::Geometry::Z.

◆ createSphere()

std::shared_ptr< CSGObject > ComponentCreationHelper::createSphere ( double  radius,
const Mantid::Kernel::V3D centre = Mantid::Kernel::V3D(),
const std::string &  id = "sp-1" 
)

◆ createTestAssemblyOfFourCylinders()

std::shared_ptr< CompAssembly > ComponentCreationHelper::createTestAssemblyOfFourCylinders ( )

Create a component assembly at the origin made up of 4 cylindrical detectors.

Definition at line 222 of file ComponentCreationHelper.cpp.

References createCappedCylinder(), and Mantid::Geometry::Component::setPos().

◆ createTestInstrumentCylindrical()

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.

Detectors have IDs assigned as follows: 7 8 9 4 5 6 1 2 3

Parameters
num_banks:: number of 9-cylinder banks to create
sourcePos:: Position of the source component
samplePos:: Position of the sample component.
cylRadius:: radius of each detector
cylHeight:: height of each detector
Returns
Created instrument

Definition at line 339 of file ComponentCreationHelper.cpp.

References Mantid::Geometry::CompAssembly::add(), addSampleToInstrument(), addSourceToInstrument(), createCappedCylinder(), and Mantid::Geometry::Component::setPos().

Referenced by MuonWorkspaceCreationHelper::createCountsWorkspace(), WorkspaceCreationHelper::createEventWorkspaceWithNonUniformInstrument(), WorkspaceCreationHelper::createGroupedWorkspace2D(), and WorkspaceCreationHelper::createGroupedWorkspace2DWithRingsAndBoxes().

◆ createTestInstrumentRectangular()

Instrument_sptr ComponentCreationHelper::createTestInstrumentRectangular ( int  num_banks,
int  pixels,
double  pixelSpacing,
double  bankDistanceFromSample,
bool  addMonitor 
)

Create a test instrument with n panels of rectangular detectors, pixels*pixels in size, a source and spherical sample shape.

Create an test instrument with n panels of rectangular detectors, pixels*pixels in size, a source and spherical sample shape.

Banks' lower-left corner is at position (0,0,5*banknum) and they go up to (pixels*0.008, pixels*0.008, Z) Pixels are 4 mm wide.

Parameters
num_banks:: number of rectangular banks to create
pixels:: number of pixels in each direction.
pixelSpacing:: padding between pixels
bankDistanceFromSample:: How far the bank is from the sample
addMonitor:: whether to add a monitor detector to the instrument

Definition at line 540 of file ComponentCreationHelper.cpp.

References addRectangularBank(), addSampleToInstrument(), and addSourceToInstrument().

Referenced by WorkspaceCreationHelper::create2DWorkspaceWithRectangularInstrument(), WorkspaceCreationHelper::createEventWorkspaceWithFullInstrument(), and Mantid::SingleCrystalDiffractionTestHelper::WorkspaceBuilder::createInstrument().

◆ createTestInstrumentRectangular2()

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.

Banks are centered at (1*banknum, 0, 0) and are facing 0,0. Pixels are 4 mm wide.

Parameters
num_banksnumber of rectangular banks to create
pixels: number of pixels in each direction.
pixelSpacing: padding between pixels

Definition at line 578 of file ComponentCreationHelper.cpp.

References addSampleToInstrument(), addSourceToInstrument(), createCappedCylinder(), Mantid::Geometry::x, and Mantid::Geometry::y.

Referenced by WorkspaceCreationHelper::createEventWorkspaceWithFullInstrument2(), and WorkspaceCreationHelper::createPeaksWorkspace().

◆ createTestUnnamedRectangular2()

Instrument_sptr ComponentCreationHelper::createTestUnnamedRectangular2 ( int  num_banks,
int  pixels,
double  pixelSpacing 
)

Create an test instrument with multiple nameless banks.

Used for testing behaviour of name handling implementation in saveInstrument

Banks are centered at (1*banknum, 0, 0) and are facing 0,0. Pixels are 4 mm wide.

Parameters
num_banksnumber of rectangular banks to create
pixels:: number of pixels in each direction.
pixelSpacing:: padding between pixels

Definition at line 630 of file ComponentCreationHelper.cpp.

References addSampleToInstrument(), addSourceToInstrument(), createCappedCylinder(), Mantid::Geometry::RectangularDetector::getAtXY(), Mantid::Geometry::RectangularDetector::initialize(), Mantid::Geometry::IComponent::setPos(), Mantid::Geometry::IComponent::setRot(), Mantid::Geometry::x, and Mantid::Geometry::y.

◆ createVectorOfCylindricalDetectors()

std::vector< std::unique_ptr< 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.

Definition at line 289 of file ComponentCreationHelper.cpp.

References createCappedCylinder(), Mantid::Geometry::x, and Mantid::Geometry::y.

Referenced by createRingOfCylindricalDetectors().

◆ cuboidXML()

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" 
)

Definition at line 137 of file ComponentCreationHelper.cpp.

References Mantid::Kernel::V3D::X().

Referenced by createCuboid().

◆ double_cmprsn()

bool ComponentCreationHelper::double_cmprsn ( double  x1,
double  x2 
)

create instrument with cylindrical detectors located in specific positions

Definition at line 427 of file ComponentCreationHelper.cpp.

References TOL.

Referenced by createCylInstrumentWithDetInGivenPositions().

◆ hollowCylinderXML()

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.

Definition at line 85 of file ComponentCreationHelper.cpp.

References height, innerRadius, Mantid::Kernel::V3D::X(), Mantid::Kernel::V3D::Y(), and Mantid::Kernel::V3D::Z().

Referenced by createHollowCylinder().

◆ makeBank()

CompAssembly * ComponentCreationHelper::makeBank ( size_t  width,
size_t  height,
Instrument instrument 
)

◆ sansInstrument()

Instrument_sptr ComponentCreationHelper::sansInstrument ( const Mantid::Kernel::V3D sourcePos,
const Mantid::Kernel::V3D samplePos,
const Mantid::Kernel::V3D trolley1Pos,
const Mantid::Kernel::V3D trolley2Pos 
)

◆ sphereXML()

std::string ComponentCreationHelper::sphereXML ( double  radius,
const Mantid::Kernel::V3D centre,
const std::string &  id 
)

Return the XML for a sphere.

Definition at line 120 of file ComponentCreationHelper.cpp.

References radius, Mantid::Kernel::V3D::X(), Mantid::Kernel::V3D::Y(), and Mantid::Kernel::V3D::Z().

Referenced by createHollowShell(), and createSphere().