Skip to content

Commit

Permalink
Refs #9643. Updated unit test.
Browse files Browse the repository at this point in the history
(1) Unit test is updated to remove the extra output workspace.

(2) Debugging output is cleaned up.
  • Loading branch information
wdzhou committed Aug 27, 2014
1 parent 3c045ea commit 7f07600
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Code/Mantid/Framework/DataHandling/src/LoadVulcanCalFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ namespace DataHandling

// Get the global correction
std::set<int>::iterator biter;
g_log.notice() << "[DB] " << "Number of bankd IDs = " << set_bankID.size() << "\n";
g_log.information() << "Number of bankds to process = " << set_bankID.size() << "\n";
map<int, double> map_bankLogCorr;
for (biter = set_bankID.begin(); biter != set_bankID.end(); ++biter)
{
Expand All @@ -466,8 +466,8 @@ namespace DataHandling
{
detid_t interbank_detid = static_cast<detid_t>((bankid+1)*NUMBERRESERVEDPERMODULE) - 2;

g_log.notice() << "[DB] Find inter-bank correction for bank " << bankid << " for special detid "
<< interbank_detid << ".\n";
g_log.information() << "Find inter-bank correction for bank " << bankid << " for special detid "
<< interbank_detid << ".\n";

offsetiter = map_detoffset.find(interbank_detid);
if (offsetiter == map_detoffset.end()) throw runtime_error("It cannot happen!");
Expand All @@ -479,7 +479,7 @@ namespace DataHandling
// Inter-module correction
if (m_groupingType == VULCAN_OFFSET_STACK)
{
g_log.notice() << "[DB] Find inter-module correction for bank " << bankid << ".\n";
g_log.information() << "Find inter-module correction for bank " << bankid << ".\n";

detid_t intermodule_detid = static_cast<detid_t>((bankid+1)*NUMBERRESERVEDPERMODULE) - 1;
offsetiter = map_detoffset.find(intermodule_detid);
Expand All @@ -490,8 +490,6 @@ namespace DataHandling
}

map_bankLogCorr.insert(make_pair(bankid, globalfactor));

g_log.notice() << "[DB] " << "Bank " << bankid << ", Log10(correction) = " << globalfactor << "\n";
}

// Calcualte the offset for each detector (log now still)
Expand Down Expand Up @@ -568,8 +566,8 @@ namespace DataHandling
double beamline_norm;

m_instrument->getInstrumentParameters(l1,beamline,beamline_norm, samplePos);
g_log.notice() << "[DB] " << "Beam line = " << beamline.X() << ", " << beamline.Y() << ", "
<< beamline.Z() << "\n";
g_log.debug() << "Beam line = " << beamline.X() << ", " << beamline.Y() << ", "
<< beamline.Z() << "\n";

// FIXME - The simple version of the algorithm to calculate 2theta is used here.
// A check will be made to raise exception if the condition is not met to use the simple version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class LoadVulcanCalFileTest : public CxxTest::TestSuite
AnalysisDataService::Instance().remove(outWSName+"_group");
AnalysisDataService::Instance().remove(outWSName+"_offsets");
AnalysisDataService::Instance().remove(outWSName+"_mask");
AnalysisDataService::Instance().remove(outWSName+"_TOF_offsets");

return;
}
Expand Down Expand Up @@ -129,6 +130,12 @@ class LoadVulcanCalFileTest : public CxxTest::TestSuite

TS_ASSERT_EQUALS(nummasked, 6);

// Remove workspace from the data service.
AnalysisDataService::Instance().remove(outWSName+"_group");
AnalysisDataService::Instance().remove(outWSName+"_offsets");
AnalysisDataService::Instance().remove(outWSName+"_mask");
AnalysisDataService::Instance().remove(outWSName+"_TOF_offsets");

return;
}

Expand Down

0 comments on commit 7f07600

Please sign in to comment.