Reference: Nucl. Instrum. Meth. A372, 469 (1996) [hep-ph/9509307]
TSVDUnfold implements the singular value decomposition based unfolding method (see reference). Currently, the unfolding of one-dimensional histograms is supported, with the same number of bins for the measured and the unfolded spectrum.
The unfolding procedure is based on singular value decomposition of the response matrix. The regularisation of the unfolding is implemented via a discrete minimum-curvature condition.
Monte Carlo inputs:
The measured distribution can be unfolded for any combination of resolution, efficiency and acceptance effects, provided an appropriate definition of xini and Adet.
The unfolding can be performed by
TSVDUnfold *tsvdunf = new TSVDUnfold( bdat, Bcov, bini, xini, Adet ); TH1D* unfresult = tsvdunf->Unfold( kreg );where kreg determines the regularisation of the unfolding. In general, overregularisation (too small kreg) will bias the unfolded spectrum towards the Monte Carlo input, while underregularisation (too large kreg) will lead to large fluctuations in the unfolded spectrum. The optimal regularisation can be determined following guidelines in Nucl. Instrum. Meth. A372, 469 (1996) [hep-ph/9509307] using the distribution of the |d_i|<\tt> that can be obtained by tsvdunf->GetD() and/or using pseudo-experiments.
Covariance matrices on the measured spectrum (for either the total uncertainties or individual sources of uncertainties) can be propagated to covariance matrices using the GetUnfoldCovMatrix method, which uses pseudo experiments for the propagation. In addition, GetAdetCovMatrix allows for the propagation of the statistical uncertainties on the response matrix using pseudo experiments. The covariance matrix corresponding to Bcov is also computed as described in Nucl. Instrum. Meth. A372, 469 (1996) [hep-ph/9509307] and can be obtained from tsvdunf->GetXtau() and its (regularisation independent) inverse from tsvdunf->GetXinv(). The distribution of singular values can be retrieved using tsvdunf->GetSV().
See also the tutorial for a toy example.
TSVDUnfold(const TSVDUnfold& other) | |
TSVDUnfold(const TH1D* bdat, const TH1D* bini, const TH1D* xini, const TH2D* Adet) | |
TSVDUnfold(const TH1D* bdat, TH2D* Bcov, const TH1D* bini, const TH1D* xini, const TH2D* Adet) | |
virtual | ~TSVDUnfold() |
void | TObject::AbstractMethod(const char* method) const |
virtual void | TObject::AppendPad(Option_t* option = "") |
virtual void | TObject::Browse(TBrowser* b) |
static TClass* | Class() |
virtual const char* | TObject::ClassName() const |
virtual void | TObject::Clear(Option_t* = "") |
virtual TObject* | TObject::Clone(const char* newname = "") const |
virtual Int_t | TObject::Compare(const TObject* obj) const |
Double_t | ComputeChiSquared(const TH1D& truspec, const TH1D& unfspec) |
virtual void | TObject::Copy(TObject& object) const |
virtual void | TObject::Delete(Option_t* option = "")MENU |
virtual Int_t | TObject::DistancetoPrimitive(Int_t px, Int_t py) |
virtual void | TObject::Draw(Option_t* option = "") |
virtual void | TObject::DrawClass() constMENU |
virtual TObject* | TObject::DrawClone(Option_t* option = "") constMENU |
virtual void | TObject::Dump() constMENU |
virtual void | TObject::Error(const char* method, const char* msgfmt) const |
virtual void | TObject::Execute(const char* method, const char* params, Int_t* error = 0) |
virtual void | TObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0) |
virtual void | TObject::ExecuteEvent(Int_t event, Int_t px, Int_t py) |
virtual void | TObject::Fatal(const char* method, const char* msgfmt) const |
virtual TObject* | TObject::FindObject(const char* name) const |
virtual TObject* | TObject::FindObject(const TObject* obj) const |
TH2D* | GetAdetCovMatrix(Int_t ntoys, Int_t seed = 1) |
TH2D* | GetBCov() const |
TH1D* | GetD() const |
virtual Option_t* | TObject::GetDrawOption() const |
static Long_t | TObject::GetDtorOnly() |
virtual const char* | TObject::GetIconName() const |
Int_t | GetKReg() const |
virtual const char* | TObject::GetName() const |
virtual char* | TObject::GetObjectInfo(Int_t px, Int_t py) const |
static Bool_t | TObject::GetObjectStat() |
virtual Option_t* | TObject::GetOption() const |
TH1D* | GetSV() const |
virtual const char* | TObject::GetTitle() const |
TH2D* | GetUnfoldCovMatrix(const TH2D* cov, Int_t ntoys, Int_t seed = 1) |
virtual UInt_t | TObject::GetUniqueID() const |
TH2D* | GetXinv() const |
TH2D* | GetXtau() const |
virtual Bool_t | TObject::HandleTimer(TTimer* timer) |
virtual ULong_t | TObject::Hash() const |
virtual void | TObject::Info(const char* method, const char* msgfmt) const |
virtual Bool_t | TObject::InheritsFrom(const char* classname) const |
virtual Bool_t | TObject::InheritsFrom(const TClass* cl) const |
virtual void | TObject::Inspect() constMENU |
void | TObject::InvertBit(UInt_t f) |
virtual TClass* | IsA() const |
virtual Bool_t | TObject::IsEqual(const TObject* obj) const |
virtual Bool_t | TObject::IsFolder() const |
Bool_t | TObject::IsOnHeap() const |
virtual Bool_t | TObject::IsSortable() const |
Bool_t | TObject::IsZombie() const |
virtual void | TObject::ls(Option_t* option = "") const |
void | TObject::MayNotUse(const char* method) const |
virtual Bool_t | TObject::Notify() |
void | TObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const |
static void | TObject::operator delete(void* ptr) |
static void | TObject::operator delete(void* ptr, void* vp) |
static void | TObject::operator delete[](void* ptr) |
static void | TObject::operator delete[](void* ptr, void* vp) |
void* | TObject::operator new(size_t sz) |
void* | TObject::operator new(size_t sz, void* vp) |
void* | TObject::operator new[](size_t sz) |
void* | TObject::operator new[](size_t sz, void* vp) |
TObject& | TObject::operator=(const TObject& rhs) |
virtual void | TObject::Paint(Option_t* option = "") |
virtual void | TObject::Pop() |
virtual void | TObject::Print(Option_t* option = "") const |
virtual Int_t | TObject::Read(const char* name) |
virtual void | TObject::RecursiveRemove(TObject* obj) |
void | TObject::ResetBit(UInt_t f) |
virtual void | TObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU |
virtual void | TObject::SavePrimitive(ostream& out, Option_t* option = "") |
void | TObject::SetBit(UInt_t f) |
void | TObject::SetBit(UInt_t f, Bool_t set) |
virtual void | TObject::SetDrawOption(Option_t* option = "")MENU |
static void | TObject::SetDtorOnly(void* obj) |
void | SetNormalize(Bool_t normalize) |
static void | TObject::SetObjectStat(Bool_t stat) |
virtual void | TObject::SetUniqueID(UInt_t uid) |
virtual void | ShowMembers(TMemberInspector&) |
virtual void | Streamer(TBuffer&) |
void | StreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b) |
virtual void | TObject::SysError(const char* method, const char* msgfmt) const |
Bool_t | TObject::TestBit(UInt_t f) const |
Int_t | TObject::TestBits(UInt_t f) const |
TH1D* | Unfold(Int_t kreg) |
virtual void | TObject::UseCurrentStyle() |
virtual void | TObject::Warning(const char* method, const char* msgfmt) const |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const |
virtual void | TObject::DoError(int level, const char* location, const char* fmt, va_list va) const |
void | TObject::MakeZombie() |
static TVectorD | CompProd(const TVectorD& vec1, const TVectorD& vec2) |
void | FillCurvatureMatrix(TMatrixD& tCurv, TMatrixD& tC) const |
static Double_t | GetCurvature(const TVectorD& vec, const TMatrixD& curv) |
static void | H2M(const TH2D* histo, TMatrixD& mat) |
static void | H2V(const TH1D* histo, TVectorD& vec) |
static void | H2Verr(const TH1D* histo, TVectorD& vec) |
void | InitHistos() |
static void | M2H(const TMatrixD& mat, TH2D& histo) |
static TMatrixD | MatDivVec(const TMatrixD& mat, const TVectorD& vec, Int_t zero = 0) |
static void | RegularisedSymMatInvert(TMatrixDSym& mat, Double_t eps = 1e-3) |
static void | V2H(const TVectorD& vec, TH1D& histo) |
static TVectorD | VecDiv(const TVectorD& vec1, const TVectorD& vec2, Int_t zero = 0) |
enum TObject::EStatusBits { | kCanDelete | |
kMustCleanup | ||
kObjInCanvas | ||
kIsReferenced | ||
kHasUUID | ||
kCannotPick | ||
kNoContextMenu | ||
kInvalidObject | ||
}; | ||
enum TObject::[unnamed] { | kIsOnHeap | |
kNotDeleted | ||
kZombie | ||
kBitMask | ||
kSingleKey | ||
kOverwrite | ||
kWriteDelete | ||
}; |
const TH2D* | fAdet | Detector response matrix |
TH2D* | fBcov | covariance matrix of measured distribution (data) |
const TH1D* | fBdat | measured distribution (data) |
const TH1D* | fBini | reconstructed distribution (MC) |
TH1D* | fDHist | ! Distribution of d (for checking regularization) |
Int_t | fDdim | ! Derivative for curvature matrix |
Int_t | fKReg | ! Regularisation parameter |
Bool_t | fMatToyMode | ! Internal switch for evaluation of statistical uncertainties from response matrix |
Int_t | fNdim | ! Truth and reconstructed dimensions |
Bool_t | fNormalize | ! Normalize unfolded spectrum to 1 |
TH1D* | fSVHist | ! Distribution of singular values |
Bool_t | fToyMode | ! Internal switch for covariance matrix propagation |
TH1D* | fToyhisto | ! Toy MC histogram |
TH2D* | fToymat | ! Toy MC detector response matrix |
const TH1D* | fXini | truth distribution (MC) |
TH2D* | fXinv | ! Computed inverse of covariance matrix |
TH2D* | fXtau | ! Computed regularized covariance matrix |
Alternative constructor User provides data and MC test spectra, as well as detector response matrix, diagonal covariance matrix of measured spectrum built from the uncertainties on measured spectrum
Default constructor Initialisation of TSVDUnfold User provides data and MC test spectra, as well as detector response matrix and the covariance matrix of the measured distribution
Determine for given input error matrix covariance matrix of unfolded spectrum from toy simulation given the passed covariance matrix on measured spectrum "cov" - covariance matrix on the measured spectrum, to be propagated "ntoys" - number of pseudo experiments used for the propagation "seed" - seed for pseudo experiments Note that this covariance matrix will contain effects of forced normalisation if spectrum is normalised to unit area.
Determine covariance matrix of unfolded spectrum from finite statistics in response matrix using pseudo experiments "ntoys" - number of pseudo experiments used for the propagation "seed" - seed for pseudo experiments
Returns the computed regularized covariance matrix corresponding to total uncertainties on measured spectrum as passed in the constructor. Note that this covariance matrix will not contain the effects of forced normalization if spectrum is normalized to unit area.
Divide entries of two vectors
Divide matrix entries by vector
naive regularised inversion cuts off small elements
Helper routine to compute chi-squared between distributions using the computed inverse of the covariance matrix for the unfolded spectrum as given in paper.
Set option to normalize unfolded spectrum to unit area
"normalize" - switch
{ fNormalize = normalize; }