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