AliPhysics  6bc8652 (6bc8652)
 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  const Int_t nEmcalSM = 20;
232  for (Int_t sm = 0; sm < nEmcalSM; sm++) {
233  histname = TString::Format("%s/BySM/hEmcalClusEnergy_SM%d", cont->GetArrayName().Data(), sm);
234  title = histname + ";#it{E}_{cluster} (GeV);counts";
235  fHistManager.CreateTH1(histname.Data(), title.Data(), nPtBins, 0, fMaxPt);
236  }
237 
238  for (Int_t sm = 0; sm < 6; sm++) {
239  histname = TString::Format("%s/BySM/hPhosClusEnergy_SM%d", cont->GetArrayName().Data(), sm);
240  title = histname + ";#it{E}_{cluster} (GeV);counts";
241  fHistManager.CreateTH1(histname.Data(), title.Data(), nPtBins, 0, fMaxPt);
242  }
243 
244  // Cluster THnSparse
245  Int_t dim = 0;
246  TString title[20];
247  Int_t nbins[20] = {0};
248  Double_t min[30] = {0.};
249  Double_t max[30] = {0.};
250  Double_t *binEdges[20] = {0};
251 
253  title[dim] = "Centrality %";
254  nbins[dim] = fNCentHistBins;
255  binEdges[dim] = fCentHistBins;
256  min[dim] = fCentHistBins[0];
257  max[dim] = fCentHistBins[fNCentHistBins];
258  dim++;
259  }
260 
261  title[dim] = "#it{E}_{clus} (GeV)";
262  nbins[dim] = fNPtHistBins;
263  binEdges[dim] = fPtHistBins;
264  min[dim] = fPtHistBins[0];
265  max[dim] = fPtHistBins[fNPtHistBins];
266  dim++;
267 
268  title[dim] = "#eta";
269  nbins[dim] = fNEtaHistBins;
270  binEdges[dim] = fEtaHistBins;
271  min[dim] = fEtaHistBins[0];
272  max[dim] = fEtaHistBins[fNEtaHistBins];
273  dim++;
274 
275  title[dim] = "#phi";
276  nbins[dim] = fNPhiHistBins;
277  binEdges[dim] = fPhiHistBins;
278  min[dim] = fPhiHistBins[0];
279  max[dim] = fPhiHistBins[fNPhiHistBins];
280  dim++;
281 
282  title[dim] = "cluster type";
283  nbins[dim] = 3;
284  binEdges[dim] = fIntegerHistBins;
285  min[dim] = fIntegerHistBins[0];
286  max[dim] = fIntegerHistBins[3];
287  dim++;
288 
289  TString thnname = TString::Format("%s/clusterObservables", cont->GetArrayName().Data());
290  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
291  for (Int_t i = 0; i < dim; i++) {
292  hn->GetAxis(i)->SetTitle(title[i]);
293  hn->SetBinEdges(i, binEdges[i]);
294  }
295  }
296 }
297 
298 //________________________________________________________________________
300 
301  AliJetContainer* jets = 0;
302  TIter nextJetColl(&fJetCollArray);
303  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
304 
305  // Allocate THnSparse
306  Double_t jetRadius = jets->GetJetRadius();
307 
308  TString axisTitle[30]= {""};
309  Int_t nbins[30] = {0};
310  Double_t min[30] = {0.};
311  Double_t max[30] = {0.};
312  Double_t *binEdges[20] = {0};
313  Int_t dim = 0;
314 
315  if (fForceBeamType != kpp) {
316  axisTitle[dim] = "Centrality (%)";
317  nbins[dim] = fNCentHistBins;
318  binEdges[dim] = fCentHistBins;
319  min[dim] = fCentHistBins[0];
320  max[dim] = fCentHistBins[fNCentHistBins];
321  dim++;
322  }
323 
324  axisTitle[dim] = "#eta_{jet}";
325  nbins[dim] = fNEtaHistBins;
326  binEdges[dim] = fEtaHistBins;
327  min[dim] = fEtaHistBins[0];
328  max[dim] = fEtaHistBins[fNEtaHistBins];
329  dim++;
330 
331  axisTitle[dim] = "#phi_{jet} (rad)";
332  nbins[dim] = fNPhiHistBins;
333  binEdges[dim] = fPhiHistBins;
334  min[dim] = fPhiHistBins[0];
335  max[dim] = fPhiHistBins[fNPhiHistBins];
336  dim++;
337 
338  axisTitle[dim] = "#it{p}_{T} (GeV/#it{c})";
339  nbins[dim] = TMath::CeilNint(fMaxPt/3);
340  min[dim] = 0;
341  max[dim] = fMaxPt;
342  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
343  dim++;
344 
345  if (fForceBeamType != kpp) {
346  axisTitle[dim] = "#it{p}_{T}^{corr} (GeV/#it{c})";
347  nbins[dim] = TMath::CeilNint(fMaxPt/3);
348  min[dim] = -fMaxPt/2 + 25;
349  max[dim] = fMaxPt/2 + 25;
350  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
351  dim++;
352  }
353 
354  axisTitle[dim] = "#it{p}_{T,particle}^{leading} (GeV/#it{c})";
355  nbins[dim] = fMaxPt/5;
356  min[dim] = 0;
357  max[dim] = 150;
358  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
359  dim++;
360 
361  TString thnname = TString::Format("%s/fHistJetObservables", jets->GetArrayName().Data());
362  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
363  for (Int_t i = 0; i < dim; i++) {
364  hn->GetAxis(i)->SetTitle(axisTitle[i]);
365  hn->SetBinEdges(i, binEdges[i]);
366  }
367 
368  // Allocate other jet histograms
369  TString histname;
370  TString title;
371  histname = TString::Format("%s/fHistJetRejectionReason", jets->GetArrayName().Data());
372  title = histname + ";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
373  TH2* hist = fHistManager.CreateTH2(histname.Data(), title.Data(), 32, 0, 32, 50, 0, 250);
374  SetRejectionReasonLabels(hist->GetXaxis());
375 
376  if (!jets->GetRhoName().IsNull()) {
377  histname = TString::Format("%s/fHistRhoVsCent", jets->GetArrayName().Data());
378  title = histname + ";Centrality (%);#rho (GeV/#it{c});counts";
379  fHistManager.CreateTH2(histname.Data(), title.Data(), 101, 0, 101, 100, 0, 500);
380  }
381  }
382 }
383 
384 //________________________________________________________________________
386 
387  Int_t nPtBins = 2*fMaxPt;
388 
389  Int_t dim = 0;
390  TString axistitle[40];
391  Int_t nbins[40] = {0};
392  Double_t min[40] = {0};
393  Double_t max[40] = {0};
394  Double_t *binEdges[20] = {0};
395 
397  axistitle[dim] = "Centrality %";
398  nbins[dim] = fNCentHistBins;
399  binEdges[dim] = fCentHistBins;
400  min[dim] = fCentHistBins[0];
401  max[dim] = fCentHistBins[fNCentHistBins];
402  dim++;
403  }
404 
405  if (fParticleCollArray.GetEntriesFast()>0) {
406  axistitle[dim] = "No. of tracks";
408  nbins[dim] = 50;
409  min[dim] = -0.5;
410  max[dim] = 10000-0.5;
411  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
412  }
413  else {
414  nbins[dim] = 50;
415  min[dim] = 0;
416  max[dim] = 200;
417  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
418  }
419  dim++;
420 
421  axistitle[dim] = "#it{p}_{T,track}^{leading} (GeV/c)";
422  nbins[dim] = fMaxPt/5;
423  min[dim] = 0;
424  max[dim] = 150;
425  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
426  dim++;
427  }
428 
429  if (fClusterCollArray.GetEntriesFast()>0) {
430  axistitle[dim] = "No. of clusters";
431 
433  nbins[dim] = 50;
434  min[dim] = -0.5;
435  max[dim] = 4000-0.5;
436  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
437  }
438  else {
439  nbins[dim] = 50;
440  min[dim] = 0;
441  max[dim] = 200;
442  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
443  }
444  dim++;
445 
446  axistitle[dim] = "#it{E}_{cluster}^{leading} (GeV)";
447  nbins[dim] = fMaxPt/5;
448  min[dim] = 0;
449  max[dim] = 150;
450  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
451  dim++;
452  }
453 
454  THnSparse* hn = fHistManager.CreateTHnSparse("eventQA","eventQA",dim,nbins,min,max);
455  for (Int_t i = 0; i < dim; i++) {
456  hn->GetAxis(i)->SetTitle(axistitle[i]);
457  hn->SetBinEdges(i, binEdges[i]);
458  }
459 
460  if (fIsPtHard) {
461  TString histname = "hPtHard";
462  TString title = histname + ";#it{p}_{T,hard} (GeV/c);counts";
463  fHistManager.CreateTH1(histname.Data(), title.Data(), nPtBins, 0, fMaxPt);
464 
465  TH1* hTrials = fHistManager.CreateTH1("hNtrials", "hNtrials", 1, 0, 1);
466  hTrials->GetXaxis()->SetBinLabel(1,"#sum{ntrials}");
467 
468  TH1* hxsection = fHistManager.CreateTH1("hXsec", "hXsec", 1, 0, 1);
469  hxsection->GetXaxis()->SetBinLabel(1,"<#sigma>");
470  }
471 
472  fHistEventRejection->GetXaxis()->SetBinLabel(15,"PtHardBinJetOutlier");
473 
474 }
475 
476 //________________________________________________________________________
478 {
479  Int_t dim = 0;
480  TString title[20];
481  Int_t nbins[20] = {0};
482  Double_t min[30] = {0.};
483  Double_t max[30] = {0.};
484  Double_t *binEdges[20] = {0};
485 
487  title[dim] = "Centrality %";
488  nbins[dim] = fNCentHistBins;
489  binEdges[dim] = fCentHistBins;
490  min[dim] = fCentHistBins[0];
491  max[dim] = fCentHistBins[fNCentHistBins];
492  dim++;
493  }
494 
495  title[dim] = "#it{p}_{T} (GeV/#it{c})";
496  nbins[dim] = fNPtHistBins;
497  binEdges[dim] = fPtHistBins;
498  min[dim] = fPtHistBins[0];
499  max[dim] = fPtHistBins[fNPtHistBins];
500  dim++;
501 
502  title[dim] = "#eta";
503  nbins[dim] = fNEtaHistBins;
504  binEdges[dim] = fEtaHistBins;
505  min[dim] = fEtaHistBins[0];
506  max[dim] = fEtaHistBins[fNEtaHistBins];
507  dim++;
508 
509  title[dim] = "#phi";
510  nbins[dim] = fNPhiHistBins;
511  binEdges[dim] = fPhiHistBins;
512  min[dim] = fPhiHistBins[0];
513  max[dim] = fPhiHistBins[fNPhiHistBins];
514  dim++;
515 
516  title[dim] = "track type";
517  nbins[dim] = 3;
518  binEdges[dim] = fIntegerHistBins;
519  min[dim] = fIntegerHistBins[0];
520  max[dim] = fIntegerHistBins[3];
521  dim++;
522 
523  title[dim] = "#sigma(#it{p}_{T}) / #it{p}_{T}";
524  nbins[dim] = fNPtResHistBins;
525  binEdges[dim] = fPtResHistBins;
526  min[dim] = fPtResHistBins[0];
527  max[dim] = fPtResHistBins[fNPtResHistBins];
528  dim++;
529 
530  THnSparse* hn = fHistManager.CreateTHnSparse("tracks","tracks", dim, nbins, min, max);
531  for (Int_t i = 0; i < dim; i++) {
532  hn->GetAxis(i)->SetTitle(title[i]);
533  hn->SetBinEdges(i, binEdges[i]);
534  }
535 
536 }
537 
538 //________________________________________________________________________
540 {
541  Int_t dim = 0;
542  TString title[20];
543  Int_t nbins[20] = {0};
544  Double_t min[30] = {0.};
545  Double_t max[30] = {0.};
546  Double_t *binEdges[20] = {0};
547 
549  title[dim] = "Centrality %";
550  nbins[dim] = fNCentHistBins;
551  binEdges[dim] = fCentHistBins;
552  min[dim] = fCentHistBins[0];
553  max[dim] = fCentHistBins[fNCentHistBins];
554  dim++;
555  }
556 
557  title[dim] = "#it{p}_{T} (GeV/#it{c})";
558  nbins[dim] = fNPtHistBins;
559  binEdges[dim] = fPtHistBins;
560  min[dim] = fPtHistBins[0];
561  max[dim] = fPtHistBins[fNPtHistBins];
562  dim++;
563 
564  title[dim] = "#eta";
565  nbins[dim] = fNEtaHistBins;
566  binEdges[dim] = fEtaHistBins;
567  min[dim] = fEtaHistBins[0];
568  max[dim] = fEtaHistBins[fNEtaHistBins];
569  dim++;
570 
571  title[dim] = "#phi";
572  nbins[dim] = fNPhiHistBins;
573  binEdges[dim] = fPhiHistBins;
574  min[dim] = fPhiHistBins[0];
575  max[dim] = fPhiHistBins[fNPhiHistBins];
576  dim++;
577 
578  title[dim] = "Findable";
579  nbins[dim] = 2;
580  binEdges[dim] = fIntegerHistBins;
581  min[dim] = fIntegerHistBins[0];
582  max[dim] = fIntegerHistBins[2];
583  dim++;
584 
585  THnSparse* hn = fHistManager.CreateTHnSparse("tracks_PhysPrim","tracks_PhysPrim", dim, nbins, min, max);
586  for (Int_t i = 0; i < dim; i++) {
587  hn->GetAxis(i)->SetTitle(title[i]);
588  hn->SetBinEdges(i, binEdges[i]);
589  }
590 }
591 
592 //________________________________________________________________________
594 {
595  Int_t dim = 0;
596  TString title[20];
597  Int_t nbins[20] = {0};
598  Double_t min[30] = {0.};
599  Double_t max[30] = {0.};
600  Double_t *binEdges[20] = {0};
601 
603  title[dim] = "Centrality %";
604  nbins[dim] = fNCentHistBins;
605  binEdges[dim] = fCentHistBins;
606  min[dim] = fCentHistBins[0];
607  max[dim] = fCentHistBins[fNCentHistBins];
608  dim++;
609  }
610 
611  title[dim] = "#it{p}_{T}^{gen} (GeV/#it{c})";
612  nbins[dim] = fNPtHistBins;
613  binEdges[dim] = fPtHistBins;
614  min[dim] = fPtHistBins[0];
615  max[dim] = fPtHistBins[fNPtHistBins];
616  dim++;
617 
618  title[dim] = "#eta^{gen}";
619  nbins[dim] = fNEtaHistBins;
620  binEdges[dim] = fEtaHistBins;
621  min[dim] = fEtaHistBins[0];
622  max[dim] = fEtaHistBins[fNEtaHistBins];
623  dim++;
624 
625  title[dim] = "#phi^{gen}";
626  nbins[dim] = fNPhiHistBins;
627  binEdges[dim] = fPhiHistBins;
628  min[dim] = fPhiHistBins[0];
629  max[dim] = fPhiHistBins[fNPhiHistBins];
630  dim++;
631 
632  title[dim] = "#it{p}_{T}^{det} (GeV/#it{c})";
633  nbins[dim] = fNPtHistBins;
634  binEdges[dim] = fPtHistBins;
635  min[dim] = fPtHistBins[0];
636  max[dim] = fPtHistBins[fNPtHistBins];
637  dim++;
638 
639  title[dim] = "#eta^{det}";
640  nbins[dim] = fNEtaHistBins;
641  binEdges[dim] = fEtaHistBins;
642  min[dim] = fEtaHistBins[0];
643  max[dim] = fEtaHistBins[fNEtaHistBins];
644  dim++;
645 
646  title[dim] = "#phi^{det}";
647  nbins[dim] = fNPhiHistBins;
648  binEdges[dim] = fPhiHistBins;
649  min[dim] = fPhiHistBins[0];
650  max[dim] = fPhiHistBins[fNPhiHistBins];
651  dim++;
652 
653  title[dim] = "(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{gen}";
654  nbins[dim] = fNPtRelDiffHistBins;
655  binEdges[dim] = fPtRelDiffHistBins;
656  min[dim] = fPtRelDiffHistBins[0];
658  dim++;
659 
660  title[dim] = "track type";
661  nbins[dim] = 3;
662  binEdges[dim] = fIntegerHistBins;
663  min[dim] = fIntegerHistBins[0];
664  max[dim] = fIntegerHistBins[3];
665  dim++;
666 
667  THnSparse* hn = fHistManager.CreateTHnSparse("tracks_Matched","tracks_Matched", dim, nbins, min, max);
668  for (Int_t i = 0; i < dim; i++) {
669  hn->GetAxis(i)->SetTitle(title[i]);
670  hn->SetBinEdges(i, binEdges[i]);
671  }
672 }
673 
674 
675 //________________________________________________________________________
678 {
679  fNPtHistBins = 82;
682  GenerateFixedBinArray(7, 0.3, 1, fPtHistBins+6);
683  GenerateFixedBinArray(10, 1, 3, fPtHistBins+13);
684  GenerateFixedBinArray(14, 3, 10, fPtHistBins+23);
685  GenerateFixedBinArray(10, 10, 20, fPtHistBins+37);
686  GenerateFixedBinArray(15, 20, 50, fPtHistBins+47);
687  GenerateFixedBinArray(20, 50, 150, fPtHistBins+62);
688 
689  fNEtaHistBins = 70;
692 
693  fNPhiHistBins = 101;
695  GenerateFixedBinArray(fNPhiHistBins, 0, TMath::Pi() * 2.02, fPhiHistBins);
696 
697  fNCentHistBins = 4;
699  fCentHistBins[0] = 0;
700  fCentHistBins[1] = 10;
701  fCentHistBins[2] = 30;
702  fCentHistBins[3] = 50;
703  fCentHistBins[4] = 90;
704 
705  fNPtResHistBins = 100;
708  GenerateFixedBinArray(25, 0.05, 0.10, fPtResHistBins+50);
709  GenerateFixedBinArray(15, 0.10, 0.20, fPtResHistBins+75);
710  GenerateFixedBinArray(10, 0.20, 0.50, fPtResHistBins+90);
711 
712  fNPtRelDiffHistBins = 50;
715 
716  fNIntegerHistBins = 3;
719 }
720 
721 //________________________________________________________________________
723 {
724  if (fClusterCollArray.GetEntriesFast() == 0 && fCaloCellsName.IsNull()) {
725  fNeedEmcalGeom = kFALSE;
726  }
727  else {
728  fNeedEmcalGeom = kTRUE;
729  }
730 
732 
733  // Load the PHOS geometry
734  Int_t runNum = InputEvent()->GetRunNumber();
735  if(runNum<209122) //Run1
736  fPHOSGeo = AliPHOSGeometry::GetInstance("IHEP");
737  else
738  fPHOSGeo = AliPHOSGeometry::GetInstance("Run2");
739 
740  if (fPHOSGeo) {
741  AliOADBContainer geomContainer("phosGeo");
742  geomContainer.InitFromFile("$ALICE_PHYSICS/OADB/PHOS/PHOSMCGeometry.root","PHOSMCRotationMatrixes");
743  TObjArray* matrixes = (TObjArray*)geomContainer.GetObject(runNum,"PHOSRotationMatrixes");
744  for(Int_t mod=0; mod<6; mod++) {
745  if(!matrixes->At(mod)) continue;
746  fPHOSGeo->SetMisalMatrix(((TGeoHMatrix*)matrixes->At(mod)),mod);
747  printf(".........Adding Matrix(%d), geo=%p\n",mod,fPHOSGeo);
748  ((TGeoHMatrix*)matrixes->At(mod))->Print();
749  }
750  }
751 }
752 
753 //________________________________________________________________________
755 {
756  if (!AliAnalysisTaskEmcalJet::RetrieveEventObjects()) return kFALSE;
757 
758  // If Pt-hard production, get the Pt-hard of the event, and have possibility to reject the event for jet outliers
759  if (fIsPtHard) {
760  AliGenPythiaEventHeader* pygen;
761  if (MCEvent()) {
762  pygen = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent()->GenEventHeader());
763  if (!pygen) {
764  // Check if AOD
765  AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
766  if (aodMCH) {
767  for (UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
768  pygen = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i));
769  if (pygen) break;
770  }
771  }
772  }
773  }
774  if (pygen) {
775  fPtHard = pygen->GetPtHard();
776  //fNTrials = pygen->Trials();
777  //fXsection = pygen->GetXsection();
778 
779  // reject outlier events, where the jet Pt is much larger than Pt-hard
780  if (fRejectOutlierEvents) {
781  AliTLorentzVector jet;
782  Int_t nTriggerJets = pygen->NTriggerJets();
783  Float_t tmpjet[]={0,0,0,0};
784  for (Int_t ijet = 0; ijet< nTriggerJets; ijet++) {
785  pygen->TriggerJet(ijet, tmpjet);
786  jet.SetPxPyPzE(tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3]);
787 
788  if (jet.Pt() > 4. * fPtHard) {
789  //AliInfo(Form("Reject jet event with: pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n", fPtHard, jet.Pt(), 4.));
790  if (fGeneralHistograms) fHistEventRejection->Fill("PtHardBinJetOutlier",1);
791  return kFALSE;
792  }
793  }
794  }
795  }
796  }
797 
798  return kTRUE;
799 }
800 
808 //________________________________________________________________________
810 {
811  if (fIsPtHard) {
812  TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
813  if (!tree) {
814  AliError(Form("%s - UserNotify: No current tree!",GetName()));
815  return kFALSE;
816  }
817 
818  Float_t xsection = 0;
819  Float_t trials = 0;
820  Int_t pthardbin = 0;
821 
822  TFile *curfile = tree->GetCurrentFile();
823  if (!curfile) {
824  AliError(Form("%s - UserNotify: No current file!",GetName()));
825  return kFALSE;
826  }
827 
828  TChain *chain = dynamic_cast<TChain*>(tree);
829  if (chain) tree = chain->GetTree();
830 
831  PythiaInfoFromFile(curfile->GetName(), xsection, trials, pthardbin);
832 
833  fHistManager.FillTH1("hNtrials", "#sum{ntrials}", trials);
834  fHistManager.FillTH1("hXsec", "<#sigma>", xsection);
835  }
836  return kTRUE;
837 }
838 
839 //________________________________________________________________________
841 {
847 
848  return kTRUE;
849 }
850 
851 //________________________________________________________________________
853 
854  fNTotTracks = 0;
855  fLeadingTrack.SetPxPyPzE(0,0,0,0);
856 
857  AliVTrack* track;
858  for (auto trackIterator : fDetectorLevel->accepted_momentum() ) {
859 
860  fNTotTracks++;
861  if (fLeadingTrack.Pt() < trackIterator.first.Pt()) fLeadingTrack = trackIterator.first;
862 
863  track = trackIterator.second;
864  Byte_t type = fDetectorLevel->GetTrackType(track);
865  if (type <= 2) {
866  Double_t sigma = 0;
867 
868  if (fIsEsd) {
869 
870  AliESDtrack *esdTrack = dynamic_cast<AliESDtrack*>(track);
871  if (esdTrack) sigma = TMath::Sqrt(esdTrack->GetSigma1Pt2());
872 
873  } else { // AOD
874 
875  AliAODTrack *aodtrack = dynamic_cast<AliAODTrack*>(track);
876  if(!aodtrack) AliFatal("Not a standard AOD");
877 
878  AliExternalTrackParam exParam;
879 
880  //get covariance matrix
881  Double_t cov[21] = {0,};
882  aodtrack->GetCovMatrix(cov);
883  Double_t pxpypz[3] = {0,};
884  aodtrack->PxPyPz(pxpypz);
885  Double_t xyz[3] = {0,};
886  aodtrack->GetXYZ(xyz);
887  Short_t sign = aodtrack->Charge();
888  exParam.Set(xyz,pxpypz,cov,sign);
889 
890  sigma = TMath::Sqrt(exParam.GetSigma1Pt2());
891 
892  }
893 
894  Int_t label = TMath::Abs(track->GetLabel());
895  Int_t mcGen = 1;
896  // reject particles generated from other generators in the cocktail but keep fake tracks (label == 0)
897  if (label==0 || track->GetGeneratorIndex() == 0) mcGen = 0;
898 
899  FillDetectorLevelTHnSparse(fCent, track->Eta(), track->Phi(), track->Pt(), sigma, type);
900 
901  if (fGeneratorLevel && label > 0) {
902  AliAODMCParticle *part = fGeneratorLevel->GetAcceptMCParticleWithLabel(label);
903  if (part) {
904  if (part->GetGeneratorIndex() == 0) {
905  Int_t pdg = TMath::Abs(part->PdgCode());
906  // select charged pions, protons, kaons, electrons, muons
907  if (pdg == 211 || pdg == 2212 || pdg == 321 || pdg == 11 || pdg == 13) {
908  FillMatchedParticlesTHnSparse(fCent, part->Eta(), part->Phi(), part->Pt(), track->Eta(), track->Phi(), track->Pt(), type);
909  }
910  }
911  }
912  }
913  }
914  else {
915  AliError(Form("Track %d has type %d not recognized!", fDetectorLevel->GetCurrentID(), type));
916  }
917  }
918 
919  if (fGeneratorLevel) {
920  AliAODMCParticle* part;
921  for (auto partIterator : fGeneratorLevel->accepted_momentum() ) {
922  part = partIterator.second;
923 
924  Int_t mcGen = 1;
925  Byte_t findable = 0;
926 
927  if (part->GetGeneratorIndex() == 0) mcGen = 0;
928 
929  Int_t pdg = TMath::Abs(part->PdgCode());
930  // select charged pions, protons, kaons, electrons, muons
931  if (pdg == 211 || pdg == 2212 || pdg == 321 || pdg == 11 || pdg == 13) findable = 1;
932 
933  FillGeneratorLevelTHnSparse(fCent, part->Eta(), part->Phi(), part->Pt(), findable);
934  }
935  }
936 }
937 
938 //________________________________________________________________________
940 
941  if (!fCaloCells) return;
942 
943  TString histname_energy = TString::Format("%s/fHistCellEnergy", fCaloCellsName.Data());
944  TString histname_time = TString::Format("%s/fHistCellTime", fCaloCellsName.Data());
945  TString histname_energyProf = TString::Format("%s/fProfCellAbsIdEnergy", fCaloCellsName.Data());
946  TString histname_timeProf = TString::Format("%s/fProfCellAbsIdTime", fCaloCellsName.Data());
947  TString histname_EnergyvsTime = TString::Format("%s/fHistCellEvsTime", fCaloCellsName.Data());
948 
949  const Int_t ncells = fCaloCells->GetNumberOfCells();
950  for (Int_t pos = 0; pos < ncells; pos++) {
951  Float_t amp = fCaloCells->GetAmplitude(pos);
952  Float_t time = fCaloCells->GetTime(pos);
953  Int_t absId = fCaloCells->GetCellNumber(pos);
954 
955  if (amp < fCellEnergyCut) continue;
956 
957  fHistManager.FillTH1(histname_energy, amp);
958  fHistManager.FillTH1(histname_time, time);
959 
960  fHistManager.FillProfile(histname_energyProf, absId, amp);
961  fHistManager.FillProfile(histname_timeProf, absId, time);
962 
963  fHistManager.FillTH2(histname_EnergyvsTime, time, amp);
964  }
965 }
966 
967 //________________________________________________________________________
969 
970  memset(fNTotClusters, 0, sizeof(Int_t)*3);
971  for (Int_t i = 0; i < 3; i++) fLeadingCluster[i].SetPxPyPzE(0,0,0,0);
972 
973  TString histname;
974  AliClusterContainer* clusters = 0;
975  TIter nextClusColl(&fClusterCollArray);
976  while ((clusters = static_cast<AliClusterContainer*>(nextClusColl()))) {
977  // Cluster loop
979  for (AliClusterIterableMomentumContainer::iterator it = itcont.begin(); it != itcont.end(); it++) {
980 
981  UInt_t rejectionReason = 0;
982  if (!clusters->AcceptCluster(it.current_index(), rejectionReason)) {
983  histname = TString::Format("%s/fHistClusterRejectionReason", clusters->GetArrayName().Data());
984  fHistManager.FillTH2(histname, clusters->GetRejectionReasonBitPosition(rejectionReason), it->first.E());
985  continue;
986  }
987 
988  // Determine cluster type (EMCal/DCal/Phos) and record relevant eventQA info
989  ClusterType clusType = kNA;
990  if (it->second->IsEMCAL()) {
991  Double_t phi = it->first.Phi_0_2pi();
992  Int_t isDcal = Int_t(phi > fgkEMCalDCalPhiDivide);
993  if (isDcal == 0) {
994  clusType = kEMCal;
995  } else if (isDcal == 1) {
996  clusType = kDCal;
997  }
998 
999  if (fLeadingCluster[isDcal].E() < it->first.E()) fLeadingCluster[isDcal] = it->first;
1000  fNTotClusters[isDcal]++;
1001 
1002  Int_t sm = fGeom->GetSuperModuleNumber(it->second->GetCellAbsId(0));
1003  if (sm >=0 && sm < 20) {
1004  histname = TString::Format("%s/BySM/hEmcalClusEnergy_SM%d", clusters->GetArrayName().Data(), sm);
1005  fHistManager.FillTH1(histname, it->second->E());
1006  }
1007  else {
1008  AliError(Form("Supermodule %d does not exist!", sm));
1009  }
1010 
1011  } else if (it->second->GetType() == AliVCluster::kPHOSNeutral){
1012  clusType = kPHOS;
1013  fNTotClusters[2]++;
1014  if (fLeadingCluster[2].E() < it->first.E()) fLeadingCluster[2] = it->first;
1015 
1016  // Fill Phos spectra by module
1017  Int_t relid[4];
1018  if (fPHOSGeo) {
1019  fPHOSGeo->AbsToRelNumbering(it->second->GetCellAbsId(0), relid);
1020  Int_t sm = relid[0];
1021  if (sm >=0 && sm < 6) {
1022  histname = TString::Format("%s/BySM/hPhosClusEnergy_SM%d", clusters->GetArrayName().Data(), sm);
1023  fHistManager.FillTH1(histname, it->second->E());
1024  }
1025  else {
1026  AliError(Form("Supermodule %d does not exist!", sm));
1027  }
1028  }
1029  }
1030 
1031  Double_t contents[30]={0};
1032  histname = TString::Format("%s/clusterObservables", clusters->GetArrayName().Data());
1033  THnSparse* histClusterObservables = static_cast<THnSparse*>(fHistManager.FindObject(histname));
1034  if (!histClusterObservables) return;
1035  for (Int_t i = 0; i < histClusterObservables->GetNdimensions(); i++) {
1036  TString title(histClusterObservables->GetAxis(i)->GetTitle());
1037  if (title=="Centrality %")
1038  contents[i] = fCent;
1039  else if (title=="#it{E}_{clus} (GeV)")
1040  contents[i] = it->first.E();
1041  else if (title=="#eta")
1042  contents[i] = it->first.Eta();
1043  else if (title=="#phi")
1044  contents[i] = it->first.Phi_0_2pi();
1045  else if (title=="cluster type")
1046  contents[i] = clusType;
1047  else
1048  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
1049  }
1050  histClusterObservables->Fill(contents);
1051 
1052  }
1053  }
1054 }
1055 
1056 //________________________________________________________________________
1058 
1059  TString histname;
1060  AliJetContainer* jets = 0;
1061  TIter nextJetColl(&fJetCollArray);
1062  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1063  Double_t rhoVal = 0;
1064  if (jets->GetRhoParameter()) {
1065  rhoVal = jets->GetRhoVal();
1066  histname = TString::Format("%s/fHistRhoVsCent", jets->GetArrayName().Data());
1067  fHistManager.FillTH2(histname.Data(), fCent, rhoVal);
1068  }
1069 
1070  for (auto jet : jets->all()) {
1071 
1072  UInt_t rejectionReason = 0;
1073  if (!jets->AcceptJet(jet, rejectionReason)) {
1074  histname = TString::Format("%s/fHistJetRejectionReason", jets->GetArrayName().Data());
1075  fHistManager.FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
1076  continue;
1077  }
1078 
1079  Float_t ptLeading = jets->GetLeadingHadronPt(jet);
1080  Float_t corrPt = jet->Pt() - rhoVal * jet->Area();
1081 
1082  TLorentzVector leadPart;
1083  jets->GetLeadingHadronMomentum(leadPart, jet);
1084 
1085  Double_t contents[30]={0};
1086  histname = TString::Format("%s/fHistJetObservables", jets->GetArrayName().Data());
1087  THnSparse* histJetObservables = static_cast<THnSparse*>(fHistManager.FindObject(histname));
1088  if (!histJetObservables) return;
1089  for (Int_t i = 0; i < histJetObservables->GetNdimensions(); i++) {
1090  TString title(histJetObservables->GetAxis(i)->GetTitle());
1091  if (title=="Centrality (%)")
1092  contents[i] = fCent;
1093  else if (title=="#eta_{jet}")
1094  contents[i] = jet->Eta();
1095  else if (title=="#phi_{jet} (rad)")
1096  contents[i] = jet->Phi_0_2pi();
1097  else if (title=="#it{p}_{T} (GeV/#it{c})")
1098  contents[i] = jet->Pt();
1099  else if (title=="#it{p}_{T}^{MC} (GeV/#it{c})")
1100  contents[i] = jet->MCPt();
1101  else if (title=="#it{p}_{T}^{corr} (GeV/#it{c})")
1102  contents[i] = corrPt;
1103  else if (title=="#it{p}_{T,particle}^{leading} (GeV/#it{c})")
1104  contents[i] = ptLeading;
1105  else
1106  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
1107  }
1108  histJetObservables->Fill(contents);
1109 
1110  } //jet loop
1111  }
1112 }
1113 
1114 //________________________________________________________________________
1116 
1117  EventQA_t eventQA;
1118  for (Int_t i = 0; i < 3; i++) {
1119  eventQA.fMaxCluster[i] = fLeadingCluster[i];
1120  }
1121  eventQA.fCent = fCent;
1122  eventQA.fNTracks = fNTotTracks;
1123  eventQA.fNClusters[0] = fNTotClusters[0];
1124  eventQA.fNClusters[1] = fNTotClusters[1];
1125  eventQA.fNClusters[2] = fNTotClusters[2];
1126  eventQA.fMaxTrack = fLeadingTrack;
1127 
1128  Int_t globalNclusters = eventQA.fNClusters[0] + eventQA.fNClusters[1] + eventQA.fNClusters[2];
1129  AliTLorentzVector globalMaxCluster;
1130  for (Int_t i = 0; i < 3; i++) {
1131  if (globalMaxCluster.E() < eventQA.fMaxCluster[i].E()) globalMaxCluster = eventQA.fMaxCluster[i];
1132  }
1133 
1134  THnSparse* histEventQA = static_cast<THnSparse*>(fHistManager.FindObject("eventQA"));
1135  Double_t contents[40]={0};
1136  for (Int_t i = 0; i < histEventQA->GetNdimensions(); i++) {
1137  TString title(histEventQA->GetAxis(i)->GetTitle());
1138  if (title=="Centrality %")
1139  contents[i] = eventQA.fCent;
1140  else if (title=="No. of tracks")
1141  contents[i] = eventQA.fNTracks;
1142  else if (title=="No. of clusters")
1143  contents[i] = globalNclusters;
1144  else if (title=="#it{p}_{T,track}^{leading} (GeV/c)")
1145  contents[i] = eventQA.fMaxTrack.Pt();
1146  else if (title=="#it{E}_{cluster}^{leading} (GeV)")
1147  contents[i] = globalMaxCluster.E();
1148  else
1149  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
1150  }
1151 
1152  histEventQA->Fill(contents);
1153 
1154  // Fill pythia pt hard histograms, if applicable
1155  if (fPtHard > 1e-6) {
1156  fHistManager.FillTH1("hPtHard", fPtHard);
1157  }
1158 }
1159 
1160 //________________________________________________________________________
1162  Double_t sigma1OverPt, Byte_t trackType)
1163 {
1164  Double_t contents[20]={0};
1165 
1166  THnSparse* thnTracks = static_cast<THnSparse*>(fHistManager.FindObject("tracks"));
1167  if (!thnTracks) return;
1168  for (Int_t i = 0; i < thnTracks->GetNdimensions(); i++) {
1169  TString title(thnTracks->GetAxis(i)->GetTitle());
1170  if (title=="Centrality %")
1171  contents[i] = cent;
1172  else if (title=="#it{p}_{T} (GeV/#it{c})")
1173  contents[i] = trackPt;
1174  else if (title=="#eta")
1175  contents[i] = trackEta;
1176  else if (title=="#phi")
1177  contents[i] = trackPhi;
1178  else if (title=="#sigma(1/#it{p}_{T}) (GeV/#it{c})^{-1}")
1179  contents[i] = sigma1OverPt;
1180  else if (title=="#sigma(#it{p}_{T}) / #it{p}_{T}")
1181  contents[i] = sigma1OverPt*trackPt;
1182  else if (title=="track type")
1183  contents[i] = trackType;
1184  else
1185  AliWarning(Form("Unable to fill dimension %s of histogram %s!", title.Data(), thnTracks->GetName()));
1186  }
1187 
1188  thnTracks->Fill(contents);
1189 }
1190 
1191 //________________________________________________________________________
1192 void AliAnalysisTaskPWGJEQA::FillGeneratorLevelTHnSparse(Double_t cent, Double_t partEta, Double_t partPhi, Double_t partPt, Byte_t findable)
1193 {
1194  Double_t contents[20]={0};
1195 
1196  THnSparse* thnTracks_PhysPrim = static_cast<THnSparse*>(fHistManager.FindObject("tracks_PhysPrim"));
1197  if (!thnTracks_PhysPrim) return;
1198  for (Int_t i = 0; i < thnTracks_PhysPrim->GetNdimensions(); i++) {
1199  TString title(thnTracks_PhysPrim->GetAxis(i)->GetTitle());
1200  if (title=="Centrality %")
1201  contents[i] = cent;
1202  else if (title=="#it{p}_{T} (GeV/#it{c})")
1203  contents[i] = partPt;
1204  else if (title=="#eta")
1205  contents[i] = partEta;
1206  else if (title=="#phi")
1207  contents[i] = partPhi;
1208  else if (title=="Findable")
1209  contents[i] = findable;
1210  else
1211  AliWarning(Form("Unable to fill dimension %s of histogram %s!", title.Data(), thnTracks_PhysPrim->GetName()));
1212  }
1213 
1214  thnTracks_PhysPrim->Fill(contents);
1215 }
1216 
1217 //________________________________________________________________________
1219  Double_t trackEta, Double_t trackPhi, Double_t trackPt, Byte_t trackType)
1220 {
1221  Double_t contents[20]={0};
1222 
1223  THnSparse* thnTracks_Matched = static_cast<THnSparse*>(fHistManager.FindObject("tracks_Matched"));
1224  if (!thnTracks_Matched) return;
1225  for (Int_t i = 0; i < thnTracks_Matched->GetNdimensions(); i++) {
1226  TString title(thnTracks_Matched->GetAxis(i)->GetTitle());
1227  if (title=="Centrality %")
1228  contents[i] = cent;
1229  else if (title=="#it{p}_{T}^{gen} (GeV/#it{c})")
1230  contents[i] = partPt;
1231  else if (title=="#eta^{gen}")
1232  contents[i] = partEta;
1233  else if (title=="#phi^{gen}")
1234  contents[i] = partPhi;
1235  else if (title=="#it{p}_{T}^{det} (GeV/#it{c})")
1236  contents[i] = trackPt;
1237  else if (title=="#eta^{det}")
1238  contents[i] = trackEta;
1239  else if (title=="#phi^{det}")
1240  contents[i] = trackPhi;
1241  else if (title=="(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{gen}")
1242  contents[i] = (partPt - trackPt) / partPt;
1243  else if (title=="(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{det}")
1244  contents[i] = (partPt - trackPt) / trackPt;
1245  else if (title=="track type")
1246  contents[i] = (Double_t)trackType;
1247  else
1248  AliWarning(Form("Unable to fill dimension %s of histogram %s!", title.Data(), thnTracks_Matched->GetName()));
1249  }
1250 
1251  thnTracks_Matched->Fill(contents);
1252 }
Int_t pdg
Double_t * fEtaHistBins
number of eta bins
Double_t * fPtResHistBins
number of 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
double Double_t
Definition: External.C:58
const char * title
Definition: MakeQAPdf.C:26
Int_t fNPtResHistBins
pt relative difference bins
AliTrackContainer * fDetectorLevel
generator level container
const AliMCParticleIterableMomentumContainer accepted_momentum() const
bidirectional stl iterator over the EMCAL iterable container
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Double_t fPtHard
!event pt hard
AliAnalysisTaskPWGJEQA()
Default constructor for ROOT I/O purposes.
Bool_t fGeneralHistograms
whether or not it should fill some general histograms
THistManager fHistManager
! phos geometry
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 fDoTrackQA
Set whether to enable track QA.
TObjArray fParticleCollArray
particle/track collection array
Double_t * sigma
const Int_t nPtBins
Double_t * fPtHistBins
number of 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="")
TObject * FindObject(const char *name) const
int Int_t
Definition: External.C:63
void CreateTProfile(const char *name, const char *title, int nbinsX, double xmin, double xmax, Option_t *opt="")
unsigned int UInt_t
Definition: External.C:33
THashList * GetListOfHistograms() const
Definition: THistManager.h:504
Double_t GetLeadingHadronPt(const AliEmcalJet *jet) const
float Float_t
Definition: External.C:68
AliEMCALGeometry * fGeom
!emcal geometry
AliPHOSGeometry * fPHOSGeo
integer bins
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="")
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
number of 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
detector level container
TString fCaloCellsName
name of calo cell collection
Int_t fNIntegerHistBins
pt res bins
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Bool_t PythiaInfoFromFile(const char *currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard)
TObjArray fJetCollArray
jet collection array
short Short_t
Definition: External.C:23
AliVCaloCells * fCaloCells
!cells
AliRhoParameter * GetRhoParameter()
Double_t * fIntegerHistBins
number of integer bins
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)
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
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
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. Based on code from Salvatore ...
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)
Float_t fMaxPt
Histogram pt limit.
AliMCParticleContainer * fGeneratorLevel
const Int_t nbins
bool Bool_t
Definition: External.C:53
Double_t * fCentHistBins
number of cent bins
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Container structure for EMCAL clusters.
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
Container for jet within the EMCAL jet framework.
Definition: External.C:196
Double_t * fPhiHistBins
number of 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