コード例 #1
0
void check_histos_equal(const Histogram & h1, const Histogram & h2){
    BOOST_REQUIRE(h1.get_nbins()==h2.get_nbins());
    BOOST_REQUIRE(h1.get_xmin()==h2.get_xmin());
    BOOST_REQUIRE(h1.get_xmax()==h2.get_xmax());
    //for the total weight, do not assume too much ...
    BOOST_REQUIRE(utils::close_to_relative(h1.get_sum_of_bincontents(),h2.get_sum_of_bincontents()));
    const size_t n = h1.get_nbins();
    for(size_t i=0; i<=n+1; i++){
        BOOST_CHECK(h1.get(i)==h2.get(i));
    }
}