Drawing stack histograms on subpads.
In this example three histograms are displayed on separate pads. If canvas divided in advance - provided subpads will be used by the THStack.
{
auto hs =
new THStack(
"hs",
"Stacked 1D histograms");
auto h1st =
new TH1F(
"h1st",
"test hstack 1", 100, -4, 4);
h1st->FillRandom(
"gaus", 20000);
auto h2st =
new TH1F(
"h2st",
"test hstack 2", 100, -4, 4);
h2st->FillRandom(
"gaus", 15000);
auto h3st =
new TH1F(
"h3st",
"test hstack 3", 100, -4, 4);
h3st->FillRandom(
"gaus", 10000);
auto c1 =
new TCanvas(
"c1",
"THStack drawing on pads", 800, 800);
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
1-D histogram with a float per channel (see TH1 documentation)
The Histogram stack class.
- Date
- June 2024
- Author
- Sergey Linev
Definition in file hist024_THStack_pads.C.