22 TF1 *gam =
new TF1(
"gam",
"1/(1+0.1*x*0.1*x)", -100., 100.);
23 TF1 *gam1 =
new TF1(
"gam",
"1/(1+0.1*x*0.1*x)", -1., .25);
24 TF1 *iga =
new TF1(
"inv gam",
"1.-1/(1+0.1*x*0.1*x)", -100., 100.);
25 TF1 *iga1 =
new TF1(
"inv gam",
"1.-1/(1+0.1*x*0.1*x)", -.5, 1.);
27 void fillhistosauto2p(
unsigned opt = 1,
unsigned n = 1001)
33 TRandom3 rndm((Long64_t)time(0));
36 auto href =
new TH1D(
"myhref",
"current", 50, 0., -1.);
37 href->SetBuffer(bsize);
40 auto href2 =
new TH1D(
"myhref",
"Auto P2, sequential", 50, 0., -1.);
41 href2->SetBit(TH1::kAutoBinPTwo);
42 href2->SetBuffer(bsize);
44 TList *hlist =
new TList;
48 TStatistic x(
"min"), y(
"max"), d(
"dif"), a(
"mean"), r(
"rms");
49 for (UInt_t j = 0; j < nh; ++j) {
50 Double_t xmi = 1e15, xma = -1e15;
51 TStatistic xw(
"work");
52 TString hname = TString::Format(
"myh%d", j);
53 auto hw =
new TH1D(hname.Data(),
"Auto P2, merged", nbins, 0., -1.);
54 hw->SetBit(TH1::kAutoBinPTwo);
57 Double_t xhma, xhmi, ovf, unf;
58 Bool_t emptied = kFALSE, tofill = kTRUE;
59 Bool_t buffering = kTRUE;
60 for (UInt_t i = 0; i < n; ++i) {
64 case 1: xx = rndm.Gaus(3, 1);
break;
65 case 2: xx = rndm.Rndm() * 100. - 50.;
break;
66 case 3: xx = gam->GetRandom();
break;
67 case 4: xx = gam1->GetRandom();
break;
68 case 5: xx = iga->GetRandom();
break;
69 case 6: xx = iga1->GetRandom();
break;
70 default: xx = rndm.Gaus(0, 1);
83 if (!hw->GetBuffer()) {
103 TH1D *h0 = (TH1D *)hlist->First();
105 if (!h0->Merge(hlist))
108 gStyle->SetOptStat(111110);
110 if (gROOT->GetListOfCanvases()->FindObject(
"c3"))
111 delete gROOT->GetListOfCanvases()->FindObject(
"c3");
112 TCanvas *c3 =
new TCanvas(
"c3",
"c3", 800, 800);
116 h0->DrawClone(
"HIST");
119 href2->StatOverflows();
123 href->StatOverflows();
126 std::cout <<
" ent: " << h0->GetEntries() <<
"\n";
130 hlist->SetOwner(kTRUE);