Skip to content

Commit

Permalink
Refs #8508 change asserts for Chi2
Browse files Browse the repository at this point in the history
  • Loading branch information
jmborr committed Dec 5, 2013
1 parent e472739 commit 4578613
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class DiffRotDiscreteCircleTest : public CxxTest::TestSuite

// check Chi-square is small
const double chi_squared = fitalg.getProperty("OutputChi2overDoF");
TS_ASSERT_DELTA( chi_squared, 0.01, 0.01 );
TS_ASSERT_LESS_THAN( chi_squared, 0.001 );
//std::cout << "\nchi_squared = " << chi_squared << "\n"; // only for debugging purposes

// check the parameters of the resolution did not change
Expand Down Expand Up @@ -164,19 +164,19 @@ class DiffRotDiscreteCircleTest : public CxxTest::TestSuite
//auto temp_workspace = generateWorkspaceFromFitAlgorithm( fitalg ); // for debugging purposes only
//saveWorkspace( temp_workspace, "/tmp/junk_from_fit_algorithm.nxs" ); // for debugging purposes only

// check Chi-square is small
const double chi_squared = fitalg.getProperty("OutputChi2overDoF");
TS_ASSERT_DELTA( chi_squared, 1e-09, 1e-09 );
//std::cout << "\nchi_squared = " << chi_squared << "\n"; // only for debugging purposes

// check the parameters of the InelasticDiffRotDiscreteCircle
// check the parameters of the InelasticDiffRotDiscreteCircle did not change
Mantid::API::IFunction_sptr fitalg_structure_factor = fitalg.getProperty( "Function" );
TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Intensity" ), I, I * 0.01 ); // allow for a small percent variation
TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Radius" ), R, R * 0.01 ); // allow for a small percent variation
TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Decay" ), tao, tao * 0.01 ); // allow for a small percent variation
//std::cout << "\nGOAL: Intensity = 2.9, Radius = 2.3, Decay = 0.468\n"; // only for debugging purposes
//std::cout << "OPTIMIZED: Intensity = " << fitalg_structure_factor->getParameter("Intensity") << " Radius = " << fitalg_structure_factor->getParameter("Radius") << " Decay = " << fitalg_structure_factor->getParameter("Decay") << "\n"; // only for debugging purposes

// check Chi-square is small
const double chi_squared = fitalg.getProperty("OutputChi2overDoF");
TS_ASSERT_LESS_THAN( chi_squared, 1e-12 );
//std::cout << "\nchi_squared = " << chi_squared << "\n"; // only for debugging purposes

}


Expand Down Expand Up @@ -267,7 +267,7 @@ class DiffRotDiscreteCircleTest : public CxxTest::TestSuite

// check Chi-square is small
const double chi_squared = fitalg.getProperty("OutputChi2overDoF");
TS_ASSERT_DELTA( chi_squared, 0.01, 0.01 );
TS_ASSERT_LESS_THAN( chi_squared, 0.001 );
//std::cout << "\nchi_squared = " << chi_squared << "\n"; // only for debugging purposes

// check the parameters of the resolution did not change
Expand Down

0 comments on commit 4578613

Please sign in to comment.