13 auto c1 =
new TCanvas(
"c1",
"The HSUM example",200,10,600,400);
16 gBenchmark->Start(
"hsum");
19 auto total =
new TH1F(
"total",
"This is the total distribution",100,-4,4);
20 auto main =
new TH1F(
"main",
"Main contributor",100,-4,4);
21 auto s1 =
new TH1F(
"s1",
"This is the first signal",100,-4,4);
22 auto s2 =
new TH1F(
"s2",
"This is the second signal",100,-4,4);
24 total->SetMarkerStyle(21);
25 total->SetMarkerSize(0.7);
26 main->SetFillColor(16);
30 gSystem->Unlink(
"hsumanim.gif");
34 const Int_t kUPDATE = 500;
35 Float_t xs1, xs2, xmain;
37 for ( Int_t i=0; i<10000; i++) {
38 xmain = gRandom->Gaus(-1,1.5);
39 xs1 = gRandom->Gaus(-0.5,0.5);
40 xs2 = gRandom->Landau(1,0.15);
47 if (i && (i%kUPDATE) == 0) {
54 slider =
new TSlider(
"slider",
"test",4.2,0,4.6,total->GetMaximum(),38);
55 slider->SetFillColor(46);
57 if (slider) slider->SetRange(0,Float_t(i)/10000.);
60 if (gROOT->IsBatch()) {
61 c1->Print(
"hsumanim.gif+");
62 printf(
"i = %d\n", i);
64 if (gSystem->ProcessEvents())
69 slider->SetRange(0,1);
70 total->Draw(
"sameaxis");
73 if (gROOT->IsBatch()) c1->Print(
"hsumanim.gif++");
77 gBenchmark->Show(
"hsum");