10#include <boost/python/class.hpp>
18 if (PyErr_Warn(PyExc_DeprecationWarning,
"'DetectorGroup::isMasked' is deprecated, "
19 "use 'SpectrumInfo::isMasked' instead.") < 0)
20 throw boost::python::error_already_set();
23 for (
const auto &det : dets) {
24 const auto &detInfo = det->parameterMap().detectorInfo();
25 masked &= detInfo.isMasked(det->index());
31 if (PyErr_Warn(PyExc_DeprecationWarning,
"'DetectorGroup::isMonitor' is "
33 "'SpectrumInfo::isMonitor' instead.") < 0)
34 throw boost::python::error_already_set();
36 return std::all_of(dets.cbegin(), dets.cend(),
37 [](
const auto &det) { return det->parameterMap().detectorInfo().isMonitor(det->index()); });
42 class_<DetectorGroup, bases<IDetector>, boost::noncopyable>(
"DetectorGroup", no_init)
43 .def(
"isMasked", &isMaskedDeprecated, arg(
"self"),
44 "Returns the value of the masked flag. True means ignore this "
46 .def(
"isMonitor", &isMonitorDeprecated, arg(
"self"),
47 "Returns True if the detector is marked as a monitor in the IDF")
49 "Returns the list of detector IDs within this group")
51 "Returns separator for list of names of detectors");
void export_DetectorGroup()
Holds a collection of detectors.
std::string getNameSeparator() const
Return separator for list of names of detectors.
std::vector< detid_t > getDetectorIDs() const
What detectors are contained in the group?
std::vector< IDetector_const_sptr > getDetectors() const
What detectors are contained in the group?
Interface class for detector objects.