ROOT logo
AliRoot » ANALYSIS » AliUnfolding

class AliUnfolding: public TObject

Function Members (Methods)

public:
virtual~AliUnfolding()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
static voidDrawResults(TH2* correlation, TH1* efficiency, TH1* measured, TH1* initialConditions, TCanvas* canvas = 0, Int_t reuseHists = kFALSE, TH1* unfolded = 0)
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
static Double_tGetAvgResidual()
static Double_tGetChi2FromFit()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
static TH1*GetPenaltyPlot(Double_t* params)
static TH1*GetPenaltyPlot(TH1* corrected)
static Double_tGetPenaltyVal()
static TH1*GetResidualsPlot(Double_t* params)
static TH1*GetResidualsPlot(TH1* corrected)
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
static voidInteractiveUnfold(TH2* correlation, TH1* efficiency, TH1* measured, TH1* initialConditions)
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::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)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
static voidRedrawInteractive()
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
static voidSetBayesianParameters(Float_t smoothing, Int_t nIterations)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
static voidSetChi2Regularization(AliUnfolding::RegularizationType type, Float_t weight)
static voidSetCreateOverflowBin(Float_t overflowBinLimit)
static voidSetDebug(Bool_t flag)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
static voidSetFunction(TF1* function)
static voidSetMinimumInitialValue(Bool_t flag, Float_t value = -1)
static voidSetMinuitMaxIterations(Int_t iter)
static voidSetMinuitPrecision(Float_t pres)
static voidSetMinuitStepSize(Float_t stepSize)
static voidSetMinuitStrategy(Double_t strat)
static voidSetNbins(Int_t nMeasured, Int_t nUnfolded)
static voidSetNormalizeInput(Bool_t flag)
static voidSetNotFoundEvents(Float_t notFoundEvents)
static voidTObject::SetObjectStat(Bool_t stat)
static voidSetPowern(Int_t n)
static voidSetSkip0BinInChi2(Bool_t flag)
static voidSetSkipBinsBegin(Int_t nBins)
static voidSetUnfoldingMethod(AliUnfolding::MethodType methodType)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector&)
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
static Int_tUnfold(TH2* correlation, TH1* efficiency, TH1* measured, TH1* initialConditions, TH1* result, Bool_t check = kFALSE)
static Int_tUnfoldGetBias(TH2* correlation, TH1* efficiency, TH1* measured, TH1* initialConditions, TH1* result)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
AliUnfolding()
static voidChi2Function(Int_t&, Double_t*, Double_t& chi2, Double_t* params, Int_t)
static voidCreateOverflowBin(TH2* correlation, TH1* measured)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
static voidDrawGuess(Double_t* params, TVirtualPad* pfolded = 0, TVirtualPad* pres = 0, TVirtualPad* ppen = 0, Int_t reuseHists = kFALSE, TH1* unfolded = 0)
static voidMakePads()
voidTObject::MakeZombie()
static Double_tRegularizationEntropy(TVectorD& params)
static Double_tRegularizationLog(TVectorD& params)
static Double_tRegularizationLogLog(TVectorD& params)
static Double_tRegularizationPol0(TVectorD& params)
static Double_tRegularizationPol1(TVectorD& params)
static Double_tRegularizationPowerLaw(TVectorD& params)
static Double_tRegularizationRatio(TVectorD& params)
static Double_tRegularizationTotalCurvature(TVectorD& params)
static voidSetStaticVariables(TH2* correlation, TH1* measured, TH1* efficiency)
static voidTF1Function(Int_t& unused1, Double_t* unused2, Double_t& chi2, Double_t* params, Int_t unused3)
static Int_tUnfoldWithBayesian(TH2* correlation, TH1* aEfficiency, TH1* measured, TH1* initialConditions, TH1* aResult)
static Int_tUnfoldWithFunction(TH2* correlation, TH1* efficiency, TH1* measured, TH1*, TH1* aResult)
static Int_tUnfoldWithMinuit(TH2* correlation, TH1* efficiency, TH1* measured, TH1* initialConditions, TH1* result, Bool_t check)

