AliPhysics  8bb951a (8bb951a)
 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 
36  AliTLorentzVector(),
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 
53  AliTLorentzVector(),
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 
77  fJetEPaxis(kFALSE),
78  fAreaAxis(kTRUE),
79  fHistManager()
80 
81 {
83 }
84 
89  AliAnalysisTaskEmcalJet(name, kTRUE),
91  fJetEPaxis(kFALSE),
92  fAreaAxis(kTRUE),
93  fHistManager(name)
94 {
96 }
97 
102 {
103  AliError("Tree output not implemented. Falling back to THnSparse output");
104  AllocateTHnSparse(jets);
105 }
106 
111 {
112  Double_t jetRadius = jets->GetJetRadius();
113 
114  TString title[30]= {""};
115  Int_t nbins[30] = {0};
116  Double_t min[30] = {0.};
117  Double_t max[30] = {0.};
118  Int_t dim = 0;
119 
120  if (fForceBeamType != kpp) {
121  title[dim] = "Centrality (%)";
122  nbins[dim] = 20;
123  min[dim] = 0;
124  max[dim] = 100;
125  dim++;
126 
127  if (fJetEPaxis) {
128  title[dim] = "#phi_{jet} - #psi_{EP}";
129  nbins[dim] = fNbins/5;
130  min[dim] = 0;
131  max[dim] = TMath::Pi();
132  dim++;
133  }
134  }
135 
136  title[dim] = "#eta_{jet}";
137  nbins[dim] = fNbins/10;
138  min[dim] = -1;
139  max[dim] = 1;
140  dim++;
141 
142  title[dim] = "#phi_{jet} (rad)";
143  nbins[dim] = fNbins/10*3;
144  min[dim] = 0;
145  max[dim] = 2*TMath::Pi();
146  dim++;
147 
148  title[dim] = "#it{p}_{T} (GeV/#it{c})";
149  nbins[dim] = fNbins;
150  min[dim] = fMinBinPt;
151  max[dim] = fMaxBinPt;
152  dim++;
153 
154  if (fIsEmbedded) {
155  title[dim] = "#it{p}_{T}^{MC} (GeV/#it{c})";
156  nbins[dim] = fNbins;
157  min[dim] = fMinBinPt;
158  max[dim] = fMaxBinPt;
159  dim++;
160  }
161 
162  if (!GetRhoName().IsNull()) {
163  title[dim] = "#it{p}_{T}^{corr} (GeV/#it{c})";
164  nbins[dim] = fNbins;
165  min[dim] = -fMaxBinPt/2;
166  max[dim] = fMaxBinPt/2;
167  dim++;
168  }
169 
170  if (fAreaAxis) {
171  // area resolution is about 0.01 (w/ ghost area 0.005)
172  // for fNbins = 250 use bin width 0.01
173  title[dim] = "#it{A}_{jet}";
174  nbins[dim] = TMath::CeilNint(2.0*jetRadius*jetRadius*TMath::Pi() / 0.01 * fNbins / 250);
175  min[dim] = 0;
176  max[dim] = 2.0*jetRadius*jetRadius*TMath::Pi();
177  dim++;
178  }
179 
180  if (fClusterCollArray.GetEntriesFast() > 0 && fParticleCollArray.GetEntriesFast() > 0) {
181  title[dim] = "NEF";
182  nbins[dim] = fNbins/5;
183  min[dim] = 0;
184  max[dim] = 1.0;
185  dim++;
186  }
187 
188  title[dim] = "#it{z}_{leading}";
189  nbins[dim] = fNbins/5;
190  min[dim] = 0;
191  max[dim] = 1.0;
192  dim++;
193 
194  if (fForceBeamType != kpp) {
195  title[dim] = "No. of constituents";
196  nbins[dim] = 125;
197  min[dim] = 0;
198  max[dim] = 250;
199  dim++;
200  }
201  else {
202  title[dim] = "No. of constituents";
203  nbins[dim] = 50;
204  min[dim] = -0.5;
205  max[dim] = 49.5;
206  dim++;
207  }
208 
209  title[dim] = "#it{p}_{T,particle}^{leading} (GeV/#it{c})";
210  nbins[dim] = fNbins/10*3;
211  min[dim] = 0;
212  max[dim] = 150;
213  dim++;
214 
215  TString histname = TString::Format("%s/fHistJetObservables", jets->GetArrayName().Data());
216  THnSparse* hn = fHistManager.CreateTHnSparse(histname.Data(), histname.Data(), dim, nbins, min, max);
217  for (Int_t i = 0; i < dim; i++) {
218  hn->GetAxis(i)->SetTitle(title[i]);
219  }
220 }
221 
226 {
227  TString histname;
228  TString title;
229 
230  for (Int_t i = 0; i < fNcentBins; i++) {
231  histname = TString::Format("%s/fHistJetPtEtaPhi_%d", jets->GetArrayName().Data(), i);
232  title = histname + ";#it{p}_{T} (GeV/#it{c});#eta;#phi (rad)";
233  fHistManager.CreateTH3(histname.Data(), title.Data(), 20, -1, 1, 41, 0, 2*TMath::Pi()*41/40, fNbins, fMinBinPt, fMaxBinPt);
234 
235  histname = TString::Format("%s/fHistJetPtArea_%d", jets->GetArrayName().Data(), i);
236  title = histname + ";#it{p}_{T} (GeV/#it{c});#it{A}_{jet};counts";
237  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins, fMinBinPt, fMaxBinPt, 150, 0, 1.5);
238 
239  histname = TString::Format("%s/fHistJetPtEP_%d", jets->GetArrayName().Data(), i);
240  title = histname + ";#it{p}_{T} (GeV/#it{c});#phi_{jet} - #psi_{EP};counts";
241  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins, fMinBinPt, fMaxBinPt, 100, 0, TMath::Pi());;
242 
243  histname = TString::Format("%s/fHistJetPtNEF_%d", jets->GetArrayName().Data(), i);
244  title = histname + ";#it{p}_{T} (GeV/#it{c});NEF;counts";
245  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins, fMinBinPt, fMaxBinPt, 102, 0, 1.02);
246 
247  histname = TString::Format("%s/fHistJetPtZ_%d", jets->GetArrayName().Data(), i);
248  title = histname + ";#it{p}_{T} (GeV/#it{c});#it{z}_{leading};counts";
249  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins, fMinBinPt, fMaxBinPt, 102, 0, 1.02);
250 
251  histname = TString::Format("%s/fHistJetPtLeadingPartPt_%d", jets->GetArrayName().Data(), i);
252  title = histname + ";#it{p}_{T} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c});counts";
253  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins, fMinBinPt, fMaxBinPt, 120, 0, 120);
254 
255  if (!jets->GetRhoName().IsNull()) {
256  histname = TString::Format("%s/fHistJetCorrPtEtaPhi_%d", jets->GetArrayName().Data(), i);
257  title = histname + ";#it{p}_{T,corr} (GeV/#it{c});#eta;#phi (rad)";
258  fHistManager.CreateTH3(histname.Data(), title.Data(), 20, -1, 1, 41, 0, 2*TMath::Pi()*201/200, fNbins*2, -fMaxBinPt, fMaxBinPt);
259 
260  histname = TString::Format("%s/fHistJetCorrPtArea_%d", jets->GetArrayName().Data(), i);
261  title = histname + ";#it{p}_{T,corr} (GeV/#it{c});#it{A}_{jet};counts";
262  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins, fMinBinPt, fMaxBinPt, 150, 0, 1.5);
263 
264  histname = TString::Format("%s/fHistJetCorrPtEP_%d", jets->GetArrayName().Data(), i);
265  title = histname + ";#it{p}_{T,corr} (GeV/#it{c});#phi_{jet} - #psi_{EP};counts";
266  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins, fMinBinPt, fMaxBinPt, 100, 0, TMath::Pi());;
267 
268  histname = TString::Format("%s/fHistJetCorrPtNEF_%d", jets->GetArrayName().Data(), i);
269  title = histname + ";#it{p}_{T,corr} (GeV/#it{c});NEF;counts";
270  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins, fMinBinPt, fMaxBinPt, 102, 0, 1.02);
271 
272  histname = TString::Format("%s/fHistJetCorrPtZ_%d", jets->GetArrayName().Data(), i);
273  title = histname + ";#it{p}_{T,corr} (GeV/#it{c});#it{z}_{leading};counts";
274  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins, fMinBinPt, fMaxBinPt, 102, 0, 1.02);
275 
276  histname = TString::Format("%s/fHistJetCorrPtLeadingPartPt_%d", jets->GetArrayName().Data(), i);
277  title = histname + ";#it{p}_{T,corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c});counts";
278  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins, fMinBinPt, fMaxBinPt, 120, 0, 120);
279 
280  histname = TString::Format("%s/fHistJetPtCorrPt_%d", jets->GetArrayName().Data(), i);
281  title = histname + ";#it{p}_{T} (GeV/#it{c});#it{p}_{T,corr} (GeV/#it{c});counts";
282  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins, fMinBinPt, fMaxBinPt, fNbins*2, -fMaxBinPt, fMaxBinPt);
283 
284  if (fIsEmbedded) {
285  histname = TString::Format("%s/fHistJetMCPtCorrPt_%d", jets->GetArrayName().Data(), i);
286  title = histname + ";#it{p}_{T,MC} (GeV/#it{c});#it{p}_{T,corr} (GeV/#it{c});counts";
287  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins, fMinBinPt, fMaxBinPt, fNbins*2, -fMaxBinPt, fMaxBinPt);
288  }
289  }
290 
291  if (fIsEmbedded) {
292  histname = TString::Format("%s/fHistJetPtMCPt_%d", jets->GetArrayName().Data(), i);
293  title = histname + ";#it{p}_{T} (GeV/#it{c});#it{p}_{T,MC} (GeV/#it{c});counts";
294  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins, fMinBinPt, fMaxBinPt, fNbins, fMinBinPt, fMaxBinPt);
295  }
296  }
297 }
298 
301 {
303 
304  Int_t constituentsNbins = 250;
305  Double_t constituentsMax = 249.5;
306 
307  if (fForceBeamType == kpp) {
308  constituentsNbins = 50;
309  constituentsMax = 49.5;
310  }
311 
312  TString histname;
313  TString title;
314 
315  AliJetContainer* jets = 0;
316  TIter nextJetColl(&fJetCollArray);
317  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
318  fHistManager.CreateHistoGroup(jets->GetArrayName());
319 
320  switch (fHistoType) {
321  case kTH2:
322  AllocateTHX(jets);
323  break;
324  case kTHnSparse:
325  AllocateTHnSparse(jets);
326  break;
327  case kTTree:
328  AllocateTTree(jets);
329  break;
330  }
331 
332  TString histname;
333 
334  for (Int_t i = 0; i < fNcentBins; i++) {
335  if (jets->GetParticleContainer()) {
336  histname = TString::Format("%s/fHistTracksJetPt_%d", jets->GetArrayName().Data(), i);
337  title = histname + ";#it{p}_{T,track} (GeV/#it{c});#it{p}_{T,jet} (GeV/#it{c});counts";
338  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins / 2, fMinBinPt, fMaxBinPt / 2, fNbins, fMinBinPt, fMaxBinPt);
339 
340  histname = TString::Format("%s/fHistTracksPtDist_%d", jets->GetArrayName().Data(), i);
341  title = histname + ";#it{p}_{T,track} (GeV/#it{c});#it{d};counts";
342  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins / 2, fMinBinPt, fMaxBinPt / 2, 100, 0, 5);
343 
344  histname = TString::Format("%s/fHistTracksZJetPtJetConst_%d", jets->GetArrayName().Data(), i);
345  title = histname + ";#it{z}_{track} (GeV/#it{c});#it{d};No. of constituents";
346  fHistManager.CreateTH3(histname.Data(), title.Data(), 120, 0.0, 1.2, fNbins, fMinBinPt, fMaxBinPt, constituentsNbins, -0.5, constituentsMax);
347  }
348 
349  if (jets->GetClusterContainer()) {
350  histname = TString::Format("%s/fHistClustersJetPt_%d", jets->GetArrayName().Data(), i);
351  title = histname + ";#it{p}_{T,cluster} (GeV/#it{c});#it{p}_{T,jet} (GeV/#it{c});counts";
352  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins / 2, fMinBinPt, fMaxBinPt / 2, fNbins, fMinBinPt, fMaxBinPt);
353 
354  histname = TString::Format("%s/fHistClustersPtDist_%d", jets->GetArrayName().Data(), i);
355  title = histname + ";#it{p}_{T,cluster} (GeV/#it{c});#it{d};counts";
356  fHistManager.CreateTH2(histname.Data(), title.Data(), fNbins / 2, fMinBinPt, fMaxBinPt / 2, 100, 0, 5);
357 
358  histname = TString::Format("%s/fHistClustersZJetPtJetConst_%d", jets->GetArrayName().Data(), i);
359  title = histname + ";#it{z}_{cluster} (GeV/#it{c});#it{p}_{T,jet} (GeV/#it{c});No. of constituents";
360  fHistManager.CreateTH3(histname.Data(), title.Data(), 120, 0.0, 1.2, fNbins, fMinBinPt, fMaxBinPt, constituentsNbins, -0.5, constituentsMax);
361  }
362 
363  histname = TString::Format("%s/fHistRejectionReason_%d", jets->GetArrayName().Data(), i);
364  title = histname + ";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
365  TH2* hist = fHistManager.CreateTH2(histname.Data(), title.Data(), 32, 0, 32, 100, 0, 250);
366  SetRejectionReasonLabels(hist->GetXaxis());
367  }
368 
369  if (!jets->GetRhoName().IsNull()) {
370  histname = TString::Format("%s/fHistRhoVsCent", jets->GetArrayName().Data());
371  title = histname + ";Centrality (%);#rho (GeV/#it{c});counts";
372  fHistManager.CreateTH2(histname.Data(), title.Data(), 101, 0, 101, 100, 0, 500);
373  }
374  }
375 
376  TIter nextElement(fHistManager.GetListOfHistograms());
377  TObject* obj = 0;
378  while ((obj = nextElement())) fOutput->Add(obj);
379  PostData(1, fOutput);
380 }
381 
386 {
387  TString histname;
388 
389  AliJetContainer* jets = 0;
390  TIter nextJetColl(&fJetCollArray);
391  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
392  if (jets->GetRhoParameter()) {
393  histname = TString::Format("%s/fHistRhoVsCent", jets->GetArrayName().Data());
394  fHistManager.FillTH2(histname.Data(), fCent, jets->GetRhoVal());
395  }
396 
397  AliEmcalJet* jet = 0;
398  jets->ResetCurrentID();
399  while ((jet = jets->GetNextJet())) {
400 
401  UInt_t rejectionReason = 0;
402  if (!jets->AcceptJet(jet, rejectionReason)) {
403  histname = TString::Format("%s/fHistRejectionReason_%d", jets->GetArrayName().Data(), fCentBin);
404  fHistManager.FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
405  continue;
406  }
407 
408  Float_t ptLeading = jets->GetLeadingHadronPt(jet);
409  Float_t corrPt = jet->Pt() - fRhoVal * jet->Area();
410 
411  TLorentzVector leadPart;
412 
413  jets->GetLeadingHadronMomentum(leadPart, jet);
414 
415  // Fill THnSparse
416  Double_t ep = jet->Phi() - fEPV0;
417  while (ep < 0) ep += TMath::Pi();
418  while (ep >= TMath::Pi()) ep -= TMath::Pi();
419 
420  Double_t z = GetParallelFraction(leadPart.Vect(), jet);
421  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
422 
423  AliEmcalJetInfo jetInfo(*jet);
424  jetInfo.fCent = fCent;
425  jetInfo.fEP = ep;
426  jetInfo.fCorrPt = corrPt;
427  jetInfo.fZ = z;
428  jetInfo.fLeadingPt = ptLeading;
429 
430  FillJetHisto(jetInfo, jets);
431 
432  AliParticleContainer* tracks = jets->GetParticleContainer();
433  if (tracks) {
434  for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
435  AliVParticle *track = jet->TrackAt(it, tracks->GetArray());
436  if (track) {
437  histname = TString::Format("%s/fHistTracksJetPt_%d", jets->GetArrayName().Data(), fCentBin);
438  fHistManager.FillTH2(histname.Data(), track->Pt(), jet->Pt());
439 
440  Double_t dphi = TVector2::Phi_0_2pi(track->Phi() - jet->Phi());
441  Double_t deta = track->Eta() - jet->Eta();
442  Double_t dist = TMath::Sqrt(deta * deta + dphi * dphi);
443 
444  histname = TString::Format("%s/fHistTracksPtDist_%d", jets->GetArrayName().Data(), fCentBin);
445  fHistManager.FillTH2(histname.Data(), track->Pt(), dist);
446 
447  histname = TString::Format("%s/fHistTracksZJetPtJetConst_%d", jets->GetArrayName().Data(), fCentBin);
448  fHistManager.FillTH3(histname.Data(), GetParallelFraction(track, jet), jet->Pt(), jet->GetNumberOfConstituents());
449  }
450  }
451  }
452 
453  AliClusterContainer* clusters = jets->GetClusterContainer();
454  if (clusters) {
455  for (Int_t ic = 0; ic < jet->GetNumberOfClusters(); ic++) {
456  AliVCluster *cluster = jet->ClusterAt(ic, clusters->GetArray());
457 
458  if (cluster) {
459  TLorentzVector nPart;
460  if (clusters->GetDefaultClusterEnergy() >=0 && clusters->GetDefaultClusterEnergy() < AliVCluster::kLastUserDefEnergy) {
461  cluster->GetMomentum(nPart, fVertex, (AliVCluster::VCluUserDefEnergy_t)clusters->GetDefaultClusterEnergy());
462  }
463  else {
464  cluster->GetMomentum(nPart, fVertex);
465  }
466 
467  histname = TString::Format("%s/fHistClustersJetPt_%d", jets->GetArrayName().Data(), fCentBin);
468  fHistManager.FillTH2(histname.Data(), nPart.Pt(), jet->Pt());
469 
470  Double_t dphi = TVector2::Phi_0_2pi(nPart.Phi() - jet->Phi());
471  Double_t deta = nPart.Eta() - jet->Eta();
472  Double_t dist = TMath::Sqrt(deta * deta + dphi * dphi);
473 
474  histname = TString::Format("%s/fHistClustersPtDist_%d", jets->GetArrayName().Data(), fCentBin);
475  fHistManager.FillTH2(histname.Data(), nPart.Pt(), dist);
476 
477  histname = TString::Format("%s/fHistClustersZJetPtJetConst_%d", jets->GetArrayName().Data(), fCentBin);
478  fHistManager.FillTH3(histname.Data(), GetParallelFraction(nPart.Vect(), jet), jet->Pt(), jet->GetNumberOfConstituents());
479  }
480  }
481  }
482  } //jet loop
483  }
484  return kTRUE;
485 }
486 
492 {
493  TString histname;
494 
495  histname = TString::Format("%s/fHistJetPtEtaPhi_%d", jets->GetArrayName().Data(), fCentBin);
496  fHistManager.FillTH3(histname.Data(), jet.Eta(), jet.Phi_0_2pi(), jet.Pt());
497 
498  histname = TString::Format("%s/fHistJetPtArea_%d", jets->GetArrayName().Data(), fCentBin);
499  fHistManager.FillTH2(histname.Data(), jet.Pt(), jet.fArea);
500 
501  histname = TString::Format("%s/fHistJetPtEP_%d", jets->GetArrayName().Data(), fCentBin);
502  fHistManager.FillTH2(histname.Data(), jet.Pt(), jet.fEP);
503 
504  histname = TString::Format("%s/fHistJetPtNEF_%d", jets->GetArrayName().Data(), fCentBin);
505  fHistManager.FillTH2(histname.Data(), jet.Pt(), jet.fNEF);
506 
507  histname = TString::Format("%s/fHistJetPtZ_%d", jets->GetArrayName().Data(), fCentBin);
508  fHistManager.FillTH2(histname.Data(), jet.Pt(), jet.fZ);
509 
510  histname = TString::Format("%s/fHistJetPtLeadingPartPt_%d", jets->GetArrayName().Data(), fCentBin);
511  fHistManager.FillTH2(histname.Data(), jet.Pt(), jet.fLeadingPt);
512 
513  if (fIsEmbedded) {
514  histname = TString::Format("%s/fHistJetPtMCPt_%d", jets->GetArrayName().Data(), fCentBin);
515  fHistManager.FillTH2(histname.Data(), jet.Pt(), jet.fMCPt);
516  }
517 
518  if (!jets->GetRhoName().IsNull()) {
519  histname = TString::Format("%s/fHistJetCorrPtEtaPhi_%d", jets->GetArrayName().Data(), fCentBin);
520  fHistManager.FillTH3(histname.Data(), jet.Eta(), jet.Phi_0_2pi(), jet.fCorrPt);
521 
522  histname = TString::Format("%s/fHistJetCorrPtArea_%d", jets->GetArrayName().Data(), fCentBin);
523  fHistManager.FillTH2(histname.Data(), jet.fCorrPt, jet.fArea);
524 
525  histname = TString::Format("%s/fHistJetCorrPtEP_%d", jets->GetArrayName().Data(), fCentBin);
526  fHistManager.FillTH2(histname.Data(), jet.fCorrPt, jet.fEP);
527 
528  histname = TString::Format("%s/fHistJetCorrPtNEF_%d", jets->GetArrayName().Data(), fCentBin);
529  fHistManager.FillTH2(histname.Data(), jet.fCorrPt, jet.fNEF);
530 
531  histname = TString::Format("%s/fHistJetCorrPtZ_%d", jets->GetArrayName().Data(), fCentBin);
532  fHistManager.FillTH2(histname.Data(), jet.fCorrPt, jet.fZ);
533 
534  histname = TString::Format("%s/fHistJetCorrPtLeadingPartPt_%d", jets->GetArrayName().Data(), fCentBin);
535  fHistManager.FillTH2(histname.Data(), jet.fCorrPt, jet.fLeadingPt);
536 
537  histname = TString::Format("%s/fHistJetPtCorrPt_%d", jets->GetArrayName().Data(), fCentBin);
538  fHistManager.FillTH2(histname.Data(), jet.Pt(), jet.fCorrPt);
539 
540  if (fIsEmbedded) {
541  histname = TString::Format("%s/fHistJetMCPtCorrPt_%d", jets->GetArrayName().Data(), fCentBin);
542  fHistManager.FillTH2(histname.Data(), jet.fMCPt, jet.fCorrPt);
543  }
544  }
545 }
546 
552 {
553  AliError("Tree output not implemented. Falling back to THnSparse output");
554  FillTHnSparse(jet, jets);
555 }
556 
562 {
563  TString histname;
564  Double_t contents[30]={0};
565 
566  histname = TString::Format("%s/fHistJetObservables", jets->GetArrayName().Data());
567  THnSparse* histJetObservables = static_cast<THnSparse*>(fHistManager.FindObject(histname));
568 
569  if (!histJetObservables) return;
570 
571  for (Int_t i = 0; i < histJetObservables->GetNdimensions(); i++) {
572  TString title(histJetObservables->GetAxis(i)->GetTitle());
573  if (title=="Centrality (%)")
574  contents[i] = jet.fCent;
575  else if (title=="#phi_{jet} - #psi_{EP}")
576  contents[i] = jet.fEP;
577  else if (title=="#eta_{jet}")
578  contents[i] = jet.Eta();
579  else if (title=="#phi_{jet} (rad)")
580  contents[i] = jet.Phi_0_2pi();
581  else if (title=="#it{p}_{T} (GeV/#it{c})")
582  contents[i] = jet.Pt();
583  else if (title=="#it{p}_{T}^{MC} (GeV/#it{c})")
584  contents[i] = jet.fMCPt;
585  else if (title=="#it{p}_{T}^{corr} (GeV/#it{c})")
586  contents[i] = jet.fCorrPt;
587  else if (title=="#it{A}_{jet}")
588  contents[i] = jet.fArea;
589  else if (title=="NEF")
590  contents[i] = jet.fNEF;
591  else if (title=="#it{z}_{leading}")
592  contents[i] = jet.fZ;
593  else if (title=="No. of constituents")
594  contents[i] = jet.fNConstituents;
595  else if (title=="#it{p}_{T,particle}^{leading} (GeV/#it{c})")
596  contents[i] = jet.fLeadingPt;
597  else
598  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
599  }
600 
601  histJetObservables->Fill(contents);
602 }
603 
609 {
610  switch (fHistoType) {
611  case kTH2:
612  FillTHX(jet, jets);
613  break;
614 
615  case kTHnSparse:
616  FillTHnSparse(jet, jets);
617  break;
618 
619  case kTTree:
620  FillTTree(jet, jets);
621  break;
622  }
623 }
Declaration of class AliAnalysisTaskEmcalJetSpectraQA.
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Double_t Area() const
Definition: AliEmcalJet.h:69
TObjArray fClusterCollArray
cluster collection array
Double_t GetRhoVal() const
const TString & GetRhoName() const
const char * title
Definition: MakeQAPdf.C:26
Double_t Eta() const
Definition: AliEmcalJet.h:60
const TString & GetRhoName(Int_t c=0) const
Double_t Phi() const
Definition: AliEmcalJet.h:55
virtual void FillTHX(const AliEmcalJetInfo &jetInfo, const AliJetContainer *jets)
Double_t fMinBinPt
min pt in histograms
Double_t fEPV0
!event plane V0
virtual void FillTHnSparse(const AliEmcalJetInfo &jetInfo, const AliJetContainer *jets)
AliClusterContainer * GetClusterContainer() const
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
Int_t fCentBin
!event centrality bin
TList * fOutput
!output list
void UserCreateOutputObjects()
Overloads base class method. Creates output objects.
UShort_t GetNumberOfConstituents() const
Definition: AliEmcalJet.h:84
Container for particles within the EMCAL framework.
Int_t GetDefaultClusterEnergy() const
Bool_t fIsEmbedded
trigger, embedded signal
UShort_t GetNumberOfTracks() const
Definition: AliEmcalJet.h:83
virtual void AllocateTTree(const AliJetContainer *jets)
TObjArray fParticleCollArray
particle/track collection array
void GetMomentum(TLorentzVector &vec) const
AliParticleContainer * GetParticleContainer() const
void GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
void FillJetHisto(const AliEmcalJetInfo &jetInfo, const AliJetContainer *jets)
Short_t ClusterAt(Int_t idx) const
Definition: AliEmcalJet.h:77
UShort_t GetNumberOfClusters() const
Definition: AliEmcalJet.h:82
THistManager fHistManager
Histogram manager.
UShort_t GetRejectionReasonBitPosition(UInt_t rejectionReason) const
Double_t GetLeadingHadronPt(const AliEmcalJet *jet) const
BeamType fForceBeamType
forced beam type
Int_t fNcentBins
how many centrality bins
Double_t fCent
!event centrality
TClonesArray * GetArray() const
virtual void FillTTree(const AliEmcalJetInfo &jetInfo, const AliJetContainer *jets)
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
Bool_t fJetEPaxis
whether a EP-jet axis should be included in the THnSparse
TObjArray fJetCollArray
name for local rho
Bool_t fAreaAxis
whether the area axis should be included
AliRhoParameter * GetRhoParameter()
Double_t Pt() const
Definition: AliEmcalJet.h:47
const TString & GetArrayName() const
AliEmcalJet * GetNextJet()
Float_t GetJetRadius() const
Double_t fMaxBinPt
max pt in histograms
Short_t TrackAt(Int_t idx) const
Definition: AliEmcalJet.h:107
Double_t fVertex[3]
!event vertex
void SetMakeGeneralHistograms(Bool_t g)
AliAnalysisTaskEmcalJetSpectraQA()
Default constractor for ROOT I/O purposes.
void SetRejectionReasonLabels(TAxis *axis)
const Int_t nbins
Double_t fRhoVal
!event rho value, same for local rho
Container structure for EMCAL clusters.
void ResetCurrentID(Int_t i=-1)
virtual void AllocateTHnSparse(const AliJetContainer *jets)
virtual void AllocateTHX(const AliJetContainer *jets)
Int_t fNbins
no. of pt bins
Implementation of a task to perform QA on jet spectra.