]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/dielectron/AliDielectronSignalFunc.h
Updates and additions: Classes for signal and spectrum extraction; saving of
[u/mrichter/AliRoot.git] / PWG3 / 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 <RooFit.h>
25 #include <RooAddPdf.h>
26
27 #include "AliDielectronSignalBase.h"
28
29 class AliDielectronSignalFunc : public AliDielectronSignalBase {
30 public:
31   AliDielectronSignalFunc();
32   AliDielectronSignalFunc(const char*name, const char* title);
33
34   virtual ~AliDielectronSignalFunc();
35
36   void Process(TH1 * const hist);
37   virtual void Process(TObjArray * const arrhist);
38   
39   void SetFunctions(TF1 * const sig, TF1 * const back, TF1 * const combined, Int_t parM=-1, Int_t parMres=-1);
40   void InitParams();
41   void SetFitOption(const char* opt) {fFitOpt=opt;}
42   void SetDefaults(Int_t type);
43   void SetFitRange(Double_t min, Double_t max) {fFitMin=min;fFitMax=max;}
44
45   void SetUseIntegral(Bool_t integral=kTRUE) { fUseIntegral=integral; }
46   
47   const char* GetFitOption()          const { return fFitOpt.Data(); }
48   TF1*  GetSignalFunction()     const { return fSignal;        }
49   TF1*  GetBackgroundFunction() const { return fBackground;    }
50   TF1*  GetCombinedFunction()   const { return fSigBack;       }
51   
52   Double_t GetFitMin()      const { return fFitMin; }
53   Double_t GetFitMax()      const { return fFitMax; }
54   
55   virtual void Draw(const Option_t* option = "");
56   
57 private:
58   TF1 *fSignal;                // Function for the signal description
59   TF1 *fBackground;            // Function for the background description
60   TF1 *fSigBack;               // Combined function signal plus background
61   RooAddPdf fFitFunc;          // RooFit fit function
62   TVectorD fVInitParam;        // initial fit parameters
63   TString fFitOpt;             // fit option used
64
65   Bool_t fUseIntegral;         // use integral instead of bin counts
66   
67   Double_t fFitMin;            // fit range min
68   Double_t fFitMax;            // fit range max
69
70   Int_t fParM;                 // Paramter which defines the mass
71   Int_t fParMres;              // Paramter which defines the resolution of the mass
72   
73   AliDielectronSignalFunc(const AliDielectronSignalFunc &c);
74   AliDielectronSignalFunc &operator=(const AliDielectronSignalFunc &c);
75
76   ClassDef(AliDielectronSignalFunc,1)         // Dielectron SignalFunc
77 };
78
79
80 #endif