AliPhysics  6cf2591 (6cf2591)
 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  fPHOSGeo = AliPHOSGeometry::GetInstance();
735  if (fPHOSGeo) {
736  AliInfo("Found instance of PHOS geometry!");
737  }
738  else {
739  AliInfo("Creating PHOS geometry!");
740  Int_t runNum = InputEvent()->GetRunNumber();
741  if(runNum<209122) //Run1
742  fPHOSGeo = AliPHOSGeometry::GetInstance("IHEP");
743  else
744  fPHOSGeo = AliPHOSGeometry::GetInstance("Run2");
745 
746  if (fPHOSGeo) {
747  AliOADBContainer geomContainer("phosGeo");
748  geomContainer.InitFromFile("$ALICE_PHYSICS/OADB/PHOS/PHOSMCGeometry.root","PHOSMCRotationMatrixes");
749  TObjArray* matrixes = (TObjArray*)geomContainer.GetObject(runNum,"PHOSRotationMatrixes");
750  for(Int_t mod=0; mod<6; mod++) {
751  if(!matrixes->At(mod)) continue;
752  fPHOSGeo->SetMisalMatrix(((TGeoHMatrix*)matrixes->At(mod)),mod);
753  printf(".........Adding Matrix(%d), geo=%p\n",mod,fPHOSGeo);
754  ((TGeoHMatrix*)matrixes->At(mod))->Print();
755  }
756  }
757  }
758 
759 }
760 
761 //________________________________________________________________________
763 {
764  if (!AliAnalysisTaskEmcalJet::RetrieveEventObjects()) return kFALSE;
765 
766  // If Pt-hard production, get the Pt-hard of the event, and have possibility to reject the event for jet outliers
767  if (fIsPtHard) {
768  AliGenPythiaEventHeader* pygen;
769  if (MCEvent()) {
770  pygen = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent()->GenEventHeader());
771  if (!pygen) {
772  // Check if AOD
773  AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
774  if (aodMCH) {
775  for (UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
776  pygen = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i));
777  if (pygen) break;
778  }
779  }
780  }
781  }
782  if (pygen) {
783  fPtHard = pygen->GetPtHard();
784  //fNTrials = pygen->Trials();
785  //fXsection = pygen->GetXsection();
786 
787  // reject outlier events, where the jet Pt is much larger than Pt-hard
788  if (fRejectOutlierEvents) {
789  AliTLorentzVector jet;
790  Int_t nTriggerJets = pygen->NTriggerJets();
791  Float_t tmpjet[]={0,0,0,0};
792  for (Int_t ijet = 0; ijet< nTriggerJets; ijet++) {
793  pygen->TriggerJet(ijet, tmpjet);
794  jet.SetPxPyPzE(tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3]);
795 
796  if (jet.Pt() > 4. * fPtHard) {
797  //AliInfo(Form("Reject jet event with: pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n", fPtHard, jet.Pt(), 4.));
798  if (fGeneralHistograms) fHistEventRejection->Fill("PtHardBinJetOutlier",1);
799  return kFALSE;
800  }
801  }
802  }
803  }
804  }
805 
806  return kTRUE;
807 }
808 
816 //________________________________________________________________________
818 {
819  if (fIsPtHard) {
820  TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
821  if (!tree) {
822  AliError(Form("%s - UserNotify: No current tree!",GetName()));
823  return kFALSE;
824  }
825 
826  Float_t xsection = 0;
827  Float_t trials = 0;
828  Int_t pthardbin = 0;
829 
830  TFile *curfile = tree->GetCurrentFile();
831  if (!curfile) {
832  AliError(Form("%s - UserNotify: No current file!",GetName()));
833  return kFALSE;
834  }
835 
836  TChain *chain = dynamic_cast<TChain*>(tree);
837  if (chain) tree = chain->GetTree();
838 
839  PythiaInfoFromFile(curfile->GetName(), xsection, trials, pthardbin);
840 
841  fHistManager.FillTH1("hNtrials", "#sum{ntrials}", trials);
842  fHistManager.FillTH1("hXsec", "<#sigma>", xsection);
843  }
844  return kTRUE;
845 }
846 
847 //________________________________________________________________________
849 {
855 
856  return kTRUE;
857 }
858 
859 //________________________________________________________________________
861 
862  fNTotTracks = 0;
863  fLeadingTrack.SetPxPyPzE(0,0,0,0);
864 
865  AliVTrack* track;
866  for (auto trackIterator : fDetectorLevel->accepted_momentum() ) {
867 
868  fNTotTracks++;
869  if (fLeadingTrack.Pt() < trackIterator.first.Pt()) fLeadingTrack = trackIterator.first;
870 
871  track = trackIterator.second;
872  Byte_t type = fDetectorLevel->GetTrackType(track);
873  if (type <= 2) {
874  Double_t sigma = 0;
875 
876  if (fIsEsd) {
877 
878  AliESDtrack *esdTrack = dynamic_cast<AliESDtrack*>(track);
879  if (esdTrack) sigma = TMath::Sqrt(esdTrack->GetSigma1Pt2());
880 
881  } else { // AOD
882 
883  AliAODTrack *aodtrack = dynamic_cast<AliAODTrack*>(track);
884  if(!aodtrack) AliFatal("Not a standard AOD");
885 
886  AliExternalTrackParam exParam;
887 
888  //get covariance matrix
889  Double_t cov[21] = {0,};
890  aodtrack->GetCovMatrix(cov);
891  Double_t pxpypz[3] = {0,};
892  aodtrack->PxPyPz(pxpypz);
893  Double_t xyz[3] = {0,};
894  aodtrack->GetXYZ(xyz);
895  Short_t sign = aodtrack->Charge();
896  exParam.Set(xyz,pxpypz,cov,sign);
897 
898  sigma = TMath::Sqrt(exParam.GetSigma1Pt2());
899 
900  }
901 
902  Int_t label = TMath::Abs(track->GetLabel());
903  Int_t mcGen = 1;
904  // reject particles generated from other generators in the cocktail but keep fake tracks (label == 0)
905  if (label==0 || track->GetGeneratorIndex() == 0) mcGen = 0;
906 
907  FillDetectorLevelTHnSparse(fCent, track->Eta(), track->Phi(), track->Pt(), sigma, type);
908 
909  if (fGeneratorLevel && label > 0) {
910  AliAODMCParticle *part = fGeneratorLevel->GetAcceptMCParticleWithLabel(label);
911  if (part) {
912  if (part->GetGeneratorIndex() == 0) {
913  Int_t pdg = TMath::Abs(part->PdgCode());
914  // select charged pions, protons, kaons, electrons, muons
915  if (pdg == 211 || pdg == 2212 || pdg == 321 || pdg == 11 || pdg == 13) {
916  FillMatchedParticlesTHnSparse(fCent, part->Eta(), part->Phi(), part->Pt(), track->Eta(), track->Phi(), track->Pt(), type);
917  }
918  }
919  }
920  }
921  }
922  else {
923  AliError(Form("Track %d has type %d not recognized!", fDetectorLevel->GetCurrentID(), type));
924  }
925  }
926 
927  if (fGeneratorLevel) {
928  AliAODMCParticle* part;
929  for (auto partIterator : fGeneratorLevel->accepted_momentum() ) {
930  part = partIterator.second;
931 
932  Int_t mcGen = 1;
933  Byte_t findable = 0;
934 
935  if (part->GetGeneratorIndex() == 0) mcGen = 0;
936 
937  Int_t pdg = TMath::Abs(part->PdgCode());
938  // select charged pions, protons, kaons, electrons, muons
939  if (pdg == 211 || pdg == 2212 || pdg == 321 || pdg == 11 || pdg == 13) findable = 1;
940 
941  FillGeneratorLevelTHnSparse(fCent, part->Eta(), part->Phi(), part->Pt(), findable);
942  }
943  }
944 }
945 
946 //________________________________________________________________________
948 
949  if (!fCaloCells) return;
950 
951  TString histname_energy = TString::Format("%s/fHistCellEnergy", fCaloCellsName.Data());
952  TString histname_time = TString::Format("%s/fHistCellTime", fCaloCellsName.Data());
953  TString histname_energyProf = TString::Format("%s/fProfCellAbsIdEnergy", fCaloCellsName.Data());
954  TString histname_timeProf = TString::Format("%s/fProfCellAbsIdTime", fCaloCellsName.Data());
955  TString histname_EnergyvsTime = TString::Format("%s/fHistCellEvsTime", fCaloCellsName.Data());
956 
957  const Int_t ncells = fCaloCells->GetNumberOfCells();
958  for (Int_t pos = 0; pos < ncells; pos++) {
959  Float_t amp = fCaloCells->GetAmplitude(pos);
960  Float_t time = fCaloCells->GetTime(pos);
961  Int_t absId = fCaloCells->GetCellNumber(pos);
962 
963  if (amp < fCellEnergyCut) continue;
964 
965  fHistManager.FillTH1(histname_energy, amp);
966  fHistManager.FillTH1(histname_time, time);
967 
968  fHistManager.FillProfile(histname_energyProf, absId, amp);
969  fHistManager.FillProfile(histname_timeProf, absId, time);
970 
971  fHistManager.FillTH2(histname_EnergyvsTime, time, amp);
972  }
973 }
974 
975 //________________________________________________________________________
977 
978  memset(fNTotClusters, 0, sizeof(Int_t)*3);
979  for (Int_t i = 0; i < 3; i++) fLeadingCluster[i].SetPxPyPzE(0,0,0,0);
980 
981  TString histname;
982  AliClusterContainer* clusters = 0;
983  TIter nextClusColl(&fClusterCollArray);
984  while ((clusters = static_cast<AliClusterContainer*>(nextClusColl()))) {
985  // Cluster loop
987  for (AliClusterIterableMomentumContainer::iterator it = itcont.begin(); it != itcont.end(); it++) {
988 
989  UInt_t rejectionReason = 0;
990  if (!clusters->AcceptCluster(it.current_index(), rejectionReason)) {
991  histname = TString::Format("%s/fHistClusterRejectionReason", clusters->GetArrayName().Data());
992  fHistManager.FillTH2(histname, clusters->GetRejectionReasonBitPosition(rejectionReason), it->first.E());
993  continue;
994  }
995 
996  // Determine cluster type (EMCal/DCal/Phos) and record relevant eventQA info
997  ClusterType clusType = kNA;
998  if (it->second->IsEMCAL()) {
999  Double_t phi = it->first.Phi_0_2pi();
1000  Int_t isDcal = Int_t(phi > fgkEMCalDCalPhiDivide);
1001  if (isDcal == 0) {
1002  clusType = kEMCal;
1003  } else if (isDcal == 1) {
1004  clusType = kDCal;
1005  }
1006 
1007  if (fLeadingCluster[isDcal].E() < it->first.E()) fLeadingCluster[isDcal] = it->first;
1008  fNTotClusters[isDcal]++;
1009 
1010  Int_t sm = fGeom->GetSuperModuleNumber(it->second->GetCellAbsId(0));
1011  if (sm >=0 && sm < 20) {
1012  histname = TString::Format("%s/BySM/hEmcalClusEnergy_SM%d", clusters->GetArrayName().Data(), sm);
1013  fHistManager.FillTH1(histname, it->second->E());
1014  }
1015  else {
1016  AliError(Form("Supermodule %d does not exist!", sm));
1017  }
1018 
1019  } else if (it->second->GetType() == AliVCluster::kPHOSNeutral){
1020  clusType = kPHOS;
1021  fNTotClusters[2]++;
1022  if (fLeadingCluster[2].E() < it->first.E()) fLeadingCluster[2] = it->first;
1023 
1024  // Fill Phos spectra by module
1025  Int_t relid[4];
1026  if (fPHOSGeo) {
1027  fPHOSGeo->AbsToRelNumbering(it->second->GetCellAbsId(0), relid);
1028  Int_t sm = relid[0];
1029  if (sm >=0 && sm < 6) {
1030  histname = TString::Format("%s/BySM/hPhosClusEnergy_SM%d", clusters->GetArrayName().Data(), sm);
1031  fHistManager.FillTH1(histname, it->second->E());
1032  }
1033  else {
1034  AliError(Form("Supermodule %d does not exist!", sm));
1035  }
1036  }
1037  }
1038 
1039  Double_t contents[30]={0};
1040  histname = TString::Format("%s/clusterObservables", clusters->GetArrayName().Data());
1041  THnSparse* histClusterObservables = static_cast<THnSparse*>(fHistManager.FindObject(histname));
1042  if (!histClusterObservables) return;
1043  for (Int_t i = 0; i < histClusterObservables->GetNdimensions(); i++) {
1044  TString title(histClusterObservables->GetAxis(i)->GetTitle());
1045  if (title=="Centrality %")
1046  contents[i] = fCent;
1047  else if (title=="#it{E}_{clus} (GeV)")
1048  contents[i] = it->first.E();
1049  else if (title=="#eta")
1050  contents[i] = it->first.Eta();
1051  else if (title=="#phi")
1052  contents[i] = it->first.Phi_0_2pi();
1053  else if (title=="cluster type")
1054  contents[i] = clusType;
1055  else
1056  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
1057  }
1058  histClusterObservables->Fill(contents);
1059 
1060  }
1061  }
1062 }
1063 
1064 //________________________________________________________________________
1066 
1067  TString histname;
1068  AliJetContainer* jets = 0;
1069  TIter nextJetColl(&fJetCollArray);
1070  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1071  Double_t rhoVal = 0;
1072  if (jets->GetRhoParameter()) {
1073  rhoVal = jets->GetRhoVal();
1074  histname = TString::Format("%s/fHistRhoVsCent", jets->GetArrayName().Data());
1075  fHistManager.FillTH2(histname.Data(), fCent, rhoVal);
1076  }
1077 
1078  for (auto jet : jets->all()) {
1079 
1080  UInt_t rejectionReason = 0;
1081  if (!jets->AcceptJet(jet, rejectionReason)) {
1082  histname = TString::Format("%s/fHistJetRejectionReason", jets->GetArrayName().Data());
1083  fHistManager.FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
1084  continue;
1085  }
1086 
1087  Float_t ptLeading = jets->GetLeadingHadronPt(jet);
1088  Float_t corrPt = jet->Pt() - rhoVal * jet->Area();
1089 
1090  TLorentzVector leadPart;
1091  jets->GetLeadingHadronMomentum(leadPart, jet);
1092 
1093  Double_t contents[30]={0};
1094  histname = TString::Format("%s/fHistJetObservables", jets->GetArrayName().Data());
1095  THnSparse* histJetObservables = static_cast<THnSparse*>(fHistManager.FindObject(histname));
1096  if (!histJetObservables) return;
1097  for (Int_t i = 0; i < histJetObservables->GetNdimensions(); i++) {
1098  TString title(histJetObservables->GetAxis(i)->GetTitle());
1099  if (title=="Centrality (%)")
1100  contents[i] = fCent;
1101  else if (title=="#eta_{jet}")
1102  contents[i] = jet->Eta();
1103  else if (title=="#phi_{jet} (rad)")
1104  contents[i] = jet->Phi_0_2pi();
1105  else if (title=="#it{p}_{T} (GeV/#it{c})")
1106  contents[i] = jet->Pt();
1107  else if (title=="#it{p}_{T}^{MC} (GeV/#it{c})")
1108  contents[i] = jet->MCPt();
1109  else if (title=="#it{p}_{T}^{corr} (GeV/#it{c})")
1110  contents[i] = corrPt;
1111  else if (title=="#it{p}_{T,particle}^{leading} (GeV/#it{c})")
1112  contents[i] = ptLeading;
1113  else
1114  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
1115  }
1116  histJetObservables->Fill(contents);
1117 
1118  } //jet loop
1119  }
1120 }
1121 
1122 //________________________________________________________________________
1124 
1125  EventQA_t eventQA;
1126  for (Int_t i = 0; i < 3; i++) {
1127  eventQA.fMaxCluster[i] = fLeadingCluster[i];
1128  }
1129  eventQA.fCent = fCent;
1130  eventQA.fNTracks = fNTotTracks;
1131  eventQA.fNClusters[0] = fNTotClusters[0];
1132  eventQA.fNClusters[1] = fNTotClusters[1];
1133  eventQA.fNClusters[2] = fNTotClusters[2];
1134  eventQA.fMaxTrack = fLeadingTrack;
1135 
1136  Int_t globalNclusters = eventQA.fNClusters[0] + eventQA.fNClusters[1] + eventQA.fNClusters[2];
1137  AliTLorentzVector globalMaxCluster;
1138  for (Int_t i = 0; i < 3; i++) {
1139  if (globalMaxCluster.E() < eventQA.fMaxCluster[i].E()) globalMaxCluster = eventQA.fMaxCluster[i];
1140  }
1141 
1142  THnSparse* histEventQA = static_cast<THnSparse*>(fHistManager.FindObject("eventQA"));
1143  Double_t contents[40]={0};
1144  for (Int_t i = 0; i < histEventQA->GetNdimensions(); i++) {
1145  TString title(histEventQA->GetAxis(i)->GetTitle());
1146  if (title=="Centrality %")
1147  contents[i] = eventQA.fCent;
1148  else if (title=="No. of tracks")
1149  contents[i] = eventQA.fNTracks;
1150  else if (title=="No. of clusters")
1151  contents[i] = globalNclusters;
1152  else if (title=="#it{p}_{T,track}^{leading} (GeV/c)")
1153  contents[i] = eventQA.fMaxTrack.Pt();
1154  else if (title=="#it{E}_{cluster}^{leading} (GeV)")
1155  contents[i] = globalMaxCluster.E();
1156  else
1157  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
1158  }
1159 
1160  histEventQA->Fill(contents);
1161 
1162  // Fill pythia pt hard histograms, if applicable
1163  if (fPtHard > 1e-6) {
1164  fHistManager.FillTH1("hPtHard", fPtHard);
1165  }
1166 }
1167 
1168 //________________________________________________________________________
1170  Double_t sigma1OverPt, Byte_t trackType)
1171 {
1172  Double_t contents[20]={0};
1173 
1174  THnSparse* thnTracks = static_cast<THnSparse*>(fHistManager.FindObject("tracks"));
1175  if (!thnTracks) return;
1176  for (Int_t i = 0; i < thnTracks->GetNdimensions(); i++) {
1177  TString title(thnTracks->GetAxis(i)->GetTitle());
1178  if (title=="Centrality %")
1179  contents[i] = cent;
1180  else if (title=="#it{p}_{T} (GeV/#it{c})")
1181  contents[i] = trackPt;
1182  else if (title=="#eta")
1183  contents[i] = trackEta;
1184  else if (title=="#phi")
1185  contents[i] = trackPhi;
1186  else if (title=="#sigma(1/#it{p}_{T}) (GeV/#it{c})^{-1}")
1187  contents[i] = sigma1OverPt;
1188  else if (title=="#sigma(#it{p}_{T}) / #it{p}_{T}")
1189  contents[i] = sigma1OverPt*trackPt;
1190  else if (title=="track type")
1191  contents[i] = trackType;
1192  else
1193  AliWarning(Form("Unable to fill dimension %s of histogram %s!", title.Data(), thnTracks->GetName()));
1194  }
1195 
1196  thnTracks->Fill(contents);
1197 }
1198 
1199 //________________________________________________________________________
1200 void AliAnalysisTaskPWGJEQA::FillGeneratorLevelTHnSparse(Double_t cent, Double_t partEta, Double_t partPhi, Double_t partPt, Byte_t findable)
1201 {
1202  Double_t contents[20]={0};
1203 
1204  THnSparse* thnTracks_PhysPrim = static_cast<THnSparse*>(fHistManager.FindObject("tracks_PhysPrim"));
1205  if (!thnTracks_PhysPrim) return;
1206  for (Int_t i = 0; i < thnTracks_PhysPrim->GetNdimensions(); i++) {
1207  TString title(thnTracks_PhysPrim->GetAxis(i)->GetTitle());
1208  if (title=="Centrality %")
1209  contents[i] = cent;
1210  else if (title=="#it{p}_{T} (GeV/#it{c})")
1211  contents[i] = partPt;
1212  else if (title=="#eta")
1213  contents[i] = partEta;
1214  else if (title=="#phi")
1215  contents[i] = partPhi;
1216  else if (title=="Findable")
1217  contents[i] = findable;
1218  else
1219  AliWarning(Form("Unable to fill dimension %s of histogram %s!", title.Data(), thnTracks_PhysPrim->GetName()));
1220  }
1221 
1222  thnTracks_PhysPrim->Fill(contents);
1223 }
1224 
1225 //________________________________________________________________________
1227  Double_t trackEta, Double_t trackPhi, Double_t trackPt, Byte_t trackType)
1228 {
1229  Double_t contents[20]={0};
1230 
1231  THnSparse* thnTracks_Matched = static_cast<THnSparse*>(fHistManager.FindObject("tracks_Matched"));
1232  if (!thnTracks_Matched) return;
1233  for (Int_t i = 0; i < thnTracks_Matched->GetNdimensions(); i++) {
1234  TString title(thnTracks_Matched->GetAxis(i)->GetTitle());
1235  if (title=="Centrality %")
1236  contents[i] = cent;
1237  else if (title=="#it{p}_{T}^{gen} (GeV/#it{c})")
1238  contents[i] = partPt;
1239  else if (title=="#eta^{gen}")
1240  contents[i] = partEta;
1241  else if (title=="#phi^{gen}")
1242  contents[i] = partPhi;
1243  else if (title=="#it{p}_{T}^{det} (GeV/#it{c})")
1244  contents[i] = trackPt;
1245  else if (title=="#eta^{det}")
1246  contents[i] = trackEta;
1247  else if (title=="#phi^{det}")
1248  contents[i] = trackPhi;
1249  else if (title=="(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{gen}")
1250  contents[i] = (partPt - trackPt) / partPt;
1251  else if (title=="(#it{p}_{T}^{gen} - #it{p}_{T}^{det}) / #it{p}_{T}^{det}")
1252  contents[i] = (partPt - trackPt) / trackPt;
1253  else if (title=="track type")
1254  contents[i] = (Double_t)trackType;
1255  else
1256  AliWarning(Form("Unable to fill dimension %s of histogram %s!", title.Data(), thnTracks_Matched->GetName()));
1257  }
1258 
1259  thnTracks_Matched->Fill(contents);
1260 }
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:26
Int_t fNPtResHistBins
! number of pt res bins
AliTrackContainer * fDetectorLevel
! detector level container
Int_t fNPhiHistBins
! number of phi bins
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
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 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="")
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
! 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="")
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="")
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()
Int_t fNCentHistBins
! number of cent bins
Double_t * fIntegerHistBins
! 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
! 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="")
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