AliPhysics  ec7afe5 (ec7afe5)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEmcalJetv2QA.cxx
Go to the documentation of this file.
1 // Jet v2 task using QA method, based on jet sample task (S.Aiola).
2 //
3 // Authors: Jason Mueller (CERN summer student 2014) & Alice Ohlson
4 
5 
6 #include <TClonesArray.h>
7 #include <TH1F.h>
8 #include <TH2F.h>
9 #include <TH3F.h>
10 #include <TList.h>
11 #include <TLorentzVector.h>
12 #include <TF1.h>
13 
14 #include "AliVCluster.h"
15 #include "AliAODCaloCluster.h"
16 #include "AliESDCaloCluster.h"
17 #include "AliVTrack.h"
18 #include "AliEmcalJet.h"
19 #include "AliRhoParameter.h"
20 #include "AliLog.h"
21 #include "AliJetContainer.h"
22 #include "AliParticleContainer.h"
23 #include "AliClusterContainer.h"
24 #include "AliPicoTrack.h"
25 
27 
28 using std::cout;
29 using std::endl;
30 
32 
33 //________________________________________________________________________
36  nCentBins(0),
37  nCentBins1(1),
38  centBins(0x0),
39  nJetPtBins(0),
40  nJetPtBins1(1),
41  jetPtBins(0x0),
42  fJetv2(0x0),
43  doPtWeight(kFALSE),
44  fHistTracksPt(0),
45  fHistClustersPt(0),
46  fHistLeadingJetPt(0),
47  fHistLeadingJetPtCorr(0),
48  fHistJetsPhiEta(0),
49  fHistJetsPtArea(0),
50  fHistJetsPtLeadHad(0),
51  fHistJetsCorrPtArea(0),
52  fHistPtDEtaDPhiTrackClus(0),
53  fHistPtDEtaDPhiClusTrack(0),
54  fDPhiJet(0),
55  fDPhiJetPythia(0),
56  fDPhiEP(0),
57  hGx(0),
58  hGy2(0),
59  hGxGy2(0),
60  hGy4(0),
61  hGx2(0),
62  hGx2Gy2(0),
63  hGxGy4(0),
64  hGy6(0),
65  hGx2Gy4(0),
66  hGxGy6(0),
67  hGy8(0),
68  hGy(0),
69  hN(0),
70  htv2std(0),
71  htjv2std(0),
72  htj2v2std(0),
73  hV0jv2std(0),
74  htdPsi(0),
75  htjdPsi(0),
76  htj2dPsi(0),
77  hV0jdPsi(0),
78  hAx(0),
79  hAxDijet(0),
80  hQx(0),
81  hQy(0),
82  hEventData(0),
83  hNTracks(0),
84  hNTracksCent(0),
85  hGxTracks(0),
86  hGyTracks(0),
87  hGy2Tracks(0),
88  hGxGy2Tracks(0),
89  hGy4Tracks(0),
90  htEPRes(0),
91  htjEPRes(0),
92  htj2EPRes(0),
93  fJetsCont(0),
94  fTracksCont(0),
95  fCaloClustersCont(0)
96 {
97  // Default constructor.
98 
99  SetMakeGeneralHistograms(kTRUE);
100 }
101 
102 //________________________________________________________________________
104  AliAnalysisTaskEmcalJet(name, kTRUE),
105  nCentBins(0),
106  nCentBins1(1),
107  centBins(0x0),
108  nJetPtBins(0),
109  nJetPtBins1(1),
110  jetPtBins(0x0),
111  fJetv2(0x0),
112  doPtWeight(kFALSE),
113  fHistTracksPt(0),
114  fHistClustersPt(0),
115  fHistLeadingJetPt(0),
116  fHistLeadingJetPtCorr(0),
117  fHistJetsPhiEta(0),
118  fHistJetsPtArea(0),
119  fHistJetsPtLeadHad(0),
120  fHistJetsCorrPtArea(0),
121  fHistPtDEtaDPhiTrackClus(0),
122  fHistPtDEtaDPhiClusTrack(0),
123  fDPhiJet(0),
124  fDPhiJetPythia(0),
125  fDPhiEP(0),
126  hGx(0),
127  hGy2(0),
128  hGxGy2(0),
129  hGy4(0),
130  hGx2(0),
131  hGx2Gy2(0),
132  hGxGy4(0),
133  hGy6(0),
134  hGx2Gy4(0),
135  hGxGy6(0),
136  hGy8(0),
137  hGy(0),
138  hN(0),
139  htv2std(0),
140  htjv2std(0),
141  htj2v2std(0),
142  hV0jv2std(0),
143  htdPsi(0),
144  htjdPsi(0),
145  htj2dPsi(0),
146  hV0jdPsi(0),
147  hAx(0),
148  hAxDijet(0),
149  hQx(0),
150  hQy(0),
151  hEventData(0),
152  hNTracks(0),
153  hNTracksCent(0),
154  hGxTracks(0),
155  hGyTracks(0),
156  hGy2Tracks(0),
157  hGxGy2Tracks(0),
158  hGy4Tracks(0),
159  htEPRes(0),
160  htjEPRes(0),
161  htj2EPRes(0),
162  fJetsCont(0),
163  fTracksCont(0),
164  fCaloClustersCont(0)
165 {
166  // Standard constructor.
167 
168  // default binning
169  Double_t centBinsTemp[7] = {0,5,10,20,30,40,50};
170  SetCentBins(6,centBinsTemp);
171  Double_t jetPtBinsTemp[6] = {40.,50.,70.,90.,120.,200.};
172  SetJetPtBins(5,jetPtBinsTemp);
173 
175 }
176 
177 //________________________________________________________________________
179 {
180  // Destructor.
181 }
182 
183 //________________________________________________________________________
185 {
186  // Create user output.
187 
189 
191  if(fJetsCont) { //get particles and clusters connected to jets
194  } else { //no jets, just analysis tracks and clusters
197  }
198 
199  fTracksCont->SetClassName("AliVTrack");
200  fCaloClustersCont->SetClassName("AliVCluster");
201 
202  fHistTracksPt = new TH1F("fHistTracksPt","fHistTracksPt", fNbins / 2, fMinBinPt, fMaxBinPt / 2);
203  fHistTracksPt->GetXaxis()->SetTitle("p_{T,track} (GeV/c)");
204  fHistTracksPt->GetYaxis()->SetTitle("counts");
205  fOutput->Add(fHistTracksPt);
206 
207  fHistClustersPt = new TH1F("fHistClustersPt", "fHistClustersPt", fNbins / 2, fMinBinPt, fMaxBinPt / 2);
208  fHistClustersPt->GetXaxis()->SetTitle("p_{T,clus} (GeV/c)");
209  fHistClustersPt->GetYaxis()->SetTitle("counts");
210  fOutput->Add(fHistClustersPt);
211 
212  fHistLeadingJetPt = new TH1F("fHistLeadingJetPt", "fHistLeadingJetPt", fNbins, fMinBinPt, fMaxBinPt);
213  fHistLeadingJetPt->GetXaxis()->SetTitle("p_{T}^{raw} (GeV/c)");
214  fHistLeadingJetPt->GetYaxis()->SetTitle("counts");
216 
217  fHistLeadingJetPtCorr = new TH1F("fHistLeadingJetPtCorr", "fHistLeadingJetPtCorr", fNbins, fMinBinPt, fMaxBinPt);
218  fHistLeadingJetPtCorr->GetXaxis()->SetTitle("p_{T}^{corr} (GeV/c)");
219  fHistLeadingJetPtCorr->GetYaxis()->SetTitle("counts");
221 
222  fHistJetsPhiEta = new TH2F("fHistJetsPhiEta", "fHistJetsPhiEta", 50, -1, 1, 101, 0, TMath::Pi()*2 + TMath::Pi()/200);
223  fHistJetsPhiEta->GetXaxis()->SetTitle("#eta");
224  fHistJetsPhiEta->GetYaxis()->SetTitle("#phi");
225  fOutput->Add(fHistJetsPhiEta);
226 
227  fHistJetsPtArea = new TH2F("fHistJetsPtArea", "fHistJetsPtArea", fNbins, fMinBinPt, fMaxBinPt, 30, 0, 3);
228  fHistJetsPtArea->GetXaxis()->SetTitle("p_{T}^{raw} (GeV/c)");
229  fHistJetsPtArea->GetYaxis()->SetTitle("area");
230  fOutput->Add(fHistJetsPtArea);
231 
232  fHistJetsPtLeadHad = new TH2F("fHistJetsPtLeadHad", "fHistJetsPtLeadHad", fNbins, fMinBinPt, fMaxBinPt, fNbins / 2, fMinBinPt, fMaxBinPt / 2);
233  fHistJetsPtLeadHad->GetXaxis()->SetTitle("p_{T}^{raw} (GeV/c)");
234  fHistJetsPtLeadHad->GetYaxis()->SetTitle("p_{T,lead} (GeV/c)");
235  fHistJetsPtLeadHad->GetZaxis()->SetTitle("counts");
237 
238  fHistJetsCorrPtArea = new TH2F("fHistJetsCorrPtArea", "fHistJetsCorrPtArea", fNbins*2, -fMaxBinPt, fMaxBinPt, 30, 0, 3);
239  fHistJetsCorrPtArea->GetXaxis()->SetTitle("p_{T}^{corr} [GeV/c]");
240  fHistJetsCorrPtArea->GetYaxis()->SetTitle("area");
242 
243  fHistPtDEtaDPhiTrackClus = new TH3F("fHistPtDEtaDPhiTrackClus","fHistPtDEtaDPhiTrackClus;#it{p}_{T}^{track};#Delta#eta;#Delta#varphi",100,0.,100.,100,-0.1,0.1,100,-0.1,0.1);
245 
246  fHistPtDEtaDPhiClusTrack = new TH3F("fHistPtDEtaDPhiClusTrack","fHistPtDEtaDPhiClusTrack;#it{p}_{T}^{clus};#Delta#eta;#Delta#varphi",100,0.,100.,100,-0.1,0.1,100,-0.1,0.1);
248 
249  fDPhiJet = new TH1F("fDPhiJet","fDPhiJet",90, -TMath::Pi()/3, 5*TMath::Pi()/3);
250  fDPhiJet->GetXaxis()->SetTitle("#Delta#varphi");
251  fDPhiJet->GetYaxis()->SetTitle("counts");
252  fOutput->Add(fDPhiJet);
253 
254  fDPhiJetPythia = new TH1F("fDPhiJetPythia","fDPhiJetPythia",90, -TMath::Pi()/3, 5*TMath::Pi()/3);
255  fDPhiJetPythia->GetXaxis()->SetTitle("#Delta#varphi");
256  fDPhiJetPythia->GetYaxis()->SetTitle("counts");
257  fOutput->Add(fDPhiJetPythia);
258 
259  fDPhiEP = new TH1F("fDPhiEP","fDPhiEP",90, 0, 2*TMath::Pi());
260  fDPhiEP->GetXaxis()->SetTitle("#Delta#varphi");
261  fDPhiEP->GetYaxis()->SetTitle("counts");
262  fOutput->Add(fDPhiEP);
263 
264  hGx = new TH2D("hGx", "Gx v Centrality v JetPt", nCentBins, centBins, nJetPtBins, jetPtBins);
265  hGx->GetXaxis()->SetTitle("Centrality (%)");
266  hGx->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
267  fOutput->Add(hGx);
268 
269  hGy2 = new TH2D("hGy2", "Gy2 v Centrality v JetPt", nCentBins, centBins, nJetPtBins, jetPtBins);
270  hGy2->GetXaxis()->SetTitle("Centrality (%)");
271  hGy2->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
272  fOutput->Add(hGy2);
273 
274  hGxGy2 = new TH2D("hGxGy2", "GxGy2 v Centrality v JetPt", nCentBins, centBins, nJetPtBins, jetPtBins);
275  hGxGy2->GetXaxis()->SetTitle("Centrality (%)");
276  hGxGy2->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
277  fOutput->Add(hGxGy2);
278 
279  hGy4 = new TH2D("hGy4", "Gy4 v Centrality v JetPt", nCentBins, centBins, nJetPtBins, jetPtBins);
280  hGy4->GetXaxis()->SetTitle("Centrality (%)");
281  hGy4->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
282  fOutput->Add(hGy4);
283 
284  hGx2 = new TH2D("hGx2", "Gx2 v Centrality v JetPt", nCentBins, centBins, nJetPtBins, jetPtBins);
285  hGx2->GetXaxis()->SetTitle("Centrality (%)");
286  hGx2->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
287  fOutput->Add(hGx2);
288 
289  hGx2Gy2 = new TH2D("hGx2Gy2", "Gx2Gy2 v Centrality v JetPt", nCentBins, centBins, nJetPtBins, jetPtBins);
290  hGx2Gy2->GetXaxis()->SetTitle("Centrality (%)");
291  hGx2Gy2->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
292  fOutput->Add(hGx2Gy2);
293 
294  hGxGy4 = new TH2D("hGxGy4", "GxGy4 v Centrality v JetPt", nCentBins, centBins, nJetPtBins, jetPtBins);
295  hGxGy4->GetXaxis()->SetTitle("Centrality (%)");
296  hGxGy4->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
297  fOutput->Add(hGxGy4);
298 
299  hGy6 = new TH2D("hGy6", "Gy6 v Centrality v JetPt", nCentBins, centBins, nJetPtBins, jetPtBins);
300  hGy6->GetXaxis()->SetTitle("Centrality (%)");
301  hGy6->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
302  fOutput->Add(hGy6);
303 
304  hGx2Gy4 = new TH2D("hGx2Gy4", "Gx2Gy4 v Centrality v JetPt", nCentBins, centBins, nJetPtBins, jetPtBins);
305  hGx2Gy4->GetXaxis()->SetTitle("Centrality (%)");
306  hGx2Gy4->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
307  fOutput->Add(hGx2Gy4);
308 
309  hGxGy6 = new TH2D("hGxGy6", "GxGy6 v Centrality v JetPt", nCentBins, centBins, nJetPtBins, jetPtBins);
310  hGxGy6->GetXaxis()->SetTitle("Centrality (%)");
311  hGxGy6->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
312  fOutput->Add(hGxGy6);
313 
314  hGy8 = new TH2D("hGy8", "Gy8 v Centrality v JetPt", nCentBins, centBins, nJetPtBins, jetPtBins);
315  hGy8->GetXaxis()->SetTitle("Centrality (%)");
316  hGy8->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
317  fOutput->Add(hGy8);
318 
319  hGy = new TH2D("hGy", "Gy v Centrality v JetPt", nCentBins, centBins, nJetPtBins, jetPtBins);
320  hGy->GetXaxis()->SetTitle("Centrality (%)");
321  hGy->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
322  fOutput->Add(hGy);
323 
324  hN = new TH2D("hN", "N v Centrality v JetPt", nCentBins, centBins, nJetPtBins, jetPtBins);
325  hN->GetXaxis()->SetTitle("Centrality (%)");
326  hN->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
327  fOutput->Add(hN);
328 
329  htv2std = new TH2D("htv2std", "v2std v Centrality v JetPt w/o jets", nCentBins, centBins, nJetPtBins, jetPtBins);
330  htv2std->GetXaxis()->SetTitle("Centrality (%)");
331  htv2std->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
332  fOutput->Add(htv2std);
333 
334  htjv2std = new TH2D("htjv2std", "v2std v Centrality v JetPt w/ jets", nCentBins, centBins, nJetPtBins, jetPtBins);
335  htjv2std->GetXaxis()->SetTitle("Centrality (%)");
336  htjv2std->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
337  fOutput->Add(htjv2std);
338 
339  htj2v2std = new TH2D("htj2v2std", "v2std v Centrality v JetPt w/ trackPt < 2 GeV", nCentBins, centBins, nJetPtBins, jetPtBins);
340  htj2v2std->GetXaxis()->SetTitle("Centrality (%)");
341  htj2v2std->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
342  fOutput->Add(htj2v2std);
343 
344  hV0jv2std = new TH2D("hV0jv2std", "v2std v Centrality v JetPt", nCentBins, centBins, nJetPtBins, jetPtBins);
345  hV0jv2std->GetXaxis()->SetTitle("Centrality (%)");
346  hV0jv2std->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
347  fOutput->Add(hV0jv2std);
348 
349  Int_t ndpsibins = 100;
350  Double_t dpsibins[101];
351  for(Int_t t = 0; t < 101; t++) dpsibins[t] = TMath::Pi()*t/50.;
352 
353  htdPsi = new TH3D("htdPsi", "JetAxis - EventPlane w/o jets", nCentBins, centBins, nJetPtBins, jetPtBins, ndpsibins, dpsibins);
354  htdPsi->GetZaxis()->SetTitle("#Psi_{jet} - #Psi_{EP}");
355  fOutput->Add(htdPsi);
356 
357  htjdPsi = new TH3D("htjdPsi", "JetAxis - EventPlane w/ jets", nCentBins, centBins, nJetPtBins, jetPtBins, ndpsibins, dpsibins);
358  htjdPsi->GetZaxis()->SetTitle("#Psi_{jet} - #Psi_{EP}");
359  fOutput->Add(htjdPsi);
360 
361  htj2dPsi = new TH3D("htj2dPsi", "JetAxis - EventPlane w/ trackPt < 2 GeV", nCentBins, centBins, nJetPtBins, jetPtBins, ndpsibins, dpsibins);
362  htj2dPsi->GetZaxis()->SetTitle("#Psi_{jet} - #Psi_{EP}");
363  fOutput->Add(htj2dPsi);
364 
365  hV0jdPsi = new TH3D("hV0jdPsi", "JetAxis - EventPlane", nCentBins, centBins, nJetPtBins, jetPtBins, ndpsibins, dpsibins);
366  hV0jdPsi->GetZaxis()->SetTitle("#Psi_{jet} - #Psi_{EP}");
367  fOutput->Add(hV0jdPsi);
368 
369  hQx = new TH2D("hQx", "Qx Distribution in EP frame", 100, -0.3, 0.3, nCentBins, centBins);
370  hQx->GetXaxis()->SetTitle("Qx");
371  hQx->GetYaxis()->SetTitle("Centrality (%)");
372  fOutput->Add(hQx);
373 
374  hQy = new TH2D("hQy", "Qy Distribution in EP frame", 100, -0.3, 0.3, nCentBins, centBins);
375  hQy->GetXaxis()->SetTitle("Qy");
376  hQy->GetYaxis()->SetTitle("Centrality (%)");
377  fOutput->Add(hQy);
378 
379  hAx = new TH2D("hAx", "Ax Distribution in EP frame w/o Dijets", 100, -35, 70, nJetPtBins, jetPtBins);
380  hAx->GetXaxis()->SetTitle("Ax");
381  hAx->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
382  fOutput->Add(hAx);
383 
384  hAxDijet = new TH2D("hAxDijet", "Ax Distribution in EP frame w/ Dijets", 100, -35, 70, nJetPtBins, jetPtBins);
385  hAxDijet->GetXaxis()->SetTitle("Ax");
386  hAxDijet->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
387  fOutput->Add(hAxDijet);
388 
389  hEventData = new TH1F("hEventData","Events Kept and Discarded", 9, 0, 9);
390  hEventData->GetYaxis()->SetTitle("counts");
391  fOutput->Add(hEventData);
392 
393  hNTracks = new TH2F("hNTracks","Number of Tracks Per Event", 100, 0, 3000, 3, 0, 3);
394  hNTracks->GetXaxis()->SetTitle("# tracks");
395  fOutput->Add(hNTracks);
396 
397  hNTracksCent = new TH2D("hNTracksCent", "NTracks by centrality", 100, 0, 3000, (Int_t)centBins[nCentBins], centBins[0], centBins[nCentBins]);
398  hNTracksCent->GetXaxis()->SetTitle("# tracks");
399  hNTracksCent->GetYaxis()->SetTitle("Centrality (%)");
400  fOutput->Add(hNTracksCent);
401 
402  hGxTracks = new TH2D("hGxTracks", "Gx by NTracks", 200, -200, 200, 100, 0, 3000);
403  hGxTracks->GetXaxis()->SetTitle("Gx");
404  hGxTracks->GetYaxis()->SetTitle("# tracks");
405  fOutput->Add(hGxTracks);
406 
407  hGyTracks = new TH2D("hGyTracks", "Gy by NTracks", 200, -200, 200, 100, 0, 3000);
408  hGyTracks->GetXaxis()->SetTitle("Gy");
409  hGyTracks->GetYaxis()->SetTitle("# tracks");
410  fOutput->Add(hGyTracks);
411 
412  hGy2Tracks = new TH2D("hGy2Tracks", "Gy2 by NTracks", 100, 0, 20000, 100, 0, 3000);
413  hGy2Tracks->GetXaxis()->SetTitle("Gy2");
414  hGy2Tracks->GetYaxis()->SetTitle("# tracks");
415  fOutput->Add(hGy2Tracks);
416 
417  hGxGy2Tracks = new TH2D("hGxGy2Tracks", "GxGy2 by NTracks", 100, -100000, 100000, 100, 0, 3000);
418  hGxGy2Tracks->GetXaxis()->SetTitle("GxGy2");
419  hGxGy2Tracks->GetYaxis()->SetTitle("# tracks");
420  fOutput->Add(hGxGy2Tracks);
421 
422  hGy4Tracks = new TH2D("hGy4Tracks", "Gy4 by NTracks", 100, 0, 100000000, 100, 0, 3000);
423  hGy4Tracks->GetXaxis()->SetTitle("Gy4");
424  hGy4Tracks->GetYaxis()->SetTitle("# tracks");
425  fOutput->Add(hGy4Tracks);
426 
427  htEPRes = new TH2D("htEPRes", "EP Resolution w/o Jets", nCentBins, centBins, nJetPtBins, jetPtBins);
428  htEPRes->GetXaxis()->SetTitle("Centrality (%)");
429  htEPRes->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
430  fOutput->Add(htEPRes);
431 
432  htjEPRes = new TH2D("htjEPRes", "EP Resolution w/ Jets", nCentBins, centBins, nJetPtBins, jetPtBins);
433  htjEPRes->GetXaxis()->SetTitle("Centrality (%)");
434  htjEPRes->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
435  fOutput->Add(htjEPRes);
436 
437  htj2EPRes = new TH2D("htj2EPRes", "EP Resolution w/ trackPT < 2 GeV", nCentBins, centBins, nJetPtBins, jetPtBins);
438  htj2EPRes->GetXaxis()->SetTitle("Centrality (%)");
439  htj2EPRes->GetYaxis()->SetTitle("Leading Jet pT (GeV/c)");
440  fOutput->Add(htj2EPRes);
441 
442  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
443 }
444 
445 //________________________________________________________________________
447 {
448  // Fill histograms.
449 
450  return kTRUE;
451 }
452 
453 
454 //________________________________________________________________________
456 
458 
459  if (fJetsCont && fJetsCont->GetArray() == 0) fJetsCont = 0;
460  if (fTracksCont && fTracksCont->GetArray() == 0) fTracksCont = 0;
461  if (fCaloClustersCont && fCaloClustersCont->GetArray() == 0) fCaloClustersCont = 0;
462 
463 }
464 
465 //________________________________________________________________________
466 Bool_t AliAnalysisTaskEmcalJetv2QA::Run() // this part loops over each event
467 {
468  // Run analysis code here, if needed. It will be executed before FillHistograms().
469 
470  Double_t jetPhi = -999; // angle of leading jet
471  Double_t jetPt = -999; // pt of leading jet
472  Double_t jetArea = -999;
473  Double_t trackPt = -999;
474  Double_t phi = -999; // track phi
475  Double_t dPhi = -999; // track phi - jet axis
476  Double_t dPhiQA = -999; // track phi - EP
477  Double_t tSin = 0; // used for std EP calc
478  Double_t tCos = 0; // used for std EP calc
479  Double_t jSin = 0; // used for std EP calc
480  Double_t jCos = 0; // used for std EP calc
481  Double_t tSin2 = 0; // used for std EP calc with trackPt < 2 GeV
482  Double_t tCos2 = 0; // used for std EP calc with trackPt < 2 GeV
483  Double_t qx = 0; // used for Qx distribution
484  Double_t qy = 0; // used for Qy distribution
485  Double_t ax = 0; // used for Ax distribution
486  Double_t tEP = -999; // EP w/o jets
487  Double_t tjEP = -999; // EP w/ jets
488  Double_t tjEP2 = -999; // EP w/ jets
489  Double_t dPsi = -999; // jet axis - EP
490  Double_t gx = 0; // used for G moment calc
491  Double_t gy = 0; // used for G moment calc
492  Int_t isDijet = 0; // if 0, no dijet. if 1, dijet.
493  Int_t nTracksBkgnd = 0; // used to keep track of number of tracks in background
494  Int_t nTracksJet =0; // used to keep track of number of tracks in jets
495 
496  if(fJetsCont)
497  {
498  fJetsCont->ResetCurrentID();
499  AliEmcalJet *jettest = fJetsCont->GetNextAcceptJet();
500  while(jettest) {
501 
502  fHistJetsPtArea->Fill(jettest->Pt(), jettest->Area());
503  fHistJetsPhiEta->Fill(jettest->Eta(), jettest->Phi());
504 
505  Float_t ptLeading = fJetsCont->GetLeadingHadronPt(jettest);
506  fHistJetsPtLeadHad->Fill(jettest->Pt(), ptLeading);
507 
508  if (fHistJetsCorrPtArea) {
509  Float_t corrPt = jettest->Pt() - fJetsCont->GetRhoVal() * jettest->Area();
510  fHistJetsCorrPtArea->Fill(corrPt, jettest->Area());
511  }
512  jettest = fJetsCont->GetNextAcceptJet();
513  }
514 
515 
517  if(jet)
518  {
519  jetPhi = jet->Phi(); // get leading jet phi (jet axis)
520  jetPt = jet->Pt(); // get leading jet pT to filter out low pT jet events
521  jetArea = jet->Area();
522  }
523  }
524 
525  // event cuts
526  if(!fTracksCont)
527  {
528  hEventData->Fill("!fTracksCont",1);
529  return kFALSE;
530  }
531  if(!fJetsCont)
532  {
533  hEventData->Fill("!fJetsCont",1);
534  return kFALSE;
535  }
536  if(jetPt == -999)
537  {
538  hEventData->Fill("jetPt=-999",1);
539  return kFALSE;
540  }
541  if(jetPt < jetPtBins[0])
542  {
543  hEventData->Fill("leadingJetPt<jetPtMin",1);
544  return kFALSE;
545  }
546  if(jetPt > jetPtBins[nJetPtBins])
547  {
548  hEventData->Fill("leadingJetPt>jetPtMax",1);
549  return kFALSE;
550  }
551  if(fCent < centBins[0])
552  {
553  hEventData->Fill("cent<centMin",1);
554  return kFALSE;
555  }
556  if(fCent > centBins[nCentBins])
557  {
558  hEventData->Fill("cent>centMax",1);
559  return kFALSE;
560  }
561  hEventData->Fill("good event",1);
562 
563  fJetsCont->ResetCurrentID();
564  AliEmcalJet *dijet = fJetsCont->GetNextAcceptJet(); // check for dijet events
565  while(dijet)
566  {
567  if(dijet->Pt() > jetPt*2./3. && fabs(jetPhi-dijet->Phi()-TMath::Pi()) < 0.4) // loop over jets with pT>50 and exclude leading jet and check that angular separation is < 0.4
568  isDijet = 1;
569  dijet = fJetsCont->GetNextAcceptJet();
570  }
571 
572  if (fCaloClustersCont)
573  {
574  fCaloClustersCont->ResetCurrentID();
575  AliVCluster *cluster = fCaloClustersCont->GetNextAcceptCluster();
576  while(cluster) {
577  TLorentzVector nPart;
578  cluster->GetMomentum(nPart, fVertex);
579  fHistClustersPt->Fill(nPart.Pt());
581  }
582  }
583 
584  fHistLeadingJetPt->Fill(jetPt);
585  fHistLeadingJetPtCorr->Fill(jetPt-fJetsCont->GetRhoVal()*jetArea);
586 
587  fTracksCont->ResetCurrentID();
588  AliVTrack *track = static_cast<AliVTrack*>(fTracksCont->GetNextAcceptParticle());
589  while(track)
590  { // loop over all particles (including jet tracks)
591  trackPt = track->Pt();
592  fHistTracksPt->Fill(trackPt);
593  phi = track->Phi(); // get track phi
594 
595  dPhi = phi-jetPhi; // get track phi - jet axis
596  if(dPhi < 0) dPhi += TMath::TwoPi();
597  if(dPhi > TMath::TwoPi()) dPhi -= TMath::TwoPi();
598 
599  dPhiQA = phi-fEPV0; // get track phi - EP
600  if(dPhiQA < 0) dPhiQA += TMath::TwoPi();
601  if(dPhiQA > TMath::TwoPi()) dPhiQA -= TMath::TwoPi();
602  fDPhiEP->Fill(dPhiQA);
603 
604  // fill jet-hadron correlation just to check if track labels make sense...
605  if(track->Pt()>1.)
606  {
607  Double_t dphiJet = dPhi;
608  if(dphiJet > 5*TMath::Pi()/3) dphiJet -= 2*TMath::Pi();
609  if(dphiJet < -TMath::Pi()/3) dphiJet += 2*TMath::Pi();
610  if(track->GetLabel() == 0)
611  fDPhiJet->Fill(dphiJet);
612  else
613  fDPhiJetPythia->Fill(dphiJet);
614  }
615 
616  Double_t weight = 1.;
617  if(doPtWeight) weight = trackPt;
618 
619  gx += weight*cos(2*dPhi);
620  gy += weight*sin(2*dPhi);
621 
622  if(track->GetLabel() == 0)
623  { // sum for std EP method
624  tSin += weight*sin(2*phi); // bkgnd has label = 0
625  tCos += weight*cos(2*phi);
626  qx += weight*cos(2*dPhiQA);
627  qy += weight*sin(2*dPhiQA);
628  nTracksBkgnd += 1;
629  }
630  else
631  {
632  jSin += weight*sin(2*phi); // jets have label =/= 0
633  jCos += weight*cos(2*phi);
634  ax += weight*cos(2*dPhi);
635  nTracksJet += 1;
636  }
637 
638  if(track->Pt() < 2.)
639  { // sum for std EP method w/ trackPt < 2 GeV
640  tSin2 += weight*sin(2*phi);
641  tCos2 += weight*cos(2*phi);
642  }
643 
644 
645  track = static_cast<AliVTrack*>(fTracksCont->GetNextAcceptParticle()); // increment to next track
646  } // close loop over particles
647 
648  hNTracks->Fill(nTracksBkgnd,"Bkgnd Tracks",1);
649  hNTracks->Fill(nTracksJet,"Jet Tracks",1);
650  hNTracks->Fill(nTracksBkgnd+nTracksJet,"Total Tracks",1);
651  hNTracksCent->Fill(nTracksBkgnd+nTracksJet,fCent,1);
652 
653  if(nTracksBkgnd == 0)
654  {
655  hEventData->Fill("no tracks",1);
656  hEventData->Fill("good event",-1);
657  return kFALSE;
658  }
659 
660  Double_t v2weight = 1+2*fJetv2*cos(2*(jetPhi-fEPV0)); // set v2 weight for event
661 
662  hGx->Fill(fCent, jetPt, v2weight*gx); // fill histograms for QA method
663  hGy2->Fill(fCent, jetPt, v2weight*gy*gy);
664  hGxGy2->Fill(fCent, jetPt, v2weight*gx*gy*gy);
665  hGy4->Fill(fCent, jetPt, v2weight*gy*gy*gy*gy);
666  hGx2->Fill(fCent, jetPt, v2weight*gx*gx);
667  hGx2Gy2->Fill(fCent, jetPt, v2weight*gx*gx*gy*gy);
668  hGxGy4->Fill(fCent, jetPt, v2weight*gx*gy*gy*gy*gy);
669  hGy6->Fill(fCent, jetPt, v2weight*gy*gy*gy*gy*gy*gy);
670  hGx2Gy4->Fill(fCent, jetPt, v2weight*gx*gx*gy*gy*gy*gy);
671  hGxGy6->Fill(fCent, jetPt, v2weight*gx*gy*gy*gy*gy*gy*gy);
672  hGy8->Fill(fCent, jetPt, v2weight*gy*gy*gy*gy*gy*gy*gy*gy);
673  hGy->Fill(fCent, jetPt, v2weight*gy);
674  hN->Fill(fCent, jetPt, v2weight);
675 
676  hGxTracks->Fill(gx,nTracksBkgnd+nTracksJet);
677  hGyTracks->Fill(gy,nTracksBkgnd+nTracksJet);
678  hGy2Tracks->Fill(gy*gy,nTracksBkgnd+nTracksJet);
679  hGxGy2Tracks->Fill(gx*gy*gy,nTracksBkgnd+nTracksJet);
680  hGy4Tracks->Fill(gy*gy*gy*gy,nTracksBkgnd+nTracksJet);
681  hQx->Fill(qx/nTracksBkgnd,fCent);
682  hQy->Fill(qy/nTracksBkgnd,fCent);
683 
684  if(isDijet == 0)
685  hAx->Fill(ax,jetPt);
686  if(isDijet == 1)
687  hAxDijet->Fill(ax,jetPt);
688 
689  tEP = 0.5*atan2(tSin,tCos); // calculate EP w/o jets
690  tjEP = 0.5*atan2((tSin+jSin),(tCos+jCos)); // calculate EP w/ jets
691  tjEP2 = 0.5*atan2(tSin2,tCos2); // calculate EP w/ trackPt < 2 GeV
692 
693  htEPRes->Fill(fCent, jetPt, v2weight*cos(2*(tEP-fEPV0)));
694  htjEPRes->Fill(fCent, jetPt, v2weight*cos(2*(tjEP-fEPV0)));
695  htj2EPRes->Fill(fCent, jetPt, v2weight*cos(2*(tjEP2-fEPV0)));
696 
697 
698  dPsi = jetPhi-tEP;
699  if(dPsi < 0) dPsi += TMath::TwoPi();
700  if(dPsi > TMath::TwoPi()) dPsi -= TMath::TwoPi();
701 
702  htv2std->Fill(fCent, jetPt, v2weight*cos(2*dPsi)); // fill histogram with v2 data w/o jets
703  htdPsi->Fill(fCent,jetPt,dPsi); // fill histogram with jet axis - EP w/o jets
704 
705  dPsi = jetPhi-tjEP;
706  if(dPsi < 0) dPsi += TMath::TwoPi();
707  if(dPsi > TMath::TwoPi()) dPsi -= TMath::TwoPi();
708 
709  htjv2std->Fill(fCent, jetPt, v2weight*cos(2*dPsi)); // fill histogram with v2 data w/ jets
710  htjdPsi->Fill(fCent,jetPt,dPsi); // fill histogram with jet axis - EP w/ jets
711 
712  dPsi = jetPhi-tjEP2;
713  if(dPsi < 0) dPsi += TMath::TwoPi();
714  if(dPsi > TMath::TwoPi()) dPsi -= TMath::TwoPi();
715 
716  htj2v2std->Fill(fCent, jetPt, v2weight*cos(2*dPsi)); // fill histogram with v2 data w/ trackPt < 2 GeV
717  htj2dPsi->Fill(fCent,jetPt,dPsi); // fill histogram with jet axis - EP w/ trackPt < 2 GeV
718 
719  dPsi = jetPhi-fEPV0;
720  if(dPsi < 0) dPsi += TMath::TwoPi();
721  if(dPsi > TMath::TwoPi()) dPsi -= TMath::TwoPi();
722 
723  hV0jv2std->Fill(fCent, jetPt, v2weight*cos(2*dPsi)); // fill histogram with v2 data
724  hV0jdPsi->Fill(fCent,jetPt,dPsi); // fill histogram with jet axis - EPV0
725 
726 
727  return kTRUE; // If return kFALSE FillHistogram() will NOT be executed.
728 }
729 
730 //________________________________________________________________________
732 {
733  // Called once at the end of the analysis.
734  if(centBins) delete [] centBins;
735  if(jetPtBins) delete [] jetPtBins;
736 }
737 
739 {
740  if(centBins) delete [] centBins;
741  nCentBins = n;
742  nCentBins1 = n+1;
743  centBins = new Double_t[nCentBins+1];
744  for(Int_t i = 0; i < nCentBins+1; i++)
745  centBins[i]=bins[i];
746  cout << endl << "Setting " << nCentBins << " centrality bins: " << endl;
747  for(Int_t i = 0; i < nCentBins+1; i++)
748  cout << centBins[i] << " ";
749  cout << endl << endl;
750 }
751 
753 {
754  if(jetPtBins) delete [] jetPtBins;
755  nJetPtBins = n;
756  nJetPtBins1 = n+1;
757  jetPtBins = new Double_t[nJetPtBins+1];
758  for(Int_t i = 0; i < nJetPtBins+1; i++)
759  jetPtBins[i]=bins[i];
760  cout << endl << "Setting " << nJetPtBins << " jet pt bins: " << endl;
761  for(Int_t i = 0; i < nJetPtBins+1; i++)
762  cout << jetPtBins[i] << " ";
763  cout << endl << endl;
764 }
void ExecOnce()
Perform steps needed to initialize the analysis.
Double_t Area() const
Definition: AliEmcalJet.h:123
virtual AliVParticle * GetNextAcceptParticle()
Double_t GetRhoVal() const
double Double_t
Definition: External.C:58
Definition: External.C:260
Definition: External.C:236
void SetCentBins(Int_t n, Double_t *bins)
AliJetContainer * GetJetContainer(Int_t i=0) const
Double_t Eta() const
Definition: AliEmcalJet.h:114
Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
Double_t Phi() const
Definition: AliEmcalJet.h:110
TH2F * fHistJetsPhiEta
Leading jet pt spectrum, background subtracted.
Double_t fMinBinPt
min pt in histograms
Double_t fEPV0
!event plane V0
AliClusterContainer * GetClusterContainer() const
TH2F * fHistJetsPtArea
Phi-Eta distribution of jets.
Int_t nCentBins
ClassImp(AliAnalysisTaskEmcalJetv2QA) AliAnalysisTaskEmcalJetv2QA
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
AliParticleContainer * GetParticleContainer() const
AliEmcalJet * GetLeadingJet(const char *opt="")
int Int_t
Definition: External.C:63
Double_t GetLeadingHadronPt(const AliEmcalJet *jet) const
float Float_t
Definition: External.C:68
TH3F * fHistPtDEtaDPhiTrackClus
Jet pt - bkg vs. area.
Definition: External.C:252
Definition: External.C:228
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
Double_t fCent
!event centrality
AliEmcalJet * GetNextAcceptJet()
TH2F * fHistJetsPtLeadHad
Jet pt vs. area.
Double_t Pt() const
Definition: AliEmcalJet.h:102
TH3F * fHistPtDEtaDPhiClusTrack
track pt, delta eta, delta phi to matched cluster
AliEmcalList * fOutput
!output list
Double_t fMaxBinPt
max pt in histograms
TH1F * fHistClustersPt
Track pt spectrum.
Double_t fVertex[3]
!event vertex
TH1F * fHistLeadingJetPt
Cluster pt spectrum.
Bool_t FillHistograms()
Function filling histograms.
AliParticleContainer * fTracksCont
Jets.
void SetMakeGeneralHistograms(Bool_t g)
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
void SetJetPtBins(Int_t n, Double_t *bins)
TH1F * fDPhiJet
cluster pt, delta eta, delta phi to matched track
const char Option_t
Definition: External.C:48
void UserCreateOutputObjects()
Main initialization function on the worker.
TH1F * fHistLeadingJetPtCorr
Leading jet pt spectrum.
TH2F * fHistJetsCorrPtArea
Jet pt vs. leading hadron.
bool Bool_t
Definition: External.C:53
AliVCluster * GetNextAcceptCluster()
AliClusterContainer * fCaloClustersCont
Tracks.
Int_t fNbins
no. of pt bins