Skip to content

Commit

Permalink
Convert umbra and penumbra values to metres internally.
Browse files Browse the repository at this point in the history
Refs #10169
  • Loading branch information
martyngigg committed Sep 30, 2014
1 parent 4ef012d commit 9a9fd6d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Code/Mantid/Framework/CurveFitting/src/CalculateMSVesuvio.cpp
Expand Up @@ -34,7 +34,7 @@ namespace Mantid
namespace
{
const size_t NSIMULATIONS = 10;
const size_t NEVENTS = 500000;
const size_t NEVENTS = 50000;
const size_t NSCATTERS = 3;
const size_t MAX_SCATTER_PT_TRIES = 25;
/// Conversion constant
Expand Down Expand Up @@ -313,7 +313,6 @@ namespace Mantid
//-------------------------------------------------------------------------
// RandomNumberGenerator helper
//-------------------------------------------------------------------------

/**
* Produces random numbers with various probability distributions
*/
Expand Down Expand Up @@ -618,6 +617,9 @@ namespace Mantid
<< m_srcR1;
throw std::invalid_argument(os.str());
}
// Convert to metres
m_srcR1 /= 100.0;
m_srcR2 /= 100.0;

// Sample rotation specified by a goniometer
m_goniometer = &(m_inputWS->run().getGoniometerMatrix());
Expand Down Expand Up @@ -820,8 +822,11 @@ namespace Mantid
V3D srcPos = generateSrcPos(detpar.l1);
// transform to sample frame
srcPos.rotate(*m_goniometer);
if(fabs(srcPos[0]) > m_halfSampleWidth ||
fabs(srcPos[1]) > m_halfSampleHeight) return 0.0; // misses sample
if(fabs(srcPos[m_acrossIdx]) > m_halfSampleWidth ||
fabs(srcPos[m_upIdx]) > m_halfSampleHeight)
{
return 0.0; // misses sample
}

// track various variables during calculation
std::vector<double> weights(nscatters, 1.0), // start at 1.0
Expand Down

0 comments on commit 9a9fd6d

Please sign in to comment.