22 SimulationArea::SimulationArea(
const IDetector* detector) : m_detector(detector), m_max_index(0)
24 if (m_detector ==
nullptr)
25 throw std::runtime_error(
"SimulationArea::SimulationArea: null pointer passed"
28 if (m_detector->dimension() == 0)
29 throw std::runtime_error(
30 "SimulationArea::SimulationArea: detector of unspecified dimensionality");
32 if (m_detector->regionOfInterest())
33 m_max_index = m_detector->regionOfInterest()->roiSize();
35 m_max_index = m_detector->totalSize();
51 return (masks && masks->hasMasks() && masks->isMasked(
detectorIndex(index)));
Defines class DetectorMask.
Defines common detector interface.
Defines class RegionOfInterest.
Defines class SimulationArea.
Abstract detector interface.
virtual const DetectorMask * detectorMask() const =0
Returns detector masks container.
virtual const RegionOfInterest * regionOfInterest() const =0
Returns region of interest if exists.
size_t detectorIndex(size_t roiIndex) const
Converts roi index to the detector index.
An iterator for SimulationArea.
Holds iteration logic over active detector channels in the presence of masked areas and RegionOfInter...
virtual bool isMasked(size_t index) const
returns true if given iterator index correspond to masked detector channel
size_t detectorIndex(size_t index) const
Return detector index from iterator index.
size_t roiIndex(size_t index) const
Return index in ROI map from iterator index.
virtual bool isMasked(size_t) const
returns true if given iterator index correspond to masked detector channel