AliPhysics  0fdb362 (0fdb362)
AliAnalysisTaskEmcalJetPerformance.cxx
Go to the documentation of this file.
1 /**********************************************************************************
2 * Copyright (C) 2016, Copyright Holders of the ALICE Collaboration *
3 * All rights reserved. *
4 * *
5 * Redistribution and use in source and binary forms, with or without *
6 * modification, are permitted provided that the following conditions are met: *
7 * * Redistributions of source code must retain the above copyright *
8 * notice, this list of conditions and the following disclaimer. *
9 * * Redistributions in binary form must reproduce the above copyright *
10 * notice, this list of conditions and the following disclaimer in the *
11 * documentation and/or other materials provided with the distribution. *
12 * * Neither the name of the <organization> nor the *
13 * names of its contributors may be used to endorse or promote products *
14 * derived from this software without specific prior written permission. *
15 * *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
19 * DISCLAIMED. IN NO EVENT SHALL ALICE COLLABORATION BE LIABLE FOR ANY *
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
26 * *********************************************************************************/
27 
28 #include <vector>
29 
30 #include <TClonesArray.h>
31 #include <TH1F.h>
32 #include <TH2F.h>
33 #include <TH3.h>
34 #include <TList.h>
35 #include <THnSparse.h>
36 #include <TRandom3.h>
37 #include <TGrid.h>
38 #include <TFile.h>
39 
40 #include <AliVCluster.h>
41 #include <AliVParticle.h>
42 #include <AliLog.h>
43 
44 #include "AliAnalysisManager.h"
45 #include <AliVEventHandler.h>
46 #include "AliTLorentzVector.h"
47 #include "AliEmcalJet.h"
48 #include "AliRhoParameter.h"
49 #include "AliJetContainer.h"
50 #include "AliParticleContainer.h"
51 #include "AliClusterContainer.h"
52 #include "AliEMCALGeometry.h"
53 #include "AliOADBContainer.h"
55 #include "AliEMCALTriggerPatchInfo.h"
57 #include "AliMCEvent.h"
58 
60 
64 
70  fPlotJetHistograms(kFALSE),
71  fPlotClusterHistograms(kFALSE),
72  fPlotParticleCompositionHistograms(kFALSE),
73  fComputeBackground(kFALSE),
74  fDoTriggerSimulation(kFALSE),
75  fPlotMatchedJetHistograms(kFALSE),
76  fComputeMBDownscaling(kFALSE),
77  fMaxPt(250),
78  fNEtaBins(40),
79  fNPhiBins(200),
80  fNCentHistBins(0),
81  fCentHistBins(0),
82  fNPtHistBins(0),
83  fPtHistBins(0),
84  fNM02HistBins(0),
85  fM02HistBins(0),
86  fNEoverPBins(0),
87  fEoverPBins(0),
88  fTrackMatchingDeltaEtaMax(0.015),
89  fTrackMatchingDeltaPhiMax(0.030),
90  fMBUpscaleFactor(1.),
91  fMedianEMCal(0.),
92  fMedianDCal(0.),
93  fkEMCEJE(kFALSE),
94  fEmbeddingQA(),
95  fMinSharedMomentumFraction(0.5),
96  fMaxMatchedJetDistance(0.3),
97  fUseAliEventCuts(kTRUE),
98  fEventCuts(0),
99  fEventCutList(0),
100  fUseManualEventCuts(kFALSE),
101  fGeneratorLevel(0),
102  fHistManager()
103 {
105 }
106 
113  AliAnalysisTaskEmcalJet(name, kTRUE),
114  fPlotJetHistograms(kFALSE),
115  fPlotClusterHistograms(kFALSE),
117  fComputeBackground(kFALSE),
118  fDoTriggerSimulation(kFALSE),
120  fComputeMBDownscaling(kFALSE),
121  fMaxPt(250),
122  fNEtaBins(40),
123  fNPhiBins(200),
124  fNCentHistBins(0),
125  fCentHistBins(0),
126  fNPtHistBins(0),
127  fPtHistBins(0),
128  fNM02HistBins(0),
129  fM02HistBins(0),
130  fNEoverPBins(0),
131  fEoverPBins(0),
134  fMBUpscaleFactor(1.),
135  fMedianEMCal(0.),
136  fMedianDCal(0.),
137  fkEMCEJE(kFALSE),
138  fEmbeddingQA(),
141  fUseAliEventCuts(kTRUE),
142  fEventCuts(0),
143  fEventCutList(0),
144  fUseManualEventCuts(kFALSE),
145  fGeneratorLevel(0),
146  fHistManager(name)
147 {
149 }
150 
155 {
156 }
157 
162 {
163  fNCentHistBins = 4;
165  fCentHistBins[0] = 0;
166  fCentHistBins[1] = 10;
167  fCentHistBins[2] = 30;
168  fCentHistBins[3] = 50;
169  fCentHistBins[4] = 90;
170 
171  fNPtHistBins = 82;
174  GenerateFixedBinArray(7, 0.3, 1, fPtHistBins+6);
175  GenerateFixedBinArray(10, 1, 3, fPtHistBins+13);
176  GenerateFixedBinArray(14, 3, 10, fPtHistBins+23);
177  GenerateFixedBinArray(10, 10, 20, fPtHistBins+37);
178  GenerateFixedBinArray(15, 20, 50, fPtHistBins+47);
179  GenerateFixedBinArray(20, 50, 150, fPtHistBins+62);
180 
181  fNM02HistBins = 81;
183  GenerateFixedBinArray(35, 0, 0.7, fM02HistBins);
184  GenerateFixedBinArray(6, 0.7, 1., fM02HistBins+35);
185  GenerateFixedBinArray(20, 1., 3., fM02HistBins+41);
186  GenerateFixedBinArray(10, 3., 5., fM02HistBins+61);
187  GenerateFixedBinArray(10, 5., 10., fM02HistBins+71);
188 
189  fNEoverPBins = 47;
191  GenerateFixedBinArray(30, 0, 1.5, fEoverPBins);
192  GenerateFixedBinArray(10, 1.5, 3.5, fEoverPBins+30);
193  GenerateFixedBinArray(7, 3.5, 10.5, fEoverPBins+40);
194 }
195 
201 {
203 
204  // Intialize AliEventCuts
205  if (fUseAliEventCuts) {
206  fEventCutList = new TList();
207  fEventCutList ->SetOwner();
208  fEventCutList ->SetName("EventCutOutput");
209 
210  fEventCuts.OverrideAutomaticTriggerSelection(fOffTrigger);
211  if(fUseManualEventCuts==1)
212  {
213  fEventCuts.SetManualMode();
214  // Configure manual settings here
215  // ...
216  }
217  fEventCuts.AddQAplotsToList(fEventCutList);
218  fOutput->Add(fEventCutList);
219  }
220 
221  // Get the MC particle branch, in case it exists
222  fGeneratorLevel = GetMCParticleContainer("mcparticles");
223 
224  // Allocate histograms
225  if (fPlotJetHistograms) {
227  }
230  }
233  }
234  if (fComputeBackground) {
236  }
237  if (fDoTriggerSimulation) {
239  }
242  }
243 
244  // Initialize embedding QA
246  if (embeddingHelper) {
247  bool res = fEmbeddingQA.Initialize();
248  if (res) {
250  }
251  }
252 
253  TIter next(fHistManager.GetListOfHistograms());
254  TObject* obj = 0;
255  while ((obj = next())) {
256  fOutput->Add(obj);
257  }
258 
259  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
260 }
261 
262 /*
263  * This function allocates the histograms for single jets.
264  * A set of histograms is allocated per each jet container.
265  */
267 {
268  TString histname;
269  TString title;
270 
271  Int_t nPtBins = TMath::CeilNint(fMaxPt/2);
272 
273  AliJetContainer* jets = 0;
274  TIter nextJetColl(&fJetCollArray);
275  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
276 
277  // Jet rejection reason
278  histname = TString::Format("%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
279  title = histname + ";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
280  TH2* hist = fHistManager.CreateTH2(histname.Data(), title.Data(), 32, 0, 32, 50, 0, fMaxPt);
281  SetRejectionReasonLabels(hist->GetXaxis());
282 
283  // Rho vs. Centrality
284  if (!jets->GetRhoName().IsNull()) {
285  histname = TString::Format("%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
286  title = histname + ";Centrality (%);#rho (GeV/#it{c});counts";
287  fHistManager.CreateTH2(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 500);
288  }
289 
290  // (Centrality, pT, NEF)
291  Int_t nbinsx = 20; Int_t minx = 0; Int_t maxx = 100;
292  Int_t nbinsy = fMaxPt; Int_t miny = 0; Int_t maxy = fMaxPt;
293  Int_t nbinsz = 50; Int_t minz = 0; Int_t maxz = 1.;
294 
295  histname = TString::Format("%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
296  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
297  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
298 
299  histname = TString::Format("%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
300  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
301  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
302 
303  // (Centrality, pT upscaled, calo type)
304  if (fComputeMBDownscaling) {
305  histname = TString::Format("%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
306  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
307  fHistManager.CreateTH3(histname.Data(), title.Data(), 20, 0, 100, nPtBins, 0, fMaxPt, 2, -0.5, 1.5, "s");
308  }
309 
310  // pT-leading vs. pT
311  histname = TString::Format("%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
312  title = histname + ";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
313  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, nPtBins, 0, fMaxPt);
314 
315  // A vs. pT
316  histname = TString::Format("%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
317  title = histname + ";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
318  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, 50, 0, 0.5);
319 
320  // (Centrality, pT, z-leading (charged))
321  nbinsx = 20; minx = 0; maxx = 100;
322  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
323  nbinsz = 50; minz = 0; maxz = 1.;
324 
325  histname = TString::Format("%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
326  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
327  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
328 
329  histname = TString::Format("%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
330  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
331  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
332 
333  // (Centrality, pT, z (charged))
334  nbinsx = 20; minx = 0; maxx = 100;
335  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
336  nbinsz = 50; minz = 0; maxz = 1.;
337 
338  histname = TString::Format("%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
339  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
340  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
341 
342  histname = TString::Format("%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
343  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
344  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
345 
346  // (Centrality, pT, Nconst, calo type)
347  nbinsx = 20; minx = 0; maxx = 100;
348  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
349  nbinsz = 50; minz = 0; maxz = fMaxPt;
350 
351  histname = TString::Format("%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
352  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
353  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
354 
355  histname = TString::Format("%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
356  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
357  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
358 
359  // (Centrality, jet pT, Enonlincorr - Ehadcorr)
360  nbinsx = 20; minx = 0; maxx = 100;
361  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
362  nbinsz = nPtBins; minz = 0; maxz = fMaxPt;
363 
364  histname = TString::Format("%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
365  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#sum#it{E}_{nonlincorr} - #it{E}_{hadcorr}";
366  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
367 
368  // (Median patch energy, calo type, jet pT, centrality)
369  if (fDoTriggerSimulation) {
370  histname = TString::Format("%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
371  title = histname + ";#it{E}_{patch,med};type;#it{p}_{T}^{corr} (GeV/#it{c});Centrality (%)";
372  Int_t nbins5[4] = {100, 2, nPtBins, 50};
373  Double_t min5[4] = {0,-0.5, 0, 0};
374  Double_t max5[4] = {50,1.5, fMaxPt, 100};
375  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins5, min5, max5);
376  }
377 
378  }
379 
380  // MB downscale factor histogram
381  if (fComputeMBDownscaling) {
382  histname = "Trigger/hMBDownscaleFactor";
383  title = histname + ";Downscale factor;counts";
384  fHistManager.CreateTH1(histname.Data(), title.Data(), 200, 0, 200);
385  }
386 
387 }
388 
389 /*
390  * This function allocates the histograms for the calorimeter performance study.
391  */
393 {
394  TString histname;
395  TString htitle;
396 
397  const Int_t nRcorrBins = 50;
398  Double_t *RcorrBins = GenerateFixedBinArray(nRcorrBins, 0., 1.);
399  const Int_t nCellBins = 30;
400  Double_t *cellBins = GenerateFixedBinArray(nCellBins, -0.5, 29.5);
401  const Int_t nMatchedTrackBins = 5;
402  Double_t *matchedTrackBins = GenerateFixedBinArray(nMatchedTrackBins, -0.5, 4.5);
403  const Int_t nDeltaEtaBins = 60;
404  Double_t *deltaEtaBins = GenerateFixedBinArray(nDeltaEtaBins, -0.015, 0.015);
405 
408 
409  // Plot M02 distribution (centrality, Eclus nonlincorr, M02)
410  histname = "ClusterHistograms/hM02";
411  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); M02";
413 
414  // Plot Ncell distribution for M02 > 0.4 and 0.1 < M02 < 0.4 (centrality, Eclus nonlincorr, Ncells)
415  histname = "ClusterHistograms/hNcellsM02G04";
416  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); Ncells";
417  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNCentHistBins, fCentHistBins, fNPtHistBins, fPtHistBins, nCellBins, cellBins);
418 
419  histname = "ClusterHistograms/hNcellsM02L04";
420  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); Ncells";
421  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNCentHistBins, fCentHistBins, fNPtHistBins, fPtHistBins, nCellBins, cellBins);
422 
425 
426  // Plot matched track pT for all clusters, M02 > 0.4 clusters, and 0.1 < M02 < 0.4 clusters (centrality, Eclus nonlincorr, trackPsum)
427  histname = "ClusterHistograms/hMatchedTrackPt";
428  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
430 
431  histname = "ClusterHistograms/hMatchedTrackPtM02G04";
432  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
434 
435  histname = "ClusterHistograms/hMatchedTrackPtM02L04";
436  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
438 
439  // Plot number of matched tracks for all clusters, M02 > 0.4 clusters, and 0.1 < M02 < 0.4 clusters (centrality, Eclus nonlincorr, N matches)
440  histname = "ClusterHistograms/hMatchedTrackN";
441  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
442  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNCentHistBins, fCentHistBins, fNPtHistBins, fPtHistBins, nMatchedTrackBins, matchedTrackBins);
443 
444  histname = "ClusterHistograms/hMatchedTrackNM02G04";
445  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
446  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNCentHistBins, fCentHistBins, fNPtHistBins, fPtHistBins, nMatchedTrackBins, matchedTrackBins);
447 
448  histname = "ClusterHistograms/hMatchedTrackNM02L04";
449  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
450  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNCentHistBins, fCentHistBins, fNPtHistBins, fPtHistBins, nMatchedTrackBins, matchedTrackBins);
451 
452  // Plot M02 distribution for clusters with matched tracks (centrality, Eclus nonlincorr, M02)
453  histname = "ClusterHistograms/hM02Matched";
454  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); M02";
456 
457  // Plot M02 distribution for clusters without matched tracks (centrality, Eclus nonlincorr, M02)
458  histname = "ClusterHistograms/hM02Unmatched";
459  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); M02";
461 
462  // Plot clus-track deltaEta of matched tracks (deltaEta, Eclus, M02)
463  histname = "ClusterHistograms/hDeltaEtaCentral";
464  htitle = histname + ";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
465  fHistManager.CreateTH3(histname.Data(), htitle.Data(), nDeltaEtaBins, deltaEtaBins, fNPtHistBins, fPtHistBins, fNM02HistBins, fM02HistBins);
466 
467  histname = "ClusterHistograms/hDeltaEtaPeripheral";
468  htitle = histname + ";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
469  fHistManager.CreateTH3(histname.Data(), htitle.Data(), nDeltaEtaBins, deltaEtaBins, fNPtHistBins, fPtHistBins, fNM02HistBins, fM02HistBins);
470 
473 
474  // Plot E/p vs. M02 for 0-10% and 50-90% (Eclus nonlincorr, Eclus nonlincorr / trackPsum, M02)
475  histname = "ClusterHistograms/hEoverPM02Central";
476  htitle = histname + ";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
478 
479  histname = "ClusterHistograms/hEoverPM02Peripheral";
480  htitle = histname + ";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
482 
485 
486  // Plot Rcorr distribution (centrality, trackPSum, Rcorr = (Enonlincorr - Ehadcorr) / trackPSum)
487  histname = "ClusterHistograms/hRcorrVsCent";
488  htitle = histname + ";Centrality (%);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
489  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNCentHistBins, fCentHistBins, fNPtHistBins, fPtHistBins, nRcorrBins, RcorrBins);
490 
491  // Plot Rcorr distribution for 0-10% centrality (Eclus nonlincorr, trackPSum, Rcorr)
492  histname = "ClusterHistograms/hRcorr0-10";
493  htitle = histname + ";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
494  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNPtHistBins, fPtHistBins, nRcorrBins, RcorrBins);
495 
496  // Plot Rcorr distribution for 50-90% centrality (Eclus nonlincorr, trackPSum, Rcorr)
497  histname = "ClusterHistograms/hRcorr50-90";
498  htitle = histname + ";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
499  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNPtHistBins, fPtHistBins, nRcorrBins, RcorrBins);
500 
501  // Plot also Rcorr-clus (centrality, trackPSum, Rcorr-clus = (Enonlincorr - Ehadcorr) / Enonlincorr )
502  histname = "ClusterHistograms/hRcorrClusVsCent";
503  htitle = histname + ";Centrality (%);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
504  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNCentHistBins, fCentHistBins, fNPtHistBins, fPtHistBins, nRcorrBins, RcorrBins);
505 
506  // Rcorr-clus for 0-10% centrality (Eclus nonlincorr, trackPSum, Rcorr-clus = (Enonlincorr - Ehadcorr) / Enonlincorr )
507  histname = "ClusterHistograms/hRcorrClus0-10";
508  htitle = histname + ";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
509  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNPtHistBins, fPtHistBins, nRcorrBins, RcorrBins);
510 
511  // Rcorr-clus for 50-90% centrality (Eclus nonlincorr, trackPSum, Rcorr-clus = (Enonlincorr - Ehadcorr) / Enonlincorr )
512  histname = "ClusterHistograms/hRcorrClus50-90";
513  htitle = histname + ";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
514  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNPtHistBins, fPtHistBins, nRcorrBins, RcorrBins);
515 
516  // Plot total track multiplicity
517  histname = "ClusterHistograms/hTrackMultiplicity";
518  htitle = histname + ";N_{tracks};Centrality (%)";
519  fHistManager.CreateTH2(histname.Data(), htitle.Data(), 1000, 0, 10000, 20, 0, 100);
520 }
521 
522 /*
523  * This function allocates the histograms for the jet composition study.
524  */
526 {
527  TString histname;
528  TString htitle;
529  Int_t nPtBins = TMath::CeilNint(fMaxPt/2);
530 
531  const Int_t nRejBins = 32;
532  Double_t* rejReasonBins = new Double_t[nRejBins+1];
533  GenerateFixedBinArray(nRejBins, 0, nRejBins, rejReasonBins);
534  const Int_t nContributorTypes = 11;
535  Double_t *contributorTypeBins = GenerateFixedBinArray(nContributorTypes, -0.5, 10.5);
536  const Int_t nParticleTypes = 17;
537  Double_t *particleTypeBins = GenerateFixedBinArray(nParticleTypes, -0.5, 16.5);
538 
539  AliEmcalContainer* cont = 0;
540  TIter nextClusColl(&fClusterCollArray);
541  while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) {
542 
543  histname = "ClusterHistogramsMC/hClusterRejectionReasonMC";
544  htitle = histname + ";Rejection reason;#it{E}_{clus} (GeV/)";
545  TH2* histMC2 = fHistManager.CreateTH2(histname.Data(), htitle.Data(), nRejBins, rejReasonBins, fNPtHistBins, fPtHistBins);
546  SetRejectionReasonLabels(histMC2->GetXaxis());
547  }
548 
549  // M02 vs. Energy vs. Particle type
550  histname = "ClusterHistogramsMC/hM02VsParticleTypeCentral";
551  htitle = histname + ";M02;#it{E}_{clus} (GeV); Particle type";
552  TH3* hM02VsParticleTypeCentral = fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNM02HistBins, fM02HistBins, fNPtHistBins, fPtHistBins, nParticleTypes, particleTypeBins);
553  SetParticleTypeLabels(hM02VsParticleTypeCentral->GetZaxis());
554 
555  histname = "ClusterHistogramsMC/hM02VsParticleTypePeripheral";
556  htitle = histname + ";M02;#it{E}_{clus} (GeV); Particle type";
557  TH3* hM02VsParticleTypePeripheral = fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNM02HistBins, fM02HistBins, fNPtHistBins, fPtHistBins, nParticleTypes, particleTypeBins);
558  SetParticleTypeLabels(hM02VsParticleTypePeripheral->GetZaxis());
559 
560  // Plot photon energy in photon-hadron overlap clusters (Centrality, Photon energy, M02)
561  histname = "ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
562  htitle = histname + ";Centrality (%);M02;#it{E}_{photon} (GeV)";
564 
565  // Plot hadron energy in hadron-photon overlap clusters (Centrality, Photon energy, M02)
566  histname = "ClusterHistogramsMC/hHadronPhotonHadronEnergy";
567  htitle = histname + ";Centrality (%);M02;#it{E}_{hadron} (GeV)";
569 
570  if (fPlotJetHistograms) {
571 
572  // M02 vs. Energy vs. Particle type vs. Jet pT, for particles inside jets
573  Int_t dim = 0;
574  TString title[20];
575  Int_t nbins[20] = {0};
576  Double_t min[30] = {0.};
577  Double_t max[30] = {0.};
578  Double_t *binEdges[20] = {0};
579 
580  title[dim] = "M02";
581  nbins[dim] = fNM02HistBins;
582  binEdges[dim] = fM02HistBins;
583  min[dim] = fM02HistBins[0];
584  max[dim] = fM02HistBins[fNM02HistBins];
585  dim++;
586 
587  title[dim] = "#it{E}_{clus} (GeV)";
588  nbins[dim] = fNPtHistBins;
589  binEdges[dim] = fPtHistBins;
590  min[dim] = fPtHistBins[0];
591  max[dim] = fPtHistBins[fNPtHistBins];
592  dim++;
593 
594  title[dim] = "Contributor type";
595  nbins[dim] = nContributorTypes;
596  min[dim] = -0.5;
597  max[dim] = 7.5;
598  binEdges[dim] = contributorTypeBins;
599  dim++;
600 
601  title[dim] = "#it{p}_{T,jet}^{corr}";
602  nbins[dim] = nPtBins;
603  min[dim] = 0;
604  max[dim] = fMaxPt;
605  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
606  dim++;
607 
608  TString thnname = "JetPerformanceMC/hM02VsContributorTypeJets";
609  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
610  for (Int_t i = 0; i < dim; i++) {
611  hn->GetAxis(i)->SetTitle(title[i]);
612  hn->SetBinEdges(i, binEdges[i]);
613  }
614 
615  // Particle composition inside each jet -- jet pT vs. particle type vs. particle number vs. particle pT sum
616  // (One entry per jet for each particle type)
617  dim = 0;
618 
619  title[dim] = "#it{p}_{T,jet}^{corr}";
620  nbins[dim] = nPtBins;
621  min[dim] = 0;
622  max[dim] = fMaxPt;
623  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
624  dim++;
625 
626  title[dim] = "Contributor type";
627  nbins[dim] = nContributorTypes;
628  min[dim] = -0.5;
629  max[dim] = 7.5;
630  binEdges[dim] = contributorTypeBins;
631  dim++;
632 
633  title[dim] = "N";
634  nbins[dim] = 30;
635  min[dim] = -0.5;
636  max[dim] = 29.5;
637  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
638  dim++;
639 
640  title[dim] = "#it{p}_{T,sum} (GeV)";
641  nbins[dim] = fNPtHistBins;
642  binEdges[dim] = fPtHistBins;
643  min[dim] = fPtHistBins[0];
644  max[dim] = fPtHistBins[fNPtHistBins];
645  dim++;
646 
647  thnname = "JetPerformanceMC/hJetComposition";
648  THnSparse* thn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
649  for (Int_t i = 0; i < dim; i++) {
650  thn->GetAxis(i)->SetTitle(title[i]);
651  thn->SetBinEdges(i, binEdges[i]);
652  }
653 
654  // Hadronic calo energy in each jet
655 
656  // Jet pT vs. Summed energy of hadronic clusters without a matched track
657  histname = "JetPerformance/hHadCaloEnergyUnmatched";
658  htitle = histname + ";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
659  fHistManager.CreateTH2(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNPtHistBins, fPtHistBins);
660 
661  // Jet pT vs. Summed energy of hadronic clusters with a matched track (before hadronic correction)
662  histname = "JetPerformance/hHadCaloEnergyMatchedNonlincorr";
663  htitle = histname + ";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
664  fHistManager.CreateTH2(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNPtHistBins, fPtHistBins);
665 
666  // Jet pT vs. Summed energy of hadronic clusters with a matched track (after hadronic correction)
667  histname = "JetPerformance/hHadCaloEnergyMatchedHadCorr";
668  htitle = histname + ";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
669  fHistManager.CreateTH2(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNPtHistBins, fPtHistBins);
670 
671  }
672 
673 }
674 
675 /*
676  * This function sets axis labels for particle type histograms.
677  */
679 {
680  axis->SetBinLabel(1, "SinglePhoton");
681  axis->SetBinLabel(2, "SingleElectron");
682  axis->SetBinLabel(3, "SingleChargedPion");
683  axis->SetBinLabel(4, "SingleProton");
684  axis->SetBinLabel(5, "SingleAntiProton");
685  axis->SetBinLabel(6, "SingleChargedKaon");
686  axis->SetBinLabel(7, "SingleK0L");
687  axis->SetBinLabel(8, "SingleNeutron");
688  axis->SetBinLabel(9, "SingleAntiNeutron");
689  axis->SetBinLabel(10, "SingleOther");
690  axis->SetBinLabel(11, "PhotonHadron");
691  axis->SetBinLabel(12, "HadronPhoton");
692  axis->SetBinLabel(13, "MergedPi0");
693  axis->SetBinLabel(14, "PhotonPhotonOther");
694  axis->SetBinLabel(15, "HadronHadron");
695  axis->SetBinLabel(16, "TwoContributorsOther");
696  axis->SetBinLabel(17, "MoreThanTwoContributors");
697 }
698 
699 /*
700  * This function allocates background subtraction histograms, if enabled.
701  * A set of histograms is allocated per each jet container.
702  */
704 {
705  TString histname;
706  TString title;
707 
708  AliJetContainer* jets = 0;
709  TIter nextJetColl(&fJetCollArray);
710  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
711 
712  // EMCal
713  histname = TString::Format("%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
714  title = histname + ";Centrality;Scale factor;counts";
715  fHistManager.CreateTH2(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 5);
716 
717  histname = TString::Format("%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
718  title = histname + ";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
719  fHistManager.CreateTH2(histname.Data(), title.Data(), 10, 0, 100, 400, -50, 150);
720 
721  histname = TString::Format("%s/BackgroundHistograms/hScaleFactorEMCalFid", jets->GetArrayName().Data());
722  title = histname + ";Centrality;Scale factor;counts";
723  fHistManager.CreateTH2(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 5);
724 
725  // DCal
726  histname = TString::Format("%s/BackgroundHistograms/hScaleFactorDCal", jets->GetArrayName().Data());
727  title = histname + ";Centrality;Scale factor;counts";
728  fHistManager.CreateTH2(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 5);
729 
730  histname = TString::Format("%s/BackgroundHistograms/hDeltaPtDCal", jets->GetArrayName().Data());
731  title = histname + ";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
732  fHistManager.CreateTH2(histname.Data(), title.Data(), 10, 0, 100, 400, -50, 150);
733 
734  histname = TString::Format("%s/BackgroundHistograms/hScaleFactorDCalFid", jets->GetArrayName().Data());
735  title = histname + ";Centrality;Scale factor;counts";
736  fHistManager.CreateTH2(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 5);
737 
738  }
739 }
740 
741 /*
742  * This function allocates the histograms for single jets, when the "simulated" trigger has been fired.
743  * A set of histograms is allocated per each jet container.
744  */
746 {
747  TString histname;
748  TString title;
749  Int_t nPtBins = TMath::CeilNint(fMaxPt/2);
750 
751  //----------------------------------------------
752  // Trigger patch histograms
753 
754  // patch eta vs. phi
755  histname = "TriggerSimHistograms/hEtaVsPhi";
756  title = histname + ";#eta_{patch} (rad);#phi_{patch} (rad)";
757  fHistManager.CreateTH2(histname.Data(), title.Data(), 140, -0.7, 0.7, 500, 1., 6.);
758 
759  // N patches
760  histname = "TriggerSimHistograms/hNPatches";
761  title = histname + ";#it{N}_{patches};type";
762  fHistManager.CreateTH2(histname.Data(), title.Data(), 200, 0, 200, 2, -0.5, 1.5);
763 
764  // patch E vs. centrality
765  histname = "TriggerSimHistograms/hPatchE";
766  title = histname + ";Centrality (%);#it{E}_{patch} (GeV)";
767  fHistManager.CreateTH2(histname.Data(), title.Data(), 50, 0, 100, nPtBins, 0, fMaxPt);
768 
769  // patch median vs. Centrality
770  histname = "TriggerSimHistograms/hPatchMedianE";
771  title = histname + ";Centrality (%);#it{E}_{patch,med} (GeV);type";
772  fHistManager.CreateTH3(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 50, 2, -0.5, 1.5);
773 
774  //----------------------------------------------
775  // Jet histograms for "triggered" events
776  AliJetContainer* jets = 0;
777  TIter nextJetColl(&fJetCollArray);
778  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
779 
780  // Jet rejection reason
781  histname = TString::Format("%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
782  title = histname + ";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
783  TH2* hist = fHistManager.CreateTH2(histname.Data(), title.Data(), 32, 0, 32, 50, 0, fMaxPt);
784  SetRejectionReasonLabels(hist->GetXaxis());
785 
786  // Rho vs. Centrality
787  if (!jets->GetRhoName().IsNull()) {
788  histname = TString::Format("%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
789  title = histname + ";Centrality (%);#rho (GeV/#it{c});counts";
790  fHistManager.CreateTH2(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 500);
791  }
792 
793  // (Centrality, pT, NEF)
794  Int_t nbinsx = 20; Int_t minx = 0; Int_t maxx = 100;
795  Int_t nbinsy = nPtBins; Int_t miny = 0; Int_t maxy = fMaxPt;
796  Int_t nbinsz = 50; Int_t minz = 0; Int_t maxz = 1.;
797 
798  histname = TString::Format("%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
799  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
800  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
801 
802  histname = TString::Format("%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
803  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
804  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
805 
806  // pT-leading vs. pT
807  histname = TString::Format("%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
808  title = histname + ";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
809  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, nPtBins, 0, fMaxPt);
810 
811  // A vs. pT
812  histname = TString::Format("%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
813  title = histname + ";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
814  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, 50, 0, 0.5);
815 
816  // (Centrality, pT, z-leading (charged))
817  nbinsx = 20; minx = 0; maxx = 100;
818  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
819  nbinsz = 50; minz = 0; maxz = 1.;
820 
821  histname = TString::Format("%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
822  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
823  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
824 
825  histname = TString::Format("%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
826  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
827  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
828 
829  // z (charged) vs. pT
830  nbinsx = 20; minx = 0; maxx = 100;
831  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
832  nbinsz = 50; minz = 0; maxz = 1.;
833 
834  histname = TString::Format("%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
835  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
836  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
837 
838  histname = TString::Format("%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
839  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
840  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
841 
842  // (Centrality, pT, Nconst)
843  nbinsx = 20; minx = 0; maxx = 100;
844  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
845  nbinsz = 50; minz = 0; maxz = fMaxPt;
846 
847  histname = TString::Format("%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
848  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
849  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
850 
851  histname = TString::Format("%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
852  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
853  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
854 
855  }
856 }
857 
858 /*
859  * This function allocates histograms for matched truth-det jets in the case of embedding.
860  * The jet matching information must be previously filled by another task, such as AliJetResponseMaker.
861  */
863 {
864  TString histname;
865  TString title;
866  Int_t nPtBins = TMath::CeilNint(fMaxPt/2);
867 
868  // Response matrix, (centrality, pT-truth, pT-det)
869  Int_t nbinsx = 20; Int_t minx = 0; Int_t maxx = 100;
870  Int_t nbinsy = fMaxPt; Int_t miny = 0; Int_t maxy = fMaxPt;
871  Int_t nbinsz = fMaxPt; Int_t minz = 0; Int_t maxz = fMaxPt;
872 
873  histname = "MatchedJetHistograms/hResponseMatrixEMCal";
874  title = histname + ";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
875  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
876 
877  histname = "MatchedJetHistograms/hResponseMatrixDCal";
878  title = histname + ";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
879  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
880 
881  // JES shift, (centrality, pT-truth, (pT-det - pT-truth) / pT-truth)
882  nbinsx = 20; minx = 0; maxx = 100;
883  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
884  nbinsz = 250; minz = -5.; maxz = 5.;
885 
886  histname = "MatchedJetHistograms/hJESshiftEMCal";
887  title = histname + ";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
888  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
889 
890  histname = "MatchedJetHistograms/hJESshiftDCal";
891  title = histname + ";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
892  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
893 
894  // NEF of det-level matched jets, (centrality, pT-truth, NEF)
895  nbinsx = 20; minx = 0; maxx = 100;
896  nbinsy = fMaxPt; miny = 0; maxy = fMaxPt;
897  nbinsz = 50; minz = 0; maxz = 1.;
898 
899  histname = "MatchedJetHistograms/hNEFVsPt";
900  title = histname + ";Centrality (%);#it{p}_{T,corr}^{det} (GeV/#it{c});Calo energy fraction";
901  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
902 
903  // z-leading (charged) of det-level matched jets, (centrality, pT-truth, z-leading)
904  nbinsx = 20; minx = 0; maxx = 100;
905  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
906  nbinsz = 50; minz = 0; maxz = 1.;
907 
908  histname = "MatchedJetHistograms/hZLeadingVsPt";
909  title = histname + ";Centrality (%);#it{p}_{T,corr}^{det} (GeV/#it{c});#it{z}_{leading}";
910  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
911 
912  // Matching distance, (centrality, pT-truth, R)
913  nbinsx = 20; minx = 0; maxx = 100;
914  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
915  nbinsz = 50; minz = 0; maxz = 1.;
916 
917  histname = "MatchedJetHistograms/hMatchingDistance";
918  title = histname + ";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});R";
919  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
920 
921  histname = "MatchedJetHistograms/hMatchingDistancepp";
922  title = histname + ";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});R";
923  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
924 
925  // Jet matching QA (copied from AliAnalysisTaskEmcalJetHCorrelations.cxx)
926  histname = "MatchedJetHistograms/fHistJetMatchingQA";
927  title = histname;
928  std::vector<std::string> binLabels = {"noMatch", "matchedJet", "sharedMomentumFraction", "partLevelMatchedJet", "jetDistance", "passedAllCuts"};
929  auto histMatchedJetCuts = fHistManager.CreateTH1(histname.Data(), title.Data(), binLabels.size(), 0, binLabels.size());
930  // Set label names
931  for (unsigned int i = 1; i <= binLabels.size(); i++) {
932  histMatchedJetCuts->GetXaxis()->SetBinLabel(i, binLabels.at(i-1).c_str());
933  }
934  histMatchedJetCuts->GetYaxis()->SetTitle("Number of jets");
935 
936 }
937 
943 {
944  // Configure base class to set fTriggerPatchInfo to array of trigger patches, each event
945  // (Need to call this before base class ExecOnce)
946  if (fDoTriggerSimulation) {
947  this->SetCaloTriggerPatchInfoName("EmcalTriggers");
948  }
949 
951 
952  fNeedEmcalGeom = kTRUE;
953 
954  // Check if trigger patches are loaded
955  if (fDoTriggerSimulation) {
956  if (fTriggerPatchInfo) {
957  TString objname(fTriggerPatchInfo->GetClass()->GetName());
958  TClass cls(objname);
959  if (!cls.InheritsFrom("AliEMCALTriggerPatchInfo")) {
960  AliError(Form("%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
961  GetName(), cls.GetName(), "EmcalTriggers"));
962  fTriggerPatchInfo = 0;
963  }
964  }
965  if (!fTriggerPatchInfo) {
966  AliError(Form("%s: Unable to get trigger patch container with name %s. Aborting", GetName(), "EmcalTriggers"));
967  return;
968  }
969  }
970 }
971 
976 
977  // Get the downscaling factors for MB triggers (to be used to calculate trigger efficiency)
978 
980 
981  // Get instance of the downscale factor helper class
983  downscaleOCDB->SetRun(InputEvent()->GetRunNumber());
984 
985  // There are two possible min bias triggers for LHC15o
986  TString triggerNameMB1 = "CINT7-B-NOPF-CENT";
987  TString triggerNameMB2 = "CV0L7-B-NOPF-CENT";
988  TString triggerNameJE = "CINT7EJ1-B-NOPF-CENTNOPMD";
989 
990  // Get the downscale factor for whichever MB trigger exists in the given run
991  std::vector<TString> runtriggers = downscaleOCDB->GetTriggerClasses();
992  Double_t downscalefactor;
993  for (auto i : runtriggers) {
994  if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
995  downscalefactor = downscaleOCDB->GetDownscaleFactorForTriggerClass(i.Data());
996  break;
997  }
998  }
999 
1000  // Store the inverse of the downscale factor, used later to weight the pT spectrum
1001  fMBUpscaleFactor = 1/downscalefactor;
1002 
1003  TString histname = "Trigger/hMBDownscaleFactor";
1004  fHistManager.FillTH1(histname.Data(), fMBUpscaleFactor);
1005 
1006  }
1007 
1008 }
1009 
1014 {
1015  if (fUseAliEventCuts) {
1016  if (!fEventCuts.AcceptEvent(InputEvent()))
1017  {
1018  PostData(1, fOutput);
1019  return kFALSE;
1020  }
1021  }
1022  else {
1024  }
1025  return kTRUE;
1026 }
1027 
1036 {
1037  TString histname;
1038  AliJetContainer* jetCont = 0;
1039  TIter next(&fJetCollArray);
1040  while ((jetCont = static_cast<AliJetContainer*>(next()))) {
1041  TString jetContName = jetCont->GetName();
1042 
1043  // Do a simple trigger simulation (if requested)
1044  if (fDoTriggerSimulation) {
1046  }
1047 
1048  }
1049 
1050  // Compute the full jet background scale factor and delta-pt
1051  if (fComputeBackground) {
1053  }
1054 
1055  // Only fill the embedding qa plots if:
1056  // - We are using the embedding helper
1057  // - The class has been initialized
1058  // - Both jet collections are available
1059  if (fEmbeddingQA.IsInitialized()) {
1061  }
1062 
1063  return kTRUE;
1064 }
1065 
1070 {
1071  TString histname;
1072 
1073  // Check if trigger patches are loaded
1074  if (fTriggerPatchInfo) {
1075  TString objname(fTriggerPatchInfo->GetClass()->GetName());
1076  TClass cls(objname);
1077  if (!cls.InheritsFrom("AliEMCALTriggerPatchInfo")) {
1078  AliError(Form("%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1079  GetName(), cls.GetName(), "EmcalTriggers"));
1080  fTriggerPatchInfo = 0;
1081  }
1082  }
1083  if (!fTriggerPatchInfo) {
1084  AliError(Form("%s: Unable to get trigger patch container with name %s. Aborting", GetName(), "EmcalTriggers"));
1085  return;
1086  }
1087 
1088  // Compute patches in EMCal, DCal (I want offline simple trigger patch, i.e. patch calculated using FEE energy)
1089  std::vector<Double_t> vecEMCal;
1090  std::vector<Double_t> vecDCal;
1091  for(auto p : *fTriggerPatchInfo){
1092  AliEMCALTriggerPatchInfo *recpatch = static_cast<AliEMCALTriggerPatchInfo *>(p);
1093  if (recpatch) {
1094 
1095  if(!recpatch->IsJetHighSimple()) continue;
1096 
1097  histname = "TriggerSimHistograms/hEtaVsPhi";
1098  fHistManager.FillTH2(histname.Data(), recpatch->GetEtaGeo(), recpatch->GetPhiGeo());
1099 
1100  histname = "TriggerSimHistograms/hPatchE";
1101  fHistManager.FillTH2(histname.Data(), fCent, recpatch->GetPatchE());
1102 
1103  if (recpatch->IsEMCal()) {
1104  vecEMCal.push_back(recpatch->GetPatchE());
1105  } else {
1106  vecDCal.push_back(recpatch->GetPatchE());
1107  }
1108 
1109  }
1110  }
1111 
1112  // Compute the median in each calorimeter
1113  const Int_t nBkgPatchesEMCal = vecEMCal.size(); // 6*8;
1114  const Int_t nBkgPatchesDCal = vecDCal.size(); // 4*5;
1115  fMedianEMCal = TMath::Median(nBkgPatchesEMCal, &vecEMCal[0]); // point to array used internally by vector
1116  fMedianDCal = TMath::Median(nBkgPatchesDCal, &vecDCal[0]);
1117 
1118  histname = "TriggerSimHistograms/hPatchMedianE";
1119  fHistManager.FillTH3(histname.Data(), fCent, fMedianEMCal, kEMCal);
1120  fHistManager.FillTH3(histname.Data(), fCent, fMedianDCal, kDCal);
1121 
1122  histname = "TriggerSimHistograms/hNPatches";
1123  fHistManager.FillTH2(histname.Data(), nBkgPatchesEMCal, kEMCal);
1124  fHistManager.FillTH2(histname.Data(), nBkgPatchesDCal, kDCal);
1125 
1126  // Then compute background subtracted patches, by subtracting from each patch the median patch E from the opposite hemisphere
1127  // If a patch is above threshold, the event is "triggered"
1128  Bool_t fkEMCEJE = kFALSE;
1129  Double_t threshold = 20;
1130  for(auto p : *fTriggerPatchInfo){
1131  AliEMCALTriggerPatchInfo *recpatch = static_cast<AliEMCALTriggerPatchInfo *>(p);
1132  if (recpatch) {
1133 
1134  if(!recpatch->IsJetHighSimple()) continue;
1135 
1136  if (recpatch->IsEMCal()) {
1137  if ((recpatch->GetPatchE() - fMedianDCal) > threshold) {
1138  fkEMCEJE = kTRUE;
1139  break;
1140  }
1141  } else {
1142  if ((recpatch->GetPatchE() - fMedianEMCal) > threshold) {
1143  fkEMCEJE = kTRUE;
1144  break;
1145  }
1146  }
1147  }
1148  }
1149 
1150  if (fkEMCEJE) {
1152  }
1153 
1154 }
1155 
1163 {
1164 
1165  if (fPlotJetHistograms) {
1167  }
1168  if (fPlotClusterHistograms) {
1170  }
1173  }
1176  }
1177 
1178  return kTRUE;
1179 }
1180 
1186 {
1187  TString histname;
1188  AliJetContainer* jets = 0;
1189  TIter nextJetColl(&fJetCollArray);
1190  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1191  TString jetContName = jets->GetName();
1192 
1193  Double_t rhoVal = 0;
1194  if (jets->GetRhoParameter()) {
1195  rhoVal = jets->GetRhoVal();
1196  histname = TString::Format("%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1197  fHistManager.FillTH2(histname.Data(), fCent, rhoVal);
1198  }
1199 
1200  for (auto jet : jets->all()) {
1201 
1202  Float_t ptLeading = jets->GetLeadingHadronPt(jet);
1203  Float_t corrPt = GetJetPt(jet, rhoVal);
1204 
1205  // A vs. pT (fill before area cut)
1206  histname = TString::Format("%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1207  fHistManager.FillTH2(histname.Data(), corrPt, jet->Area());
1208 
1209 
1210  // Rejection reason
1211  UInt_t rejectionReason = 0;
1212  if (!jets->AcceptJet(jet, rejectionReason)) {
1213  histname = TString::Format("%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1214  fHistManager.FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
1215  continue;
1216  }
1217 
1218  // compute jet acceptance type
1219  Double_t type = GetJetType(jet);
1220  if ( (type != kEMCal) && (type != kDCal) ) {
1221  continue;
1222  }
1223 
1224  // (Centrality, pT, NEF)
1225  if (type == kEMCal) {
1226  histname = TString::Format("%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
1227  }
1228  else if (type == kDCal) {
1229  histname = TString::Format("%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
1230  }
1231  fHistManager.FillTH3(histname, fCent, corrPt, jet->NEF());
1232 
1233  // (Centrality, pT upscaled, calo type)
1234  if (fComputeMBDownscaling) {
1235  histname = TString::Format("%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1236  fHistManager.FillTH3(histname.Data(), fCent, corrPt, type, fMBUpscaleFactor);
1237  }
1238 
1239  // pT-leading vs. pT
1240  histname = TString::Format("%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1241  fHistManager.FillTH2(histname.Data(), corrPt, ptLeading);
1242 
1243  // (Centrality, pT, z-leading (charged))
1244  if (type == kEMCal) {
1245  histname = TString::Format("%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1246  }
1247  else if (type == kDCal) {
1248  histname = TString::Format("%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1249  }
1250  TLorentzVector leadPart;
1251  jets->GetLeadingHadronMomentum(leadPart, jet);
1252  Double_t z = GetParallelFraction(leadPart.Vect(), jet);
1253  if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999; // so that it will contribute to the bin <1
1254  fHistManager.FillTH3(histname, fCent, corrPt, z);
1255 
1256  // (Centrality, pT, z (charged))
1257  if (type == kEMCal) {
1258  histname = TString::Format("%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1259  }
1260  else if (type == kDCal) {
1261  histname = TString::Format("%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1262  }
1263  const AliVTrack* track;
1264  for (Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1265  track = static_cast<AliVTrack*>(jet->Track(i));
1266  z = track->Pt() / TMath::Abs(corrPt);
1267  fHistManager.FillTH3(histname, fCent, corrPt, z);
1268  }
1269 
1270  // (Centrality, pT, Nconst)
1271  if (type == kEMCal) {
1272  histname = TString::Format("%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1273  }
1274  else if (type == kDCal) {
1275  histname = TString::Format("%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1276  }
1277  fHistManager.FillTH3(histname, fCent, corrPt, 1.*jet->GetNumberOfConstituents());
1278 
1279  // (Centrality, jet pT, Enonlincorr - Ehadcorr)
1280  Double_t deltaEhadcorr = 0;
1281  const AliVCluster* clus = nullptr;
1282  Int_t nClusters = jet->GetNumberOfClusters();
1283  for (Int_t iClus = 0; iClus < nClusters; iClus++) {
1284  clus = jet->Cluster(iClus);
1285  deltaEhadcorr += (clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy());
1286  }
1287 
1288  histname = TString::Format("%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
1289  fHistManager.FillTH3(histname, fCent, corrPt, deltaEhadcorr);
1290 
1291 
1292  // (Median patch energy, calo type, jet pT, centrality)
1293  if (fDoTriggerSimulation) {
1294  histname = TString::Format("%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
1295  Double_t x[4] = {fMedianEMCal, kEMCal, corrPt, fCent};
1296  fHistManager.FillTHnSparse(histname, x);
1297  Double_t y[4] = {fMedianDCal, kDCal, corrPt, fCent};
1298  fHistManager.FillTHnSparse(histname, y);
1299  }
1300 
1301  } //jet loop
1302 
1303  }
1304 }
1305 
1306 /*
1307  * This function fills the histograms for the calorimeter performance study.
1308  */
1310 {
1311  TString histname;
1312 
1313  // Loop through clusters
1315  const AliVCluster* clus;
1316  for (auto it : clusters->accepted_momentum()) {
1317 
1318  clus = it.second;
1319  Double_t clusPhi = it.first.Phi_0_2pi();
1320  Double_t clusEta = it.first.Eta();
1321 
1322  // Include only EMCal/DCal clusters
1323  if (!clus->IsEMCAL()) {
1324  continue;
1325  }
1326 
1327  // Compute the sum of matched track momentum, and various track matching / hadronic corretion quantities
1328  Double_t trackPSum = 0;
1329  Int_t nTracksMatched = 0;
1330  const AliVTrack* track = nullptr;
1331  for (Int_t itrack=0; itrack < clus->GetNTracksMatched(); itrack++) {
1332  track = dynamic_cast<AliVTrack*>(clus->GetTrackMatched(itrack));
1333  if (!track) {
1334  continue;
1335  }
1336 
1337  Double_t trackPhi = TVector2::Phi_0_2pi(track->GetTrackPhiOnEMCal());
1338  Double_t trackEta = track->GetTrackEtaOnEMCal();
1339  Double_t deta = TMath::Abs(clusEta - trackEta);
1340  Double_t dphi = TMath::Abs(clusPhi - trackPhi);
1341 
1343  trackPSum += track->P();
1344  nTracksMatched++;
1345  }
1346  }
1347 
1348  Double_t EoverP = 0;
1349  if (trackPSum > 1e-3) {
1350  EoverP = clus->GetNonLinCorrEnergy() / trackPSum;
1351  }
1352 
1353  Double_t deltaE = clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy();
1354  Double_t Rcorr = 0;
1355  if (trackPSum > 1e-3) {
1356  Rcorr = deltaE / trackPSum;
1357  }
1358  Double_t RcorrClus = deltaE / clus->GetNonLinCorrEnergy();
1359 
1362 
1363  // Fill M02 distribution (centrality, Eclus nonlincorr, M02)
1364  histname = "ClusterHistograms/hM02";
1365  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), clus->GetM02());
1366 
1367  // Plot Ncell distribution for M02 > 0.4 or M02 < 0.4 (centrality, Eclus nonlincorr, Ncells)
1368  if (clus->GetM02() > 0.4) {
1369  histname = "ClusterHistograms/hNcellsM02G04";
1370  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), clus->GetNCells());
1371  }
1372  if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1373  histname = "ClusterHistograms/hNcellsM02L04";
1374  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), clus->GetNCells());
1375  }
1376 
1379 
1380  // Plot matched track pT (centrality, Eclus nonlincorr, trackPsum)
1381  histname = "ClusterHistograms/hMatchedTrackPt";
1382  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), trackPSum);
1383 
1384  if (clus->GetM02() > 0.4) {
1385  histname = "ClusterHistograms/hMatchedTrackPtM02G04";
1386  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), trackPSum);
1387  }
1388  if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1389  histname = "ClusterHistograms/hMatchedTrackPtM02L04";
1390  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), trackPSum);
1391  }
1392 
1393  // Plot number of matched tracks (centrality, Eclus nonlincorr, N matches)
1394  histname = "ClusterHistograms/hMatchedTrackN";
1395  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), nTracksMatched);
1396 
1397  if (clus->GetM02() > 0.4) {
1398  histname = "ClusterHistograms/hMatchedTrackNM02G04";
1399  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), nTracksMatched);
1400  }
1401  if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1402  histname = "ClusterHistograms/hMatchedTrackNM02L04";
1403  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), nTracksMatched);
1404  }
1405 
1406  // Plot M02 distribution for clusters with matched tracks (centrality, Eclus nonlincorr, M02)
1407  histname = "ClusterHistograms/hM02Matched";
1408  if (nTracksMatched > 0) {
1409  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), clus->GetM02());
1410  }
1411 
1412  // Plot M02 distribution for clusters without matched tracks (centrality, Eclus nonlincorr, M02)
1413  histname = "ClusterHistograms/hM02Unmatched";
1414  if (nTracksMatched == 0) {
1415  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), clus->GetM02());
1416  }
1417 
1418  // Plot clus-track deltaEta if there is one matched track (deltaEta, Eclus, M02)
1419  if (nTracksMatched == 1) {
1420 
1421  const AliVTrack* track = dynamic_cast<AliVTrack*>(clus->GetTrackMatched(0));
1422  if (track) {
1423  Double_t trackEta = track->GetTrackEtaOnEMCal();
1424  Double_t deta = trackEta - clusEta;
1425 
1426  if (fCent > 0 && fCent < 10) {
1427  histname = "ClusterHistograms/hDeltaEtaCentral";
1428  fHistManager.FillTH3(histname.Data(), deta, clus->GetNonLinCorrEnergy(), clus->GetM02());
1429  }
1430 
1431  if (fCent > 50 && fCent < 90) {
1432  histname = "ClusterHistograms/hDeltaEtaPeripheral";
1433  fHistManager.FillTH3(histname.Data(), deta, clus->GetNonLinCorrEnergy(), clus->GetM02());
1434  }
1435  }
1436  }
1437 
1440 
1441  // Plot E/p vs. M02 for 0-10% and 50-90% (Eclus nonlincorr, Eclus nonlincorr / trackPsum, M02)
1442  if (fCent > 0 && fCent < 10) {
1443  histname = "ClusterHistograms/hEoverPM02Central";
1444  fHistManager.FillTH3(histname, clus->GetNonLinCorrEnergy(), EoverP, clus->GetM02());
1445  }
1446  if (fCent > 50 && fCent < 90) {
1447  histname = "ClusterHistograms/hEoverPM02Peripheral";
1448  fHistManager.FillTH3(histname, clus->GetNonLinCorrEnergy(), EoverP, clus->GetM02());
1449  }
1450 
1453 
1454  // Fill Rcorr distribution (centrality, trackPSum, Rcorr = (Enonlincorr - Ehadcorr) / trackPSum)
1455  histname = "ClusterHistograms/hRcorrVsCent";
1456  fHistManager.FillTH3(histname, fCent, trackPSum, Rcorr);
1457 
1458  // Fill Rcorr distribution for 0-10% centrality (Eclus nonlincorr, trackPSum, Rcorr)
1459  if (fCent > 0 && fCent < 10) {
1460  histname = "ClusterHistograms/hRcorr0-10";
1461  fHistManager.FillTH3(histname, clus->GetNonLinCorrEnergy(), trackPSum, Rcorr);
1462  }
1463 
1464  // Fill Rcorr distribution for 50-90% centrality (Eclus nonlincorr, trackPSum, Rcorr)
1465  if (fCent > 50 && fCent < 90) {
1466  histname = "ClusterHistograms/hRcorr50-90";
1467  fHistManager.FillTH3(histname, clus->GetNonLinCorrEnergy(), trackPSum, Rcorr);
1468  }
1469 
1470  // Fill also Rcorr-clus (centrality, trackPSum, Rcorr-clus = (Enonlincorr - Ehadcorr) / Enonlincorr )
1471  histname = "ClusterHistograms/hRcorrClusVsCent";
1472  fHistManager.FillTH3(histname, fCent, trackPSum, RcorrClus);
1473 
1474  // Fill Rcorr-clus for 0-10% centrality (Eclus nonlincorr, trackPSum, Rcorr-clus = (Enonlincorr - Ehadcorr) / Enonlincorr )
1475  if (fCent > 0 && fCent < 10) {
1476  histname = "ClusterHistograms/hRcorrClus0-10";
1477  fHistManager.FillTH3(histname, clus->GetNonLinCorrEnergy(), trackPSum, RcorrClus);
1478  }
1479 
1480  // Fill Rcorr-clus for 50-90% centrality (Eclus nonlincorr, trackPSum, Rcorr-clus = (Enonlincorr - Ehadcorr) / Enonlincorr )
1481  if (fCent > 50 && fCent < 90) {
1482  histname = "ClusterHistograms/hRcorrClus50-90";
1483  fHistManager.FillTH3(histname, clus->GetNonLinCorrEnergy(), trackPSum, RcorrClus);
1484  }
1485 
1486  }
1487 
1488  // Fill total track multiplicity
1489  histname = "ClusterHistograms/hTrackMultiplicity";
1490  AliTrackContainer* trackCont = dynamic_cast<AliTrackContainer*>(GetParticleContainer("tracks"));
1491  Int_t nTracks = trackCont->GetNAcceptedTracks();
1492  fHistManager.FillTH2(histname.Data(), nTracks, fCent);
1493 
1494 }
1495 
1496 /*
1497  * This function fills particle composition histograms for the calorimeter performance study in MC.
1498  */
1500 {
1501  // If MC, get the MC event
1502  const AliMCEvent* mcevent = nullptr;
1503  if (fGeneratorLevel) {
1504  mcevent = MCEvent();
1505  }
1506  else {
1507  return;
1508  }
1509 
1510  // Loop through clusters, and plot M02 for each particle type
1512 
1513  // Loop through jets, to fill various histograms
1514  if (fPlotJetHistograms) {
1516  }
1517 
1518 }
1519 
1520 /*
1521  * Loop through clusters, and plot M02 for each particle type
1522  */
1524 {
1525  TString histname;
1527  const AliVCluster* clus;
1528  std::vector<ContributorType> vecContributorTypes;
1529  std::vector<Int_t> vecContributorLabels;
1530  for (auto it : clusters->accepted_momentum()) {
1531 
1532  clus = it.second;
1533 
1534  // Include only EMCal/DCal clusters (reject PHOS clusters)
1535  if (!clus->IsEMCAL()) {
1536  continue;
1537  }
1538 
1539  // Loop through the cluster's contributors in order to classify its type
1540  ParticleType particleType = kNotDefined;
1541  ContributorType contributorType = kUndefined;
1542  const Int_t nLabels = clus->GetNLabels();
1543 
1544  // Create a vector to store the contributor types for PhysicalPrimary particles
1545  vecContributorTypes.clear();
1546  vecContributorLabels.clear();
1547  for (Int_t iLabel=0; iLabel<nLabels; iLabel++) {
1548 
1549  Int_t label = clus->GetLabels()[iLabel];
1550  if (TMath::Abs(label) > 0) { // if the particle has a truth-level match, the label is nonzero
1551  contributorType = GetContributorType(clus, mcevent, label);
1552  if (contributorType != kUndefined) {
1553  vecContributorTypes.push_back(contributorType);
1554  vecContributorLabels.push_back(label);
1555  }
1556  }
1557  }
1558 
1559  Int_t nLabelsPhysPrim = vecContributorTypes.size();
1560 
1561  if (nLabelsPhysPrim == 1) {
1562 
1563  contributorType = vecContributorTypes[0];
1564 
1565  if (contributorType == kPhoton) {
1566  particleType = kSinglePhoton;
1567  }
1568  else if (contributorType == kElectron) {
1569  particleType = kSingleElectron;
1570  }
1571  else if (contributorType == kChargedPion) {
1572  particleType = kSingleChargedPion;
1573  }
1574  else if (contributorType == kProton) {
1575  particleType = kSingleProton;
1576  }
1577  else if (contributorType == kAntiProton) {
1578  particleType = kSingleAntiProton;
1579  }
1580  else if (contributorType == kChargedKaon) {
1581  particleType = kSingleChargedKaon;
1582  }
1583  else if (contributorType == kK0L) {
1584  particleType = kSingleK0L;
1585  }
1586  else if (contributorType == kNeutron) {
1587  particleType = kSingleNeutron;
1588  }
1589  else if (contributorType == kAntiNeutron) {
1590  particleType = kSingleAntiNeutron;
1591  }
1592  else {
1593  particleType = kSingleOther;
1594  }
1595 
1596  }
1597  else if (nLabelsPhysPrim == 2) {
1598 
1599  // Get the contributor particle types
1600  ContributorType contributorType1 = vecContributorTypes[0];
1601  ContributorType contributorType2 = vecContributorTypes[1];
1602 
1603  // Get the fraction of cluster energy from each contributor
1604  //Double_t frac0 = clus->GetClusterMCEdepFraction(0);
1605  Double_t frac1 = clus->GetClusterMCEdepFraction(1);
1606 
1607  // Check whether the leading/subleading contributors are photons/hadrons
1608  Bool_t isHadron1 = IsHadron(contributorType1);
1609  Bool_t isHadron2 = IsHadron(contributorType2);
1610  Bool_t isPhoton1 = contributorType1 == kPhoton;
1611  Bool_t isPhoton2 = contributorType2 == kPhoton;
1612 
1613  if (isHadron1 && isHadron2) {
1614  particleType = kHadronHadron;
1615  }
1616  else if (isPhoton1 && isHadron2) {
1617  particleType = kPhotonHadron;
1618 
1619  // Plot cluster energy when subleading hadron is subtracted
1620  Double_t photonEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
1621  histname = "ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
1622  fHistManager.FillTH3(histname.Data(), fCent, clus->GetM02(), photonEnergy);
1623  }
1624  else if (isHadron1 && isPhoton2) {
1625  particleType = kHadronPhoton;
1626 
1627  // Plot cluster energy when subleading hadron is subtracted
1628  Double_t hadronEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
1629  histname = "ClusterHistogramsMC/hHadronPhotonHadronEnergy";
1630  fHistManager.FillTH3(histname.Data(), fCent, clus->GetM02(), hadronEnergy);
1631  }
1632  else if (isPhoton1 && isPhoton2) {
1633 
1634  // By default, assume the two photons are not a merged pi0
1635  particleType = kPhotonPhotonOther;
1636 
1637  // Using the vector of accepted contributor labels, check whether the two photons are from the same pi0
1638  AliAODMCParticle *part1 = fGeneratorLevel->GetMCParticleWithLabel(vecContributorLabels[0]);
1639  AliAODMCParticle *part2 = fGeneratorLevel->GetMCParticleWithLabel(vecContributorLabels[1]);
1640  if (part1 && part2) {
1641  Int_t iMother1 = part1->GetMother();
1642  Int_t iMother2 = part2->GetMother();
1643  AliVParticle *mother1 = mcevent->GetTrack(iMother1);
1644  AliVParticle *mother2 = mcevent->GetTrack(iMother2);
1645 
1646  if (mother1 && mother2) {
1647  if ( (mother1->PdgCode() == 111) && (mother2->PdgCode() == 111) ) {
1648  if (iMother1 == iMother2) {
1649  particleType = kMergedPi0;
1650  }
1651  }
1652  }
1653  }
1654  }
1655  else {
1656  particleType = kTwoContributorsOther; // this includes partially contained conversion overlaps
1657  }
1658 
1659  }
1660  else if (nLabelsPhysPrim > 2) {
1661  particleType = kMoreThanTwoContributors;
1662  }
1663 
1664  // (M02, Eclus, part type)
1665  if (fCent > 0 && fCent < 10) {
1666  histname = "ClusterHistogramsMC/hM02VsParticleTypeCentral";
1667  fHistManager.FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
1668  }
1669  if (fCent > 50 && fCent < 90) {
1670  histname = "ClusterHistogramsMC/hM02VsParticleTypePeripheral";
1671  fHistManager.FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
1672  }
1673 
1674  }
1675 }
1676 
1677 /*
1678  * Loop through jets, to fill particle composition histograms.
1679  */
1681 {
1682  TString histname;
1683 
1684  const AliVCluster* clus;
1685  AliJetContainer* jets = GetJetContainer(0); // there is only a single, det-level jet finder here
1686  for (const auto jet : jets->accepted()) {
1687 
1688  Double_t jetPt = GetJetPt(jet, 0);
1689 
1690  // Keep track of hadronic calo energy in each jet
1691  Double_t hadCaloEnergyUnmatched = 0;
1692  Double_t hadCaloEnergyMatchedNonlincorr = 0;
1693  Double_t hadCaloEnergyMatchedHadCorr = 0;
1694 
1695  // Loop through clusters in each jet, to plot several histograms
1696  Int_t nClusters = jet->GetNumberOfClusters();
1697  for (Int_t iClus = 0; iClus < nClusters; iClus++) {
1698 
1699  clus = jet->Cluster(iClus);
1700 
1701  // Get the particle type of the cluster
1702  ContributorType contributorType = kUndefined;
1703  Int_t label = TMath::Abs(clus->GetLabel());
1704  if (label > 0) {
1705  contributorType = GetContributorType(clus, mcevent, label);
1706  }
1707 
1708  // Plot M02 for each particle type
1709  histname = "JetPerformanceMC/hM02VsContributorTypeJets";
1710  Double_t x[4] = {clus->GetM02(), clus->GetNonLinCorrEnergy(), contributorType, jetPt};
1711  fHistManager.FillTHnSparse(histname, x);
1712 
1713  // If the cluster is a hadron, sum its energy to compute the jet's hadronic calo energy
1714  Bool_t isHadron = IsHadron(contributorType);
1715  if (isHadron) {
1716  Bool_t hasMatchedTrack = (clus->GetNTracksMatched() > 0);
1717  //Bool_t hasMatchedTrack = ((clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy()) > 1e-3);
1718  if (hasMatchedTrack) {
1719  hadCaloEnergyMatchedNonlincorr += clus->GetNonLinCorrEnergy();
1720  hadCaloEnergyMatchedHadCorr += clus->GetHadCorrEnergy();
1721  }
1722  else {
1723  hadCaloEnergyUnmatched += clus->GetNonLinCorrEnergy();
1724  }
1725  }
1726 
1727  }
1728 
1729  // Fill hadronic calo energy in each jet
1730 
1731  // (Jet pT, Summed energy of hadronic clusters without a matched track)
1732  histname = "JetPerformance/hHadCaloEnergyUnmatched";
1733  fHistManager.FillTH2(histname, jetPt, hadCaloEnergyUnmatched);
1734 
1735  // (Jet pT vs. Summed energy of hadronic clusters with a matched track (before hadronic correction))
1736  histname = "JetPerformance/hHadCaloEnergyMatchedNonlincorr";
1737  fHistManager.FillTH2(histname, jetPt, hadCaloEnergyMatchedNonlincorr);
1738 
1739  // (Jet pT vs. Summed energy of hadronic clusters with a matched track (after hadronic correction))
1740  histname = "JetPerformance/hHadCaloEnergyMatchedHadCorr";
1741  fHistManager.FillTH2(histname, jetPt, hadCaloEnergyMatchedHadCorr);
1742 
1743  // Loop through particle types, and plot jet composition for each particle type
1744  histname = "JetPerformanceMC/hJetComposition";
1745  for (Int_t type = 0; type < 8; type++) {
1746 
1747  ContributorType contributorType = kUndefined;
1748  Double_t nSum = 0;
1749  Double_t pTsum = 0;
1750 
1751  // Loop through clusters in jet, and add to sum if cluster matches particle type
1752  for (Int_t iClus = 0; iClus < nClusters; iClus++) {
1753 
1754  clus = jet->Cluster(iClus);
1755 
1756  Int_t label = TMath::Abs(clus->GetLabel());
1757  if (label > 0) {
1758  contributorType = GetContributorType(clus, mcevent, label);
1759  }
1760 
1761  if (type == contributorType) {
1762  nSum++;
1763  pTsum += clus->GetNonLinCorrEnergy();
1764  }
1765  }
1766 
1767  // Fill jet composition histogram
1768  Double_t x[4] = {jetPt, 1.*type, nSum, pTsum};
1769  fHistManager.FillTHnSparse(histname, x);
1770 
1771  }
1772  }
1773 }
1774 
1779 {
1780  // Loop over tracks and clusters in order to:
1781  // (1) Compute scale factor for full jets
1782  // (2) Compute delta-pT for full jets, with the random cone method
1783 
1784  // Define the acceptance boundaries for the TPC and EMCal/DCal/PHOS
1785  Double_t etaTPC = 0.9;
1786  Double_t etaEMCal = 0.7;
1787  Double_t etaMinDCal = 0.22;
1788  Double_t phiMinEMCal = fGeom->GetArm1PhiMin() * TMath::DegToRad(); // 80
1789  Double_t phiMaxEMCal = fGeom->GetEMCALPhiMax() * TMath::DegToRad(); // ~188
1790  Double_t phiMinDCal = fGeom->GetDCALPhiMin() * TMath::DegToRad(); // 260
1791  Double_t phiMaxDCal = fGeom->GetDCALPhiMax() * TMath::DegToRad(); // ~327 (1/3 SMs start at 320)
1792 
1793  Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
1794  Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
1795  Double_t accDCal = 2 * (etaEMCal - etaMinDCal) * (phiMaxDCal - phiMinDCal);
1796 
1797  // Loop over jet containers
1798  AliJetContainer* jetCont = 0;
1799  TIter nextJetColl(&fJetCollArray);
1800  while ((jetCont = static_cast<AliJetContainer*>(nextJetColl()))) {
1801 
1802  // Define fiducial acceptances, to be used to generate random cones, and for scale factor studies
1803  TRandom3* r = new TRandom3(0);
1804  Double_t jetR = jetCont->GetJetRadius();
1805  Double_t etaEMCalfid = etaEMCal - jetR;
1806  Double_t etaMinDCalfid = etaMinDCal + jetR;
1807  Double_t phiMinEMCalfid = phiMinEMCal + jetR;
1808  Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
1809  Double_t phiMinDCalfid = phiMinDCal + jetR;
1810  Double_t phiMaxDCalfid = phiMaxDCal - jetR;
1811  Double_t accEMCalfid = 2 * etaEMCalfid * (phiMaxEMCalfid - phiMinEMCalfid);
1812  Double_t accDCalfid = 2 * (etaEMCalfid - etaMinDCalfid) * (phiMaxDCalfid - phiMinDCalfid);
1813  if ( (etaEMCalfid - etaMinDCalfid) < 0) {
1814  accDCalfid = 0;
1815  }
1816 
1817  // Generate EMCal random cone eta-phi
1818  Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
1819  Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
1820 
1821  // Generate DCal random cone eta-phi
1822  Double_t etaDCalRC = r->Uniform(etaMinDCalfid, etaEMCalfid);
1823  Double_t sign = r->Uniform(-1., 1.);
1824  if (sign < 0) {
1825  etaDCalRC = -1*etaDCalRC;
1826  }
1827  Double_t phiDCalRC = r->Uniform(phiMinDCalfid, phiMaxDCalfid);
1828 
1829  // Initialize the various sums to 0
1830  Double_t trackPtSumTPC = 0;
1831  Double_t trackPtSumEMCal = 0;
1832  Double_t trackPtSumEMCalfid = 0;
1833  Double_t trackPtSumDCal = 0;
1834  Double_t trackPtSumDCalfid = 0;
1835  Double_t trackPtSumEMCalRC = 0;
1836  Double_t trackPtSumDCalRC = 0;
1837  Double_t clusPtSumEMCal = 0;
1838  Double_t clusPtSumEMCalfid = 0;
1839  Double_t clusPtSumDCal = 0;
1840  Double_t clusPtSumDCalfid = 0;
1841  Double_t clusPtSumEMCalRC = 0;
1842  Double_t clusPtSumDCalRC = 0;
1843 
1844  // Loop over tracks. Sum the track pT:
1845  // (1) in the entire TPC, (2) in the EMCal, (3) in the EMCal fiducial volume, (4) in the DCal, (5) in the DCal fiducial volume, (6) in the EMCal random cone, (7) in the DCal random cone
1846  // Note: Loops over all det-level track containers. For data there should be only one. For embedding, there should be signal+background tracks.
1847  AliParticleContainer * partCont = 0;
1848  AliTLorentzVector track;
1849  Double_t trackEta;
1850  Double_t trackPhi;
1851  Double_t trackPt;
1852  Double_t deltaR;
1853  TIter nextPartCont(&fParticleCollArray);
1854  while ((partCont = static_cast<AliParticleContainer*>(nextPartCont()))) {
1855 
1856  TString partContName = partCont->GetName();
1857  if (!partContName.CompareTo("tracks")) {
1858 
1859  AliTrackContainer* trackCont = dynamic_cast<AliTrackContainer*>(partCont);
1860  for (auto trackIterator : trackCont->accepted_momentum() ) {
1861 
1862  track.Clear();
1863  track = trackIterator.first;
1864  trackEta = track.Eta();
1865  trackPhi = track.Phi_0_2pi();
1866  trackPt = track.Pt();
1867 
1868  // (1)
1869  if (TMath::Abs(trackEta) < etaTPC) {
1870  trackPtSumTPC += trackPt;
1871  }
1872 
1873  // (2)
1874  if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
1875  trackPtSumEMCal += trackPt;
1876  }
1877 
1878  // (3)
1879  if (TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinEMCalfid && trackPhi < phiMaxEMCalfid) {
1880  trackPtSumEMCalfid += trackPt;
1881  }
1882 
1883  // (4)
1884  if (TMath::Abs(trackEta) > etaMinDCal && TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinDCal && trackPhi < phiMaxDCal) {
1885  trackPtSumDCal += trackPt;
1886  }
1887 
1888  // (5)
1889  if (TMath::Abs(trackEta) > etaMinDCalfid && TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinDCalfid && trackPhi < phiMaxDCalfid) {
1890  trackPtSumDCalfid += trackPt;
1891  }
1892 
1893  // (6)
1894  deltaR = GetDeltaR(&track, etaEMCalRC, phiEMCalRC);
1895  if (deltaR < jetR) {
1896  trackPtSumEMCalRC += trackPt;
1897  }
1898 
1899  // (7)
1900  deltaR = GetDeltaR(&track, etaDCalRC, phiDCalRC);
1901  if (deltaR < jetR) {
1902  trackPtSumDCalRC += trackPt;
1903  }
1904  }
1905  }
1906  }
1907 
1908  // Loop over clusters, if the jet container is for full jets. Sum the cluster ET:
1909  // (1) in the EMCal, (2) in the EMCal fiducial volume, (3) in the DCal, (4), in the DCal fiducial volume, (5) in the EMCal random cone, (6) in the DCal random cone
1910  if (jetCont->GetClusterContainer()) {
1912 
1913  AliTLorentzVector clus;
1914  Double_t clusEta;
1915  Double_t clusPhi;
1916  Double_t clusPt;
1917  for (auto clusIterator : clusCont->accepted_momentum() ) {
1918 
1919  clus.Clear();
1920  clus = clusIterator.first;
1921  clusEta = clus.Eta();
1922  clusPhi = clus.Phi_0_2pi();
1923  clusPt = clus.Pt();
1924 
1925  // (1)
1926  if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
1927  clusPtSumEMCal += clusPt;
1928  }
1929 
1930  // (2)
1931  if (TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinEMCalfid && clusPhi < phiMaxEMCalfid) {
1932  clusPtSumEMCalfid += clusPt;
1933  }
1934 
1935  // (3)
1936  if (TMath::Abs(clusEta) > etaMinDCal && TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinDCal && clusPhi < phiMaxDCal) {
1937  clusPtSumDCal += clusPt;
1938  }
1939 
1940  // (4)
1941  if (TMath::Abs(clusEta) > etaMinDCalfid && TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinDCalfid && clusPhi < phiMaxDCalfid) {
1942  clusPtSumDCalfid += clusPt;
1943  }
1944 
1945  // (5)
1946  deltaR = GetDeltaR(&clus, etaEMCalRC, phiEMCalRC);
1947  if (deltaR < jetR) {
1948  clusPtSumEMCalRC += clusPt;
1949  }
1950 
1951  // (6)
1952  deltaR = GetDeltaR(&clus, etaDCalRC, phiDCalRC);
1953  if (deltaR < jetR) {
1954  clusPtSumDCalRC += clusPt;
1955  }
1956 
1957  }
1958  }
1959 
1960  // Compute the scale factor, as a function of centrality, for (1) EMCal, (2) EMCalfid, (3) DCal, (4) DCalfid
1961  // (1)
1962  Double_t numerator = (trackPtSumEMCal + clusPtSumEMCal) / accEMCal;
1963  Double_t denominator = trackPtSumTPC / accTPC;
1964  Double_t scaleFactor = numerator / denominator;
1965  TString histname = TString::Format("%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
1966  fHistManager.FillTH2(histname, fCent, scaleFactor);
1967 
1968  // (2)
1969  if (accEMCalfid > 1e-3) {
1970  numerator = (trackPtSumEMCalfid + clusPtSumEMCalfid) / accEMCalfid;
1971  scaleFactor = numerator / denominator;
1972  histname = TString::Format("%s/BackgroundHistograms/hScaleFactorEMCalFid", jetCont->GetArrayName().Data());
1973  fHistManager.FillTH2(histname, fCent, scaleFactor);
1974  }
1975 
1976  // (3)
1977  numerator = (trackPtSumDCal + clusPtSumDCal) / accDCal;
1978  scaleFactor = numerator / denominator;
1979  histname = TString::Format("%s/BackgroundHistograms/hScaleFactorDCal", jetCont->GetArrayName().Data());
1980  fHistManager.FillTH2(histname, fCent, scaleFactor);
1981 
1982  // (4)
1983  if (accDCalfid > 1e-3) {
1984  numerator = (trackPtSumDCalfid + clusPtSumDCalfid) / accDCalfid;
1985  scaleFactor = numerator / denominator;
1986  histname = TString::Format("%s/BackgroundHistograms/hScaleFactorDCalFid", jetCont->GetArrayName().Data());
1987  fHistManager.FillTH2(histname, fCent, scaleFactor);
1988  }
1989 
1990  // Compute delta pT, as a function of centrality
1991 
1992  // EMCal
1993  Double_t rho = jetCont->GetRhoVal();
1994  Double_t deltaPt = trackPtSumEMCalRC + clusPtSumEMCalRC - rho * TMath::Pi() * jetR * jetR;
1995  histname = TString::Format("%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
1996  fHistManager.FillTH2(histname, fCent, deltaPt);
1997 
1998  // DCal
1999  if (accDCalfid > 1e-3) {
2000  deltaPt = trackPtSumDCalRC + clusPtSumDCalRC - rho * TMath::Pi() * jetR * jetR;
2001  histname = TString::Format("%s/BackgroundHistograms/hDeltaPtDCal", jetCont->GetArrayName().Data());
2002  fHistManager.FillTH2(histname, fCent, deltaPt);
2003  }
2004 
2005  delete r;
2006 
2007  }
2008 
2009 }
2010 
2016 {
2017  TString histname;
2018  AliJetContainer* jets = 0;
2019  TIter nextJetColl(&fJetCollArray);
2020  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2021  TString jetContName = jets->GetName();
2022 
2023  Double_t rhoVal = 0;
2024  if (jets->GetRhoParameter()) {
2025  rhoVal = jets->GetRhoVal();
2026  histname = TString::Format("%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
2027  fHistManager.FillTH2(histname.Data(), fCent, rhoVal);
2028  }
2029 
2030  for (auto jet : jets->all()) {
2031 
2032  Float_t ptLeading = jets->GetLeadingHadronPt(jet);
2033  Float_t corrPt = GetJetPt(jet, rhoVal);
2034 
2035  // A vs. pT (fill before area cut)
2036  histname = TString::Format("%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
2037  fHistManager.FillTH2(histname.Data(), corrPt, jet->Area());
2038 
2039  // Rejection reason
2040  UInt_t rejectionReason = 0;
2041  if (!jets->AcceptJet(jet, rejectionReason)) {
2042  histname = TString::Format("%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
2043  fHistManager.FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
2044  continue;
2045  }
2046 
2047  // compute jet acceptance type
2048  Double_t type = GetJetType(jet);
2049  if ( (type != kEMCal) && (type != kDCal) ) {
2050  continue;
2051  }
2052 
2053  // (Centrality, pT, NEF, calo type)
2054  if (type == kEMCal) {
2055  histname = TString::Format("%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
2056  }
2057  else if (type == kDCal) {
2058  histname = TString::Format("%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
2059  }
2060  fHistManager.FillTH3(histname, fCent, corrPt, jet->NEF());
2061 
2062  // pT-leading vs. pT
2063  histname = TString::Format("%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
2064  fHistManager.FillTH2(histname.Data(), corrPt, ptLeading);
2065 
2066  // (Centrality, pT, z-leading (charged), calo type)
2067  if (type == kEMCal) {
2068  histname = TString::Format("%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
2069  }
2070  else if (type == kDCal) {
2071  histname = TString::Format("%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
2072  }
2073  TLorentzVector leadPart;
2074  jets->GetLeadingHadronMomentum(leadPart, jet);
2075  Double_t z = GetParallelFraction(leadPart.Vect(), jet);
2076  if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999; // so that it will contribute to the bin <1
2077  fHistManager.FillTH3(histname, fCent, corrPt, z);
2078 
2079  // (Centrality, pT, z (charged), calo type)
2080  if (type == kEMCal) {
2081  histname = TString::Format("%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
2082  }
2083  else if (type == kDCal) {
2084  histname = TString::Format("%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
2085  }
2086  const AliVTrack* track;
2087  for (Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
2088  track = static_cast<AliVTrack*>(jet->Track(i));
2089  z = track->Pt() / TMath::Abs(corrPt);
2090  fHistManager.FillTH3(histname, fCent, corrPt, z);
2091  }
2092 
2093  // (Centrality, pT, Nconst)
2094  if (type == kEMCal) {
2095  histname = TString::Format("%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
2096  }
2097  else if (type == kDCal) {
2098  histname = TString::Format("%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
2099  }
2100  fHistManager.FillTH3(histname, fCent, corrPt, 1.*jet->GetNumberOfConstituents());
2101 
2102  } //jet loop
2103 
2104  }
2105 }
2106 
2112 {
2113  TString histname;
2114  AliJetContainer* jets = 0;
2115  const AliEmcalJet* matchedPartLevelJet = nullptr;
2116  TIter nextJetColl(&fJetCollArray);
2117  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2118  TString jetContName = jets->GetName();
2119 
2120  // Only loop over jets in the detector-level jet container
2121  if (jetContName.Contains("mcparticles")) {
2122  continue;
2123  }
2124 
2125  Double_t rhoVal = 0;
2126  if (jets->GetRhoParameter()) {
2127  rhoVal = jets->GetRhoVal();
2128  }
2129 
2130  for (auto jet : jets->accepted()) {
2131 
2132  // Get the matched part-level jet, if one exists, subject to fMinSharedMomentumFraction, fMaxMatchedJetDistance criteria
2133  matchedPartLevelJet = GetMatchedPartLevelJet(jets, jet, "MatchedJetHistograms/fHistJetMatchingQA");
2134  if (!matchedPartLevelJet) {
2135  continue;
2136  }
2137 
2138  // compute jet acceptance type
2139  Double_t type = GetJetType(jet);
2140  if ( (type != kEMCal) && (type != kDCal) ) {
2141  continue;
2142  }
2143 
2144  Float_t detPt = GetJetPt(jet, rhoVal);
2145  Float_t truthPt = matchedPartLevelJet->Pt();
2146 
2147  // Fill response matrix (centrality, pT-truth, pT-det)
2148  if (type == kEMCal) {
2149  histname = "MatchedJetHistograms/hResponseMatrixEMCal";
2150  }
2151  else if (type == kDCal) {
2152  histname = "MatchedJetHistograms/hResponseMatrixDCal";
2153  }
2154  fHistManager.FillTH3(histname, fCent, truthPt, detPt);
2155 
2156  // Fill JES shift (centrality, pT-truth, (pT-det - pT-truth) / pT-truth)
2157  if (type == kEMCal) {
2158  histname = "MatchedJetHistograms/hJESshiftEMCal";
2159  }
2160  else if (type == kDCal) {
2161  histname = "MatchedJetHistograms/hJESshiftDCal";
2162  }
2163  fHistManager.FillTH3(histname, fCent, truthPt, (detPt-truthPt)/truthPt );
2164 
2165  // Fill NEF of det-level matched jets (centrality, pT-truth, NEF)
2166  histname = "MatchedJetHistograms/hNEFVsPt";
2167  fHistManager.FillTH3(histname, fCent, truthPt, jet->NEF());
2168 
2169  // Fill z-leading (charged) of det-level matched jets (centrality, pT-truth, z-leading)
2170  histname = "MatchedJetHistograms/hZLeadingVsPt";
2171  TLorentzVector leadPart;
2172  jets->GetLeadingHadronMomentum(leadPart, jet);
2173  Double_t z = GetParallelFraction(leadPart.Vect(), jet);
2174  if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999; // so that it will contribute to the bin <1
2175  fHistManager.FillTH3(histname, fCent, truthPt, z);
2176 
2177  // Fill matching distance between combined jet and pp det-level jet (centrality, pT-truth, R)
2178  histname = "MatchedJetHistograms/hMatchingDistance";
2179  fHistManager.FillTH3(histname, fCent, truthPt, jet->ClosestJetDistance());
2180 
2181  // Fill matching distance between pp det-level jet and pp truth-level jet (centrality, pT-truth, R)
2182  histname = "MatchedJetHistograms/hMatchingDistancepp";
2183  fHistManager.FillTH3(histname, fCent, truthPt, matchedPartLevelJet->ClosestJetDistance());
2184 
2185  } //jet loop
2186  }
2187 }
2188 
2189 /*
2190  * Compute the MC particle type of a given cluster contributor, using the MC particle container
2191  */
2193 {
2194  ContributorType contributorType = kUndefined;
2195 
2196  AliAODMCParticle *part = fGeneratorLevel->GetMCParticleWithLabel(label);
2197  if (part) {
2198 
2199  TString histname = "ClusterHistogramsMC/hClusterRejectionReasonMC";
2200  UInt_t rejectionReason = 0;
2201  if (!fGeneratorLevel->AcceptMCParticle(part, rejectionReason)) {
2202  fHistManager.FillTH2(histname, fGeneratorLevel->GetRejectionReasonBitPosition(rejectionReason), clus->GetNonLinCorrEnergy());
2203  return contributorType;
2204  }
2205 
2206  if (part->GetGeneratorIndex() == 0) { // generator index in cocktail
2207 
2208  // select charged pions, protons, kaons, electrons, muons
2209  Int_t pdg = part->PdgCode();
2210 
2211  if (pdg == 22) { // gamma 22
2212  contributorType = kPhoton;
2213  }
2214  else if (TMath::Abs(pdg) == 211) { // pi+ 211 (abs value ensures both particles and antiparticles are included)
2215  contributorType = kChargedPion;
2216  }
2217  else if (pdg == 2212) { // proton 2212
2218  contributorType = kProton;
2219  }
2220  else if (pdg == -2212) {
2221  contributorType = kAntiProton;
2222  }
2223  else if (TMath::Abs(pdg) == 321) { // K+ 321
2224  contributorType = kChargedKaon;
2225  }
2226  else if (pdg == 130) { // K0L 130
2227  contributorType = kK0L;
2228  }
2229  else if (pdg == 2112) { // neutron 2112
2230  contributorType = kNeutron;
2231  }
2232  else if (pdg == -2112) {
2233  contributorType = kAntiNeutron;
2234  }
2235  else if (TMath::Abs(pdg) == 11) { // e- 11
2236  contributorType = kElectron;
2237  }
2238  else if (TMath::Abs(pdg) == 13) { // mu- 13
2239  contributorType = kMuon;
2240  }
2241  else {
2242  contributorType = kOther;
2243  }
2244  }
2245  }
2246  return contributorType;
2247 }
2248 
2253 {
2254  Double_t deltaPhi = TMath::Abs(part->Phi_0_2pi() - phiRef);
2255  Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
2256  Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
2257  return deltaR;
2258 }
2259 
2264 {
2265  UInt_t jetType = jet->GetJetAcceptanceType();
2266  Double_t type = -1;
2267  if (jetType & AliEmcalJet::kEMCAL) {
2268  type = kEMCal;
2269  }
2270  else if (jetType & AliEmcalJet::kDCALonly) {
2271  type = kDCal;
2272  }
2273 
2274  return type;
2275 }
2276 
2281 {
2282  Double_t pT = jet->Pt() - rho * jet->Area();
2283  return pT;
2284 }
2285 
2290 {
2291  return (contributor == kChargedPion) || (contributor == kProton) || (contributor == kAntiProton) || (contributor == kChargedKaon) || (contributor == kK0L) || (contributor == kNeutron) || (contributor == kAntiNeutron);
2292 }
2293 
2313 const AliEmcalJet* AliAnalysisTaskEmcalJetPerformance::GetMatchedPartLevelJet(const AliJetContainer * jets, const AliEmcalJet * jet, const std::string & histName)
2314 {
2315  bool returnValue = false;
2316  const AliEmcalJet* partLevelJet = nullptr;
2317 
2318  // First, check if combined jet has a pp det-level match assigned
2319  if (jet->ClosestJet()) {
2320  fHistManager.FillTH1(histName.c_str(), "matchedJet");
2321  returnValue = true;
2322  AliDebugStream(4) << "Jet is matched!\nJet: " << jet->toString() << "\n";
2323 
2324  // Check shared momentum fraction
2325  // We explicitly want to use indices instead of geometric matching
2326  double sharedFraction = jets->GetFractionSharedPt(jet, nullptr);
2327  if (sharedFraction < fMinSharedMomentumFraction) {
2328  AliDebugStream(4) << "Jet rejected due to shared momentum fraction of " << sharedFraction << ", which is smaller than the min momentum fraction of " << fMinSharedMomentumFraction << "\n";
2329  returnValue = false;
2330  }
2331  else {
2332  AliDebugStream(4) << "Passed shared momentum fraction with value of " << sharedFraction << "\n";
2333  fHistManager.FillTH1(histName.c_str(), "sharedMomentumFraction");
2334  }
2335 
2336  // Check that the combined jet has a particle-level match
2337  AliEmcalJet * detLevelJet = jet->ClosestJet();
2338  partLevelJet = detLevelJet->ClosestJet();
2339  if (!partLevelJet) {
2340  AliDebugStream(4) << "Jet rejected due to no matching part level jet.\n";
2341  returnValue = false;
2342  }
2343  else {
2344  AliDebugStream(4) << "Det level jet has a required match to a part level jet.\n" << "Part level jet: " << partLevelJet->toString() << "\n";
2345  fHistManager.FillTH1(histName.c_str(), "partLevelMatchedJet");
2346  }
2347 
2348  // Check the matching distance between the combined and pp det-level jets, if a value has been set
2349  if (fMaxMatchedJetDistance > 0) {
2350  double matchedJetDistance = jet->ClosestJetDistance();
2351  if (matchedJetDistance > fMaxMatchedJetDistance) {
2352  AliDebugStream(4) << "Jet rejected due to matching distance of " << matchedJetDistance << ", which is larger than the max distance of " << fMaxMatchedJetDistance << "\n";
2353  returnValue = false;
2354  }
2355  else {
2356  AliDebugStream(4) << "Jet passed distance cut with distance of " << matchedJetDistance << "\n";
2357  fHistManager.FillTH1(histName.c_str(), "jetDistance");
2358  }
2359  }
2360 
2361  // Record all cuts passed
2362  if (returnValue == true) {
2363  fHistManager.FillTH1(histName.c_str(), "passedAllCuts");
2364  }
2365  }
2366  else {
2367  AliDebugStream(5) << "Rejected jet because it was not matched to a external event jet.\n";
2368  fHistManager.FillTH1(histName.c_str(), "noMatch");
2369  returnValue = false;
2370  }
2371 
2372  if (returnValue) {
2373  return partLevelJet;
2374  }
2375  return 0;
2376 }
2377 
2382  const char *ntracks,
2383  const char *nclusters,
2384  const char *nGenLev,
2385  const Double_t minTrPt,
2386  const Double_t minClPt,
2387  const char *suffix)
2388 {
2389  // Get the pointer to the existing analysis manager via the static access method.
2390  //==============================================================================
2391  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
2392  if (!mgr)
2393  {
2394  ::Error("AddTaskEmcalJetPerformance", "No analysis manager to connect to.");
2395  return 0;
2396  }
2397 
2398  // Check the analysis type using the event handlers connected to the analysis manager.
2399  //==============================================================================
2400  AliVEventHandler* handler = mgr->GetInputEventHandler();
2401  if (!handler)
2402  {
2403  ::Error("AddTaskEmcalJetPerformance", "This task requires an input event handler");
2404  return 0;
2405  }
2406 
2407  enum EDataType_t {
2408  kUnknown,
2409  kESD,
2410  kAOD
2411  };
2412 
2413  EDataType_t dataType = kUnknown;
2414 
2415  if (handler->InheritsFrom("AliESDInputHandler")) {
2416  dataType = kESD;
2417  }
2418  else if (handler->InheritsFrom("AliAODInputHandler")) {
2419  dataType = kAOD;
2420  }
2421 
2422  //-------------------------------------------------------
2423  // Init the task and do settings
2424  //-------------------------------------------------------
2425 
2426  TString trackName(ntracks);
2427  TString clusName(nclusters);
2428 
2429  if (trackName == "usedefault") {
2430  if (dataType == kESD) {
2431  trackName = "Tracks";
2432  }
2433  else if (dataType == kAOD) {
2434  trackName = "tracks";
2435  }
2436  else {
2437  trackName = "";
2438  }
2439  }
2440 
2441  if (clusName == "usedefault") {
2442  if (dataType == kESD) {
2443  clusName = "CaloClusters";
2444  }
2445  else if (dataType == kAOD) {
2446  clusName = "caloClusters";
2447  }
2448  else {
2449  clusName = "";
2450  }
2451  }
2452 
2453  TString name("AliAnalysisTaskEmcalJetPerformance");
2454  if (!trackName.IsNull()) {
2455  name += "_";
2456  name += trackName;
2457  }
2458  if (!clusName.IsNull()) {
2459  name += "_";
2460  name += clusName;
2461  }
2462  if (strcmp(suffix,"") != 0) {
2463  name += "_";
2464  name += suffix;
2465  }
2466 
2468  // Configure jet performance task
2470 
2472  // Create track and cluster containers with the standard cuts
2473 
2474  AliParticleContainer* partCont = 0;
2475  if (trackName == "mcparticles") {
2476  AliMCParticleContainer* mcpartCont = new AliMCParticleContainer(trackName);
2477  partCont = mcpartCont;
2478  }
2479  else if (trackName == "tracks" || trackName == "Tracks") {
2480  AliTrackContainer* trackCont = new AliTrackContainer(trackName);
2481  partCont = trackCont;
2482  }
2483  if (partCont) partCont->SetParticlePtCut(minTrPt);
2484  if (partCont) task->AdoptParticleContainer(partCont);
2485 
2486  // Add the generator-level container, if specified
2487  if (nGenLev && strcmp(nGenLev,"")!=0) {
2488  AliMCParticleContainer* mcpartCont = task->AddMCParticleContainer(nGenLev);
2489  mcpartCont->SelectPhysicalPrimaries(kTRUE);
2490  mcpartCont->SetParticlePtCut(0);
2491  }
2492 
2493  // Add the cluster container
2494  AliClusterContainer* clusCont = 0;
2495  if (!clusName.IsNull()) {
2496  clusCont = new AliClusterContainer(clusName);
2497  clusCont->SetClusECut(0.);
2498  clusCont->SetClusPtCut(0.);
2499  }
2500  if (clusCont) task->AdoptClusterContainer(clusCont);
2501 
2502  //-------------------------------------------------------
2503  // Final settings, pass to manager and set the containers
2504  //-------------------------------------------------------
2505 
2506  mgr->AddTask(task);
2507 
2508  // Create containers for input/output
2509  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
2510  TString contname(name);
2511  contname += "_histos";
2512  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
2513  TList::Class(),AliAnalysisManager::kOutputContainer,
2514  Form("%s", AliAnalysisManager::GetCommonFileName()));
2515  mgr->ConnectInput (task, 0, cinput1 );
2516  mgr->ConnectOutput (task, 1, coutput1 );
2517 
2518  return task;
2519 }
2520 
Int_t pdg
static AliAnalysisTaskEmcalJetPerformance * AddTaskEmcalJetPerformance(const char *ntracks="usedefault", const char *nclusters="usedefault", const char *nGenLev="mcparticles", const Double_t minTrPt=0.15, const Double_t minClPt=0.30, const char *suffix="")
Double_t Area() const
Definition: AliEmcalJet.h:130
TObjArray fClusterCollArray
cluster collection array
void SetParticlePtCut(Double_t cut)
Double_t GetRhoVal() const
const TString & GetRhoName() const
double Double_t
Definition: External.C:58
TList * fEventCutList
! Output list for event cut histograms
Double_t GetJetPt(const AliEmcalJet *jet, Double_t rho)
const char * title
Definition: MakeQAPdf.C:27
AliEmcalJet * ClosestJet() const
Definition: AliEmcalJet.h:327
Bool_t fUseAliEventCuts
Flag to use AliEventCuts (otherwise AliAnalysisTaskEmcal will be used)
AliJetContainer * GetJetContainer(Int_t i=0) const
Definition: External.C:244
Double_t ClosestJetDistance() const
Definition: AliEmcalJet.h:328
UInt_t fOffTrigger
offline trigger for event selection
void AdoptParticleContainer(AliParticleContainer *cont)
const AliClusterIterableMomentumContainer accepted_momentum() const
Int_t nbinsy
void FillParticleCompositionJetHistograms(const AliMCEvent *mcevent)
Container with name, TClonesArray and cuts for particles.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
Declaration of class AliTLorentzVector.
static AliEmcalDownscaleFactorsOCDB * Instance()
AliClusterContainer * GetClusterContainer() const
void FillTH3(const char *hname, double x, double y, double z, double weight=1., Option_t *opt="")
Fill a 3D histogram within the container.
Declaration of class AliAnalysisTaskEmcalEmbeddingHelper.
AliMCParticleContainer * fGeneratorLevel
! generator level container
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
Double_t GetDownscaleFactorForTriggerClass(const TString &trigger) const
TString part
use mixed event to constrain combinatorial background
Definition: InvMassFit.C:52
Container for particles within the EMCAL framework.
void SetCaloTriggerPatchInfoName(const char *n)
Bool_t fPlotClusterHistograms
Set whether to plot cluster histograms.
Double_t GetDeltaR(const AliTLorentzVector *part, Double_t etaRef, Double_t phiRef)
void AdoptClusterContainer(AliClusterContainer *cont)
TObjArray fParticleCollArray
particle/track collection array
virtual Bool_t AcceptMCParticle(const AliAODMCParticle *vp, UInt_t &rejectionReason) const
bool AddQAPlotsToList(TList *list)
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
const Int_t nPtBins
Bool_t fComputeMBDownscaling
Set whether to compute and plot MB downscaling factors.
void GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
AliEmcalEmbeddingQA fEmbeddingQA
! QA hists for embedding (will only be added if embedding)
void FillTHnSparse(const char *name, const double *x, double weight=1., Option_t *opt="")
bool IsInitialized() const
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Create a new TH2 within the container.
int Int_t
Definition: External.C:63
Double_t fTrackMatchingDeltaEtaMax
Maximum delta-eta to consider a track to be matched to a cluster.
unsigned int UInt_t
Definition: External.C:33
THashList * GetListOfHistograms() const
Get the list of histograms.
Definition: THistManager.h:671
Double_t GetLeadingHadronPt(const AliEmcalJet *jet) const
float Float_t
Definition: External.C:68
AliEMCALGeometry * fGeom
!emcal geometry
UInt_t GetJetAcceptanceType() const
Definition: AliEmcalJet.h:367
Double_t Phi_0_2pi() const
EMCal acceptance.
Definition: AliEmcalJet.h:69
Implementation of task to embed external events.
TString toString() const
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
Double_t fTrackMatchingDeltaPhiMax
Maximum delta-phi to consider a track to be matched to a cluster.
Photon+Photon (not from same pi0) are the only contributors.
Bool_t fUseManualEventCuts
Flag to use manual event cuts.
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
Double_t fCent
!event centrality
Photon (direct or decay) is the only contributor.
Two particles from merged pi0 are the only contributors.
Bool_t fPlotJetHistograms
Set whether to enable inclusive jet histograms.
Int_t fNEoverPBins
! number of variable E/p bins
AliMCParticleContainer * AddMCParticleContainer(const char *n)
Create new container for MC particles and attach it to the task.
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
Calculates the fraction of momentum z of part 1 w.r.t. part 2 in the direction of part 2...
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
AliEventCuts fEventCuts
event selection utility
Bool_t fPlotMatchedJetHistograms
Set whether to plot matched jet histograms (must run ResponseMaker first)
TObjArray fJetCollArray
jet collection array
Bool_t fkEMCEJE
! flag telling whether the event is "triggered" or not in "simulation"
AliRhoParameter * GetRhoParameter()
const AliEmcalJet * GetMatchedPartLevelJet(const AliJetContainer *jets, const AliEmcalJet *jet, const std::string &histName)
Double_t Pt() const
Definition: AliEmcalJet.h:109
Photon+Hadron are the only contributors, with Photon leading.
Int_t nbinsx
virtual Bool_t IsEventSelected()
Performing event selection.
Bool_t IsHadron(const ContributorType contributor)
static Double_t * GenerateFixedBinArray(Int_t n, Double_t min, Double_t max)
Bool_t fComputeBackground
Set whether to enable study of background.
Float_t GetJetRadius() const
Double_t fMinSharedMomentumFraction
Minimum shared momentum (pp det-level track pT in combined jet) / (pp det-level track pT) ...
AliEmcalList * fOutput
!output list
ContributorType GetContributorType(const AliVCluster *clus, const AliMCEvent *mcevent, Int_t label)
Handler for downscale factors for various triggers obtained from the OCDB.
AliMCParticleContainer * GetMCParticleContainer(Int_t i=0) const
Int_t fNPtHistBins
! number of variable pt bins
Definition: External.C:220
Bool_t fPlotParticleCompositionHistograms
Set whether to plot jet composition histograms.
void SelectPhysicalPrimaries(Bool_t s)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:51
Int_t fNM02HistBins
! number of variable M02 bins
Double_t fMBUpscaleFactor
! inverse of downscale factor, for MB trigger
Double_t GetFractionSharedPt(const AliEmcalJet *jet, AliParticleContainer *cont2=0x0) const
const AliTrackIterableMomentumContainer accepted_momentum() const
Int_t GetRunNumber(TString)
Definition: PlotMuonQA.C:2235
void SetClusPtCut(Double_t cut)
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
Main initialization function on the worker.
Bool_t fDoTriggerSimulation
Set whether to perform a simple trigger simulation.
const Int_t nbins
const AliJetIterableContainer accepted() const
bool Bool_t
Definition: External.C:53
EDataType_t
Switch for the data type.
DCal acceptance – spans ONLY DCal (no PHOS or gap)
Definition: AliEmcalJet.h:73
void SetClusECut(Double_t cut)
Double_t fMedianDCal
! median patch energy in DCal, per event
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Create a new THnSparse within the container.
Double_t fMedianEMCal
! median patch energy in EMCal, per event
Container structure for EMCAL clusters.
Container for MC-true particles within the EMCAL framework.
virtual AliAODMCParticle * GetMCParticleWithLabel(Int_t lab) const
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
Container for jet within the EMCAL jet framework.
Hadron+Photon are the only contributors, with Hadron leading.
void FillParticleCompositionClusterHistograms(const AliMCEvent *mcevent)
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="")
Create a new TH2 within the container.
Double_t fMaxMatchedJetDistance
Maximum distance between two matched jets.
const AliJetIterableContainer all() const
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()