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