AliPhysics  96f6795 (96f6795)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskPWGJEQA.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 #include <cstring>
17 
18 #include <TClonesArray.h>
19 #include <TH1F.h>
20 #include <TH2F.h>
21 #include <THnSparse.h>
22 #include <TMath.h>
23 #include <TString.h>
24 #include <Riostream.h>
25 #include <TChain.h>
26 #include <TFile.h>
27 
28 #include <AliVEventHandler.h>
29 #include <AliAnalysisManager.h>
30 #include "AliParticleContainer.h"
31 #include "AliClusterContainer.h"
32 #include "AliTrackContainer.h"
33 #include "AliCentrality.h"
34 #include "AliVCluster.h"
35 #include "AliVParticle.h"
36 #include "AliVTrack.h"
37 #include "AliLog.h"
38 #include "AliEMCALGeometry.h"
39 #include "AliEMCALGeoParams.h"
40 #include "AliESDtrack.h"
41 #include "AliAODTrack.h"
42 #include "AliAODMCParticle.h"
43 #include "AliMCParticleContainer.h"
44 #include "AliEmcalJet.h"
45 #include "AliJetContainer.h"
46 #include "AliMCEvent.h"
47 #include "AliGenPythiaEventHeader.h"
48 #include "AliAODMCHeader.h"
49 #include "AliPHOSGeometry.h"
50 #include "AliOADBContainer.h"
51 
52 #include "AliAnalysisTaskPWGJEQA.h"
53 
57 
58 //________________________________________________________________________
61  AliAnalysisTaskEmcalJet("AliAnalysisTaskPWGJEQA", kTRUE),
62  fCellEnergyCut(0.05),
63  fMaxPt(250),
64  fNTotTracks(0),
65  fLeadingTrack(),
66  fGeneratorLevel(0),
67  fGeneratorLevelName(),
68  fDetectorLevel(0),
69  fDetectorLevelName(),
70  fNPtHistBins(0),
71  fPtHistBins(0),
72  fNEtaHistBins(0),
73  fEtaHistBins(0),
74  fNPhiHistBins(0),
75  fPhiHistBins(0),
76  fNCentHistBins(0),
77  fCentHistBins(0),
78  fNPtRelDiffHistBins(0),
79  fPtRelDiffHistBins(0),
80  fNPtResHistBins(0),
81  fPtResHistBins(0),
82  fNIntegerHistBins(0),
83  fIntegerHistBins(0),
84  fHistManager("AliAnalysisTaskPWGJEQA"),
85  fDoTrackQA(kTRUE),
86  fDoCaloQA(kTRUE),
87  fDoJetQA(kTRUE),
88  fDoEventQA(kTRUE),
89  fRejectOutlierEvents(kFALSE),
90  fIsPtHard(kFALSE),
91  fPHOSGeo(nullptr)
92 {
93  // Default constructor.
94  memset(fNTotClusters, 0, sizeof(Int_t)*3);
97 }
98 
99 //________________________________________________________________________
104  AliAnalysisTaskEmcalJet(name, kTRUE),
105  fCellEnergyCut(0.05),
106  fMaxPt(250),
107  fNTotTracks(0),
108  fLeadingTrack(),
109  fGeneratorLevel(0),
110  fGeneratorLevelName(),
111  fDetectorLevel(0),
112  fDetectorLevelName(),
113  fNPtHistBins(0),
114  fPtHistBins(0),
115  fNEtaHistBins(0),
116  fEtaHistBins(0),
117  fNPhiHistBins(0),
118  fPhiHistBins(0),
119  fNCentHistBins(0),
120  fCentHistBins(0),
121  fNPtRelDiffHistBins(0),
122  fPtRelDiffHistBins(0),
123  fNPtResHistBins(0),
124  fPtResHistBins(0),
125  fNIntegerHistBins(0),
126  fIntegerHistBins(0),
127  fHistManager(name),
128  fDoTrackQA(kTRUE),
129  fDoCaloQA(kTRUE),
130  fDoJetQA(kTRUE),
131  fDoEventQA(kTRUE),
132  fRejectOutlierEvents(kFALSE),
133  fIsPtHard(kFALSE),
134  fPHOSGeo(nullptr)
135 {
136  // Standard
137  memset(fNTotClusters, 0, sizeof(Int_t)*3);
140 }
141 
142 //________________________________________________________________________
144 {
145  // Destructor
146 }
147 
148 //________________________________________________________________________
150 {
151  // Create histograms
153 
154  // Set track container pointers
157 
158  // Allocate histograms for tracks, cells, clusters, jets
164 
165  TIter next(fHistManager.GetListOfHistograms());
166  TObject* obj = 0;
167  while ((obj = next())) {
168  fOutput->Add(obj);
169  }
170 
171  PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram
172 }
173 
174 //________________________________________________________________________
176 
178  if (fGeneratorLevel) {
181  }
182 }
183 
184 //________________________________________________________________________
186 
187  TString histname;
188  TString title;
189 
190  if (!fCaloCellsName.IsNull()) {
191 
192  histname = TString::Format("%s/fHistCellEnergy", fCaloCellsName.Data());
193  title = histname + ";#it{E}_{cell} (GeV);counts";
194  fHistManager.CreateTH1(histname.Data(), title.Data(), 500,0, 100);
195 
196  histname = TString::Format("%s/fProfCellAbsIdEnergy", fCaloCellsName.Data());
197  title = histname + ";cell absId;<#it{E}_{cell}> (GeV)";
198  fHistManager.CreateTProfile(histname.Data(), title.Data(), 18000,0,18000);
199 
200  histname = TString::Format("%s/fHistCellTime", fCaloCellsName.Data());
201  title = histname + ";#it{t}_{cell} (s);counts";
202  fHistManager.CreateTH1(histname.Data(), title.Data(), 500,-5e-6, 5e-6);
203 
204  histname = TString::Format("%s/fProfCellAbsIdTime", fCaloCellsName.Data());
205  title = histname + ";cell absId;<#it{t}_{cell}> (s)";
206  fHistManager.CreateTProfile(histname.Data(), title.Data(), 18000,0,18000);
207 
208  histname = TString::Format("%s/fHistCellEvsTime", fCaloCellsName.Data());
209  title = histname + ";<#it{t}_{cell}> (s);<#it{E}_{cell}> (GeV)";
210  fHistManager.CreateTH2(histname.Data(), title.Data(), 1000, -1e-6, 1e-6, 200, 0, 100);
211 
212  }
213 }
214 
215 //________________________________________________________________________
217 
218  AliEmcalContainer* cont = 0;
219  TString histname;
220  TString title;
221  Int_t nPtBins = 2*fMaxPt;
222 
223  TIter nextClusColl(&fClusterCollArray);
224  while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) {
225 
226  histname = TString::Format("%s/fHistClusterRejectionReason", cont->GetArrayName().Data());
227  title = histname + ";Rejection reason;#it{E}_{clus} (GeV/);counts";
228  TH2* hist = fHistManager.CreateTH2(histname.Data(), title.Data(), 32, 0, 32, 50, 0, 250);
229  SetRejectionReasonLabels(hist->GetXaxis());
230 
231  histname = TString::Format("%s/hPhosNCellsVsEnergy", cont->GetArrayName().Data());
232  title = histname + ";N cells;#it{E}_{clus} (GeV/);counts";
233  fHistManager.CreateTH2(histname.Data(), title.Data(), 40, 0, 40, nPtBins, 0, fMaxPt);
234 
235  histname = TString::Format("%s/hPhosM02VsEnergy", cont->GetArrayName().Data());
236  title = histname + ";M02;#it{E}_{clus} (GeV/);counts";
237  fHistManager.CreateTH2(histname.Data(), title.Data(), 100, 0, 20, nPtBins, 0, fMaxPt);
238 
239  histname = TString::Format("%s/hPhosCellIdVsEnergy", cont->GetArrayName().Data());
240  title = histname + ";Cell ID;#it{E}_{clus} (GeV/);counts";
241  fHistManager.CreateTH2(histname.Data(), title.Data(), 20000, 0, 20000, nPtBins, 0, fMaxPt);
242 
243  const Int_t nEmcalSM = 20;
244  for (Int_t sm = 0; sm < nEmcalSM; sm++) {
245  histname = TString::Format("%s/BySM/hEmcalClusEnergy_SM%d", cont->GetArrayName().Data(), sm);
246  title = histname + ";#it{E}_{cluster} (GeV);counts";
247  fHistManager.CreateTH1(histname.Data(), title.Data(), nPtBins, 0, fMaxPt);
248  }
249 
250  for (Int_t sm = 1; sm < 5; sm++) {
251  histname = TString::Format("%s/BySM/hPhosClusEnergy_SM%d", cont->GetArrayName().Data(), sm);
252  title = histname + ";#it{E}_{cluster} (GeV);counts";
253  fHistManager.CreateTH1(histname.Data(), title.Data(), nPtBins, 0, fMaxPt);
254  }
255 
256  // Cluster THnSparse
257  Int_t dim = 0;
258  TString title[20];
259  Int_t nbins[20] = {0};
260  Double_t min[30] = {0.};
261  Double_t max[30] = {0.};
262  Double_t *binEdges[20] = {0};
263 
265  title[dim] = "Centrality %";
266  nbins[dim] = fNCentHistBins;
267  binEdges[dim] = fCentHistBins;
268  min[dim] = fCentHistBins[0];
269  max[dim] = fCentHistBins[fNCentHistBins];
270  dim++;
271  }
272 
273  title[dim] = "#it{E}_{clus} (GeV)";
274  nbins[dim] = fNPtHistBins;
275  binEdges[dim] = fPtHistBins;
276  min[dim] = fPtHistBins[0];
277  max[dim] = fPtHistBins[fNPtHistBins];
278  dim++;
279 
280  title[dim] = "#eta";
281  nbins[dim] = fNEtaHistBins;
282  binEdges[dim] = fEtaHistBins;
283  min[dim] = fEtaHistBins[0];
284  max[dim] = fEtaHistBins[fNEtaHistBins];
285  dim++;
286 
287  title[dim] = "#phi";
288  nbins[dim] = fNPhiHistBins;
289  binEdges[dim] = fPhiHistBins;
290  min[dim] = fPhiHistBins[0];
291  max[dim] = fPhiHistBins[fNPhiHistBins];
292  dim++;
293 
294  title[dim] = "cluster type";
295  nbins[dim] = 3;
296  binEdges[dim] = fIntegerHistBins;
297  min[dim] = fIntegerHistBins[0];
298  max[dim] = fIntegerHistBins[3];
299  dim++;
300 
301  TString thnname = TString::Format("%s/clusterObservables", cont->GetArrayName().Data());
302  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
303  for (Int_t i = 0; i < dim; i++) {
304  hn->GetAxis(i)->SetTitle(title[i]);
305  hn->SetBinEdges(i, binEdges[i]);
306  }
307  }
308 }
309 
310 //________________________________________________________________________
312 
313  AliJetContainer* jets = 0;
314  TIter nextJetColl(&fJetCollArray);
315  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
316 
317  // Allocate THnSparse
318  Double_t jetRadius = jets->GetJetRadius();
319 
320  TString axisTitle[30]= {""};
321  Int_t nbins[30] = {0};
322  Double_t min[30] = {0.};
323  Double_t max[30] = {0.};
324  Double_t *binEdges[20] = {0};
325  Int_t dim = 0;
326 
327  if (fForceBeamType != kpp) {
328  axisTitle[dim] = "Centrality (%)";
329  nbins[dim] = fNCentHistBins;
330  binEdges[dim] = fCentHistBins;
331  min[dim] = fCentHistBins[0];
332  max[dim] = fCentHistBins[fNCentHistBins];
333  dim++;
334  }
335 
336  axisTitle[dim] = "#eta_{jet}";
337  nbins[dim] = fNEtaHistBins;
338  binEdges[dim] = fEtaHistBins;
339  min[dim] = fEtaHistBins[0];
340  max[dim] = fEtaHistBins[fNEtaHistBins];
341  dim++;
342 
343  axisTitle[dim] = "#phi_{jet} (rad)";
344  nbins[dim] = fNPhiHistBins;
345  binEdges[dim] = fPhiHistBins;
346  min[dim] = fPhiHistBins[0];
347  max[dim] = fPhiHistBins[fNPhiHistBins];
348  dim++;
349 
350  axisTitle[dim] = "#it{p}_{T} (GeV/#it{c})";
351  nbins[dim] = TMath::CeilNint(fMaxPt/3);
352  min[dim] = 0;
353  max[dim] = fMaxPt;
354  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
355  dim++;
356 
357  if (fForceBeamType != kpp) {
358  axisTitle[dim] = "#it{p}_{T}^{corr} (GeV/#it{c})";
359  nbins[dim] = TMath::CeilNint(fMaxPt/3);
360  min[dim] = -fMaxPt/2 + 25;
361  max[dim] = fMaxPt/2 + 25;
362  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
363  dim++;
364  }
365 
366  axisTitle[dim] = "#it{p}_{T,particle}^{leading} (GeV/#it{c})";
367  nbins[dim] = fMaxPt/5;
368  min[dim] = 0;
369  max[dim] = 150;
370  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
371  dim++;
372 
373  TString thnname = TString::Format("%s/fHistJetObservables", jets->GetArrayName().Data());
374  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
375  for (Int_t i = 0; i < dim; i++) {
376  hn->GetAxis(i)->SetTitle(axisTitle[i]);
377  hn->SetBinEdges(i, binEdges[i]);
378  }
379 
380  // Allocate other jet histograms
381  TString histname;
382  TString title;
383  histname = TString::Format("%s/fHistJetRejectionReason", jets->GetArrayName().Data());
384  title = histname + ";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
385  TH2* hist = fHistManager.CreateTH2(histname.Data(), title.Data(), 32, 0, 32, 50, 0, 250);
386  SetRejectionReasonLabels(hist->GetXaxis());
387 
388  if (!jets->GetRhoName().IsNull()) {
389  histname = TString::Format("%s/fHistRhoVsCent", jets->GetArrayName().Data());
390  title = histname + ";Centrality (%);#rho (GeV/#it{c});counts";
391  fHistManager.CreateTH2(histname.Data(), title.Data(), 101, 0, 101, 100, 0, 500);
392  }
393  }
394 }
395 
396 //________________________________________________________________________
398 
399  Int_t nPtBins = 2*fMaxPt;
400 
401  Int_t dim = 0;
402  TString axistitle[40];
403  Int_t nbins[40] = {0};
404  Double_t min[40] = {0};
405  Double_t max[40] = {0};
406  Double_t *binEdges[20] = {0};
407 
409  axistitle[dim] = "Centrality %";
410  nbins[dim] = fNCentHistBins;
411  binEdges[dim] = fCentHistBins;
412  min[dim] = fCentHistBins[0];
413  max[dim] = fCentHistBins[fNCentHistBins];
414  dim++;
415  }
416 
417  if (fParticleCollArray.GetEntriesFast()>0) {
418  axistitle[dim] = "No. of tracks";
420  nbins[dim] = 50;
421  min[dim] = -0.5;
422  max[dim] = 10000-0.5;
423  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
424  }
425  else {
426  nbins[dim] = 50;
427  min[dim] = 0;
428  max[dim] = 200;
429  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
430  }
431  dim++;
432 
433  axistitle[dim] = "#it{p}_{T,track}^{leading} (GeV/c)";
434  nbins[dim] = fMaxPt/5;
435  min[dim] = 0;
436  max[dim] = 150;
437  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
438  dim++;
439  }
440 
441  if (fClusterCollArray.GetEntriesFast()>0) {
442  axistitle[dim] = "No. of clusters";
443 
445  nbins[dim] = 50;
446  min[dim] = -0.5;
447  max[dim] = 4000-0.5;
448  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
449  }
450  else {
451  nbins[dim] = 50;
452  min[dim] = 0;
453  max[dim] = 200;
454  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
455  }
456  dim++;
457 
458  axistitle[dim] = "#it{E}_{cluster}^{leading} (GeV)";
459  nbins[dim] = fMaxPt/5;
460  min[dim] = 0;
461  max[dim] = 150;
462  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
463  dim++;
464  }
465 
466  THnSparse* hn = fHistManager.CreateTHnSparse("eventQA","eventQA",dim,nbins,min,max);
467  for (Int_t i = 0; i < dim; i++) {
468  hn->GetAxis(i)->SetTitle(axistitle[i]);
469  hn->SetBinEdges(i, binEdges[i]);
470  }
471 
472  if (fIsPtHard) {
473  TString histname = "hPtHard";
474  TString title = histname + ";#it{p}_{T,hard} (GeV/c);counts";
475  fHistManager.CreateTH1(histname.Data(), title.Data(), nPtBins, 0, fMaxPt);
476 
477  TH1* hTrials = fHistManager.CreateTH1("hNtrials", "hNtrials", 1, 0, 1);
478  hTrials->GetXaxis()->SetBinLabel(1,"#sum{ntrials}");
479 
480  TH1* hxsection = fHistManager.CreateTH1("hXsec", "hXsec", 1, 0, 1);
481  hxsection->GetXaxis()->SetBinLabel(1,"<#sigma>");
482  }
483 
484  fHistEventRejection->GetXaxis()->SetBinLabel(15,"PtHardBinJetOutlier");
485 
486 }
487 
488 //________________________________________________________________________
490 {
491  Int_t dim = 0;
492  TString title[20];
493  Int_t nbins[20] = {0};
494  Double_t min[30] = {0.};
495  Double_t max[30] = {0.};
496  Double_t *binEdges[20] = {0};
497 
499  title[dim] = "Centrality %";
500  nbins[dim] = fNCentHistBins;
501  binEdges[dim] = fCentHistBins;
502  min[dim] = fCentHistBins[0];
503  max[dim] = fCentHistBins[fNCentHistBins];
504  dim++;
505  }
506 
507  title[dim] = "#it{p}_{T} (GeV/#it{c})";
508  nbins[dim] = fNPtHistBins;
509  binEdges[dim] = fPtHistBins;
510  min[dim] = fPtHistBins[0];
511  max[dim] = fPtHistBins[fNPtHistBins];
512  dim++;
513 
514  title[dim] = "#eta";
515  nbins[dim] = fNEtaHistBins;
516  binEdges[dim] = fEtaHistBins;
517  min[dim] = fEtaHistBins[0];
518  max[dim] = fEtaHistBins[fNEtaHistBins];
519  dim++;
520 
521  title[dim] = "#phi";
522  nbins[dim] = fNPhiHistBins;
523  binEdges[dim] = fPhiHistBins;
524  min[dim] = fPhiHistBins[0];
525  max[dim] = fPhiHistBins[fNPhiHistBins];
526  dim++;
527 
528  title[dim] = "track type";
529  nbins[dim] = 3;
530  binEdges[dim] = fIntegerHistBins;
531  min[dim] = fIntegerHistBins[0];
532  max[dim] = fIntegerHistBins[3];
533  dim++;
534 
535  title[dim] = "#sigma(#it{p}_{T}) / #it{p}_{T}";
536  nbins[dim] = fNPtResHistBins;
537  binEdges[dim] = fPtResHistBins;
538  min[dim] = fPtResHistBins[0];
539  max[dim] = fPtResHistBins[fNPtResHistBins];
540  dim++;
541 
542  THnSparse* hn = fHistManager.CreateTHnSparse("tracks","tracks", dim, nbins, min, max);
543  for (Int_t i = 0; i < dim; i++) {
544  hn->GetAxis(i)->SetTitle(title[i]);
545  hn->SetBinEdges(i, binEdges[i]);
546  }
547 
548 }
549 
550 //________________________________________________________________________
552 {
553  Int_t dim = 0;
554  TString title[20];
555  Int_t nbins[20] = {0};
556  Double_t min[30] = {0.};
557  Double_t max[30] = {0.};
558  Double_t *binEdges[20] = {0};
559 
561  title[dim] = "Centrality %";
562  nbins[dim] = fNCentHistBins;
563  binEdges[dim] = fCentHistBins;
564  min[dim] = fCentHistBins[0];
565  max[dim] = fCentHistBins[fNCentHistBins];
566  dim++;
567  }
568 
569  title[dim] = "#it{p}_{T} (GeV/#it{c})";
570  nbins[dim] = fNPtHistBins;
571  binEdges[dim] = fPtHistBins;
572  min[dim] = fPtHistBins[0];
573  max[dim] = fPtHistBins[fNPtHistBins];
574  dim++;
575 
576  title[dim] = "#eta";
577  nbins[dim] = fNEtaHistBins;
578  binEdges[dim] = fEtaHistBins;
579  min[dim] = fEtaHistBins[0];
580  max[dim] = fEtaHistBins[fNEtaHistBins];
581  dim++;
582 
583  title[dim] = "#phi";
584  nbins[dim] = fNPhiHistBins;
585  binEdges[dim] = fPhiHistBins;
586  min[dim] = fPhiHistBins[0];
587  max[dim] = fPhiHistBins[fNPhiHistBins];
588  dim++;
589 
590  title[dim] = "Findable";
591  nbins[dim] = 2;
592  binEdges[dim] = fIntegerHistBins;
593  min[dim] = fIntegerHistBins[0];
594  max[dim] = fIntegerHistBins[2];
595  dim++;
596 
597  THnSparse* hn = fHistManager.CreateTHnSparse("tracks_PhysPrim","tracks_PhysPrim", dim, nbins, min, max);
598  for (Int_t i = 0; i < dim; i++) {
599  hn->GetAxis(i)->SetTitle(title[i]);
600  hn->SetBinEdges(i, binEdges[i]);
601  }
602 }
603 
604 //________________________________________________________________________
606 {
607  Int_t dim = 0;
608  TString title[20];
609  Int_t nbins[20] = {0};
610  Double_t min[30] = {0.};
611  Double_t max[30] = {0.};
612  Double_t *binEdges[20] = {0};
613 
615  title[dim] = "Centrality %";
616  nbins[dim] = fNCentHistBins;
617  binEdges[dim] = fCentHistBins;
618  min[dim] = fCentHistBins[0];
619  max[dim] = fCentHistBins[fNCentHistBins];
620  dim++;
621  }
622 
623  title[dim] = "#it{p}_{T}^{gen} (GeV/#it{c})";
624  nbins[dim] = fNPtHistBins;
625  binEdges[dim] = fPtHistBins;
626  min[dim] = fPtHistBins[0];
627  max[dim] = fPtHistBins[fNPtHistBins];
628  dim++;
629 
630  title[dim] = "#eta^{gen}";
631  nbins[dim] = fNEtaHistBins;
632  binEdges[dim] = fEtaHistBins;
633  min[dim] = fEtaHistBins[0];
634  max[dim] = fEtaHistBins[fNEtaHistBins];
635  dim++;
636 
637  title[dim] = "#phi^{gen}";
638  nbins[dim] = fNPhiHistBins;
639  binEdges[dim] = fPhiHistBins;
640  min[dim] = fPhiHistBins[0];
641  max[dim] = fPhiHistBins[fNPhiHistBins];
642  dim++;
643 
644  title[dim] = "#it{p}_{T}^{det} (GeV/#it{c})";
645  nbins[dim] = fNPtHistBins;
646  binEdges[dim] = fPtHistBins;
647  min[dim] = fPtHistBins[0];
648  max[dim] = fPtHistBins[fNPtHistBins];
649  dim++;
650 
651  title[dim] = "#eta^{det}";
652  nbins[dim] = fNEtaHistBins;
653  binEdges[dim] = fEtaHistBins;
654  min[dim] = fEtaHistBins[0];
655  max[dim] = fEtaHistBins[fNEtaHistBins];
656  dim++;
657 
658  title[dim] = "#phi^{det}";
659  nbins[dim] = fNPhiHistBins;
660  binEdges[dim] = fPhiHistBins;
661  min[dim] = fPhiHistBins[0];
662  max[dim] = fPhiHistBins[fNPhiHistBins];
663  dim++;
664 
665  title[dim] = "(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{gen}";
666  nbins[dim] = fNPtRelDiffHistBins;
667  binEdges[dim] = fPtRelDiffHistBins;
668  min[dim] = fPtRelDiffHistBins[0];
670  dim++;
671 
672  title[dim] = "track type";
673  nbins[dim] = 3;
674  binEdges[dim] = fIntegerHistBins;
675  min[dim] = fIntegerHistBins[0];
676  max[dim] = fIntegerHistBins[3];
677  dim++;
678 
679  THnSparse* hn = fHistManager.CreateTHnSparse("tracks_Matched","tracks_Matched", dim, nbins, min, max);
680  for (Int_t i = 0; i < dim; i++) {
681  hn->GetAxis(i)->SetTitle(title[i]);
682  hn->SetBinEdges(i, binEdges[i]);
683  }
684 }
685 
686 
687 //________________________________________________________________________
690 {
691  fNPtHistBins = 82;
694  GenerateFixedBinArray(7, 0.3, 1, fPtHistBins+6);
695  GenerateFixedBinArray(10, 1, 3, fPtHistBins+13);
696  GenerateFixedBinArray(14, 3, 10, fPtHistBins+23);
697  GenerateFixedBinArray(10, 10, 20, fPtHistBins+37);
698  GenerateFixedBinArray(15, 20, 50, fPtHistBins+47);
699  GenerateFixedBinArray(20, 50, 150, fPtHistBins+62);
700 
701  fNEtaHistBins = 70;
704 
705  fNPhiHistBins = 101;
707  GenerateFixedBinArray(fNPhiHistBins, 0, TMath::Pi() * 2.02, fPhiHistBins);
708 
709  fNCentHistBins = 4;
711  fCentHistBins[0] = 0;
712  fCentHistBins[1] = 10;
713  fCentHistBins[2] = 30;
714  fCentHistBins[3] = 50;
715  fCentHistBins[4] = 90;
716 
717  fNPtResHistBins = 100;
720  GenerateFixedBinArray(25, 0.05, 0.10, fPtResHistBins+50);
721  GenerateFixedBinArray(15, 0.10, 0.20, fPtResHistBins+75);
722  GenerateFixedBinArray(10, 0.20, 0.50, fPtResHistBins+90);
723 
724  fNPtRelDiffHistBins = 50;
727 
728  fNIntegerHistBins = 3;
731 }
732 
733 //________________________________________________________________________
735 {
736  if (fClusterCollArray.GetEntriesFast() == 0 && fCaloCellsName.IsNull()) {
737  fNeedEmcalGeom = kFALSE;
738  }
739  else {
740  fNeedEmcalGeom = kTRUE;
741  }
742 
744 
745  // Load the PHOS geometry
746  fPHOSGeo = AliPHOSGeometry::GetInstance();
747  if (fPHOSGeo) {
748  AliInfo("Found instance of PHOS geometry!");
749  }
750  else {
751  AliInfo("Creating PHOS geometry!");
752  Int_t runNum = InputEvent()->GetRunNumber();
753  if(runNum<209122) //Run1
754  fPHOSGeo = AliPHOSGeometry::GetInstance("IHEP");
755  else
756  fPHOSGeo = AliPHOSGeometry::GetInstance("Run2");
757 
758  if (fPHOSGeo) {
759  AliOADBContainer geomContainer("phosGeo");
760  geomContainer.InitFromFile("$ALICE_PHYSICS/OADB/PHOS/PHOSMCGeometry.root","PHOSMCRotationMatrixes");
761  TObjArray* matrixes = (TObjArray*)geomContainer.GetObject(runNum,"PHOSRotationMatrixes");
762  for(Int_t mod=0; mod<6; mod++) {
763  if(!matrixes->At(mod)) continue;
764  fPHOSGeo->SetMisalMatrix(((TGeoHMatrix*)matrixes->At(mod)),mod);
765  printf(".........Adding Matrix(%d), geo=%p\n",mod,fPHOSGeo);
766  ((TGeoHMatrix*)matrixes->At(mod))->Print();
767  }
768  }
769  }
770 
771 }
772 
773 //________________________________________________________________________
775 {
776  if (!AliAnalysisTaskEmcalJet::RetrieveEventObjects()) return kFALSE;
777 
778  // If Pt-hard production, get the Pt-hard of the event, and have possibility to reject the event for jet outliers
779  if (fIsPtHard) {
780  AliGenPythiaEventHeader* pygen;
781  if (MCEvent()) {
782  pygen = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent()->GenEventHeader());
783  if (!pygen) {
784  // Check if AOD
785  AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
786  if (aodMCH) {
787  for (UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
788  pygen = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i));
789  if (pygen) break;
790  }
791  }
792  }
793  }
794  if (pygen) {
795  fPtHard = pygen->GetPtHard();
796  //fNTrials = pygen->Trials();
797  //fXsection = pygen->GetXsection();
798 
799  // reject outlier events, where the jet Pt is much larger than Pt-hard
800  if (fRejectOutlierEvents) {
801  AliTLorentzVector jet;
802  Int_t nTriggerJets = pygen->NTriggerJets();
803  Float_t tmpjet[]={0,0,0,0};
804  for (Int_t ijet = 0; ijet< nTriggerJets; ijet++) {
805  pygen->TriggerJet(ijet, tmpjet);
806  jet.SetPxPyPzE(tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3]);
807 
808  if (jet.Pt() > 4. * fPtHard) {
809  //AliInfo(Form("Reject jet event with: pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n", fPtHard, jet.Pt(), 4.));
810  if (fGeneralHistograms) fHistEventRejection->Fill("PtHardBinJetOutlier",1);
811  return kFALSE;
812  }
813  }
814  }
815  }
816  }
817 
818  return kTRUE;
819 }
820 
828 //________________________________________________________________________
830 {
831  if (fIsPtHard) {
832  TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
833  if (!tree) {
834  AliError(Form("%s - UserNotify: No current tree!",GetName()));
835  return kFALSE;
836  }
837 
838  Float_t xsection = 0;
839  Float_t trials = 0;
840  Int_t pthardbin = 0;
841 
842  TFile *curfile = tree->GetCurrentFile();
843  if (!curfile) {
844  AliError(Form("%s - UserNotify: No current file!",GetName()));
845  return kFALSE;
846  }
847 
848  TChain *chain = dynamic_cast<TChain*>(tree);
849  if (chain) tree = chain->GetTree();
850 
851  PythiaInfoFromFile(curfile->GetName(), xsection, trials, pthardbin);
852 
853  fHistManager.FillTH1("hNtrials", "#sum{ntrials}", trials);
854  fHistManager.FillTH1("hXsec", "<#sigma>", xsection);
855  }
856  return kTRUE;
857 }
858 
859 //________________________________________________________________________
861 {
867 
868  return kTRUE;
869 }
870 
871 //________________________________________________________________________
873 
874  fNTotTracks = 0;
875  fLeadingTrack.SetPxPyPzE(0,0,0,0);
876 
877  AliVTrack* track;
878  for (auto trackIterator : fDetectorLevel->accepted_momentum() ) {
879 
880  fNTotTracks++;
881  if (fLeadingTrack.Pt() < trackIterator.first.Pt()) fLeadingTrack = trackIterator.first;
882 
883  track = trackIterator.second;
884  Byte_t type = fDetectorLevel->GetTrackType(track);
885  if (type <= 2) {
886  Double_t sigma = 0;
887 
888  if (fIsEsd) {
889 
890  AliESDtrack *esdTrack = dynamic_cast<AliESDtrack*>(track);
891  if (esdTrack) sigma = TMath::Sqrt(esdTrack->GetSigma1Pt2());
892 
893  } else { // AOD
894 
895  AliAODTrack *aodtrack = dynamic_cast<AliAODTrack*>(track);
896  if(!aodtrack) AliFatal("Not a standard AOD");
897 
898  AliExternalTrackParam exParam;
899 
900  //get covariance matrix
901  Double_t cov[21] = {0,};
902  aodtrack->GetCovMatrix(cov);
903  Double_t pxpypz[3] = {0,};
904  aodtrack->PxPyPz(pxpypz);
905  Double_t xyz[3] = {0,};
906  aodtrack->GetXYZ(xyz);
907  Short_t sign = aodtrack->Charge();
908  exParam.Set(xyz,pxpypz,cov,sign);
909 
910  sigma = TMath::Sqrt(exParam.GetSigma1Pt2());
911 
912  }
913 
914  Int_t label = TMath::Abs(track->GetLabel());
915 
916  FillDetectorLevelTHnSparse(fCent, track->Eta(), track->Phi(), track->Pt(), sigma, type);
917 
918  if (fGeneratorLevel && label > 0) {
919  AliAODMCParticle *part = fGeneratorLevel->GetAcceptMCParticleWithLabel(label);
920  if (part) {
921  if (part->GetGeneratorIndex() == 0) {
922  Int_t pdg = TMath::Abs(part->PdgCode());
923  // select charged pions, protons, kaons, electrons, muons
924  if (pdg == 211 || pdg == 2212 || pdg == 321 || pdg == 11 || pdg == 13) {
925  FillMatchedParticlesTHnSparse(fCent, part->Eta(), part->Phi(), part->Pt(), track->Eta(), track->Phi(), track->Pt(), type);
926  }
927  }
928  }
929  }
930  }
931  else {
932  AliError(Form("Track %d has type %d not recognized!", fDetectorLevel->GetCurrentID(), type));
933  }
934  }
935 
936  if (fGeneratorLevel) {
937  AliAODMCParticle* part;
938  for (auto partIterator : fGeneratorLevel->accepted_momentum() ) {
939  part = partIterator.second;
940 
941  Byte_t findable = 0;
942 
943  Int_t pdg = TMath::Abs(part->PdgCode());
944  // select charged pions, protons, kaons, electrons, muons
945  if (pdg == 211 || pdg == 2212 || pdg == 321 || pdg == 11 || pdg == 13) findable = 1;
946 
947  FillGeneratorLevelTHnSparse(fCent, part->Eta(), part->Phi(), part->Pt(), findable);
948  }
949  }
950 }
951 
952 //________________________________________________________________________
954 
955  if (!fCaloCells) return;
956 
957  TString histname_energy = TString::Format("%s/fHistCellEnergy", fCaloCellsName.Data());
958  TString histname_time = TString::Format("%s/fHistCellTime", fCaloCellsName.Data());
959  TString histname_energyProf = TString::Format("%s/fProfCellAbsIdEnergy", fCaloCellsName.Data());
960  TString histname_timeProf = TString::Format("%s/fProfCellAbsIdTime", fCaloCellsName.Data());
961  TString histname_EnergyvsTime = TString::Format("%s/fHistCellEvsTime", fCaloCellsName.Data());
962 
963  const Int_t ncells = fCaloCells->GetNumberOfCells();
964  for (Int_t pos = 0; pos < ncells; pos++) {
965  Float_t amp = fCaloCells->GetAmplitude(pos);
966  Float_t time = fCaloCells->GetTime(pos);
967  Int_t absId = fCaloCells->GetCellNumber(pos);
968 
969  if (amp < fCellEnergyCut) continue;
970 
971  fHistManager.FillTH1(histname_energy, amp);
972  fHistManager.FillTH1(histname_time, time);
973 
974  fHistManager.FillProfile(histname_energyProf, absId, amp);
975  fHistManager.FillProfile(histname_timeProf, absId, time);
976 
977  fHistManager.FillTH2(histname_EnergyvsTime, time, amp);
978  }
979 }
980 
981 //________________________________________________________________________
983 
984  memset(fNTotClusters, 0, sizeof(Int_t)*3);
985  for (Int_t i = 0; i < 3; i++) fLeadingCluster[i].SetPxPyPzE(0,0,0,0);
986 
987  TString histname;
988  AliClusterContainer* clusters = 0;
989  TIter nextClusColl(&fClusterCollArray);
990  while ((clusters = static_cast<AliClusterContainer*>(nextClusColl()))) {
991  // Cluster loop
993  for (AliClusterIterableMomentumContainer::iterator it = itcont.begin(); it != itcont.end(); it++) {
994 
995  UInt_t rejectionReason = 0;
996  if (!clusters->AcceptCluster(it.current_index(), rejectionReason)) {
997  histname = TString::Format("%s/fHistClusterRejectionReason", clusters->GetArrayName().Data());
998  fHistManager.FillTH2(histname, clusters->GetRejectionReasonBitPosition(rejectionReason), it->first.E());
999  continue;
1000  }
1001 
1002  // Determine cluster type (EMCal/DCal/Phos) and record relevant eventQA info
1003  ClusterType clusType = kNA;
1004  if (it->second->IsEMCAL()) {
1005  Double_t phi = it->first.Phi_0_2pi();
1006  Int_t isDcal = Int_t(phi > fgkEMCalDCalPhiDivide);
1007  if (isDcal == 0) {
1008  clusType = kEMCal;
1009  } else if (isDcal == 1) {
1010  clusType = kDCal;
1011  }
1012 
1013  if (fLeadingCluster[isDcal].E() < it->first.E()) fLeadingCluster[isDcal] = it->first;
1014  fNTotClusters[isDcal]++;
1015 
1016  Int_t sm = fGeom->GetSuperModuleNumber(it->second->GetCellAbsId(0));
1017  if (sm >=0 && sm < 20) {
1018  histname = TString::Format("%s/BySM/hEmcalClusEnergy_SM%d", clusters->GetArrayName().Data(), sm);
1019  fHistManager.FillTH1(histname, it->second->E());
1020  }
1021  else {
1022  AliError(Form("Supermodule %d does not exist!", sm));
1023  }
1024 
1025  } else if (it->second->GetType() == AliVCluster::kPHOSNeutral){
1026 
1027  Int_t nCells = it->second->GetNCells();
1028  Double_t M02 = it->second->GetM02();
1029  Double_t energy = it->second->E();
1030 
1031  histname = TString::Format("%s/hPhosNCellsVsEnergy", clusters->GetArrayName().Data());
1032  fHistManager.FillTH2(histname, nCells, energy);
1033 
1034  histname = TString::Format("%s/hPhosM02VsEnergy", clusters->GetArrayName().Data());
1035  fHistManager.FillTH2(histname, M02, energy);
1036 
1037  clusType = kPHOS;
1038  fNTotClusters[2]++;
1039  if (fLeadingCluster[2].E() < it->first.E()) fLeadingCluster[2] = it->first;
1040 
1041  // Fill Phos spectra by module
1042  Int_t relid[4];
1043  if (fPHOSGeo) {
1044  fPHOSGeo->AbsToRelNumbering(it->second->GetCellAbsId(0), relid);
1045  Int_t sm = relid[0];
1046  if (sm >=1 && sm < 5) {
1047  histname = TString::Format("%s/BySM/hPhosClusEnergy_SM%d", clusters->GetArrayName().Data(), sm);
1048  fHistManager.FillTH1(histname, energy);
1049  }
1050  else {
1051  AliError(Form("Supermodule %d does not exist!", sm));
1052  }
1053  }
1054 
1055  // Loop through cells in the cluster, and histogram their energy
1056  histname = TString::Format("%s/hPhosCellIdVsEnergy", clusters->GetArrayName().Data());
1057  for (Int_t i=0; i < nCells; i++) {
1058  fHistManager.FillTH2(histname, it->second->GetCellAbsId(i), energy);
1059  }
1060 
1061  }
1062 
1063  Double_t contents[30]={0};
1064  histname = TString::Format("%s/clusterObservables", clusters->GetArrayName().Data());
1065  THnSparse* histClusterObservables = static_cast<THnSparse*>(fHistManager.FindObject(histname));
1066  if (!histClusterObservables) return;
1067  for (Int_t i = 0; i < histClusterObservables->GetNdimensions(); i++) {
1068  TString title(histClusterObservables->GetAxis(i)->GetTitle());
1069  if (title=="Centrality %")
1070  contents[i] = fCent;
1071  else if (title=="#it{E}_{clus} (GeV)")
1072  contents[i] = it->first.E();
1073  else if (title=="#eta")
1074  contents[i] = it->first.Eta();
1075  else if (title=="#phi")
1076  contents[i] = it->first.Phi_0_2pi();
1077  else if (title=="cluster type")
1078  contents[i] = clusType;
1079  else
1080  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
1081  }
1082  histClusterObservables->Fill(contents);
1083 
1084  }
1085  }
1086 }
1087 
1088 //________________________________________________________________________
1090 
1091  TString histname;
1092  AliJetContainer* jets = 0;
1093  TIter nextJetColl(&fJetCollArray);
1094  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1095  Double_t rhoVal = 0;
1096  if (jets->GetRhoParameter()) {
1097  rhoVal = jets->GetRhoVal();
1098  histname = TString::Format("%s/fHistRhoVsCent", jets->GetArrayName().Data());
1099  fHistManager.FillTH2(histname.Data(), fCent, rhoVal);
1100  }
1101 
1102  for (auto jet : jets->all()) {
1103 
1104  UInt_t rejectionReason = 0;
1105  if (!jets->AcceptJet(jet, rejectionReason)) {
1106  histname = TString::Format("%s/fHistJetRejectionReason", jets->GetArrayName().Data());
1107  fHistManager.FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
1108  continue;
1109  }
1110 
1111  Float_t ptLeading = jets->GetLeadingHadronPt(jet);
1112  Float_t corrPt = jet->Pt() - rhoVal * jet->Area();
1113 
1114  TLorentzVector leadPart;
1115  jets->GetLeadingHadronMomentum(leadPart, jet);
1116 
1117  Double_t contents[30]={0};
1118  histname = TString::Format("%s/fHistJetObservables", jets->GetArrayName().Data());
1119  THnSparse* histJetObservables = static_cast<THnSparse*>(fHistManager.FindObject(histname));
1120  if (!histJetObservables) return;
1121  for (Int_t i = 0; i < histJetObservables->GetNdimensions(); i++) {
1122  TString title(histJetObservables->GetAxis(i)->GetTitle());
1123  if (title=="Centrality (%)")
1124  contents[i] = fCent;
1125  else if (title=="#eta_{jet}")
1126  contents[i] = jet->Eta();
1127  else if (title=="#phi_{jet} (rad)")
1128  contents[i] = jet->Phi_0_2pi();
1129  else if (title=="#it{p}_{T} (GeV/#it{c})")
1130  contents[i] = jet->Pt();
1131  else if (title=="#it{p}_{T}^{MC} (GeV/#it{c})")
1132  contents[i] = jet->MCPt();
1133  else if (title=="#it{p}_{T}^{corr} (GeV/#it{c})")
1134  contents[i] = corrPt;
1135  else if (title=="#it{p}_{T,particle}^{leading} (GeV/#it{c})")
1136  contents[i] = ptLeading;
1137  else
1138  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
1139  }
1140  histJetObservables->Fill(contents);
1141 
1142  } //jet loop
1143  }
1144 }
1145 
1146 //________________________________________________________________________
1148 
1149  EventQA_t eventQA;
1150  for (Int_t i = 0; i < 3; i++) {
1151  eventQA.fMaxCluster[i] = fLeadingCluster[i];
1152  }
1153  eventQA.fCent = fCent;
1154  eventQA.fNTracks = fNTotTracks;
1155  eventQA.fNClusters[0] = fNTotClusters[0];
1156  eventQA.fNClusters[1] = fNTotClusters[1];
1157  eventQA.fNClusters[2] = fNTotClusters[2];
1158  eventQA.fMaxTrack = fLeadingTrack;
1159 
1160  Int_t globalNclusters = eventQA.fNClusters[0] + eventQA.fNClusters[1] + eventQA.fNClusters[2];
1161  AliTLorentzVector globalMaxCluster;
1162  for (Int_t i = 0; i < 3; i++) {
1163  if (globalMaxCluster.E() < eventQA.fMaxCluster[i].E()) globalMaxCluster = eventQA.fMaxCluster[i];
1164  }
1165 
1166  THnSparse* histEventQA = static_cast<THnSparse*>(fHistManager.FindObject("eventQA"));
1167  Double_t contents[40]={0};
1168  for (Int_t i = 0; i < histEventQA->GetNdimensions(); i++) {
1169  TString title(histEventQA->GetAxis(i)->GetTitle());
1170  if (title=="Centrality %")
1171  contents[i] = eventQA.fCent;
1172  else if (title=="No. of tracks")
1173  contents[i] = eventQA.fNTracks;
1174  else if (title=="No. of clusters")
1175  contents[i] = globalNclusters;
1176  else if (title=="#it{p}_{T,track}^{leading} (GeV/c)")
1177  contents[i] = eventQA.fMaxTrack.Pt();
1178  else if (title=="#it{E}_{cluster}^{leading} (GeV)")
1179  contents[i] = globalMaxCluster.E();
1180  else
1181  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
1182  }
1183 
1184  histEventQA->Fill(contents);
1185 
1186  // Fill pythia pt hard histograms, if applicable
1187  if (fPtHard > 1e-6) {
1188  fHistManager.FillTH1("hPtHard", fPtHard);
1189  }
1190 }
1191 
1192 //________________________________________________________________________
1194  Double_t sigma1OverPt, Byte_t trackType)
1195 {
1196  Double_t contents[20]={0};
1197 
1198  THnSparse* thnTracks = static_cast<THnSparse*>(fHistManager.FindObject("tracks"));
1199  if (!thnTracks) return;
1200  for (Int_t i = 0; i < thnTracks->GetNdimensions(); i++) {
1201  TString title(thnTracks->GetAxis(i)->GetTitle());
1202  if (title=="Centrality %")
1203  contents[i] = cent;
1204  else if (title=="#it{p}_{T} (GeV/#it{c})")
1205  contents[i] = trackPt;
1206  else if (title=="#eta")
1207  contents[i] = trackEta;
1208  else if (title=="#phi")
1209  contents[i] = trackPhi;
1210  else if (title=="#sigma(1/#it{p}_{T}) (GeV/#it{c})^{-1}")
1211  contents[i] = sigma1OverPt;
1212  else if (title=="#sigma(#it{p}_{T}) / #it{p}_{T}")
1213  contents[i] = sigma1OverPt*trackPt;
1214  else if (title=="track type")
1215  contents[i] = trackType;
1216  else
1217  AliWarning(Form("Unable to fill dimension %s of histogram %s!", title.Data(), thnTracks->GetName()));
1218  }
1219 
1220  thnTracks->Fill(contents);
1221 }
1222 
1223 //________________________________________________________________________
1224 void AliAnalysisTaskPWGJEQA::FillGeneratorLevelTHnSparse(Double_t cent, Double_t partEta, Double_t partPhi, Double_t partPt, Byte_t findable)
1225 {
1226  Double_t contents[20]={0};
1227 
1228  THnSparse* thnTracks_PhysPrim = static_cast<THnSparse*>(fHistManager.FindObject("tracks_PhysPrim"));
1229  if (!thnTracks_PhysPrim) return;
1230  for (Int_t i = 0; i < thnTracks_PhysPrim->GetNdimensions(); i++) {
1231  TString title(thnTracks_PhysPrim->GetAxis(i)->GetTitle());
1232  if (title=="Centrality %")
1233  contents[i] = cent;
1234  else if (title=="#it{p}_{T} (GeV/#it{c})")
1235  contents[i] = partPt;
1236  else if (title=="#eta")
1237  contents[i] = partEta;
1238  else if (title=="#phi")
1239  contents[i] = partPhi;
1240  else if (title=="Findable")
1241  contents[i] = findable;
1242  else
1243  AliWarning(Form("Unable to fill dimension %s of histogram %s!", title.Data(), thnTracks_PhysPrim->GetName()));
1244  }
1245 
1246  thnTracks_PhysPrim->Fill(contents);
1247 }
1248 
1249 //________________________________________________________________________
1251  Double_t trackEta, Double_t trackPhi, Double_t trackPt, Byte_t trackType)
1252 {
1253  Double_t contents[20]={0};
1254 
1255  THnSparse* thnTracks_Matched = static_cast<THnSparse*>(fHistManager.FindObject("tracks_Matched"));
1256  if (!thnTracks_Matched) return;
1257  for (Int_t i = 0; i < thnTracks_Matched->GetNdimensions(); i++) {
1258  TString title(thnTracks_Matched->GetAxis(i)->GetTitle());
1259  if (title=="Centrality %")
1260  contents[i] = cent;
1261  else if (title=="#it{p}_{T}^{gen} (GeV/#it{c})")
1262  contents[i] = partPt;
1263  else if (title=="#eta^{gen}")
1264  contents[i] = partEta;
1265  else if (title=="#phi^{gen}")
1266  contents[i] = partPhi;
1267  else if (title=="#it{p}_{T}^{det} (GeV/#it{c})")
1268  contents[i] = trackPt;
1269  else if (title=="#eta^{det}")
1270  contents[i] = trackEta;
1271  else if (title=="#phi^{det}")
1272  contents[i] = trackPhi;
1273  else if (title=="(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{gen}")
1274  contents[i] = (partPt - trackPt) / partPt;
1275  else if (title=="(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{det}")
1276  contents[i] = (partPt - trackPt) / trackPt;
1277  else if (title=="track type")
1278  contents[i] = (Double_t)trackType;
1279  else
1280  AliWarning(Form("Unable to fill dimension %s of histogram %s!", title.Data(), thnTracks_Matched->GetName()));
1281  }
1282 
1283  thnTracks_Matched->Fill(contents);
1284 }
Int_t pdg
Double_t * fEtaHistBins
! eta bins
Double_t * fPtResHistBins
! pt res bins
void Print(std::ostream &o, const char *name, Double_t dT, Double_t dVM, Double_t alldT, Double_t alldVM)
Definition: PlotSysInfo.C:121
TObjArray fClusterCollArray
cluster collection array
Bool_t fDoEventQA
Set whether to enable event QA.
Double_t GetRhoVal() const
const TString & GetRhoName() const
Int_t fNEtaHistBins
! number of eta bins
double Double_t
Definition: External.C:58
const char * title
Definition: MakeQAPdf.C:27
Int_t fNPtResHistBins
! number of pt res bins
AliTrackContainer * fDetectorLevel
! detector level container
Int_t fNPhiHistBins
! number of phi bins
Bool_t RetrieveEventObjects()
Retrieve common objects from event.
const AliMCParticleIterableMomentumContainer accepted_momentum() const
bidirectional stl iterator over the EMCAL iterable container
energy
Definition: HFPtSpectrum.C:44
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
AliAnalysisTaskPWGJEQA()
Default constructor for ROOT I/O purposes.
Bool_t fGeneralHistograms
whether or not it should fill some general histograms
THistManager fHistManager
Histogram manager.
Bool_t fRejectOutlierEvents
flag to reject pythia pt-hard jet outlier events
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
Int_t fNTotClusters[3]
!Total number of accepted clusters in current event (DCal/EMCal)
TString fDetectorLevelName
detector level container name
Bool_t FillHistograms()
Function filling histograms.
Bool_t fDoTrackQA
Set whether to enable track QA.
TObjArray fParticleCollArray
particle/track collection array
Double_t * sigma
const Int_t nPtBins
Double_t * fPtHistBins
! pt bins
void GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Create a new TH2 within the container.
TObject * FindObject(const char *name) const
Find an object inside the container.
int Int_t
Definition: External.C:63
void CreateTProfile(const char *name, const char *title, int nbinsX, double xmin, double xmax, Option_t *opt="")
Create a new TProfile within the container.
unsigned int UInt_t
Definition: External.C:33
THashList * GetListOfHistograms() const
Get the list of histograms.
Definition: THistManager.h:671
Double_t GetLeadingHadronPt(const AliEmcalJet *jet) const
float Float_t
Definition: External.C:68
AliEMCALGeometry * fGeom
!emcal geometry
AliPHOSGeometry * fPHOSGeo
! phos geometry
void FillDetectorLevelTHnSparse(Double_t cent, Double_t trackEta, Double_t trackPhi, Double_t trackPt, Double_t sigma1OverPt, Byte_t trackType)
virtual AliAODMCParticle * GetAcceptMCParticleWithLabel(Int_t lab)
Int_t fNTotTracks
!Total number of accepted tracks in current event
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
Float_t fCellEnergyCut
Energy cell cut.
BeamType fForceBeamType
forced beam type
virtual Bool_t AcceptCluster(Int_t i, UInt_t &rejectionReason) const
Double_t * fPtRelDiffHistBins
! pt relative difference bins
void FillProfile(const char *name, double x, double y, double weight=1.)
Declaration of class AliAnalysisTaskPWGJEQA.
Double_t fCent
!event centrality
Int_t fNPtHistBins
! number of pt bins
TString fCaloCellsName
name of calo cell collection
Int_t fNIntegerHistBins
! number of integer bins
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
Bool_t PythiaInfoFromFile(const char *currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard)
Loading PYTHIA information from external cross section file into the task.
TObjArray fJetCollArray
jet collection array
short Short_t
Definition: External.C:23
AliVCaloCells * fCaloCells
!cells
AliRhoParameter * GetRhoParameter()
Int_t fNCentHistBins
! number of cent bins
void ExecOnce()
Perform steps needed to initialize the analysis.
Double_t * fIntegerHistBins
! integer bins
ClassImp(AliAnalysisTaskDeltaPt) AliAnalysisTaskDeltaPt
const AliClusterIterableMomentumContainer all_momentum() const
void FillMatchedParticlesTHnSparse(Double_t cent, Double_t partEta, Double_t partPhi, Double_t partPt, Double_t trackEta, Double_t trackPhi, Double_t trackPt, Byte_t trackType)
Float_t fPtHard
!event -hard
void FillGeneratorLevelTHnSparse(Double_t cent, Double_t partEta, Double_t partPhi, Double_t partPt, Byte_t findable)
static Double_t * GenerateFixedBinArray(Int_t n, Double_t min, Double_t max)
AliTLorentzVector fLeadingTrack
!Leading track in current event
Float_t GetJetRadius() const
AliEmcalList * fOutput
!output list
AliMCParticleContainer * GetMCParticleContainer(Int_t i=0) const
Char_t GetTrackType(const AliVTrack *track) const
Definition: External.C:220
Bool_t fIsEsd
!whether it's an ESD analysis
void GenerateHistoBins()
Generate histogram binning arrays.
AliTrackContainer * GetTrackContainer(Int_t i=0) const
Bool_t fDoCaloQA
Set whether to enable cell/cluster QA.
TH1 * fHistEventRejection
!book keep reasons for rejecting event
void SetMakeGeneralHistograms(Bool_t g)
This is a task used to do basic PWGJE QA on tracks, clusters, and jets.
Base task in the EMCAL jet framework.
Bool_t fIsPtHard
flag to enable pt-hard histos and make available outlier cut
const AliTrackIterableMomentumContainer accepted_momentum() const
Bool_t fDoJetQA
Set whether to enable jet QA.
TString fGeneratorLevelName
generator level container name
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
Main initialization function on the worker.
Float_t fMaxPt
Histogram pt limit.
AliMCParticleContainer * fGeneratorLevel
! generator level container
const Int_t nbins
bool Bool_t
Definition: External.C:53
Double_t * fCentHistBins
! cent bins
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Create a new THnSparse within the container.
Container structure for EMCAL clusters.
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
Int_t fNPtRelDiffHistBins
! number of pt relative difference bins
Container for jet within the EMCAL jet framework.
Definition: External.C:196
Double_t * fPhiHistBins
! phi bins
AliTLorentzVector fLeadingCluster[3]
!Leading cluster in current event (EMCal/DCal)
const AliJetIterableContainer all() const
static Double_t fgkEMCalDCalPhiDivide
phi value used to distinguish between DCal and EMCal