ROOT logo
AliRoot » PWG » TOOLS » AliPWGHistoTools

class AliPWGHistoTools: public TObject

                     AliPWGHistoTools

 This class provides some tools which can be useful in the analsis
 of spectra, to fit or transform histograms. See the comments of the
 individual methods for details

 Author: M. Floris (CERN)

Function Members (Methods)

public:
AliPWGHistoTools()
virtual~AliPWGHistoTools()
voidTObject::AbstractMethod(const char* method) const
static TGraphErrors*Add2Graphs(const TGraphErrors* g1, const TGraphErrors* g2)
static voidAddHisto(TH1* hdest, const TH1* hsource, Bool_t getMirrorBins = kFALSE)
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
static TH1F*Combine3HistosWithErrors(const TH1* h1, const TH1* h2, const TH1* h3, TH1* he1, TH1* he2, TH1* he3, const TH1* htemplate, Int_t statFrom = 0, Float_t renorm1 = 1., Float_t renorm2 = 1., Float_t renorm3 = 1., TH1** hSyst = 0, Bool_t errorFromBinContent = kFALSE)
static TH1F*CombineHistos(const TH1* h1, TH1* h2, const TH1* htemplate, Float_t renorm1 = 1.)
virtual Int_tTObject::Compare(const TObject* obj) const
static TGraphErrors*ConcatenateGraphs(const TGraphErrors* g1, const TGraphErrors* g2)
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
static TGraphErrors*Divide2Graphs(const TGraph* g1, const TGraph* g2, Int_t strategy)
static TGraphErrors*DivideGraphByFunc(const TGraphErrors* g, const TF1* f, Bool_t invert = kFALSE)
static TGraphErrors*DivideGraphByHisto(const TGraphErrors* g, TH1* h, Bool_t invert = kFALSE)
static TH1F*DivideHistoByFunc(TH1F* h, TF1* f, Bool_t invert = kFALSE)
static TH1F*DivideHistosDifferentBins(const TH1F* h1, const TH1F* h2)
static Double_tdMtdptFunction(Double_t* x, Double_t* p)
static Double_tDoIntegral(TH1* h, Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Int_t binz1, Int_t binz2, Double_t& error, Option_t* option, Bool_t doError)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
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 Bool_tFit(TH1* h, TF1* f, Float_t min, Float_t max)
static Double_tGetdMtdEta(TH1* hData, TF1* fExtrapolation, Double_t mass)
static TH1*GetdNdmtFromdNdpt(const TH1* hpt, Double_t mass)
static TH1*GetdNdptFromdNdmt(const TH1* hmt, Double_t mass)
static TH1*GetdNdPtFromOneOverPt(const TH1* h1Pt)
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
static voidGetFromHistoGraphDifferentX(const TH1F* h, TF1* f, TGraphErrors** gBarycentre, TGraphErrors** gXlw)
static TGraphErrors*GetGraphFromHisto(const TH1F* h, Bool_t binWidth = kTRUE)
static Int_tGetHighestNotEmptyBin(const TH1* h)
static Float_tGetHighestNotEmptyBinEdge(const TH1* h)
static voidGetHistoCombinedErrors(TH1* hdest, const TH1* h1)
static TH1F*GetHistoFromGraph(const TGraphErrors* g, const TH1F* hTemplate)
virtual const char*TObject::GetIconName() const
static Int_tGetLowestNotEmptyBin(const TH1* h)
static Float_tGetLowestNotEmptyBinEdge(const TH1* h)
static Float_tGetMean(TH1F* h, Float_t min, Float_t max, Float_t* error = NULL)
static voidGetMean(TF1* func, Float_t& mean, Float_t& error, Float_t min = 0, Float_t max = 100, Int_t normPar = -1)
static voidGetMeanDataAndExtrapolation(const TH1* hData, TF1* fExtrapolation, Double_t& mean, Double_t& error, Float_t min = 0, Float_t max = 100)
static voidGetMeanSquare(TF1* func, Float_t& mean, Float_t& error, Float_t min = 0, Float_t max = 100, Int_t normPar = -1)
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
static TH1*GetOneOverPtdNdPt(const TH1* hPt)
virtual Option_t*TObject::GetOption() const
static TH1*GetRelativeError(TH1* h)
static voidGetResiduals(const TGraphErrors* gdata, const TF1* func, TH1F** hres, TGraphErrors** gres)
static voidGetResiduals(const TH1F* hdata, const TF1* func, TH1F** hres, TH1F** hresVsBin)
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
static voidGetValueAndError(TH1* hdest, const TH1* hvalue, const TH1* herror, Bool_t isPercentError)
static voidGetYield(TH1* h, TF1* f, Double_t& yield, Double_t& yieldError, Float_t min = 0, Float_t max = 100, Double_t* partialYields = 0, Double_t* partialYieldsErrors = 0)
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
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)
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 voidScaleGraph(TGraph* g1, Double_t scale)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
static voidTObject::SetObjectStat(Bool_t stat)
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
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
static voidWeightedMean(Int_t npoints, const Double_t* x, const Double_t* xerr, Double_t& mean, Double_t& meanerr)
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:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
private:
AliPWGHistoTools(const AliPWGHistoTools&)
static voidGetMoment(TString name, TString var, TF1* func, Float_t& mean, Float_t& error, Float_t min, Float_t max, Int_t normPar = -1)
AliPWGHistoTools&operator=(const AliPWGHistoTools&)

