void stacktest()
{
gStyle->SetHistTopMargin(0);
TCanvas c("c","c");
gPad->SetLeftMargin(0.35);
TH1F* h1 = new TH1F("h1","h1",50,-5,5);
TH1F* h2 = new TH1F("h2","h2",50,-5,5);
TH1F* h3 = new TH1F("h3","h3",50,-5,5);
h1->FillRandom("gaus",13000);
h2->FillRandom("gaus",20000);
h3->FillRandom("gaus",35000);
h1->SetFillColor(kRed);
h2->SetFillColor(kAzure);
h3->SetFillColor(kYellow);
THStack* hs = new THStack("hs","hs");
#if 1 /* 0 or 1 */
hs->Add(h1);
hs->Add(h2);
hs->Add(h3);
hs->Draw("");
#else /* 0 or 1 */
hs->Add(h3);
hs->Add(h2);
hs->Add(h1);
hs->Draw("NOSTACK");
#endif /* 0 or 1 */
hs->GetYaxis()->SetTitleSize(0.05);
hs->GetYaxis()->SetTitleOffset(1.85);
hs->GetYaxis()->SetLabelSize(0.045);
hs->GetYaxis()->SetTitle("Colombia");
hs->SetMinimum(1.e-2);
hs->SetMaximum(1.e4);
#if 1 /* 0 or 1 */
TH1 *h = (TH1 *)(hs->GetStack()->Last()); // the "sum" of all histograms
#else /* 0 or 1 */
TH1 *h = ((TH1 *)(hs->GetStack()->Last()))->DrawCopy("E P SAMES"); // copy of "sum"
h->SetFillColor(0);
#endif /* 0 or 1 */
h->SetMarkerColor(kOrange);
h->SetMarkerSize(1.5);
h->SetMarkerStyle(20);
h->Draw("E P SAMES");
c.Draw();
c.SaveAs("image.gif");
}