]>
Commit | Line | Data |
---|---|---|
64129b35 | 1 | #ifndef ALIRSNMINIMonitorTask_H |
2 | #define ALIRSNMINIMonitorTask_H | |
3 | ||
4 | // | |
5 | // Analysis task for 'mini' sub-package | |
6 | // Contains all definitions needed for running an analysis: | |
7 | // -- global event cut | |
8 | // -- a list of track cuts (any number) | |
9 | // -- definitions of output histograms | |
10 | // -- values to be computed. | |
11 | // | |
12 | ||
13 | #include <TString.h> | |
14 | #include <TClonesArray.h> | |
15 | ||
16 | #include "AliAnalysisTaskSE.h" | |
17 | ||
18 | #include "AliRsnEvent.h" | |
19 | #include "AliRsnMiniMonitor.h" | |
20 | ||
21 | class TList; | |
22 | ||
23 | class AliTriggerAnalysis; | |
24 | class AliRsnMiniEvent; | |
25 | class AliRsnCutSet; | |
26 | ||
27 | class AliRsnMiniMonitorTask : public AliAnalysisTaskSE { | |
28 | ||
29 | public: | |
30 | ||
31 | AliRsnMiniMonitorTask(); | |
32 | AliRsnMiniMonitorTask(const char *name, Bool_t isMC = kFALSE); | |
33 | AliRsnMiniMonitorTask(const AliRsnMiniMonitorTask ©); | |
34 | AliRsnMiniMonitorTask& operator=(const AliRsnMiniMonitorTask ©); | |
35 | virtual ~AliRsnMiniMonitorTask(); | |
36 | ||
37 | void UseMC(Bool_t yn = kTRUE) {fUseMC = yn;} | |
38 | void UseCentrality(const char *type) {fUseCentrality = kTRUE; fCentralityType = type; fCentralityType.ToUpper();} | |
39 | void UseMultiplicity(const char *type) {fUseCentrality = kFALSE; fCentralityType = type; fCentralityType.ToUpper();} | |
40 | void SetEventCuts(AliRsnCutSet *cuts) {fEventCuts = cuts;} | |
41 | Int_t AddTrackCuts(AliRsnCutSet *cuts); | |
42 | TClonesArray *Outputs() {return &fHistograms;} | |
43 | ||
44 | virtual void UserCreateOutputObjects(); | |
45 | virtual void UserExec(Option_t*); | |
46 | virtual void Terminate(Option_t*); | |
47 | ||
48 | AliRsnMiniMonitor *CreateMonitor(const char *name, AliRsnMiniMonitor::EType type, Int_t cutID); | |
49 | ||
50 | private: | |
51 | ||
52 | Char_t CheckCurrentEvent(); | |
53 | Double_t ComputeCentrality(Bool_t isESD); | |
54 | ||
55 | Bool_t fUseMC; // use or not MC info | |
56 | Int_t fEvNum; //! absolute event counter | |
57 | Bool_t fUseCentrality; // if true, use centrality for event, otherwise use multiplicity | |
58 | TString fCentralityType; // definition used to choose what centrality or multiplicity to use | |
59 | ||
60 | TList *fOutput; // output list | |
61 | TClonesArray fHistograms; // list of histogram definitions | |
62 | ||
63 | AliRsnCutSet *fEventCuts; // cuts on events | |
64 | TObjArray fTrackCuts; // list of single track cuts | |
65 | AliRsnEvent fRsnEvent; //! interface object to the event | |
66 | Bool_t fBigOutput; // flag if open file for output list | |
67 | ||
68 | ClassDef(AliRsnMiniMonitorTask, 1); // AliRsnMiniMonitorTask | |
69 | }; | |
70 | ||
71 | inline AliRsnMiniMonitor* AliRsnMiniMonitorTask::CreateMonitor | |
72 | (const char *name, AliRsnMiniMonitor::EType type, Int_t cutID) | |
73 | { | |
74 | // | |
75 | // Create a new histogram definition in the task, | |
76 | // which is then returned to the user for its configuration | |
77 | // | |
78 | ||
79 | Int_t n = fHistograms.GetEntries(); | |
80 | AliRsnMiniMonitor *newDef = new (fHistograms[n]) AliRsnMiniMonitor(name, type, cutID); | |
81 | ||
82 | return newDef; | |
83 | } | |
84 | ||
85 | #endif |