ROOT logo
AliRoot » PWGDQ » DIELECTRON » AliDielectronSignalFunc

class AliDielectronSignalFunc: public AliDielectronSignalExt

Dielectron SignalFunc




  Class used for extracting the signal from an invariant mass spectrum.
  It implements the AliDielectronSignalBase and -Ext classes and it uses user provided
  functions to fit the spectrum with a combined signa+background fit.
  Used invariant mass spectra are provided via an array of histograms. There are serveral method
  to estimate the background and to extract the raw yield from the background subtracted spectra.

  Example usage:

  AliDielectronSignalFunc *sig = new AliDielectronSignalFunc();


  1) invariant mass input spectra

  1.1) Assuming a AliDielectronCF container as data format (check class for more details)
  AliDielectronCFdraw *cf = new AliDielectronCFdraw("path/to/the/output/file.root");
  TObjArray *arrHists = cf->CollectMinvProj(cf->FindStep("Config"));

  1.2) Assuming a AliDielectronHF grid as data format (check class for more details)
  AliDielectronHFhelper *hf = new AliDielectronHFhelper("path/to/the/output/file.root", "ConfigName");
  TObjArray *arrHists = hf->CollectHistos(AliDielectronVarManager::kM);

  1.3) Assuming a single histograms
  TObjArray *histoArray = new TObjArray();
  arrHists->Add(signalPP);            // add the spectrum histograms to the array
  arrHists->Add(signalPM);            // the order is important !!!
  arrHists->Add(signalMM);


  2) background estimation

  2.1) set the method for the background estimation (methods can be found in AliDielectronSignalBase)
  sig->SetMethod(AliDielectronSignalBase::kFitted);
  2.2) rebin the spectras if needed
  //  sig->SetRebin(2);
  2.3) add any background function you like
  TF1 *fB = new TF1("fitBgrd","pol3",minFit,maxFit);


  3) configure the signal extraction

  3.1) chose one of the signal functions (MCshape, CrystalBall, Gauss)
  TF1 *fS = new TF1("fitSign",AliDielectronSignalFunc::PeakFunCB,minFit,maxFit,5); // has 5 parameters
  //  TF1 *fS = new TF1("fitSign",AliDielectronSignalFunc::PeakFunGaus,minFit,maxFit,3); // has 3 parameters
  //  sig->SetMCSignalShape(hMCsign);
  //  TF1 *fS = new TF1("fitSign",AliDielectronSignalFunc::PeakFunMC,minFit,maxFit,1); // requires a MC shape
  3.2) set the method for the signal extraction (methods can be found in AliDielectronSignalBase)
  depending on the method serveral inputs are needed (e.g. MC shape, PDG code of the particle of interest)
  //  sig->SetParticleOfInterest(443); //default is jpsi
  //  sig->SetMCSignalShape(signalMC);
  //  sig->SetIntegralRange(minInt, maxInt);
  sig->SetExtractionMethod(AliDielectronSignal::BinCounting); // this is the default


  4) combined fit of bgrd+signal

  4.1) combine the two functions
  sig->CombineFunc(fS,fB);
  4.2) apply fitting ranges and the fit options
  sig->SetFitRange(minFit, maxFit);
  sig->SetFitOption("NR");


  5) start the processing

  sig->Process(arrHists);
  sig->Print(""); // print values and errors extracted


  6) access the spectra and values created

  6.1) standard spectra as provided filled in AliDielectronSignalExt
  TH1F *hsign = (TH1F*) sig->GetUnlikeSignHistogram();  // same as the input (rebinned)
  TH1F *hbgrd = (TH1F*) sig->GetBackgroundHistogram();  // filled histogram with fitBgrd
  TH1F *hextr = (TH1F*) sig->GetSignalHistogram();      // after backgound extraction (rebinned)
  TObject *oPeak = (TObject*) sig->GetPeakShape();      // can be a TF1 or TH1 depending on the method
  6.2) flow spectra
  TF1 *fFitSign  = sig->GetCombinedFunction();                // combined fit function
  TF1 *fFitExtr  = sig->GetSignalFunction();                  // signal function
  TF1 *fFitBgrd  = sig->GetBackgroundFunction();              // background function
  6.3) access the extracted values and errors
  sig->GetValues();     or GetErrors();                 // yield extraction




