Skip to content

Commit

Permalink
refs #6667 Added option to request comparing all data to
Browse files Browse the repository at this point in the history
CheckWorkspacesMatch
  • Loading branch information
abuts committed Jun 27, 2013
1 parent f081441 commit 0168f2e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Code/Mantid/Framework/Algorithms/src/CheckWorkspacesMatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ void CheckWorkspacesMatch::init()
declareProperty("CheckInstrument",true, "Whether to check that the instruments match. ");
declareProperty("CheckMasking",true, "Whether to check that the bin masking matches. ");
declareProperty("CheckSample",false, "Whether to check that the sample (e.g. logs)."); // Have this one false by default - the logs are brittle
declareProperty("CheckAllData",false, "Usually checking data ends wnen first mismatch occurs. This will force algorithm to check all data and print mismatch to debug log"); // Have this one false by default - it can be a lot of printing.


declareProperty("Result","",Direction::Output);
Expand Down Expand Up @@ -449,6 +450,9 @@ bool CheckWorkspacesMatch::checkData(API::MatrixWorkspace_const_sptr ws1, API::M
const size_t numHists = ws1->getNumberHistograms();
const size_t numBins = ws1->blocksize();
const bool histogram = ws1->isHistogramData();
bool checkAllData=getProperty("CheckAllData");



// First check that the workspace are the same size
if ( numHists != ws2->getNumberHistograms() || numBins != ws2->blocksize() )
Expand Down Expand Up @@ -519,15 +523,15 @@ bool CheckWorkspacesMatch::checkData(API::MatrixWorkspace_const_sptr ws1, API::M
g_log.debug() << " Dataset #2 (X,Y,E) = (" << X2[j] << "," << Y2[j] << "," << E2[j] << ")\n";
g_log.debug() << " Difference (X,Y,E) = (" << std::abs(X1[j]-X2[j]) << "," << std::abs(Y1[j]-Y2[j]) << "," << std::abs(E1[j]-E2[j]) << ")\n";
result = "Data mismatch";
resultBool = false;
resultBool = checkAllData;
}
}

// Extra one for histogram data
if ( histogram && std::abs(X1.back()-X2.back()) > tolerance )
{
result = "Data mismatch";
resultBool = false;
resultBool = checkAllData;
}
}
PARALLEL_END_INTERUPT_REGION
Expand Down

0 comments on commit 0168f2e

Please sign in to comment.