Data Members

private:
static TF1*fdNdptForETCalc

Class Charts

Inheritance Chart:
TObject
AliPWGHistoTools

Function documentation

AliPWGHistoTools()
 ctor
~AliPWGHistoTools()
 dtor
TH1 * GetdNdmtFromdNdpt(const TH1* hpt, Double_t mass)
 convert the x axis from pt to mt. Assumes you have 1/pt dNdpt in the histo you start with
TH1 * GetdNdptFromdNdmt(const TH1* hmt, Double_t mass)
 convert the x axis from mt to pt. Assumes you have 1/mt dNdmt in the histo you start with
TH1 * GetdNdPtFromOneOverPt(const TH1* h1Pt)
TH1 * GetOneOverPtdNdPt(const TH1* hPt)
TGraphErrors * GetGraphFromHisto(const TH1F* h, Bool_t binWidth = kTRUE)
 Convert a histo to a graph
 if binWidth is true ex is set to the bin width of the histos, otherwise it is set to zero
TH1F * GetHistoFromGraph(const TGraphErrors* g, const TH1F* hTemplate)
TGraphErrors * ConcatenateGraphs(const TGraphErrors* g1, const TGraphErrors* g2)
TH1F * Combine3HistosWithErrors(const TH1* h1, const TH1* h2, const TH1* h3, TH1* he1, TH1* he2, TH1* he3, const TH1* htemplate, Int_t statFrom = 0, Float_t renorm1 = 1., Float_t renorm2 = 1., Float_t renorm3 = 1., TH1** hSyst = 0, Bool_t errorFromBinContent = kFALSE)
 Combines 3 histos (h1,h2,h3), weighting by the errors provided in
 he1,he2,he3, supposed to be the independent systematic errors.
 he1,he2,he3 are also assumed to have the same binning as h1,h2,h3
 The combined histo must fit the template provided (no check is performed on this)
 The histogram are supposed to come from the same (nearly) sample
 of tracks. statFrom tells the stat error of which of the 3 is
 going to be assigned to the combined
 Optionally, it is possible to rescale any of the histograms.
 if hSyst is give, the histo is filled with combined syst error vs pt
 if errorFromBinContent is true, the weights are taken from the he* content rather than errors
void GetMeanDataAndExtrapolation(const TH1* hData, TF1* fExtrapolation, Double_t& mean, Double_t& error, Float_t min = 0, Float_t max = 100)
 Computes the mean of the combined data and extrapolation in a
 given range, use data where they are available and the function
 where data are not available
 ERROR from DATA ONLY is returned in this version!

