]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/TRD/AliAnalysisTaskTRDtriggerCheck.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWG / TRD / AliAnalysisTaskTRDtriggerCheck.h
CommitLineData
9e7843aa 1#ifndef ALIANALYSISTASKTRDTRIGGERCHECK_H
2#define ALIANALYSISTASKTRDTRIGGERCHECK_H
3
4#include "TH1.h"
5#include "TH2.h"
6#include "TH3.h"
7
8#include "AliLog.h"
9
10#include "AliAnalysisTaskSE.h"
11
12#define ID(x) x, #x
13#define LAB(x) x+1, #x
14
15class TList;
16
17class AliAnalysisTaskTRDtriggerCheck :
18 public AliAnalysisTaskSE
19{
20public:
21 AliAnalysisTaskTRDtriggerCheck(const char *name = "trd_trg_check");
22 ~AliAnalysisTaskTRDtriggerCheck();
23
24 // analysis operations
25 virtual void UserCreateOutputObjects();
26 virtual Bool_t Notify();
27 virtual void UserExec(Option_t *option);
28 virtual void Terminate(const Option_t *option);
29
30 // task configuration
31
32 // histograms
33 enum Hist_t {
34 kHistStat = 0,
35 kHistTrgStat,
36 kHistTrgStatSec,
37 kHistTrgStatStackCond,
38 kHistTrgStatStackCondNotFired,
39 kHistLast
40 };
41
42 // statistics
43 enum Stat_t {
44 kStatSeen = 1,
45 kStatLast
46 };
47
48 enum Trigger_t {
49 kTrgHCO = 0,
50 kTrgHJT,
51 kTrgHSE,
52 kTrgHQU,
53 kTrgHEE,
54 kTrgLast
55 };
56
57 enum Comb_t {
d3362e58 58 // ok
9e7843aa 59 kNothing = 1,
d3362e58 60 kFiredCondition,
61 kTriggeredFiredCondition,
62 // not ok
9e7843aa 63 kTriggered,
64 kFired,
65 kCondition,
66 kTriggeredFired,
67 kTriggeredCondition,
9e7843aa 68 kLastComb
69 };
70
71protected:
72 // output objects
73 TList *fOutputList; // list of output objects
74
75 // histogram management
76 TH1 *fHist[kHistLast]; //! pointers to histogram
77 const char *fShortTaskId; //! short identifier for the task
78
79 TH1*& GetHistogram(Hist_t hist, const Int_t idx = 0) { return fHist[hist + idx]; }
80
81 TH1* AddHistogram(Hist_t hist, const char *hid, TString title,
82 Int_t xbins, Float_t xmin, Float_t xmax, Int_t binType = 1);
83 TH2* AddHistogram(Hist_t hist, const char *hid, TString title,
84 Int_t xbins, Float_t xmin, Float_t xmax,
85 Int_t ybins, Float_t ymin, Float_t ymax, Int_t binType = 1);
86 TH3* AddHistogram(Hist_t hist, const char *hid, TString title,
87 Int_t xbins, Float_t xmin, Float_t xmax,
88 Int_t ybins, Float_t ymin, Float_t ymax,
89 Int_t zbins, Float_t zmin, Float_t zmax, Int_t binType = 1);
90
91 void FillH1(Hist_t hist, Float_t x, Float_t weight = 1., Int_t idx = 0)
92 { GetHistogram(hist, idx)->Fill(x, weight); }
93 void FillH2(Hist_t hist, Float_t x, Float_t y, Float_t weight = 1., Int_t idx = 0)
94 { ((TH2*) GetHistogram(hist, idx))->Fill(x, y, weight); }
95 void FillH3(Hist_t hist, Float_t x, Float_t y, Float_t z, Float_t weight = 1., Int_t idx = 0)
96 { ((TH3*) GetHistogram(hist, idx))->Fill(x, y, z, weight); }
97
98 // internal use
99
100 // task configuration
101
102private:
103 // not implemented
104 AliAnalysisTaskTRDtriggerCheck(const AliAnalysisTaskTRDtriggerCheck &rhs);
105 AliAnalysisTaskTRDtriggerCheck& operator=(const AliAnalysisTaskTRDtriggerCheck &rhs);
106
107 ClassDef(AliAnalysisTaskTRDtriggerCheck, 1);
108};
109
110#endif