Skip to content

Commit

Permalink
Make sure monitors have a "sensitivity" of 1. Re #3963
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed Oct 18, 2011
1 parent 64d42bb commit ce92217
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Code/Mantid/Framework/Algorithms/src/CalculateEfficiency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,19 @@ void CalculateEfficiency::normalizeDetectors(MatrixWorkspace_sptr rebinnedWS,
IDetector_const_sptr det = rebinnedWS->getDetector(i);
// If this detector is masked, skip to the next one
if ( det->isMasked() ) continue;
// If this detector is a monitor, skip to the next one
if ( det->isMonitor() ) continue;

// Retrieve the spectrum into a vector
const MantidVec& YIn = rebinnedWS->readY(i);
const MantidVec& EIn = rebinnedWS->readE(i);
MantidVec& YOut = outputWS->dataY(i);
MantidVec& EOut = outputWS->dataE(i);
// If this detector is a monitor, skip to the next one
if ( det->isMonitor() )
{
YOut[0] = 1.0;
EOut[0] = 0.0;
continue;
}

// Normalize counts to get relative efficiency
YOut[0] = nPixels/sum * YIn[0];
Expand Down

0 comments on commit ce92217

Please sign in to comment.