Skip to content

Commit

Permalink
Merge pull request #21898 from mrodozov/fix-cons-test
Browse files Browse the repository at this point in the history
Compare cone volumes up to 11th digit of fp
  • Loading branch information
cmsbuild authored Jan 25, 2018
2 parents 611c78e + 3b5d563 commit 8a3a3d3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions SimG4Core/Geometry/test/Cons_.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ testCons::matched_g4_and_dd( void )
double g4v = g4.GetCubicVolume()/cm3;
double ddv = dd.volume()/cm3;
double ddsv = dds.volume()/cm3;
double precision_in_digits = 1e-12;

std::cout << "\tg4 volume = " << g4v <<" cm3" << std::endl;
std::cout << "\tdd volume = " << ddv << " cm3" << std::endl;
std::cout << "\tDD Information: " << dds << " vol=" << ddsv << " cm3" << std::endl;
CPPUNIT_ASSERT( g4v == ddv );
CPPUNIT_ASSERT( g4v == ddsv );

CPPUNIT_ASSERT( abs(g4v - ddv) < precision_in_digits );
CPPUNIT_ASSERT( abs(g4v - ddsv) < precision_in_digits );
}

CPPUNIT_TEST_SUITE_REGISTRATION( testCons );

0 comments on commit 8a3a3d3

Please sign in to comment.