BAT
0.9.4
The Bayesian analysis toolkit
|
A class for handling 2D distributions. More...
#include <BCH2D.h>
Public Member Functions | |
Constructors and destructors | |
BCH2D (TH2D *h=0) | |
~BCH2D () | |
Member functions (get) | |
TH2D * | GetHistogram () |
int | GetColor (int index) |
Member functions (set) | |
void | SetColorScheme (int scheme) |
void | SetHistogram (TH2D *hist) |
void | SetGlobalMode (double mode[2]) |
Member functions (miscellaneous methods) | |
void | Print (const char *filename, std::string options="BTfB3CS1meangmode", std::vector< double > intervals=std::vector< double >(0), int ww=0, int wh=0) |
void | Print (const char *filename, std::string options, double interval, int ww=0, int wh=0) |
void | Draw (std::string options="BTfB3CS1meangmodelmode", std::vector< double > intervals=std::vector< double >(0)) |
void | Draw (std::string options, double interval) |
void | CalculateIntegratedHistogram () |
void | PrintIntegratedHistogram (const char *filename) |
double | GetLevel (double p) |
double | GetArea (double p) |
std::vector< int > | GetNIntervalsY (TH2D *h, int &nfoundmax) |
TGraph * | CalculateProfileGraph (int axis, std::string options="mode") |
TGraph * | DrawProfile (int axis, std::string options, std::string drawoptions="blacksolid") |
TGraph * | DrawProfileX (std::string options, std::string drawoptions) |
TGraph * | DrawProfileY (std::string options, std::string drawoptions) |
A class for handling 2D distributions.
void BCH2D::CalculateIntegratedHistogram | ( | ) |
TGraph * BCH2D::CalculateProfileGraph | ( | int | axis, |
std::string | options = "mode" |
||
) |
Return a graph of the profile along x or y. The profile is calculated by scanning through the one axis, e.g., y, and finding the mode, mean, median, etc. with respect to the other axis, e.g. x.
axis | x-axis (0) or y-axis (1) |
options | Options: mode : calculate the profile using the mode [default] mean : calculate the profile using the mean median : calculate the profile using the median |
void BCH2D::Draw | ( | std::string | options = "BTfB3CS1meangmodelmode" , |
std::vector< double > | intervals = std::vector<double>(0) |
||
) |
Draw distribution into the active canvas.
options | Drawing options: BTf : band type a filled area [default] BTc : band type is a contour B1 : draw one band corresponding to an integrated probability specified in intervals B2 : draw two bands corresponding to an integrated probability specified in intervals B3 : draw three bands corresponding to an integrated probability specified in intervals [default] CS0 : choose color scheme 0 (B&W) CS1 : choose color scheme 1 (green/yellow/red) [default] CS2 : choose color scheme 2 (blueish colors) CS3 : choose color scheme 3 (redish colors) smooth1 : use ROOT smoothing algorithm once smooth3 : use ROOT smoothing algorithm three times smooth5 : use ROOT smoothing algorithm five times smooth10 : use ROOT smoothing algorithm ten times mean : draw mean value and standard deviation [default] gmode : draw global mode [default] lmode : draw global mode [default] profilex : draw the profile line vs. x using the mode profiley : draw the profile line vs. y using the mode nL : remove legend |
intervals | the intervals for the bands |
void BCH2D::Draw | ( | std::string | options, |
double | interval | ||
) |
Draw distribution into the active canvas.
options | Drawing options, |
interval | an upper or lower limit |
TGraph * BCH2D::DrawProfile | ( | int | axis, |
std::string | options, | ||
std::string | drawoptions = "blacksolid" |
||
) |
Draw the profile along x or y
options | The options of the calculation of the profile |
drawoptions | The drawing options: black : line color is black [default] red : line color is red solid : line is solid [default] dashed : line is dashed dotted : line is dotted |
|
inline |
|
inline |
double BCH2D::GetArea | ( | double | p | ) |
|
inline |
|
inline |
double BCH2D::GetLevel | ( | double | p | ) |
std::vector< int > BCH2D::GetNIntervalsY | ( | TH2D * | h, |
int & | nfoundmax | ||
) |
void BCH2D::Print | ( | const char * | filename, |
std::string | options = "BTfB3CS1meangmode" , |
||
std::vector< double > | intervals = std::vector<double>(0) , |
||
int | ww = 0 , |
||
int | wh = 0 |
||
) |
Print distribution into a PostScript file.
filename | Output filename |
option | the draw options (see myDraw()) plus |
intervals | the intervals for the bands logz : draw z-axis in log-scale R : rescale canvas to have a squared histogram |
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. |
void BCH2D::Print | ( | const char * | filename, |
std::string | options, | ||
double | interval, | ||
int | ww = 0 , |
||
int | wh = 0 |
||
) |
Print distribution into a PostScript file.
filename | Output filename |
option | the draw options, |
interval | an upper or lower limit |
ww | canvas size in pixels along X |
ww | canvas size in pixels along Y |
void BCH2D::PrintIntegratedHistogram | ( | const char * | filename | ) |
void BCH2D::SetColorScheme | ( | int | scheme | ) |
|
inline |
void BCH2D::SetHistogram | ( | TH2D * | hist | ) |