AliPhysics  a8fcd8c (a8fcd8c)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 "AliTLorentzVector.h"
45 #include "AliEmcalJet.h"
46 #include "AliRhoParameter.h"
47 #include "AliJetContainer.h"
48 #include "AliParticleContainer.h"
49 #include "AliClusterContainer.h"
50 #include "AliEMCALGeometry.h"
51 #include "AliOADBContainer.h"
53 #include "AliEMCALTriggerPatchInfo.h"
55 #include "AliMCAnalysisUtils.h"
56 
58 
62 
68  fPlotJetHistograms(kFALSE),
69  fPlotClusterHistograms(kFALSE),
70  fPlotParticleCompositionHistograms(kFALSE),
71  fComputeBackground(kFALSE),
72  fDoTriggerSimulation(kFALSE),
73  fPlotMatchedJetHistograms(kFALSE),
74  fComputeMBDownscaling(kFALSE),
75  fMaxPt(200),
76  fNEtaBins(40),
77  fNPhiBins(200),
78  fNCentHistBins(0),
79  fCentHistBins(0),
80  fNPtHistBins(0),
81  fPtHistBins(0),
82  fNM02HistBins(0),
83  fM02HistBins(0),
84  fNEoverPBins(0),
85  fEoverPBins(0),
86  fTrackMatchingDeltaEtaMax(0.015),
87  fTrackMatchingDeltaPhiMax(0.030),
88  fMBUpscaleFactor(1.),
89  fMedianEMCal(0.),
90  fMedianDCal(0.),
91  fkEMCEJE(kFALSE),
92  fEmbeddingQA(),
93  fUseAliEventCuts(kTRUE),
94  fEventCuts(0),
95  fEventCutList(0),
96  fUseManualEventCuts(kFALSE),
97  fGeneratorLevel(0),
98  fHistManager()
99 {
101 }
102 
109  AliAnalysisTaskEmcalJet(name, kTRUE),
110  fPlotJetHistograms(kFALSE),
111  fPlotClusterHistograms(kFALSE),
112  fPlotParticleCompositionHistograms(kFALSE),
113  fComputeBackground(kFALSE),
114  fDoTriggerSimulation(kFALSE),
115  fPlotMatchedJetHistograms(kFALSE),
116  fComputeMBDownscaling(kFALSE),
117  fMaxPt(200),
118  fNEtaBins(40),
119  fNPhiBins(200),
120  fNCentHistBins(0),
121  fCentHistBins(0),
122  fNPtHistBins(0),
123  fPtHistBins(0),
124  fNM02HistBins(0),
125  fM02HistBins(0),
126  fNEoverPBins(0),
127  fEoverPBins(0),
128  fTrackMatchingDeltaEtaMax(0.015),
129  fTrackMatchingDeltaPhiMax(0.030),
130  fMBUpscaleFactor(1.),
131  fMedianEMCal(0.),
132  fMedianDCal(0.),
133  fkEMCEJE(kFALSE),
134  fEmbeddingQA(),
135  fUseAliEventCuts(kTRUE),
136  fEventCuts(0),
137  fEventCutList(0),
138  fUseManualEventCuts(kFALSE),
139  fGeneratorLevel(0),
140  fHistManager(name)
141 {
143 }
144 
149 {
150 }
151 
156 {
157  fNCentHistBins = 4;
159  fCentHistBins[0] = 0;
160  fCentHistBins[1] = 10;
161  fCentHistBins[2] = 30;
162  fCentHistBins[3] = 50;
163  fCentHistBins[4] = 90;
164 
165  fNPtHistBins = 82;
168  GenerateFixedBinArray(7, 0.3, 1, fPtHistBins+6);
169  GenerateFixedBinArray(10, 1, 3, fPtHistBins+13);
170  GenerateFixedBinArray(14, 3, 10, fPtHistBins+23);
171  GenerateFixedBinArray(10, 10, 20, fPtHistBins+37);
172  GenerateFixedBinArray(15, 20, 50, fPtHistBins+47);
173  GenerateFixedBinArray(20, 50, 150, fPtHistBins+62);
174 
175  fNM02HistBins = 81;
177  GenerateFixedBinArray(35, 0, 0.7, fM02HistBins);
178  GenerateFixedBinArray(6, 0.7, 1., fM02HistBins+35);
179  GenerateFixedBinArray(20, 1., 3., fM02HistBins+41);
180  GenerateFixedBinArray(10, 3., 5., fM02HistBins+61);
181  GenerateFixedBinArray(10, 5., 10., fM02HistBins+71);
182 
183  fNEoverPBins = 47;
185  GenerateFixedBinArray(30, 0, 1.5, fEoverPBins);
186  GenerateFixedBinArray(10, 1.5, 3.5, fEoverPBins+30);
187  GenerateFixedBinArray(7, 3.5, 10.5, fEoverPBins+40);
188 }
189 
195 {
197 
198  // Intialize AliEventCuts
199  if (fUseAliEventCuts) {
200  fEventCutList = new TList();
201  fEventCutList ->SetOwner();
202  fEventCutList ->SetName("EventCutOutput");
203 
204  fEventCuts.OverrideAutomaticTriggerSelection(fOffTrigger);
205  if(fUseManualEventCuts==1)
206  {
207  fEventCuts.SetManualMode();
208  // Configure manual settings here
209  // ...
210  }
211  fEventCuts.AddQAplotsToList(fEventCutList);
212  fOutput->Add(fEventCutList);
213  }
214 
215  // Get the MC particle branch, in case it exists
216  fGeneratorLevel = GetMCParticleContainer("mcparticles");
217 
218  // Allocate histograms
219  if (fPlotJetHistograms) {
221  }
224  }
227  }
228  if (fComputeBackground) {
230  }
231  if (fDoTriggerSimulation) {
233  }
236  }
237 
238  // Initialize embedding QA
240  if (embeddingHelper) {
241  bool res = fEmbeddingQA.Initialize();
242  if (res) {
244  }
245  }
246 
247  TIter next(fHistManager.GetListOfHistograms());
248  TObject* obj = 0;
249  while ((obj = next())) {
250  fOutput->Add(obj);
251  }
252 
253  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
254 }
255 
256 /*
257  * This function allocates the histograms for single jets.
258  * A set of histograms is allocated per each jet container.
259  */
261 {
262  TString histname;
263  TString title;
264 
265  Int_t nPtBins = TMath::CeilNint(fMaxPt/2);
266 
267  AliJetContainer* jets = 0;
268  TIter nextJetColl(&fJetCollArray);
269  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
270 
271  // Jet rejection reason
272  histname = TString::Format("%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
273  title = histname + ";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
274  TH2* hist = fHistManager.CreateTH2(histname.Data(), title.Data(), 32, 0, 32, 50, 0, fMaxPt);
275  SetRejectionReasonLabels(hist->GetXaxis());
276 
277  // Rho vs. Centrality
278  if (!jets->GetRhoName().IsNull()) {
279  histname = TString::Format("%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
280  title = histname + ";Centrality (%);#rho (GeV/#it{c});counts";
281  fHistManager.CreateTH2(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 500);
282  }
283 
284  // (Centrality, pT, NEF)
285  Int_t nbinsx = 20; Int_t minx = 0; Int_t maxx = 100;
286  Int_t nbinsy = nPtBins; Int_t miny = 0; Int_t maxy = fMaxPt;
287  Int_t nbinsz = 50; Int_t minz = 0; Int_t maxz = 1.;
288 
289  histname = TString::Format("%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
290  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
291  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
292 
293  histname = TString::Format("%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
294  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
295  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
296 
297  // (Centrality, pT upscaled, calo type)
298  if (fComputeMBDownscaling) {
299  histname = TString::Format("%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
300  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
301  fHistManager.CreateTH3(histname.Data(), title.Data(), 20, 0, 100, nPtBins, 0, fMaxPt, 2, -0.5, 1.5, "s");
302  }
303 
304  // pT-leading vs. pT
305  histname = TString::Format("%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
306  title = histname + ";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
307  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, nPtBins, 0, fMaxPt);
308 
309  // A vs. pT
310  histname = TString::Format("%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
311  title = histname + ";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
312  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, fMaxPt/3, 0, 0.5);
313 
314  // (Centrality, pT, z-leading (charged))
315  nbinsx = 20; minx = 0; maxx = 100;
316  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
317  nbinsz = 50; minz = 0; maxz = 1.;
318 
319  histname = TString::Format("%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
320  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
321  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
322 
323  histname = TString::Format("%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
324  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
325  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
326 
327  // (Centrality, pT, z (charged))
328  nbinsx = 20; minx = 0; maxx = 100;
329  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
330  nbinsz = 50; minz = 0; maxz = 1.;
331 
332  histname = TString::Format("%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
333  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
334  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
335 
336  histname = TString::Format("%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
337  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
338  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
339 
340  // (Centrality, pT, Nconst, calo type)
341  nbinsx = 20; minx = 0; maxx = 100;
342  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
343  nbinsz = 50; minz = 0; maxz = fMaxPt;
344 
345  histname = TString::Format("%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
346  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
347  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
348 
349  histname = TString::Format("%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
350  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
351  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
352 
353  // (Centrality, jet pT, Enonlincorr - Ehadcorr)
354  nbinsx = 20; minx = 0; maxx = 100;
355  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
356  nbinsz = nPtBins; minz = 0; maxz = fMaxPt;
357 
358  histname = TString::Format("%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
359  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#sum#it{E}_{nonlincorr} - #it{E}_{hadcorr}";
360  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
361 
362  // (Median patch energy, calo type, jet pT, centrality)
363  if (fDoTriggerSimulation) {
364  histname = TString::Format("%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
365  title = histname + ";#it{E}_{patch,med};type;#it{p}_{T}^{corr} (GeV/#it{c});Centrality (%)";
366  Int_t nbins5[4] = {100, 2, nPtBins, 50};
367  Double_t min5[4] = {0,-0.5, 0, 0};
368  Double_t max5[4] = {50,1.5, fMaxPt, 100};
369  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins5, min5, max5);
370  }
371 
372  }
373 
374  // MB downscale factor histogram
375  if (fComputeMBDownscaling) {
376  histname = "Trigger/hMBDownscaleFactor";
377  title = histname + ";Downscale factor;counts";
378  fHistManager.CreateTH1(histname.Data(), title.Data(), 200, 0, 200);
379  }
380 
381 }
382 
383 /*
384  * This function allocates the histograms for the calorimeter performance study.
385  */
387 {
388  TString histname;
389  TString htitle;
390 
391  const Int_t nRcorrBins = 50;
392  Double_t *RcorrBins = GenerateFixedBinArray(nRcorrBins, 0., 1.);
393  const Int_t nCellBins = 30;
394  Double_t *cellBins = GenerateFixedBinArray(nCellBins, -0.5, 29.5);
395  const Int_t nMatchedTrackBins = 5;
396  Double_t *matchedTrackBins = GenerateFixedBinArray(nMatchedTrackBins, -0.5, 4.5);
397 
400 
401  // Plot M02 distribution (centrality, Eclus nonlincorr, M02)
402  histname = "ClusterHistograms/hM02";
403  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); M02";
405 
406  // Plot Ncell distribution for M02 > 0.4 and 0.1 < M02 < 0.4 (centrality, Eclus nonlincorr, Ncells)
407  histname = "ClusterHistograms/hNcellsM02G04";
408  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); Ncells";
409  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNCentHistBins, fCentHistBins, fNPtHistBins, fPtHistBins, nCellBins, cellBins);
410 
411  histname = "ClusterHistograms/hNcellsM02L04";
412  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); Ncells";
413  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNCentHistBins, fCentHistBins, fNPtHistBins, fPtHistBins, nCellBins, cellBins);
414 
417 
418  // Plot matched track pT for all clusters, M02 > 0.4 clusters, and 0.1 < M02 < 0.4 clusters (centrality, Eclus nonlincorr, trackPsum)
419  histname = "ClusterHistograms/hMatchedTrackPt";
420  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
422 
423  histname = "ClusterHistograms/hMatchedTrackPtM02G04";
424  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
426 
427  histname = "ClusterHistograms/hMatchedTrackPtM02L04";
428  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
430 
431  // Plot number of matched tracks for all clusters, M02 > 0.4 clusters, and 0.1 < M02 < 0.4 clusters (centrality, Eclus nonlincorr, N matches)
432  histname = "ClusterHistograms/hMatchedTrackN";
433  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
434  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNCentHistBins, fCentHistBins, fNPtHistBins, fPtHistBins, nMatchedTrackBins, matchedTrackBins);
435 
436  histname = "ClusterHistograms/hMatchedTrackNM02G04";
437  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
438  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNCentHistBins, fCentHistBins, fNPtHistBins, fPtHistBins, nMatchedTrackBins, matchedTrackBins);
439 
440  histname = "ClusterHistograms/hMatchedTrackNM02L04";
441  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
442  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNCentHistBins, fCentHistBins, fNPtHistBins, fPtHistBins, nMatchedTrackBins, matchedTrackBins);
443 
444  // Plot M02 distribution for clusters with matched tracks (centrality, Eclus nonlincorr, M02)
445  histname = "ClusterHistograms/hM02Matched";
446  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); M02";
448 
449  // Plot M02 distribution for clusters without matched tracks (centrality, Eclus nonlincorr, M02)
450  histname = "ClusterHistograms/hM02Unmatched";
451  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); M02";
453 
456 
457  // Plot E/p (centrality, Eclus nonlincorr, Eclus nonlincorr / trackPsum)
458  histname = "ClusterHistograms/hEoverP";
459  htitle = histname + ";Centrality (%);#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV)";
461 
462  // Plot E/p vs. M02 for 0-10% (Eclus nonlincorr, Eclus nonlincorr / trackPsum, M02)
463  histname = "ClusterHistograms/hEoverPM02";
464  htitle = histname + ";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
466 
469 
470  // Plot Rcorr distribution (centrality, trackPSum, Rcorr = (Enonlincorr - Ehadcorr) / trackPSum)
471  histname = "ClusterHistograms/hRcorrVsCent";
472  htitle = histname + ";Centrality (%);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
473  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNCentHistBins, fCentHistBins, fNPtHistBins, fPtHistBins, nRcorrBins, RcorrBins);
474 
475  // Plot Rcorr distribution for 0-10% centrality (Eclus nonlincorr, trackPSum, Rcorr)
476  histname = "ClusterHistograms/hRcorr0-10";
477  htitle = histname + ";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
478  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNPtHistBins, fPtHistBins, nRcorrBins, RcorrBins);
479 
480  // Plot Rcorr distribution for 50-90% centrality (Eclus nonlincorr, trackPSum, Rcorr)
481  histname = "ClusterHistograms/hRcorr50-90";
482  htitle = histname + ";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
483  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNPtHistBins, fPtHistBins, nRcorrBins, RcorrBins);
484 
485  // Plot also Rcorr-clus (centrality, trackPSum, Rcorr-clus = (Enonlincorr - Ehadcorr) / Enonlincorr )
486  histname = "ClusterHistograms/hRcorrClusVsCent";
487  htitle = histname + ";Centrality (%);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
488  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNCentHistBins, fCentHistBins, fNPtHistBins, fPtHistBins, nRcorrBins, RcorrBins);
489 
490  // Rcorr-clus for 0-10% centrality (Eclus nonlincorr, trackPSum, Rcorr-clus = (Enonlincorr - Ehadcorr) / Enonlincorr )
491  histname = "ClusterHistograms/hRcorrClus0-10";
492  htitle = histname + ";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
493  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNPtHistBins, fPtHistBins, nRcorrBins, RcorrBins);
494 
495  // Rcorr-clus for 50-90% centrality (Eclus nonlincorr, trackPSum, Rcorr-clus = (Enonlincorr - Ehadcorr) / Enonlincorr )
496  histname = "ClusterHistograms/hRcorrClus50-90";
497  htitle = histname + ";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
498  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNPtHistBins, fPtHistBins, nRcorrBins, RcorrBins);
499 
500 }
501 
502 /*
503  * This function allocates the histograms for the jet composition study.
504  */
506 {
507  TString histname;
508  TString htitle;
509  Int_t nPtBins = TMath::CeilNint(fMaxPt/2);
510 
511  const Int_t nRejBins = 32;
512  Double_t* rejReasonBins = new Double_t[nRejBins+1];
513  GenerateFixedBinArray(nRejBins, 0, nRejBins, rejReasonBins);
514  const Int_t nParticleTypes = 8;
515  Double_t *particleTypeBins = GenerateFixedBinArray(nParticleTypes, -0.5, 7.5);
516 
517  AliEmcalContainer* cont = 0;
518  TIter nextClusColl(&fClusterCollArray);
519  while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) {
520 
521  histname = "JetPerformance/hClusterRejectionReasonMC";
522  htitle = histname + ";Rejection reason;#it{E}_{clus} (GeV/)";
523  TH2* histMC = fHistManager.CreateTH2(histname.Data(), htitle.Data(), nRejBins, rejReasonBins, fNPtHistBins, fPtHistBins);
524  SetRejectionReasonLabels(histMC->GetXaxis());
525  }
526 
527  // M02 vs. Energy vs. Particle type
528  histname = "JetPerformance/hM02VsParticleType";
529  htitle = histname + ";M02;#it{E}_{clus} (GeV); Particle type";
530  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNM02HistBins, fM02HistBins, fNPtHistBins, fPtHistBins, nParticleTypes, particleTypeBins);
531 
532  // M02 vs. Energy vs. Particle type vs. Jet pT, for particles inside jets
533  Int_t dim = 0;
534  TString title[20];
535  Int_t nbins[20] = {0};
536  Double_t min[30] = {0.};
537  Double_t max[30] = {0.};
538  Double_t *binEdges[20] = {0};
539 
540  title[dim] = "M02";
541  nbins[dim] = fNM02HistBins;
542  binEdges[dim] = fM02HistBins;
543  min[dim] = fM02HistBins[0];
544  max[dim] = fM02HistBins[fNM02HistBins];
545  dim++;
546 
547  title[dim] = "#it{E}_{clus} (GeV)";
548  nbins[dim] = fNPtHistBins;
549  binEdges[dim] = fPtHistBins;
550  min[dim] = fPtHistBins[0];
551  max[dim] = fPtHistBins[fNPtHistBins];
552  dim++;
553 
554  title[dim] = "Particle type";
555  nbins[dim] = nParticleTypes;
556  min[dim] = -0.5;
557  max[dim] = 7.5;
558  binEdges[dim] = particleTypeBins;
559  dim++;
560 
561  title[dim] = "#it{p}_{T,jet}^{corr}";
562  nbins[dim] = nPtBins;
563  min[dim] = 0;
564  max[dim] = fMaxPt;
565  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
566  dim++;
567 
568  TString thnname = "JetPerformance/hM02VsParticleTypeJets";
569  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
570  for (Int_t i = 0; i < dim; i++) {
571  hn->GetAxis(i)->SetTitle(title[i]);
572  hn->SetBinEdges(i, binEdges[i]);
573  }
574 
575  // Particle composition inside each jet -- jet pT vs. particle type vs. particle number vs. particle pT sum
576  // (One entry per jet for each particle type)
577  dim = 0;
578 
579  title[dim] = "#it{p}_{T,jet}^{corr}";
580  nbins[dim] = nPtBins;
581  min[dim] = 0;
582  max[dim] = fMaxPt;
583  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
584  dim++;
585 
586  title[dim] = "Particle type";
587  nbins[dim] = nParticleTypes;
588  min[dim] = -0.5;
589  max[dim] = 7.5;
590  binEdges[dim] = particleTypeBins;
591  dim++;
592 
593  title[dim] = "N";
594  nbins[dim] = 30;
595  min[dim] = -0.5;
596  max[dim] = 29.5;
597  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
598  dim++;
599 
600  title[dim] = "#it{p}_{T,sum} (GeV)";
601  nbins[dim] = fNPtHistBins;
602  binEdges[dim] = fPtHistBins;
603  min[dim] = fPtHistBins[0];
604  max[dim] = fPtHistBins[fNPtHistBins];
605  dim++;
606 
607  thnname = "JetPerformance/hJetComposition";
608  THnSparse* thn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
609  for (Int_t i = 0; i < dim; i++) {
610  thn->GetAxis(i)->SetTitle(title[i]);
611  thn->SetBinEdges(i, binEdges[i]);
612  }
613 
614  // Hadronic calo energy in each jet
615 
616  // Jet pT vs. Summed energy of hadronic clusters without a matched track
617  histname = "JetPerformance/hHadCaloEnergyUnmatched";
618  htitle = histname + ";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
619  fHistManager.CreateTH2(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNPtHistBins, fPtHistBins);
620 
621  // Jet pT vs. Summed energy of hadronic clusters with a matched track (before hadronic correction)
622  histname = "JetPerformance/hHadCaloEnergyMatchedNonlincorr";
623  htitle = histname + ";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
624  fHistManager.CreateTH2(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNPtHistBins, fPtHistBins);
625 
626  // Jet pT vs. Summed energy of hadronic clusters with a matched track (after hadronic correction)
627  histname = "JetPerformance/hHadCaloEnergyMatchedHadCorr";
628  htitle = histname + ";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
629  fHistManager.CreateTH2(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNPtHistBins, fPtHistBins);
630 
631 }
632 
633 /*
634  * This function allocates background subtraction histograms, if enabled.
635  * A set of histograms is allocated per each jet container.
636  */
638 {
639  TString histname;
640  TString title;
641 
642  AliJetContainer* jets = 0;
643  TIter nextJetColl(&fJetCollArray);
644  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
645 
646  histname = TString::Format("%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
647  title = histname + ";Centrality;Scale factor;counts";
648  fHistManager.CreateTH2(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 5);
649 
650  histname = TString::Format("%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
651  title = histname + ";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
652  fHistManager.CreateTH2(histname.Data(), title.Data(), 10, 0, 100, 400, -50, 150);
653 
654  }
655 }
656 
657 /*
658  * This function allocates the histograms for single jets, when the "simulated" trigger has been fired.
659  * A set of histograms is allocated per each jet container.
660  */
662 {
663  TString histname;
664  TString title;
665  Int_t nPtBins = TMath::CeilNint(fMaxPt/2);
666 
667  //----------------------------------------------
668  // Trigger patch histograms
669 
670  // patch eta vs. phi
671  histname = "TriggerSimHistograms/hEtaVsPhi";
672  title = histname + ";#eta_{patch} (rad);#phi_{patch} (rad)";
673  fHistManager.CreateTH2(histname.Data(), title.Data(), 140, -0.7, 0.7, 500, 1., 6.);
674 
675  // N patches
676  histname = "TriggerSimHistograms/hNPatches";
677  title = histname + ";#it{N}_{patches};type";
678  fHistManager.CreateTH2(histname.Data(), title.Data(), 200, 0, 200, 2, -0.5, 1.5);
679 
680  // patch E vs. centrality
681  histname = "TriggerSimHistograms/hPatchE";
682  title = histname + ";Centrality (%);#it{E}_{patch} (GeV)";
683  fHistManager.CreateTH2(histname.Data(), title.Data(), 50, 0, 100, nPtBins, 0, fMaxPt);
684 
685  // patch median vs. Centrality
686  histname = "TriggerSimHistograms/hPatchMedianE";
687  title = histname + ";Centrality (%);#it{E}_{patch,med} (GeV);type";
688  fHistManager.CreateTH3(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 50, 2, -0.5, 1.5);
689 
690  //----------------------------------------------
691  // Jet histograms for "triggered" events
692  AliJetContainer* jets = 0;
693  TIter nextJetColl(&fJetCollArray);
694  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
695 
696  // Jet rejection reason
697  histname = TString::Format("%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
698  title = histname + ";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
699  TH2* hist = fHistManager.CreateTH2(histname.Data(), title.Data(), 32, 0, 32, 50, 0, fMaxPt);
700  SetRejectionReasonLabels(hist->GetXaxis());
701 
702  // Rho vs. Centrality
703  if (!jets->GetRhoName().IsNull()) {
704  histname = TString::Format("%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
705  title = histname + ";Centrality (%);#rho (GeV/#it{c});counts";
706  fHistManager.CreateTH2(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 500);
707  }
708 
709  // (Centrality, pT, NEF)
710  Int_t nbinsx = 20; Int_t minx = 0; Int_t maxx = 100;
711  Int_t nbinsy = nPtBins; Int_t miny = 0; Int_t maxy = fMaxPt;
712  Int_t nbinsz = 50; Int_t minz = 0; Int_t maxz = 1.;
713 
714  histname = TString::Format("%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
715  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
716  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
717 
718  histname = TString::Format("%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
719  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
720  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
721 
722  // pT-leading vs. pT
723  histname = TString::Format("%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
724  title = histname + ";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
725  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, nPtBins, 0, fMaxPt);
726 
727  // A vs. pT
728  histname = TString::Format("%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
729  title = histname + ";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
730  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, fMaxPt/3, 0, 0.5);
731 
732  // (Centrality, pT, z-leading (charged))
733  nbinsx = 20; minx = 0; maxx = 100;
734  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
735  nbinsz = 50; minz = 0; maxz = 1.;
736 
737  histname = TString::Format("%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
738  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
739  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
740 
741  histname = TString::Format("%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
742  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
743  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
744 
745  // z (charged) vs. pT
746  nbinsx = 20; minx = 0; maxx = 100;
747  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
748  nbinsz = 50; minz = 0; maxz = 1.;
749 
750  histname = TString::Format("%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
751  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
752  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
753 
754  histname = TString::Format("%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
755  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
756  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
757 
758  // (Centrality, pT, Nconst)
759  nbinsx = 20; minx = 0; maxx = 100;
760  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
761  nbinsz = 50; minz = 0; maxz = fMaxPt;
762 
763  histname = TString::Format("%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
764  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
765  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
766 
767  histname = TString::Format("%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
768  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
769  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
770 
771  }
772 }
773 
774 /*
775  * This function allocates histograms for matched truth-det jets in the case of embedding.
776  * The jet matching information must be previously filled by another task, such as AliJetResponseMaker.
777  */
779 {
780  TString histname;
781  TString title;
782  Int_t nPtBins = TMath::CeilNint(fMaxPt/2);
783 
784  // Response matrix, (centrality, pT-truth, pT-det)
785  Int_t nbinsx = 20; Int_t minx = 0; Int_t maxx = 100;
786  Int_t nbinsy = nPtBins; Int_t miny = 0; Int_t maxy = fMaxPt;
787  Int_t nbinsz = nPtBins; Int_t minz = 0; Int_t maxz = fMaxPt;
788 
789  histname = "MatchedJetHistograms/hResponseMatrixEMCal";
790  title = histname + ";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
791  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
792 
793  histname = "MatchedJetHistograms/hResponseMatrixDCal";
794  title = histname + ";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
795  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
796 
797  // JES shift, (centrality, pT-truth, (pT-det - pT-truth) / pT-truth)
798  nbinsx = 20; minx = 0; maxx = 100;
799  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
800  nbinsz = 250; minz = -5.; maxz = 5.;
801 
802  histname = "MatchedJetHistograms/hJESshiftEMCal";
803  title = histname + ";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
804  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
805 
806  histname = "MatchedJetHistograms/hJESshiftDCal";
807  title = histname + ";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
808  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
809 
810  // NEF of det-level matched jets, (centrality, pT-truth, NEF)
811  nbinsx = 20; minx = 0; maxx = 100;
812  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
813  nbinsz = 50; minz = 0; maxz = 1.;
814 
815  histname = "MatchedJetHistograms/hNEFVsPt";
816  title = histname + ";Centrality (%);#it{p}_{T,corr}^{det} (GeV/#it{c});Calo energy fraction";
817  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
818 
819  // z-leading (charged) of det-level matched jets, (centrality, pT-truth, z-leading)
820  nbinsx = 20; minx = 0; maxx = 100;
821  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
822  nbinsz = 50; minz = 0; maxz = 1.;
823 
824  histname = "MatchedJetHistograms/hZLeadingVsPt";
825  title = histname + ";Centrality (%);#it{p}_{T,corr}^{det} (GeV/#it{c});#it{z}_{leading}";
826  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
827 
828  // Matching distance, (centrality, pT-truth, R)
829  nbinsx = 20; minx = 0; maxx = 100;
830  nbinsy = nPtBins; miny = 0; maxy = fMaxPt;
831  nbinsz = 50; minz = 0; maxz = 1.;
832 
833  histname = "MatchedJetHistograms/hMatchingDistance";
834  title = histname + ";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});R";
835  fHistManager.CreateTH3(histname.Data(), title.Data(), nbinsx, minx, maxx, nbinsy, miny, maxy, nbinsz, minz, maxz);
836 
837 }
838 
844 {
845  // Configure base class to set fTriggerPatchInfo to array of trigger patches, each event
846  // (Need to call this before base class ExecOnce)
847  if (fDoTriggerSimulation) {
848  this->SetCaloTriggerPatchInfoName("EmcalTriggers");
849  }
850 
852 
853  fNeedEmcalGeom = kTRUE;
854 
855  // Check if trigger patches are loaded
856  if (fDoTriggerSimulation) {
857  if (fTriggerPatchInfo) {
858  TString objname(fTriggerPatchInfo->GetClass()->GetName());
859  TClass cls(objname);
860  if (!cls.InheritsFrom("AliEMCALTriggerPatchInfo")) {
861  AliError(Form("%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
862  GetName(), cls.GetName(), "EmcalTriggers"));
863  fTriggerPatchInfo = 0;
864  }
865  }
866  if (!fTriggerPatchInfo) {
867  AliError(Form("%s: Unable to get trigger patch container with name %s. Aborting", GetName(), "EmcalTriggers"));
868  return;
869  }
870  }
871 }
872 
877 
878  // Get the downscaling factors for MB triggers (to be used to calculate trigger efficiency)
879 
881 
882  // Get instance of the downscale factor helper class
884  downscaleOCDB->SetRun(InputEvent()->GetRunNumber());
885 
886  // There are two possible min bias triggers for LHC15o
887  TString triggerNameMB1 = "CINT7-B-NOPF-CENT";
888  TString triggerNameMB2 = "CV0L7-B-NOPF-CENT";
889  TString triggerNameJE = "CINT7EJ1-B-NOPF-CENTNOPMD";
890 
891  // Get the downscale factor for whichever MB trigger exists in the given run
892  std::vector<TString> runtriggers = downscaleOCDB->GetTriggerClasses();
893  Double_t downscalefactor;
894  for (auto i : runtriggers) {
895  if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
896  downscalefactor = downscaleOCDB->GetDownscaleFactorForTriggerClass(i.Data());
897  break;
898  }
899  }
900 
901  // Store the inverse of the downscale factor, used later to weight the pT spectrum
902  fMBUpscaleFactor = 1/downscalefactor;
903 
904  TString histname = "Trigger/hMBDownscaleFactor";
905  fHistManager.FillTH1(histname.Data(), fMBUpscaleFactor);
906 
907  }
908 
909 }
910 
915 {
916  if (fUseAliEventCuts) {
917  if (!fEventCuts.AcceptEvent(InputEvent()))
918  {
919  PostData(1, fOutput);
920  return kFALSE;
921  }
922  }
923  else {
925  }
926  return kTRUE;
927 }
928 
937 {
938  TString histname;
939  AliJetContainer* jetCont = 0;
940  TIter next(&fJetCollArray);
941  while ((jetCont = static_cast<AliJetContainer*>(next()))) {
942  TString jetContName = jetCont->GetName();
943 
944  // Compute the full jet background scale factor and delta-pt
945  if (fComputeBackground) {
947  }
948 
949  // Do a simple trigger simulation (if requested)
950  if (fDoTriggerSimulation) {
952  }
953 
954  }
955 
956  // Only fill the embedding qa plots if:
957  // - We are using the embedding helper
958  // - The class has been initialized
959  // - Both jet collections are available
960  if (fEmbeddingQA.IsInitialized()) {
962  }
963 
964  return kTRUE;
965 }
966 
971 {
972  TString histname;
973 
974  // Check if trigger patches are loaded
975  if (fTriggerPatchInfo) {
976  TString objname(fTriggerPatchInfo->GetClass()->GetName());
977  TClass cls(objname);
978  if (!cls.InheritsFrom("AliEMCALTriggerPatchInfo")) {
979  AliError(Form("%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
980  GetName(), cls.GetName(), "EmcalTriggers"));
981  fTriggerPatchInfo = 0;
982  }
983  }
984  if (!fTriggerPatchInfo) {
985  AliError(Form("%s: Unable to get trigger patch container with name %s. Aborting", GetName(), "EmcalTriggers"));
986  return;
987  }
988 
989  // Compute patches in EMCal, DCal (I want offline simple trigger patch, i.e. patch calculated using FEE energy)
990  std::vector<Double_t> vecEMCal;
991  std::vector<Double_t> vecDCal;
992  for(auto p : *fTriggerPatchInfo){
993  AliEMCALTriggerPatchInfo *recpatch = static_cast<AliEMCALTriggerPatchInfo *>(p);
994  if (recpatch) {
995 
996  if(!recpatch->IsJetHighSimple()) continue;
997 
998  histname = "TriggerSimHistograms/hEtaVsPhi";
999  fHistManager.FillTH2(histname.Data(), recpatch->GetEtaGeo(), recpatch->GetPhiGeo());
1000 
1001  histname = "TriggerSimHistograms/hPatchE";
1002  fHistManager.FillTH2(histname.Data(), fCent, recpatch->GetPatchE());
1003 
1004  if (recpatch->IsEMCal()) {
1005  vecEMCal.push_back(recpatch->GetPatchE());
1006  } else {
1007  vecDCal.push_back(recpatch->GetPatchE());
1008  }
1009 
1010  }
1011  }
1012 
1013  // Compute the median in each calorimeter
1014  const Int_t nBkgPatchesEMCal = vecEMCal.size(); // 6*8;
1015  const Int_t nBkgPatchesDCal = vecDCal.size(); // 4*5;
1016  fMedianEMCal = TMath::Median(nBkgPatchesEMCal, &vecEMCal[0]); // point to array used internally by vector
1017  fMedianDCal = TMath::Median(nBkgPatchesDCal, &vecDCal[0]);
1018 
1019  histname = "TriggerSimHistograms/hPatchMedianE";
1020  fHistManager.FillTH3(histname.Data(), fCent, fMedianEMCal, kEMCal);
1021  fHistManager.FillTH3(histname.Data(), fCent, fMedianDCal, kDCal);
1022 
1023  histname = "TriggerSimHistograms/hNPatches";
1024  fHistManager.FillTH2(histname.Data(), nBkgPatchesEMCal, kEMCal);
1025  fHistManager.FillTH2(histname.Data(), nBkgPatchesDCal, kDCal);
1026 
1027  // Then compute background subtracted patches, by subtracting from each patch the median patch E from the opposite hemisphere
1028  // If a patch is above threshold, the event is "triggered"
1029  Bool_t fkEMCEJE = kFALSE;
1030  Double_t threshold = 20;
1031  for(auto p : *fTriggerPatchInfo){
1032  AliEMCALTriggerPatchInfo *recpatch = static_cast<AliEMCALTriggerPatchInfo *>(p);
1033  if (recpatch) {
1034 
1035  if(!recpatch->IsJetHighSimple()) continue;
1036 
1037  if (recpatch->IsEMCal()) {
1038  if ((recpatch->GetPatchE() - fMedianDCal) > threshold) {
1039  fkEMCEJE = kTRUE;
1040  break;
1041  }
1042  } else {
1043  if ((recpatch->GetPatchE() - fMedianEMCal) > threshold) {
1044  fkEMCEJE = kTRUE;
1045  break;
1046  }
1047  }
1048  }
1049  }
1050 
1051  if (fkEMCEJE) {
1053  }
1054 
1055 }
1056 
1064 {
1065 
1066  if (fPlotJetHistograms) {
1068  }
1069  if (fPlotClusterHistograms) {
1071  }
1074  }
1077  }
1078 
1079  return kTRUE;
1080 }
1081 
1087 {
1088  TString histname;
1089  AliJetContainer* jets = 0;
1090  TIter nextJetColl(&fJetCollArray);
1091  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1092  TString jetContName = jets->GetName();
1093 
1094  Double_t rhoVal = 0;
1095  if (jets->GetRhoParameter()) {
1096  rhoVal = jets->GetRhoVal();
1097  histname = TString::Format("%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1098  fHistManager.FillTH2(histname.Data(), fCent, rhoVal);
1099  }
1100 
1101  for (auto jet : jets->all()) {
1102 
1103  Float_t ptLeading = jets->GetLeadingHadronPt(jet);
1104  Float_t corrPt = GetJetPt(jet, rhoVal);
1105 
1106  // A vs. pT (fill before area cut)
1107  histname = TString::Format("%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1108  fHistManager.FillTH2(histname.Data(), corrPt, jet->Area());
1109 
1110 
1111  // Rejection reason
1112  UInt_t rejectionReason = 0;
1113  if (!jets->AcceptJet(jet, rejectionReason)) {
1114  histname = TString::Format("%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1115  fHistManager.FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
1116  continue;
1117  }
1118 
1119  // compute jet acceptance type
1120  Double_t type = GetJetType(jet);
1121  if ( (type != kEMCal) && (type != kDCal) ) {
1122  continue;
1123  }
1124 
1125  // (Centrality, pT, NEF)
1126  if (type == kEMCal) {
1127  histname = TString::Format("%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
1128  }
1129  else if (type == kDCal) {
1130  histname = TString::Format("%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
1131  }
1132  fHistManager.FillTH3(histname, fCent, corrPt, jet->NEF());
1133 
1134  // (Centrality, pT upscaled, calo type)
1135  if (fComputeMBDownscaling) {
1136  histname = TString::Format("%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1137  fHistManager.FillTH3(histname.Data(), fCent, corrPt, type, fMBUpscaleFactor);
1138  }
1139 
1140  // pT-leading vs. pT
1141  histname = TString::Format("%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1142  fHistManager.FillTH2(histname.Data(), corrPt, ptLeading);
1143 
1144  // (Centrality, pT, z-leading (charged))
1145  if (type == kEMCal) {
1146  histname = TString::Format("%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1147  }
1148  else if (type == kDCal) {
1149  histname = TString::Format("%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1150  }
1151  TLorentzVector leadPart;
1152  jets->GetLeadingHadronMomentum(leadPart, jet);
1153  Double_t z = GetParallelFraction(leadPart.Vect(), jet);
1154  if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999; // so that it will contribute to the bin <1
1155  fHistManager.FillTH3(histname, fCent, corrPt, z);
1156 
1157  // (Centrality, pT, z (charged))
1158  if (type == kEMCal) {
1159  histname = TString::Format("%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1160  }
1161  else if (type == kDCal) {
1162  histname = TString::Format("%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1163  }
1164  const AliVTrack* track;
1165  for (Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1166  track = static_cast<AliVTrack*>(jet->Track(i));
1167  z = track->Pt() / TMath::Abs(corrPt);
1168  fHistManager.FillTH3(histname, fCent, corrPt, z);
1169  }
1170 
1171  // (Centrality, pT, Nconst)
1172  if (type == kEMCal) {
1173  histname = TString::Format("%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1174  }
1175  else if (type == kDCal) {
1176  histname = TString::Format("%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1177  }
1178  fHistManager.FillTH3(histname, fCent, corrPt, 1.*jet->GetNumberOfConstituents());
1179 
1180  // (Centrality, jet pT, Enonlincorr - Ehadcorr)
1181  Double_t deltaEhadcorr = 0;
1182  const AliVCluster* clus = nullptr;
1183  Int_t nClusters = jet->GetNumberOfClusters();
1184  for (Int_t iClus = 0; iClus < nClusters; iClus++) {
1185  clus = jet->Cluster(iClus);
1186  deltaEhadcorr += (clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy());
1187  }
1188 
1189  histname = TString::Format("%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
1190  fHistManager.FillTH3(histname, fCent, corrPt, deltaEhadcorr);
1191 
1192 
1193  // (Median patch energy, calo type, jet pT, centrality)
1194  if (fDoTriggerSimulation) {
1195  histname = TString::Format("%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
1196  Double_t x[4] = {fMedianEMCal, kEMCal, corrPt, fCent};
1197  fHistManager.FillTHnSparse(histname, x);
1198  Double_t y[4] = {fMedianDCal, kDCal, corrPt, fCent};
1199  fHistManager.FillTHnSparse(histname, y);
1200  }
1201 
1202  } //jet loop
1203 
1204  }
1205 }
1206 
1207 /*
1208  * This function fills the histograms for the calorimeter performance study.
1209  */
1211 {
1212  TString histname;
1213 
1214  // Loop through clusters
1216  const AliVCluster* clus;
1217  for (auto it : clusters->accepted_momentum()) {
1218 
1219  clus = it.second;
1220  Double_t clusPhi = it.first.Phi_0_2pi();
1221  Double_t clusEta = it.first.Eta();
1222 
1223  // Include only EMCal/DCal clusters
1224  if (!clus->IsEMCAL()) {
1225  continue;
1226  }
1227 
1228  // Compute the sum of matched track momentum, and various track matching / hadronic corretion quantities
1229  Double_t trackPSum = 0;
1230  Int_t nTracksMatched = 0;
1231  const AliVTrack* track = nullptr;
1232  for (Int_t itrack=0; itrack < clus->GetNTracksMatched(); itrack++) {
1233  track = dynamic_cast<AliVTrack*>(clus->GetTrackMatched(itrack));
1234  if (!track) {
1235  continue;
1236  }
1237 
1238  Double_t trackPhi = TVector2::Phi_0_2pi(track->GetTrackPhiOnEMCal());
1239  Double_t trackEta = track->GetTrackEtaOnEMCal();
1240  Double_t deta = TMath::Abs(clusPhi - trackPhi);
1241  Double_t dphi = TMath::Abs(clusEta - trackEta);
1242 
1244  trackPSum += track->P();
1245  nTracksMatched++;
1246  }
1247  }
1248 
1249  Double_t EoverP = 0;
1250  if (trackPSum > 1e-3) {
1251  EoverP = clus->GetNonLinCorrEnergy() / trackPSum;
1252  }
1253 
1254  Double_t deltaE = clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy();
1255  Double_t Rcorr = 0;
1256  if (trackPSum > 1e-3) {
1257  Rcorr = deltaE / trackPSum;
1258  }
1259  Double_t RcorrClus = deltaE / clus->GetNonLinCorrEnergy();
1260 
1263 
1264  // Fill M02 distribution (centrality, Eclus nonlincorr, M02)
1265  histname = "ClusterHistograms/hM02";
1266  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), clus->GetM02());
1267 
1268  // Plot Ncell distribution for M02 > 0.4 or M02 < 0.4 (centrality, Eclus nonlincorr, Ncells)
1269  if (clus->GetM02() > 0.4) {
1270  histname = "ClusterHistograms/hNcellsM02G04";
1271  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), clus->GetNCells());
1272  }
1273  if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1274  histname = "ClusterHistograms/hNcellsM02L04";
1275  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), clus->GetNCells());
1276  }
1277 
1280 
1281  // Plot matched track pT (centrality, Eclus nonlincorr, trackPsum)
1282  histname = "ClusterHistograms/hMatchedTrackPt";
1283  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), trackPSum);
1284 
1285  if (clus->GetM02() > 0.4) {
1286  histname = "ClusterHistograms/hMatchedTrackPtM02G04";
1287  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), trackPSum);
1288  }
1289  if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1290  histname = "ClusterHistograms/hMatchedTrackPtM02L04";
1291  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), trackPSum);
1292  }
1293 
1294  // Plot number of matched tracks (centrality, Eclus nonlincorr, N matches)
1295  histname = "ClusterHistograms/hMatchedTrackN";
1296  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), nTracksMatched);
1297 
1298  if (clus->GetM02() > 0.4) {
1299  histname = "ClusterHistograms/hMatchedTrackNM02G04";
1300  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), nTracksMatched);
1301  }
1302  if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1303  histname = "ClusterHistograms/hMatchedTrackNM02L04";
1304  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), nTracksMatched);
1305  }
1306 
1307  // Plot M02 distribution for clusters with matched tracks (centrality, Eclus nonlincorr, M02)
1308  histname = "ClusterHistograms/hM02Matched";
1309  if (nTracksMatched > 0) {
1310  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), clus->GetM02());
1311  }
1312 
1313  // Plot M02 distribution for clusters without matched tracks (centrality, Eclus nonlincorr, M02)
1314  histname = "ClusterHistograms/hM02Unmatched";
1315  if (nTracksMatched == 0) {
1316  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), clus->GetM02());
1317  }
1318 
1321 
1322  // Plot E/p (centrality, Eclus nonlincorr, Eclus nonlincorr / trackPsum)
1323  histname = "ClusterHistograms/hEoverP";
1324  fHistManager.FillTH3(histname, fCent, clus->GetNonLinCorrEnergy(), EoverP);
1325 
1326  // Plot E/p vs. M02 for 0-10% (Eclus nonlincorr, Eclus nonlincorr / trackPsum, M02)
1327  histname = "ClusterHistograms/hEoverPM02";
1328  if (fCent < 10) {
1329  fHistManager.FillTH3(histname, clus->GetNonLinCorrEnergy(), EoverP, clus->GetM02());
1330  }
1331 
1334 
1335  // Fill Rcorr distribution (centrality, trackPSum, Rcorr = (Enonlincorr - Ehadcorr) / trackPSum)
1336  histname = "ClusterHistograms/hRcorrVsCent";
1337  fHistManager.FillTH3(histname, fCent, trackPSum, Rcorr);
1338 
1339  // Fill Rcorr distribution for 0-10% centrality (Eclus nonlincorr, trackPSum, Rcorr)
1340  if (fCent > 0 && fCent < 10) {
1341  histname = "ClusterHistograms/hRcorr0-10";
1342  fHistManager.FillTH3(histname, clus->GetNonLinCorrEnergy(), trackPSum, Rcorr);
1343  }
1344 
1345  // Fill Rcorr distribution for 50-90% centrality (Eclus nonlincorr, trackPSum, Rcorr)
1346  if (fCent > 50 && fCent < 90) {
1347  histname = "ClusterHistograms/hRcorr50-90";
1348  fHistManager.FillTH3(histname, clus->GetNonLinCorrEnergy(), trackPSum, Rcorr);
1349  }
1350 
1351  // Fill also Rcorr-clus (centrality, trackPSum, Rcorr-clus = (Enonlincorr - Ehadcorr) / Enonlincorr )
1352  histname = "ClusterHistograms/hRcorrClusVsCent";
1353  fHistManager.FillTH3(histname, fCent, trackPSum, RcorrClus);
1354 
1355  // Fill Rcorr-clus for 0-10% centrality (Eclus nonlincorr, trackPSum, Rcorr-clus = (Enonlincorr - Ehadcorr) / Enonlincorr )
1356  if (fCent > 0 && fCent < 10) {
1357  histname = "ClusterHistograms/hRcorrClus0-10";
1358  fHistManager.FillTH3(histname, clus->GetNonLinCorrEnergy(), trackPSum, RcorrClus);
1359  }
1360 
1361  // Fill Rcorr-clus for 50-90% centrality (Eclus nonlincorr, trackPSum, Rcorr-clus = (Enonlincorr - Ehadcorr) / Enonlincorr )
1362  if (fCent > 50 && fCent < 90) {
1363  histname = "ClusterHistograms/hRcorrClus50-90";
1364  fHistManager.FillTH3(histname, clus->GetNonLinCorrEnergy(), trackPSum, RcorrClus);
1365  }
1366 
1367  }
1368 
1369 }
1370 
1371 /*
1372  * This function fills the histograms for the calorimeter performance study.
1373  */
1375 {
1376  TString histname;
1377 
1378  // If MC, get the MC event
1379  const AliMCEvent* mcevent = nullptr;
1380  if (fGeneratorLevel) {
1381  mcevent = MCEvent();
1382  }
1383  else {
1384  return;
1385  }
1386 
1387  // Loop through clusters, and plot M02 for each particle type
1389  const AliVCluster* clus;
1390  for (auto it : clusters->accepted_momentum()) {
1391 
1392  clus = it.second;
1393 
1394  // Include only EMCal clusters (reject DCal and PHOS clusters)
1395  if (!clus->IsEMCAL()) {
1396  continue;
1397  }
1398  if (it.first.Phi_0_2pi() > fgkEMCalDCalPhiDivide) {
1399  continue;
1400  }
1401 
1402  // If MC, determine the particle type
1403  // Each detector-level cluster contains an array of labels of each truth-level particle contributing to the cluster
1404  ParticleType particleType1 = kUndefined;
1405 
1406  Int_t label = TMath::Abs(clus->GetLabel()); // returns mc-label of particle that deposited the most energy in the cluster
1407  if (label > 0) { // if the particle has a truth-level match, the label is > 0
1408 
1409  // Method 1: Use AliMCAnalysisUtils to identify all particles
1410  particleType1 = GetParticleType1(clus, mcevent, clusters->GetArray());
1411 
1412  }
1413 
1414  // (M02, Eclus, part type)
1415  histname = "JetPerformance/hM02VsParticleType";
1416  fHistManager.FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType1);
1417 
1418  }
1419 
1420  // Loop through jets, to fill various histograms
1421  AliJetContainer* jets = GetJetContainer(0); // there is only a single, det-level jet finder here
1422  for (const auto jet : jets->accepted()) {
1423 
1424  Double_t jetPt = GetJetPt(jet, 0);
1425 
1426  // Keep track of hadronic calo energy in each jet
1427  Double_t hadCaloEnergyUnmatched = 0;
1428  Double_t hadCaloEnergyMatchedNonlincorr = 0;
1429  Double_t hadCaloEnergyMatchedHadCorr = 0;
1430 
1431  // Loop through clusters in each jet, to plot several histograms
1432  Int_t nClusters = jet->GetNumberOfClusters();
1433  for (Int_t iClus = 0; iClus < nClusters; iClus++) {
1434 
1435  clus = jet->Cluster(iClus);
1436 
1437  // Get the particle type of the cluster
1438  ParticleType particleType1 = kUndefined;
1439  Int_t label = TMath::Abs(clus->GetLabel());
1440  if (label > 0) {
1441  particleType1 = GetParticleType1(clus, mcevent, clusters->GetArray());
1442  }
1443 
1444  // Plot M02 for each particle type
1445  histname = "JetPerformance/hM02VsParticleTypeJets";
1446  Double_t x[4] = {clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType1, jetPt};
1447  fHistManager.FillTHnSparse(histname, x);
1448 
1449  // If the cluster is a hadron, sum its energy to compute the jet's hadronic calo energy
1450  if (particleType1 == kHadron) {
1451  Bool_t hasMatchedTrack = (clus->GetNTracksMatched() > 0);
1452  //Bool_t hasMatchedTrack = ((clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy()) > 1e-3);
1453  if (hasMatchedTrack) {
1454  hadCaloEnergyMatchedNonlincorr += clus->GetNonLinCorrEnergy();
1455  hadCaloEnergyMatchedHadCorr += clus->GetHadCorrEnergy();
1456  }
1457  else {
1458  hadCaloEnergyUnmatched += clus->GetNonLinCorrEnergy();
1459  }
1460  }
1461 
1462  }
1463 
1464  // Fill hadronic calo energy in each jet
1465 
1466  // (Jet pT, Summed energy of hadronic clusters without a matched track)
1467  histname = "JetPerformance/hHadCaloEnergyUnmatched";
1468  fHistManager.FillTH2(histname, jetPt, hadCaloEnergyUnmatched);
1469 
1470  // (Jet pT vs. Summed energy of hadronic clusters with a matched track (before hadronic correction))
1471  histname = "JetPerformance/hHadCaloEnergyMatchedNonlincorr";
1472  fHistManager.FillTH2(histname, jetPt, hadCaloEnergyMatchedNonlincorr);
1473 
1474  // (Jet pT vs. Summed energy of hadronic clusters with a matched track (after hadronic correction))
1475  histname = "JetPerformance/hHadCaloEnergyMatchedHadCorr";
1476  fHistManager.FillTH2(histname, jetPt, hadCaloEnergyMatchedHadCorr);
1477 
1478  // Loop through particle types, and plot jet composition for each particle type
1479  histname = "JetPerformance/hJetComposition";
1480  for (Int_t type = 0; type < 8; type++) {
1481 
1482  ParticleType particleType1 = kUndefined;
1483  Double_t nSum = 0;
1484  Double_t pTsum = 0;
1485 
1486  // Loop through clusters in jet, and add to sum if cluster matches particle type
1487  for (Int_t iClus = 0; iClus < nClusters; iClus++) {
1488 
1489  clus = jet->Cluster(iClus);
1490 
1491  Int_t label = TMath::Abs(clus->GetLabel());
1492  if (label > 0) {
1493  particleType1 = GetParticleType1(clus, mcevent, clusters->GetArray());
1494  }
1495 
1496  if (type == particleType1) {
1497  nSum++;
1498  pTsum += clus->GetNonLinCorrEnergy();
1499  }
1500  }
1501 
1502  // Fill jet composition histogram
1503  Double_t x[4] = {jetPt, 1.*type, nSum, pTsum};
1504  fHistManager.FillTHnSparse(histname, x);
1505 
1506  }
1507  }
1508 }
1509 
1514 {
1515  // Loop over tracks and clusters in order to:
1516  // (1) Compute scale factor for full jets
1517  // (2) Compute delta-pT for full jets, with the random cone method
1518 
1519  // Define the acceptance boundaries for the TPC and EMCal/DCal/PHOS
1520  Double_t etaTPC = 0.9;
1521  Double_t etaEMCal = 0.7;
1522  //Double_t etaMinDCal = 0.22;
1523  Double_t phiMinEMCal = fGeom->GetArm1PhiMin() * TMath::DegToRad(); // 80
1524  Double_t phiMaxEMCal = fGeom->GetEMCALPhiMax() * TMath::DegToRad(); // ~188
1525  //Double_t phiMinDCal = fGeom->GetDCALPhiMin() * TMath::DegToRad(); // 260
1526  //Double_t phiMaxDCal = fGeom->GetDCALPhiMax() * TMath::DegToRad(); // ~327 (1/3 SMs start at 320)
1527 
1528  Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
1529  Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
1530  //Double_t accDCalRegion = 2 * etaEMCal * (phiMaxDCal - phiMinDCal);
1531 
1532  // Loop over jet containers
1533  AliJetContainer* jetCont = 0;
1534  TIter nextJetColl(&fJetCollArray);
1535  while ((jetCont = static_cast<AliJetContainer*>(nextJetColl()))) {
1536 
1537  // Define fiducial acceptances, to be used to generate random cones
1538  TRandom3* r = new TRandom3(0);
1539  Double_t jetR = jetCont->GetJetRadius();
1540  Double_t etaEMCalfid = etaEMCal - jetR;
1541  Double_t phiMinEMCalfid = phiMinEMCal + jetR;
1542  Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
1543 
1544  // Generate EMCal random cone eta-phi
1545  Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
1546  Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
1547 
1548  // Initialize the various sums to 0
1549  Double_t trackPtSumTPC = 0;
1550  Double_t trackPtSumEMCal = 0;
1551  Double_t trackPtSumEMCalRC = 0;
1552  Double_t clusESumEMCal = 0;
1553  Double_t clusESumEMCalRC = 0;
1554 
1555  // Define a 2D vector (initialized to 0) to store the sum of track pT, and another for cluster ET
1556  std::vector<std::vector<Double_t>> trackPtSumDCalRC(fNEtaBins, std::vector<Double_t>(fNPhiBins));
1557  std::vector<std::vector<Double_t>> clusESumDCalRC(fNEtaBins, std::vector<Double_t>(fNPhiBins));
1558 
1559  // Loop over tracks. Sum the track pT:
1560  // (1) in the entire TPC, (2) in the EMCal, (3) in the EMCal random cone,
1561  AliTrackContainer* trackCont = dynamic_cast<AliTrackContainer*>(GetParticleContainer("tracks"));
1562  AliTLorentzVector track;
1563  Double_t trackEta;
1564  Double_t trackPhi;
1565  Double_t trackPt;
1566  Double_t deltaR;
1567  for (auto trackIterator : trackCont->accepted_momentum() ) {
1568 
1569  track.Clear();
1570  track = trackIterator.first;
1571  trackEta = track.Eta();
1572  trackPhi = track.Phi_0_2pi();
1573  trackPt = track.Pt();
1574 
1575  // (1)
1576  if (TMath::Abs(trackEta) < etaTPC) {
1577  trackPtSumTPC += trackPt;
1578  }
1579 
1580  // (2)
1581  if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
1582  trackPtSumEMCal += trackPt;
1583  }
1584 
1585  // (3)
1586  deltaR = GetDeltaR(&track, etaEMCalRC, phiEMCalRC);
1587  if (deltaR < jetR) {
1588  trackPtSumEMCalRC += trackPt;
1589  }
1590 
1591  }
1592 
1593  // Loop over clusters. Sum the cluster ET:
1594  // (1) in the EMCal, (2) in the EMCal random cone
1596  AliTLorentzVector clus;
1597  Double_t clusEta;
1598  Double_t clusPhi;
1599  Double_t clusE;
1600  for (auto clusIterator : clusCont->accepted_momentum() ) {
1601 
1602  clus.Clear();
1603  clus = clusIterator.first;
1604  clusEta = clus.Eta();
1605  clusPhi = clus.Phi_0_2pi();
1606  clusE = clus.E();
1607 
1608  // (1)
1609  if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
1610  clusESumEMCal += clusE;
1611  }
1612 
1613  // (2)
1614  deltaR = GetDeltaR(&clus, etaEMCalRC, phiEMCalRC);
1615  if (deltaR < jetR) {
1616  clusESumEMCalRC += clusE;
1617  }
1618 
1619  }
1620 
1621  // Compute the scale factor for EMCal, as a function of centrality
1622  Double_t numerator = (trackPtSumEMCal + clusESumEMCal) / accEMCal;
1623  Double_t denominator = trackPtSumTPC / accTPC;
1624  Double_t scaleFactor = numerator / denominator;
1625  TString histname = TString::Format("%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
1626  fHistManager.FillTH2(histname, fCent, scaleFactor);
1627 
1628  // Compute delta pT for EMCal, as a function of centrality
1629  Double_t rho = jetCont->GetRhoVal();
1630  Double_t deltaPt = trackPtSumEMCalRC + clusESumEMCalRC - rho * TMath::Pi() * jetR * jetR;
1631  histname = TString::Format("%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
1632  fHistManager.FillTH2(histname, fCent, deltaPt);
1633 
1634  delete r;
1635 
1636  }
1637 
1638 }
1639 
1645 {
1646  TString histname;
1647  AliJetContainer* jets = 0;
1648  TIter nextJetColl(&fJetCollArray);
1649  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1650  TString jetContName = jets->GetName();
1651 
1652  Double_t rhoVal = 0;
1653  if (jets->GetRhoParameter()) {
1654  rhoVal = jets->GetRhoVal();
1655  histname = TString::Format("%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
1656  fHistManager.FillTH2(histname.Data(), fCent, rhoVal);
1657  }
1658 
1659  for (auto jet : jets->all()) {
1660 
1661  Float_t ptLeading = jets->GetLeadingHadronPt(jet);
1662  Float_t corrPt = GetJetPt(jet, rhoVal);
1663 
1664  // A vs. pT (fill before area cut)
1665  histname = TString::Format("%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
1666  fHistManager.FillTH2(histname.Data(), corrPt, jet->Area());
1667 
1668  // Rejection reason
1669  UInt_t rejectionReason = 0;
1670  if (!jets->AcceptJet(jet, rejectionReason)) {
1671  histname = TString::Format("%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1672  fHistManager.FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
1673  continue;
1674  }
1675 
1676  // compute jet acceptance type
1677  Double_t type = GetJetType(jet);
1678  if ( (type != kEMCal) && (type != kDCal) ) {
1679  continue;
1680  }
1681 
1682  // (Centrality, pT, NEF, calo type)
1683  if (type == kEMCal) {
1684  histname = TString::Format("%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
1685  }
1686  else if (type == kDCal) {
1687  histname = TString::Format("%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
1688  }
1689  fHistManager.FillTH3(histname, fCent, corrPt, jet->NEF());
1690 
1691  // pT-leading vs. pT
1692  histname = TString::Format("%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1693  fHistManager.FillTH2(histname.Data(), corrPt, ptLeading);
1694 
1695  // (Centrality, pT, z-leading (charged), calo type)
1696  if (type == kEMCal) {
1697  histname = TString::Format("%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1698  }
1699  else if (type == kDCal) {
1700  histname = TString::Format("%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1701  }
1702  TLorentzVector leadPart;
1703  jets->GetLeadingHadronMomentum(leadPart, jet);
1704  Double_t z = GetParallelFraction(leadPart.Vect(), jet);
1705  if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999; // so that it will contribute to the bin <1
1706  fHistManager.FillTH3(histname, fCent, corrPt, z);
1707 
1708  // (Centrality, pT, z (charged), calo type)
1709  if (type == kEMCal) {
1710  histname = TString::Format("%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1711  }
1712  else if (type == kDCal) {
1713  histname = TString::Format("%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1714  }
1715  const AliVTrack* track;
1716  for (Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1717  track = static_cast<AliVTrack*>(jet->Track(i));
1718  z = track->Pt() / TMath::Abs(corrPt);
1719  fHistManager.FillTH3(histname, fCent, corrPt, z);
1720  }
1721 
1722  // (Centrality, pT, Nconst)
1723  if (type == kEMCal) {
1724  histname = TString::Format("%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1725  }
1726  else if (type == kDCal) {
1727  histname = TString::Format("%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1728  }
1729  fHistManager.FillTH3(histname, fCent, corrPt, 1.*jet->GetNumberOfConstituents());
1730 
1731  } //jet loop
1732 
1733  }
1734 }
1735 
1741 {
1742  TString histname;
1743  AliJetContainer* jets = 0;
1744  const AliEmcalJet* matchedJet = nullptr;
1745  TIter nextJetColl(&fJetCollArray);
1746  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1747  TString jetContName = jets->GetName();
1748 
1749  // Only loop over jets in the detector-level jet container
1750  if (jetContName.Contains("mcparticles")) {
1751  continue;
1752  }
1753 
1754  Double_t rhoVal = 0;
1755  if (jets->GetRhoParameter()) {
1756  rhoVal = jets->GetRhoVal();
1757  }
1758 
1759  for (auto jet : jets->accepted()) {
1760 
1761  // Get the matched jet, if it exists
1762  matchedJet = jet->MatchedJet();
1763  if (!matchedJet) {
1764  continue;
1765  }
1766 
1767  // compute jet acceptance type
1768  Double_t type = GetJetType(jet);
1769  if ( (type != kEMCal) && (type != kDCal) ) {
1770  continue;
1771  }
1772 
1773  Float_t detPt = GetJetPt(jet, rhoVal);
1774  Float_t truthPt = matchedJet->Pt();
1775 
1776  // Fill response matrix (centrality, pT-truth, pT-det)
1777  if (type == kEMCal) {
1778  histname = "MatchedJetHistograms/hResponseMatrixEMCal";
1779  }
1780  else if (type == kDCal) {
1781  histname = "MatchedJetHistograms/hResponseMatrixDCal";
1782  }
1783  fHistManager.FillTH3(histname, fCent, truthPt, detPt);
1784 
1785  // Fill JES shift (centrality, pT-truth, (pT-det - pT-truth) / pT-truth)
1786  if (type == kEMCal) {
1787  histname = "MatchedJetHistograms/hJESshiftEMCal";
1788  }
1789  else if (type == kDCal) {
1790  histname = "MatchedJetHistograms/hJESshiftDCal";
1791  }
1792  fHistManager.FillTH3(histname, fCent, truthPt, (detPt-truthPt)/truthPt );
1793 
1794  // Fill NEF of det-level matched jets (centrality, pT-truth, NEF)
1795  histname = "MatchedJetHistograms/hNEFVsPt";
1796  fHistManager.FillTH3(histname, fCent, truthPt, jet->NEF());
1797 
1798  // Fill z-leading (charged) of det-level matched jets (centrality, pT-truth, z-leading)
1799  histname = "MatchedJetHistograms/hZLeadingVsPt";
1800  TLorentzVector leadPart;
1801  jets->GetLeadingHadronMomentum(leadPart, jet);
1802  Double_t z = GetParallelFraction(leadPart.Vect(), jet);
1803  if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999; // so that it will contribute to the bin <1
1804  fHistManager.FillTH3(histname, fCent, truthPt, z);
1805 
1806  // Fill matching distance (centrality, pT-truth, R)
1807  histname = "MatchedJetHistograms/hMatchingDistance";
1808  fHistManager.FillTH3(histname, fCent, truthPt, jet->ClosestJetDistance());
1809 
1810  } //jet loop
1811  }
1812 }
1813 
1814 /*
1815  * Compute the MC particle type using AliMCAnalysisUtils
1816  */
1817 AliAnalysisTaskEmcalJetPerformance::ParticleType AliAnalysisTaskEmcalJetPerformance::GetParticleType1(const AliVCluster* clus, const AliMCEvent* mcevent, const TClonesArray* clusArray)
1818 {
1819  ParticleType particleType = kUndefined;
1820 
1821  AliMCAnalysisUtils mcUtils;
1822  Int_t tag = mcUtils.CheckOrigin(clus->GetLabels(), clus->GetNLabels(), mcevent, clusArray);
1823 
1824  Bool_t isPhoton = mcUtils.CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton);
1825  Bool_t isPi0 = mcUtils.CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0);
1826  Bool_t isConversion = mcUtils.CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion);
1827  Bool_t isEta = mcUtils.CheckTagBit(tag, AliMCAnalysisUtils::kMCEta);
1828  Bool_t isPion = mcUtils.CheckTagBit(tag, AliMCAnalysisUtils::kMCPion);
1829  Bool_t isKaon = mcUtils.CheckTagBit(tag, AliMCAnalysisUtils::kMCKaon);
1830  Bool_t isProton = mcUtils.CheckTagBit(tag, AliMCAnalysisUtils::kMCProton);
1831  Bool_t isAntiProton = mcUtils.CheckTagBit(tag, AliMCAnalysisUtils::kMCAntiProton);
1832  Bool_t isNeutron = mcUtils.CheckTagBit(tag, AliMCAnalysisUtils::kMCNeutron);
1833  Bool_t isAntiNeutron = mcUtils.CheckTagBit(tag, AliMCAnalysisUtils::kMCAntiNeutron);
1834  Bool_t isElectron = mcUtils.CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron);
1835  Bool_t isMuon = mcUtils.CheckTagBit(tag, AliMCAnalysisUtils::kMCMuon);
1836 
1837  if (isPi0) {
1838  if (isConversion) {
1839  particleType = kPi0Conversion;
1840  }
1841  else {
1842  particleType = kPi0;
1843  }
1844  }
1845  else if (isEta) {
1846  particleType = kEta;
1847  }
1848  else if (isPhoton) {
1849  particleType = kPhoton;
1850  }
1851  else if (isPion || isKaon || isProton || isAntiProton || isNeutron || isAntiNeutron) {
1852  particleType = kHadron;
1853  }
1854  else if (isElectron) {
1855  particleType = kElectron;
1856  }
1857  else if (isMuon) {
1858  particleType = kMuon;
1859  }
1860  else {
1861  particleType = kOther;
1862  }
1863  return particleType;
1864 }
1865 
1866 /*
1867  * Compute the MC particle type using the MC particle container (and only AliMCAnalysisUtils to find merged pi0)
1868  */
1870 {
1871  ParticleType particleType = kUndefined;
1872 
1873  AliAODMCParticle *part = fGeneratorLevel->GetMCParticleWithLabel(label);
1874  if (part) {
1875 
1876  TString histname = TString::Format("%s/hClusterRejectionReasonMC", clusters->GetArrayName().Data());
1877  UInt_t rejectionReason = 0;
1878  if (!fGeneratorLevel->AcceptMCParticle(part, rejectionReason)) {
1879  fHistManager.FillTH2(histname, fGeneratorLevel->GetRejectionReasonBitPosition(rejectionReason), clus->GetNonLinCorrEnergy());
1880  return particleType;
1881  }
1882 
1883  if (part->GetGeneratorIndex() == 0) { // generator index in cocktail
1884 
1885  // select charged pions, protons, kaons, electrons, muons
1886  Int_t pdg = TMath::Abs(part->PdgCode()); // abs value ensures both particles and antiparticles are included
1887 
1888  if (pdg == 22) { // gamma 22
1889 
1890  AliMCAnalysisUtils mcUtils;
1891  Int_t tag;
1892  mcUtils.CheckOverlapped2GammaDecay(clus->GetLabels(), clus->GetNLabels(), part->GetMother(), mcevent, tag);
1893 
1894  if (mcUtils.CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0)) {
1895  if (mcUtils.CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion)) {
1896  particleType = kPi0Conversion;
1897  }
1898  else {
1899  particleType = kPi0;
1900  }
1901  }
1902  else if (mcUtils.CheckTagBit(tag, AliMCAnalysisUtils::kMCEta)) {
1903  particleType = kEta;
1904  }
1905  else { // direct photon
1906  particleType = kPhoton;
1907  }
1908 
1909  }
1910  else if (pdg == 211 || 2212 || 321 || 2112) { // pi+ 211, proton 2212, K+ 321, neutron 2112
1911  particleType = kHadron;
1912  }
1913  else if (pdg == 11) { // e- 11
1914  particleType = kElectron;
1915  }
1916  else if (pdg == 13) { // mu- 13
1917  particleType = kMuon;
1918  }
1919  else {
1920  particleType = kOther;
1921  }
1922  }
1923  }
1924  return particleType;
1925 }
1926 
1931 {
1932  Double_t deltaPhi = TMath::Abs(part->Phi_0_2pi() - phiRef);
1933  Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
1934  Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
1935  return deltaR;
1936 }
1937 
1942 {
1943  UInt_t jetType = jet->GetJetAcceptanceType();
1944  Double_t type = -1;
1945  if (jetType & AliEmcalJet::kEMCAL) {
1946  type = kEMCal;
1947  }
1948  else if (jetType & AliEmcalJet::kDCALonly) {
1949  type = kDCal;
1950  }
1951 
1952  return type;
1953 }
1954 
1959 {
1960  Double_t pT = jet->Pt() - rho * jet->Area();
1961  return pT;
1962 }
Int_t pdg
Double_t Area() const
Definition: AliEmcalJet.h:130
ParticleType GetParticleType2(const AliVCluster *clus, const AliMCEvent *mcevent, Int_t label, const AliClusterContainer *clusters)
TObjArray fClusterCollArray
cluster collection array
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
Bool_t fUseAliEventCuts
Flag to use AliEventCuts (otherwise AliAnalysisTaskEmcal will be used)
AliJetContainer * GetJetContainer(Int_t i=0) const
UInt_t fOffTrigger
offline trigger for event selection
static AliEmcalDownscaleFactorsOCDB * Instance()
const AliClusterIterableMomentumContainer accepted_momentum() const
Int_t nbinsy
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.
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
void SetCaloTriggerPatchInfoName(const char *n)
Bool_t fPlotClusterHistograms
Set whether to plot cluster histograms.
Int_t CheckOrigin(Int_t label, const AliMCEvent *mcevent)
Double_t GetDeltaR(const AliTLorentzVector *part, Double_t etaRef, Double_t phiRef)
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
ParticleType GetParticleType1(const AliVCluster *clus, const AliMCEvent *mcevent, const TClonesArray *clusArray)
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.
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.
Bool_t fUseManualEventCuts
Flag to use manual event cuts.
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
std::vector< TString > GetTriggerClasses() const
Double_t fCent
!event centrality
Bool_t fPlotJetHistograms
Set whether to enable inclusive jet histograms.
Int_t fNEoverPBins
! number of variable E/p bins
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()
void CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, const AliMCEvent *mcevent, Int_t &tag)
Double_t Pt() const
Definition: AliEmcalJet.h:109
Int_t nbinsx
virtual Bool_t IsEventSelected()
Performing event selection.
static Double_t * GenerateFixedBinArray(Int_t n, Double_t min, Double_t max)
Bool_t fComputeBackground
Set whether to enable study of background.
Pi0 (merged pi0) with conversion of one photon (may be only partially contained in cluster) ...
AliEmcalList * fOutput
!output list
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.
Handler for downscale factors for various triggers obtained from the OCDB.
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
const AliTrackIterableMomentumContainer accepted_momentum() const
Int_t GetRunNumber(TString)
Definition: PlotMuonQA.C:2235
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
DCal acceptance – spans ONLY DCal (no PHOS or gap)
Definition: AliEmcalJet.h:73
Double_t fMedianDCal
! median patch energy in DCal, per event
Class with analysis utils for simulations.
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.
virtual AliAODMCParticle * GetMCParticleWithLabel(Int_t lab) const
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
Bool_t CheckTagBit(Int_t tag, UInt_t test) const
Container for jet within the EMCAL jet framework.
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.
const AliJetIterableContainer all() const
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()
static Double_t fgkEMCalDCalPhiDivide
phi value used to distinguish between DCal and EMCal