CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
th1fmorph.h
Go to the documentation of this file.
1 #include "TH1.h"
2 
3 TH1F *th1fmorph(const char *chname,
4  const char *chtitle,
5  TH1F *hist1,TH1F *hist2,
6  Double_t par1,Double_t par2,Double_t parinterp,
7  Double_t morphedhistnorm,
8  Int_t idebug=0) ;
9 TH1D *th1fmorph(const char *chname,
10  const char *chtitle,
11  TH1D *hist1,TH1D *hist2,
12  Double_t par1,Double_t par2,Double_t parinterp,
13  Double_t morphedhistnorm,
14  Int_t idebug=0) ;
15  //--------------------------------------------------------------------------
16  // Author : Alex Read
17  // Version 0.2 of ROOT implementation, 08.05.2011
18  // *
19  // * Perform a linear interpolation between two histograms as a function
20  // * of the characteristic parameter of the distribution.
21  // *
22  // * The algorithm is described in Read, A. L., "Linear Interpolation
23  // * of Histograms", NIM A 425 (1999) 357-360.
24  // *
25  // * This ROOT-based CINT implementation is based on the FORTRAN77
26  // * implementation used by the DELPHI experiment at LEP (d_pvmorph.f).
27  // * The use of double precision allows pdf's to be accurately
28  // * interpolated down to something like 10**-15.
29  // *
30  // * The input histograms don't have to be identical, the binning is also
31  // * interpolated.
32  // *
33  // * Extrapolation is allowed (a warning is given) but the extrapolation
34  // * is not as well-defined as the interpolation and the results should
35  // * be used with great care.
36  // *
37  // * Data in the underflow and overflow bins are completely ignored.
38  // * They are neither interpolated nor do they contribute to the
39  // * normalization of the histograms.
40  // *
41  // * Input arguments:
42  // * ================
43  // * chname, chtitle : The ROOT name and title of the interpolated histogram.
44  // * Defaults for the name and title are "THF1-interpolated"
45  // * and "Interpolated histogram", respectively.
46  // *
47  // * hist1, hist2 : The two input histograms.
48  // *
49  // * par1,par2 : The values of the linear parameter that characterises
50  // * the histograms (e.g. a particle mass).
51  // *
52  // * parinterp : The value of the linear parameter we wish to
53  // * interpolate to.
54  // *
55  // * morphedhistnorm : The normalization of the interpolated histogram
56  // * (default is 1.0).
57  // *
58  // * idebug : Default is zero, no internal information displayed.
59  // * Values between 1 and increase the verbosity of
60  // * informational output which may prove helpful to
61  // * understand errors and pathalogical results.
62  // *
63  // * The routine returns a pointer (TH1 *) to a new histogram which is
64  // * the interpolated result.
65  // *
66  // *------------------------------------------------------------------------
67  // Changes from 0.1 to 0.2:
68  // o Treatment of empty and non-existing histograms now well-defined.
69  // o The tricky regions of the first and last bins are improved (and
70  // well-tested).
71  // *------------------------------------------------------------------------
72 
TH1F * th1fmorph(const char *chname, const char *chtitle, TH1F *hist1, TH1F *hist2, Double_t par1, Double_t par2, Double_t parinterp, Double_t morphedhistnorm, Int_t idebug=0)
Definition: th1fmorph.cc:489