Skip to content

Commit

Permalink
Refs #4814. Added overload for isMonitor.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Feb 21, 2012
1 parent bfdf820 commit 8b4ad1c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ namespace Mantid

IDetector_const_sptr getDetector(const detid_t &detector_id) const;
bool isMonitor(const detid_t &detector_id) const;
bool isMonitor(const std::set<detid_t> &detector_ids) const;
bool isDetectorMasked(const detid_t &detector_id) const;
bool isDetectorMasked(const std::set<detid_t> &detector_ids) const;

Expand Down
13 changes: 13 additions & 0 deletions Code/Mantid/Framework/Geometry/src/Instrument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,19 @@ namespace Mantid
return det->isMonitor();
}

bool Instrument::isMonitor(const std::set<detid_t> &detector_ids) const
{
if (detector_ids.empty())
return false;

for (std::set<detid_t>::const_iterator it = detector_ids.begin(); it != detector_ids.end(); ++it)
{
if (this->isMonitor(*it))
return true;
}
return false;
}

//--------------------------------------------------------------------------
/** Is the detector with the given ID masked?
*
Expand Down

0 comments on commit 8b4ad1c

Please sign in to comment.