Skip to content

Commit

Permalink
Refs #4814. Using more efficient mask checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Feb 21, 2012
1 parent 610b806 commit e6d4c95
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions Code/Mantid/Framework/Algorithms/src/DetectorDiagnostic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,25 +134,26 @@ namespace Mantid
// The maximum possible length is that of workspace length
medianInput.reserve(nhists);

bool checkForMask = false;
Geometry::Instrument_const_sptr instrument = input->getInstrument();
if (instrument != NULL)
{
checkForMask = ((instrument->getSource() != NULL) && (instrument->getSample() != NULL));
}
std::cout << "checkForMask = " << checkForMask << std::endl; // REMOVE

PARALLEL_FOR1(input)
for (int i = 0; i < nhists; ++i)
{
PARALLEL_START_INTERUPT_REGION

IDetector_const_sptr det;
try
{
det = input->getDetector(i);
if (checkForMask) {
if (instrument->isDetectorMasked(i))
continue;
if (instrument->isMonitor(i))
continue;
}
catch (Kernel::Exception::NotFoundError&)
{
// Catch if no detector. Next line tests whether this happened - test placed
// outside here because Mac Intel compiler doesn't like 'continue' in a catch
// in an openmp block.
}
// If the detector is either not found, a monitor or is masked do not include it
if ( !det || det->isMonitor() || det->isMasked() ) continue;


const double yValue = input->readY(i)[0];
if ( yValue < 0.0 )
{
Expand Down

0 comments on commit e6d4c95

Please sign in to comment.