13void hist052_Graphics_candle_plot_whiskers()
15 auto c1 =
new TCanvas(
"c1",
"Candle Presets", 700, 800);
19 auto h1 =
new TH2I(
"h1",
"Gaus", 100, -5, 5, 1, 0, 1);
20 auto h2 =
new TH1I(
"h2",
"Gaus", 100, -5, 5);
22 h1->GetXaxis()->SetTitle(
"Standard deviation #sigma");
23 h2->GetXaxis()->SetTitle(
"Standard deviation #sigma");
24 h2->GetYaxis()->SetTitle(
"dN/d#sigma");
27 for (
int i = 0; i < 100000; i++) {
28 myRand = rng->Gaus(0, 1);
42 h2->GetQuantiles(3,
q, p);
43 cout <<
"Q1 (-25%): " <<
q[0] <<
" Median: " <<
q[1] <<
" Q3 (+25%): " <<
q[2] << endl;
44 double iqr =
q[2] -
q[0];
45 auto mygaus_1_middle =
new TF1(
"mygaus_1_middle",
"gaus",
q[0],
q[2]);
46 auto mygaus_1_left =
new TF1(
"mygaus_1_left",
"gaus",
q[0] - 1.5 * iqr,
q[0]);
47 mygaus_1_left->SetLineColor(
kGreen);
48 auto mygaus_1_right =
new TF1(
"mygaus_1_right",
"gaus",
q[2],
q[2] + 1.5 * iqr);
49 mygaus_1_right->SetLineColor(
kGreen);
53 h1->Draw(
"candley2 scat");
57 h2->Fit(
"mygaus_1_left",
"R");
58 mygaus_1_left->Draw(
"same");
59 auto l3 =
new TLine(
q[0] - 1.5 * iqr, 0,
q[0] - 1.5 * iqr, mygaus_1_left->Eval(
q[0] - 1.5 * iqr));
63 auto l1 =
new TLine(
q[0], 0,
q[0], mygaus_1_left->Eval(
q[0]));
68 h2->Fit(
"mygaus_1_right",
"R",
"");
69 mygaus_1_right->Draw(
"same");
70 auto l4 =
new TLine(
q[2] + 1.5 * iqr, 0,
q[2] + 1.5 * iqr, mygaus_1_left->Eval(
q[2] + 1.5 * iqr));
74 auto l5 =
new TLine(
q[2], 0,
q[2], mygaus_1_right->Eval(
q[2]));
79 h2->Fit(
"mygaus_1_middle",
"R");
80 mygaus_1_middle->Draw(
"same");
85 t.
DrawText(0, mygaus_1_middle->Eval(0) / 2,
"50%");
86 t.
DrawText(-1.5, mygaus_1_middle->Eval(-1.5) / 2,
"24.65%");
87 t.
DrawText(+1, mygaus_1_middle->Eval(+1.5) / 2,
"24.65%");
double Double_t
Double 8 bytes.
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
1-D histogram with an int per channel (see TH1 documentation)
2-D histogram with an int per channel (see TH1 documentation)
Use the TLine constructor to create a simple line.
This is the base class for the ROOT Random number generators.
virtual TText * DrawText(Double_t x, Double_t y, const char *text)