#ifndef ROOT_TUnfoldDensity
#define ROOT_TUnfoldDensity
#include "TUnfoldSys.h"
#include "TUnfoldBinning.h"
class TUnfoldDensity : public TUnfoldSys {
protected:
const TUnfoldBinning * fConstOutputBins;
const TUnfoldBinning * fConstInputBins;
TUnfoldBinning *fOwnedOutputBins;
TUnfoldBinning *fOwnedInputBins;
TUnfoldBinning *fRegularisationConditions;
public:
enum EDensityMode {
kDensityModeeNone=0,
kDensityModeBinWidth=1,
kDensityModeUser=2,
kDensityModeBinWidthAndUser=3
};
protected:
virtual TString GetOutputBinName(Int_t iBinX) const;
TUnfoldDensity(void);
Double_t GetDensityFactor(EDensityMode densityMode,Int_t iBin) const;
void RegularizeDistributionRecursive
(const TUnfoldBinning *binning,ERegMode regmode,
EDensityMode densityMode,const char *distribution,
const char *axisSteering);
void RegularizeOneDistribution
(const TUnfoldBinning *binning,ERegMode regmode,
EDensityMode densityMode,const char *axisSteering);
public:
TUnfoldDensity(const TH2 *hist_A, EHistMap histmap,
ERegMode regmode = kRegModeCurvature,
EConstraint constraint=kEConstraintArea,
EDensityMode densityMode=kDensityModeBinWidthAndUser,
const TUnfoldBinning *outputBins=0,
const TUnfoldBinning *inputBins=0,
const char *regularisationDistribution=0,
const char *regularisationAxisSteering="*[UOB]");
virtual ~ TUnfoldDensity(void);
void RegularizeDistribution(ERegMode regmode,EDensityMode densityMode,
const char *distribution,
const char *axisSteering);
enum EScanTauMode {
kEScanTauRhoAvg =0,
kEScanTauRhoMax =1,
kEScanTauRhoAvgSys =2,
kEScanTauRhoMaxSys =3,
kEScanTauRhoSquareAvg =4,
kEScanTauRhoSquareAvgSys =5
};
virtual Int_t ScanTau(Int_t nPoint,Double_t tauMin,Double_t tauMax,
TSpline **scanResult,Int_t mode=kEScanTauRhoAvg,
const char *distribution=0,const char *projectionMode=0,TGraph **lCurvePlot=0,TSpline **logTauXPlot=0,TSpline **logTauYPlot=0);
virtual Double_t GetScanVariable(Int_t mode,const char *distribution,const char *projectionMode);
TH1 *GetOutput(const char *histogramName,
const char *histogramTitle=0,const char *distributionName=0,
const char *projectionMode=0,Bool_t useAxisBinning=kTRUE) const;
TH1 *GetBias(const char *histogramName,
const char *histogramTitle=0,const char *distributionName=0,
const char *projectionMode=0,Bool_t useAxisBinning=kTRUE) const;
TH1 *GetFoldedOutput(const char *histogramName,
const char *histogramTitle=0,
const char *distributionName=0,
const char *projectionMode=0,Bool_t useAxisBinning=kTRUE,
Bool_t addBgr=kFALSE) const;
TH1 *GetBackground(const char *histogramName,const char *bgrSource=0,
const char *histogramTitle=0,
const char *distributionName=0,
const char *projectionMode=0,Bool_t useAxisBinning=kTRUE,Int_t includeError=3,
Bool_t clearHist=kTRUE) const;
TH1 *GetInput(const char *histogramName,const char *histogramTitle=0,
const char *distributionName=0,
const char *projectionMode=0,Bool_t useAxisBinning=kTRUE) const;
TH1 *GetDeltaSysSource(const char *source,
const char *histogramName,
const char *histogramTitle=0,
const char *distributionName=0,
const char *projectionMode=0,Bool_t useAxisBinning=kTRUE);
TH1 *GetDeltaSysBackgroundScale(const char *bgrSource,
const char *histogramName,
const char *histogramTitle=0,
const char *distributionName=0,
const char *projectionMode=0,Bool_t useAxisBinning=kTRUE);
TH1 *GetDeltaSysTau(const char *histogramName,
const char *histogramTitle=0,
const char *distributionName=0,
const char *projectionMode=0,Bool_t useAxisBinning=kTRUE);
TH2 *GetEmatrixSysUncorr(const char *histogramName,
const char *histogramTitle=0,
const char *distributionName=0,
const char *projectionMode=0,Bool_t useAxisBinning=kTRUE);
TH2 *GetEmatrixSysBackgroundUncorr(const char *bgrSource,
const char *histogramName,
const char *histogramTitle=0,
const char *distributionName=0,
const char *projectionMode=0,Bool_t useAxisBinning=kTRUE);
TH2 *GetEmatrixInput(const char *histogramName,
const char *histogramTitle=0,
const char *distributionName=0,
const char *projectionMode=0,Bool_t useAxisBinning=kTRUE);
TH2 *GetEmatrixTotal(const char *histogramName,
const char *histogramTitle=0,
const char *distributionName=0,
const char *projectionMode=0,Bool_t useAxisBinning=kTRUE);
TH1 *GetRhoIstatbgr(const char *histogramName,const char *histogramTitle=0,
const char *distributionName=0,
const char *projectionMode=0,Bool_t useAxisBinning=kTRUE,
TH2 **ematInv=0);
TH1 *GetRhoItotal(const char *histogramName,const char *histogramTitle=0,
const char *distributionName=0,
const char *projectionMode=0,Bool_t useAxisBinning=kTRUE,
TH2 **ematInv=0);
TH2 *GetRhoIJtotal(const char *histogramName,
const char *histogramTitle=0,
const char *distributionName=0,
const char *projectionMode=0,Bool_t useAxisBinning=kTRUE);
TH2 *GetL(const char *histogramName,
const char *histogramTitle=0,
Bool_t useAxisBinning=kTRUE);
TH1 *GetLxMinusBias(const char *histogramName,const char *histogramTitle=0);
TH2 *GetProbabilityMatrix(const char *histogramName,
const char *histogramTitle=0,Bool_t useAxisBinning=kTRUE) const;
const TUnfoldBinning *GetInputBinning(const char *distributionName=0) const;
const TUnfoldBinning *GetOutputBinning(const char *distributionName=0) const;
TUnfoldBinning *GetLBinning(void) const { return fRegularisationConditions; }
ClassDef(TUnfoldDensity, TUnfold_CLASS_VERSION)
};
#endif