Data Members

public:
enum RegularizationType { kNone
kPol0
kPol1
kLog
kEntropy
kCurvature
kRatio
kPowerLaw
kLogLog
};
enum MethodType { kInvalid
kChi2Minimization
kBayesian
kFunction
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
static Double_tfAvgResidualSum residuals / nbins
static Double_tfChi2FromFitChi2 from fit at current iteration
static Double_tfPenaltyValPenalty value at current iteration (\beta * PU)
static Int_tfgBayesianIterationsnumber of iterations in Bayesian method
static Float_tfgBayesianSmoothingsmoothing parameter (0 = no smoothing)
static Int_tfgCallCountcall count to chi2 function
static TCanvas*fgCanvasCanvas for interactive unfolder
static TMatrixD*fgCorrelationCovarianceMatrixcontains the errors of fCurrentESD
static TMatrixD*fgCorrelationMatrixcontains fCurrentCorrelation in matrix form
static TMatrixD*fgCorrelationMatrixSquaredcontains squared fCurrentCorrelation in matrix form
static TVectorD*fgCurrentESDVectorcontains fCurrentESD
static Bool_tfgDebugdebug flag
static TVectorD*fgEfficiencyefficiency
static TVectorD*fgEntropyAPrioria-priori distribution for entropy regularization
static TF1*fgFitFunctionfit function
static Int_tfgMaxInputbins in measured histogram
static Int_tfgMaxParamsbins in unfolded histogram = number of fit params
static TAxis*fgMeasuredAxisbin widths and positions for measured
static AliUnfolding::MethodTypefgMethodTypeunfolding method to be used
static Bool_tfgMinimumInitialValueset all initial values at least to the smallest value among the initial values
static Float_tfgMinimumInitialValueFixuse this as the minimum initial value instead of determining it automatically
static Int_tfgMinuitMaxIterationsmaximum number of iterations used by minuit. default = 5000
static Float_tfgMinuitPrecisionprecision used by minuit. default = 1e-6
static Float_tfgMinuitStepSize(usually not needed to be changed) step size in minimization
static Double_tfgMinuitStrategyminuit strategy: 0 (low), 1 (default), 2 (high)
static Bool_tfgNormalizeInputnormalize input spectrum
static Float_tfgNotFoundEventsconstraint on the total number of not found events sum(guess * (1/eff -1))
static Float_tfgOverflowBinLimitto fix fluctuations at high multiplicities, all entries above the limit are summarized in one bin
static Int_tfgPowernpower of power law for regularization with power law
static Int_tfgPrintChi2Detailsdebug for chi2 calc
static AliUnfolding::RegularizationTypefgRegularizationTyperegularization that is used during Chi2 method
static Float_tfgRegularizationWeightfactor for regularization term
static Bool_tfgSkipBin0InChi2skip bin 0 (= 0 measured) in chi2 function
static Int_tfgSkipBinsBegin(optional) skip the given number of bins in the regularization
static TAxis*fgUnfoldedAxisbin widths and positions for unfolded
static TH2*fghCorrelationResponse matrix for interactive unfolder
static TH1*fghEfficiencyEfficiency histo for interactive unfolder
static TH1*fghMeasuredMeasured distribution for interactive unfolder
static TH1*fghUnfoldedUnfolding result for interactive unfolder

Class Charts

Inheritance Chart:
TObject
AliUnfolding

Function documentation

void SetUnfoldingMethod(AliUnfolding::MethodType methodType)
 set unfolding method
void SetCreateOverflowBin(Float_t overflowBinLimit)
 enable the creation of a overflow bin that includes all statistics below the given limit
void SetSkipBinsBegin(Int_t nBins)
 set number of skipped bins in regularization
void SetNbins(Int_t nMeasured, Int_t nUnfolded)
 set number of bins in the input (measured) distribution and in the unfolded distribution
void SetChi2Regularization(AliUnfolding::RegularizationType type, Float_t weight)
 sets the parameters for chi2 minimization

void SetBayesianParameters(Float_t smoothing, Int_t nIterations)
 sets the parameters for Bayesian unfolding

void SetFunction(TF1* function)
 set function for unfolding with a fit function
Int_t Unfold(TH2* correlation, TH1* efficiency, TH1* measured, TH1* initialConditions, TH1* result, Bool_t check = kFALSE)
 unfolds with unfolding method fgMethodType

