]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGDQ/dielectron/AliDielectronSignalFunc.h
ALIROOT-5488 Remove build/include from the include directories
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / AliDielectronSignalFunc.h
1 #ifndef ALIDIELECTRONSIGNALFUNC_H
2 #define ALIDIELECTRONSIGNALFUNC_H
3
4 /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 //#############################################################
8 //#                                                           # 
9 //#         Class AliDielectronSignalFunc                     #
10 //#                                                           #
11 //#  Authors:                                                 #
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      #
19 //#                                                           #
20 //#############################################################
21
22 #include <TVectorT.h>
23 #include <TString.h>
24 #include <TH1F.h>
25
26 #include "AliDielectronSignalExt.h"
27
28 class AliDielectronSignalFunc : public AliDielectronSignalExt {
29 public:
30   AliDielectronSignalFunc();
31   AliDielectronSignalFunc(const char*name, const char* title);
32   AliDielectronSignalFunc(const AliDielectronSignalFunc &c);
33   AliDielectronSignalFunc &operator=(const AliDielectronSignalFunc &c);
34
35   virtual ~AliDielectronSignalFunc();
36
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
41
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) {
47     fFitOpt=opt; 
48     fFitOpt.ToLower(); 
49     if(!fFitOpt.Contains("s")) fFitOpt += "s";
50   }
51   void SetDefaults(Int_t type);
52     
53   TF1*  GetSignalFunction()     const { return fFuncSignal;        }
54   TF1*  GetBackgroundFunction() const { return fFuncBackground;    }
55   TF1*  GetCombinedFunction()   const { return fFuncSigBack;       }
56   
57   //  Int_t GetPolDeg()             const { return fPolDeg;            }
58   Int_t GetDof()                const { return fDof;            }
59   Double_t GetChi2Dof()         const { return fChi2Dof;           }
60   
61   virtual void Draw(const Option_t* option = "");
62
63   // peak functions
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
67
68 protected:
69
70   static Double_t PeakBgndFun(const Double_t *x, const Double_t *par); // combine any bgrd and any peak function
71
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
77   
78   TString fFitOpt;             // fit option used
79   Bool_t fUseIntegral;         // use the integral of the fitted functions to extract signal and background
80
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
84   
85   static Int_t    fNparPeak;              // number of parameters for peak function
86   static Int_t    fNparBgnd;              // number of parameters for background function
87
88   //  static TH1F* fgHistSimPM;         // simulated peak shape
89   
90   ClassDef(AliDielectronSignalFunc,3)         // class for signal extraction using a combined bgrd+signal fit
91 };
92
93 #endif