14 TCanvas *c1 =
new TCanvas(
"c1",
"The HSUM example",200,10,600,400);
17 gBenchmark->Start(
"hsum");
20 auto total =
new TH1F(
"total",
"This is the total distribution",100,-4,4);
21 auto main =
new TH1F(
"main",
"Main contributor",100,-4,4);
22 auto s1 =
new TH1F(
"s1",
"This is the first signal",100,-4,4);
23 auto s2 =
new TH1F(
"s2",
"This is the second signal",100,-4,4);
25 total->SetMarkerStyle(21);
26 total->SetMarkerSize(0.7);
27 main->SetFillColor(16);
34 const Int_t kUPDATE = 500;
35 Float_t xs1, xs2, xmain;
36 for ( Int_t i=0; i<10000; i++) {
37 xmain = gRandom->Gaus(-1,1.5);
38 xs1 = gRandom->Gaus(-0.5,0.5);
39 xs2 = gRandom->Landau(1,0.15);
46 if (i && (i%kUPDATE) == 0) {
53 slider =
new TSlider(
"slider",
54 "test",4.2,0,4.6,total->GetMaximum(),38);
55 slider->SetFillColor(46);
57 if (slider) slider->SetRange(0,Float_t(i)/10000.);
62 slider->SetRange(0,1);
63 total->Draw(
"sameaxis");
65 gBenchmark->Show(
"hsum");