Skip to content
Snippets Groups Projects
Commit e783ce0c authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

c'tor -> initializer list; make members const

parent 1cafb436
No related branches found
No related tags found
1 merge request!1142simplify ISimulation2D and IDetector, improve comments
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
#include "Device/Detector/IDetector.h" #include "Device/Detector/IDetector.h"
DetectorContext::DetectorContext(const IDetector* detector) DetectorContext::DetectorContext(const IDetector* detector)
: m_analyzer_operator(detector->analyzer().matrix())
, m_active_indices(detector->active_indices())
{ {
m_active_indices = detector->active_indices();
m_analyzer_operator = detector->analyzer().matrix();
m_pixels.reserve(m_active_indices.size()); m_pixels.reserve(m_active_indices.size());
for (auto detector_index : m_active_indices) for (auto detector_index : m_active_indices)
m_pixels.emplace_back(detector->createPixel(detector_index)); m_pixels.emplace_back(detector->createPixel(detector_index));
......
...@@ -40,9 +40,9 @@ public: ...@@ -40,9 +40,9 @@ public:
size_t detectorIndex(size_t element_index) const; size_t detectorIndex(size_t element_index) const;
private: private:
SpinMatrix m_analyzer_operator; const SpinMatrix m_analyzer_operator;
const std::vector<size_t> m_active_indices; //! The sequence of bin indices (unmasked, in ROI)
OwningVector<const IPixel> m_pixels; //! All unmasked pixels inside ROI. OwningVector<const IPixel> m_pixels; //! All unmasked pixels inside ROI.
std::vector<size_t> m_active_indices; //! The sequence of bin indices (unmasked, in ROI)
}; };
#endif // BORNAGAIN_DEVICE_DETECTOR_DETECTORCONTEXT_H #endif // BORNAGAIN_DEVICE_DETECTOR_DETECTORCONTEXT_H
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment