Event Mixing for Triggered BF analysis
[u/mrichter/AliRoot.git] / PWGCF / EBYE / BalanceFunctions / AliAnalysisTaskTriggeredBF.h
CommitLineData
f8b2d882 1#ifndef ALIANALYSISTASKTRIGGEREDBF_CXX\r
2#define ALIANALYSISTASKTRIGGEREDBF_CXX\r
3\r
4// Analysis task for the TriggeredBF code\r
5// Authors: Panos Cristakoglou@cern.ch, m.weber@cern.ch\r
6\r
845fdeca 7#include "AliLog.h"\r
8#include "AliAnalysisTaskSE.h"\r
9#include "AliBalanceTriggered.h"\r
10\r
f8b2d882 11class TList;\r
12class TH1F;\r
13class TH2F;\r
f8b2d882 14\r
15class AliBalanceTriggered;\r
85379419 16class AliEventPoolManager;\r
f8b2d882 17\r
f8b2d882 18\r
19class AliAnalysisTaskTriggeredBF : public AliAnalysisTaskSE {\r
20 public:\r
21 AliAnalysisTaskTriggeredBF(const char *name = "AliAnalysisTaskTriggeredBF");\r
22 virtual ~AliAnalysisTaskTriggeredBF(); \r
23 \r
24 \r
25 virtual void UserCreateOutputObjects();\r
26 virtual void UserExec(Option_t *option);\r
27 virtual void UserExecMix(Option_t*);\r
28 virtual void FinishTaskOutput();\r
29 virtual void Terminate(Option_t *);\r
30\r
31 void SetAnalysisObject(AliBalanceTriggered *const analysis) {\r
32 fBalance = analysis;\r
33 }\r
34 void SetShufflingObject(AliBalanceTriggered *const analysisShuffled) {\r
35 fRunShuffling = kTRUE;\r
36 fShuffledBalance = analysisShuffled;\r
37 }\r
845fdeca 38 void SetMixingObject(AliBalanceTriggered *const analysisMixed) {\r
39 fRunMixing = kTRUE;\r
40 fMixedBalance = analysisMixed;\r
41 }\r
85379419 42 void SetMixingTracks(Int_t tracks) { fMixingTracks = tracks; }\r
43\r
f8b2d882 44 \r
45 void SetVertexDiamond(Double_t vx, Double_t vy, Double_t vz) {\r
46 fVxMax = vx;\r
47 fVyMax = vy;\r
48 fVzMax = vz;\r
49 }\r
50\r
51 //==============AOD analysis==============//\r
52 void SetAODtrackCutBit(Int_t bit){\r
53 nAODtrackCutBit = bit;\r
54 }\r
55\r
56 void SetKinematicsCutsAOD(Double_t ptmin, Double_t ptmax, Double_t etamin, Double_t etamax){\r
57 fPtMin = ptmin;\r
58 fPtMax = ptmax;\r
59 fEtaMin = etamin;\r
60 fEtaMax = etamax;\r
61\r
62 }\r
63\r
64 void SetExtraDCACutsAOD(Double_t DCAxy, Double_t DCAz){\r
65 fDCAxyCut = DCAxy;\r
66 fDCAzCut = DCAz;\r
67 }\r
68\r
69 void SetExtraTPCCutsAOD(Double_t maxTPCchi2, Int_t minNClustersTPC){\r
70 fTPCchi2Cut = maxTPCchi2;\r
71 fNClustersTPCCut = minNClustersTPC;\r
72 }\r
73\r
74 //Centrality\r
75 void SetCentralityEstimator(const char* centralityEstimator) {fCentralityEstimator = centralityEstimator;}\r
76 const char* GetCentralityEstimator(void) {return fCentralityEstimator;}\r
77 void SetCentralityPercentileRange(Double_t min, Double_t max) { \r
78 fUseCentrality = kTRUE;\r
79 fCentralityPercentileMin=min;\r
80 fCentralityPercentileMax=max;\r
81 }\r
82 void SetImpactParameterRange(Double_t min, Double_t max) { \r
83 fUseCentrality = kTRUE;\r
84 fImpactParameterMin=min;\r
85 fImpactParameterMax=max;\r
86 }\r
87\r
88 //multiplicity\r
89 void SetMultiplicityRange(Int_t min, Int_t max) {\r
90 fUseMultiplicity = kTRUE;\r
91 fNumberOfAcceptedTracksMin = min;\r
92 fNumberOfAcceptedTracksMax = max;}\r
93 \r
94 void UseOfflineTrigger() {fUseOfflineTrigger = kTRUE;}\r
95 \r
96\r
97 private:\r
845fdeca 98 Float_t IsEventAccepted(AliVEvent* event);\r
99 TObjArray* GetAcceptedTracks(AliVEvent* event);\r
100 TObjArray* GetShuffledTracks(TObjArray* tracks);\r
101\r
f8b2d882 102 AliBalanceTriggered *fBalance; //TriggeredBF object\r
103 Bool_t fRunShuffling;//run shuffling or not\r
104 AliBalanceTriggered *fShuffledBalance; //TriggeredBF object (shuffled)\r
845fdeca 105 Bool_t fRunMixing;//run mixing or not\r
85379419 106 Int_t fMixingTracks;\r
845fdeca 107 AliBalanceTriggered *fMixedBalance; //TriggeredBF object (mixed)\r
85379419 108 AliEventPoolManager* fPoolMgr; //! event pool manager\r
109 \r
110\r
f8b2d882 111 TList *fList; //fList object\r
112 TList *fListTriggeredBF; //fList object\r
845fdeca 113 TList *fListTriggeredBFS; //fList object (shuffling)\r
114 TList *fListTriggeredBFM; //fList object (mixing)\r
f8b2d882 115 TList *fHistListPIDQA; //! list of histograms\r
116\r
117 TH1F *fHistEventStats; //event stats\r
118 TH2F *fHistCentStats; //centrality stats\r
119 TH1F *fHistTriggerStats; //trigger stats\r
120 TH1F *fHistTrackStats; //Track filter bit stats\r
121 TH1F *fHistVx; //x coordinate of the primary vertex\r
122 TH1F *fHistVy; //y coordinate of the primary vertex\r
123 TH1F *fHistVz; //z coordinate of the primary vertex\r
124\r
125 TH2F *fHistClus;//\r
126 TH2F *fHistDCA;//\r
127 TH1F *fHistChi2;//\r
128 TH1F *fHistPt;//\r
129 TH1F *fHistEta;//\r
130 TH1F *fHistPhi;//\r
131 TH1F *fHistPhiBefore;//\r
132 TH1F *fHistPhiAfter;//\r
133 TH2F *fHistV0M;//\r
134 TH2F *fHistRefTracks;//\r
135\r
136 \r
137 TString fCentralityEstimator; //"V0M","TRK","TKL","ZDC","FMD"\r
138 Bool_t fUseCentrality;//use the centrality (PbPb) or not (pp)\r
139 Double_t fCentralityPercentileMin;//centrality percentile min\r
140 Double_t fCentralityPercentileMax;//centrality percentile max\r
141 Double_t fImpactParameterMin;//impact parameter min (used for MC)\r
142 Double_t fImpactParameterMax;//impact parameter max (used for MC)\r
143\r
144 Bool_t fUseMultiplicity;//use the multiplicity cuts\r
145 Int_t fNumberOfAcceptedTracksMin;//min. number of number of accepted tracks (used for the multiplicity dependence study - pp)\r
146 Int_t fNumberOfAcceptedTracksMax;//max. number of number of accepted tracks (used for the multiplicity dependence study - pp)\r
147 TH1F *fHistNumberOfAcceptedTracks;//hisot to store the number of accepted tracks\r
148\r
149 Bool_t fUseOfflineTrigger;//Usage of the offline trigger selection\r
150\r
151 Double_t fVxMax;//vxmax\r
152 Double_t fVyMax;//vymax\r
153 Double_t fVzMax;//vzmax\r
154\r
155 Int_t nAODtrackCutBit;//track cut bit from track selection (only used for AODs)\r
156\r
157 Double_t fPtMin;//only used for AODs\r
158 Double_t fPtMax;//only used for AODs\r
159 Double_t fEtaMin;//only used for AODs\r
160 Double_t fEtaMax;//only used for AODs\r
161\r
162 Double_t fDCAxyCut;//only used for AODs\r
163 Double_t fDCAzCut;//only used for AODs\r
164\r
165 Double_t fTPCchi2Cut;//only used for AODs\r
166 Int_t fNClustersTPCCut;//only used for AODs\r
167\r
168 \r
169 AliAnalysisTaskTriggeredBF(const AliAnalysisTaskTriggeredBF&); // not implemented\r
170 AliAnalysisTaskTriggeredBF& operator=(const AliAnalysisTaskTriggeredBF&); // not implemented\r
171 \r
172 ClassDef(AliAnalysisTaskTriggeredBF, 1); // example of analysis\r
173};\r
174\r
845fdeca 175// class used for io with AliBalance (taken from AliAnalysisTaskPhiCorrelations)\r
176class AliBFBasicParticle : public AliVParticle\r
177{ \r
178 public:\r
179 AliBFBasicParticle(Float_t eta, Float_t phi, Float_t pt, Short_t charge)\r
180 : fEta(eta), fPhi(phi), fpT(pt), fCharge(charge)\r
181 {\r
182 }\r
183 ~AliBFBasicParticle() {}\r
184 \r
185 // kinematics\r
186 virtual Double_t Px() const { AliFatal("Not implemented"); return 0; }\r
187 virtual Double_t Py() const { AliFatal("Not implemented"); return 0; }\r
188 virtual Double_t Pz() const { AliFatal("Not implemented"); return 0; }\r
189 virtual Double_t Pt() const { return fpT; }\r
190 virtual Double_t P() const { AliFatal("Not implemented"); return 0; }\r
191 virtual Bool_t PxPyPz(Double_t[3]) const { AliFatal("Not implemented"); return 0; }\r
192\r
193 virtual Double_t Xv() const { AliFatal("Not implemented"); return 0; }\r
194 virtual Double_t Yv() const { AliFatal("Not implemented"); return 0; }\r
195 virtual Double_t Zv() const { AliFatal("Not implemented"); return 0; }\r
196 virtual Bool_t XvYvZv(Double_t[3]) const { AliFatal("Not implemented"); return 0; }\r
197\r
198 virtual Double_t OneOverPt() const { AliFatal("Not implemented"); return 0; }\r
199 virtual Double_t Phi() const { return fPhi; }\r
200 virtual Double_t Theta() const { AliFatal("Not implemented"); return 0; }\r
201\r
202\r
203 virtual Double_t E() const { AliFatal("Not implemented"); return 0; }\r
204 virtual Double_t M() const { AliFatal("Not implemented"); return 0; }\r
205 \r
206 virtual Double_t Eta() const { return fEta; }\r
207 virtual Double_t Y() const { AliFatal("Not implemented"); return 0; }\r
208 \r
209 virtual Short_t Charge() const { return fCharge; }\r
845fdeca 210 virtual Int_t GetLabel() const { AliFatal("Not implemented"); return 0; }\r
211 // PID\r
212 virtual Int_t PdgCode() const { AliFatal("Not implemented"); return 0; } \r
213 virtual const Double_t *PID() const { AliFatal("Not implemented"); return 0; }\r
214 \r
215 private:\r
216 Float_t fEta; // eta\r
217 Float_t fPhi; // phi\r
218 Float_t fpT; // pT\r
219 Short_t fCharge; // charge\r
220 \r
221 ClassDef( AliBFBasicParticle, 1); // class which contains only quantities requires for this analysis to reduce memory consumption for event mixing\r
222};\r
223\r
f8b2d882 224#endif\r