 parameters:
  correlation: response matrix as measured vs. generated
  efficiency:  (optional) efficiency that is applied on the unfolded spectrum, i.e. it has to be in unfolded variables. If 0 no efficiency is applied.
  measured:    the measured spectrum
  initialConditions: (optional) initial conditions for the unfolding. if 0 the measured spectrum is used as initial conditions.
  result:      target for the unfolded result
  check:       depends on the unfolding method, see comments in specific functions

  return code: see UnfoldWithMinuit/UnfoldWithBayesian/UnfoldWithFunction
void SetStaticVariables(TH2* correlation, TH1* measured, TH1* efficiency)
 fill static variables needed for minuit fit
Int_t UnfoldWithMinuit(TH2* correlation, TH1* efficiency, TH1* measured, TH1* initialConditions, TH1* result, Bool_t check)
 implementation of unfolding (internal function)

 unfolds <measured> using response from <correlation> and effiency <efficiency>
 output is in <result>
 <initialConditions> set the initial values for the minimization, if 0 <measured> is used
   negative values in initialConditions mean that the given parameter is fixed to the absolute of the value
 if <check> is true no unfolding is made, instead only the chi2 without unfolding is printed

 returns minuit status (0 = success), (-1 when check was set)

Int_t UnfoldWithBayesian(TH2* correlation, TH1* aEfficiency, TH1* measured, TH1* initialConditions, TH1* aResult)
 unfolds a spectrum using the Bayesian method

Double_t RegularizationPol0(TVectorD& params)
 homogenity term for minuit fitting
 pure function of the parameters
 prefers constant function (pol0)

 Does not take into account efficiency
Double_t RegularizationPol1(TVectorD& params)
 homogenity term for minuit fitting
 pure function of the parameters
 prefers linear function (pol1)

 Does not take into account efficiency
Double_t RegularizationLog(TVectorD& params)
 homogenity term for minuit fitting
 pure function of the parameters
 prefers logarithmic function (log)

