Skip to content

Commit

Permalink
Reduce scope of variables in TobyFitYVector, fixes cppcheck issue.
Browse files Browse the repository at this point in the history
Refs #8940
  • Loading branch information
martyngigg committed Feb 7, 2014
1 parent 087961d commit 2c80cf9
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -212,12 +212,13 @@ namespace Mantid
*/
void TobyFitYVector::calculateSampleContribution()
{
double & sampleBeamDir = m_yvector[TobyFitYVector::ScatterPointBeam];
double & samplePerpDir = m_yvector[TobyFitYVector::ScatterPointPerp];
double & sampleUpDir = m_yvector[TobyFitYVector::ScatterPointUp];

if(m_sampleVolume)
{
double & sampleBeamDir = m_yvector[TobyFitYVector::ScatterPointBeam];
double & samplePerpDir = m_yvector[TobyFitYVector::ScatterPointPerp];
double & sampleUpDir = m_yvector[TobyFitYVector::ScatterPointUp];

const Kernel::V3D & boxSize = m_curObs->sampleCuboid();
sampleBeamDir = boxSize[2]*(nextRandomNumber() - 0.5);
samplePerpDir = boxSize[0]*(nextRandomNumber() - 0.5);
Expand Down

0 comments on commit 2c80cf9

Please sign in to comment.