AliPhysics  2c3d014 (2c3d014)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEmcalDijetImbalance.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 #include <vector>
17 
18 #include <TClonesArray.h>
19 #include <TH1F.h>
20 #include <TH2F.h>
21 #include <TH3.h>
22 #include <TList.h>
23 #include <THnSparse.h>
24 #include <TRandom3.h>
25 #include <TGrid.h>
26 #include <TFile.h>
27 
28 #include <AliVCluster.h>
29 #include <AliVParticle.h>
30 #include <AliLog.h>
31 
32 #include "AliTLorentzVector.h"
33 #include "AliEmcalJet.h"
34 #include "AliRhoParameter.h"
35 #include "AliJetContainer.h"
36 #include "AliParticleContainer.h"
37 #include "AliClusterContainer.h"
38 #include "AliEMCALGeometry.h"
40 #include "AliPHOSGeometry.h"
41 #include "AliOADBContainer.h"
42 #include "AliEMCALTriggerPatchInfo.h"
43 
45 
49 
55  fHistManager(),
56  fEventCuts(0),
57  fEventCutList(0),
58  fUseManualEventCuts(kFALSE),
59  fUseAliEventCuts(kTRUE),
60  fDeltaPhiMin(0),
61  fMinTrigJetPt(0),
62  fMinAssJetPt(0),
63  fDijetLeadingHadronPt(0),
64  fMaxPt(200),
65  fNCentHistBins(0),
66  fCentHistBins(0),
67  fNPtHistBins(0),
68  fPtHistBins(0),
69  fPlotJetHistograms(kFALSE),
70  fPlotDijetCandHistograms(kFALSE),
71  fPlotDijetImbalanceHistograms(kFALSE),
72  fComputeBackground(kFALSE),
73  fDoMomentumBalance(kFALSE),
74  fDoGeometricalMatching(kFALSE),
75  fMatchingJetR(0.2),
76  fTrackConstituentThreshold(0),
77  fClusterConstituentThreshold(0),
78  fMBUpscaleFactor(1.),
79  fNEtaBins(40),
80  fNPhiBins(200),
81  fLoadBackgroundScalingWeights(kTRUE),
82  fBackgroundScalingWeights(0),
83  fGapJetScalingWeights(0),
84  fComputeMBDownscaling(kFALSE),
85  fDoCaloStudy(kFALSE),
86  fDoTriggerSimulation(kFALSE),
87  fMedianEMCal(0),
88  fMedianDCal(0),
89  fkEMCEJE(kFALSE),
90  fPHOSGeo(nullptr)
91 {
95 
96  // Configure base class to set fTriggerPatchInfo to array of trigger patches, each event
97  this->SetCaloTriggerPatchInfoName("EmcalTriggers");
98 }
99 
106  AliAnalysisTaskEmcalJet(name, kTRUE),
107  fHistManager(name),
108  fEventCuts(0),
109  fEventCutList(0),
110  fUseManualEventCuts(kFALSE),
111  fUseAliEventCuts(kTRUE),
112  fDeltaPhiMin(0),
113  fMinTrigJetPt(0),
114  fMinAssJetPt(0),
115  fDijetLeadingHadronPt(0),
116  fMaxPt(200),
117  fNCentHistBins(0),
118  fCentHistBins(0),
119  fNPtHistBins(0),
120  fPtHistBins(0),
121  fPlotJetHistograms(kFALSE),
122  fPlotDijetCandHistograms(kFALSE),
123  fPlotDijetImbalanceHistograms(kFALSE),
124  fComputeBackground(kFALSE),
125  fDoMomentumBalance(kFALSE),
126  fDoGeometricalMatching(kFALSE),
127  fMatchingJetR(0.2),
128  fTrackConstituentThreshold(0),
129  fClusterConstituentThreshold(0),
130  fMBUpscaleFactor(1.),
131  fNEtaBins(40),
132  fNPhiBins(200),
133  fLoadBackgroundScalingWeights(kTRUE),
134  fBackgroundScalingWeights(0),
135  fGapJetScalingWeights(0),
136  fComputeMBDownscaling(kFALSE),
137  fDoCaloStudy(kFALSE),
138  fDoTriggerSimulation(kFALSE),
139  fMedianEMCal(0),
140  fMedianDCal(0),
141  fkEMCEJE(kFALSE),
142  fPHOSGeo(nullptr)
143 {
145  Dijet_t fDijet;
147 
148  // Configure base class to set fTriggerPatchInfo to array of trigger patches, each event
149  this->SetCaloTriggerPatchInfoName("EmcalTriggers");
150 }
151 
156 {
157 }
158 
163 {
164  fNCentHistBins = 4;
166  fCentHistBins[0] = 0;
167  fCentHistBins[1] = 10;
168  fCentHistBins[2] = 30;
169  fCentHistBins[3] = 50;
170  fCentHistBins[4] = 90;
171 
172  fNPtHistBins = 82;
175  GenerateFixedBinArray(7, 0.3, 1, fPtHistBins+6);
176  GenerateFixedBinArray(10, 1, 3, fPtHistBins+13);
177  GenerateFixedBinArray(14, 3, 10, fPtHistBins+23);
178  GenerateFixedBinArray(10, 10, 20, fPtHistBins+37);
179  GenerateFixedBinArray(15, 20, 50, fPtHistBins+47);
180  GenerateFixedBinArray(20, 50, 150, fPtHistBins+62);
181 }
182 
188 {
190 
198 
199  TIter next(fHistManager.GetListOfHistograms());
200  TObject* obj = 0;
201  while ((obj = next())) {
202  fOutput->Add(obj);
203  }
204 
205  // Intialize AliEventCuts
206  if (fUseAliEventCuts) {
207  fEventCutList = new TList();
208  fEventCutList ->SetOwner();
209  fEventCutList ->SetName("EventCutOutput");
210 
211  fEventCuts.OverrideAutomaticTriggerSelection(fOffTrigger);
212  if(fUseManualEventCuts==1)
213  {
214  fEventCuts.SetManualMode();
215  // Configure manual settings here
216  // ...
217  }
218  fEventCuts.AddQAplotsToList(fEventCutList);
219  fOutput->Add(fEventCutList);
220  }
221 
222  // Load eta-phi background scale factors from histogram on AliEn
225  }
226 
227  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
228 }
229 
230 /*
231  * This function allocates the histograms for single jets.
232  * A set of histograms is allocated per each jet container.
233  */
235 {
236  TString histname;
237  TString title;
238 
239  Int_t nPtBins = TMath::CeilNint(fMaxPt/2);
240 
241  AliJetContainer* jets = 0;
242  TIter nextJetColl(&fJetCollArray);
243  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
244 
245  // Jet rejection reason
246  histname = TString::Format("%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
247  title = histname + ";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
248  TH2* hist = fHistManager.CreateTH2(histname.Data(), title.Data(), 32, 0, 32, 50, 0, fMaxPt);
249  SetRejectionReasonLabels(hist->GetXaxis());
250 
251  // Rho vs. Centrality
252  if (!jets->GetRhoName().IsNull()) {
253  histname = TString::Format("%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
254  title = histname + ";Centrality (%);#rho (GeV/#it{c});counts";
255  fHistManager.CreateTH2(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 500);
256  }
257 
258  // (Centrality, pT, calo type)
259  histname = TString::Format("%s/JetHistograms/hCentVsPt", jets->GetArrayName().Data());
260  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
261  fHistManager.CreateTH3(histname.Data(), title.Data(), 20, 0, 100, nPtBins, 0, fMaxPt, 3, -0.5, 2.5);
262 
263  // (Centrality, eta, phi, pT, NEF, calo type)
264  histname = TString::Format("%s/JetHistograms/hNEFVsPtVsEtaVsPhi", jets->GetArrayName().Data());
265  title = histname + ";Centrality (%);#eta_{jet} (rad);#phi_{jet} (rad);#it{p}_{T}^{corr} (GeV/#it{c});NEF;type";
266  Int_t nbins1[6] = {20, fNEtaBins, fNPhiBins, nPtBins, 50, 3};
267  Double_t min1[6] = {0, -0.5,1., 0, 0, -0.5};
268  Double_t max1[6] = {100, 0.5,6., fMaxPt, 1., 2.5};
269  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 6, nbins1, min1, max1);
270 
271  // (Centrality, pT upscaled, calo type)
272  histname = TString::Format("%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
273  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
274  fHistManager.CreateTH3(histname.Data(), title.Data(), 20, 0, 100, nPtBins, 0, fMaxPt, 3, -0.5, 2.5, "s");
275 
276  // pT-leading vs. pT
277  histname = TString::Format("%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
278  title = histname + ";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
279  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, nPtBins, 0, fMaxPt);
280 
281  // A vs. pT
282  histname = TString::Format("%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
283  title = histname + ";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
284  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, fMaxPt/3, 0, 0.5);
285 
286  // (Centrality, pT, z-leading (charged), calo type)
287  histname = TString::Format("%s/JetHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
288  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading};type";
289  Int_t nbins2[4] = {20, nPtBins, 50, 3};
290  Double_t min2[4] = {0, 0, 0, -0.5};
291  Double_t max2[4] = {100, fMaxPt, 1., 2.5};
292  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins2, min2, max2);
293 
294  // (Centrality, pT, z (charged), calo type)
295  histname = TString::Format("%s/JetHistograms/hZVsPt", jets->GetArrayName().Data());
296  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z};type";
297  Int_t nbins3[4] = {20, nPtBins, 50, 3};
298  Double_t min3[4] = {0, 0, 0, -0.5};
299  Double_t max3[4] = {100, fMaxPt, 1., 2.5};
300  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins3, min3, max3);
301 
302  // (Centrality, pT, Nconst, calo type)
303  histname = TString::Format("%s/JetHistograms/hNConstVsPt", jets->GetArrayName().Data());
304  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents;type";
305  Int_t nbins4[4] = {20, nPtBins, 50, 3};
306  Double_t min4[4] = {0, 0, 0, -0.5};
307  Double_t max4[4] = {100, fMaxPt, fMaxPt, 2.5};
308  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins4, min4, max4);
309 
310  // (Median patch energy, calo type, jet pT, centrality)
311  if (fDoTriggerSimulation) {
312  histname = TString::Format("%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
313  title = histname + ";#it{E}_{patch,med};type;#it{p}_{T}^{corr} (GeV/#it{c});Centrality (%)";
314  Int_t nbins5[4] = {100, 2, nPtBins, 50};
315  Double_t min5[4] = {0,-0.5, 0, 0};
316  Double_t max5[4] = {50,1.5, fMaxPt, 100};
317  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins5, min5, max5);
318  }
319 
320  // Allocate background subtraction histograms, if enabled
321  if (fComputeBackground) {
322 
323  histname = TString::Format("%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
324  title = histname + ";Centrality;Scale factor;counts";
325  fHistManager.CreateTH2(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 5);
326 
327  histname = TString::Format("%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
328  title = histname + ";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
329  fHistManager.CreateTH2(histname.Data(), title.Data(), 10, 0, 100, 400, -50, 150);
330 
331  histname = TString::Format("%s/BackgroundHistograms/hScaleFactorEtaPhi", jets->GetArrayName().Data());
332  title = histname + ";#eta;#phi;Centrality;Scale factor;";
333  Int_t nbins[4] = {fNEtaBins, fNPhiBins, 50, 400};
334  Double_t min[4] = {-0.5,1., 0, 0};
335  Double_t max[4] = {0.5,6., 100, 20};
336  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins, min, max);
337 
338  histname = TString::Format("%s/BackgroundHistograms/hDeltaPtEtaPhi", jets->GetArrayName().Data());
339  title = histname + ";#eta;#phi;Centrality;#delta#it{p}_{T} (GeV/#it{c})";
340  Int_t nbinsDpT[4] = {fNEtaBins, fNPhiBins, 10, 400};
341  Double_t minDpT[4] = {-0.5,1., 0, -50};
342  Double_t maxDpT[4] = {0.5,6., 100, 150};
343  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbinsDpT, minDpT, maxDpT);
344 
345  }
346 
347  // Plot cluster spectra within jets
348  // (centrality, cluster energy, jet pT, jet eta, jet phi)
349  Int_t dim = 0;
350  TString title[20];
351  Int_t nbins[20] = {0};
352  Double_t min[30] = {0.};
353  Double_t max[30] = {0.};
354  Double_t *binEdges[20] = {0};
355 
357  title[dim] = "Centrality %";
358  nbins[dim] = fNCentHistBins;
359  binEdges[dim] = fCentHistBins;
360  min[dim] = fCentHistBins[0];
361  max[dim] = fCentHistBins[fNCentHistBins];
362  dim++;
363  }
364 
365  title[dim] = "#it{E}_{clus} (GeV)";
366  nbins[dim] = fNPtHistBins;
367  binEdges[dim] = fPtHistBins;
368  min[dim] = fPtHistBins[0];
369  max[dim] = fPtHistBins[fNPtHistBins];
370  dim++;
371 
372  title[dim] = "#it{p}_{T,jet}^{corr}";
373  nbins[dim] = nPtBins;
374  min[dim] = 0;
375  max[dim] = fMaxPt;
376  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
377  dim++;
378 
379  title[dim] = "#eta_{jet}";
380  nbins[dim] = fNEtaBins;
381  min[dim] = -0.5;
382  max[dim] = 0.5;
383  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
384  dim++;
385 
386  title[dim] = "#phi_{jet}";
387  nbins[dim] = fNPhiBins;
388  min[dim] = 1.;
389  max[dim] = 6.;
390  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
391  dim++;
392 
393  TString thnname = TString::Format("%s/JetHistograms/hClustersInJets", jets->GetArrayName().Data());
394  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
395  for (Int_t i = 0; i < dim; i++) {
396  hn->GetAxis(i)->SetTitle(title[i]);
397  hn->SetBinEdges(i, binEdges[i]);
398  }
399 
400  }
401 
402  // MB downscale factor histogram
403  if (fComputeMBDownscaling) {
404  histname = "Trigger/hMBDownscaleFactor";
405  title = histname + ";Downscale factor;counts";
406  TH1* hist = fHistManager.CreateTH1(histname.Data(), title.Data(), 200, 0, 200);
407  }
408 
409 }
410 
411 /*
412  * This function allocates the histograms for dijet candidates, i.e. dijet pairs with the leading jet
413  * passing the trigger condition, but no condition on the subleading jet. In particular this histogram is
414  * designed to study the kinematic selection of dijets.
415  */
417 {
418  // Allocate dijet THnSparse
419  AliJetContainer* jets = 0;
420  TIter nextJetColl(&fJetCollArray);
421  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
422  TString axisTitle[30]= {""};
423  Int_t nbins[30] = {0};
424  Double_t min[30] = {0.};
425  Double_t max[30] = {0.};
426  Double_t *binEdges[20] = {0};
427  Int_t dim = 0;
428 
429  if (fForceBeamType != kpp) {
430  axisTitle[dim] = "Centrality (%)";
431  nbins[dim] = fNCentHistBins;
432  binEdges[dim] = fCentHistBins;
433  min[dim] = fCentHistBins[0];
434  max[dim] = fCentHistBins[fNCentHistBins];
435  dim++;
436  }
437 
438  axisTitle[dim] = "LeadingHadronRequired";
439  nbins[dim] = 2;
440  min[dim] = -0.5;
441  max[dim] = 1.5;
442  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
443  dim++;
444 
445  axisTitle[dim] = "#it{p}_{T,trig jet} (GeV/#it{c})";
446  nbins[dim] = TMath::CeilNint(fMaxPt/2);
447  min[dim] = 0;
448  max[dim] = fMaxPt;
449  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
450  dim++;
451 
452  axisTitle[dim] = "#it{p}_{T,ass jet} (GeV/#it{c})";
453  nbins[dim] = TMath::CeilNint(fMaxPt/2);
454  min[dim] = 0;
455  max[dim] = fMaxPt;
456  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
457  dim++;
458 
459  axisTitle[dim] = "#phi_{trig jet}";
460  nbins[dim] = TMath::CeilNint(fMaxPt/2);
461  min[dim] = 0;
462  max[dim] = TMath::TwoPi();
463  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
464  dim++;
465 
466  axisTitle[dim] = "#phi_{ass jet}";
467  nbins[dim] = TMath::CeilNint(fMaxPt/2);
468  min[dim] = 0;
469  max[dim] = TMath::TwoPi();
470  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
471  dim++;
472 
473  axisTitle[dim] = "#eta_{trig jet}";
474  nbins[dim] = TMath::CeilNint(fMaxPt/2);
475  min[dim] = -1;
476  max[dim] = 1;
477  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
478  dim++;
479 
480  axisTitle[dim] = "#eta_{ass jet}";
481  nbins[dim] = TMath::CeilNint(fMaxPt/2);
482  min[dim] = -1;
483  max[dim] = 1;
484  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
485  dim++;
486 
487  TString thnname = TString::Format("%s/DijetCandObservables", jets->GetArrayName().Data());
488  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
489  for (Int_t i = 0; i < dim; i++) {
490  hn->GetAxis(i)->SetTitle(axisTitle[i]);
491  hn->SetBinEdges(i, binEdges[i]);
492  }
493  }
494 }
495 
496 /*
497  * This function allocates the histograms for accepted dijets.
498  * The purpose is to study in detail the imbalance properties of the accepted dijets.
499  */
501 {
502  AliJetContainer* jets = 0;
503  TIter nextJetColl(&fJetCollArray);
504  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
505 
506  // Allocate dijet imbalance THnSparse, unless doing trigger simulation
507  if (!fDoTriggerSimulation) {
508  TString axisTitle[30]= {""};
509  Int_t nbins[30] = {0};
510  Double_t min[30] = {0.};
511  Double_t max[30] = {0.};
512  Double_t *binEdges[20] = {0};
513  Int_t dim = 0;
514 
515  if (fForceBeamType != kpp) {
516  axisTitle[dim] = "Centrality (%)";
517  nbins[dim] = fNCentHistBins;
518  binEdges[dim] = fCentHistBins;
519  min[dim] = fCentHistBins[0];
520  max[dim] = fCentHistBins[fNCentHistBins];
521  dim++;
522  }
523 
524  axisTitle[dim] = "#Delta#phi";
525  nbins[dim] = 100;
526  min[dim] = 0;
527  max[dim] = 4;
528  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
529  dim++;
530 
531  axisTitle[dim] = "#Delta#eta";
532  nbins[dim] = 100;
533  min[dim] = -2;
534  max[dim] = 2;
535  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
536  dim++;
537 
538  axisTitle[dim] = "A_{J}";
539  nbins[dim] = 100;
540  min[dim] = 0;
541  max[dim] = 1;
542  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
543  dim++;
544 
545  axisTitle[dim] = "x_{J}";
546  nbins[dim] = 100;
547  min[dim] = 0;
548  max[dim] = 1;
549  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
550  dim++;
551 
552  axisTitle[dim] = "k_{Ty} (GeV)";
553  nbins[dim] = 100;
554  min[dim] = 0;
555  max[dim] = 100;
556  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
557  dim++;
558 
559  axisTitle[dim] = "N_{tracks, trig jet}";
560  nbins[dim] = fMaxPt/5;
561  min[dim] = 0;
562  max[dim] = 100;
563  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
564  dim++;
565 
566  axisTitle[dim] = "N_{tracks, ass jet}";
567  nbins[dim] = fMaxPt/5;
568  min[dim] = 0;
569  max[dim] = 100;
570  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
571  dim++;
572 
573  TString thnname = TString::Format("%s/DijetImbalanceObservables", jets->GetArrayName().Data());
574  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
575  for (Int_t i = 0; i < dim; i++) {
576  hn->GetAxis(i)->SetTitle(axisTitle[i]);
577  hn->SetBinEdges(i, binEdges[i]);
578  }
579  }
580 
581  // Now, allocate 2d pt spectrum, upscaled according to MB downscaling factors (for trigger efficiency)
582  Int_t nPtBins = TMath::CeilNint(fMaxPt/2);
583 
584  // (Centrality, pT1, pT2) (upscaled)
585  TString histname = TString::Format("%s/DijetJetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
586  TString title = histname + ";Centrality (%);#it{p}_{T,1}^{corr} (GeV/#it{c});#it{p}_{T,2}^{corr} (GeV/#it{c})";
587  fHistManager.CreateTH3(histname.Data(), title.Data(), 20, 0, 100, nPtBins, 0, fMaxPt, nPtBins, 0, fMaxPt, "s");
588 
589  // Now, plot jet histograms for the leading jet within the dijet (for comparison to single jets, and triggered to MB)
590 
591  // (Centrality, pT, NEF, calo type)
592  histname = TString::Format("%s/DijetJetHistograms/hNEFVsPt", jets->GetArrayName().Data());
593  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF;type";
594  Int_t nbins1[4] = {20, nPtBins, 50, 3};
595  Double_t min1[4] = {0, 0, 0, -0.5};
596  Double_t max1[4] = {100, fMaxPt, 1., 2.5};
597  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins1, min1, max1);
598 
599  // (Centrality, pT, z-leading (charged), calo type)
600  histname = TString::Format("%s/DijetJetHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
601  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading};type";
602  Int_t nbins2[4] = {20, nPtBins, 50, 3};
603  Double_t min2[4] = {0, 0, 0, -0.5};
604  Double_t max2[4] = {100, fMaxPt, 1., 2.5};
605  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins2, min2, max2);
606 
607  // (Centrality, pT, z (charged), calo type)
608  histname = TString::Format("%s/DijetJetHistograms/hZVsPt", jets->GetArrayName().Data());
609  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z};type";
610  Int_t nbins3[4] = {20, nPtBins, 50, 3};
611  Double_t min3[4] = {0, 0, 0, -0.5};
612  Double_t max3[4] = {100, fMaxPt, 1., 2.5};
613  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins3, min3, max3);
614 
615  // (Centrality, pT, Nconst, calo type)
616  histname = TString::Format("%s/DijetJetHistograms/hNConstVsPt", jets->GetArrayName().Data());
617  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents;type";
618  Int_t nbins4[4] = {20, nPtBins, 50, 3};
619  Double_t min4[4] = {0, 0, 0, -0.5};
620  Double_t max4[4] = {100, fMaxPt, fMaxPt, 2.5};
621  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins4, min4, max4);
622  }
623 }
624 
625 /*
626  * This function allocates the histograms for the momentum balance study.
627  */
629 {
630  AliJetContainer* jets = 0;
631  TIter nextJetColl(&fJetCollArray);
632  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
633 
634  // Allocate THnSparse
635  TString axisTitle[30]= {""};
636  Int_t nbins[30] = {0};
637  Double_t min[30] = {0.};
638  Double_t max[30] = {0.};
639  Double_t *binEdges[20] = {0};
640  Int_t dim = 0;
641 
642  axisTitle[dim] = "A_{J}";
643  nbins[dim] = 100;
644  min[dim] = 0;
645  max[dim] = 1;
646  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
647  dim++;
648 
649  axisTitle[dim] = "#Delta#phi";
650  nbins[dim] = 100;
651  min[dim] = -4;
652  max[dim] = 4;
653  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
654  dim++;
655 
656  axisTitle[dim] = "#it{p}_{T,particle} (GeV/#it{c})";
657  nbins[dim] = 9;
658  Double_t* pTParticleBins = new Double_t[nbins[dim]+1];
659  GenerateFixedBinArray(1, 0.15, 0.3, pTParticleBins);
660  GenerateFixedBinArray(1, 0.3, 0.5, pTParticleBins+1);
661  GenerateFixedBinArray(1, 0.5, 1, pTParticleBins+2);
662  GenerateFixedBinArray(2, 1, 5, pTParticleBins+3);
663  GenerateFixedBinArray(3, 5, 20, pTParticleBins+5);
664  GenerateFixedBinArray(1, 20, 150, pTParticleBins+8);
665  min[dim] = 0;
666  max[dim] = pTParticleBins[nbins[dim]];
667  binEdges[dim] = pTParticleBins;
668  dim++;
669 
670  axisTitle[dim] = "#it{p}_{T}#parallel (GeV/#it{c})";
671  nbins[dim] = 80;
672  Double_t* pTParallelBins = new Double_t[nbins[dim]+1];
673  GenerateFixedBinArray(20, 0, 2, pTParallelBins);
674  GenerateFixedBinArray(16, 2, 10, pTParallelBins+20);
675  GenerateFixedBinArray(10, 10, 20, pTParallelBins+36);
676  GenerateFixedBinArray(10, 20, 40, pTParallelBins+46);
677  GenerateFixedBinArray(24, 40, 150, pTParallelBins+56);
678  min[dim] = 0;
679  max[dim] = pTParallelBins[nbins[dim]];
680  binEdges[dim] = pTParallelBins;
681  dim++;
682 
683  TString thnname = TString::Format("%s/MomentumBalance", jets->GetArrayName().Data());
684  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
685  for (Int_t i = 0; i < dim; i++) {
686  hn->GetAxis(i)->SetTitle(axisTitle[i]);
687  hn->SetBinEdges(i, binEdges[i]);
688  }
689  }
690 }
691 
692 /*
693  * This function allocates the histograms for the constituent dijet study.
694  */
696 {
697  // Allocate geometrical matching THnSparse
698  TString axisTitle[30]= {""};
699  Int_t nbins[30] = {0};
700  Double_t min[30] = {0.};
701  Double_t max[30] = {0.};
702  Double_t *binEdges[20] = {0};
703  Int_t dim = 0;
704 
705  if (fForceBeamType != kpp) {
706  axisTitle[dim] = "Centrality (%)";
707  nbins[dim] = fNCentHistBins;
708  binEdges[dim] = fCentHistBins;
709  min[dim] = fCentHistBins[0];
710  max[dim] = fCentHistBins[fNCentHistBins];
711  dim++;
712  }
713 
714  axisTitle[dim] = "isSwitched";
715  nbins[dim] = 2;
716  min[dim] = -0.5;
717  max[dim] = 1.5;
718  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
719  dim++;
720 
721  axisTitle[dim] = "#DeltaR_{trig}";
722  nbins[dim] = 50;
723  min[dim] = 0;
724  max[dim] = 0.5;
725  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
726  dim++;
727 
728  axisTitle[dim] = "#DeltaR_{ass}";
729  nbins[dim] = 50;
730  min[dim] = 0;
731  max[dim] = 0.5;
732  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
733  dim++;
734 
735  axisTitle[dim] = "trig #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}";
736  nbins[dim] = 100;
737  min[dim] = -50;
738  max[dim] = 50;
739  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
740  dim++;
741 
742  axisTitle[dim] = "ass #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}";
743  nbins[dim] = 100;
744  min[dim] = -50;
745  max[dim] = 50;
746  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
747  dim++;
748 
749  axisTitle[dim] = "A_{J} low-threshold";
750  nbins[dim] = 100;
751  min[dim] = 0;
752  max[dim] = 1;
753  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
754  dim++;
755 
756  axisTitle[dim] = "A_{J} hard-core";
757  nbins[dim] = 100;
758  min[dim] = 0;
759  max[dim] = 1;
760  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
761  dim++;
762 
763  TString thnname = "GeometricalMatching";
764  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
765  for (Int_t i = 0; i < dim; i++) {
766  hn->GetAxis(i)->SetTitle(axisTitle[i]);
767  hn->SetBinEdges(i, binEdges[i]);
768  }
769 
770  // Allocate other histograms
771  TString histname;
772  TString title;
773  histname = "GeometricalMatchingEfficiency";
774  title = histname + ";isMatched;counts";
775  TH1* hist = fHistManager.CreateTH1(histname.Data(), title.Data(), 2, -0.5, 1.5);
776 }
777 
778 /*
779  * This function allocates the histograms for the calorimeter performance study.
780  */
782 {
783  TString histname;
784  TString htitle;
785 
786  Double_t* clusType = new Double_t[3+1];
787  GenerateFixedBinArray(3, -0.5, 2.5, clusType);
788  const Int_t nRejBins = 32;
789  Double_t* rejReasonBins = new Double_t[nRejBins+1];
790  GenerateFixedBinArray(nRejBins, 0, nRejBins, rejReasonBins);
791 
792  AliEmcalContainer* cont = 0;
793  TIter nextClusColl(&fClusterCollArray);
794  while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) {
795 
796  // rejection reason plot, to make efficiency correction
797  histname = TString::Format("%s/hClusterRejectionReasonEMCal", cont->GetArrayName().Data());
798  htitle = histname + ";Rejection reason;#it{E}_{clus} (GeV/)";
799  TH2* hist = fHistManager.CreateTH2(histname.Data(), htitle.Data(), nRejBins, rejReasonBins, fNPtHistBins, fPtHistBins);
800  SetRejectionReasonLabels(hist->GetXaxis());
801 
802  histname = TString::Format("%s/hClusterRejectionReasonPHOS", cont->GetArrayName().Data());
803  htitle = histname + ";Rejection reason;#it{E}_{clus} (GeV/)";
804  TH2* histPhos = fHistManager.CreateTH2(histname.Data(), htitle.Data(), nRejBins, rejReasonBins, fNPtHistBins, fPtHistBins);
805  SetRejectionReasonLabels(histPhos->GetXaxis());
806 
807  // plot by SM
808  const Int_t nEmcalSM = 20;
809  for (Int_t sm = 0; sm < nEmcalSM; sm++) {
810  histname = TString::Format("%s/BySM/hEmcalClusEnergy_SM%d", cont->GetArrayName().Data(), sm);
811  htitle = histname + ";#it{E}_{cluster} (GeV);counts";
812  fHistManager.CreateTH1(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins);
813  }
814 
815  for (Int_t sm = 1; sm < 5; sm++) {
816  histname = TString::Format("%s/BySM/hPhosClusEnergy_SM%d", cont->GetArrayName().Data(), sm);
817  htitle = histname + ";#it{E}_{cluster} (GeV);counts";
818  fHistManager.CreateTH1(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins);
819  }
820 
821  // Plot cluster THnSparse (centrality, cluster type, E, E-hadcorr, has matched track, M02, Ncells)
822  Int_t dim = 0;
823  TString title[20];
824  Int_t nbins[20] = {0};
825  Double_t min[30] = {0.};
826  Double_t max[30] = {0.};
827  Double_t *binEdges[20] = {0};
828 
830  title[dim] = "Centrality %";
831  nbins[dim] = fNCentHistBins;
832  binEdges[dim] = fCentHistBins;
833  min[dim] = fCentHistBins[0];
834  max[dim] = fCentHistBins[fNCentHistBins];
835  dim++;
836  }
837 
838  title[dim] = "#eta";
839  nbins[dim] = 28;
840  min[dim] = -0.7;
841  max[dim] = 0.7;
842  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
843  dim++;
844 
845  title[dim] = "#phi";
846  nbins[dim] = 100;
847  min[dim] = 1.;
848  max[dim] = 6.;
849  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
850  dim++;
851 
852  title[dim] = "#it{E}_{clus} (GeV)";
853  nbins[dim] = fNPtHistBins;
854  binEdges[dim] = fPtHistBins;
855  min[dim] = fPtHistBins[0];
856  max[dim] = fPtHistBins[fNPtHistBins];
857  dim++;
858 
859  title[dim] = "#it{E}_{clus, hadcorr} or #it{E}_{core} (GeV)";
860  nbins[dim] = fNPtHistBins;
861  binEdges[dim] = fPtHistBins;
862  min[dim] = fPtHistBins[0];
863  max[dim] = fPtHistBins[fNPtHistBins];
864  dim++;
865 
866  title[dim] = "Matched track";
867  nbins[dim] = 2;
868  min[dim] = -0.5;
869  max[dim] = 1.5;
870  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
871  dim++;
872 
873  title[dim] = "M02";
874  nbins[dim] = 100;
875  min[dim] = 0;
876  max[dim] = 10;
877  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
878  dim++;
879 
880  title[dim] = "Ncells";
881  nbins[dim] = 40;
882  min[dim] = -0.5;
883  max[dim] = 49.5;
884  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
885  dim++;
886 
887  title[dim] = "Dispersion cut";
888  nbins[dim] = 2;
889  min[dim] = -0.5;
890  max[dim] = 1.5;
891  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
892  dim++;
893 
894  TString thnname = TString::Format("%s/clusterObservables", cont->GetArrayName().Data());
895  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
896  for (Int_t i = 0; i < dim; i++) {
897  hn->GetAxis(i)->SetTitle(title[i]);
898  hn->SetBinEdges(i, binEdges[i]);
899  }
900  }
901 
902  // plot neutral jets
903  AliJetContainer* jets = 0;
904  TIter nextJetColl(&fJetCollArray);
905  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
906 
907  TString axisTitle[30]= {""};
908  Int_t nbinsJet[30] = {0};
909  Double_t minJet[30] = {0.};
910  Double_t maxJet[30] = {0.};
911  Double_t *binEdgesJet[20] = {0};
912  Int_t dimJet = 0;
913 
914  if (fForceBeamType != kpp) {
915  axisTitle[dimJet] = "Centrality (%)";
916  nbinsJet[dimJet] = fNCentHistBins;
917  binEdgesJet[dimJet] = fCentHistBins;
918  minJet[dimJet] = fCentHistBins[0];
919  maxJet[dimJet] = fCentHistBins[fNCentHistBins];
920  dimJet++;
921  }
922 
923  axisTitle[dimJet] = "#eta_{jet}";
924  nbinsJet[dimJet] = 28;
925  minJet[dimJet] = -0.7;
926  maxJet[dimJet] = 0.7;
927  binEdgesJet[dimJet] = GenerateFixedBinArray(nbinsJet[dimJet], minJet[dimJet], maxJet[dimJet]);
928  dimJet++;
929 
930  axisTitle[dimJet] = "#phi_{jet} (rad)";
931  nbinsJet[dimJet] = 100;
932  minJet[dimJet] = 1.;
933  maxJet[dimJet] = 6.;
934  binEdgesJet[dimJet] = GenerateFixedBinArray(nbinsJet[dimJet], minJet[dimJet], maxJet[dimJet]);
935  dimJet++;
936 
937  axisTitle[dimJet] = "#it{E}_{T} (GeV)";
938  nbinsJet[dimJet] = fNPtHistBins;
939  binEdgesJet[dimJet] = fPtHistBins;
940  minJet[dimJet] = fPtHistBins[0];
941  maxJet[dimJet] = fPtHistBins[fNPtHistBins];
942  dimJet++;
943 
944  axisTitle[dimJet] = "#rho (GeV/#it{c})";
945  nbinsJet[dimJet] = 100;
946  minJet[dimJet] = 0.;
947  maxJet[dimJet] = 1000.;
948  binEdgesJet[dimJet] = GenerateFixedBinArray(nbinsJet[dimJet], minJet[dimJet], maxJet[dimJet]);
949  dimJet++;
950 
951  axisTitle[dimJet] = "N_{clusters}";
952  nbinsJet[dimJet] = 20;
953  minJet[dimJet] = -0.5;
954  maxJet[dimJet] = 19.5;
955  binEdgesJet[dimJet] = GenerateFixedBinArray(nbinsJet[dimJet], minJet[dimJet], maxJet[dimJet]);
956  dimJet++;
957 
958  TString thnname = TString::Format("%s/hClusterJetObservables", jets->GetArrayName().Data());
959  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dimJet, nbinsJet, minJet, maxJet);
960  for (Int_t i = 0; i < dimJet; i++) {
961  hn->GetAxis(i)->SetTitle(axisTitle[i]);
962  hn->SetBinEdges(i, binEdgesJet[i]);
963  }
964 
965  }
966 
967  // Plot cell histograms
968 
969  // centrality vs. cell energy vs. cell type (for all cells)
970  histname = TString::Format("Cells/hCellEnergyAll");
971  htitle = histname + ";#it{E}_{cell} (GeV);Centrality (%); Cluster type";
972  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNCentHistBins, fCentHistBins, 3, clusType);
973 
974  // centrality vs. cell energy vs. cell type (for cells in accepted clusters)
975  histname = TString::Format("Cells/hCellEnergyAccepted");
976  htitle = histname + ";#it{E}_{cell} (GeV);Centrality (%); Cluster type";
977  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNCentHistBins, fCentHistBins, 3, clusType);
978 
979  // centrality vs. cell energy vs. cell type (for leading cells in accepted clusters)
980  histname = TString::Format("Cells/hCellEnergyLeading");
981  htitle = histname + ";#it{E}_{cell} (GeV);Centrality (%); Cluster type";
982  fHistManager.CreateTH3(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNCentHistBins, fCentHistBins, 3, clusType);
983 
984  // plot cell patches by SM
985  const Int_t nEmcalSM = 20;
986  for (Int_t sm = 0; sm < nEmcalSM; sm++) {
987  histname = TString::Format("Cells/BySM/hEmcalPatchEnergy_SM%d", sm);
988  htitle = histname + ";#it{E}_{cell patch} (GeV);Centrality (%)";
989  fHistManager.CreateTH2(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNCentHistBins, fCentHistBins);
990  }
991 
992  for (Int_t sm = 1; sm < 5; sm++) {
993  histname = TString::Format("Cells/BySM/hPhosPatchEnergy_SM%d", sm);
994  htitle = histname + ";#it{E}_{cell patch} (GeV);Centrality (%)";
995  fHistManager.CreateTH2(histname.Data(), htitle.Data(), fNPtHistBins, fPtHistBins, fNCentHistBins, fCentHistBins);
996  }
997 
998 }
999 
1000 /*
1001  * This function allocates the histograms for single jets, when the "simulated" trigger has been fired.
1002  * A set of histograms is allocated per each jet container.
1003  */
1005 {
1006  TString histname;
1007  TString title;
1008  Int_t nPtBins = TMath::CeilNint(fMaxPt/2);
1009 
1010  //----------------------------------------------
1011  // Trigger patch histograms
1012 
1013  // patch eta vs. phi
1014  histname = "TriggerSimHistograms/hEtaVsPhi";
1015  title = histname + ";#eta_{patch} (rad);#phi_{patch} (rad)";
1016  fHistManager.CreateTH2(histname.Data(), title.Data(), 140, -0.7, 0.7, 500, 1., 6.);
1017 
1018  // N patches
1019  histname = "TriggerSimHistograms/hNPatches";
1020  title = histname + ";#it{N}_{patches};type";
1021  fHistManager.CreateTH2(histname.Data(), title.Data(), 200, 0, 200, 2, -0.5, 1.5);
1022 
1023  // patch E vs. centrality
1024  histname = "TriggerSimHistograms/hPatchE";
1025  title = histname + ";Centrality (%);#it{E}_{patch} (GeV)";
1026  fHistManager.CreateTH2(histname.Data(), title.Data(), 50, 0, 100, nPtBins, 0, fMaxPt);
1027 
1028  // patch median vs. Centrality
1029  histname = "TriggerSimHistograms/hPatchMedianE";
1030  title = histname + ";Centrality (%);#it{E}_{patch,med} (GeV);type";
1031  fHistManager.CreateTH3(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 50, 2, -0.5, 1.5);
1032 
1033  // Median patch energy vs. centrality, for dijets
1034  histname = "TriggerSimHistograms/hMedPatchDijet";
1035  title = histname + ";Centrality (%);#it{E}_{patch,med} (GeV);type";
1036  fHistManager.CreateTH3(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 50, 2, -0.5, 1.5);
1037 
1038  //----------------------------------------------
1039  // Jet histograms for "triggered" events
1040  AliJetContainer* jets = 0;
1041  TIter nextJetColl(&fJetCollArray);
1042  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1043 
1044  // Jet rejection reason
1045  histname = TString::Format("%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1046  title = histname + ";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
1047  TH2* hist = fHistManager.CreateTH2(histname.Data(), title.Data(), 32, 0, 32, 50, 0, fMaxPt);
1048  SetRejectionReasonLabels(hist->GetXaxis());
1049 
1050  // Rho vs. Centrality
1051  if (!jets->GetRhoName().IsNull()) {
1052  histname = TString::Format("%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
1053  title = histname + ";Centrality (%);#rho (GeV/#it{c});counts";
1054  fHistManager.CreateTH2(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 500);
1055  }
1056 
1057  // (Centrality, pT, calo type)
1058  histname = TString::Format("%s/TriggerSimHistograms/hCentVsPt", jets->GetArrayName().Data());
1059  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
1060  fHistManager.CreateTH3(histname.Data(), title.Data(), 20, 0, 100, nPtBins, 0, fMaxPt, 3, -0.5, 2.5);
1061 
1062  // (Centrality, eta, phi, pT, NEF, calo type)
1063  histname = TString::Format("%s/TriggerSimHistograms/hNEFVsPtVsEtaVsPhi", jets->GetArrayName().Data());
1064  title = histname + ";Centrality (%);#eta_{jet} (rad);#phi_{jet} (rad);#it{p}_{T}^{corr} (GeV/#it{c});NEF;type";
1065  Int_t nbins1[6] = {20, fNEtaBins, fNPhiBins, nPtBins, 50, 3};
1066  Double_t min1[6] = {0, -0.5,1., 0, 0, -0.5};
1067  Double_t max1[6] = {100, 0.5,6., fMaxPt, 1., 2.5};
1068  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 6, nbins1, min1, max1);
1069 
1070  // pT-leading vs. pT
1071  histname = TString::Format("%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1072  title = histname + ";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
1073  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, nPtBins, 0, fMaxPt);
1074 
1075  // A vs. pT
1076  histname = TString::Format("%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
1077  title = histname + ";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
1078  fHistManager.CreateTH2(histname.Data(), title.Data(), nPtBins, 0, fMaxPt, fMaxPt/3, 0, 0.5);
1079 
1080  // (Centrality, pT, z-leading (charged), calo type)
1081  histname = TString::Format("%s/TriggerSimHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
1082  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading};type";
1083  Int_t nbins2[4] = {20, nPtBins, 50, 3};
1084  Double_t min2[4] = {0, 0, 0, -0.5};
1085  Double_t max2[4] = {100, fMaxPt, 1., 2.5};
1086  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins2, min2, max2);
1087 
1088  // z (charged) vs. pT
1089  histname = TString::Format("%s/TriggerSimHistograms/hZVsPt", jets->GetArrayName().Data());
1090  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z};type";
1091  Int_t nbins3[4] = {20, nPtBins, 50, 3};
1092  Double_t min3[4] = {0, 0, 0, -0.5};
1093  Double_t max3[4] = {100, fMaxPt, 1., 2.5};
1094  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins3, min3, max3);
1095 
1096  // (Centrality, pT, Nconst, calo type)
1097  histname = TString::Format("%s/TriggerSimHistograms/hNConstVsPt", jets->GetArrayName().Data());
1098  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents;type";
1099  Int_t nbins4[4] = {20, nPtBins, 50, 3};
1100  Double_t min4[4] = {0, 0, 0, -0.5};
1101  Double_t max4[4] = {100, fMaxPt, fMaxPt, 2.5};
1102  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins4, min4, max4);
1103 
1104  }
1105 
1106 }
1107 
1112 {
1113 
1114  TString fname(path);
1115  if (fname.BeginsWith("alien://")) {
1116  TGrid::Connect("alien://");
1117  }
1118 
1119  TFile* file = TFile::Open(path);
1120 
1121  if (!file || file->IsZombie()) {
1122  ::Error("AliAnalysisTaskEmcalDijetImbalance", "Could not open background scaling histogram");
1123  return;
1124  }
1125 
1126  TH1D* h = dynamic_cast<TH1D*>(file->Get(name));
1127 
1128  if (h) {
1129  ::Info("AliAnalysisTaskEmcalDijetImbalance::LoadBackgroundScalingHistogram", "Background histogram %s loaded from file %s.", name, path);
1130  }
1131  else {
1132  ::Error("AliAnalysisTaskEmcalDijetImbalance::LoadBackgroundScalingHistogram", "Background histogram %s not found in file %s.", name, path);
1133  return;
1134  }
1135 
1136  fBackgroundScalingWeights = static_cast<TH1D*>(h->Clone());
1137 
1138  file->Close();
1139  delete file;
1140 
1141 }
1142 
1148 {
1149 
1151 
1152  fNeedEmcalGeom = kTRUE;
1153 
1154  // Check if trigger patches are loaded
1155  if (fTriggerPatchInfo) {
1156  TString objname(fTriggerPatchInfo->GetClass()->GetName());
1157  TClass cls(objname);
1158  if (!cls.InheritsFrom("AliEMCALTriggerPatchInfo")) {
1159  AliError(Form("%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1160  GetName(), cls.GetName(), "EmcalTriggers"));
1161  fTriggerPatchInfo = 0;
1162  }
1163  }
1164  if (!fTriggerPatchInfo) {
1165  AliError(Form("%s: Unable to get trigger patch container with name %s. Aborting", GetName(), "EmcalTriggers"));
1166  return;
1167  }
1168 
1169  // Load the PHOS geometry
1170  if (fDoCaloStudy) {
1171  fPHOSGeo = AliPHOSGeometry::GetInstance();
1172  if (fPHOSGeo) {
1173  AliInfo("Found instance of PHOS geometry!");
1174  }
1175  else {
1176  AliInfo("Creating PHOS geometry!");
1177  Int_t runNum = InputEvent()->GetRunNumber();
1178  if(runNum<209122) //Run1
1179  fPHOSGeo = AliPHOSGeometry::GetInstance("IHEP");
1180  else
1181  fPHOSGeo = AliPHOSGeometry::GetInstance("Run2");
1182 
1183  if (fPHOSGeo) {
1184  AliOADBContainer geomContainer("phosGeo");
1185  geomContainer.InitFromFile("$ALICE_PHYSICS/OADB/PHOS/PHOSMCGeometry.root","PHOSMCRotationMatrixes");
1186  TObjArray* matrixes = (TObjArray*)geomContainer.GetObject(runNum,"PHOSRotationMatrixes");
1187  for(Int_t mod=0; mod<6; mod++) {
1188  if(!matrixes->At(mod)) continue;
1189  fPHOSGeo->SetMisalMatrix(((TGeoHMatrix*)matrixes->At(mod)),mod);
1190  printf(".........Adding Matrix(%d), geo=%p\n",mod,fPHOSGeo);
1191  ((TGeoHMatrix*)matrixes->At(mod))->Print();
1192  }
1193  }
1194  }
1195  }
1196 
1197  AliInfo(Form("Trigger jet threshold = %f, Associated jet threshold = %f", fMinTrigJetPt, fMinAssJetPt));
1198  AliInfo(Form("Leading hadron threshold (for dijet leading jet): %f GeV", fDijetLeadingHadronPt));
1199  AliInfo(Form("Momentum balance study: %d", fDoMomentumBalance));
1200  AliInfo(Form("Geometrical matching study: %d", fDoGeometricalMatching));
1201 
1202 }
1203 
1208 
1209  // Get the downscaling factors for MB triggers (to be used to calculate trigger efficiency)
1210 
1212 
1213  // Get instance of the downscale factor helper class
1215  downscaleOCDB->SetRun(InputEvent()->GetRunNumber());
1216 
1217  // There are two possible min bias triggers for LHC15o
1218  TString triggerNameMB1 = "CINT7-B-NOPF-CENT";
1219  TString triggerNameMB2 = "CV0L7-B-NOPF-CENT";
1220  TString triggerNameJE = "CINT7EJ1-B-NOPF-CENTNOPMD";
1221 
1222  // Get the downscale factor for whichever MB trigger exists in the given run
1223  std::vector<TString> runtriggers = downscaleOCDB->GetTriggerClasses();
1224  Double_t downscalefactor;
1225  for (auto i : runtriggers) {
1226  if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
1227  downscalefactor = downscaleOCDB->GetDownscaleFactorForTriggerClass(i.Data());
1228  break;
1229  }
1230  }
1231 
1232  // Store the inverse of the downscale factor, used later to weight the pT spectrum
1233  fMBUpscaleFactor = 1/downscalefactor;
1234 
1235  TString histname = "Trigger/hMBDownscaleFactor";
1236  fHistManager.FillTH1(histname.Data(), fMBUpscaleFactor);
1237 
1238  }
1239 
1240 }
1241 
1246 {
1247  if (fUseAliEventCuts) {
1248  if (!fEventCuts.AcceptEvent(InputEvent()))
1249  {
1250  PostData(1, fOutput);
1251  return kFALSE;
1252  }
1253  }
1254  else {
1256  }
1257  return kTRUE;
1258 }
1259 
1268 {
1269  TString histname;
1270  AliJetContainer* jetCont = 0;
1271  TIter next(&fJetCollArray);
1272  while ((jetCont = static_cast<AliJetContainer*>(next()))) {
1273  TString jetContName = jetCont->GetName();
1274  if (jetContName.Contains("HardCore")) continue;
1275 
1276  //-----------------------------------------------------------------------------
1277  // Find the leading di-jet candidate in each event, and if it satisfies the
1278  // trig jet pT threshold, then fill di-jet candidate histogram (regardless of ass jet).
1279  // The idea is to study the kinematic selections in post-processing.
1280 
1281  // Loop over leading hadron cut or not
1282  for (Int_t leadingHadronCutType=0; leadingHadronCutType<2; leadingHadronCutType++) {
1283 
1284  // Find the dijet candidate of the event and store its info in struct fDijet
1285  FindDijet(jetCont, leadingHadronCutType);
1286 
1287  // If we find a dijet candidate (i.e. acceptable trig jet; ass jet accepted or not), fill the di-jet candidate histogram
1289  FillDijetCandHistograms(jetCont);
1290  }
1291 
1292  }
1293 
1294  //---------------------------------------------------------------------------------------------------
1295  // Now, study the accepted dijet selection -- specified by the trig/ass jet pT conditions
1296 
1297  // Find the dijet candidate of the event and store its info in struct fDijet
1298  FindDijet(jetCont, 0);
1299 
1300  // If we find an accepted dijet, fill the dijet imbalance histogram
1303  }
1304  // If we find an accepted dijet, perform momentum-balance study (if requested)
1306  histname = TString::Format("%s/MomentumBalance", jetCont->GetArrayName().Data());
1307  DoMomentumBalance(histname);
1308  }
1309 
1310  //---------------------------------------------------------------------------
1311  // Do a simple trigger simulation (if requested)
1312  if (fDoTriggerSimulation) {
1314  }
1315 
1316  }
1317 
1318  //---------------------------------------------------------------------------
1319  // Do the constituent threshold and geometrical matching study (if requested)
1320  if (fDoGeometricalMatching) {
1322  }
1323 
1324  return kTRUE;
1325 }
1326 
1335 {
1336  fDijet.clear();
1337  fDijet.leadingHadronCutType = leadingHadronCutBin;
1338 
1339  // Get trigger jet
1340  AliEmcalJet* trigJet = GetLeadingJet(jetCont);
1341  if(!trigJet) return;
1342 
1343  // Skip the event if the leading jet doesn't satisfy the pT threshold
1344  Double_t trigJetPt = GetJetPt(jetCont, trigJet);
1345  if ( trigJetPt < fMinTrigJetPt ) return;
1346 
1347  // Skip the event if the leading jet doesn't satisfy the leading hadron threshold
1348  if (jetCont->GetLeadingHadronPt(trigJet) < fDijetLeadingHadronPt*leadingHadronCutBin) return;
1349 
1350  // Fill the dijet struct
1351  fDijet.trigJet = trigJet;
1352  fDijet.trigJetPt = trigJetPt;
1353  fDijet.trigJetEta = trigJet->Eta();
1354  fDijet.trigJetPhi = trigJet->Phi();
1355 
1356  // Find the subleading jet in the opposite hemisphere
1357  AliEmcalJet *assJet = 0;
1358  for(auto assJetCand : jetCont->accepted()) {
1359  if (!assJetCand) continue;
1360  Double_t assJetCandPt = GetJetPt(jetCont, assJetCand);
1361  if ( TMath::Abs(trigJet->Phi() - assJetCand->Phi()) < fDeltaPhiMin ) continue;
1362  if (assJet) {
1363  Double_t assJetPt = GetJetPt(jetCont, assJet);
1364  if ( assJetCandPt < assJetPt ) continue;
1365  }
1366  assJet = assJetCand;
1367  }
1368  if (!assJet) return;
1369 
1370  // Fill the dijet struct
1371  fDijet.assJet = assJet;
1372  fDijet.assJetPt = GetJetPt(jetCont, assJet);
1373  fDijet.assJetPhi = assJet->Phi();
1374  fDijet.assJetEta = assJet->Eta();
1376 
1377  fDijet.deltaPhi = TMath::Abs(trigJet->Phi() - assJet->Phi());
1378  fDijet.deltaEta = trigJet->Eta() - assJet->Eta();
1381  fDijet.kTy = TMath::Abs( fDijet.trigJetPt * TMath::Sin(fDijet.deltaPhi) );
1382 }
1383 
1389 {
1390 
1391  AliTrackContainer* trackCont = dynamic_cast<AliTrackContainer*>(GetParticleContainer("tracks"));
1392 
1393  AliVTrack* track;
1394  for (auto trackIterator : trackCont->accepted_momentum() ) {
1395 
1396  track = trackIterator.second;
1397 
1398  // Compute the delta phi between the track and its nearest jet (of the two jets in the dijet),
1399  // as well as its pT-parallel projection onto the nearest jet's axis.
1400 
1401  Double_t trackPt = track->Pt();
1402  Double_t trackPhi = track->Phi();
1403  Double_t trigJetPhi = fDijet.trigJet->Phi();
1404  Double_t assJetPhi = fDijet.assJet->Phi();
1405 
1406  Double_t deltaPhiTrigJet = TMath::Abs(trackPhi - trigJetPhi);
1407  Double_t deltaPhiAssJet = TMath::Abs(trackPhi - assJetPhi);
1408  Bool_t isNearside = deltaPhiTrigJet < deltaPhiAssJet;
1409 
1410  Double_t deltaPhi;
1411  Double_t balancePt;
1412  if (isNearside) {
1413  deltaPhi = trackPhi - trigJetPhi;
1414  balancePt = trackPt * TMath::Cos(deltaPhi);
1415  }
1416  else {
1417  deltaPhi = trackPhi - assJetPhi;
1418  balancePt = -trackPt * TMath::Cos(deltaPhi);
1419  }
1420 
1421  FillMomentumBalanceHistograms(histname, deltaPhi, trackPt, balancePt);
1422 
1423  }
1424 }
1425 
1430 {
1431  // Get jet container with minimum constituent pT,E thresholds
1432  TString jetContAllName = Form("Jet_AKTFullR0%d0_tracks_pT0150_caloClusters_E0300_pt_scheme", (int) (fMatchingJetR*10) );
1433  AliJetContainer* jetContAll = GetJetContainer(jetContAllName.Data());
1434 
1435  // Get jet container with X GeV constituent pT,E thresholds
1436  Int_t trackThreshold = (int) (fTrackConstituentThreshold*1000); // in MeV
1437  Int_t clusThreshold = (int) (fClusterConstituentThreshold*1000); // in MeV
1438  TString jetContHardCoreName = Form("JetHardCore_AKTFullR0%d0_tracks_pT%d_caloClusters_E%d_pt_scheme", (int) (fMatchingJetR*10), trackThreshold, clusThreshold);
1439  AliJetContainer* jetContHardCore = GetJetContainer(jetContHardCoreName.Data());
1440 
1441  // Find the di-jet in the hard-core jet sample, then find the matching di-jet and fill histograms
1442  FindDijet(jetContHardCore, 0);
1443  if (fDijet.isAccepted) {
1444  FindMatchingDijet(jetContAll);
1446  }
1447 }
1448 
1453 {
1454  TString histname;
1455 
1456  // Check if trigger patches are loaded
1457  if (fTriggerPatchInfo) {
1458  TString objname(fTriggerPatchInfo->GetClass()->GetName());
1459  TClass cls(objname);
1460  if (!cls.InheritsFrom("AliEMCALTriggerPatchInfo")) {
1461  AliError(Form("%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1462  GetName(), cls.GetName(), "EmcalTriggers"));
1463  fTriggerPatchInfo = 0;
1464  }
1465  }
1466  if (!fTriggerPatchInfo) {
1467  AliError(Form("%s: Unable to get trigger patch container with name %s. Aborting", GetName(), "EmcalTriggers"));
1468  return;
1469  }
1470 
1471  // Compute patches in EMCal, DCal (I want offline simple trigger patch, i.e. patch calculated using FEE energy)
1472  std::vector<Double_t> vecEMCal;
1473  std::vector<Double_t> vecDCal;
1474  for(auto p : *fTriggerPatchInfo){
1475  AliEMCALTriggerPatchInfo *recpatch = static_cast<AliEMCALTriggerPatchInfo *>(p);
1476  if (recpatch) {
1477 
1478  if(!recpatch->IsJetHighSimple()) continue;
1479 
1480  histname = "TriggerSimHistograms/hEtaVsPhi";
1481  fHistManager.FillTH2(histname.Data(), recpatch->GetEtaGeo(), recpatch->GetPhiGeo());
1482 
1483  histname = "TriggerSimHistograms/hPatchE";
1484  fHistManager.FillTH2(histname.Data(), fCent, recpatch->GetPatchE());
1485 
1486  if (recpatch->IsEMCal()) {
1487  vecEMCal.push_back(recpatch->GetPatchE());
1488  } else {
1489  vecDCal.push_back(recpatch->GetPatchE());
1490  }
1491 
1492  }
1493  }
1494 
1495  // Compute the median in each calorimeter
1496  const Int_t nBkgPatchesEMCal = vecEMCal.size(); // 6*8;
1497  const Int_t nBkgPatchesDCal = vecDCal.size(); // 4*5;
1498  fMedianEMCal = TMath::Median(nBkgPatchesEMCal, &vecEMCal[0]); // point to array used internally by vector
1499  fMedianDCal = TMath::Median(nBkgPatchesDCal, &vecDCal[0]);
1500 
1501  histname = "TriggerSimHistograms/hPatchMedianE";
1502  fHistManager.FillTH3(histname.Data(), fCent, fMedianEMCal, kEMCal);
1503  fHistManager.FillTH3(histname.Data(), fCent, fMedianDCal, kDCal);
1504 
1505  histname = "TriggerSimHistograms/hNPatches";
1506  fHistManager.FillTH2(histname.Data(), nBkgPatchesEMCal, kEMCal);
1507  fHistManager.FillTH2(histname.Data(), nBkgPatchesDCal, kDCal);
1508 
1509  // Then compute background subtracted patches, by subtracting from each patch the median patch E from the opposite hemisphere
1510  // If a patch is above threshold, the event is "triggered"
1511  Bool_t fkEMCEJE = kFALSE;
1512  Double_t threshold = 20;
1513  for(auto p : *fTriggerPatchInfo){
1514  AliEMCALTriggerPatchInfo *recpatch = static_cast<AliEMCALTriggerPatchInfo *>(p);
1515  if (recpatch) {
1516 
1517  if(!recpatch->IsJetHighSimple()) continue;
1518 
1519  if (recpatch->IsEMCal()) {
1520  if ((recpatch->GetPatchE() - fMedianDCal) > threshold) {
1521  fkEMCEJE = kTRUE;
1522  break;
1523  }
1524  } else {
1525  if ((recpatch->GetPatchE() - fMedianEMCal) > threshold) {
1526  fkEMCEJE = kTRUE;
1527  break;
1528  }
1529  }
1530  }
1531  }
1532 
1533  if (fkEMCEJE) {
1535  }
1536 
1537 }
1538 
1544 {
1546 
1547  // Loop over jets and find leading jet within R of fDijet.trigJet
1548  AliEmcalJet *matchingTrigJet = 0;
1549  for(auto matchingTrigJetCand : jetCont->accepted()) {
1550  if (!matchingTrigJetCand) continue;
1551  if ( GetDeltaR(matchingTrigJetCand, fDijet.trigJet) > fMatchingJetR ) continue;
1552  if (matchingTrigJet) {
1553  if ( GetJetPt(jetCont, matchingTrigJetCand) < GetJetPt(jetCont, matchingTrigJet) ) continue;
1554  }
1555  matchingTrigJet = matchingTrigJetCand;
1556  }
1557  if (!matchingTrigJet) return;
1558 
1559  // Loop over jets and find leading jet within R of fDijet.assJet
1560  AliEmcalJet *matchingAssJet = 0;
1561  for(auto matchingAssJetCand : jetCont->accepted()) {
1562  if (!matchingAssJetCand) continue;
1563  if ( GetDeltaR(matchingAssJetCand, fDijet.assJet) > fMatchingJetR ) continue;
1564  if (matchingAssJet) {
1565  if ( GetJetPt(jetCont, matchingAssJetCand) < GetJetPt(jetCont, matchingAssJet) ) continue;
1566  }
1567  matchingAssJet = matchingAssJetCand;
1568  }
1569 
1570  // Determine which matching jet is the leading jet (i.e. allow them to flip)
1571  if (matchingAssJet) {
1572  AliEmcalJet* trigJet = matchingTrigJet;
1573  AliEmcalJet* assJet = matchingAssJet;
1574  if ( GetJetPt(jetCont, matchingTrigJet) < GetJetPt(jetCont, matchingAssJet) ) {
1575  AliEmcalJet* trigJet = matchingAssJet;
1576  AliEmcalJet* assJet = matchingTrigJet;
1577  }
1578 
1579  // Fill the dijet struct
1580  fMatchingDijet.trigJet = trigJet;
1581  fMatchingDijet.trigJetPt = GetJetPt(jetCont, trigJet);
1582  fMatchingDijet.trigJetEta = trigJet->Eta();
1583  fMatchingDijet.trigJetPhi = trigJet->Phi();
1584 
1585  fMatchingDijet.assJet = assJet;
1586  fMatchingDijet.assJetPt = GetJetPt(jetCont, assJet);
1587  fMatchingDijet.assJetPhi = assJet->Phi();
1588  fMatchingDijet.assJetEta = assJet->Eta();
1590 
1591  fMatchingDijet.deltaPhi = TMath::Abs(trigJet->Phi() - assJet->Phi());
1592  fMatchingDijet.deltaEta = trigJet->Eta() - assJet->Eta();
1595  fMatchingDijet.kTy = TMath::Abs( fMatchingDijet.trigJetPt * TMath::Sin(fMatchingDijet.deltaPhi) );
1596  }
1597 }
1598 
1603 {
1604  // Loop over tracks and clusters in order to:
1605  // (1) Compute scale factor for full jets
1606  // (2) Compute delta-pT for full jets, with the random cone method
1607  // For both the scale factor and delta-pT, we compute only one histogram each for EMCal.
1608  // But for DCal, we bin in eta-phi, in order to account for the DCal vs. PHOS vs. gap
1609 
1610  // Define the acceptance boundaries for the TPC and EMCal/DCal/PHOS
1611  Double_t etaTPC = 0.9;
1612  Double_t etaEMCal = 0.7;
1613  Double_t etaMinDCal = 0.22;
1614  Double_t etaMaxPHOS = 0.13;
1615  Double_t phiMinEMCal = fGeom->GetArm1PhiMin() * TMath::DegToRad(); // 80
1616  Double_t phiMaxEMCal = fGeom->GetEMCALPhiMax() * TMath::DegToRad(); // ~188
1617  Double_t phiMinDCal = fGeom->GetDCALPhiMin() * TMath::DegToRad(); // 260
1618  Double_t phiMaxDCal = fGeom->GetDCALPhiMax() * TMath::DegToRad(); // ~327 (1/3 SMs start at 320)
1619  Double_t phiMinPHOS = 250 * TMath::DegToRad();
1620  Double_t phiMaxPHOS = 320 * TMath::DegToRad();
1621 
1622  Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
1623  Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
1624  Double_t accDCalRegion = 2 * etaEMCal * (phiMaxDCal - phiMinDCal);
1625 
1626  // Define fiducial acceptances, to be used to generate random cones
1627  TRandom3* r = new TRandom3(0);
1628  Double_t jetR = jetCont->GetJetRadius();
1629  Double_t accRC = TMath::Pi() * jetR * jetR;
1630  Double_t etaEMCalfid = etaEMCal - jetR;
1631  Double_t phiMinEMCalfid = phiMinEMCal + jetR;
1632  Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
1633  Double_t phiMinDCalRegionfid = phiMinDCal + jetR;
1634  Double_t phiMaxDCalRegionfid = phiMaxDCal - jetR;
1635 
1636  // Generate EMCal random cone eta-phi
1637  Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
1638  Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
1639 
1640  // For DCalRegion, generate random eta, phi in each eta/phi bin, to be used as center of random cone
1641  Double_t etaDCalRC[fNEtaBins]; // array storing the RC eta values
1642  Double_t etaStep = 1./fNEtaBins;
1643  Double_t etaMin;
1644  Double_t etaMax;
1645  for (Int_t etaBin=0; etaBin < fNEtaBins; etaBin++) {
1646  etaMin = -etaEMCalfid + etaBin*etaStep;
1647  etaMax = etaMin + etaStep;
1648  etaDCalRC[etaBin] = r->Uniform(etaMin, etaMax);
1649  }
1650 
1651  Double_t phiDCalRC[fNPhiBins]; // array storing the RC phi values
1652  Double_t phiStep = 5./fNPhiBins; // phi axis is [1,6] in order to have simple binning
1653  Double_t phiMin;
1654  Double_t phiMax;
1655  for (Int_t phiBin=0; phiBin < fNPhiBins; phiBin++) {
1656  phiMin = 1 + phiBin*phiStep;
1657  phiMax = phiMin + phiStep;
1658  phiDCalRC[phiBin] = r->Uniform(phiMin, phiMax);
1659  }
1660 
1661  // Initialize the various sums to 0
1662  Double_t trackPtSumTPC = 0;
1663  Double_t trackPtSumEMCal = 0;
1664  Double_t trackPtSumEMCalRC = 0;
1665  Double_t clusESumEMCal = 0;
1666  Double_t clusESumEMCalRC = 0;
1667 
1668  // Define a 2D vector (initialized to 0) to store the sum of track pT, and another for cluster ET
1669  std::vector<std::vector<Double_t>> trackPtSumDCalRC(fNEtaBins, std::vector<Double_t>(fNPhiBins));
1670  std::vector<std::vector<Double_t>> clusESumDCalRC(fNEtaBins, std::vector<Double_t>(fNPhiBins));
1671 
1672  // Loop over tracks. Sum the track pT:
1673  // (1) in the entire TPC, (2) in the EMCal, (3) in the EMCal random cone,
1674  // (4) in the DCalRegion in a random cone at each eta-phi
1675  AliTrackContainer* trackCont = dynamic_cast<AliTrackContainer*>(GetParticleContainer("tracks"));
1676  AliTLorentzVector track;
1677  Double_t trackEta;
1678  Double_t trackPhi;
1679  Double_t trackPt;
1680  Double_t deltaR;
1681  for (auto trackIterator : trackCont->accepted_momentum() ) {
1682 
1683  track.Clear();
1684  track = trackIterator.first;
1685  trackEta = track.Eta();
1686  trackPhi = track.Phi_0_2pi();
1687  trackPt = track.Pt();
1688 
1689  // (1)
1690  if (TMath::Abs(trackEta) < etaTPC) {
1691  trackPtSumTPC += trackPt;
1692  }
1693 
1694  // (2)
1695  if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
1696  trackPtSumEMCal += trackPt;
1697  }
1698 
1699  // (3)
1700  deltaR = GetDeltaR(&track, etaEMCalRC, phiEMCalRC);
1701  if (deltaR < jetR) {
1702  trackPtSumEMCalRC += trackPt;
1703  }
1704 
1705  // (4)
1706  for (Int_t etaBin=0; etaBin < fNEtaBins; etaBin++) {
1707  for (Int_t phiBin=0; phiBin < fNPhiBins; phiBin++) {
1708  deltaR = GetDeltaR(&track, etaDCalRC[etaBin], phiDCalRC[phiBin]);
1709  if (deltaR < jetR) {
1710  trackPtSumDCalRC[etaBin][phiBin] += trackPt;
1711  }
1712  }
1713  }
1714 
1715  }
1716 
1717  // Loop over clusters. Sum the cluster ET:
1718  // (1) in the EMCal, (2) in the EMCal random cone, (3) in the DCalRegion in a random cone at each eta-phi
1720  AliTLorentzVector clus;
1721  Double_t clusEta;
1722  Double_t clusPhi;
1723  Double_t clusE;
1724  for (auto clusIterator : clusCont->accepted_momentum() ) {
1725 
1726  clus.Clear();
1727  clus = clusIterator.first;
1728  clusEta = clus.Eta();
1729  clusPhi = clus.Phi_0_2pi();
1730  clusE = clus.E();
1731 
1732  // (1)
1733  if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
1734  clusESumEMCal += clusE;
1735  }
1736 
1737  // (2)
1738  deltaR = GetDeltaR(&clus, etaEMCalRC, phiEMCalRC);
1739  if (deltaR < jetR) {
1740  clusESumEMCalRC += clusE;
1741  }
1742 
1743  // (3)
1744  for (Int_t etaBin=0; etaBin < fNEtaBins; etaBin++) {
1745  for (Int_t phiBin=0; phiBin < fNPhiBins; phiBin++) {
1746  deltaR = GetDeltaR(&clus, etaDCalRC[etaBin], phiDCalRC[phiBin]);
1747  if (deltaR < jetR) {
1748  clusESumDCalRC[etaBin][phiBin] += clusE;
1749  }
1750  }
1751  }
1752 
1753  }
1754 
1755  // Compute the scale factor for EMCal, as a function of centrality
1756  Double_t numerator = (trackPtSumEMCal + clusESumEMCal) / accEMCal;
1757  Double_t denominator = trackPtSumTPC / accTPC;
1758  Double_t scaleFactor = numerator / denominator;
1759  TString histname = TString::Format("%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
1760  fHistManager.FillTH2(histname, fCent, scaleFactor);
1761 
1762  // Compute the scale factor for DCalRegion in each eta-phi bin, as a function of centrality
1763  for (Int_t etaBin=0; etaBin < fNEtaBins; etaBin++) {
1764  for (Int_t phiBin=0; phiBin < fNPhiBins; phiBin++) {
1765  numerator = (trackPtSumDCalRC[etaBin][phiBin] + clusESumDCalRC[etaBin][phiBin]) / accRC;
1766  scaleFactor = numerator / denominator;
1767  histname = TString::Format("%s/BackgroundHistograms/hScaleFactorEtaPhi", jetCont->GetArrayName().Data());
1768  Double_t x[4] = {etaDCalRC[etaBin], phiDCalRC[phiBin], fCent, scaleFactor};
1769  fHistManager.FillTHnSparse(histname, x);
1770  }
1771  }
1772 
1773  // Compute delta pT for EMCal, as a function of centrality
1774  Double_t rho = jetCont->GetRhoVal();
1775  Double_t deltaPt = trackPtSumEMCalRC + clusESumEMCalRC - rho * TMath::Pi() * jetR * jetR;
1776  histname = TString::Format("%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
1777  fHistManager.FillTH2(histname, fCent, deltaPt);
1778 
1779  // Compute delta pT for DCalRegion in each eta-phi bin, as a function of centrality
1780  Double_t sf;
1781  for (Int_t etaBin=0; etaBin < fNEtaBins; etaBin++) {
1782  for (Int_t phiBin=0; phiBin < fNPhiBins; phiBin++) {
1784  sf = fBackgroundScalingWeights->GetBinContent(etaDCalRC[etaBin], phiDCalRC[phiBin]);
1785  rho = sf * rho;
1786  }
1787  deltaPt = trackPtSumDCalRC[etaBin][phiBin] + clusESumDCalRC[etaBin][phiBin] - rho * accRC;
1788  histname = TString::Format("%s/BackgroundHistograms/hDeltaPtEtaPhi", jetCont->GetArrayName().Data());
1789  Double_t x[4] = {etaDCalRC[etaBin], phiDCalRC[phiBin], fCent, deltaPt};
1790  fHistManager.FillTHnSparse(histname, x);
1791  }
1792  }
1793 
1794  delete r;
1795 
1796 }
1797 
1802 {
1803 
1804  Double_t rho = jetCont->GetRhoVal();
1805 
1806  // Get eta-phi dependent scale factor
1808  Double_t sf = fBackgroundScalingWeights->GetBinContent(jet->Eta(), jet->Phi_0_2pi());
1809  rho = sf * rho;
1810  }
1811 
1812  // Compute pT
1813  Double_t pT = jet->Pt() - rho * jet->Area();
1814 
1815  // If hard-core jet, don't subtract background
1816  TString jetContName = jetCont->GetName();
1817  if (jetContName.Contains("HardCore")) pT = jet->Pt();
1818 
1819  return pT;
1820 }
1821 
1826 {
1827  AliEmcalJet* leadingJet = 0;
1828 
1829  if (jetCont->GetRhoParameter()) {
1830  for(auto jetCand : jetCont->accepted()) {
1831  if (!jetCand) continue;
1832  Double_t jetCandPt = GetJetPt(jetCont, jetCand);
1833  if (leadingJet) {
1834  Double_t leadingJetPt = GetJetPt(jetCont, leadingJet);
1835  if ( jetCandPt < leadingJetPt ) continue;
1836  }
1837  leadingJet = jetCand;
1838  }
1839  }
1840  else {
1841  leadingJet = jetCont->GetLeadingJet();
1842  }
1843 
1844  return leadingJet;
1845 }
1846 
1851 {
1852  Double_t deltaPhi = TMath::Abs(jet1->Phi() - jet2->Phi());
1853  Double_t deltaEta = TMath::Abs(jet1->Eta() - jet2->Eta());
1854  Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
1855  return deltaR;
1856 }
1857 
1862 {
1863  Double_t deltaPhi = TMath::Abs(part->Phi_0_2pi() - phiRef);
1864  Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
1865  Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
1866  return deltaR;
1867 }
1868 
1873 {
1874  UInt_t jetType = jet->GetJetAcceptanceType();
1875  Double_t type = -1;
1876  if (jetType & AliEmcalJet::kEMCAL) {
1877  type = kEMCal;
1878  }
1879  else if (jetType & AliEmcalJet::kDCALonly) {
1880  type = kDCal;
1881  }
1882  else if (jetType & AliEmcalJet::kPHOS) {
1883  type = kPHOS;
1884  }
1885 
1886  return type;
1887 }
1888 
1889 
1897 {
1900 
1901  return kTRUE;
1902 }
1903 
1909 {
1910  TString histname;
1911  AliJetContainer* jets = 0;
1912  TIter nextJetColl(&fJetCollArray);
1913  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1914  TString jetContName = jets->GetName();
1915  if (jetContName.Contains("HardCore")) continue;
1916  Double_t rhoVal = 0;
1917  if (jets->GetRhoParameter()) {
1918  rhoVal = jets->GetRhoVal();
1919  histname = TString::Format("%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1920  fHistManager.FillTH2(histname.Data(), fCent, rhoVal);
1921  }
1922 
1923  for (auto jet : jets->all()) {
1924 
1925  Float_t ptLeading = jets->GetLeadingHadronPt(jet);
1926  Float_t corrPt = GetJetPt(jets, jet);
1927 
1928  // A vs. pT (fill before area cut)
1929  histname = TString::Format("%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1930  fHistManager.FillTH2(histname.Data(), corrPt, jet->Area());
1931 
1932 
1933  // Rejection reason
1934  UInt_t rejectionReason = 0;
1935  if (!jets->AcceptJet(jet, rejectionReason)) {
1936  histname = TString::Format("%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1937  fHistManager.FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
1938  continue;
1939  }
1940 
1941  // compute jet acceptance type
1942  Double_t type = GetJetType(jet);
1943 
1944  // (Centrality, pT, calo type)
1945  histname = TString::Format("%s/JetHistograms/hCentVsPt", jets->GetArrayName().Data());
1946  fHistManager.FillTH3(histname.Data(), fCent, corrPt, type);
1947 
1948  // (Centrality, eta, phi, pT, NEF, calo type)
1949  histname = TString::Format("%s/JetHistograms/hNEFVsPtVsEtaVsPhi", jets->GetArrayName().Data());
1950  Double_t x[6] = {fCent, jet->Eta(), jet->Phi_0_2pi(), corrPt, jet->NEF(), type};
1951  fHistManager.FillTHnSparse(histname, x);
1952 
1953  // (Centrality, pT upscaled, calo type)
1954  histname = TString::Format("%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1955  fHistManager.FillTH3(histname.Data(), fCent, corrPt, type, fMBUpscaleFactor);
1956 
1957  // pT-leading vs. pT
1958  histname = TString::Format("%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1959  fHistManager.FillTH2(histname.Data(), corrPt, ptLeading);
1960 
1961  // (Centrality, pT, z-leading (charged), calo type)
1962  TLorentzVector leadPart;
1963  jets->GetLeadingHadronMomentum(leadPart, jet);
1964  Double_t z = GetParallelFraction(leadPart.Vect(), jet);
1965  if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999; // so that it will contribute to the bin 0.9-1 rather than 1-1.1
1966  histname = TString::Format("%s/JetHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
1967  Double_t y[4] = {fCent, corrPt, z, type};
1968  fHistManager.FillTHnSparse(histname, y);
1969 
1970  // (Centrality, pT, z (charged), calo type)
1971  histname = TString::Format("%s/JetHistograms/hZVsPt", jets->GetArrayName().Data());
1972  AliVTrack* track;
1973  for (Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1974  track = static_cast<AliVTrack*>(jet->Track(i));
1975  z = track->Pt() / TMath::Abs(corrPt);
1976  Double_t y2[4] = {fCent, corrPt, z, type};
1977  fHistManager.FillTHnSparse(histname, y2);
1978  }
1979 
1980  // (Centrality, pT, Nconst, calo type)
1981  histname = TString::Format("%s/JetHistograms/hNConstVsPt", jets->GetArrayName().Data());
1982  Double_t a[4] = {fCent, corrPt, 1.*jet->GetNumberOfConstituents(), type};
1983  fHistManager.FillTHnSparse(histname, a);
1984 
1985  // (Median patch energy, calo type, jet pT, centrality)
1986  if (fDoTriggerSimulation) {
1987  histname = TString::Format("%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
1988  Double_t x[4] = {fMedianEMCal, kEMCal, corrPt, fCent};
1989  fHistManager.FillTHnSparse(histname, x);
1990  Double_t y[4] = {fMedianDCal, kDCal, corrPt, fCent};
1991  fHistManager.FillTHnSparse(histname, y);
1992  }
1993 
1994  // Fill cluster spectra of clusters within jets
1995  //(centrality, cluster energy, jet pT, jet eta, jet phi)
1996  histname = TString::Format("%s/JetHistograms/hClustersInJets", jets->GetArrayName().Data());
1997  Int_t nClusters = jet->GetNumberOfClusters();
1998  AliVCluster* clus;
1999  for (Int_t iClus = 0; iClus < nClusters; iClus++) {
2000  clus = jet->Cluster(iClus);
2001  Double_t x[5] = {fCent, clus->E(), corrPt, jet->Eta(), jet->Phi_0_2pi()};
2002  fHistManager.FillTHnSparse(histname, x);
2003  }
2004 
2005  } //jet loop
2006 
2007  //---------------------------------------------------------------------------
2008  // Do study of background (if requested)
2010  }
2011 }
2012 
2018 {
2019  TString histname;
2020  AliJetContainer* jets = 0;
2021  TIter nextJetColl(&fJetCollArray);
2022  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2023  TString jetContName = jets->GetName();
2024  if (jetContName.Contains("HardCore")) continue;
2025  Double_t rhoVal = 0;
2026  if (jets->GetRhoParameter()) {
2027  rhoVal = jets->GetRhoVal();
2028  histname = TString::Format("%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
2029  fHistManager.FillTH2(histname.Data(), fCent, rhoVal);
2030  }
2031 
2032  for (auto jet : jets->all()) {
2033 
2034  Float_t ptLeading = jets->GetLeadingHadronPt(jet);
2035  Float_t corrPt = GetJetPt(jets, jet);
2036 
2037  // A vs. pT (fill before area cut)
2038  histname = TString::Format("%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
2039  fHistManager.FillTH2(histname.Data(), corrPt, jet->Area());
2040 
2041 
2042  // Rejection reason
2043  UInt_t rejectionReason = 0;
2044  if (!jets->AcceptJet(jet, rejectionReason)) {
2045  histname = TString::Format("%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
2046  fHistManager.FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
2047  continue;
2048  }
2049 
2050  // compute jet acceptance type
2051  Double_t type = GetJetType(jet);
2052 
2053  // Centrality vs. pT
2054  histname = TString::Format("%s/TriggerSimHistograms/hCentVsPt", jets->GetArrayName().Data());
2055  fHistManager.FillTH3(histname.Data(), fCent, corrPt, type);
2056 
2057  // (Centrality, eta, phi, pT, NEF, calo type)
2058  histname = TString::Format("%s/TriggerSimHistograms/hNEFVsPtVsEtaVsPhi", jets->GetArrayName().Data());
2059  Double_t x[6] = {fCent, jet->Eta(), jet->Phi_0_2pi(), corrPt, jet->NEF(), type};
2060  fHistManager.FillTHnSparse(histname, x);
2061 
2062  // pT-leading vs. pT
2063  histname = TString::Format("%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
2064  fHistManager.FillTH2(histname.Data(), corrPt, ptLeading);
2065 
2066  // (Centrality, pT, z-leading (charged), calo type)
2067  TLorentzVector leadPart;
2068  jets->GetLeadingHadronMomentum(leadPart, jet);
2069  Double_t z = GetParallelFraction(leadPart.Vect(), jet);
2070  if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999; // so that it will contribute to the bin 0.9-1 rather than 1-1.1
2071  histname = TString::Format("%s/TriggerSimHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
2072  Double_t y[4] = {fCent, corrPt, z, type};
2073  fHistManager.FillTHnSparse(histname, y);
2074 
2075  // (Centrality, pT, z (charged), calo type)
2076  histname = TString::Format("%s/TriggerSimHistograms/hZVsPt", jets->GetArrayName().Data());
2077  AliVTrack* track;
2078  for (Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
2079  track = static_cast<AliVTrack*>(jet->Track(i));
2080  z = track->Pt() / TMath::Abs(corrPt);
2081  Double_t y2[4] = {fCent, corrPt, z, type};
2082  fHistManager.FillTHnSparse(histname, y2);
2083  }
2084 
2085  // (Centrality, pT, Nconst, calo type)
2086  histname = TString::Format("%s/TriggerSimHistograms/hNConstVsPt", jets->GetArrayName().Data());
2087  Double_t a[4] = {fCent, corrPt, 1.*jet->GetNumberOfConstituents(), type};
2088  fHistManager.FillTHnSparse(histname, a);
2089 
2090  } //jet loop
2091 
2092  }
2093 }
2094 
2099 {
2100  Double_t contents[30]={0};
2101  TString histname = TString::Format("%s/DijetCandObservables", jets->GetArrayName().Data());
2102  THnSparse* histJetObservables = static_cast<THnSparse*>(fHistManager.FindObject(histname));
2103  if (!histJetObservables) return;
2104  for (Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
2105  TString title(histJetObservables->GetAxis(n)->GetTitle());
2106  if (title=="Centrality (%)")
2107  contents[n] = fCent;
2108  else if (title=="LeadingHadronRequired")
2109  contents[n] = fDijet.leadingHadronCutType;
2110  else if (title=="#it{p}_{T,trig jet} (GeV/#it{c})")
2111  contents[n] = fDijet.trigJetPt;
2112  else if (title=="#it{p}_{T,ass jet} (GeV/#it{c})")
2113  contents[n] = fDijet.assJetPt;
2114  else if (title=="#phi_{trig jet}")
2115  contents[n] = fDijet.trigJetPhi;
2116  else if (title=="#phi_{ass jet}")
2117  contents[n] = fDijet.assJetPhi;
2118  else if (title=="#eta_{trig jet}")
2119  contents[n] = fDijet.trigJetEta;
2120  else if (title=="#eta_{ass jet}")
2121  contents[n] = fDijet.assJetEta;
2122  else
2123  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
2124  }
2125  histJetObservables->Fill(contents);
2126 }
2127 
2132 {
2133  // Fill the dijet imbalance histogram (unless doing trigger simulation, in which case bypass this)
2134  if (!fDoTriggerSimulation) {
2135  Double_t contents[30]={0};
2136  TString histname = TString::Format("%s/DijetImbalanceObservables", jets->GetArrayName().Data());
2137  THnSparse* histJetObservables = static_cast<THnSparse*>(fHistManager.FindObject(histname));
2138  if (!histJetObservables) return;
2139  for (Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
2140  TString title(histJetObservables->GetAxis(n)->GetTitle());
2141  if (title=="Centrality (%)")
2142  contents[n] = fCent;
2143  else if (title=="#Delta#phi")
2144  contents[n] = fDijet.deltaPhi;
2145  else if (title=="#Delta#eta")
2146  contents[n] = fDijet.deltaEta;
2147  else if (title=="A_{J}")
2148  contents[n] = fDijet.AJ;
2149  else if (title=="x_{J}")
2150  contents[n] = fDijet.xJ;
2151  else if (title=="k_{Ty} (GeV)")
2152  contents[n] = fDijet.kTy;
2153  else if (title=="N_{tracks, trig jet}")
2154  contents[n] = fDijet.trigJet->GetNumberOfTracks();
2155  else if (title=="N_{tracks, ass jet}")
2156  contents[n] = fDijet.assJet->GetNumberOfTracks();
2157  else
2158  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
2159  }
2160  histJetObservables->Fill(contents);
2161  }
2162 
2163  // (Centrality, pT1, pT2) (upscaled)
2164  TString histname = TString::Format("%s/DijetJetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
2166 
2167  // Get jet acceptance type
2168  AliEmcalJet* trigJet = fDijet.trigJet;
2169  Double_t type = GetJetType(trigJet);
2170 
2171  // (Centrality, pT, NEF, calo type)
2172  histname = TString::Format("%s/DijetJetHistograms/hNEFVsPt", jets->GetArrayName().Data());
2173  Double_t x[4] = {fCent, fDijet.trigJetPt, trigJet->NEF(), type};
2174  fHistManager.FillTHnSparse(histname, x);
2175 
2176  // (Centrality, pT, z-leading (charged), calo type)
2177  histname = TString::Format("%s/DijetJetHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
2178  TLorentzVector leadPart;
2179  jets->GetLeadingHadronMomentum(leadPart, trigJet);
2180  Double_t z = GetParallelFraction(leadPart.Vect(), trigJet);
2181  if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999; // so that it will contribute to the bin 0.9-1 rather than 1-1.1
2182  Double_t y[4] = {fCent, fDijet.trigJetPt, z, type};
2183  fHistManager.FillTHnSparse(histname, y);
2184 
2185  // (Centrality, pT, z (charged), calo type)
2186  histname = TString::Format("%s/DijetJetHistograms/hZVsPt", jets->GetArrayName().Data());
2187  AliVTrack* track;
2188  for (Int_t i=0; i<trigJet->GetNumberOfTracks(); i++) {
2189  track = static_cast<AliVTrack*>(trigJet->Track(i));
2190  z = track->Pt() / TMath::Abs(fDijet.trigJetPt);
2191  Double_t y2[4] = {fCent, fDijet.trigJetPt, z, type};
2192  fHistManager.FillTHnSparse(histname, y2);
2193  }
2194 
2195  // (Centrality, pT, Nconst, calo type)
2196  histname = TString::Format("%s/DijetJetHistograms/hNConstVsPt", jets->GetArrayName().Data());
2197  Double_t a[4] = {fCent, fDijet.trigJetPt, 1.*trigJet->GetNumberOfConstituents(), type};
2198  fHistManager.FillTHnSparse(histname, a);
2199 
2200  // Median patch energy vs. pT
2201  if (fDoTriggerSimulation) {
2202  histname = "TriggerSimHistograms/hMedPatchDijet";
2203  fHistManager.FillTH3(histname.Data(), fCent, fMedianEMCal, kEMCal);
2204  fHistManager.FillTH3(histname.Data(), fCent, fMedianDCal, kDCal);
2205  }
2206 
2207 }
2208 
2213 {
2214  Double_t contents[30]={0};
2215  THnSparse* histJetObservables = static_cast<THnSparse*>(fHistManager.FindObject(histname));
2216  if (!histJetObservables) return;
2217  for (Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
2218  TString title(histJetObservables->GetAxis(n)->GetTitle());
2219  if (title=="A_{J}")
2220  contents[n] = fDijet.AJ;
2221  else if (title=="#Delta#phi")
2222  contents[n] = deltaPhi;
2223  else if (title=="#it{p}_{T,particle} (GeV/#it{c})")
2224  contents[n] = trackPt;
2225  else if (title=="#it{p}_{T}#parallel (GeV/#it{c})")
2226  contents[n] = balancePt;
2227  else
2228  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
2229  }
2230  histJetObservables->Fill(contents);
2231 }
2232 
2237 {
2238  // Matching efficiency histogram
2239  TString histname = "GeometricalMatchingEfficiency";
2240 
2241  // If we have a matching di-jet, fill the geometrical matching histogram
2242  if (fMatchingDijet.assJet) {
2243  fHistManager.FillTH1(histname.Data(), 1);
2244 
2247  Bool_t isSwitched = trigDeltaR > fMatchingJetR;
2248 
2249  TString thnname = "GeometricalMatching";
2250  Double_t contents[30]={0};
2251  THnSparse* histJetObservables = static_cast<THnSparse*>(fHistManager.FindObject(thnname.Data()));
2252  if (!histJetObservables) return;
2253  for (Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
2254  TString title(histJetObservables->GetAxis(n)->GetTitle());
2255  if (title=="Centrality (%)")
2256  contents[n] = fCent;
2257  else if (title=="isSwitched")
2258  contents[n] = isSwitched;
2259  else if (title=="#DeltaR_{trig}")
2260  contents[n] = trigDeltaR;
2261  else if (title=="#DeltaR_{ass}")
2262  contents[n] = assDeltaR;
2263  else if (title=="trig #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}")
2264  contents[n] = fMatchingDijet.trigJetPt - fDijet.trigJetPt;
2265  else if (title=="ass #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}")
2266  contents[n] = fMatchingDijet.assJetPt - fDijet.assJetPt;
2267  else if (title=="A_{J} low-threshold")
2268  contents[n] = fMatchingDijet.AJ;
2269  else if (title=="A_{J} hard-core")
2270  contents[n] = fDijet.AJ;
2271  else
2272  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
2273  }
2274  histJetObservables->Fill(contents);
2275  }
2276  else {
2277  fHistManager.FillTH1(histname.Data(), 0.);
2278  }
2279 }
2280 
2281 /*
2282  * This function fills the histograms for the calorimeter performance study.
2283  */
2285 {
2286  // Define some vars
2287  TString histname;
2288  Double_t Enonlin;
2289  Double_t Ehadcorr;
2290  Int_t absId;
2291  Double_t ecell;
2292  Double_t leadEcell;
2293 
2294  // Get cells from event
2295  fCaloCells = InputEvent()->GetEMCALCells();
2296  AliVCaloCells* phosCaloCells = InputEvent()->GetPHOSCells();
2297 
2298  // Loop through clusters and plot cluster THnSparse (centrality, cluster type, E, E-hadcorr, has matched track, M02, Ncells)
2299  AliClusterContainer* clusters = 0;
2300  TIter nextClusColl(&fClusterCollArray);
2301  while ((clusters = static_cast<AliClusterContainer*>(nextClusColl()))) {
2303  for (AliClusterIterableMomentumContainer::iterator it = itcont.begin(); it != itcont.end(); it++) {
2304 
2305  // Determine cluster type (EMCal/DCal/Phos)
2306  ClusterType clusType = kNA;
2307  if (it->second->IsEMCAL()) {
2308  Double_t phi = it->first.Phi_0_2pi();
2309  Int_t isDcal = Int_t(phi > fgkEMCalDCalPhiDivide);
2310  if (isDcal == 0) {
2311  clusType = kEMCal;
2312  } else if (isDcal == 1) {
2313  clusType = kDCal;
2314  }
2315  } else if (it->second->GetType() == AliVCluster::kPHOSNeutral){
2316  clusType = kPHOS;
2317  }
2318 
2319  // rejection reason plots, to make efficiency correction
2320  if (it->second->IsEMCAL()) {
2321  histname = TString::Format("%s/hClusterRejectionReasonEMCal", clusters->GetArrayName().Data());
2322  UInt_t rejectionReason = 0;
2323  if (!clusters->AcceptCluster(it.current_index(), rejectionReason)) {
2324  fHistManager.FillTH2(histname, clusters->GetRejectionReasonBitPosition(rejectionReason), it->first.E());
2325  continue;
2326  }
2327  } else if (it->second->GetType() == AliVCluster::kPHOSNeutral){
2328  histname = TString::Format("%s/hClusterRejectionReasonPHOS", clusters->GetArrayName().Data());
2329  UInt_t rejectionReason = 0;
2330  if (!clusters->AcceptCluster(it.current_index(), rejectionReason)) {
2331  fHistManager.FillTH2(histname, clusters->GetRejectionReasonBitPosition(rejectionReason), it->first.E());
2332  continue;
2333  }
2334  } else {
2335  continue;
2336  }
2337 
2338  // Fill cluster spectra by SM, and fill cell histograms
2339  Enonlin = 0;
2340  Ehadcorr = 0;
2341  if (it->second->IsEMCAL()) {
2342 
2343  Ehadcorr = it->second->GetHadCorrEnergy();
2344  Enonlin = it->second->GetNonLinCorrEnergy();
2345 
2346  Int_t sm = fGeom->GetSuperModuleNumber(it->second->GetCellAbsId(0));
2347  if (sm >=0 && sm < 20) {
2348  histname = TString::Format("%s/BySM/hEmcalClusEnergy_SM%d", clusters->GetArrayName().Data(), sm);
2349  fHistManager.FillTH1(histname, it->second->E());
2350  }
2351  else {
2352  AliError(Form("Supermodule %d does not exist!", sm));
2353  }
2354 
2355  // Get cells from each accepted cluster, and plot centrality vs. cell energy vs. cell type
2356  histname = TString::Format("Cells/hCellEnergyAccepted");
2357  leadEcell = 0;
2358  for (Int_t iCell = 0; iCell < it->second->GetNCells(); iCell++){
2359  absId = it->second->GetCellAbsId(iCell);
2360  ecell = fCaloCells->GetCellAmplitude(absId);
2361  fHistManager.FillTH3(histname, ecell, fCent, kEMCal); // Note: I don't distinguish EMCal from DCal cells
2362  if (ecell > leadEcell) {
2363  leadEcell = ecell;
2364  }
2365  }
2366  // Plot also the leading cell
2367  histname = TString::Format("Cells/hCellEnergyLeading");
2368  fHistManager.FillTH3(histname, leadEcell, fCent, kEMCal);
2369 
2370  } else if (it->second->GetType() == AliVCluster::kPHOSNeutral){
2371 
2372  Ehadcorr = it->second->GetCoreEnergy();
2373  Enonlin = it->second->E();
2374 
2375  Int_t relid[4];
2376  if (fPHOSGeo) {
2377  fPHOSGeo->AbsToRelNumbering(it->second->GetCellAbsId(0), relid);
2378  Int_t sm = relid[0];
2379  if (sm >=1 && sm < 5) {
2380  histname = TString::Format("%s/BySM/hPhosClusEnergy_SM%d", clusters->GetArrayName().Data(), sm);
2381  fHistManager.FillTH1(histname, it->second->E());
2382  }
2383  else {
2384  AliError(Form("Supermodule %d does not exist!", sm));
2385  }
2386  }
2387 
2388  // Get cells from each accepted cluster, and plot centrality vs. cell energy vs. cell type
2389  histname = TString::Format("Cells/hCellEnergyAccepted");
2390  leadEcell = 0;
2391  for (Int_t iCell = 0; iCell < it->second->GetNCells(); iCell++){
2392  absId = it->second->GetCellAbsId(iCell);
2393  ecell = phosCaloCells->GetCellAmplitude(absId);
2394  fHistManager.FillTH3(histname, ecell, fCent, kPHOS);
2395  if (ecell > leadEcell) {
2396  leadEcell = ecell;
2397  }
2398  }
2399  // Plot also the leading cell
2400  histname = TString::Format("Cells/hCellEnergyLeading");
2401  fHistManager.FillTH3(histname, leadEcell, fCent, kPHOS);
2402  }
2403 
2404  // Check if the cluster has a matched track
2405  Int_t hasMatchedTrack = -1;
2406  Int_t nMatchedTracks = it->second->GetNTracksMatched();
2407  if (nMatchedTracks == 0) {
2408  hasMatchedTrack = 0;
2409  } else if (nMatchedTracks > 0) {
2410  hasMatchedTrack = 1;
2411  }
2412 
2413  // Check if the cluster passes the dispersion cut for photon-like cluster (meaningful only for PHOS)
2414  Int_t passedDispersionCut = 0;
2415  if (it->second->Chi2() < 2.5*2.5) {
2416  passedDispersionCut = 1;
2417  }
2418 
2419  Double_t contents[30]={0};
2420  histname = TString::Format("%s/clusterObservables", clusters->GetArrayName().Data());
2421  THnSparse* histClusterObservables = static_cast<THnSparse*>(fHistManager.FindObject(histname));
2422  if (!histClusterObservables) return;
2423  for (Int_t i = 0; i < histClusterObservables->GetNdimensions(); i++) {
2424  TString title(histClusterObservables->GetAxis(i)->GetTitle());
2425  if (title=="Centrality %")
2426  contents[i] = fCent;
2427  else if (title=="#eta")
2428  contents[i] = it->first.Eta();
2429  else if (title=="#phi")
2430  contents[i] = it->first.Phi_0_2pi();
2431  else if (title=="#it{E}_{clus} (GeV)")
2432  contents[i] = Enonlin;
2433  else if (title=="#it{E}_{clus, hadcorr} or #it{E}_{core} (GeV)")
2434  contents[i] = Ehadcorr;
2435  else if (title=="Matched track")
2436  contents[i] = hasMatchedTrack;
2437  else if (title=="M02")
2438  contents[i] = it->second->GetM02();
2439  else if (title=="Ncells")
2440  contents[i] = it->second->GetNCells();
2441  else if (title=="Dispersion cut")
2442  contents[i] = passedDispersionCut;
2443  else
2444  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
2445  }
2446  histClusterObservables->Fill(contents);
2447 
2448  }
2449 
2450  }
2451 
2452  // plot neutral jets THnSparse (centrality, eta, phi, E, Nclusters)
2453  AliJetContainer* jets = 0;
2454  TIter nextJetColl(&fJetCollArray);
2455  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2456 
2457  for (auto jet : jets->accepted()) {
2458 
2459  Double_t contents[30]={0};
2460  histname = TString::Format("%s/hClusterJetObservables", jets->GetArrayName().Data());
2461  THnSparse* histJetObservables = static_cast<THnSparse*>(fHistManager.FindObject(histname));
2462  if (!histJetObservables) return;
2463  for (Int_t i = 0; i < histJetObservables->GetNdimensions(); i++) {
2464  TString title(histJetObservables->GetAxis(i)->GetTitle());
2465  if (title=="Centrality (%)")
2466  contents[i] = fCent;
2467  else if (title=="#eta_{jet}")
2468  contents[i] = jet->Eta();
2469  else if (title=="#phi_{jet} (rad)")
2470  contents[i] = jet->Phi_0_2pi();
2471  else if (title=="#it{E}_{T} (GeV)")
2472  contents[i] = jet->Pt();
2473  else if (title=="#rho (GeV/#it{c})")
2474  contents[i] = jet->Pt() / jet->Area();
2475  else if (title=="N_{clusters}")
2476  contents[i] = jet->GetNumberOfClusters();
2477  else
2478  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
2479  }
2480  histJetObservables->Fill(contents);
2481 
2482  }
2483 
2484  }
2485 
2486  // Loop through all cells and fill histos
2487  Int_t sm;
2488  Int_t relid[4];
2489  Double_t patchSumEMCal[20] = {0.};
2490  Double_t patchSumPHOS[4] = {0.};
2491  for (Int_t i=0; i<fCaloCells->GetNumberOfCells(); i++) {
2492 
2493  absId = fCaloCells->GetCellNumber(i);
2494  ecell = fCaloCells->GetCellAmplitude(absId);
2495 
2496  // Fill cell histo
2497  histname = TString::Format("Cells/hCellEnergyAll");
2498  fHistManager.FillTH3(histname, ecell, fCent, kEMCal); // Note: I don't distinguish EMCal from DCal cells
2499 
2500  // Fill cell patch histo, per SM
2501  sm = fGeom->GetSuperModuleNumber(absId);
2502  if (sm >=0 && sm < 20) {
2503  patchSumEMCal[sm] += ecell;
2504  }
2505 
2506  }
2507 
2508  for (Int_t i=0; i<phosCaloCells->GetNumberOfCells(); i++) {
2509 
2510  absId = phosCaloCells->GetCellNumber(i);
2511  ecell = phosCaloCells->GetCellAmplitude(absId);
2512 
2513  // Fill cell histo
2514  histname = TString::Format("Cells/hCellEnergyAll");
2515  fHistManager.FillTH3(histname, ecell, fCent, kPHOS);
2516 
2517  // Fill cell patch histo, per SM
2518  fPHOSGeo->AbsToRelNumbering(absId, relid);
2519  sm = relid[0];
2520  if (sm >=1 && sm < 5) {
2521  patchSumPHOS[sm-1] += ecell;
2522  }
2523 
2524  }
2525 
2526  for (Int_t sm = 0; sm < 20; sm++) {
2527  histname = TString::Format("Cells/BySM/hEmcalPatchEnergy_SM%d", sm);
2528  fHistManager.FillTH2(histname, patchSumEMCal[sm], fCent);
2529  }
2530 
2531  for (Int_t sm = 1; sm < 5; sm++) {
2532  histname = TString::Format("Cells/BySM/hPhosPatchEnergy_SM%d", sm);
2533  fHistManager.FillTH2(histname, patchSumPHOS[sm-1], fCent);
2534  }
2535 
2536 }
2537 
AliEmcalJet * GetLeadingJet(AliJetContainer *jetCont)
void Print(std::ostream &o, const char *name, Double_t dT, Double_t dVM, Double_t alldT, Double_t alldVM)
Definition: PlotSysInfo.C:121
Double_t Area() const
Definition: AliEmcalJet.h:123
TObjArray fClusterCollArray
cluster collection array
Double_t GetRhoVal() const
Int_t fNPhiBins
Number of phi bins in DCal region (for background/correction)
const TString & GetRhoName() const
Int_t fNPtHistBins
! number of variable pt bins
double Double_t
Definition: External.C:58
const char * title
Definition: MakeQAPdf.C:26
AliJetContainer * GetJetContainer(Int_t i=0) const
PHOS acceptance.
Definition: AliEmcalJet.h:68
Bool_t fUseManualEventCuts
Flag to use manual event cuts.
UInt_t fOffTrigger
offline trigger for event selection
Bool_t fUseAliEventCuts
Flag to use AliEventCuts (otherwise AliAnalysisTaskEmcal will be used)
Double_t Eta() const
Definition: AliEmcalJet.h:114
static AliEmcalDownscaleFactorsOCDB * Instance()
const AliClusterIterableMomentumContainer accepted_momentum() const
Int_t fNEtaBins
Number of eta bins in DCal region (for background/correction)
bidirectional stl iterator over the EMCAL iterable container
Double_t Phi() const
Definition: AliEmcalJet.h:110
Container with name, TClonesArray and cuts for particles.
Bool_t fPlotJetHistograms
Set whether to enable inclusive jet histograms.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
Declaration of class AliTLorentzVector.
TList * fEventCutList
! Output list for event cut histograms
void FillTH3(const char *hname, double x, double y, double z, double weight=1., Option_t *opt="")
Fill a 3D histogram within the container.
AliVParticle * Track(Int_t idx) const
Double_t fDijetLeadingHadronPt
leading hadron pT threshold for leading jet in dijet
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
Bool_t fkEMCEJE
! flag telling whether the event is "triggered" or not in "simulation"
Double_t GetDownscaleFactorForTriggerClass(const TString &trigger) const
Double_t fMedianEMCal
! median patch energy in EMCal, per event
Double_t fMedianDCal
! median patch energy in DCal, per event
Double_t fMinAssJetPt
subleading jet min pT in a dijet pair, for it to be accepted
UShort_t GetNumberOfConstituents() const
Definition: AliEmcalJet.h:133
void SetCaloTriggerPatchInfoName(const char *n)
UShort_t GetNumberOfTracks() const
Definition: AliEmcalJet.h:132
Bool_t fDoMomentumBalance
Set whether to enable momentum balance study.
void FindDijet(AliJetContainer *jetCont, Int_t leadingHadronCutBin)
Bool_t fPlotDijetImbalanceHistograms
Set whether to enable dijet imbalance histograms.
AliEventCuts fEventCuts
event selection utility
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
const Int_t nPtBins
AliEmcalJet * GetLeadingJet(const char *opt="")
void GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
Dijet_t fDijet
! dijet candidate (per event)
void FillTHnSparse(const char *name, const double *x, double weight=1., Option_t *opt="")
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.
TObject * FindObject(const char *name) const
Find an object inside the container.
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
THashList * GetListOfHistograms() const
Get the list of histograms.
Definition: THistManager.h:671
Double_t GetDeltaR(AliEmcalJet *jet1, AliEmcalJet *jet2)
Double_t GetLeadingHadronPt(const AliEmcalJet *jet) const
float Float_t
Definition: External.C:68
Double_t fClusterConstituentThreshold
constituent threshold for matching study
Di-jet imbalance analysis with full jets.
AliEMCALGeometry * fGeom
!emcal geometry
UInt_t GetJetAcceptanceType() const
Definition: AliEmcalJet.h:261
Double_t Phi_0_2pi() const
EMCal acceptance.
Definition: AliEmcalJet.h:62
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
Bool_t fDoTriggerSimulation
Set whether to perform a simple trigger simulation.
BeamType fForceBeamType
forced beam type
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
Definition: External.C:212
virtual Bool_t AcceptCluster(Int_t i, UInt_t &rejectionReason) const
Double_t fDeltaPhiMin
minimum delta phi between di-jets
Double_t fMBUpscaleFactor
! inverse of downscale factor, for MB trigger
Bool_t fComputeBackground
Set whether to enable study of background.
Double_t Phi_0_2pi() const
Definition: AliEmcalJet.h:122
std::vector< TString > GetTriggerClasses() const
Double_t fCent
!event centrality
Double_t GetJetPt(AliJetContainer *jetCont, AliEmcalJet *jet)
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 FillMomentumBalanceHistograms(TString histname, Double_t deltaPhi, Double_t trackPt, Double_t balancePt)
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
TObjArray fJetCollArray
jet collection array
AliVCaloCells * fCaloCells
!cells
AliRhoParameter * GetRhoParameter()
Bool_t fComputeMBDownscaling
Set whether to compute and plot MB downscaling factors.
Double_t Pt() const
Definition: AliEmcalJet.h:102
const AliClusterIterableMomentumContainer all_momentum() const
virtual Bool_t IsEventSelected()
Performing event selection.
static Double_t * GenerateFixedBinArray(Int_t n, Double_t min, Double_t max)
Float_t GetJetRadius() const
AliEmcalList * fOutput
!output list
Definition: External.C:220
Bool_t fLoadBackgroundScalingWeights
Flag to load eta-phi weights for full-jet background scale factors.
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Handler for downscale factors for various triggers obtained from the OCDB.
TFile * file
TList with histograms for a given trigger.
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Base task in the EMCAL jet framework.
Bool_t fDoGeometricalMatching
Set whether to enable constituent study with geometrical matching.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
const AliTrackIterableMomentumContainer accepted_momentum() const
Int_t GetRunNumber(TString)
Definition: PlotMuonQA.C:2235
Dijet_t fMatchingDijet
! low-threshold matching dijet, for matching study
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
Main initialization function on the worker.
const Int_t nbins
const AliJetIterableContainer accepted() const
bool Bool_t
Definition: External.C:53
Double_t fTrackConstituentThreshold
constituent threshold for matching study
DCal acceptance – spans ONLY DCal (no PHOS or gap)
Definition: AliEmcalJet.h:66
Double_t NEF() const
Definition: AliEmcalJet.h:141
TH1D * fBackgroundScalingWeights
Histogram storing eta-phi weights for full-jet background scale factors.
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 fMinTrigJetPt
leading jet min pT in a dijet pair
Container structure for EMCAL clusters.
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
Container for jet within the EMCAL jet framework.
Definition: External.C:196
Bool_t fPlotDijetCandHistograms
Set whether to enable dijet pair histograms.
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.
void LoadBackgroundScalingHistogram(const char *path="alien:///alice/cern.ch/user/j/jmulliga/BackgroundScalingWeights.root", const char *name="hBackgroundScalingWeights")
Bool_t fDoCaloStudy
Set whether to perform calorimeter detector study.
const AliJetIterableContainer all() const
static Double_t fgkEMCalDCalPhiDivide
phi value used to distinguish between DCal and EMCal