29 m_detection_properties(other.m_detection_properties)
58 throw std::runtime_error(
"Error in IDetector::getAxis: not so many axes in this detector.");
64 size_t remainder(index);
66 for (
size_t i = 0; i < dim; ++i) {
68 if (selected_axis == i_axis)
69 return remainder %
m_axes[i_axis]->size();
70 remainder /=
m_axes[i_axis]->size();
72 throw std::runtime_error(
"IDetector::getAxisBinIndex() -> "
73 "Error! No axis with given number");
83 "IDetector::createAxis() -> Error! Number n_bins can't be zero.");
84 return std::make_unique<FixedBinAxis>(
axisName(index), n_bins, min, max);
93 for (
size_t i_axis = 0; i_axis < dim; ++i_axis)
94 result *=
m_axes[i_axis]->size();
99 double total_transmission)
119 if (!p_intensity_map)
120 throw std::runtime_error(
"IDetector::applyDetectorResolution() -> "
121 "Error! Null pointer to intensity map");
127 buff->copyShapeFrom(*p_intensity_map);
153 "can't create detector map.");
159 return detectorMap.release();
166 throw std::runtime_error(
167 "Error in IDetector::createDetectorMap: dimensions of the detector are undefined");
170 for (
size_t i = 0; i < dim; ++i)
172 result->addAxis(*roi->clipAxisToRoi(i,
getAxis(i)));
180 const std::vector<SimulationElement>& elements)
const
182 if (elements.empty())
Defines class ConvolutionDetectorResolution.
Defines class DetectorMask.
Defines common detector interface.
Defines class RegionOfInterest.
Defines class SimulationArea.
Defines class SimulationElement.
Convolutes the intensity in 1 or 2 dimensions with a resolution function.
void setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission)
Sets the polarization analyzer characteristics of the detector.
Interface for one-dimensional axes.
virtual IAxis * clone() const =0
clone function
Interface for polymorphic classes that should not be copied, except by explicit cloning.
Interface for detector resolution algorithms.
virtual IDetectorResolution * clone() const =0
Abstract detector interface.
void setDataToDetectorMap(OutputData< double > &detectorMap, const std::vector< SimulationElement > &elements) const
void applyDetectorResolution(OutputData< double > *p_intensity_map) const
Applies the detector resolution to the given intensity maps.
std::unique_ptr< IDetectorResolution > mP_detector_resolution
virtual std::string axisName(size_t index) const =0
Returns the name for the axis with given index.
virtual const DetectorMask * detectorMask() const =0
Returns detector masks container.
size_t dimension() const
Returns actual dimensionality of the detector (number of defined axes)
size_t axisBinIndex(size_t index, size_t selected_axis) const
Calculate axis index for given global index.
virtual std::unique_ptr< IAxis > createAxis(size_t index, size_t n_bins, double min, double max) const
Generates an axis with correct name and default binning for given index.
std::vector< const INode * > getChildren() const override
Returns a vector of children (const).
size_t totalSize() const
Returns total number of pixels.
size_t numberOfSimulationElements() const
Returns number of simulation elements.
const IAxis & getAxis(size_t index) const
void setResolutionFunction(const IResolutionFunction2D &resFunc)
DetectionProperties m_detection_properties
CloneableVector< IAxis > m_axes
void setAnalyzerProperties(const kvector_t direction, double efficiency, double total_transmission)
Sets the polarization analyzer characteristics of the detector.
void addAxis(const IAxis &axis)
OutputData< double > * createDetectorIntensity(const std::vector< SimulationElement > &elements) const
Returns new intensity map with detector resolution applied.
void setDetectorResolution(const IDetectorResolution &p_detector_resolution)
Sets the detector resolution.
std::unique_ptr< OutputData< double > > createDetectorMap() const
Returns empty detector map in given axes units.
void iterate(std::function< void(const_iterator)> func, bool visit_masks=false) const
const IDetectorResolution * detectorResolution() const
Returns a pointer to detector resolution object.
void removeDetectorResolution()
Removes detector resolution function.
virtual const RegionOfInterest * regionOfInterest() const =0
Returns region of interest if exists.
Base class for tree-like structures containing parameterized objects.
void registerChild(INode *node)
const std::string & getName() const
void setName(const std::string &name)
Interface providing two-dimensional resolution function.
void setRawDataVector(const std::vector< T > &data_vector)
Sets new values to raw data vector.
An iterator for SimulationArea.
size_t elementIndex() const
Holds iteration logic over active detector channels in the presence of masked areas and RegionOfInter...
SimulationAreaIterator begin()
SimulationAreaIterator end()
Holds iteration logic over active detector channels in the presence of ROI.