12 void candleplotwhiskers() {
17 TH2I *
h1 =
new TH2I(
"h1",
"Gaus",100,-5,5,1,0,1);
18 TH1I *h2 =
new TH1I(
"h2",
"Gaus",100,-5,5);
25 for (
int i = 0; i < 100000; i++) {
26 myRand = randnum->
Gaus(0,1);
33 q[0] = 0.; q[1] = 0.; q[2] = 0.;
34 p[0] = 0.25; p[1] = 0.5; p[2] = 0.75;
37 cout <<
"Q1 (-25%): " << q[0] <<
" Median: " << q[1] <<
" Q3 (+25%): " << q[2] << endl;
38 double iqr = q[2]-q[0];
39 TF1 *mygaus_1_middle =
new TF1(
"mygaus_1_middle",
"gaus",q[0],q[2]);
40 TF1 *mygaus_1_left =
new TF1(
"mygaus_1_left",
"gaus",q[0]-1.5*iqr,q[0]);
42 TF1 *mygaus_1_right =
new TF1(
"mygaus_1_right",
"gaus",q[2],q[2]+1.5*iqr);
47 h1->
Draw(
"candley2 scat");
51 h2->
Fit(
"mygaus_1_left",
"R");
52 mygaus_1_left->
Draw(
"same");
53 TLine *l3 =
new TLine(q[0]-1.5*iqr,0,q[0]-1.5*iqr,mygaus_1_left->
Eval(q[0]-1.5*iqr));
58 h2->
Fit(
"mygaus_1_right",
"R",
"");
59 mygaus_1_right->
Draw(
"same");
60 TLine *l4 =
new TLine(q[2]+1.5*iqr,0,q[2]+1.5*iqr,mygaus_1_left->
Eval(q[2]+1.5*iqr));
65 h2->
Fit(
"mygaus_1_middle",
"R");
66 mygaus_1_middle->
Draw(
"same");
71 t->
DrawText(-1.5,mygaus_1_middle->
Eval(-1.5)/2,
"24.65%");
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
THist< 1, int, THistStatContent > TH1I
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual Int_t GetQuantiles(Int_t nprobSum, Double_t *q, const Double_t *probSum=0)
Compute Quantiles for this histogram Quantile x_q of a probability distribution Function F is defined...
virtual void Draw(Option_t *option="")
Draw this function with its current attributes.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
This is the base class for the ROOT Random number generators.
Base class for several text objects.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
tomato 1-D histogram with an int per channel (see TH1 documentation)}
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
char * Form(const char *fmt,...)
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
virtual TText * DrawText(Double_t x, Double_t y, const char *text)
Draw this text with new coordinates.
THist< 2, int, THistStatContent > TH2I
tomato 2-D histogram with an int per channel (see TH1 documentation)}
Int_t Fill(Double_t)
Invalid Fill method.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Fit histogram with function fname.