19#ifndef ROOT_TUnfoldSys
20#define ROOT_TUnfoldSys
113 ~ TUnfoldSys(
void)
override;
129 const Int_t *binMap=
nullptr);
134 const Int_t *binMap=
nullptr);
#define ClassDefOverride(name, id)
Option_t Option_t TPoint TPoint const char mode
#define TUnfold_CLASS_VERSION
TH1 is the base class of all histogram classes in ROOT.
Service class for 2-D histogram classes.
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
A sorted doubly linked list.
An algorithm to unfold distributions from detector to truth level, with background subtraction and pr...
TMatrixD * fAoutside
Input: underflow/overflow bins.
TMatrixDSparse * fDAinRelSq
Input: normalized errors from input matrix.
TMatrixDSparse * GetSummedErrorMatrixXX(void)
Determine total error matrix on the vector x.
void GetEmatrixSysTau(TH2 *ematrix, const Int_t *binMap=nullptr, Bool_t clearEmat=kTRUE)
Covariance matrix contribution from error on regularisation parameter.
Double_t GetChi2Sys(void)
Calculate total chi**2 including all systematic errors.
void GetEmatrixTotal(TH2 *ematrix, const Int_t *binMap=nullptr)
Get total error matrix, summing up all contributions.
void VectorMapToHist(TH1 *hist_delta, const TMatrixDSparse *delta, const Int_t *binMap)
Map delta to hist_delta, possibly summing up bins.
void ScaleColumnsByVector(TMatrixDSparse *m, const TMatrixTBase< Double_t > *v) const
Scale columns of a matrix by the corresponding rows of a vector.
void GetEmatrixSysBackgroundScale(TH2 *ematrix, const char *source, const Int_t *binMap=nullptr, Bool_t clearEmat=kTRUE)
Covariance contribution from background normalisation uncertainty.
TMap * fDeltaCorrAx
Result: syst.shift from fSysIn on fAx.
TMatrixD * fYData
Input: fY prior to bgr subtraction.
void GetRhoItotal(TH1 *rhoi, const Int_t *binMap=nullptr, TH2 *invEmat=nullptr)
Get global correlatiocn coefficients, summing up all contributions.
void GetEmatrixFromVyy(const TMatrixDSparse *vyy, TH2 *ematrix, const Int_t *binMap, Bool_t clearEmat)
Propagate an error matrix on the input vector to the unfolding result.
void GetBackground(TH1 *bgr, const char *bgrSource=nullptr, const Int_t *binMap=nullptr, Int_t includeError=3, Bool_t clearHist=kTRUE) const
Get background into a histogram.
void InitTUnfoldSys(void)
Initialize pointers and TMaps.
TMatrixDSparse * fVyyData
Input: error on fY prior to bgr subtraction.
TMatrixDSparse * fEmatUncorrAx
Result: syst.error from fDA2 on fAx.
Bool_t GetDeltaSysBackgroundScale(TH1 *delta, const char *source, const Int_t *binMap=nullptr)
Correlated one-sigma shifts from background normalisation uncertainty.
void DoBackgroundSubtraction(void)
Perform background subtraction.
TMatrixDSparse * GetSummedErrorMatrixYY(void)
Determine total error matrix on the vector Ax.
Double_t fDtau
Input: error on tau.
ESysErrMode
type of matrix specified with AddSysError()
@ kSysErrModeRelative
matrix gives the relative shifts
@ kSysErrModeMatrix
matrix is an alternative to the default matrix, the errors are the difference to the original matrix
@ kSysErrModeShift
matrix gives the absolute shifts
virtual TMatrixDSparse * PrepareUncorrEmat(const TMatrixDSparse *m1, const TMatrixDSparse *m2)
Propagate uncorrelated systematic errors to a covariance matrix.
Bool_t GetDeltaSysTau(TH1 *delta, const Int_t *binMap=nullptr)
Correlated one-sigma shifts from shifting tau.
Bool_t GetDeltaSysSource(TH1 *hist_delta, const char *source, const Int_t *binMap=nullptr)
Correlated one-sigma shifts correspinding to a given systematic uncertainty.
void GetEmatrixInput(TH2 *ematrix, const Int_t *binMap=nullptr, Bool_t clearEmat=kTRUE)
Covariance matrix contribution from input measurement uncertainties.
TMatrixDSparse * fEmatUncorrX
Result: syst.error from fDA2 on fX.
void SubtractBackground(const TH1 *hist_bgr, const char *name, Double_t scale=1.0, Double_t scale_error=0.0)
Specify a source of background.
void ClearResults(void) override
Clear all data members which depend on the unfolding results.
TMap * fBgrIn
Input: size of background sources.
TMap * fDeltaCorrX
Result: syst.shift from fSysIn on fX.
TSortedList * GetSysSources(void) const
Get a new list of all systematic uuncertainty sources.
TMatrixD * fDAinColRelSq
Input: normalized column err.sq. (inp.matr.)
TMatrixDSparse * fDeltaSysTau
Result: systematic shift from tau.
void AddSysError(const TH2 *sysError, const char *name, EHistMap histmap, ESysErrMode mode)
Specify a correlated systematic uncertainty.
void SetTauError(Double_t delta_tau)
Specify an uncertainty on tau.
TMap * fBgrErrUncorrInSq
Input: uncorr error squared from bgr sources.
TUnfoldSys(void)
Only for use by root streamer or derived classes.
virtual void PrepareSysError(void)
Matrix calculations required to propagate systematic errors.
Int_t SetInput(const TH1 *hist_y, Double_t scaleBias=0.0, Double_t oneOverZeroError=0.0, const TH2 *hist_vyy=nullptr, const TH2 *hist_vyy_inv=nullptr) override
Define the input data for subsequent calls to DoUnfold(Double_t).
void GetEmatrixSysSource(TH2 *ematrix, const char *source, const Int_t *binMap=nullptr, Bool_t clearEmat=kTRUE)
Covariance contribution from a systematic variation of the response matrix.
void GetEmatrixSysBackgroundUncorr(TH2 *ematrix, const char *source, const Int_t *binMap=nullptr, Bool_t clearEmat=kTRUE)
Covariance contribution from background uncorrelated uncertainty.
void GetEmatrixSysUncorr(TH2 *ematrix, const Int_t *binMap=nullptr, Bool_t clearEmat=kTRUE)
Covariance contribution from uncorrelated uncertainties of the response matrix.
TMap * fBgrErrScaleIn
Input: background sources correlated error.
TSortedList * GetBgrSources(void) const
Get a new list of all background sources.
virtual TMatrixDSparse * PrepareCorrEmat(const TMatrixDSparse *m1, const TMatrixDSparse *m2, const TMatrixDSparse *dsys)
Propagate correlated systematic shift to an output vector.
TMap * fSysIn
Input: correlated errors.
An algorithm to unfold distributions from detector to truth level.
EConstraint
type of extra constraint
@ kEConstraintArea
enforce preservation of the area
ERegMode
choice of regularisation scheme
@ kRegModeSize
regularise the amplitude of the output distribution
EHistMap
arrangement of axes for the response matrix (TH2 histogram)