]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/TRD/AliAnalysisTaskTRDtriggerCheck.h
- first version of PWGTRD lib
[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 {
58 kNothing = 1,
59 kTriggered,
60 kFired,
61 kCondition,
62 kTriggeredFired,
63 kTriggeredCondition,
64 kFiredCondition,
65 kTriggeredFiredCondition,
66 kLastComb
67 };
68
69protected:
70 // output objects
71 TList *fOutputList; // list of output objects
72
73 // histogram management
74 TH1 *fHist[kHistLast]; //! pointers to histogram
75 const char *fShortTaskId; //! short identifier for the task
76
77 TH1*& GetHistogram(Hist_t hist, const Int_t idx = 0) { return fHist[hist + idx]; }
78
79 TH1* AddHistogram(Hist_t hist, const char *hid, TString title,
80 Int_t xbins, Float_t xmin, Float_t xmax, Int_t binType = 1);
81 TH2* AddHistogram(Hist_t hist, const char *hid, TString title,
82 Int_t xbins, Float_t xmin, Float_t xmax,
83 Int_t ybins, Float_t ymin, Float_t ymax, Int_t binType = 1);
84 TH3* AddHistogram(Hist_t hist, const char *hid, TString title,
85 Int_t xbins, Float_t xmin, Float_t xmax,
86 Int_t ybins, Float_t ymin, Float_t ymax,
87 Int_t zbins, Float_t zmin, Float_t zmax, Int_t binType = 1);
88
89 void FillH1(Hist_t hist, Float_t x, Float_t weight = 1., Int_t idx = 0)
90 { GetHistogram(hist, idx)->Fill(x, weight); }
91 void FillH2(Hist_t hist, Float_t x, Float_t y, Float_t weight = 1., Int_t idx = 0)
92 { ((TH2*) GetHistogram(hist, idx))->Fill(x, y, weight); }
93 void FillH3(Hist_t hist, Float_t x, Float_t y, Float_t z, Float_t weight = 1., Int_t idx = 0)
94 { ((TH3*) GetHistogram(hist, idx))->Fill(x, y, z, weight); }
95
96 // internal use
97
98 // task configuration
99
100private:
101 // not implemented
102 AliAnalysisTaskTRDtriggerCheck(const AliAnalysisTaskTRDtriggerCheck &rhs);
103 AliAnalysisTaskTRDtriggerCheck& operator=(const AliAnalysisTaskTRDtriggerCheck &rhs);
104
105 ClassDef(AliAnalysisTaskTRDtriggerCheck, 1);
106};
107
108#endif