18 std::cout <<
"smoothing a " <<
fname <<
" histogram" << std::endl;
25 h1_s->SetName(
"h1_s");
31 double p2 =
h1_s->Chi2Test(h2,
"UU");
33 Error(
"testSmooth",
"TH1::Smooth is not working correctly - a worst chi2 is obtained");
35 std::cout <<
" chi2 test non-smoothed histo " <<
p1 << std::endl;
36 std::cout <<
" chi2 test smoothed histo " <<
p2 << std::endl;
39 double a2 =
h1_s->AndersonDarlingTest(h2);
41 std::cout <<
" AD test non-smoothed histo " <<
a1 << std::endl;
42 std::cout <<
" AD test smoothed histo " <<
a2 << std::endl;
45 double k2 =
h1_s->KolmogorovTest(h2);
47 std::cout <<
" KS test non-smoothed histo " <<
k1 << std::endl;
48 std::cout <<
" KS test smoothed histo " <<
k2 << std::endl;
54 h2->Scale(
double(
n1) /
n2);
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
1-D histogram with a double per channel (see TH1 documentation)
virtual void FillRandom(TF1 *f1, Int_t ntimes=5000, TRandom *rng=nullptr)
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
void Draw(Option_t *option="") override
Draw this histogram with options.
virtual Double_t AndersonDarlingTest(const TH1 *h2, Option_t *option="") const
Statistical test of compatibility in shape between this histogram and h2, using the Anderson-Darling ...
virtual Double_t Chi2Test(const TH1 *h2, Option_t *option="UU", Double_t *res=nullptr) const
test for comparing weighted and unweighted histograms.
virtual Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const
Statistical test of compatibility in shape between this histogram and h2, using Kolmogorov test.