7 #include "gtest/gtest.h" 21 for (
Int_t i = 0; i < 1000000; i++) {
24 value = ran.
Gaus(20, 5);
26 weight = ran.
Gaus(17,20);
27 tp2d->
Fill(px, py, value, weight);
28 tpp->
Fill(px, py, value, weight);
33 for(
Int_t c=1; c<=3; ++c) {
46 ASSERT_NEAR(cont1, cont2,
delta);
52 ASSERT_NEAR(cont1, cont2,
delta);
61 ASSERT_NEAR(cont1, cont2,
delta);
68 ASSERT_NEAR(cont1, cont2,
delta);
80 ASSERT_NEAR(cont1, cont2,
delta);
86 ASSERT_NEAR(cont1, cont2,
delta);
102 double minx = -10;
double maxx = 10;
103 double miny = -10;
double maxy = 10;
106 for (
double i = minx; i < maxx; i += binsz) {
107 for (
double j = miny; j < maxy; j += binsz) {
108 TP2P->
AddBin(i, j, i + binsz, j + binsz);
109 TP2P_2->
AddBin(i, j, i + binsz, j + binsz);
119 auto TP2D =
new TProfile2D(
"1",
"1", 10, -10, 10, 10, -10, 10, 0, 0);
120 auto TP2D_2 =
new TProfile2D(
"2",
"2", 10, -10, 10, 10, -10, 10, 0, 0);
144 TP2D->Merge(&DMerge);
145 TP2P->Merge(&PMerge);
156 auto TP2D =
new TProfile2D(
"1",
"1", 10, -10, 10, 10, -10, 10, 0, 0);
157 auto TP2D_2 =
new TProfile2D(
"2",
"2", 10, -10, 10, 10, -10, 10, 0, 0);
183 TP2D->Merge(&DMerge);
184 TP2P->Merge(&PMerge);
197 auto TP2D =
new TProfile2D(
"1",
"1", 10, -10, 10, 10, -10, 10, 0, 0);
198 auto TP2D_2 =
new TProfile2D(
"2",
"2", 10, -10, 10, 10, -10, 10, 0, 0);
222 TP2D->Merge(&DMerge);
223 TP2P->Merge(&PMerge);
234 auto TP2D =
new TProfile2D(
"1",
"1", 10, -10, 10, 10, -10, 10, 0, 0);
235 auto TP2D_2 =
new TProfile2D(
"2",
"2", 10, -10, 10, 10, -10, 10, 0, 0);
259 TP2D->Merge(&DMerge);
260 TP2P->Merge(&PMerge);
static void StatOverflows(Bool_t flag=kTRUE)
if flag=kTRUE, underflows and overflows are used by the Fill functions in the computation of statisti...
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
Random number generator class based on M.
Int_t FindBin(Double_t x, Double_t y, Double_t z=0)
Returns the bin number of the bin at the given coordinate.
virtual Double_t GetBinError(Int_t bin) const
Return bin error of a Profile2D histogram.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
virtual Double_t GetBinError(Int_t bin) const override
Returns the value of error associated to bin number bin.
void binEntriesCompare(TProfile2D *tp2d, TProfile2Poly *tpp)
virtual Double_t GetMeanError(Int_t axis=1) const
Return standard error of mean of this histogram along the X axis.
virtual Double_t GetMean(Int_t axis=1) const
For axis = 1,2 or 3 returns the mean value of the histogram along X,Y or Z axis.
void globalStatsCompare(TProfile2D *tp2d, TProfile2Poly *tpp)
void SetupPlots(TProfile2Poly *TP2P_2, TProfile2Poly *TP2P, TProfile2D *TP2D_2, TProfile2D *TP2D, TString opt="")
void test_binErrorSpreadStats()
void binContentCompare(TProfile2D *tp2d, TProfile2Poly *tpp)
Int_t Fill(const Double_t *v)
This is the base class for the ROOT Random number generators.
virtual Double_t GetBinContent(Int_t bin) const
Return bin content of a Profile2D histogram.
virtual void SetErrorOption(Option_t *option="")
Set option to compute profile2D errors.
virtual Int_t AddBin(TObject *poly)
Adds a new bin to the histogram.
void binErrorCompare(TProfile2D *tp2d, TProfile2Poly *tpp)
virtual Int_t Fill(Double_t xcoord, Double_t ycoord, Double_t value) override
Increment the bin containing (x,y) by w.
void test_binEntryStats()
void FillForTest(TProfile2D *tp2d, TProfile2Poly *tpp, TRandom &ran)
void SetErrorOption(EErrorType type)
virtual Double_t GetBinContent(Int_t bin) const override
Returns the content of the input bin For the overflow/underflow/sea bins: -1 | -2 | -3 ---+----+---- ...
virtual Double_t GetBinEffectiveEntries(Int_t bin)
Return bin effective entries for a weighted filled Profile histogram.
Profile2D histograms are used to display the mean value of Z and its RMS for each cell in X...
void test_binErrorMeanStats()
virtual void Add(TObject *obj)
TEST(TProfile2Poly, GlobalCompare)
Double_t GetBinEffectiveEntries(Int_t bin) const
virtual Double_t GetStdDev(Int_t axis=1) const
Returns the Standard Deviation (Sigma).