 Does not take into account efficiency
Double_t RegularizationTotalCurvature(TVectorD& params)
 homogenity term for minuit fitting
 pure function of the parameters
 minimizes the total curvature (from Unfolding Methods In High-Energy Physics Experiments,
 V. Blobel (Hamburg U.) . DESY 84/118, Dec 1984. 40pp.

 Does not take into account efficiency
Double_t RegularizationEntropy(TVectorD& params)
 homogenity term for minuit fitting
 pure function of the parameters
 calculates entropy, from
 The method of reduced cross-entropy (M. Schmelling 1993)

 Does not take into account efficiency
Double_t RegularizationRatio(TVectorD& params)
 homogenity term for minuit fitting
 pure function of the parameters

 Does not take into account efficiency
Double_t RegularizationPowerLaw(TVectorD& params)
 homogenity term for minuit fitting
 pure function of the parameters
 prefers power law with n = -5

 Does not take into account efficiency
Double_t RegularizationLogLog(TVectorD& params)
 homogenity term for minuit fitting
 pure function of the parameters
 prefers a powerlaw (linear on a log-log scale)

 The calculation takes into account the efficiencies
void Chi2Function(Int_t& , Double_t* , Double_t& chi2, Double_t* params, Int_t )
 fit function for minuit
 does: (m - Ad)W(m - Ad) where m = measured, A correlation matrix, d = guess, W = covariance matrix

void MakePads()
void DrawResults(TH2* correlation, TH1* efficiency, TH1* measured, TH1* initialConditions, TCanvas* canvas = 0, Int_t reuseHists = kFALSE, TH1* unfolded = 0)
 Draw histograms of
   - Result folded with response
   - Penalty factors
   - Chisquare contributions
 (Useful for debugging/sanity checks and the interactive unfolder)

 If a canvas pointer is given (canv != 0), it will be used for all
 plots; 3 pads are made if needed.
void RedrawInteractive()
 Helper function for interactive unfolding

void InteractiveUnfold(TH2* correlation, TH1* efficiency, TH1* measured, TH1* initialConditions)
 Function to do interactive unfolding
 A canvas is drawn with the unfolding result
 Change the histogram with your mouse and all histograms
 will be updated automatically
void DrawGuess(Double_t* params, TVirtualPad* pfolded = 0, TVirtualPad* pres = 0, TVirtualPad* ppen = 0, Int_t reuseHists = kFALSE, TH1* unfolded = 0)
 draws residuals of solution suggested by params and effect of regularization

TH1* GetResidualsPlot(TH1* corrected)
 MvL: THIS MUST BE INCORRECT.
 Need heff to calculate params from TH1 'corrected'

TH1* GetResidualsPlot(Double_t* params)
 fill residuals histogram of solution suggested by params and effect of regularization

TH1* GetPenaltyPlot(TH1* corrected)
 draws the penalty factors as function of multiplicity of the current selected regularization
TH1* GetPenaltyPlot(Double_t* params)
 draws the penalty factors as function of multiplicity of the current selected regularization
void TF1Function(Int_t& unused1, Double_t* unused2, Double_t& chi2, Double_t* params, Int_t unused3)
 fit function for minuit
 uses the TF1 stored in fgFitFunction

Int_t UnfoldWithFunction(TH2* correlation, TH1* efficiency, TH1* measured, TH1* , TH1* aResult)
 correct spectrum using minuit chi2 method applying a functional fit

void CreateOverflowBin(TH2* correlation, TH1* measured)
 Finds the first bin where the content is below fgStatLimit and combines all values for this bin and larger bins
 The same limit is applied to the correlation
Int_t UnfoldGetBias(TH2* correlation, TH1* efficiency, TH1* measured, TH1* initialConditions, TH1* result)
 unfolds and assigns bias as errors with Eq. 19 of Cowan, "a survey of unfolding methods for particle physics"
 b_i = sum_j dmu_i/dn_j (nu_j - n_j) with nu_j as folded guess, n_j as data
 dmu_i/dn_j is found numerically by changing the bin content and re-unfolding

 return code: 0 (success) -1 (error: from Unfold(...) )
virtual ~AliUnfolding()
{}
void SetMinuitStepSize(Float_t stepSize)
{ fgMinuitStepSize = stepSize; }
void SetMinuitPrecision(Float_t pres)
void SetMinuitMaxIterations(Int_t iter)
void SetMinuitStrategy(Double_t strat)
{fgMinuitStrategy = strat;}
void SetMinimumInitialValue(Bool_t flag, Float_t value = -1)
void SetNormalizeInput(Bool_t flag)
{ fgNormalizeInput = flag; }
void SetNotFoundEvents(Float_t notFoundEvents)
{ fgNotFoundEvents = notFoundEvents; }
void SetSkip0BinInChi2(Bool_t flag)
{ fgSkipBin0InChi2 = flag; }
void SetDebug(Bool_t flag)
{ fgDebug = flag; }
void SetPowern(Int_t n)
{fgPowern = -1*n;}
Double_t GetChi2FromFit()
{return fChi2FromFit;}
Double_t GetPenaltyVal()
{return fPenaltyVal;}
Double_t GetAvgResidual()
{return fAvgResidual;}
AliUnfolding()
{}
AliUnfolding(const AliUnfolding& )
AliUnfolding& operator=(const AliUnfolding& )