1 #ifndef ALIDIELECTRONSIGNALFUNC_H
2 #define ALIDIELECTRONSIGNALFUNC_H
4 /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 //#############################################################
9 //# Class AliDielectronSignalFunc #
12 //# Anton Andronic, GSI / A.Andronic@gsi.de #
13 //# Ionut C. Arsene, GSI / I.C.Arsene@gsi.de #
14 //# Julian Book, Uni Ffm / Julian.Book@cern.ch #
15 //# Frederick Kramer, Uni Ffm, / Frederick.Kramer@cern.ch #
16 //# Magnus Mager, CERN / Magnus.Mager@cern.ch #
17 //# WooJin J. Park, GSI / W.J.Park@gsi.de #
18 //# Jens Wiechula, Uni HD / Jens.Wiechula@cern.ch #
20 //#############################################################
26 #include "AliDielectronSignalExt.h"
28 class AliDielectronSignalFunc : public AliDielectronSignalExt {
30 AliDielectronSignalFunc();
31 AliDielectronSignalFunc(const char*name, const char* title);
32 AliDielectronSignalFunc(const AliDielectronSignalFunc &c);
33 AliDielectronSignalFunc &operator=(const AliDielectronSignalFunc &c);
35 virtual ~AliDielectronSignalFunc();
37 virtual void Process(TObjArray * const arrhist);
38 void ProcessFit(TObjArray * const arrhist); // fit the SE +- distribution
39 void ProcessFitLS(TObjArray * const arrhist); // substract the fitted SE like-sign background
40 void ProcessFitEM(TObjArray * const arrhist); // substract the fitted SE+ME like-sign background
42 // void SetMCSignalShape(TH1F* hist) { fgHistSimPM=hist; }
43 void SetUseIntegral(Bool_t flag=kTRUE) {fUseIntegral = flag;};
44 void SetFunctions(TF1 * const combined, TF1 * const sig=0, TF1 * const back=0, Int_t parM=1, Int_t parMres=2);
45 void CombineFunc(TF1 * const peak=0, TF1 * const bgnd=0);
46 void SetFitOption(const char* opt) {
49 if(!fFitOpt.Contains("s")) fFitOpt += "s";
51 void SetDefaults(Int_t type);
53 TF1* GetSignalFunction() const { return fFuncSignal; }
54 TF1* GetBackgroundFunction() const { return fFuncBackground; }
55 TF1* GetCombinedFunction() const { return fFuncSigBack; }
57 // Int_t GetPolDeg() const { return fPolDeg; }
58 Int_t GetDof() const { return fDof; }
59 Double_t GetChi2Dof() const { return fChi2Dof; }
61 virtual void Draw(const Option_t* option = "");
64 static Double_t PeakFunMC(const Double_t *x, const Double_t *par); // peak function from a mc histo
65 static Double_t PeakFunCB(const Double_t *x, const Double_t *par); // crystal ball function
66 static Double_t PeakFunGaus(const Double_t *x, const Double_t *par); // gaussian
70 static Double_t PeakBgndFun(const Double_t *x, const Double_t *par); // combine any bgrd and any peak function
72 static TF1 *fFuncSignal; // Function for the signal description
73 static TF1 *fFuncBackground; // Function for the background description
74 TF1 *fFuncSigBack; // Combined function signal plus background
75 Int_t fParMass; // the index of the parameter corresponding to the resonance mass
76 Int_t fParMassWidth; // the index of the parameter corresponding to the resonance mass width
78 TString fFitOpt; // fit option used
79 Bool_t fUseIntegral; // use the integral of the fitted functions to extract signal and background
81 // Int_t fPolDeg; // polynomial degree of the background function
82 Int_t fDof; // degrees of freedom
83 Double_t fChi2Dof; // chi2/dof of the fitted inv mass spectra
85 static Int_t fNparPeak; // number of parameters for peak function
86 static Int_t fNparBgnd; // number of parameters for background function
88 // static TH1F* fgHistSimPM; // simulated peak shape
90 ClassDef(AliDielectronSignalFunc,3) // class for signal extraction using a combined bgrd+signal fit