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)
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
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.
19 // author: A. Pulvirenti (email: alberto.pulvirenti@ct.infn.it)
22 #ifndef ALIRSNFUNCTION_H
23 #define ALIRSNFUNCTION_H
25 #include <TClonesArray.h>
29 #include <THnSparse.h>
32 #include "AliRsnCut.h"
38 class AliRsnFunction : public TObject {
42 AliRsnFunction(Bool_t single = kFALSE, Bool_t useTH1 = kTRUE);
43 AliRsnFunction(const AliRsnFunction ©);
44 virtual ~AliRsnFunction() { delete fH1; delete fHSparse; }
45 const AliRsnFunction& operator=(const AliRsnFunction ©);
47 void SetPairDef(AliRsnPairDef * const def) {fPairDef = def;}
48 void SetPair(AliRsnMother * const pair) {fPair = pair;}
49 void SetDaughter(AliRsnDaughter * const daughter) {fDaughter = daughter;}
51 AliRsnPairDef* GetPairDef() const {return fPairDef;}
52 AliRsnMother* GetPair() const {return fPair;}
53 AliRsnDaughter* GetDaughter() const {return fDaughter;}
54 AliRsnEvent* GetEvent() const {return fEvent;}
55 virtual const char* GetName() const;
57 Bool_t IsSingle() const {return fSingle;}
58 void SetSingle(Bool_t yn = kTRUE) {fSingle = yn;}
59 Bool_t IsUsingTH1() {return fUseTH1;}
60 void UseTH1() {fUseTH1 = kTRUE;}
61 void UseSparse() {fUseTH1 = kFALSE;}
63 Bool_t AddAxis(AliRsnValue* const axis);
64 Int_t GetNumberOfAxes() {return fAxisList.GetEntries();}
66 TH1* CreateHistogram(const char *histoName, const char *histoTitle);
67 THnSparseF* CreateHistogramSparse(const char *histoName, const char *histoTitle);
73 AliRsnPairDef *fPairDef; // reference to used pair definition
74 TClonesArray fAxisList; // list of axis
76 AliRsnMother *fPair; // processed pair
77 AliRsnEvent *fEvent; // processed event
78 AliRsnDaughter *fDaughter; // processed track
80 Bool_t fSingle; // is kTRUE when function processes tracks instead of pairs
81 Bool_t fUseTH1; // use TH1 or not?
82 Int_t fSize; // number of dim of output histogram
83 TH1 *fH1; // output histogram (standard type)
84 THnSparseF *fHSparse; // output histogram (sparse type)
87 ClassDef(AliRsnFunction, 3)