17 auto C =
new TCanvas(
"C",
"A ratio example");
18 auto h1 =
new TH1D(
"h1",
"TRatioPlot Example; x; y", 50, 0, 10);
19 auto h2 =
new TH1D(
"h2",
"h2", 50, 0, 10);
20 auto f1 =
new TF1(
"f1",
"exp(- x/[0] )");
23 h2->FillRandom(
"f1", 2000);
32 rp->GetLowYaxis()->SetNdivisions(505);
35 rp->GetUpperPad()->cd();
37 legend->
AddEntry(
"h1",
"First histogram",
"l");
38 legend->
AddEntry(
"h2",
"Second histogram",
"le");
R__EXTERN TStyle * gStyle
virtual void SetParameter(Int_t param, Double_t value)
1-D histogram with a double per channel (see TH1 documentation)
virtual void FillRandom(const char *fname, Int_t ntimes=5000, TRandom *rng=nullptr)
Fill histogram following distribution in function fname.
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
This class displays a legend box (TPaveText) containing several legend entries.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
void Draw(Option_t *option="") override
Draw this legend with its current attributes.
Class for displaying ratios, differences and fit residuals.
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
constexpr Double_t C()
Velocity of light in .