Function Members (Methods)

public:
AliDielectronSignalFunc()
AliDielectronSignalFunc(const AliDielectronSignalFunc& c)
AliDielectronSignalFunc(const char* name, const char* title)
virtual~AliDielectronSignalFunc()
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 voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
voidCombineFunc(TF1 *const peak = 0, TF1 *const bgnd = 0)
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")MENU
TObject*AliDielectronSignalBase::DescribePeakShape(AliDielectronSignalBase::ESignalExtractionMethod method, Bool_t replaceValErr = kFALSE, TH1F* mcShape = 0x0)
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidDraw(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 voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Double_tAliDielectronSignalBase::GetBackground() const
Double_tAliDielectronSignalBase::GetBackgroundError() const
TF1*GetBackgroundFunction() const
TH1*AliDielectronSignalBase::GetBackgroundHistogram() const
Double_tGetChi2Dof() const
TF1*GetCombinedFunction() const
Int_tGetDof() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
const TVectorD&AliDielectronSignalBase::GetErrors() const
Int_tAliDielectronSignalBase::GetExtractionMethod() const
virtual const char*TObject::GetIconName() const
Double_tAliDielectronSignalBase::GetIntegralMax() const
Double_tAliDielectronSignalBase::GetIntegralMin() const
Double_tAliDielectronSignalBase::GetMass() const
Double_tAliDielectronSignalBase::GetMassError() const
Double_tAliDielectronSignalBase::GetMassWidth() const
Double_tAliDielectronSignalBase::GetMassWidthError() const
Int_tAliDielectronSignalBase::GetMethod() const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Int_tAliDielectronSignalBase::GetParticleOfInterest() const
TObject*AliDielectronSignalBase::GetPeakShape() const
TH1*AliDielectronSignalBase::GetRfactorHistogram() const
Double_tAliDielectronSignalBase::GetSB() const
Double_tAliDielectronSignalBase::GetSBError() const
Double_tAliDielectronSignalBase::GetScaleFactor() const
Double_tAliDielectronSignalBase::GetScaleMax() const
Double_tAliDielectronSignalBase::GetScaleMax2() const
Double_tAliDielectronSignalBase::GetScaleMin() const
Double_tAliDielectronSignalBase::GetScaleMin2() const
Double_tAliDielectronSignalBase::GetSignal() const
Double_tAliDielectronSignalBase::GetSignalError() const
TF1*GetSignalFunction() const
TH1*AliDielectronSignalBase::GetSignalHistogram() const
Double_tAliDielectronSignalBase::GetSignificance() const
Double_tAliDielectronSignalBase::GetSignificanceError() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
TH1*AliDielectronSignalBase::GetUnlikeSignHistogram() const
static const char*AliDielectronSignalBase::GetValueName(Int_t i)
const TVectorD&AliDielectronSignalBase::GetValues() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::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_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::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)
AliDielectronSignalFunc&operator=(const AliDielectronSignalFunc& c)
virtual voidTObject::Paint(Option_t* option = "")
static Double_tPeakFunCB(const Double_t* x, const Double_t* par)
static Double_tPeakFunGaus(const Double_t* x, const Double_t* par)
static Double_tPeakFunMC(const Double_t* x, const Double_t* par)
virtual voidTObject::Pop()
virtual voidAliDielectronSignalBase::Print(Option_t* option = "") const
virtual voidProcess(TObjArray *const arrhist)
voidAliDielectronSignalExt::ProcessEM(TObjArray *const arrhist)
voidProcessFit(TObjArray *const arrhist)
voidProcessFitEM(TObjArray *const arrhist)
voidProcessFitLS(TObjArray *const arrhist)
voidAliDielectronSignalExt::ProcessLS(TObjArray *const arrhist)
voidAliDielectronSignalExt::ProcessRotation(TObjArray *const arrhist)
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 Double_tAliDielectronSignalBase::ScaleHistograms(TH1* histRaw, TH1* histBackground, Double_t intMin, Double_t intMax)
static Double_tAliDielectronSignalBase::ScaleHistograms(TH1* histRaw, TH1* histBackground, Double_t intMin, Double_t intMax, Double_t intMin2, Double_t intMax2)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetDefaults(Int_t type)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidAliDielectronSignalBase::SetExtractionMethod(AliDielectronSignalBase::ESignalExtractionMethod method)
voidSetFitOption(const char* opt)
voidAliDielectronSignalBase::SetFitRange(Double_t min, Double_t max)
voidSetFunctions(TF1 *const combined, TF1 *const sig = 0, TF1 *const back = 0, Int_t parM = 1, Int_t parMres = 2)
voidAliDielectronSignalBase::SetIntegralRange(Double_t min, Double_t max)
voidAliDielectronSignalBase::SetMCSignalShape(TH1F* hist)
voidAliDielectronSignalBase::SetMethod(AliDielectronSignalBase::EBackgroundMethod method)
voidAliDielectronSignalBase::SetMixingCorrection(Bool_t mixcorr = kTRUE)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
voidAliDielectronSignalBase::SetParticleOfInterest(Int_t pdgcode)
voidAliDielectronSignalBase::SetRebin(Int_t factor)
voidAliDielectronSignalBase::SetScaleRawToBackground(Double_t intMin, Double_t intMax)
voidAliDielectronSignalBase::SetScaleRawToBackground(Double_t intMin, Double_t intMax, Double_t intMin2, Double_t intMax2)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetUseIntegral(Bool_t flag = kTRUE)
virtual voidShowMembers(TMemberInspector&)
virtual Int_tTNamed::Sizeof() const
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
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
TPaveText*AliDielectronSignalBase::DrawStats(Double_t x1 = 0., Double_t y1 = 0., Double_t x2 = 0., Double_t y2 = 0.)
voidTObject::MakeZombie()
static Double_tPeakBgndFun(const Double_t* x, const Double_t* par)
voidAliDielectronSignalBase::SetFWHM()
voidAliDielectronSignalBase::SetSignificanceAndSOB()

