22 setName(
"Instrument");
23 registerChild(m_detector.get());
24 registerChild(&m_beam);
27 Instrument::Instrument(
const Instrument& other) :
INode(), m_beam(other.m_beam)
30 setDetector(*other.m_detector);
31 registerChild(&m_beam);
32 setName(other.getName());
35 Instrument::~Instrument() =
default;
40 m_beam = other.m_beam;
41 registerChild(&m_beam);
50 m_detector.reset(detector.clone());
51 registerChild(m_detector.get());
59 "Instrument::initDetector() -> Error. Detector is not initialized.");
60 m_detector->init(getBeam());
65 std::vector<const INode*> result;
66 result.push_back(&m_beam);
68 result.push_back(m_detector.get());
74 m_detector->setResolutionFunction(p_resolution_function);
79 m_detector->removeDetectorResolution();
84 m_detector->applyDetectorResolution(p_intensity_map);
96 return m_detector->detectorMask();
99 void Instrument::setBeam(
const Beam& beam)
106 void Instrument::setBeamIntensity(
double intensity)
116 double Instrument::getBeamIntensity()
const
121 const IDetector* Instrument::getDetector()
const
124 return m_detector.get();
127 const IDetector& Instrument::detector()
const
144 throw std::runtime_error(
"Error: Detector is not twodimensional");
153 throw std::runtime_error(
"Error: Detector is not twodimensional");
157 const IAxis& Instrument::getDetectorAxis(
size_t index)
const
159 return m_detector->getAxis(index);
162 size_t Instrument::getDetectorDimension()
const
164 return m_detector->dimension();
168 double total_transmission)
170 m_detector->setAnalyzerProperties(direction, efficiency, total_transmission);
Defines class Histogram2D.
Defines interface class IResolutionFunction2D.
Defines class Instrument.
Defines class SphericalDetector.
Beam defined by wavelength, direction and intensity.
void setPolarization(const kvector_t bloch_vector)
Sets the polarization density matrix according to the given Bloch vector.
void setIntensity(double intensity)
Sets the beam intensity in neutrons/sec.
double getIntensity() const
Returns the beam intensity in neutrons/sec.
void setCentralK(double wavelength, double alpha_i, double phi_i)
Sets the wavevector in terms of wavelength and incoming angles.
Collection of detector masks.
Interface for one-dimensional axes.
Abstract 2D detector interface.
Abstract detector interface.
Base class for tree-like structures containing parameterized objects.
Interface providing two-dimensional resolution function.
Assembles beam, detector and their relative positions with respect to the sample.
void applyDetectorResolution(OutputData< double > *p_intensity_map) const
apply the detector resolution to the given intensity map
void setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission)
Sets the polarization analyzer characteristics of the detector.
void setBeamParameters(double wavelength, double alpha_i, double phi_i)
Sets the beam wavelength and incoming angles.
void setDetector(const IDetector &detector)
Sets the detector (axes can be overwritten later)
void setDetectorResolutionFunction(const IResolutionFunction2D &p_resolution_function)
Sets detector resolution function.
void initDetector()
init detector with beam settings
void removeDetectorResolution()
Removes detector resolution function.
std::vector< const INode * > getChildren() const
Returns a vector of children (const).
void setBeamPolarization(const kvector_t bloch_vector)
Sets the beam's polarization according to the given Bloch vector.
A spherical detector with axes and resolution function.