]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnFunction.h
Removed warnings from RESONANCES code
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnFunction.h
1 //
2 // Class AliRsn Fcn
3 //
4 // This class defines a base classe to implement a typical computation
5 // which uses the internal RSN package event format (AliRsnEvent).
6 // It contains some default flags which turn out to be useful:
7 //  - a flag to select only the "true" pairs (tracks from same resonance)
8 //  - a flag to know if the computation is done over two events (mixing)
9 //
10 // Any kind of analysis object should be implemented as inheriting from this
11 // because the AliRsnAnalyzer which executes the analysis will accept a collection
12 // of such objects, in order to have a unique format of processing method
13 //
14 // The user who implements a kind of computation type should inherit from
15 // this class and override the virtual functions defined in it, which
16 // initialize the final output histogram and define how to process data.
17 //
18 //
19 // author: A. Pulvirenti             (email: alberto.pulvirenti@ct.infn.it)
20 //
21
22 #ifndef ALIRSNFUNCTION_H
23 #define ALIRSNFUNCTION_H
24
25 #include <TArrayD.h>
26 #include <TString.h>
27
28 #include "AliRsnCut.h"
29 #include "AliRsnHistoDef.h"
30 #include "AliRsnPairParticle.h"
31
32 class TH1D;
33 class TH2D;
34 class AliRsnEvent;
35
36 class AliRsnFunction : public TObject
37 {
38
39   public:
40
41     enum EFcnType
42     {
43       kInvMass,
44       kInvMassMC,
45       kInvMassRotated,
46       kResolution,
47       kPtSpectrum,
48       kEtaSpectrum,
49       kFcnTypes
50     };
51
52     AliRsnFunction();
53     AliRsnFunction(EFcnType type, AliRsnHistoDef *hd, Bool_t skipOut = kTRUE);
54     AliRsnFunction(const AliRsnFunction &copy);
55     virtual ~AliRsnFunction() {Clear();}
56     virtual void Clear(Option_t *option = "");
57
58     Bool_t           UseBins() {return fUseBins;}
59     Bool_t           SkipOut() {return fSkipOutsideInterval;}
60     AliRsnHistoDef*  GetHistoDef() {return fHistoDef;}
61     TString          GetFcnName();
62     TString          GetFcnTitle();
63
64     void  SetBinningCut(AliRsnCut::EType type, Double_t min, Double_t max, Double_t step);
65     void  SetBinningCut(AliRsnCut::EType type, Int_t nbins, Double_t *bins);
66     void  SetHistoDef(AliRsnHistoDef *def) {fHistoDef = def;}
67     void  SetRotationAngle(Double_t rotAngle) {fRotAngle = rotAngle;}
68
69     // working routines
70     TList* Init(const char *histoName, const char *histoTitle);
71     void   Init(const char *histoName, const char *histoTitle, TList *tgt);
72     Bool_t Fill(AliRsnPairParticle *pair, AliRsnPairDef *ref, Double_t weight = 0.0);
73     Double_t FcnValue(AliRsnPairParticle *pair, AliRsnPairDef *ref);
74
75   private:
76
77     const AliRsnFunction& operator=(const AliRsnFunction &copy);
78
79     Double_t    FcnResolution(AliRsnPairParticle *pair, AliRsnPairDef *pd);
80
81     EFcnType         fFcnType;       // function type
82     
83     Double_t         fRotAngle;      // rotation angle (for "rotated" invMass)
84
85     Bool_t           fUseBins;       // flag to choose if binning is used
86     Bool_t           fSkipOutsideInterval; // skip pairs which fall outside histogram interval
87
88     TArrayD          fBins;          // low edge of each bin (upper is the low edge of next bin)
89     AliRsnCut        fBinningCut;    // binning cut
90     AliRsnCut::EType fBinningCutType;// binning cut type
91
92     AliRsnHistoDef  *fHistoDef;      // definitions for histogram
93     TH1D            *fHisto[100];    // binned histograms
94
95     // ROOT dictionary
96     ClassDef(AliRsnFunction, 1)
97 };
98
99 #endif