OBJ: TStatistic min Mean = -0.22308 +- 0.09665 RMS = 0.30563 Count = 10 Min = -0.58943 Max = 0.40591
OBJ: TStatistic max Mean = 6.221 +- 0.07178 RMS = 0.22699 Count = 10 Min = 5.8412 Max = 6.4679
OBJ: TStatistic dif Mean = 6.4441 +- 0.1147 RMS = 0.36287 Count = 10 Min = 5.8972 Max = 6.95
OBJ: TStatistic mean Mean = 3.0031 +- 0.008 RMS = 0.025299 Count = 10 Min = 2.9745 Max = 3.0483
OBJ: TStatistic rms Mean = 0.99735 +- 0.004182 RMS = 0.013225 Count = 10 Min = 0.97476 Max = 1.016
ent: 10010
TH1.Print Name = myh0, Entries= 10010, Total sum= 10006
TH1.Print Name = myhref, Entries= 10010, Total sum= 10010
TF1 *gam =
new TF1(
"gam",
"1/(1+0.1*x*0.1*x)", -100., 100.);
TF1 *gam1 =
new TF1(
"gam",
"1/(1+0.1*x*0.1*x)", -1., .25);
TF1 *iga =
new TF1(
"inv gam",
"1.-1/(1+0.1*x*0.1*x)", -100., 100.);
TF1 *iga1 =
new TF1(
"inv gam",
"1.-1/(1+0.1*x*0.1*x)", -.5, 1.);
enum class EHist101_Func {
kGaus = 1,
kLinear = 2,
kGamma1 = 4,
kInvGamma = 5,
kInvGamma1 = 6
};
void hist101_TH1_autobinning(EHist101_Func function = EHist101_Func::kGaus, unsigned nEntriesPerHisto = 1001)
{
auto href = std::make_unique<TH1D>("myhref", "current", nbins, 0., -1.);
auto href2 = std::make_unique<TH1D>("myhref", "Auto P2, sequential", nbins, 0., -1.);
for (int j = 0; j < 10; ++j) {
double xmi = 1e15, xma = -1e15;
const std::string hname = "myh" + std::to_string(j);
auto hw =
new TH1D(hname.c_str(),
"Auto P2, merged", nbins, 0., -1.);
bool buffering = true;
for (
UInt_t i = 0; i < nEntriesPerHisto; ++i) {
double xx = 0;
switch (function) {
case EHist101_Func::kGaus: xx = rndm.Gaus(3, 1); break;
case EHist101_Func::kLinear: xx = rndm.Rndm() * 100. - 50.; break;
case EHist101_Func::kGamma: xx = gam->
GetRandom();
break;
case EHist101_Func::kGamma1: xx = gam1->
GetRandom();
break;
case EHist101_Func::kInvGamma: xx = iga->
GetRandom();
break;
case EHist101_Func::kInvGamma1: xx = iga1->
GetRandom();
break;
default: xx = rndm.Gaus(0, 1);
}
if (buffering) {
if (xx > xma)
xma = xx;
if (xx < xmi)
xmi = xx;
xw.Fill(xx);
}
hw->Fill(xx);
href->Fill(xx);
href2->Fill(xx);
if (!hw->GetBuffer()) {
buffering = false;
}
}
}
auto h0 = std::unique_ptr<TH1D>(
static_cast<TH1D *
>(histoList.
First()));
if (!h0->Merge(&histoList))
return;
if (
gROOT->GetListOfCanvases()->FindObject(
"c3"))
delete gROOT->GetListOfCanvases()->FindObject(
"c3");
h0->StatOverflows();
h0->DrawClone("HIST");
href2->StatOverflows();
href2->DrawClone();
href->StatOverflows();
href->DrawClone();
std::cout << " ent: " << h0->GetEntries() << "\n";
h0->Print();
href->Print();
}
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
long long Long64_t
Portable signed long integer 8 bytes.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Double_t GetRandom(TRandom *rng=nullptr, Option_t *opt=nullptr)
1-D histogram with a double per channel (see TH1 documentation)
@ kAutoBinPTwo
different than 1.
static void SetDefaultBufferSize(Int_t bufsize=1000)
void Add(TObject *obj) override
TObject * Remove(TObject *obj) override
Remove object from the list.
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
Random number generator class based on M.
Statistical variable, defined by its mean and variance (RMS).