JG ROOT Tools libraries  version 5.0 - august 2014
RHistoFunctions.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file RHistoFunctions.hh
3  *
4  * Include file for functions related to ROOT histograms.
5  */
6 //======================================================================
7 
8 #ifndef R_HISTO_FUNCTIONS_HH
9 #define R_HISTO_FUNCTIONS_HH
10 
11 #include "RBaseFunctions.hh"
12 #include <TH1.h>
13 #include <TH2.h>
14 #include <TH3.h>
15 
16 //----------------------------------------------------------------------
17 // fonctions de base
18 extern TH1 * RReadHisto ( const string & fname, const string & hname );
19 
20 //----------------------------------------------------------------------
21 // fonctions de lissage d'histogrammes
22 extern TH1 * RSmoothHisto ( const TH1 *hptr, const int n, const char *title = "Smoothed_Histo" );
23 extern TH1 * RSmoothHisto1D ( const TH1 *hptr, const int n, const char *title = "Smoothed_Histo" );
24 extern TH1 * RSmoothHisto2D ( const TH1 *hptr, const int n, const char *title = "Smoothed_Histo" );
25 
26 //----------------------------------------------------------------------
27 // coefficient de correlation d'un histogramme 2D
28 extern Double_t RGetHistoCorrelation ( const TH2 *hptr, Double_t &sum, Double_t &sigx, Double_t &sigy );
29 extern Double_t RGetHistoCorrelation ( const TH2 *hptr, Double_t x1, Double_t x2,
30  Double_t y1, Double_t y2,
31  Double_t &sum, Double_t &sigx, Double_t &sigy );
32 extern Double_t RGetHistoCorrelation ( const TH2 *hptr, Int_t ix1, Int_t ix2,
33  Int_t iy1, Int_t iy2,
34  Double_t &sum, Double_t &sigx, Double_t &sigy );
35 
36 //----------------------------------------------------------------------
37 // fonctions de tracé d'un histogramme avec son erreur
38 extern void RGetHistoErrorLimits ( const TH1 * hptr, Double_t &vmin, Double_t &vmax,
39  Int_t ixmin = 0, Int_t ixmax = 0,
40  Int_t iymin = 0, Int_t iymax = 0 );
41 
42 extern void RDrawHistoError ( const TH1 * hptr, const TH1 * herr, const char opts[] = "", Double_t yinf = 0., Double_t ysup = 0. );
43 extern void RDrawHistoError ( const TH1 * hptr, const char opts[] = "", Double_t yinf = 0., Double_t ysup = 0. );
44 
45 
46 //======================================================================
47 // export histogram data
48 
49 extern int RExportPOV ( const string & fname, TH1 * hptr, double thr = 0., const string & fmt = "%10.4f" );
50 extern int RExportPOV ( FILE * fptr, TH1 * hptr, double thr = 0., const string & fmt = "%10.4f" );
51 
52 extern int RExportDF3 ( const string & fname, TH3 * hptr, double thr = 0., double scale = 1. );
53 extern int RExportDF3 ( FILE * fptr, TH3 * hptr, double thr = 0., double scale = 1. );
54 
55 //======================================================================
56 #endif
TH1 * RReadHisto(const string &fname, const string &hname)
Definition: RHistoFunctions.cpp:29
TH1 * RSmoothHisto(const TH1 *hptr, const int n, const char *title)
Definition: RHistoFunctions.cpp:81
void RGetHistoErrorLimits(const TH1 *hptr, Double_t &vinf, Double_t &vsup, Int_t ixmin, Int_t ixmax, Int_t iymin, Int_t iymax)
Definition: RHistoFunctions.cpp:537
void RDrawHistoError(const TH1 *hptr, const TH1 *herr, const char opts[], Double_t yinf, Double_t ysup)
Definition: RHistoFunctions.cpp:650
int RExportPOV(const string &fname, TH1 *hptr, double thr, const string &fmt)
Definition: RHistoFunctions.cpp:869
TH1 * RSmoothHisto2D(const TH1 *hptr, const int n, const char *title)
Definition: RHistoFunctions.cpp:178
Double_t RGetHistoCorrelation(const TH2 *hptr, Double_t &sum, Double_t &sigx, Double_t &sigy)
Definition: RHistoFunctions.cpp:286
TH1 * RSmoothHisto1D(const TH1 *hptr, const int n, const char *title)
Definition: RHistoFunctions.cpp:110
int RExportDF3(const string &fname, TH3 *hptr, double thr, double scale)
Definition: RHistoFunctions.cpp:985