#ifndef ROOT_TUnfold
#define ROOT_TUnfold
#include <TH1D.h>
#include <TH2D.h>
#include <TObject.h>
#include <TArrayI.h>
#include <TSpline.h>
#include <TMatrixDSparse.h>
#include <TMatrixD.h>
class TUnfold:public TObject {
private:
void ClearTUnfold(void);
protected:
TMatrixDSparse * fA;
TMatrixDSparse *fLsquared;
TMatrixDSparse *fV;
TMatrixD *fY;
TMatrixD *fX0;
Double_t fTau;
Double_t fBiasScale;
TArrayI fXToHist;
TArrayI fHistToX;
TMatrixDSparse *fEinv;
TMatrixD *fE;
TMatrixD *fX;
TMatrixDSparse *fAx;
Double_t fChi2A;
Double_t fChi2L;
Double_t fRhoMax;
Double_t fRhoAvg;
protected:
TUnfold(void);
virtual Double_t DoUnfold(void);
virtual void CalculateChi2Rho(void);
static TMatrixDSparse *CreateSparseMatrix(Int_t nr, Int_t nc, Int_t * row, Int_t * col, Double_t const *data);
inline Int_t GetNx(void) const {
return fA->GetNcols();
}
inline Int_t GetNy(void) const {
return fA->GetNrows();
}
public:
enum EHistMap {
kHistMapOutputHoriz = 0,
kHistMapOutputVert = 1
};
enum ERegMode {
kRegModeNone = 0,
kRegModeSize = 1,
kRegModeDerivative = 2,
kRegModeCurvature = 3
};
TUnfold(TH2 const *hist_A, EHistMap histmap, ERegMode regmode = kRegModeSize);
virtual ~ TUnfold(void);
void SetBias(TH1 const *bias);
void RegularizeSize(int bin, Double_t const &scale = 1.0);
void RegularizeDerivative(int left_bin, int right_bin, Double_t const &scale = 1.0);
void RegularizeCurvature(int left_bin, int center_bin, int right_bin, Double_t const &scale_left = 1.0, Double_t const &scale_right = 1.0);
void RegularizeBins(int start, int step, int nbin, ERegMode regmode);
void RegularizeBins2D(int start_bin, int step1, int nbin1, int step2, int nbin2, ERegMode regmode);
Double_t DoUnfold(Double_t const &tau,
TH1 const *hist_y, Double_t const &scaleBias=0.0);
void SetInput(TH1 const *hist_y, Double_t const &scaleBias=0.0);
virtual Double_t DoUnfold(Double_t const &tau);
virtual Int_t ScanLcurve(Int_t nPoint,Double_t const &tauMin,
Double_t const &tauMax,TGraph **lCurve,
TSpline **logTauX=0,TSpline **logTauY=0);
TH1D *GetOutput(char const *name, char const *title, Double_t x0 = 0.0, Double_t x1 = 0.0) const;
TH1D *GetBias(char const *name, char const *title, Double_t x0 = 0.0, Double_t x1 = 0.0) const;
TH1D *GetFoldedOutput(char const *name, char const *title, Double_t y0 = 0.0, Double_t y1 = 0.0) const;
TH1D *GetInput(char const *name, char const *title, Double_t y0 = 0.0, Double_t y1 = 0.0) const;
TH2D *GetRhoIJ(char const *name, char const *title, Double_t x0 = 0.0, Double_t x1 = 0.0) const;
TH2D *GetEmatrix(char const *name, char const *title, Double_t x0 = 0.0, Double_t x1 = 0.0) const;
TH1D *GetRhoI(char const *name, char const *title, Double_t x0 = 0.0, Double_t x1 = 0.0) const;
TH2D *GetLsquared(char const *name, char const *title, Double_t x0 = 0.0, Double_t x1 = 0.0) const;
void GetOutput(TH1 *output,Int_t const *binMap=0) const;
void GetEmatrix(TH2 *ematrix,Int_t const *binMap=0) const;
Double_t GetRhoI(TH1 *rhoi,TH2 *ematrixinv=0,Int_t const *binMap=0) const;
void GetRhoIJ(TH2 *rhoij,Int_t const *binMap=0) const;
Double_t const &GetTau(void) const;
Double_t const &GetRhoMax(void) const;
Double_t const &GetRhoAvg(void) const;
Double_t const &GetChi2A(void) const;
Double_t const &GetChi2L(void) const;
Double_t GetLcurveX(void) const;
Double_t GetLcurveY(void) const;
ClassDef(TUnfold, 0)
};
#endif
Last change: Mon Nov 24 08:20:09 2008
Last generated: 2008-11-24 08:20
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.