00001 #include "TH1.h" 00002 00003 TH1F *th1fmorph(const char *chname, 00004 const char *chtitle, 00005 TH1F *hist1,TH1F *hist2, 00006 Double_t par1,Double_t par2,Double_t parinterp, 00007 Double_t morphedhistnorm, 00008 Int_t idebug=0) ; 00009 TH1D *th1fmorph(const char *chname, 00010 const char *chtitle, 00011 TH1D *hist1,TH1D *hist2, 00012 Double_t par1,Double_t par2,Double_t parinterp, 00013 Double_t morphedhistnorm, 00014 Int_t idebug=0) ; 00015 //-------------------------------------------------------------------------- 00016 // Author : Alex Read 00017 // Version 0.2 of ROOT implementation, 08.05.2011 00018 // * 00019 // * Perform a linear interpolation between two histograms as a function 00020 // * of the characteristic parameter of the distribution. 00021 // * 00022 // * The algorithm is described in Read, A. L., "Linear Interpolation 00023 // * of Histograms", NIM A 425 (1999) 357-360. 00024 // * 00025 // * This ROOT-based CINT implementation is based on the FORTRAN77 00026 // * implementation used by the DELPHI experiment at LEP (d_pvmorph.f). 00027 // * The use of double precision allows pdf's to be accurately 00028 // * interpolated down to something like 10**-15. 00029 // * 00030 // * The input histograms don't have to be identical, the binning is also 00031 // * interpolated. 00032 // * 00033 // * Extrapolation is allowed (a warning is given) but the extrapolation 00034 // * is not as well-defined as the interpolation and the results should 00035 // * be used with great care. 00036 // * 00037 // * Data in the underflow and overflow bins are completely ignored. 00038 // * They are neither interpolated nor do they contribute to the 00039 // * normalization of the histograms. 00040 // * 00041 // * Input arguments: 00042 // * ================ 00043 // * chname, chtitle : The ROOT name and title of the interpolated histogram. 00044 // * Defaults for the name and title are "THF1-interpolated" 00045 // * and "Interpolated histogram", respectively. 00046 // * 00047 // * hist1, hist2 : The two input histograms. 00048 // * 00049 // * par1,par2 : The values of the linear parameter that characterises 00050 // * the histograms (e.g. a particle mass). 00051 // * 00052 // * parinterp : The value of the linear parameter we wish to 00053 // * interpolate to. 00054 // * 00055 // * morphedhistnorm : The normalization of the interpolated histogram 00056 // * (default is 1.0). 00057 // * 00058 // * idebug : Default is zero, no internal information displayed. 00059 // * Values between 1 and increase the verbosity of 00060 // * informational output which may prove helpful to 00061 // * understand errors and pathalogical results. 00062 // * 00063 // * The routine returns a pointer (TH1 *) to a new histogram which is 00064 // * the interpolated result. 00065 // * 00066 // *------------------------------------------------------------------------ 00067 // Changes from 0.1 to 0.2: 00068 // o Treatment of empty and non-existing histograms now well-defined. 00069 // o The tricky regions of the first and last bins are improved (and 00070 // well-tested). 00071 // *------------------------------------------------------------------------ 00072