100 #define TUnfold_VERSION "V17.6" 101 #define TUnfold_CLASS_VERSION 17 void GetNormalisationVector(TH1 *s, const Int_t *binMap=0) const
Histogram of truth bins, determined from summing over the response matrix.
void SetBias(const TH1 *bias)
Set bias vector.
EConstraint fConstraint
type of constraint to use for the unfolding
const TMatrixDSparse * GetEinv(void) const
matrix E-1, using internal bin counting
TMatrixDSparse * InvertMSparseSymmPos(const TMatrixDSparse *A, Int_t *rank) const
Get the inverse or pseudo-inverse of a positive, sparse matrix.
static void DeleteMatrix(TMatrixD **m)
delete matrix and invalidate pointer
Int_t GetNdf(void) const
get number of degrees of freedom determined in recent unfolding
TUnfold(void)
Only for use by root streamer or derived classes.
Double_t GetRhoMax(void) const
get maximum global correlation determined in recent unfolding
virtual Int_t ScanLcurve(Int_t nPoint, Double_t tauMin, Double_t tauMax, TGraph **lCurve, TSpline **logTauX=0, TSpline **logTauY=0, TSpline **logTauCurvature=0)
Scan the L curve, determine tau and unfold at the final value of tau.
Int_t fNdf
number of degrees of freedom
Double_t GetRhoIFromMatrix(TH1 *rhoi, const TMatrixDSparse *eOrig, const Int_t *binMap, TH2 *invEmat) const
Get global correlation coefficients with arbitrary min map.
TArrayI fHistToX
mapping of histogram bins to matrix indices
Base class for spline implementation containing the Draw/Paint methods.
TMatrixD * fX
unfolding result x
no regularisation, or defined later by RegularizeXXX() methods
TMatrixDSparse * fDXDtauSquared
derivative of the result wrt tau squared
Int_t RegularizeBins2D(int start_bin, int step1, int nbin1, int step2, int nbin2, ERegMode regmode)
Add regularisation conditions for 2d unfolding.
TMatrixDSparse * MultiplyMSparseMSparse(const TMatrixDSparse *a, const TMatrixDSparse *b) const
Multiply two sparse matrices.
const TMatrixDSparse * GetVxxInv(void) const
inverse of covariance matrix of the result
TMatrixDSparse * MultiplyMSparseM(const TMatrixDSparse *a, const TMatrixD *b) const
Multiply sparse matrix and a non-sparse matrix.
TMatrixDSparse * MultiplyMSparseMSparseTranspVector(const TMatrixDSparse *m1, const TMatrixDSparse *m2, const TMatrixTBase< Double_t > *v) const
Calculate a sparse matrix product where the diagonal matrix V is given by a vector.
TMatrixD * fX0
bias vector x0
Int_t GetBinFromRow(int ix) const
converts matrix row to truth histogram bin number
void GetInputInverseEmatrix(TH2 *ematrix)
Get inverse of the measurement's covariance matrix.
TMatrixDSparse * CreateSparseMatrix(Int_t nrow, Int_t ncol, Int_t nele, Int_t *row, Int_t *col, Double_t *data) const
Create a sparse matrix, given the nonzero elements.
TMatrixDSparse * fDXDAZ[2]
vector contribution to the of derivative dx_k/dA_ij
Array of integers (32 bits per element).
TMatrixDSparse * fL
regularisation conditions L
Double_t GetRhoI(TH1 *rhoi, const Int_t *binMap=0, TH2 *invEmat=0) const
Get global correlation coefficients, possibly cumulated over several bins.
const TMatrixDSparse * GetDXDY(void) const
matrix of derivatives dx/dy
Bool_t AddRegularisationCondition(Int_t i0, Double_t f0, Int_t i1=-1, Double_t f1=0., Int_t i2=-1, Double_t f2=0.)
Add a row of regularisation conditions to the matrix L.
ERegMode fRegMode
type of regularisation
#define ClassDef(name, id)
truth level on x-axis of the response matrix
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t tau
const TMatrixD * GetX(void) const
vector of the unfolding result
TMatrixDSparse * fDXDAM[2]
matrix contribution to the of derivative dx_k/dA_ij
TArrayD fSumOverY
truth vector calculated from the non-normalized response matrix
regularise the amplitude of the output distribution
EHistMap
arrangement of axes for the response matrix (TH2 histogram)
EConstraint
type of extra constraint
virtual Double_t GetLcurveY(void) const
Get value on y-axis of L-curve determined in recent unfolding.
const TMatrixDSparse * GetVxx(void) const
covariance matrix of the result
TMatrixDSparse * MultiplyMSparseTranspMSparse(const TMatrixDSparse *a, const TMatrixDSparse *b) const
Multiply a transposed Sparse matrix with another sparse matrix,.
Int_t RegularizeCurvature(int left_bin, int center_bin, int right_bin, Double_t scale_left=1.0, Double_t scale_right=1.0)
Add a regularisation condition on the curvature of three truth bin.
TArrayI fXToHist
mapping of matrix indices to histogram bins
const TMatrixDSparse * GetDXDAM(int i) const
matrix contributions of the derivative dx/dA
Double_t fChi2A
chi**2 contribution from (y-Ax)Vyy-1(y-Ax)
void SetEpsMatrix(Double_t eps)
set numerical accuracy for Eigenvalue analysis when inverting matrices with rank problems ...
Int_t GetRowFromBin(int ix) const
converts truth histogram bin number to matrix row
truth level on y-axis of the response matrix
ERegMode
choice of regularisation scheme
const TMatrixDSparse * GetDXDtauSquared(void) const
vector of derivative dx/dtauSquared, using internal bin counting
TMatrixDSparse * fVxxInv
inverse of covariance matrix Vxx-1
void GetBias(TH1 *bias, const Int_t *binMap=0) const
Get bias vector including bias scale.
Double_t fRhoMax
maximum global correlation coefficient
TMatrixDSparse * fAx
result x folded back A*x
virtual Int_t SetInput(const TH1 *hist_y, Double_t scaleBias=0.0, Double_t oneOverZeroError=0.0, const TH2 *hist_vyy=0, const TH2 *hist_vyy_inv=0)
Define input data for subsequent calls to DoUnfold(tau).
TMatrixDSparse * fVyyInv
inverse of the input covariance matrix Vyy-1
virtual TString GetOutputBinName(Int_t iBinX) const
Get bin name of an output bin.
virtual Double_t DoUnfold(void)
Core unfolding algorithm.
TMatrixDSparse * fDXDY
derivative of the result wrt dx/dy
Service class for 2-Dim histogram classes.
void GetLsquared(TH2 *lsquared) const
Get matrix of regularisation conditions squared.
Double_t fBiasScale
scale factor for the bias
void ClearHistogram(TH1 *h, Double_t x=0.) const
Initialize bin contents and bin errors for a given histogram.
const TMatrixDSparse * GetVyyInv(void) const
inverse of covariance matrix of the data y
virtual Double_t GetLcurveX(void) const
Get value on x-axis of L-curve determined in recent unfolding.
void InitTUnfold(void)
Initialize data members, for use in constructors.
static const char * GetTUnfoldVersion(void)
Return a string describing the TUnfold version.
static constexpr double m2
TMatrixD * fY
input (measured) data y
regularize the 1st derivative of the output distribution
Double_t fTauSquared
regularisation parameter tau squared
TMatrixDSparse * fVyy
covariance matrix Vyy corresponding to y
enforce preservation of the area
Int_t GetNx(void) const
returns internal number of output (truth) matrix rows
Int_t GetNr(void) const
Get number of regularisation conditions.
mixed regularisation pattern
TMatrixDSparse * fEinv
matrix E^(-1)
virtual void ClearResults(void)
Reset all results.
void GetProbabilityMatrix(TH2 *A, EHistMap histmap) const
Get matrix of probabilities.
Double_t fRhoAvg
average global correlation coefficient
void SetConstraint(EConstraint constraint)
Set type of area constraint.
Double_t fLXsquared
chi**2 contribution from (x-s*x0)TLTL(x-s*x0)
void GetFoldedOutput(TH1 *folded, const Int_t *binMap=0) const
Get unfolding result on detector level.
const TMatrixDSparse * GetDXDAZ(int i) const
vector contributions of the derivative dx/dA
const TMatrixDSparse * GetAx(void) const
vector of folded-back result
static constexpr double s
void GetInput(TH1 *inputData, const Int_t *binMap=0) const
Input vector of measurements.
Int_t RegularizeBins(int start, int step, int nbin, ERegMode regmode)
Add regularisation conditions for a group of bins.
Array of doubles (64 bits per element).
#define TUnfold_CLASS_VERSION
Mother of all ROOT objects.
TMatrixDSparse * fA
response matrix A
void GetRhoIJ(TH2 *rhoij, const Int_t *binMap=0) const
Get correlation coefficients, possibly cumulated over several bins.
Int_t fIgnoredBins
number of input bins which are dropped because they have error=0
Int_t RegularizeDerivative(int left_bin, int right_bin, Double_t scale=1.0)
Add a regularisation condition on the difference of two truth bin.
An algorithm to unfold distributions from detector to truth level.
#define dest(otri, vertexptr)
Double_t fEpsMatrix
machine accuracy used to determine matrix rank after eigenvalue analysis
void GetOutput(TH1 *output, const Int_t *binMap=0) const
Get output distribution, possibly cumulated over several bins.
TMatrixDSparse * fE
matrix E
A Graph is a graphics object made of two arrays X and Y with npoints each.
TMatrixDSparse * fVxx
covariance matrix Vxx
Double_t GetRhoAvg(void) const
get average global correlation determined in recent unfolding
void ErrorMatrixToHist(TH2 *ematrix, const TMatrixDSparse *emat, const Int_t *binMap, Bool_t doClear) const
Add up an error matrix, also respecting the bin mapping.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Int_t GetNy(void) const
returns the number of measurement bins
void AddMSparse(TMatrixDSparse *dest, Double_t f, const TMatrixDSparse *src) const
Add a sparse matrix, scaled by a factor, to another scaled matrix.
Double_t GetChi2L(void) const
Get contribution determined in recent unfolding.
void GetL(TH2 *l) const
Get matrix of regularisation conditions.
regularize the 2nd derivative of the output distribution
Int_t RegularizeSize(int bin, Double_t scale=1.0)
Add a regularisation condition on the magnitude of a truth bin.
Int_t GetNpar(void) const
Get number of truth parameters determined in recent unfolding.
Double_t GetChi2A(void) const
get χ2A contribution determined in recent unfolding
void GetEmatrix(TH2 *ematrix, const Int_t *binMap=0) const
Get output covariance matrix, possibly cumulated over several bins.
Double_t GetTau(void) const
Return regularisation parameter.
Double_t GetEpsMatrix(void) const
get numerical accuracy for Eigenvalue analysis when inverting matrices with rank problems ...
const TMatrixDSparse * GetE(void) const
matrix E, using internal bin counting