]>
Commit | Line | Data |
---|---|---|
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 <TClonesArray.h> | |
26 | #include <TH1.h> | |
27 | #include <TH2.h> | |
28 | #include <TH3.h> | |
29 | #include <THnSparse.h> | |
30 | #include <TNamed.h> | |
31 | ||
32 | #include "AliRsnCut.h" | |
33 | ||
34 | class AliRsnValue; | |
35 | class AliRsnMother; | |
36 | class AliRsnPairDef; | |
37 | ||
38 | class AliRsnFunction : public TObject | |
39 | { | |
40 | ||
41 | public: | |
42 | ||
43 | AliRsnFunction(Bool_t useTH1 = kTRUE); | |
44 | AliRsnFunction(const AliRsnFunction ©); | |
45 | virtual ~AliRsnFunction() { delete fH1; delete fHSparse; } | |
46 | const AliRsnFunction& operator=(const AliRsnFunction ©); | |
47 | ||
48 | void SetPairDef(AliRsnPairDef * const def) {fPairDef = def;} | |
49 | void SetPair(AliRsnMother * const pair) {fPair = pair;} | |
50 | void SetEvent(AliRsnEvent *const event) {fEvent = event;} | |
51 | ||
52 | AliRsnPairDef* GetPairDef() const {return fPairDef;} | |
53 | AliRsnMother* GetPair() const {return fPair;} | |
54 | AliRsnEvent* GetEvent() const {return fEvent;} | |
55 | virtual const char* GetName() const; | |
56 | ||
57 | Bool_t IsUsingTH1() {return fUseTH1;} | |
58 | void UseTH1() {fUseTH1 = kTRUE;} | |
59 | void UseSparse() {fUseTH1 = kFALSE;} | |
60 | void AddAxis(AliRsnValue* const axis); | |
61 | Int_t GetNumberOfAxes() {return fAxisList.GetEntries();} | |
62 | TH1* CreateHistogram(const char *histoName, const char *histoTitle); | |
63 | THnSparseF* CreateHistogramSparse(const char *histoName, const char *histoTitle); | |
64 | ||
65 | Bool_t Fill(); | |
66 | ||
67 | protected: | |
68 | ||
69 | AliRsnPairDef *fPairDef; // reference to used pair definition | |
70 | TClonesArray fAxisList; // list of axis | |
71 | ||
72 | AliRsnMother *fPair; // processed pair | |
73 | AliRsnEvent *fEvent; // processed event | |
74 | ||
75 | Bool_t fUseTH1; // use TH1 or not? | |
76 | Int_t fSize; // number of dim of output histogram | |
77 | TH1 *fH1; // output histogram (standard type) | |
78 | THnSparseF *fHSparse; // output histogram (sparse type) | |
79 | ||
80 | // ROOT dictionary | |
81 | ClassDef(AliRsnFunction, 3) | |
82 | }; | |
83 | ||
84 | #endif |