TH1F * CombineHistos(const TH1* h1, TH1* h2, const TH1* htemplate, Float_t renorm1 = 1.)
 Combine two histos. This assumes the histos have the same binning
 in the overlapping region. It computes the arithmetic mean in the
 overlapping region and assigns as an error the relative error
 h2. TO BE IMPROVED
void GetFromHistoGraphDifferentX(const TH1F* h, TF1* f, TGraphErrors** gBarycentre, TGraphErrors** gXlw)
Float_t GetMean(TH1F* h, Float_t min, Float_t max, Float_t* error = NULL)
void GetMean(TF1* func, Float_t& mean, Float_t& error, Float_t min = 0, Float_t max = 100, Int_t normPar = -1)
void GetMeanSquare(TF1* func, Float_t& mean, Float_t& error, Float_t min = 0, Float_t max = 100, Int_t normPar = -1)
void GetMoment(TString name, TString var, TF1* func, Float_t& mean, Float_t& error, Float_t min, Float_t max, Int_t normPar = -1)
Bool_t Fit(TH1* h, TF1* f, Float_t min, Float_t max)
Int_t GetLowestNotEmptyBin(const TH1* h)
Int_t GetHighestNotEmptyBin(const TH1* h)
void GetResiduals(const TGraphErrors* gdata, const TF1* func, TH1F** hres, TGraphErrors** gres)
void GetResiduals(const TH1F* hdata, const TF1* func, TH1F** hres, TH1F** hresVsBin)
void GetYield(TH1* h, TF1* f, Double_t& yield, Double_t& yieldError, Float_t min = 0, Float_t max = 100, Double_t* partialYields = 0, Double_t* partialYieldsErrors = 0)
 Returns the yield extracted from the data in the histo where
 there are points and from the fit to extrapolate, in the given
 range.
 Partial yields are also returned if the corresponding pointers are non null
TGraphErrors * DivideGraphByFunc(const TGraphErrors* g, const TF1* f, Bool_t invert = kFALSE)
TGraphErrors * Divide2Graphs(const TGraph* g1, const TGraph* g2, Int_t strategy)
TGraphErrors * Add2Graphs(const TGraphErrors* g1, const TGraphErrors* g2)
TGraphErrors * DivideGraphByHisto(const TGraphErrors* g, TH1* h, Bool_t invert = kFALSE)
TH1F * DivideHistoByFunc(TH1F* h, TF1* f, Bool_t invert = kFALSE)
void WeightedMean(Int_t npoints, const Double_t* x, const Double_t* xerr, Double_t& mean, Double_t& meanerr)
TH1 * GetRelativeError(TH1* h)
 Returns an histogram with the same binning as h, filled with the relative error bin by bin
void GetValueAndError(TH1* hdest, const TH1* hvalue, const TH1* herror, Bool_t isPercentError)
void AddHisto(TH1* hdest, const TH1* hsource, Bool_t getMirrorBins = kFALSE)
void GetHistoCombinedErrors(TH1* hdest, const TH1* h1)
TH1F * DivideHistosDifferentBins(const TH1F* h1, const TH1F* h2)
 Divides 2 histos even if they have a different binning. Finds
 overlapping bins and divides them
Double_t DoIntegral(TH1* h, Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Int_t binz1, Int_t binz2, Double_t& error, Option_t* option, Bool_t doError)
 function to compute integral and optionally the error  between the limits
 specified by the bin number values working for all histograms (1D, 2D and 3D)
 copied from TH! to fix a bug still present in 5-27-06b
Double_t dMtdptFunction(Double_t* x, Double_t* p)
Double_t GetdMtdEta(TH1* hData, TF1* fExtrapolation, Double_t mass)
 Computes dMtdEta integrating dN/dptdy with the proper weights and jacobian.
void ScaleGraph(TGraph* g1, Double_t scale)
AliPWGHistoTools()
Float_t GetLowestNotEmptyBinEdge(const TH1* h)
{ return h->GetBinLowEdge(GetLowestNotEmptyBin(h));}
Float_t GetHighestNotEmptyBinEdge(const TH1* h)
{ return h->GetBinLowEdge(GetHighestNotEmptyBin(h)+1);}
AliPWGHistoTools& operator=(const AliPWGHistoTools& )