AliPhysics  251aa1e (251aa1e)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEmcalJetSpectraQA.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 <TClonesArray.h>
17 #include <TH2F.h>
18 #include <TH3F.h>
19 #include <THnSparse.h>
20 #include <THashList.h>
21 
22 #include "AliEmcalJet.h"
23 #include "AliVCluster.h"
24 #include "AliVParticle.h"
25 #include "AliLog.h"
26 #include "AliJetContainer.h"
27 #include "AliClusterContainer.h"
28 #include "AliParticleContainer.h"
29 
31 
32 // Definitions of class AliAnalysisTaskEmcalJetSpectraQA::AliEmcalJetInfo
33 
37  fArea(0),
38  fMCPt(0),
39  fNConstituents(0),
40  fNEF(0),
41  fCent(0),
42  fEP(0),
43  fCorrPt(0),
44  fZ(0),
45  fLeadingPt(0)
46 {
47 }
48 
54  fArea(jet.Area()),
55  fMCPt(jet.MCPt()),
56  fNConstituents(jet.GetNumberOfConstituents()),
57  fNEF(jet.NEF()),
58  fCent(0),
59  fEP(0),
60  fCorrPt(0),
61  fZ(0),
62  fLeadingPt(0)
63 {
64  jet.GetMomentum(*this);
65 }
66 
67 // Definitions of class AliAnalysisTaskEmcalJetSpectraQA
68 
72 
75  AliAnalysisTaskEmcalJetLight("AliAnalysisTaskEmcalJetSpectraQA", kTRUE),
77  fJetEPaxis(kFALSE),
78  fAreaAxis(kTRUE),
79  fPtBinWidth(0.5),
80  fMaxPt(250),
81  fIsEmbedded(kFALSE),
82  fHistManager()
83 
84 {
86 }
87 
92  AliAnalysisTaskEmcalJetLight(name, kTRUE),
93  fHistoType(kTHnSparse),
94  fJetEPaxis(kFALSE),
95  fAreaAxis(kTRUE),
96  fPtBinWidth(0.5),
97  fMaxPt(250),
98  fIsEmbedded(kFALSE),
99  fHistManager(name)
100 {
102 }
103 
108 {
109  AliError("Tree output not implemented. Falling back to THnSparse output");
110  AllocateTHnSparse(jets);
111 }
112 
117 {
118  Double_t jetRadius = jets->GetJetRadius();
119 
120  TString title[30]= {""};
121  Int_t nbins[30] = {0};
122  Double_t min[30] = {0.};
123  Double_t max[30] = {0.};
124  Int_t dim = 0;
125 
126  Int_t nPtBins = TMath::CeilNint(fMaxPt / fPtBinWidth);
127 
128  if (fForceBeamType != kpp) {
129  title[dim] = "Centrality (%)";
130  nbins[dim] = 20;
131  min[dim] = 0;
132  max[dim] = 100;
133  dim++;
134 
135  if (fJetEPaxis) {
136  title[dim] = "#phi_{jet} - #psi_{EP}";
137  nbins[dim] = nPtBins/5;
138  min[dim] = 0;
139  max[dim] = TMath::Pi();
140  dim++;
141  }
142  }
143 
144  title[dim] = "#eta_{jet}";
145  nbins[dim] = nPtBins/10;
146  min[dim] = -1;
147  max[dim] = 1;
148  dim++;
149 
150  title[dim] = "#phi_{jet} (rad)";
151  nbins[dim] = nPtBins/10*3;
152  min[dim] = 0;
153  max[dim] = 2*TMath::Pi();
154  dim++;
155 
156  title[dim] = "#it{p}_{T} (GeV/#it{c})";
157  nbins[dim] = nPtBins;
158  min[dim] = 0;
159  max[dim] = fMaxPt;
160  dim++;
161 
162  if (fIsEmbedded) {
163  title[dim] = "#it{p}_{T}^{MC} (GeV/#it{c})";
164  nbins[dim] = nPtBins;
165  min[dim] = 0;
166  max[dim] = fMaxPt;
167  dim++;
168  }
169 
170  if (fForceBeamType != kpp) {
171  title[dim] = "#it{p}_{T}^{corr} (GeV/#it{c})";
172  nbins[dim] = nPtBins;
173  min[dim] = -fMaxPt/2;
174  max[dim] = fMaxPt/2;
175  dim++;
176  }
177 
178  if (fAreaAxis) {
179  // area resolution is about 0.01 (w/ ghost area 0.005)
180  // for nPtBins = 250 use bin width 0.01
181  title[dim] = "#it{A}_{jet}";
182  nbins[dim] = TMath::CeilNint(2.0*jetRadius*jetRadius*TMath::Pi() / 0.01 * nPtBins / 250);
183  min[dim] = 0;
184  max[dim] = 2.0*jetRadius*jetRadius*TMath::Pi();
185  dim++;
186  }
187 
188  if (fClusterCollArray.GetEntriesFast() > 0 && fParticleCollArray.GetEntriesFast() > 0) {
189  title[dim] = "NEF";
190  nbins[dim] = nPtBins/5;
191  min[dim] = 0;
192  max[dim] = 1.0;
193  dim++;
194  }
195 
196  title[dim] = "#it{z}_{leading}";
197  nbins[dim] = nPtBins/5;
198  min[dim] = 0;
199  max[dim] = 1.0;
200  dim++;
201 
202  if (fForceBeamType != kpp) {
203  title[dim] = "No. of constituents";
204  nbins[dim] = 125;
205  min[dim] = 0;
206  max[dim] = 250;
207  dim++;
208  }
209  else {
210  title[dim] = "No. of constituents";
211  nbins[dim] = 50;
212  min[dim] = -0.5;
213  max[dim] = 49.5;
214  dim++;
215  }
216 
217  title[dim] = "#it{p}_{T,particle}^{leading} (GeV/#it{c})";
218  nbins[dim] = nPtBins/10*3;
219  min[dim] = 0;
220  max[dim] = 150;
221  dim++;
222 
223  TString histname = TString::Format("%s/fHistJetObservables", jets->GetArrayName().Data());
224  THnSparse* hn = fHistManager.CreateTHnSparse(histname.Data(), histname.Data(), dim, nbins, min, max);
225  for (Int_t i = 0; i < dim; i++) {
226  hn->GetAxis(i)->SetTitle(title[i]);
227  }
228 }
229 
234 {
235  TString histname;
236  TString title;
237 
238  Int_t nPtBins = TMath::CeilNint(fMaxPt / fPtBinWidth);
239 
240  for (Int_t i = 0; i < fNcentBins; i++) {
241  histname = TString::Format("%s/fHistJetPtEtaPhi_%d", jets->GetArrayName().Data(), i);
242  title = histname + ";#it{p}_{T} (GeV/#it{c});#eta;#phi (rad)";
243  fHistManager.CreateTH3(histname.Data(), title.Data(), 20, -1, 1, 41, 0, 2*TMath::Pi()*41/40, nPtBins, 0, fMaxPt);
244 
245  histname = TString::Format("%s/fHistJetPtArea_%d", jets->GetArrayName().Data(), i);
246  title = histname + ";#it{p}_{T} (GeV/#it{c});#it{A}_{jet};counts";
247  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, 150, 0, 1.5);
248 
249  histname = TString::Format("%s/fHistJetPtEP_%d", jets->GetArrayName().Data(), i);
250  title = histname + ";#it{p}_{T} (GeV/#it{c});#phi_{jet} - #psi_{EP};counts";
251  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, 100, 0, TMath::Pi());;
252 
253  histname = TString::Format("%s/fHistJetPtNEF_%d", jets->GetArrayName().Data(), i);
254  title = histname + ";#it{p}_{T} (GeV/#it{c});NEF;counts";
255  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, 102, 0, 1.02);
256 
257  histname = TString::Format("%s/fHistJetPtZ_%d", jets->GetArrayName().Data(), i);
258  title = histname + ";#it{p}_{T} (GeV/#it{c});#it{z}_{leading};counts";
259  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, 102, 0, 1.02);
260 
261  histname = TString::Format("%s/fHistJetPtLeadingPartPt_%d", jets->GetArrayName().Data(), i);
262  title = histname + ";#it{p}_{T} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c});counts";
263  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, 120, 0, 120);
264 
265  if (!jets->GetRhoName().IsNull()) {
266  histname = TString::Format("%s/fHistJetCorrPtEtaPhi_%d", jets->GetArrayName().Data(), i);
267  title = histname + ";#it{p}_{T,corr} (GeV/#it{c});#eta;#phi (rad)";
268  fHistManager.CreateTH3(histname.Data(), title.Data(), 20, -1, 1, 41, 0, 2*TMath::Pi()*201/200, nPtBins*2, -fMaxPt, fMaxPt);
269 
270  histname = TString::Format("%s/fHistJetCorrPtArea_%d", jets->GetArrayName().Data(), i);
271  title = histname + ";#it{p}_{T,corr} (GeV/#it{c});#it{A}_{jet};counts";
272  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, 150, 0, 1.5);
273 
274  histname = TString::Format("%s/fHistJetCorrPtEP_%d", jets->GetArrayName().Data(), i);
275  title = histname + ";#it{p}_{T,corr} (GeV/#it{c});#phi_{jet} - #psi_{EP};counts";
276  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, 100, 0, TMath::Pi());;
277 
278  histname = TString::Format("%s/fHistJetCorrPtNEF_%d", jets->GetArrayName().Data(), i);
279  title = histname + ";#it{p}_{T,corr} (GeV/#it{c});NEF;counts";
280  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, 102, 0, 1.02);
281 
282  histname = TString::Format("%s/fHistJetCorrPtZ_%d", jets->GetArrayName().Data(), i);
283  title = histname + ";#it{p}_{T,corr} (GeV/#it{c});#it{z}_{leading};counts";
284  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, 102, 0, 1.02);
285 
286  histname = TString::Format("%s/fHistJetCorrPtLeadingPartPt_%d", jets->GetArrayName().Data(), i);
287  title = histname + ";#it{p}_{T,corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c});counts";
288  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, 120, 0, 120);
289 
290  histname = TString::Format("%s/fHistJetPtCorrPt_%d", jets->GetArrayName().Data(), i);
291  title = histname + ";#it{p}_{T} (GeV/#it{c});#it{p}_{T,corr} (GeV/#it{c});counts";
292  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, nPtBins*2, -fMaxPt, fMaxPt);
293 
294  if (fIsEmbedded) {
295  histname = TString::Format("%s/fHistJetMCPtCorrPt_%d", jets->GetArrayName().Data(), i);
296  title = histname + ";#it{p}_{T,MC} (GeV/#it{c});#it{p}_{T,corr} (GeV/#it{c});counts";
297  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, nPtBins*2, -fMaxPt, fMaxPt);
298  }
299  }
300 
301  if (fIsEmbedded) {
302  histname = TString::Format("%s/fHistJetPtMCPt_%d", jets->GetArrayName().Data(), i);
303  title = histname + ";#it{p}_{T} (GeV/#it{c});#it{p}_{T,MC} (GeV/#it{c});counts";
304  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, nPtBins, 0, fMaxPt);
305  }
306  }
307 }
308 
311 {
313 
314  Int_t constituentsNbins = 250;
315  Double_t constituentsMax = 249.5;
316 
317  Int_t nPtBins = TMath::CeilNint(fMaxPt / fPtBinWidth);
318 
319  if (fForceBeamType == kpp) {
320  constituentsNbins = 50;
321  constituentsMax = 49.5;
322  }
323 
324  TString histname;
325  TString title;
326 
327  AliJetContainer* jets = 0;
328  TIter nextJetColl(&fJetCollArray);
329  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
330  fHistManager.CreateHistoGroup(jets->GetArrayName());
331 
332  switch (fHistoType) {
333  case kTH2:
334  AllocateTHX(jets);
335  break;
336  case kTHnSparse:
337  AllocateTHnSparse(jets);
338  break;
339  case kTTree:
340  AllocateTTree(jets);
341  break;
342  }
343 
344  TString histname;
345 
346  for (Int_t i = 0; i < fNcentBins; i++) {
347  if (jets->GetParticleContainer()) {
348  histname = TString::Format("%s/fHistTracksJetPt_%d", jets->GetArrayName().Data(), i);
349  title = histname + ";#it{p}_{T,track} (GeV/#it{c});#it{p}_{T,jet} (GeV/#it{c});counts";
350  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins / 2, 0, fMaxPt / 2, nPtBins, 0, fMaxPt);
351 
352  histname = TString::Format("%s/fHistTracksPtDist_%d", jets->GetArrayName().Data(), i);
353  title = histname + ";#it{p}_{T,track} (GeV/#it{c});#it{d};counts";
354  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins / 2, 0, fMaxPt / 2, 100, 0, 5);
355 
356  histname = TString::Format("%s/fHistTracksZJetPtJetConst_%d", jets->GetArrayName().Data(), i);
357  title = histname + ";#it{z}_{track} (GeV/#it{c});#it{d};No. of constituents";
358  fHistManager.CreateTH3(histname.Data(), title.Data(), 120, 0.0, 1.2, nPtBins, 0, fMaxPt, constituentsNbins, -0.5, constituentsMax);
359  }
360 
361  if (jets->GetClusterContainer()) {
362  histname = TString::Format("%s/fHistClustersJetPt_%d", jets->GetArrayName().Data(), i);
363  title = histname + ";#it{p}_{T,cluster} (GeV/#it{c});#it{p}_{T,jet} (GeV/#it{c});counts";
364  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins / 2, 0, fMaxPt / 2, nPtBins, 0, fMaxPt);
365 
366  histname = TString::Format("%s/fHistClustersPtDist_%d", jets->GetArrayName().Data(), i);
367  title = histname + ";#it{p}_{T,cluster} (GeV/#it{c});#it{d};counts";
368  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins / 2, 0, fMaxPt / 2, 100, 0, 5);
369 
370  histname = TString::Format("%s/fHistClustersZJetPtJetConst_%d", jets->GetArrayName().Data(), i);
371  title = histname + ";#it{z}_{cluster} (GeV/#it{c});#it{p}_{T,jet} (GeV/#it{c});No. of constituents";
372  fHistManager.CreateTH3(histname.Data(), title.Data(), 120, 0.0, 1.2, nPtBins, 0, fMaxPt, constituentsNbins, -0.5, constituentsMax);
373  }
374 
375  histname = TString::Format("%s/fHistRejectionReason_%d", jets->GetArrayName().Data(), i);
376  title = histname + ";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
377  TH2* hist = fHistManager.CreateTH2(histname.Data(), title.Data(), 32, 0, 32, 100, 0, 250);
378  SetRejectionReasonLabels(hist->GetXaxis());
379  }
380 
381  if (!jets->GetRhoName().IsNull()) {
382  histname = TString::Format("%s/fHistRhoVsCent", jets->GetArrayName().Data());
383  title = histname + ";Centrality (%);#rho (GeV/#it{c});counts";
384  fHistManager.CreateTH2(histname.Data(), title.Data(), 101, 0, 101, 100, 0, 500);
385  }
386  }
387 
388  TIter nextElement(fHistManager.GetListOfHistograms());
389  TObject* obj = 0;
390  while ((obj = nextElement())) fOutput->Add(obj);
391  PostData(1, fOutput);
392 }
393 
398 {
399  TString histname;
400 
401  AliJetContainer* jets = 0;
402  TIter nextJetColl(&fJetCollArray);
403  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
404  Double_t rhoVal = 0;
405  if (jets->GetRhoParameter()) {
406  rhoVal = jets->GetRhoVal();
407  histname = TString::Format("%s/fHistRhoVsCent", jets->GetArrayName().Data());
408  fHistManager.FillTH2(histname.Data(), fCent, rhoVal);
409  }
410 
411  for (auto jet : jets->accepted()) {
412 
413  UInt_t rejectionReason = 0;
414  if (!jets->AcceptJet(jet, rejectionReason)) {
415  histname = TString::Format("%s/fHistRejectionReason_%d", jets->GetArrayName().Data(), fCentBin);
416  fHistManager.FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
417  continue;
418  }
419 
420  Float_t ptLeading = jets->GetLeadingHadronPt(jet);
421  Float_t corrPt = jet->Pt() - rhoVal * jet->Area();
422 
423  TLorentzVector leadPart;
424 
425  jets->GetLeadingHadronMomentum(leadPart, jet);
426 
427  // Fill THnSparse
428  Double_t ep = jet->Phi() - fEPV0;
429  while (ep < 0) ep += TMath::Pi();
430  while (ep >= TMath::Pi()) ep -= TMath::Pi();
431 
432  Double_t z = GetParallelFraction(leadPart.Vect(), jet);
433  if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999; // so that it will contribute to the bin 0.9-1 rather than 1-1.1
434 
435  AliEmcalJetInfo jetInfo(*jet);
436  jetInfo.fCent = fCent;
437  jetInfo.fEP = ep;
438  jetInfo.fCorrPt = corrPt;
439  jetInfo.fZ = z;
440  jetInfo.fLeadingPt = ptLeading;
441 
442  FillJetHisto(jetInfo, jets);
443 
444  AliParticleContainer* tracks = jets->GetParticleContainer();
445  if (tracks) {
446  for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
447  AliVParticle *track = jet->TrackAt(it, tracks->GetArray());
448  if (track) {
449  histname = TString::Format("%s/fHistTracksJetPt_%d", jets->GetArrayName().Data(), fCentBin);
450  fHistManager.FillTH2(histname.Data(), track->Pt(), jet->Pt());
451 
452  Double_t dphi = TVector2::Phi_0_2pi(track->Phi() - jet->Phi());
453  Double_t deta = track->Eta() - jet->Eta();
454  Double_t dist = TMath::Sqrt(deta * deta + dphi * dphi);
455 
456  histname = TString::Format("%s/fHistTracksPtDist_%d", jets->GetArrayName().Data(), fCentBin);
457  fHistManager.FillTH2(histname.Data(), track->Pt(), dist);
458 
459  histname = TString::Format("%s/fHistTracksZJetPtJetConst_%d", jets->GetArrayName().Data(), fCentBin);
460  fHistManager.FillTH3(histname.Data(), GetParallelFraction(track, jet), jet->Pt(), jet->GetNumberOfConstituents());
461  }
462  }
463  }
464 
465  AliClusterContainer* clusters = jets->GetClusterContainer();
466  if (clusters) {
467  for (Int_t ic = 0; ic < jet->GetNumberOfClusters(); ic++) {
468  AliVCluster *cluster = jet->ClusterAt(ic, clusters->GetArray());
469 
470  if (cluster) {
471  TLorentzVector nPart;
472  if (clusters->GetDefaultClusterEnergy() >=0 && clusters->GetDefaultClusterEnergy() < AliVCluster::kLastUserDefEnergy) {
473  cluster->GetMomentum(nPart, fVertex, (AliVCluster::VCluUserDefEnergy_t)clusters->GetDefaultClusterEnergy());
474  }
475  else {
476  cluster->GetMomentum(nPart, fVertex);
477  }
478 
479  histname = TString::Format("%s/fHistClustersJetPt_%d", jets->GetArrayName().Data(), fCentBin);
480  fHistManager.FillTH2(histname.Data(), nPart.Pt(), jet->Pt());
481 
482  Double_t dphi = TVector2::Phi_0_2pi(nPart.Phi() - jet->Phi());
483  Double_t deta = nPart.Eta() - jet->Eta();
484  Double_t dist = TMath::Sqrt(deta * deta + dphi * dphi);
485 
486  histname = TString::Format("%s/fHistClustersPtDist_%d", jets->GetArrayName().Data(), fCentBin);
487  fHistManager.FillTH2(histname.Data(), nPart.Pt(), dist);
488 
489  histname = TString::Format("%s/fHistClustersZJetPtJetConst_%d", jets->GetArrayName().Data(), fCentBin);
490  fHistManager.FillTH3(histname.Data(), GetParallelFraction(nPart.Vect(), jet), jet->Pt(), jet->GetNumberOfConstituents());
491  }
492  }
493  }
494  } //jet loop
495  }
496  return kTRUE;
497 }
498 
504 {
505  TString histname;
506 
507  histname = TString::Format("%s/fHistJetPtEtaPhi_%d", jets->GetArrayName().Data(), fCentBin);
508  fHistManager.FillTH3(histname.Data(), jet.Eta(), jet.Phi_0_2pi(), jet.Pt());
509 
510  histname = TString::Format("%s/fHistJetPtArea_%d", jets->GetArrayName().Data(), fCentBin);
511  fHistManager.FillTH2(histname.Data(), jet.Pt(), jet.fArea);
512 
513  histname = TString::Format("%s/fHistJetPtEP_%d", jets->GetArrayName().Data(), fCentBin);
514  fHistManager.FillTH2(histname.Data(), jet.Pt(), jet.fEP);
515 
516  histname = TString::Format("%s/fHistJetPtNEF_%d", jets->GetArrayName().Data(), fCentBin);
517  fHistManager.FillTH2(histname.Data(), jet.Pt(), jet.fNEF);
518 
519  histname = TString::Format("%s/fHistJetPtZ_%d", jets->GetArrayName().Data(), fCentBin);
520  fHistManager.FillTH2(histname.Data(), jet.Pt(), jet.fZ);
521 
522  histname = TString::Format("%s/fHistJetPtLeadingPartPt_%d", jets->GetArrayName().Data(), fCentBin);
523  fHistManager.FillTH2(histname.Data(), jet.Pt(), jet.fLeadingPt);
524 
525  if (fIsEmbedded) {
526  histname = TString::Format("%s/fHistJetPtMCPt_%d", jets->GetArrayName().Data(), fCentBin);
527  fHistManager.FillTH2(histname.Data(), jet.Pt(), jet.fMCPt);
528  }
529 
530  if (!jets->GetRhoName().IsNull()) {
531  histname = TString::Format("%s/fHistJetCorrPtEtaPhi_%d", jets->GetArrayName().Data(), fCentBin);
532  fHistManager.FillTH3(histname.Data(), jet.Eta(), jet.Phi_0_2pi(), jet.fCorrPt);
533 
534  histname = TString::Format("%s/fHistJetCorrPtArea_%d", jets->GetArrayName().Data(), fCentBin);
535  fHistManager.FillTH2(histname.Data(), jet.fCorrPt, jet.fArea);
536 
537  histname = TString::Format("%s/fHistJetCorrPtEP_%d", jets->GetArrayName().Data(), fCentBin);
538  fHistManager.FillTH2(histname.Data(), jet.fCorrPt, jet.fEP);
539 
540  histname = TString::Format("%s/fHistJetCorrPtNEF_%d", jets->GetArrayName().Data(), fCentBin);
541  fHistManager.FillTH2(histname.Data(), jet.fCorrPt, jet.fNEF);
542 
543  histname = TString::Format("%s/fHistJetCorrPtZ_%d", jets->GetArrayName().Data(), fCentBin);
544  fHistManager.FillTH2(histname.Data(), jet.fCorrPt, jet.fZ);
545 
546  histname = TString::Format("%s/fHistJetCorrPtLeadingPartPt_%d", jets->GetArrayName().Data(), fCentBin);
547  fHistManager.FillTH2(histname.Data(), jet.fCorrPt, jet.fLeadingPt);
548 
549  histname = TString::Format("%s/fHistJetPtCorrPt_%d", jets->GetArrayName().Data(), fCentBin);
550  fHistManager.FillTH2(histname.Data(), jet.Pt(), jet.fCorrPt);
551 
552  if (fIsEmbedded) {
553  histname = TString::Format("%s/fHistJetMCPtCorrPt_%d", jets->GetArrayName().Data(), fCentBin);
554  fHistManager.FillTH2(histname.Data(), jet.fMCPt, jet.fCorrPt);
555  }
556  }
557 }
558 
564 {
565  AliError("Tree output not implemented. Falling back to THnSparse output");
566  FillTHnSparse(jet, jets);
567 }
568 
574 {
575  TString histname;
576  Double_t contents[30]={0};
577 
578  histname = TString::Format("%s/fHistJetObservables", jets->GetArrayName().Data());
579  THnSparse* histJetObservables = static_cast<THnSparse*>(fHistManager.FindObject(histname));
580 
581  if (!histJetObservables) return;
582 
583  for (Int_t i = 0; i < histJetObservables->GetNdimensions(); i++) {
584  TString title(histJetObservables->GetAxis(i)->GetTitle());
585  if (title=="Centrality (%)")
586  contents[i] = jet.fCent;
587  else if (title=="#phi_{jet} - #psi_{EP}")
588  contents[i] = jet.fEP;
589  else if (title=="#eta_{jet}")
590  contents[i] = jet.Eta();
591  else if (title=="#phi_{jet} (rad)")
592  contents[i] = jet.Phi_0_2pi();
593  else if (title=="#it{p}_{T} (GeV/#it{c})")
594  contents[i] = jet.Pt();
595  else if (title=="#it{p}_{T}^{MC} (GeV/#it{c})")
596  contents[i] = jet.fMCPt;
597  else if (title=="#it{p}_{T}^{corr} (GeV/#it{c})")
598  contents[i] = jet.fCorrPt;
599  else if (title=="#it{A}_{jet}")
600  contents[i] = jet.fArea;
601  else if (title=="NEF")
602  contents[i] = jet.fNEF;
603  else if (title=="#it{z}_{leading}")
604  contents[i] = jet.fZ;
605  else if (title=="No. of constituents")
606  contents[i] = jet.fNConstituents;
607  else if (title=="#it{p}_{T,particle}^{leading} (GeV/#it{c})")
608  contents[i] = jet.fLeadingPt;
609  else
610  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
611  }
612 
613  histJetObservables->Fill(contents);
614 }
615 
621 {
622  switch (fHistoType) {
623  case kTH2:
624  FillTHX(jet, jets);
625  break;
626 
627  case kTHnSparse:
628  FillTHnSparse(jet, jets);
629  break;
630 
631  case kTTree:
632  FillTTree(jet, jets);
633  break;
634  }
635 }
Declaration of class AliAnalysisTaskEmcalJetSpectraQA.
THashList * CreateHistoGroup(const char *groupname)
Int_t fNcentBins
how many centrality bins
Double_t GetRhoVal() const
const TString & GetRhoName() const
double Double_t
Definition: External.C:58
const char * title
Definition: MakeQAPdf.C:26
TObjArray fClusterCollArray
cluster collection array
Double_t fEPV0
!event plane V0
TObjArray fParticleCollArray
particle/track collection array
Float_t fPtBinWidth
Histogram pt bin width.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
virtual void FillTHX(const AliEmcalJetInfo &jetInfo, const AliJetContainer *jets)
virtual void FillTHnSparse(const AliEmcalJetInfo &jetInfo, const AliJetContainer *jets)
AliClusterContainer * GetClusterContainer() const
void FillTH3(const char *hname, double x, double y, double z, double weight=1., Option_t *opt="")
TObjArray fJetCollArray
jet collection array
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
void UserCreateOutputObjects()
Overloads base class method. Creates output objects.
Container for particles within the EMCAL framework.
Int_t GetDefaultClusterEnergy() const
virtual void AllocateTTree(const AliJetContainer *jets)
void GetMomentum(TLorentzVector &vec) const
EBeamType_t fForceBeamType
forced beam type
AliParticleContainer * GetParticleContainer() const
void GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
void FillJetHisto(const AliEmcalJetInfo &jetInfo, const AliJetContainer *jets)
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
THistManager fHistManager
Histogram manager.
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
Double_t Phi_0_2pi() const
Double_t fVertex[3]
!event vertex
virtual void FillTTree(const AliEmcalJetInfo &jetInfo, const AliJetContainer *jets)
Base task in the EMCAL jet framework (lighter version of AliAnalysisTaskEmcalJet) ...
Int_t fCentBin
!event centrality bin
Bool_t fJetEPaxis
whether a EP-jet axis should be included in the THnSparse
Bool_t fAreaAxis
whether the area axis should be included
AliRhoParameter * GetRhoParameter()
Float_t GetJetRadius() const
Definition: External.C:220
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Bool_t GetMomentum(TLorentzVector &mom, const AliVCluster *vc, Double_t mass) const
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
AliAnalysisTaskEmcalJetSpectraQA()
Default constructor for ROOT I/O purposes.
const Int_t nbins
const AliJetIterableContainer accepted() const
bool Bool_t
Definition: External.C:53
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.
const Int_t nPtBins
virtual void AllocateTHnSparse(const AliJetContainer *jets)
virtual void AllocateTHX(const AliJetContainer *jets)
Double_t fCent
!event centrality
Container for jet within the EMCAL jet framework.
Implementation of a task to perform QA on jet spectra.
TH3 * CreateTH3(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, int nbinsz, double zmin, double zmax, Option_t *opt="")
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)