BCH1D Class Reference
#include <BCH1D.h>
List of all members.
Detailed Description
A class for handling 1D distributions.
- Author:
- Daniel Kollar
Kevin Kröninger
- Version:
- 1.0
- Date:
- 08.2008 This class contains a TH1D histogram and some additional functions. It is used for marginalized distributions.
Definition at line 32 of file BCH1D.h.
|
Public Member Functions |
|
|
| BCH1D () |
| ~BCH1D () |
|
|
void | Draw (int options=0, double ovalue=0.) |
void | DrawShadedLimits (double mode, double min, double max, double limit=0) |
void | DrawSmallest (double mode, double prob, bool drawmean=true) |
void | GetSmallestInterval (double &min, double &max, double content=.68) |
TH1D * | GetSmallestIntervalHistogram (double level) |
std::vector< double > | GetSmallestIntervals (double content=0.68) |
TH1D * | GetSubHisto (double min, double max, const char *name) |
double | IntegralWidth (double min, double max) |
void | Print (const char *filename, int options=0, double ovalue=0., int ww=0, int wh=0) |
|
|
TH1D * | GetHistogram () |
double | GetIntegral (double valuemin, double valuemax) |
double | GetLimit (double probability) |
double | GetMean () |
double | GetMedian () |
double | GetMode () |
double | GetPValue (double probability) |
double | GetQuantile (double probablity) |
double | GetRMS () |
|
|
void | SetDefaultCLLimit (double limit) |
void | SetGlobalMode (double mode) |
void | SetHistogram (TH1D *hist) |
Private Attributes |
double | fDefaultCLLimit |
TH1D * | fHistogram |
double | fMode |
int | fModeFlag |
Constructor & Destructor Documentation
The default constructor.
Definition at line 25 of file BCH1D.cxx.
The default destructor.
Definition at line 36 of file BCH1D.cxx.
Member Function Documentation
void BCH1D::Draw |
( |
int |
options = 0 , |
|
|
double |
ovalue = 0. | |
|
) |
| | |
Draw distribution into the active canvas.
- Parameters:
-
| options | Drawing options:
0 = band mode [default],
1 = draw vertical line,
2 = band mode with minimal interval |
| ovalue | Option specific value. For option 0, if ovalue is nonzero a limit is to be drawn rather than central band with ovalue being the per cent value of the limit. If negative, limit is drawn from minimum, if positive limit is drawn from maximum. Allowed values are 68 < |limit| < 100. If mode is outside the band, the limit is drawn automatically. The default limit can be changed by BCH1D::SetDefaultCLLimit(int limit).
For option 1 the ovalue defines where the line is drawn.
For option 2 the ovalue sets the content of the minimal interval in per cent. If omitted a 68% minimal interval will be drawn. |
Definition at line 154 of file BCH1D.cxx.
void BCH1D::DrawShadedLimits |
( |
double |
mode, |
|
|
double |
min, |
|
|
double |
max, |
|
|
double |
limit = 0 | |
|
) |
| | |
Draw distribution with band between min and max and with marker at the mode. Write the location of the mode with uncertainties. If limit is specified, draw CL limit. Allowed values are 68 < |limit| < 100.
Definition at line 264 of file BCH1D.cxx.
void BCH1D::DrawSmallest |
( |
double |
mode, |
|
|
double |
prob, |
|
|
bool |
drawmean = true | |
|
) |
| | |
Draw distribution with bands so that the total shaded area is the smallest possible containing and integral of "prob". Draw the location of the mean and median if requested (default).
Definition at line 425 of file BCH1D.cxx.
TH1D* BCH1D::GetHistogram |
( |
|
) |
[inline] |
- Returns:
- The one-dimensional histogram.
Definition at line 58 of file BCH1D.h.
double BCH1D::GetIntegral |
( |
double |
valuemin, |
|
|
double |
valuemax | |
|
) |
| | |
Returns the integral of distribution the between two values.
- Parameters:
-
| valuemin | The value from which the intergration is done. |
| valuemax | The value up to which the intergration is done. |
- Returns:
- The integral.
Definition at line 74 of file BCH1D.cxx.
double BCH1D::GetLimit |
( |
double |
probability |
) |
[inline] |
Return the quantily of the distribution
- Parameters:
-
| probability | The probability. |
- Returns:
- The quantile of the distribution for the probability.
- See also:
- GetQuantile(double probablity)
Definition at line 92 of file BCH1D.h.
double BCH1D::GetMean |
( |
|
) |
[inline] |
- Returns:
- The mean of the distribution.
Definition at line 64 of file BCH1D.h.
double BCH1D::GetMedian |
( |
|
) |
[inline] |
- Returns:
- The median of the distribution.
Definition at line 75 of file BCH1D.h.
double BCH1D::GetMode |
( |
|
) |
|
- Returns:
- The mode of the distribution.
Definition at line 46 of file BCH1D.cxx.
double BCH1D::GetPValue |
( |
double |
probability |
) |
|
Returns the p-value. Returns the integral from 0 to the probability.
- Parameters:
-
| probability | Upper limit of integration. |
- Returns:
- The p-value.
Definition at line 92 of file BCH1D.cxx.
double BCH1D::GetQuantile |
( |
double |
probablity |
) |
|
Returns the quantile of the distribution.
- Parameters:
-
| probability | The probability. |
- Returns:
- The quantile of the distribution for the probability.
- See also:
- GetLimit(double probability)
Definition at line 55 of file BCH1D.cxx.
double BCH1D::GetRMS |
( |
|
) |
[inline] |
- Returns:
- The RMS of the distribution.
Definition at line 98 of file BCH1D.h.
void BCH1D::GetSmallestInterval |
( |
double & |
min, |
|
|
double & |
max, |
|
|
double |
content = .68 | |
|
) |
| | |
Calculate the minimal interval of the distribution containing a given content.
- Parameters:
-
| min | calculated minimum of the interval |
| max | calculated maximum of the interval |
| content | content of the interval [default is .68] |
Definition at line 544 of file BCH1D.cxx.
TH1D * BCH1D::GetSmallestIntervalHistogram |
( |
double |
level |
) |
|
std::vector< double > BCH1D::GetSmallestIntervals |
( |
double |
content = 0.68 |
) |
|
TH1D * BCH1D::GetSubHisto |
( |
double |
min, |
|
|
double |
max, |
|
|
const char * |
name | |
|
) |
| | |
Get histogram with bins outside min, max band being zero. The new histogram can have 2 more bins than the original one as the bins where min and max fall into will be split in two (except for the case when min and/or max are equal to some of the original bin boundaries.
- Parameters:
-
| min | lower boundary of the non-zero interval |
| max | upper boundary of the non-zero interval |
- Returns:
- new histogram which is nonzero only between min and max
Definition at line 694 of file BCH1D.cxx.
double BCH1D::IntegralWidth |
( |
double |
min, |
|
|
double |
max | |
|
) |
| | |
Calculate integral of the distribution between min and max.
- Parameters:
-
| min | lower boundary of the integrated interval |
| max | upper boundary of the integrated interval |
- Returns:
- integral calculated as sum of BinContent*BinWidth
Definition at line 655 of file BCH1D.cxx.
void BCH1D::Print |
( |
const char * |
filename, |
|
|
int |
options = 0 , |
|
|
double |
ovalue = 0. , |
|
|
int |
ww = 0 , |
|
|
int |
wh = 0 | |
|
) |
| | |
Print distribution into a PostScript file.
- Parameters:
-
| filename | Output filename |
| ww | canvas size in pixels along X |
| ww | canvas size in pixels along Y If ww and wh are set to 0, default ROOT canvas size is used. For explanation of parameters options and ovalue look at BCH1D::Draw() method. |
Definition at line 124 of file BCH1D.cxx.
void BCH1D::SetDefaultCLLimit |
( |
double |
limit |
) |
|
Set default probability limits. Allowed values are between 68% and 100%. The default value is 95%.
Definition at line 106 of file BCH1D.cxx.
void BCH1D::SetGlobalMode |
( |
double |
mode |
) |
[inline] |
Set global mode
Definition at line 137 of file BCH1D.h.
void BCH1D::SetHistogram |
( |
TH1D * |
hist |
) |
[inline] |
Sets the histogram.
Definition at line 125 of file BCH1D.h.
Member Data Documentation
Default confidence level limit
Definition at line 234 of file BCH1D.h.
The 1D histogram
Definition at line 229 of file BCH1D.h.
Global mode
Definition at line 239 of file BCH1D.h.
"Is there a global mode?" flag
Definition at line 244 of file BCH1D.h.