Data Members

protected:
Double_tfChi2Dofchi2/dof of the fitted inv mass spectra
Int_tfDofdegrees of freedom
TVectorDAliDielectronSignalBase::fErrorsvalue errors
Double_tAliDielectronSignalBase::fFitMaxfit range highest inv. mass
Double_tAliDielectronSignalBase::fFitMinfit range lowest inv. mass
TStringfFitOptfit option used
static TF1*fFuncBackgroundFunction for the background description
TF1*fFuncSigBackCombined function signal plus background
static TF1*fFuncSignalFunction for the signal description
TH1*AliDielectronSignalBase::fHistBackgroundhistogram of background (fitted=0, like-sign=1, event mixing=2)
TH1*AliDielectronSignalBase::fHistDataMEhistogram of selected +- pair candidates from mixed event
TH1*AliDielectronSignalBase::fHistDataMMhistogram of selected -- pair candidates
TH1*AliDielectronSignalBase::fHistDataPMhistogram of selected +- pair candidates
TH1*AliDielectronSignalBase::fHistDataPPhistogram of selected ++ pair candidates
TH1*AliDielectronSignalBase::fHistRfactorhistogram of R factors
TH1*AliDielectronSignalBase::fHistSignalhistogram of pure signal
Double_tAliDielectronSignalBase::fIntMaxsignal extraction range max
Double_tAliDielectronSignalBase::fIntMinsignal extraction range min
AliDielectronSignalBase::EBackgroundMethodAliDielectronSignalBase::fMethodmethod for background substraction
Bool_tAliDielectronSignalBase::fMixingCorrswitch for bin by bin correction with R factor
TStringTNamed::fNameobject identifier
static Int_tfNparBgndnumber of parameters for background function
static Int_tfNparPeaknumber of parameters for peak function
Int_tAliDielectronSignalBase::fPOIpdgpdg code particle of interest
Int_tfParMassthe index of the parameter corresponding to the resonance mass
Int_tfParMassWidththe index of the parameter corresponding to the resonance mass width
AliDielectronSignalBase::ESignalExtractionMethodAliDielectronSignalBase::fPeakMethodmethod for peak description and signal extraction
Bool_tAliDielectronSignalBase::fProcessedflag
Int_tAliDielectronSignalBase::fRebinhistogram rebin factor
Double_tAliDielectronSignalBase::fScaleFactorscale factor of raw to background histogram scaling
Double_tAliDielectronSignalBase::fScaleMaxmax for scaling of raw and background histogram
Double_tAliDielectronSignalBase::fScaleMax2max for scaling of raw and background histogram
Double_tAliDielectronSignalBase::fScaleMinmin for scaling of raw and background histogram
Double_tAliDielectronSignalBase::fScaleMin2min for scaling of raw and background histogram
TStringTNamed::fTitleobject title
Bool_tfUseIntegraluse the integral of the fitted functions to extract signal and background
TVectorDAliDielectronSignalBase::fValuesvalues
static TH1F*AliDielectronSignalBase::fgHistSimPMsimulated peak shape
static TObject*AliDielectronSignalBase::fgPeakShapehistogram or function used to describe the extracted signal
static const char*AliDielectronSignalBase::fgkValueNames[6]value names

