JG ROOT Tools libraries
version 5.0 - august 2014
|
#include "RHistoFunctions.hh"
#include "RBaseFunctions.hh"
#include <TAxis.h>
#include <TPad.h>
#include <TAttLine.h>
#include <TAttFill.h>
#include <THistPainter.h>
#include <TFile.h>
Functions | |
TH1 * | RReadHisto (const string &fname, const string &hname) |
TH1 * | RSmoothHisto (const TH1 *hptr, const int n, const char *title) |
TH1 * | RSmoothHisto1D (const TH1 *hptr, const int n, const char *title) |
TH1 * | RSmoothHisto2D (const TH1 *hptr, const int n, const char *title) |
Double_t | RGetHistoCorrelation (const TH2 *hptr, Double_t &sum, Double_t &sigx, Double_t &sigy) |
Double_t | RGetHistoCorrelation (const TH2 *hptr, Double_t x1, Double_t x2, Double_t y1, Double_t y2, Double_t &sum, Double_t &sigx, Double_t &sigy) |
Double_t | RGetHistoCorrelation (const TH2 *hptr, Int_t ix1, Int_t ix2, Int_t iy1, Int_t iy2, Double_t &sum, Double_t &sigx, Double_t &sigy) |
void | RGetHistoErrorLimits (const TH1 *hptr, Double_t &vinf, Double_t &vsup, Int_t ixmin, Int_t ixmax, Int_t iymin, Int_t iymax) |
void | RDrawHistoError (const TH1 *hptr, const TH1 *herr, const char opts[], Double_t yinf, Double_t ysup) |
void | RDrawHistoError (const TH1 *hptr, const char opts[], Double_t yinf, Double_t ysup) |
int | RExportPOV (const string &fname, TH1 *hptr, double thr, const string &fmt) |
int | RExportPOV (FILE *fptr, TH1 *hptr, double thr, const string &fmt) |
int | RExportDF3 (const string &fname, TH3 *hptr, double thr, double scale) |
int | RExportDF3 (FILE *fptr, TH3 *hptr, double thr, double scale) |
Source file for functions related to ROOT histograms.
TH1* RReadHisto | ( | const string & | fname, |
const string & | hname | ||
) |
Read an histogram in a ROOT file, and return a pointer to the histogram. The histogram is taken to "local" directory. This function is redundant with RGetFileHisto.
fname | ROOT file name |
hname | histogram name |
TH1* RSmoothHisto | ( | const TH1 * | hptr, |
const int | n, | ||
const char * | title | ||
) |
Histogram smoothing: a new histogram is created and its pointer is returned. In case of error, a NULL pointer is returned.
hptr | initial histogram pointer |
n | number of smoothing loops |
title | smoothed histogram name |
References RSmoothHisto1D(), and RSmoothHisto2D().
TH1* RSmoothHisto1D | ( | const TH1 * | hptr, |
const int | n, | ||
const char * | title | ||
) |
1D histogram smoothing: a new histogram is created and its pointer is returned. In case of error, a NULL pointer is returned.
hptr | initial histogram pointer |
n | number of smoothing loops |
title | smoothed histogram name |
Referenced by RSmoothHisto().
TH1* RSmoothHisto2D | ( | const TH1 * | hptr, |
const int | n, | ||
const char * | title | ||
) |
2D histogram smoothing: a new histogram is created and its pointer is returned. In case of error, a NULL pointer is returned.
hptr | initial histogram pointer |
n | number of smoothing loops |
title | smoothed histogram name |
Referenced by RSmoothHisto().
Double_t RGetHistoCorrelation | ( | const TH2 * | hptr, |
Double_t & | sum, | ||
Double_t & | sigx, | ||
Double_t & | sigy | ||
) |
Compute the correlation coefficient for a 2D histogram. It also returns (arguments) the standard deviations on X and Y dimensions.
hptr | 2D histogram pointer |
sum | histogram sum (output) |
sigx | X dimension standard deviation (output) |
sigy | Y dimension standard deviation (output) |
References RGetHistoCorrelation().
Referenced by RGetHistoCorrelation().
Double_t RGetHistoCorrelation | ( | const TH2 * | hptr, |
Double_t | x1, | ||
Double_t | x2, | ||
Double_t | y1, | ||
Double_t | y2, | ||
Double_t & | sum, | ||
Double_t & | sigx, | ||
Double_t & | sigy | ||
) |
Compute the correlation coefficient for a 2D histogram. It also returns (arguments) the standard deviations on X and Y dimensions.
hptr | 2D histogram pointer |
x1 | lower calculation limit along X |
x2 | upper calculation limit along X |
y1 | lower calculation limit along Y |
y2 | upper calculation limit along Y |
sum | histogram sum (output) |
sigx | X dimension standard deviation (output) |
sigy | Y dimension standard deviation (output) |
References RGetHistoCorrelation().
Double_t RGetHistoCorrelation | ( | const TH2 * | hptr, |
Int_t | ix1, | ||
Int_t | ix2, | ||
Int_t | iy1, | ||
Int_t | iy2, | ||
Double_t & | sum, | ||
Double_t & | sigx, | ||
Double_t & | sigy | ||
) |
Compute the correlation coefficient for a 2D histogram. It also returns (arguments) the standard deviations on X and Y dimensions.
hptr | 2D histogram pointer |
ix1 | lower calculation bin along X |
ix2 | upper calculation bin along X |
iy1 | lower calculation bin along Y |
iy2 | upper calculation bin along Y |
sum | histogram sum (output) |
sigx | X dimension standard deviation (output) |
sigy | Y dimension standard deviation (output) |
void RGetHistoErrorLimits | ( | const TH1 * | hptr, |
Double_t & | vinf, | ||
Double_t & | vsup, | ||
Int_t | ixmin, | ||
Int_t | ixmax, | ||
Int_t | iymin, | ||
Int_t | iymax | ||
) |
Computes minimum and maximum values for an histogram, including errors.
hptr | histogram pointer (1D or 2D) |
vinf | returned minimum value |
vsup | returned maximum value |
ixmin | lower X bin (included) |
ixmax | upper X bin (included) |
iymin | lower Y bin (included) |
iymax | upper Y bin (included) |
Referenced by RGFitBase1D::Construct(), and RGFitBase2D::Construct().
void RDrawHistoError | ( | const TH1 * | hptr, |
const TH1 * | herr, | ||
const char | opts[], | ||
Double_t | yinf, | ||
Double_t | ysup | ||
) |
Plot an histogram in current pad, with its error. The current X lower and upper plotting values are used. This function uses an independant histogram that contains errors associated to the plotted histogram. If yinf and ysup are not specified, the vertical scale is adjusted automatically.
hptr | pointer on histogram |
herr | pointer on error histogram |
opts | options de tracé (non utilisé); |
yinf | valeur inférieure du tracé en Y |
ysup | valeur supérieure du tracé en Y |
References RDrawHistoError().
Referenced by RFitBase1D::DrawHisto(), RGFitBase1D::DrawPadHisto(), and RDrawHistoError().
void RDrawHistoError | ( | const TH1 * | hptr, |
const char | opts[], | ||
Double_t | yinf, | ||
Double_t | ysup | ||
) |
Plot an histogram in current pad, with its error. The current X lower and upper plotting values are used. If yinf and ysup are not specified, the vertical scale is adjusted automatically.
hptr | pointer on histogram (with errors defined) |
opts | options de tracé (non utilisé); |
yinf | valeur inférieure du tracé en Y |
ysup | valeur supérieure du tracé en Y |
int RExportPOV | ( | const string & | fname, |
TH1 * | hptr, | ||
double | thr, | ||
const string & | fmt | ||
) |
Export the histogram data to a text file for use as an input file in Persistence Of Vision. The file contains 2, 3 or 4 columns for 1D, 2D and 3D histograms respectively: the bins indexes and the histogram content.
fname | output file name |
hptr | histogram pointer |
thr | threshold (only values above threshold are exported) |
fmt | values format |
References RExportPOV().
Referenced by RExportPOV().
int RExportPOV | ( | FILE * | fptr, |
TH1 * | hptr, | ||
double | thr, | ||
const string & | fmt | ||
) |
Export the histogram data to a text file for use as an input file in Persistence Of Vision. The file contains 2, 3 or 4 columns for 1D, 2D and 3D histograms respectively: the bins indexes and the histogram content.
fptr | output file pointer |
hptr | histogram pointer |
thr | threshold (only values above threshold are exported) |
fmt | values format |
int RExportDF3 | ( | const string & | fname, |
TH3 * | hptr, | ||
double | thr, | ||
double | scale | ||
) |
Export the 3D histogram data to a DF3 density file (for Persistence Of Vision).
fname | output file name |
hptr | histogram pointer |
thr | threshold (only values above threshold are exported) |
scale | scaling factor: 0 for normalization to max value |
References RExportDF3().
Referenced by RExportDF3().
int RExportDF3 | ( | FILE * | fptr, |
TH3 * | hptr, | ||
double | thr, | ||
double | scale | ||
) |
Export the 3D histogram data to a DF3 density file (for Persistence Of Vision).
fptr | output file pointer |
hptr | histogram pointer |
thr | threshold (only values above threshold are exported) |
scale | scaling factor: 0 for normalization to max value |