Skip to content

Commit

Permalink
Revert "Refs #10254 new edge integration parameter"
Browse files Browse the repository at this point in the history
This reverts commit 15d35ef.
  • Loading branch information
VickieLynch committed Oct 2, 2014
1 parent d0a4660 commit 3233878
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
Expand Up @@ -47,7 +47,7 @@ namespace MDAlgorithms
Mantid::API::IMDEventWorkspace_sptr inWS;

/// Calculate if this Q is on a detector
bool detectorQ(Mantid::Kernel::V3D QLabFrame, double PeakRadius, double edgeRatio);
bool detectorQ(Mantid::Kernel::V3D QLabFrame, double PeakRadius);

/// Instrument reference
Geometry::Instrument_const_sptr inst;
Expand Down
21 changes: 7 additions & 14 deletions Code/Mantid/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp
Expand Up @@ -92,9 +92,6 @@ namespace MDAlgorithms
declareProperty("IntegrateIfOnEdge", true, "Only warning if all of peak outer radius is not on detector (default).\n"
"If false, do not integrate if the outer radius is not on a detector.");

declareProperty(new PropertyWithValue<double>("EdgeRatio",1.0,Direction::Input),
"Ratio of points on edge of sphere that must map to a detector for warning or omitting IntegrateIfOnEdge=false..");

declareProperty("AdaptiveQRadius", false, "Default is false. If true, all input radii are multiplied by the magnitude of Q at the peak center so each peak has a different integration radius.");

declareProperty("Cylinder", false, "Default is sphere. Use next five parameters for cylinder.");
Expand Down Expand Up @@ -207,7 +204,6 @@ namespace MDAlgorithms
/// Replace intensity with 0
bool replaceIntensity = getProperty("ReplaceIntensity");
bool integrateEdge = getProperty("IntegrateIfOnEdge");
double edgeRatio = getProperty("EdgeRatio");
if (BackgroundInnerRadius < PeakRadius)
BackgroundInnerRadius = PeakRadius;
std::string profileFunction = getProperty("ProfileFunction");
Expand Down Expand Up @@ -251,15 +247,15 @@ namespace MDAlgorithms
// Do not integrate if sphere is off edge of detector
if (BackgroundOuterRadius > PeakRadius)
{
if (!detectorQ(p.getQLabFrame(), BackgroundOuterRadius, edgeRatio))
if (!detectorQ(p.getQLabFrame(), BackgroundOuterRadius))
{
g_log.warning() << "Warning: sphere/cylinder for integration is off edge of detector for peak " << i << std::endl;
if (!integrateEdge)continue;
}
}
else
{
if (!detectorQ(p.getQLabFrame(), PeakRadius, edgeRatio))
if (!detectorQ(p.getQLabFrame(), PeakRadius))
{
g_log.warning() << "Warning: sphere/cylinder for integration is off edge of detector for peak " << i << std::endl;
if (!integrateEdge)continue;
Expand Down Expand Up @@ -588,10 +584,9 @@ namespace MDAlgorithms
* @param r: Peak radius.
* @param edgeRatio: Ratio of edge points that map to detector.
*/
bool IntegratePeaksMD2::detectorQ(Mantid::Kernel::V3D QLabFrame, double r, double edgeRatio)
bool IntegratePeaksMD2::detectorQ(Mantid::Kernel::V3D QLabFrame, double r)
{
bool in = true;
int sum = 0;
const int nAngles = 8;
double dAngles = static_cast<coord_t>(nAngles);
// check 64 points in theta and phi at outer radius
Expand All @@ -610,10 +605,10 @@ namespace MDAlgorithms
try
{
Peak p(inst, edge);
in = p.findDetector();
if (in)
in = (in && p.findDetector());
if (!in)
{
sum++;
return in;
}
}
catch (...)
Expand All @@ -622,9 +617,7 @@ namespace MDAlgorithms
}
}
}
// Percentage of points at edge of sphere to allow gaps between tubes
if (sum >= static_cast<int>(edgeRatio*64)) return true;
else return false;
return in;
}
void IntegratePeaksMD2::checkOverlap(int i,
Mantid::DataObjects::PeaksWorkspace_sptr peakWS, int CoordinatesToUse, double radius)
Expand Down

0 comments on commit 3233878

Please sign in to comment.