Class Charts

Inheritance Chart:
TNamed
AliDielectronSignalBase
AliDielectronSignalExt
AliDielectronSignalFunc

Function documentation

AliDielectronSignalFunc()
 Default Constructor

AliDielectronSignalFunc(const char* name, const char* title)
 Named Constructor

~AliDielectronSignalFunc()
 Default Destructor

void Process(TObjArray *const arrhist)
 Fit the invariant mass histograms and retrieve the signal and background

Double_t PeakFunMC(const Double_t* x, const Double_t* par)
 Fit MC signal shape
 parameters
 [0]:   scale for simpeak
Double_t PeakFunCB(const Double_t* x, const Double_t* par)
 Crystal Ball fit function
Double_t PeakFunGaus(const Double_t* x, const Double_t* par)
 Gaussian fit function
printf("fNparBgrd %d \n",fNparBgnd);
void ProcessFit(TObjArray *const arrhist)
 Fit the +- invariant mass distribution only
 Here we assume that the combined fit function is a sum of the signal and background functions
    and that the signal function is always the first term of this sum

void ProcessFitLS(TObjArray *const arrhist)
 Substract background using the like-sign spectrum

void ProcessFitEM(TObjArray *const arrhist)
 Substract background with the event mixing technique

void SetFunctions(TF1 *const combined, TF1 *const sig = 0, TF1 *const back = 0, Int_t parM = 1, Int_t parMres = 2)
 Set the signal, background functions and combined fit function
 Note: The process method assumes that the first n parameters in the
       combined fit function correspond to the n parameters of the signal function
       and the n+1 to n+m parameters to the m parameters of the background function!!!
void SetDefaults(Int_t type)
 Setup some default functions:
 type = 0: gaus signal + linear background in 2.5 - 4 GeV inv. mass
 type = 1: gaus signal + exponential background in 2.5 - 4 GeV inv. mass
 type = 2: half gaussian, half exponential signal function
 type = 3: Crystal-Ball function
 type = 4: Crystal-Ball signal + exponential background

void Draw(Option_t* option = "")
 Draw the fitted function

void CombineFunc(TF1 *const peak = 0, TF1 *const bgnd = 0)
 combine the bgnd and the peak function

Double_t PeakBgndFun(const Double_t* x, const Double_t* par)
 merge peak and bgnd functions

AliDielectronSignalFunc()
AliDielectronSignalFunc & operator=(const AliDielectronSignalFunc& c)
void SetUseIntegral(Bool_t flag = kTRUE)
  void SetMCSignalShape(TH1F* hist) { fgHistSimPM=hist; }
{fUseIntegral = flag;}
void SetFitOption(const char* opt)
TF1* GetSignalFunction() const
{ return fFuncSignal; }
TF1* GetBackgroundFunction() const
{ return fFuncBackground; }
TF1* GetCombinedFunction() const
{ return fFuncSigBack; }
Int_t GetDof() const
  Int_t GetPolDeg()             const { return fPolDeg;            }
{ return fDof; }
Double_t GetChi2Dof() const
{ return fChi2Dof; }