Logo ROOT  
Reference Guide
TPaveStats.cxx
Go to the documentation of this file.
1 // @(#)root/graf:$Id$
2 // Author: Rene Brun 15/03/99
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #include <cstring>
13 #include <cstdlib>
14 #include <cstdio>
15 #include <iostream>
16 
17 #include "TROOT.h"
18 #include "TBuffer.h"
19 #include "TPaveStats.h"
20 #include "TPaveLabel.h"
21 #include "TVirtualPad.h"
22 #include "TStyle.h"
23 #include "TLatex.h"
24 #include "strlcpy.h"
25 
27 
28 /** \class TPaveStats
29 \ingroup BasicGraphics
30 
31 The histogram statistics painter class.
32 
33 To draw histogram statistics and fit parameters.
34 
35 - [Statistics Display](#PS01)
36 - [Fit Statistics](#PS02)
37 - [Statistics box editing](#PS03)
38 
39 ## <a name="PS01"></a> Statistics Display
40 
41 The type of information shown in the histogram statistics box can be selected
42 with:
43 ~~~ {.cpp}
44  gStyle->SetOptStat(mode);
45 ~~~
46 
47 The "`mode`" has up to nine digits that can be set to on (1 or 2), off (0).
48 ~~~ {.cpp}
49  mode = ksiourmen (default = 000001111)
50  k = 1; kurtosis printed
51  k = 2; kurtosis and kurtosis error printed
52  s = 1; skewness printed
53  s = 2; skewness and skewness error printed
54  i = 1; integral of bins printed
55  o = 1; number of overflows printed
56  u = 1; number of underflows printed
57  r = 1; rms printed
58  r = 2; rms and rms error printed
59  m = 1; mean value printed
60  m = 2; mean and mean error values printed
61  e = 1; number of entries printed
62  n = 1; name of histogram is printed
63 ~~~
64 
65 For example:
66 ~~~ {.cpp}
67  gStyle->SetOptStat(11);
68 ~~~
69 displays only the name of histogram and the number of entries, whereas:
70 ~~~ {.cpp}
71  gStyle->SetOptStat(1101);
72 ~~~
73 displays the name of histogram, mean value and RMS.
74 
75 <b>WARNING 1:</b> never do:
76 ~~~ {.cpp}
77  gStyle->SetOptStat(0001111);
78 ~~~
79 but instead do:
80 ~~~ {.cpp}
81  gStyle->SetOptStat(1111);
82 ~~~
83 because `0001111` will be taken as an octal number!
84 
85 <b>WARNING 2:</b> for backward compatibility with older versions
86 ~~~ {.cpp}
87  gStyle->SetOptStat(1);
88 ~~~
89 is taken as:
90 ~~~ {.cpp}
91  gStyle->SetOptStat(1111)
92 ~~~
93 To print only the name of the histogram do:
94 ~~~ {.cpp}
95  gStyle->SetOptStat(1000000001);
96 ~~~
97 
98 <b>NOTE</b> that in case of 2D histograms, when selecting only underflow
99 (10000) or overflow (100000), the statistics box will show all combinations
100 of underflow/overflows and not just one single number.
101 
102 The parameter mode can be any combination of the letters `kKsSiourRmMen`
103 ~~~ {.cpp}
104  k : kurtosis printed
105  K : kurtosis and kurtosis error printed
106  s : skewness printed
107  S : skewness and skewness error printed
108  i : integral of bins printed
109  o : number of overflows printed
110  u : number of underflows printed
111  r : rms printed
112  R : rms and rms error printed
113  m : mean value printed
114  M : mean value mean error values printed
115  e : number of entries printed
116  n : name of histogram is printed
117 ~~~
118 
119 For example, to print only name of histogram and number of entries do:
120 ~~~ {.cpp}
121  gStyle->SetOptStat("ne");
122 ~~~
123 
124 To print only the name of the histogram do:
125 ~~~ {.cpp}
126  gStyle->SetOptStat("n");
127 ~~~
128 
129 The default value is:
130 ~~~ {.cpp}
131  gStyle->SetOptStat("nemr");
132 ~~~
133 
134 When a histogram is painted, a `TPaveStats` object is created and added
135 to the list of functions of the histogram. If a `TPaveStats` object
136 already exists in the histogram list of functions, the existing object is just
137 updated with the current histogram parameters.
138 
139 Once a histogram is painted, the statistics box can be accessed using
140 `h->FindObject("stats")`. In the command line it is enough to do:
141 ~~~ {.cpp}
142  Root > h->Draw()
143  Root > TPaveStats *st = (TPaveStats*)h->FindObject("stats")
144 ~~~
145 
146 because after `h->Draw()` the histogram is automatically painted. But
147 in a script file the painting should be forced using `gPad->Update()`
148 in order to make sure the statistics box is created:
149 ~~~ {.cpp}
150  h->Draw();
151  gPad->Update();
152  TPaveStats *st = (TPaveStats*)h->FindObject("stats");
153 ~~~
154 
155 Without `gPad->Update()` the line `h->FindObject("stats")`
156 returns a null pointer.
157 
158 When a histogram is drawn with the option "`SAME`", the statistics box
159 is not drawn. To force the statistics box drawing with the option
160 "`SAME`", the option "`SAMES`" must be used.
161 If the new statistics box hides the previous statistics box, one can change
162 its position with these lines ("`h`" being the pointer to the histogram):
163 ~~~ {.cpp}
164  Root > TPaveStats *st = (TPaveStats*)h->FindObject("stats")
165  Root > st->SetX1NDC(newx1); //new x start position
166  Root > st->SetX2NDC(newx2); //new x end position
167 ~~~
168 
169 To change the type of information for an histogram with an existing
170 `TPaveStats` one should do:
171 ~~~ {.cpp}
172  st->SetOptStat(mode);
173 ~~~
174 Where "`mode`" has the same meaning than when calling
175 `gStyle->SetOptStat(mode)` (see above).
176 
177 One can delete the statistics box for a histogram `TH1* h` with:
178 ~~~ {.cpp}
179  h->SetStats(0)
180 ~~~
181 
182 and activate it again with:
183 ~~~ {.cpp}
184  h->SetStats(1).
185 ~~~
186 
187 ## <a name="PS02"></a> Fit Statistics
188 
189 The type of information about fit parameters printed in the histogram statistics
190 box can be selected via the parameter mode. The parameter mode can be
191 `= pcev` (default `= 0111`)
192 ~~~ {.cpp}
193  p = 1; print Probability
194  c = 1; print Chisquare/Number of degrees of freedom
195  e = 1; print errors (if e=1, v must be 1)
196  v = 1; print name/values of parameters
197 ~~~
198 Example:
199 ~~~ {.cpp}
200  gStyle->SetOptFit(1011);
201 ~~~
202 print fit probability, parameter names/values and errors.
203 
204  1. When `"v" = 1` is specified, only the non-fixed parameters are
205  shown.
206  2. When `"v" = 2` all parameters are shown.
207 
208 Note: `gStyle->SetOptFit(1)` means "default value", so it is equivalent
209 to `gStyle->SetOptFit(111)`
210 
211 ## <a name="PS03"></a> Statistics box editing
212 
213 The following example show how to remove and add a line in a statistics box.
214 
215 Begin_Macro(source)
216 ../../../tutorials/hist/statsEditing.C
217 End_Macro
218 */
219 
220 
221 const UInt_t kTakeStyle = BIT(17); //see TStyle::SetOptFit/Stat
222 
223 ////////////////////////////////////////////////////////////////////////////////
224 /// TPaveStats default constructor.
225 
227 {
228  fParent = 0;
229  fOptFit = gStyle->GetOptFit();
231 }
232 
233 ////////////////////////////////////////////////////////////////////////////////
234 /// TPaveStats normal constructor.
235 
237  :TPaveText(x1,y1,x2,y2,option)
238 {
239  fParent = 0;
240  fOptFit = gStyle->GetOptFit();
244 }
245 
246 ////////////////////////////////////////////////////////////////////////////////
247 /// TPaveStats default destructor.
248 
250 {
252 }
253 
254 ////////////////////////////////////////////////////////////////////////////////
255 /// Return the fit option.
256 
258 {
259  if (TestBit(kTakeStyle)) return gStyle->GetOptFit();
260  return fOptFit;
261 }
262 
263 ////////////////////////////////////////////////////////////////////////////////
264 /// Return the stat option.
265 
267 {
268  if (TestBit(kTakeStyle)) return gStyle->GetOptStat();
269  return fOptStat;
270 }
271 
272 ////////////////////////////////////////////////////////////////////////////////
273 /// Save This TPaveStats options in current style.
274 
276 {
281 }
282 
283 ////////////////////////////////////////////////////////////////////////////////
284 /// Change (i.e. set) the format for printing fit parameters in statistics box.
285 
286 void TPaveStats::SetFitFormat(const char *form)
287 {
288  fFitFormat = form;
289 }
290 
291 ////////////////////////////////////////////////////////////////////////////////
292 /// Set the fit option.
293 
295 {
296  fOptFit = fit;
298 }
299 
300 ////////////////////////////////////////////////////////////////////////////////
301 /// Set the stat option.
302 
304 {
305  fOptStat = stat;
307 }
308 
309 ////////////////////////////////////////////////////////////////////////////////
310 /// Change (i.e. set) the format for printing statistics.
311 
312 void TPaveStats::SetStatFormat(const char *form)
313 {
314  fStatFormat = form;
315 }
316 
317 ////////////////////////////////////////////////////////////////////////////////
318 /// Paint the pave stat.
319 
321 {
324 
325  if (!fLines) return;
326  TString typolabel;
327  Double_t y2ref = TMath::Max(fY1,fY2);
328  Double_t x1ref = TMath::Min(fX1,fX2);
329  Double_t x2ref = TMath::Max(fX1,fX2);
330  Double_t dx = TMath::Abs(fX2 - fX1);
331  Double_t dy = TMath::Abs(fY2 - fY1);
332  Double_t titlesize=0;
333  Double_t textsize = GetTextSize();
334  Int_t nlines = GetSize();
335  if (nlines == 0) nlines = 5;
336  Int_t print_name = fOptStat%10;
337 
338  // Evaluate text size as a function of the number of lines
339  Double_t y1 = gPad->GetY1();
340  Double_t y2 = gPad->GetY2();
341  Float_t margin = fMargin*dx;
342  Double_t yspace = dy/Double_t(nlines);
343  Double_t textsave = textsize;
344  TObject *line;
345  TLatex *latex, *latex_tok;
346  TIter next(fLines);
347  Double_t longest = 0, titlelength = 0;
348  Double_t w, wtok[2];
349  char *st, *sl=0;
350  if (textsize == 0) {
351  textsize = 0.92*yspace/(y2 - y1);
352  titlesize = textsize;
353  wtok[0] = 0; wtok[1] = 0;
354  while ((line = (TObject*) next())) {
355  if (line->IsA() == TLatex::Class()) {
356  latex = (TLatex*)line;
357  Int_t nchs = strlen(latex->GetTitle());
358  sl = new char[nchs+1];
359  strlcpy(sl, latex->GetTitle(),nchs+1);
360  if (strpbrk(sl, "=") !=0 && print_name == 0) {
361  st = strtok(sl, "=");
362  Int_t itok = 0;
363  while ( st !=0 ) {
364  latex_tok = new TLatex(0.,0.,st);
365  Style_t tfont = latex->GetTextFont();
366  if (tfont == 0) tfont = GetTextFont();
367  latex_tok->SetTextFont(tfont);
368  latex_tok->SetTextSize(textsize);
369  w = latex_tok->GetXsize();
370  if (w > wtok[itok]) wtok[itok] = w;
371  st = strtok(0, "=");
372  ++itok;
373  delete latex_tok;
374  }
375  } else if (strpbrk(sl, "|") !=0) {
376  } else {
377  print_name = 0;
378  Style_t tfont = latex->GetTextFont();
379  if (tfont == 0) latex->SetTextFont(GetTextFont());
380  latex->SetTextSize(titlesize);
381  titlelength = latex->GetXsize()+2.*margin;
382  if (titlelength > 0.98*dx) titlesize *= 0.98*dx/titlelength;
383  latex->SetTextFont(tfont);
384  }
385  delete [] sl; sl = 0;
386  }
387  }
388  longest = wtok[0]+wtok[1]+2.*margin;
389  if (longest > 0.98*dx) textsize *= 0.98*dx/longest;
390  SetTextSize(textsize);
391  } else {
392  titlesize = textsize;
393  }
394  Double_t ytext = y2ref + 0.5*yspace;
395  Double_t xtext = 0;
396  print_name = fOptStat%10;
397 
398  // Iterate over all lines
399  // Copy pavetext attributes to line attributes if line attributes not set
400  next.Reset();
401  while ((line = (TObject*) next())) {
402  if (line->IsA() == TLatex::Class()) {
403  latex = (TLatex*)line;
404  ytext -= yspace;
405  Double_t xl = latex->GetX();
406  Double_t yl = latex->GetY();
407  Short_t talign = latex->GetTextAlign();
408  Color_t tcolor = latex->GetTextColor();
409  Style_t tfont = latex->GetTextFont();
410  Size_t tsize = latex->GetTextSize();
411  if (tcolor == 0) latex->SetTextColor(GetTextColor());
412  if (tfont == 0) latex->SetTextFont(GetTextFont());
413  if (tsize == 0) latex->SetTextSize(GetTextSize());
414 
415  Int_t nchs = strlen(latex->GetTitle());
416  sl = new char[nchs+1];
417  strlcpy(sl, latex->GetTitle(),nchs+1);
418  // Draw all the histogram stats except the 2D under/overflow
419  if (strpbrk(sl, "=") !=0 && print_name == 0) {
420  st = strtok(sl, "=");
421  Int_t halign = 12;
422  while ( st !=0 ) {
423  typolabel = st;
424  latex->SetTextAlign(halign);
425  if (halign == 12) xtext = x1ref + margin;
426  if (halign == 32) {
427  xtext = x2ref - margin;
428  typolabel = typolabel.Strip();
429  typolabel.ReplaceAll("-","#minus");
430  }
431  latex->PaintLatex(xtext,ytext,latex->GetTextAngle(),
432  latex->GetTextSize(),
433  typolabel.Data());
434  st = strtok(0, "=");
435  halign = 32;
436  }
437  // Draw the 2D under/overflow
438  } else if (strpbrk(sl, "|") !=0) {
439  Double_t yline1 = ytext+yspace/2.;
440  Double_t yline2 = ytext-yspace/2.;
441  Double_t xline1 = dx/3+x1ref;
442  Double_t xline2 = 2*dx/3+x1ref;
443  gPad->PaintLine(x1ref,yline1,x2ref,yline1);
444  gPad->PaintLine(xline1,yline1,xline1,yline2);
445  gPad->PaintLine(xline2,yline1,xline2,yline2);
446  st = strtok(sl, "|");
447  Int_t theIndex = 0;
448  while ( st !=0 ) {
449  latex->SetTextAlign(22);
450  if (theIndex == 0) xtext = 0.5*(x1ref+xline1);
451  if (theIndex == 1) xtext = 0.5*(x1ref+x2ref);
452  if (theIndex == 2) xtext = 0.5*(xline2+x2ref);
453  typolabel = st;
454  typolabel.ReplaceAll("-", "#minus");
455  latex->PaintLatex(xtext,ytext,latex->GetTextAngle(),
456  latex->GetTextSize(),
457  typolabel.Data());
458  theIndex++;
459  st = strtok(0, "|");
460  }
461  // Draw the histogram identifier
462  } else {
463  print_name = 0;
464  latex->SetTextAlign(22);
465  xtext = 0.5*(x1ref+x2ref);
466  latex->PaintLatex(xtext,ytext,latex->GetTextAngle(),
467  titlesize,
468  sl);
469  gPad->PaintLine(x1ref,y2ref-yspace,x2ref,y2ref-yspace);
470  }
471  delete [] sl;
472 
473  latex->SetTextAlign(talign);
474  latex->SetTextColor(tcolor);
475  latex->SetTextFont(tfont);
476  latex->SetTextSize(tsize);
477  latex->SetX(xl); //paintlatex modifies fX and fY
478  latex->SetY(yl);
479  }
480  }
481  SetTextSize(textsave);
482 
483  // if a label create & paint a pavetext title
484  if (fLabel.Length() > 0) {
485  Double_t x1,x2;
486  dy = gPad->GetY2() - gPad->GetY1();
487  x1 = x1ref + 0.25*dx;
488  x2 = x2ref - 0.25*dx;
489  y1 = y2ref - 0.02*dy;
490  y2 = y2ref + 0.02*dy;
491  TPaveLabel *title = new TPaveLabel(x1,y1,x2,y2,fLabel.Data(),GetDrawOption());
492  title->SetFillColor(GetFillColor());
493  title->SetTextColor(GetTextColor());
494  title->SetTextFont(GetTextFont());
495  title->Paint();
496  delete title;
497  }
498 }
499 
500 ////////////////////////////////////////////////////////////////////////////////
501 /// Save primitive as a C++ statement(s) on output stream out.
502 
503 void TPaveStats::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
504 {
505  char quote = '"';
506  out<<" "<<std::endl;
507  Bool_t saved = gROOT->ClassSaved(TPaveStats::Class());
508  if (saved) {
509  out<<" ";
510  } else {
511  out<<" "<<ClassName()<<" *";
512  }
513  if (fOption.Contains("NDC")) {
514  out<<"ptstats = new "<<ClassName()<<"("<<fX1NDC<<","<<fY1NDC<<","<<fX2NDC<<","<<fY2NDC
515  <<","<<quote<<fOption<<quote<<");"<<std::endl;
516  } else {
517  out<<"ptstats = new "<<ClassName()<<"("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2
518  <<","<<quote<<fOption<<quote<<");"<<std::endl;
519  }
520  if (strcmp(GetName(),"TPave")) {
521  out<<" ptstats->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
522  }
523  if (fBorderSize != 4) {
524  out<<" ptstats->SetBorderSize("<<fBorderSize<<");"<<std::endl;
525  }
526  SaveFillAttributes(out,"ptstats",19,1001);
527  SaveLineAttributes(out,"ptstats",1,1,1);
528  SaveTextAttributes(out,"ptstats",22,0,1,62,0);
529  SaveLines(out,"ptstats",saved);
530  out<<" ptstats->SetOptStat("<<GetOptStat()<<");"<<std::endl;
531  out<<" ptstats->SetOptFit("<<GetOptFit()<<");"<<std::endl;
532  out<<" ptstats->Draw();"<<std::endl;
533 }
534 
535 ////////////////////////////////////////////////////////////////////////////////
536 /// Stream an object of class TPaveStats.
537 
538 void TPaveStats::Streamer(TBuffer &R__b)
539 {
540  if (R__b.IsReading()) {
541  UInt_t R__s, R__c;
542  Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
543  if (R__v > 2) {
544  R__b.ReadClassBuffer(TPaveStats::Class(), this, R__v, R__s, R__c);
545  return;
546  }
547  //====process old versions before automatic schema evolution
548  TPaveText::Streamer(R__b);
549  R__b >> fOptFit;
550  R__b >> fOptStat;
551  if (R__v > 1 || R__b.GetVersionOwner() == 22304) {
552  fFitFormat.Streamer(R__b);
553  fStatFormat.Streamer(R__b);
554  } else {
555  SetFitFormat();
556  SetStatFormat();
557  }
558  R__b.CheckByteCount(R__s, R__c, TPaveStats::IsA());
559  //====end of old versions
560 
561  } else {
562  R__b.WriteClassBuffer(TPaveStats::Class(),this);
563  }
564 }
565 
566 ////////////////////////////////////////////////////////////////////////////////
567 /// Replace current attributes by current style.
568 
570 {
571  if (gStyle->IsReading()) {
586  } else {
592  gStyle->SetTextColor(GetTextColor());
593  gStyle->SetStatColor(GetFillColor());
594  gStyle->SetStatStyle(GetFillStyle());
595  gStyle->SetTextFont(GetTextFont());
596  gStyle->SetStatFontSize(GetTextSize());
597  gStyle->SetStatTextColor(GetTextColor());
602  }
603 }
TPaveStats::Paint
virtual void Paint(Option_t *option="")
Paint the pave stat.
Definition: TPaveStats.cxx:320
TPave::SetBorderSize
virtual void SetBorderSize(Int_t bordersize=4)
Definition: TPave.h:79
TPaveStats::UseCurrentStyle
virtual void UseCurrentStyle()
Replace current attributes by current style.
Definition: TPaveStats.cxx:569
TPave::fY1NDC
Double_t fY1NDC
Y1 point in NDC coordinates.
Definition: TPave.h:29
TStyle::SetStatW
void SetStatW(Float_t w=0.19)
Definition: TStyle.h:382
TPave::SetY1NDC
virtual void SetY1NDC(Double_t y1)
Definition: TPave.h:86
TStyle::GetStatW
Float_t GetStatW() const
Definition: TStyle.h:257
TPave::GetBorderSize
Int_t GetBorderSize() const
Definition: TPave.h:60
TStyle::SetStatBorderSize
void SetStatBorderSize(Width_t size=2)
Definition: TStyle.h:376
Style_t
short Style_t
Definition: RtypesCore.h:80
TStyle::SetStatTextColor
void SetStatTextColor(Color_t color=1)
Definition: TStyle.h:374
TObject::TestBit
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
TStyle::GetFitFormat
const char * GetFitFormat() const
Definition: TStyle.h:191
Version_t
short Version_t
Definition: RtypesCore.h:65
TPaveStats::fFitFormat
TString fFitFormat
Printing format for fit parameters.
Definition: TPaveStats.h:29
TMath::Max
Short_t Max(Short_t a, Short_t b)
Definition: TMathBase.h:212
TString::Strip
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
Definition: TString.cxx:1106
TPaveStats::SetStatFormat
virtual void SetStatFormat(const char *format="6.4g")
Change (i.e. set) the format for printing statistics.
Definition: TPaveStats.cxx:312
TPaveStats::GetStatFormat
virtual const char * GetStatFormat() const
Definition: TPaveStats.h:42
TString::Data
const char * Data() const
Definition: TString.h:369
TPaveStats::TPaveStats
TPaveStats()
TPaveStats default constructor.
Definition: TPaveStats.cxx:226
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TPave::ConvertNDCtoPad
virtual void ConvertNDCtoPad()
Convert pave coordinates from NDC to Pad coordinates.
Definition: TPave.cxx:139
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:54
TPaveStats::SetFitFormat
virtual void SetFitFormat(const char *format="5.4g")
Change (i.e. set) the format for printing fit parameters in statistics box.
Definition: TPaveStats.cxx:286
TBuffer::ReadClassBuffer
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
TPaveStats::SetOptFit
void SetOptFit(Int_t fit=1)
Set the fit option.
Definition: TPaveStats.cxx:294
SetFillStyle
a SetFillStyle(0)
TText::SetX
virtual void SetX(Double_t x)
Definition: TText.h:76
TStyle::GetStatColor
Color_t GetStatColor() const
Definition: TStyle.h:248
TAttText::SaveTextAttributes
virtual void SaveTextAttributes(std::ostream &out, const char *name, Int_t alidef=12, Float_t angdef=0, Int_t coldef=1, Int_t fondef=61, Float_t sizdef=1)
Save text attributes as C++ statement(s) on output stream out.
Definition: TAttText.cxx:344
TPaveLabel::Paint
virtual void Paint(Option_t *option="")
Paint this pavelabel with its current attributes.
Definition: TPaveLabel.cxx:99
TBox::fX2
Double_t fX2
X of 2nd point.
Definition: TBox.h:30
Float_t
float Float_t
Definition: RtypesCore.h:57
TStyle::GetOptFit
Int_t GetOptFit() const
Definition: TStyle.h:235
TStyle.h
TBuffer::GetVersionOwner
virtual Int_t GetVersionOwner() const =0
TStyle::SetStatColor
void SetStatColor(Color_t color=19)
Definition: TStyle.h:373
TStyle::SetStatFontSize
void SetStatFontSize(Float_t size=0)
Definition: TStyle.h:378
TPaveStats.h
kTakeStyle
const UInt_t kTakeStyle
Definition: TPaveStats.cxx:221
TBox::fX1
Double_t fX1
X of 1st point.
Definition: TBox.h:28
TString::Contains
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
TAttLine::SaveLineAttributes
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
Definition: TAttLine.cxx:270
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
TPave::SetX2NDC
virtual void SetX2NDC(Double_t x2)
Definition: TPave.h:85
TLatex
Definition: TLatex.h:18
TIter::Reset
void Reset()
Definition: TCollection.h:252
TStyle::GetStatFontSize
Float_t GetStatFontSize() const
Definition: TStyle.h:252
TMath::Abs
Short_t Abs(Short_t d)
Definition: TMathBase.h:120
TBuffer
Definition: TBuffer.h:43
TPaveStats::GetOptStat
Int_t GetOptStat() const
Return the stat option.
Definition: TPaveStats.cxx:266
TLatex::GetXsize
Double_t GetXsize()
Return size of the formula along X in pad coordinates.
Definition: TLatex.cxx:2522
TBuffer::CheckByteCount
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
TString
Definition: TString.h:136
TStyle::SetStatStyle
void SetStatStyle(Style_t style=1001)
Definition: TStyle.h:375
TAttFill::SaveFillAttributes
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
Definition: TAttFill.cxx:234
TStyle::SetFitFormat
void SetFitFormat(const char *format="5.4g")
Definition: TStyle.h:287
Color_t
short Color_t
Definition: RtypesCore.h:83
TStyle::GetStatY
Float_t GetStatY() const
Definition: TStyle.h:256
TObject::RecursiveRemove
virtual void RecursiveRemove(TObject *obj)
Recursively remove this object from a list.
Definition: TObject.cxx:574
TStyle::GetStatH
Float_t GetStatH() const
Definition: TStyle.h:258
bool
TPaveLabel.h
TString::ReplaceAll
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
TStyle::SetOptFit
void SetOptFit(Int_t fit=1)
The type of information about fit parameters printed in the histogram statistics box can be selected ...
Definition: TStyle.cxx:1544
TStyle::SetStatFormat
void SetStatFormat(const char *format="6.4g")
Definition: TStyle.h:379
TPaveStats
Definition: TPaveStats.h:18
x1
static const double x1[5]
Definition: RooGaussKronrodIntegrator1D.cxx:346
TROOT.h
TPave::SetX1NDC
virtual void SetX1NDC(Double_t x1)
Definition: TPave.h:84
TPaveStats::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TPaveStats.cxx:503
TStyle::GetStatTextColor
Color_t GetStatTextColor() const
Definition: TStyle.h:249
TPaveStats::fParent
TObject * fParent
owner of this TPaveStats
Definition: TPaveStats.h:31
TPave::GetX1NDC
Double_t GetX1NDC() const
Definition: TPave.h:65
TPave::GetY1NDC
Double_t GetY1NDC() const
Definition: TPave.h:67
TStyle::GetStatFormat
const char * GetStatFormat() const
Definition: TStyle.h:254
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TText::GetX
Double_t GetX() const
Definition: TText.h:53
TBuffer.h
gStyle
R__EXTERN TStyle * gStyle
Definition: TStyle.h:412
TObject::ResetBit
void ResetBit(UInt_t f)
Definition: TObject.h:171
TPaveStats::GetFitFormat
virtual const char * GetFitFormat() const
Definition: TPaveStats.h:41
SetFillColor
h1 SetFillColor(kGreen)
TText::GetY
Double_t GetY() const
Definition: TText.h:61
TPave::fX1NDC
Double_t fX1NDC
X1 point in NDC coordinates.
Definition: TPave.h:28
TPaveText::fLabel
TString fLabel
Label written at the top of the pavetext.
Definition: TPaveText.h:24
TObject::GetDrawOption
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
Definition: TObject.cxx:343
TBuffer::WriteClassBuffer
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TPave::fY2NDC
Double_t fY2NDC
Y2 point in NDC coordinates.
Definition: TPave.h:31
SetTextColor
pt SetTextColor(4)
TPave::GetName
Option_t * GetName() const
Returns name of object.
Definition: TPave.h:62
BIT
#define BIT(n)
Definition: Rtypes.h:85
TVirtualPad.h
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TPave::SetY2NDC
virtual void SetY2NDC(Double_t y2)
Definition: TPave.h:87
TPave::GetY2NDC
Double_t GetY2NDC() const
Definition: TPave.h:68
TStyle::SetStatH
void SetStatH(Float_t h=0.1)
Definition: TStyle.h:383
TStyle::GetStatX
Float_t GetStatX() const
Definition: TStyle.h:255
TPaveStats::SaveStyle
virtual void SaveStyle()
Save This TPaveStats options in current style.
Definition: TPaveStats.cxx:275
Short_t
short Short_t
Definition: RtypesCore.h:39
TPaveText::GetSize
virtual Int_t GetSize() const
return number of text lines (ignoring TLine, etc)
Definition: TPaveText.cxx:364
TPaveStats::fStatFormat
TString fStatFormat
Printing format for stats.
Definition: TPaveStats.h:30
TStyle::IsReading
Bool_t IsReading() const
Definition: TStyle.h:282
line
TLine * line
Definition: entrylistblock_figure1.C:235
TBuffer::ReadVersion
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
TBox::fY1
Double_t fY1
Y of 1st point.
Definition: TBox.h:29
TStyle::SetOptStat
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
Definition: TStyle.cxx:1592
TMath::Min
Short_t Min(Short_t a, Short_t b)
Definition: TMathBase.h:180
TObject::kInvalidObject
@ kInvalidObject
if object ctor succeeded but object should not be used
Definition: TObject.h:68
TPaveStats::fOptStat
Int_t fOptStat
option Stat
Definition: TPaveStats.h:28
TPaveLabel
Definition: TPaveLabel.h:20
TPave::fBorderSize
Int_t fBorderSize
window box bordersize in pixels
Definition: TPave.h:32
TBuffer::IsReading
Bool_t IsReading() const
Definition: TBuffer.h:86
TPave::fX2NDC
Double_t fX2NDC
X2 point in NDC coordinates.
Definition: TPave.h:30
TStyle::SetStatY
void SetStatY(Float_t y=0)
Definition: TStyle.h:381
Double_t
double Double_t
Definition: RtypesCore.h:59
TPaveStats::GetOptFit
Int_t GetOptFit() const
Return the fit option.
Definition: TPaveStats.cxx:257
TLatex.h
TPave::fOption
TString fOption
Pave style.
Definition: TPave.h:36
TStyle::SetStatX
void SetStatX(Float_t x=0)
Definition: TStyle.h:380
TLatex::PaintLatex
virtual void PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
Main drawing function.
Definition: TLatex.cxx:2051
TPaveStats::fOptFit
Int_t fOptFit
option Fit
Definition: TPaveStats.h:27
TObject
Definition: TObject.h:37
TBox::fY2
Double_t fY2
Y of 2nd point.
Definition: TBox.h:31
TPaveText::SaveLines
virtual void SaveLines(std::ostream &out, const char *name, Bool_t saved)
Save lines of this pavetext as C++ statements on output stream out.
Definition: TPaveText.cxx:677
x2
static const double x2[5]
Definition: RooGaussKronrodIntegrator1D.cxx:364
gPad
#define gPad
Definition: TVirtualPad.h:287
TIter
Definition: TCollection.h:233
TPaveText
Definition: TPaveText.h:21
TStyle::GetOptStat
Int_t GetOptStat() const
Definition: TStyle.h:236
TStyle::GetStatStyle
Style_t GetStatStyle() const
Definition: TStyle.h:253
TPave::GetX2NDC
Double_t GetX2NDC() const
Definition: TPave.h:66
TPaveText::fLines
TList * fLines
List of labels.
Definition: TPaveText.h:27
SetTextFont
pt SetTextFont(42)
Class
void Class()
Definition: Class.C:29
TStyle::GetStatBorderSize
Width_t GetStatBorderSize() const
Definition: TStyle.h:250
TPaveStats::SetOptStat
void SetOptStat(Int_t stat=1)
Set the stat option.
Definition: TPaveStats.cxx:303
TObject::ClassName
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:130
SetTextSize
th1 SetTextSize(0.12)
TText::SetY
virtual void SetY(Double_t y)
Definition: TText.h:77
TPaveStats::~TPaveStats
virtual ~TPaveStats()
TPaveStats default destructor.
Definition: TPaveStats.cxx:249
TPave::PaintPave
virtual void PaintPave(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Int_t bordersize=4, Option_t *option="br")
Draw this pave with new coordinates.
Definition: TPave.cxx:312
TStyle::GetStatFont
Style_t GetStatFont() const
Definition: TStyle.h:251
gROOT
#define gROOT
Definition: TROOT.h:406
int
Size_t
float Size_t
Definition: RtypesCore.h:87
TPaveText::fMargin
Float_t fMargin
Text margin.
Definition: TPaveText.h:26