AliPhysics  d20dab4 (d20dab4)
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 "AliAnalysisManager.h"
33 #include <AliVEventHandler.h>
34 #include "AliTLorentzVector.h"
35 #include "AliEmcalJet.h"
36 #include "AliRhoParameter.h"
37 #include "AliJetContainer.h"
38 #include "AliParticleContainer.h"
39 #include "AliClusterContainer.h"
40 #include "AliEMCALGeometry.h"
42 #include "AliEMCALTriggerPatchInfo.h"
44 
46 
50 
56  fDeltaPhiMin(0),
57  fMinTrigJetPt(0),
58  fMinAssJetPt(0),
59  fDijetLeadingHadronPt(0),
60  fMatchingJetR(0.2),
61  fTrackConstituentThreshold(0),
62  fClusterConstituentThreshold(0),
63  fNEtaBins(40),
64  fNPhiBins(200),
65  fBackgroundScalingWeights(0),
66  fGapJetScalingWeights(0),
67  fPlotDijetCandHistograms(kFALSE),
68  fPlotDijetImbalanceHistograms(kFALSE),
69  fComputeBackground(kFALSE),
70  fDoMomentumBalance(kFALSE),
71  fDoGeometricalMatching(kFALSE),
72  fLoadBackgroundScalingWeights(kTRUE),
73  fComputeMBDownscaling(kFALSE),
74  fDoTriggerSimulation(kFALSE),
75  fMaxPt(200),
76  fNCentHistBins(0),
77  fCentHistBins(0),
78  fNPtHistBins(0),
79  fPtHistBins(0),
80  fUseAliEventCuts(kTRUE),
81  fEventCuts(0),
82  fEventCutList(0),
83  fUseManualEventCuts(kFALSE),
84  fMBUpscaleFactor(1.),
85  fMedianEMCal(0),
86  fMedianDCal(0),
87  fkEMCEJE(kFALSE),
88  fEmbeddingQA(),
89  fHistManager()
90 {
94 }
95 
102  AliAnalysisTaskEmcalJet(name, kTRUE),
103  fDeltaPhiMin(0),
104  fMinTrigJetPt(0),
105  fMinAssJetPt(0),
107  fMatchingJetR(0.2),
110  fNEtaBins(40),
111  fNPhiBins(200),
114  fPlotDijetCandHistograms(kFALSE),
116  fComputeBackground(kFALSE),
117  fDoMomentumBalance(kFALSE),
118  fDoGeometricalMatching(kFALSE),
120  fComputeMBDownscaling(kFALSE),
121  fDoTriggerSimulation(kFALSE),
122  fMaxPt(200),
123  fNCentHistBins(0),
124  fCentHistBins(0),
125  fNPtHistBins(0),
126  fPtHistBins(0),
127  fUseAliEventCuts(kTRUE),
128  fEventCuts(0),
129  fEventCutList(0),
130  fUseManualEventCuts(kFALSE),
131  fMBUpscaleFactor(1.),
132  fMedianEMCal(0),
133  fMedianDCal(0),
134  fkEMCEJE(kFALSE),
135  fEmbeddingQA(),
136  fHistManager(name)
137 {
139  Dijet_t fDijet;
141 }
142 
147 {
148 }
149 
154 {
155  fNCentHistBins = 4;
157  fCentHistBins[0] = 0;
158  fCentHistBins[1] = 10;
159  fCentHistBins[2] = 30;
160  fCentHistBins[3] = 50;
161  fCentHistBins[4] = 90;
162 
163  fNPtHistBins = 82;
166  GenerateFixedBinArray(7, 0.3, 1, fPtHistBins+6);
167  GenerateFixedBinArray(10, 1, 3, fPtHistBins+13);
168  GenerateFixedBinArray(14, 3, 10, fPtHistBins+23);
169  GenerateFixedBinArray(10, 10, 20, fPtHistBins+37);
170  GenerateFixedBinArray(15, 20, 50, fPtHistBins+47);
171  GenerateFixedBinArray(20, 50, 150, fPtHistBins+62);
172 }
173 
179 {
181 
182  if (fComputeBackground) {
184  }
187  }
190  }
191  if (fDoMomentumBalance) {
193  }
196  }
197  if (fDoTriggerSimulation) {
199  }
200 
201  TIter next(fHistManager.GetListOfHistograms());
202  TObject* obj = 0;
203  while ((obj = next())) {
204  fOutput->Add(obj);
205  }
206 
207  // Intialize AliEventCuts
208  if (fUseAliEventCuts) {
209  fEventCutList = new TList();
210  fEventCutList ->SetOwner();
211  fEventCutList ->SetName("EventCutOutput");
212 
213  fEventCuts.OverrideAutomaticTriggerSelection(fOffTrigger);
214  if(fUseManualEventCuts==1)
215  {
216  fEventCuts.SetManualMode();
217  // Configure manual settings here
218  // ...
219  }
220  fEventCuts.AddQAplotsToList(fEventCutList);
221  fOutput->Add(fEventCutList);
222  }
223 
224  // Load eta-phi background scale factors from histogram on AliEn
227  }
228 
229  // Initialize embedding QA
231  if (embeddingHelper) {
232  bool res = fEmbeddingQA.Initialize();
233  if (res) {
235  }
236  }
237 
238  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
239 }
240 
241 /*
242  * This function allocates background subtraction histograms, if enabled.
243  * A set of histograms is allocated per each jet container.
244  */
246 {
247  TString histname;
248  TString title;
249 
250  AliJetContainer* jets = 0;
251  TIter nextJetColl(&fJetCollArray);
252  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
253 
254  histname = TString::Format("%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
255  title = histname + ";Centrality;Scale factor;counts";
256  fHistManager.CreateTH2(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 5);
257 
258  histname = TString::Format("%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
259  title = histname + ";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
260  fHistManager.CreateTH2(histname.Data(), title.Data(), 10, 0, 100, 400, -50, 150);
261 
262  histname = TString::Format("%s/BackgroundHistograms/hScaleFactorEtaPhi", jets->GetArrayName().Data());
263  title = histname + ";#eta;#phi;Centrality;Scale factor;";
264  Int_t nbins[4] = {fNEtaBins, fNPhiBins, 50, 400};
265  Double_t min[4] = {-0.5,1., 0, 0};
266  Double_t max[4] = {0.5,6., 100, 20};
267  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins, min, max);
268 
269  histname = TString::Format("%s/BackgroundHistograms/hDeltaPtEtaPhi", jets->GetArrayName().Data());
270  title = histname + ";#eta;#phi;Centrality;#delta#it{p}_{T} (GeV/#it{c})";
271  Int_t nbinsDpT[4] = {fNEtaBins, fNPhiBins, 10, 400};
272  Double_t minDpT[4] = {-0.5,1., 0, -50};
273  Double_t maxDpT[4] = {0.5,6., 100, 150};
274  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbinsDpT, minDpT, maxDpT);
275 
276  }
277 }
278 
279 /*
280  * This function allocates the histograms for dijet candidates, i.e. dijet pairs with the leading jet
281  * passing the trigger condition, but no condition on the subleading jet. In particular this histogram is
282  * designed to study the kinematic selection of dijets.
283  */
285 {
286  // Allocate dijet THnSparse
287  AliJetContainer* jets = 0;
288  TIter nextJetColl(&fJetCollArray);
289  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
290  TString axisTitle[30]= {""};
291  Int_t nbins[30] = {0};
292  Double_t min[30] = {0.};
293  Double_t max[30] = {0.};
294  Double_t *binEdges[20] = {0};
295  Int_t dim = 0;
296 
297  if (fForceBeamType != kpp) {
298  axisTitle[dim] = "Centrality (%)";
299  nbins[dim] = fNCentHistBins;
300  binEdges[dim] = fCentHistBins;
301  min[dim] = fCentHistBins[0];
302  max[dim] = fCentHistBins[fNCentHistBins];
303  dim++;
304  }
305 
306  axisTitle[dim] = "LeadingHadronRequired";
307  nbins[dim] = 2;
308  min[dim] = -0.5;
309  max[dim] = 1.5;
310  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
311  dim++;
312 
313  axisTitle[dim] = "#it{p}_{T,trig jet} (GeV/#it{c})";
314  nbins[dim] = TMath::CeilNint(fMaxPt/2);
315  min[dim] = 0;
316  max[dim] = fMaxPt;
317  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
318  dim++;
319 
320  axisTitle[dim] = "#it{p}_{T,ass jet} (GeV/#it{c})";
321  nbins[dim] = TMath::CeilNint(fMaxPt/2);
322  min[dim] = 0;
323  max[dim] = fMaxPt;
324  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
325  dim++;
326 
327  axisTitle[dim] = "#phi_{trig jet}";
328  nbins[dim] = TMath::CeilNint(fMaxPt/2);
329  min[dim] = 0;
330  max[dim] = TMath::TwoPi();
331  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
332  dim++;
333 
334  axisTitle[dim] = "#phi_{ass jet}";
335  nbins[dim] = TMath::CeilNint(fMaxPt/2);
336  min[dim] = 0;
337  max[dim] = TMath::TwoPi();
338  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
339  dim++;
340 
341  axisTitle[dim] = "#eta_{trig jet}";
342  nbins[dim] = TMath::CeilNint(fMaxPt/2);
343  min[dim] = -1;
344  max[dim] = 1;
345  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
346  dim++;
347 
348  axisTitle[dim] = "#eta_{ass jet}";
349  nbins[dim] = TMath::CeilNint(fMaxPt/2);
350  min[dim] = -1;
351  max[dim] = 1;
352  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
353  dim++;
354 
355  TString thnname = TString::Format("%s/DijetCandObservables", jets->GetArrayName().Data());
356  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
357  for (Int_t i = 0; i < dim; i++) {
358  hn->GetAxis(i)->SetTitle(axisTitle[i]);
359  hn->SetBinEdges(i, binEdges[i]);
360  }
361  }
362 }
363 
364 /*
365  * This function allocates the histograms for accepted dijets.
366  * The purpose is to study in detail the imbalance properties of the accepted dijets.
367  */
369 {
370  AliJetContainer* jets = 0;
371  TIter nextJetColl(&fJetCollArray);
372  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
373 
374  // Allocate dijet imbalance THnSparse, unless doing trigger simulation
375  if (!fDoTriggerSimulation) {
376  TString axisTitle[30]= {""};
377  Int_t nbins[30] = {0};
378  Double_t min[30] = {0.};
379  Double_t max[30] = {0.};
380  Double_t *binEdges[20] = {0};
381  Int_t dim = 0;
382 
383  if (fForceBeamType != kpp) {
384  axisTitle[dim] = "Centrality (%)";
385  nbins[dim] = fNCentHistBins;
386  binEdges[dim] = fCentHistBins;
387  min[dim] = fCentHistBins[0];
388  max[dim] = fCentHistBins[fNCentHistBins];
389  dim++;
390  }
391 
392  axisTitle[dim] = "#Delta#phi";
393  nbins[dim] = 100;
394  min[dim] = 0;
395  max[dim] = 4;
396  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
397  dim++;
398 
399  axisTitle[dim] = "#Delta#eta";
400  nbins[dim] = 100;
401  min[dim] = -2;
402  max[dim] = 2;
403  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
404  dim++;
405 
406  axisTitle[dim] = "A_{J}";
407  nbins[dim] = 100;
408  min[dim] = 0;
409  max[dim] = 1;
410  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
411  dim++;
412 
413  axisTitle[dim] = "x_{J}";
414  nbins[dim] = 100;
415  min[dim] = 0;
416  max[dim] = 1;
417  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
418  dim++;
419 
420  axisTitle[dim] = "k_{Ty} (GeV)";
421  nbins[dim] = 100;
422  min[dim] = 0;
423  max[dim] = 100;
424  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
425  dim++;
426 
427  axisTitle[dim] = "N_{tracks, trig jet}";
428  nbins[dim] = fMaxPt/5;
429  min[dim] = 0;
430  max[dim] = 100;
431  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
432  dim++;
433 
434  axisTitle[dim] = "N_{tracks, ass jet}";
435  nbins[dim] = fMaxPt/5;
436  min[dim] = 0;
437  max[dim] = 100;
438  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
439  dim++;
440 
441  TString thnname = TString::Format("%s/DijetImbalanceObservables", jets->GetArrayName().Data());
442  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
443  for (Int_t i = 0; i < dim; i++) {
444  hn->GetAxis(i)->SetTitle(axisTitle[i]);
445  hn->SetBinEdges(i, binEdges[i]);
446  }
447  }
448 
449  // Now, allocate 2d pt spectrum, upscaled according to MB downscaling factors (for trigger efficiency)
450  Int_t nPtBins = TMath::CeilNint(fMaxPt/2);
451 
452  // (Centrality, pT1, pT2) (upscaled)
453  TString histname = TString::Format("%s/DijetJetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
454  TString title = histname + ";Centrality (%);#it{p}_{T,1}^{corr} (GeV/#it{c});#it{p}_{T,2}^{corr} (GeV/#it{c})";
455  fHistManager.CreateTH3(histname.Data(), title.Data(), 20, 0, 100, nPtBins, 0, fMaxPt, nPtBins, 0, fMaxPt, "s");
456 
457  // Now, plot jet histograms for the leading jet within the dijet (for comparison to single jets, and triggered to MB)
458 
459  // (Centrality, pT, NEF, calo type)
460  histname = TString::Format("%s/DijetJetHistograms/hNEFVsPt", jets->GetArrayName().Data());
461  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF;type";
462  Int_t nbins1[4] = {20, nPtBins, 50, 3};
463  Double_t min1[4] = {0, 0, 0, -0.5};
464  Double_t max1[4] = {100, fMaxPt, 1., 2.5};
465  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins1, min1, max1);
466 
467  // (Centrality, pT, z-leading (charged), calo type)
468  histname = TString::Format("%s/DijetJetHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
469  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading};type";
470  Int_t nbins2[4] = {20, nPtBins, 50, 3};
471  Double_t min2[4] = {0, 0, 0, -0.5};
472  Double_t max2[4] = {100, fMaxPt, 1., 2.5};
473  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins2, min2, max2);
474 
475  // (Centrality, pT, z (charged), calo type)
476  histname = TString::Format("%s/DijetJetHistograms/hZVsPt", jets->GetArrayName().Data());
477  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z};type";
478  Int_t nbins3[4] = {20, nPtBins, 50, 3};
479  Double_t min3[4] = {0, 0, 0, -0.5};
480  Double_t max3[4] = {100, fMaxPt, 1., 2.5};
481  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins3, min3, max3);
482 
483  // (Centrality, pT, Nconst, calo type)
484  histname = TString::Format("%s/DijetJetHistograms/hNConstVsPt", jets->GetArrayName().Data());
485  title = histname + ";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents;type";
486  Int_t nbins4[4] = {20, nPtBins, 50, 3};
487  Double_t min4[4] = {0, 0, 0, -0.5};
488  Double_t max4[4] = {100, fMaxPt, fMaxPt, 2.5};
489  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbins4, min4, max4);
490  }
491 }
492 
493 /*
494  * This function allocates the histograms for the momentum balance study.
495  */
497 {
498  AliJetContainer* jets = 0;
499  TIter nextJetColl(&fJetCollArray);
500  while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
501 
502  // Allocate THnSparse
503  TString axisTitle[30]= {""};
504  Int_t nbins[30] = {0};
505  Double_t min[30] = {0.};
506  Double_t max[30] = {0.};
507  Double_t *binEdges[20] = {0};
508  Int_t dim = 0;
509 
510  axisTitle[dim] = "A_{J}";
511  nbins[dim] = 100;
512  min[dim] = 0;
513  max[dim] = 1;
514  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
515  dim++;
516 
517  axisTitle[dim] = "#Delta#phi";
518  nbins[dim] = 100;
519  min[dim] = -4;
520  max[dim] = 4;
521  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
522  dim++;
523 
524  axisTitle[dim] = "#it{p}_{T,particle} (GeV/#it{c})";
525  nbins[dim] = 9;
526  Double_t* pTParticleBins = new Double_t[nbins[dim]+1];
527  GenerateFixedBinArray(1, 0.15, 0.3, pTParticleBins);
528  GenerateFixedBinArray(1, 0.3, 0.5, pTParticleBins+1);
529  GenerateFixedBinArray(1, 0.5, 1, pTParticleBins+2);
530  GenerateFixedBinArray(2, 1, 5, pTParticleBins+3);
531  GenerateFixedBinArray(3, 5, 20, pTParticleBins+5);
532  GenerateFixedBinArray(1, 20, 150, pTParticleBins+8);
533  min[dim] = 0;
534  max[dim] = pTParticleBins[nbins[dim]];
535  binEdges[dim] = pTParticleBins;
536  dim++;
537 
538  axisTitle[dim] = "#it{p}_{T}#parallel (GeV/#it{c})";
539  nbins[dim] = 80;
540  Double_t* pTParallelBins = new Double_t[nbins[dim]+1];
541  GenerateFixedBinArray(20, 0, 2, pTParallelBins);
542  GenerateFixedBinArray(16, 2, 10, pTParallelBins+20);
543  GenerateFixedBinArray(10, 10, 20, pTParallelBins+36);
544  GenerateFixedBinArray(10, 20, 40, pTParallelBins+46);
545  GenerateFixedBinArray(24, 40, 150, pTParallelBins+56);
546  min[dim] = 0;
547  max[dim] = pTParallelBins[nbins[dim]];
548  binEdges[dim] = pTParallelBins;
549  dim++;
550 
551  TString thnname = TString::Format("%s/MomentumBalance", jets->GetArrayName().Data());
552  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
553  for (Int_t i = 0; i < dim; i++) {
554  hn->GetAxis(i)->SetTitle(axisTitle[i]);
555  hn->SetBinEdges(i, binEdges[i]);
556  }
557  }
558 }
559 
560 /*
561  * This function allocates the histograms for the constituent dijet study.
562  */
564 {
565  // Allocate geometrical matching THnSparse
566  TString axisTitle[30]= {""};
567  Int_t nbins[30] = {0};
568  Double_t min[30] = {0.};
569  Double_t max[30] = {0.};
570  Double_t *binEdges[20] = {0};
571  Int_t dim = 0;
572 
573  if (fForceBeamType != kpp) {
574  axisTitle[dim] = "Centrality (%)";
575  nbins[dim] = fNCentHistBins;
576  binEdges[dim] = fCentHistBins;
577  min[dim] = fCentHistBins[0];
578  max[dim] = fCentHistBins[fNCentHistBins];
579  dim++;
580  }
581 
582  axisTitle[dim] = "isSwitched";
583  nbins[dim] = 2;
584  min[dim] = -0.5;
585  max[dim] = 1.5;
586  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
587  dim++;
588 
589  axisTitle[dim] = "#DeltaR_{trig}";
590  nbins[dim] = 50;
591  min[dim] = 0;
592  max[dim] = 0.5;
593  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
594  dim++;
595 
596  axisTitle[dim] = "#DeltaR_{ass}";
597  nbins[dim] = 50;
598  min[dim] = 0;
599  max[dim] = 0.5;
600  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
601  dim++;
602 
603  axisTitle[dim] = "trig #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}";
604  nbins[dim] = 100;
605  min[dim] = -50;
606  max[dim] = 50;
607  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
608  dim++;
609 
610  axisTitle[dim] = "ass #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}";
611  nbins[dim] = 100;
612  min[dim] = -50;
613  max[dim] = 50;
614  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
615  dim++;
616 
617  axisTitle[dim] = "A_{J} low-threshold";
618  nbins[dim] = 100;
619  min[dim] = 0;
620  max[dim] = 1;
621  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
622  dim++;
623 
624  axisTitle[dim] = "A_{J} hard-core";
625  nbins[dim] = 100;
626  min[dim] = 0;
627  max[dim] = 1;
628  binEdges[dim] = GenerateFixedBinArray(nbins[dim], min[dim], max[dim]);
629  dim++;
630 
631  TString thnname = "GeometricalMatching";
632  THnSparse* hn = fHistManager.CreateTHnSparse(thnname.Data(), thnname.Data(), dim, nbins, min, max);
633  for (Int_t i = 0; i < dim; i++) {
634  hn->GetAxis(i)->SetTitle(axisTitle[i]);
635  hn->SetBinEdges(i, binEdges[i]);
636  }
637 
638  // Allocate other histograms
639  TString histname;
640  TString title;
641  histname = "GeometricalMatchingEfficiency";
642  title = histname + ";isMatched;counts";
643  fHistManager.CreateTH1(histname.Data(), title.Data(), 2, -0.5, 1.5);
644 }
645 
646 /*
647  * This function allocates the histograms for single jets, when the "simulated" trigger has been fired.
648  * A set of histograms is allocated per each jet container.
649  */
651 {
652  TString histname;
653  TString title;
654 
655  //----------------------------------------------
656  // Trigger patch histograms
657 
658  // Median patch energy vs. centrality, for dijets
659  histname = "TriggerSimHistograms/hMedPatchDijet";
660  title = histname + ";Centrality (%);#it{p}_{T,trig}^{corr} (GeV/#it{c});#it{E}_{patch,med} (GeV);type";
661  Int_t nbinsD[4] = {50, 40, 100, 2};
662  Double_t minD[4] = {0, 0, 0, -0.5};
663  Double_t maxD[4] = {100, 200, 50, 1.5};
664  fHistManager.CreateTHnSparse(histname.Data(), title.Data(), 4, nbinsD, minD, maxD);
665 
666 }
667 
671 void AliAnalysisTaskEmcalDijetImbalance::LoadBackgroundScalingHistogram(const char* path, const char* name1, const char* name2)
672 {
673 
674  TString fname(path);
675  if (fname.BeginsWith("alien://")) {
676  TGrid::Connect("alien://");
677  }
678 
679  TFile* file = TFile::Open(path);
680 
681  if (!file || file->IsZombie()) {
682  ::Error("AliAnalysisTaskEmcalDijetImbalance", "Could not open background scaling histogram");
683  return;
684  }
685 
686  // Open background scale factor histogram
687  TH2D* h1 = dynamic_cast<TH2D*>(file->Get(name1));
688 
689  if (h1) {
690  ::Info("AliAnalysisTaskEmcalDijetImbalance::LoadBackgroundScalingHistogram", "Background histogram %s loaded from file %s.", name1, path);
691  }
692  else {
693  ::Error("AliAnalysisTaskEmcalDijetImbalance::LoadBackgroundScalingHistogram", "Background histogram %s not found in file %s.", name1, path);
694  return;
695  }
696 
697  fBackgroundScalingWeights = static_cast<TH2D*>(h1->Clone());
698 
699  // Open jet pT scale factor histogram
700  TH2D* h2 = dynamic_cast<TH2D*>(file->Get(name2));
701 
702  if (h2) {
703  ::Info("AliAnalysisTaskEmcalDijetImbalance::LoadBackgroundScalingHistogram", "Jet pT scaling histogram %s loaded from file %s.", name2, path);
704  }
705  else {
706  ::Error("AliAnalysisTaskEmcalDijetImbalance::LoadBackgroundScalingHistogram", "Jet pT scaling histogram %s not found in file %s.", name2, path);
707  return;
708  }
709 
710  fGapJetScalingWeights = static_cast<TH2D*>(h2->Clone());
711 
712  file->Close();
713  delete file;
714 
715 }
716 
722 {
723 
724  // Configure base class to set fTriggerPatchInfo to array of trigger patches, each event
725  // (Need to call this before base class ExecOnce)
726  if (fDoTriggerSimulation) {
727  this->SetCaloTriggerPatchInfoName("EmcalTriggers");
728  }
729 
731 
732  fNeedEmcalGeom = kTRUE;
733 
734  // Check if trigger patches are loaded
735  if (fDoTriggerSimulation) {
736  if (fTriggerPatchInfo) {
737  TString objname(fTriggerPatchInfo->GetClass()->GetName());
738  TClass cls(objname);
739  if (!cls.InheritsFrom("AliEMCALTriggerPatchInfo")) {
740  AliError(Form("%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
741  GetName(), cls.GetName(), "EmcalTriggers"));
742  fTriggerPatchInfo = 0;
743  }
744  }
745  if (!fTriggerPatchInfo) {
746  AliError(Form("%s: Unable to get trigger patch container with name %s. Aborting", GetName(), "EmcalTriggers"));
747  return;
748  }
749  }
750 
751  AliInfo(Form("Trigger jet threshold = %f, Associated jet threshold = %f", fMinTrigJetPt, fMinAssJetPt));
752  AliInfo(Form("Leading hadron threshold (for dijet leading jet): %f GeV", fDijetLeadingHadronPt));
753  AliInfo(Form("Momentum balance study: %d", fDoMomentumBalance));
754  AliInfo(Form("Geometrical matching study: %d", fDoGeometricalMatching));
755 
756 }
757 
762 
763  // Get the downscaling factors for MB triggers (to be used to calculate trigger efficiency)
764 
765  if (fComputeMBDownscaling) {
766 
767  // Get instance of the downscale factor helper class
769  downscaleOCDB->SetRun(InputEvent()->GetRunNumber());
770 
771  // There are two possible min bias triggers for LHC15o
772  TString triggerNameMB1 = "CINT7-B-NOPF-CENT";
773  TString triggerNameMB2 = "CV0L7-B-NOPF-CENT";
774  TString triggerNameJE = "CINT7EJ1-B-NOPF-CENTNOPMD";
775 
776  // Get the downscale factor for whichever MB trigger exists in the given run
777  std::vector<TString> runtriggers = downscaleOCDB->GetTriggerClasses();
778  Double_t downscalefactor;
779  for (auto i : runtriggers) {
780  if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
781  downscalefactor = downscaleOCDB->GetDownscaleFactorForTriggerClass(i.Data());
782  break;
783  }
784  }
785 
786  // Store the inverse of the downscale factor, used later to weight the pT spectrum
787  fMBUpscaleFactor = 1/downscalefactor;
788 
789  }
790 
791 }
792 
797 {
798  if (fUseAliEventCuts) {
799  if (!fEventCuts.AcceptEvent(InputEvent()))
800  {
801  PostData(1, fOutput);
802  return kFALSE;
803  }
804  }
805  else {
807  }
808  return kTRUE;
809 }
810 
819 {
820  TString histname;
821  AliJetContainer* jetCont = 0;
822  TIter next(&fJetCollArray);
823  while ((jetCont = static_cast<AliJetContainer*>(next()))) {
824  TString jetContName = jetCont->GetName();
825  if (jetContName.Contains("HardCore")) continue;
826 
827  //-----------------------------------------------------------------------------
828  // Find the leading di-jet candidate in each event, and if it satisfies the
829  // trig jet pT threshold, then fill di-jet candidate histogram (regardless of ass jet).
830  // The idea is to study the kinematic selections in post-processing.
831 
832  // Loop over leading hadron cut or not
833  for (Int_t leadingHadronCutType=0; leadingHadronCutType<2; leadingHadronCutType++) {
834 
835  // Find the dijet candidate of the event and store its info in struct fDijet
836  FindDijet(jetCont, leadingHadronCutType);
837 
838  // If we find a dijet candidate (i.e. acceptable trig jet; ass jet accepted or not), fill the di-jet candidate histogram
840  FillDijetCandHistograms(jetCont);
841  }
842 
843  }
844 
845  //---------------------------------------------------------------------------------------------------
846  // Now, study the accepted dijet selection -- specified by the trig/ass jet pT conditions
847 
848  // Find the dijet candidate of the event and store its info in struct fDijet
849  FindDijet(jetCont, 0);
850 
851  // If we find an accepted dijet, fill the dijet imbalance histogram
854  }
855  // If we find an accepted dijet, perform momentum-balance study (if requested)
857  histname = TString::Format("%s/MomentumBalance", jetCont->GetArrayName().Data());
858  DoMomentumBalance(histname);
859  }
860 
861  //---------------------------------------------------------------------------
862  // Do a simple trigger simulation (if requested)
863  if (fDoTriggerSimulation) {
865  }
866 
867  }
868 
869  //---------------------------------------------------------------------------
870  // Do the constituent threshold and geometrical matching study (if requested)
873  }
874 
875  // Only fill the embedding qa plots if:
876  // - We are using the embedding helper
877  // - The class has been initialized
878  // - Both jet collections are available
879  if (fEmbeddingQA.IsInitialized()) {
881  }
882 
883  return kTRUE;
884 }
885 
894 {
895  fDijet.clear();
896  fDijet.leadingHadronCutType = leadingHadronCutBin;
897 
898  // Get trigger jet
899  AliEmcalJet* trigJet = GetLeadingJet(jetCont);
900  if(!trigJet) return;
901 
902  // Skip the event if the leading jet doesn't satisfy the pT threshold
903  Double_t trigJetPt = GetJetPt(jetCont, trigJet);
904  if ( trigJetPt < fMinTrigJetPt ) return;
905 
906  // Skip the event if the leading jet doesn't satisfy the leading hadron threshold
907  if (jetCont->GetLeadingHadronPt(trigJet) < fDijetLeadingHadronPt*leadingHadronCutBin) return;
908 
909  // Fill the dijet struct
910  fDijet.trigJet = trigJet;
911  fDijet.trigJetPt = trigJetPt;
912  fDijet.trigJetEta = trigJet->Eta();
913  fDijet.trigJetPhi = trigJet->Phi();
914 
915  // Find the subleading jet in the opposite hemisphere
916  AliEmcalJet *assJet = 0;
917  for(auto assJetCand : jetCont->accepted()) {
918  if (!assJetCand) continue;
919  Double_t assJetCandPt = GetJetPt(jetCont, assJetCand);
920  if ( TMath::Abs(trigJet->Phi() - assJetCand->Phi()) < fDeltaPhiMin ) continue;
921  if (assJet) {
922  Double_t assJetPt = GetJetPt(jetCont, assJet);
923  if ( assJetCandPt < assJetPt ) continue;
924  }
925  assJet = assJetCand;
926  }
927  if (!assJet) return;
928 
929  // Fill the dijet struct
930  fDijet.assJet = assJet;
931  fDijet.assJetPt = GetJetPt(jetCont, assJet);
932  fDijet.assJetPhi = assJet->Phi();
933  fDijet.assJetEta = assJet->Eta();
935 
936  fDijet.deltaPhi = TMath::Abs(trigJet->Phi() - assJet->Phi());
937  fDijet.deltaEta = trigJet->Eta() - assJet->Eta();
940  fDijet.kTy = TMath::Abs( fDijet.trigJetPt * TMath::Sin(fDijet.deltaPhi) );
941 }
942 
948 {
949 
950  AliTrackContainer* trackCont = dynamic_cast<AliTrackContainer*>(GetParticleContainer("tracks"));
951 
952  AliVTrack* track;
953  for (auto trackIterator : trackCont->accepted_momentum() ) {
954 
955  track = trackIterator.second;
956 
957  // Compute the delta phi between the track and its nearest jet (of the two jets in the dijet),
958  // as well as its pT-parallel projection onto the nearest jet's axis.
959 
960  Double_t trackPt = track->Pt();
961  Double_t trackPhi = track->Phi();
962  Double_t trigJetPhi = fDijet.trigJet->Phi();
963  Double_t assJetPhi = fDijet.assJet->Phi();
964 
965  Double_t deltaPhiTrigJet = TMath::Abs(trackPhi - trigJetPhi);
966  Double_t deltaPhiAssJet = TMath::Abs(trackPhi - assJetPhi);
967  Bool_t isNearside = deltaPhiTrigJet < deltaPhiAssJet;
968 
969  Double_t deltaPhi;
970  Double_t balancePt;
971  if (isNearside) {
972  deltaPhi = trackPhi - trigJetPhi;
973  balancePt = trackPt * TMath::Cos(deltaPhi);
974  }
975  else {
976  deltaPhi = trackPhi - assJetPhi;
977  balancePt = -trackPt * TMath::Cos(deltaPhi);
978  }
979 
980  FillMomentumBalanceHistograms(histname, deltaPhi, trackPt, balancePt);
981 
982  }
983 }
984 
989 {
990  // Get jet container with minimum constituent pT,E thresholds
991  TString jetContAllName = Form("Jet_AKTFullR0%d0_tracks_pT0150_caloClusters_E0300_pt_scheme", (int) (fMatchingJetR*10) );
992  AliJetContainer* jetContAll = GetJetContainer(jetContAllName.Data());
993 
994  // Get jet container with X GeV constituent pT,E thresholds
995  Int_t trackThreshold = (int) (fTrackConstituentThreshold*1000); // in MeV
996  Int_t clusThreshold = (int) (fClusterConstituentThreshold*1000); // in MeV
997  TString jetContHardCoreName = Form("JetHardCore_AKTFullR0%d0_tracks_pT%d_caloClusters_E%d_pt_scheme", (int) (fMatchingJetR*10), trackThreshold, clusThreshold);
998  AliJetContainer* jetContHardCore = GetJetContainer(jetContHardCoreName.Data());
999 
1000  // Find the di-jet in the hard-core jet sample, then find the matching di-jet and fill histograms
1001  FindDijet(jetContHardCore, 0);
1002  if (fDijet.isAccepted) {
1003  FindMatchingDijet(jetContAll);
1005  }
1006 }
1007 
1013 {
1014  TString histname;
1015 
1016  // Check if trigger patches are loaded
1017  if (fTriggerPatchInfo) {
1018  TString objname(fTriggerPatchInfo->GetClass()->GetName());
1019  TClass cls(objname);
1020  if (!cls.InheritsFrom("AliEMCALTriggerPatchInfo")) {
1021  AliError(Form("%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1022  GetName(), cls.GetName(), "EmcalTriggers"));
1023  fTriggerPatchInfo = 0;
1024  }
1025  }
1026  if (!fTriggerPatchInfo) {
1027  AliError(Form("%s: Unable to get trigger patch container with name %s. Aborting", GetName(), "EmcalTriggers"));
1028  return;
1029  }
1030 
1031  // Compute patches in EMCal, DCal (I want offline simple trigger patch, i.e. patch calculated using FEE energy)
1032  std::vector<Double_t> vecEMCal;
1033  std::vector<Double_t> vecDCal;
1034  for(auto p : *fTriggerPatchInfo){
1035  AliEMCALTriggerPatchInfo *recpatch = static_cast<AliEMCALTriggerPatchInfo *>(p);
1036  if (recpatch) {
1037 
1038  if(!recpatch->IsJetHighSimple()) continue;
1039 
1040  if (recpatch->IsEMCal()) {
1041  vecEMCal.push_back(recpatch->GetPatchE());
1042  } else {
1043  vecDCal.push_back(recpatch->GetPatchE());
1044  }
1045 
1046  }
1047  }
1048 
1049  // Compute the median in each calorimeter
1050  const Int_t nBkgPatchesEMCal = vecEMCal.size(); // 6*8;
1051  const Int_t nBkgPatchesDCal = vecDCal.size(); // 4*5;
1052  fMedianEMCal = TMath::Median(nBkgPatchesEMCal, &vecEMCal[0]); // point to array used internally by vector
1053  fMedianDCal = TMath::Median(nBkgPatchesDCal, &vecDCal[0]);
1054 
1055  // Median patch energy vs. pT for dijets
1056  if (fDijet.isAccepted) {
1057  histname = "TriggerSimHistograms/hMedPatchDijet";
1059  fHistManager.FillTHnSparse(histname, x);
1061  fHistManager.FillTHnSparse(histname, y);
1062  }
1063 
1064 }
1065 
1071 {
1073 
1074  // Loop over jets and find leading jet within R of fDijet.trigJet
1075  AliEmcalJet *matchingTrigJet = 0;
1076  for(auto matchingTrigJetCand : jetCont->accepted()) {
1077  if (!matchingTrigJetCand) continue;
1078  if ( GetDeltaR(matchingTrigJetCand, fDijet.trigJet) > fMatchingJetR ) continue;
1079  if (matchingTrigJet) {
1080  if ( GetJetPt(jetCont, matchingTrigJetCand) < GetJetPt(jetCont, matchingTrigJet) ) continue;
1081  }
1082  matchingTrigJet = matchingTrigJetCand;
1083  }
1084  if (!matchingTrigJet) return;
1085 
1086  // Loop over jets and find leading jet within R of fDijet.assJet
1087  AliEmcalJet *matchingAssJet = 0;
1088  for(auto matchingAssJetCand : jetCont->accepted()) {
1089  if (!matchingAssJetCand) continue;
1090  if ( GetDeltaR(matchingAssJetCand, fDijet.assJet) > fMatchingJetR ) continue;
1091  if (matchingAssJet) {
1092  if ( GetJetPt(jetCont, matchingAssJetCand) < GetJetPt(jetCont, matchingAssJet) ) continue;
1093  }
1094  matchingAssJet = matchingAssJetCand;
1095  }
1096 
1097  // Determine which matching jet is the leading jet (i.e. allow them to flip)
1098  if (matchingAssJet) {
1099  AliEmcalJet* trigJet = matchingTrigJet;
1100  AliEmcalJet* assJet = matchingAssJet;
1101  if ( GetJetPt(jetCont, matchingTrigJet) < GetJetPt(jetCont, matchingAssJet) ) {
1102  trigJet = matchingAssJet;
1103  assJet = matchingTrigJet;
1104  }
1105 
1106  // Fill the dijet struct
1107  fMatchingDijet.trigJet = trigJet;
1108  fMatchingDijet.trigJetPt = GetJetPt(jetCont, trigJet);
1109  fMatchingDijet.trigJetEta = trigJet->Eta();
1110  fMatchingDijet.trigJetPhi = trigJet->Phi();
1111 
1112  fMatchingDijet.assJet = assJet;
1113  fMatchingDijet.assJetPt = GetJetPt(jetCont, assJet);
1114  fMatchingDijet.assJetPhi = assJet->Phi();
1115  fMatchingDijet.assJetEta = assJet->Eta();
1117 
1118  fMatchingDijet.deltaPhi = TMath::Abs(trigJet->Phi() - assJet->Phi());
1119  fMatchingDijet.deltaEta = trigJet->Eta() - assJet->Eta();
1122  fMatchingDijet.kTy = TMath::Abs( fMatchingDijet.trigJetPt * TMath::Sin(fMatchingDijet.deltaPhi) );
1123  }
1124 }
1125 
1130 {
1131  // Loop over tracks and clusters in order to:
1132  // (1) Compute scale factor for full jets
1133  // (2) Compute delta-pT for full jets, with the random cone method
1134  // For both the scale factor and delta-pT, we compute only one histogram each for EMCal.
1135  // And then we bin in eta-phi, in order to compute and perform a corretion to account for the DCal vs. PHOS vs. gap
1136 
1137  // Define the acceptance boundaries for the TPC and EMCal/DCal/PHOS
1138  Double_t etaTPC = 0.9;
1139  Double_t etaEMCal = 0.7;
1140  //Double_t etaMinDCal = 0.22;
1141  //Double_t etaMaxPHOS = 0.13;
1142  Double_t phiMinEMCal = fGeom->GetArm1PhiMin() * TMath::DegToRad(); // 80
1143  Double_t phiMaxEMCal = fGeom->GetEMCALPhiMax() * TMath::DegToRad(); // ~188
1144  //Double_t phiMinDCal = fGeom->GetDCALPhiMin() * TMath::DegToRad(); // 260
1145  //Double_t phiMaxDCal = fGeom->GetDCALPhiMax() * TMath::DegToRad(); // ~327 (1/3 SMs start at 320)
1146  //Double_t phiMinPHOS = 250 * TMath::DegToRad();
1147  //Double_t phiMaxPHOS = 320 * TMath::DegToRad();
1148 
1149  Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
1150  Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
1151  //Double_t accDCalRegion = 2 * etaEMCal * (phiMaxDCal - phiMinDCal);
1152 
1153  // Loop over jet containers
1154  AliJetContainer* jetCont = 0;
1155  TIter nextJetColl(&fJetCollArray);
1156  while ((jetCont = static_cast<AliJetContainer*>(nextJetColl()))) {
1157 
1158  // Define fiducial acceptances, to be used to generate random cones
1159  TRandom3* r = new TRandom3(0);
1160  Double_t jetR = jetCont->GetJetRadius();
1161  Double_t accRC = TMath::Pi() * jetR * jetR;
1162  Double_t etaEMCalfid = etaEMCal - jetR;
1163  Double_t phiMinEMCalfid = phiMinEMCal + jetR;
1164  Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
1165 
1166  // Generate EMCal random cone eta-phi
1167  Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
1168  Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
1169 
1170  // For eta-phi correction, generate random eta, phi in each eta/phi bin, to be used as center of random cone
1171  Double_t etaDCalRC[fNEtaBins]; // array storing the RC eta values
1172  Double_t etaStep = 1./fNEtaBins;
1173  Double_t etaMin;
1174  Double_t etaMax;
1175  for (Int_t etaBin=0; etaBin < fNEtaBins; etaBin++) {
1176  etaMin = -etaEMCalfid + etaBin*etaStep;
1177  etaMax = etaMin + etaStep;
1178  etaDCalRC[etaBin] = r->Uniform(etaMin, etaMax);
1179  }
1180 
1181  Double_t phiDCalRC[fNPhiBins]; // array storing the RC phi values
1182  Double_t phiStep = 5./fNPhiBins; // phi axis is [1,6] in order to have simple binning
1183  Double_t phiMin;
1184  Double_t phiMax;
1185  for (Int_t phiBin=0; phiBin < fNPhiBins; phiBin++) {
1186  phiMin = 1 + phiBin*phiStep;
1187  phiMax = phiMin + phiStep;
1188  phiDCalRC[phiBin] = r->Uniform(phiMin, phiMax);
1189  }
1190 
1191  // Initialize the various sums to 0
1192  Double_t trackPtSumTPC = 0;
1193  Double_t trackPtSumEMCal = 0;
1194  Double_t trackPtSumEMCalRC = 0;
1195  Double_t clusESumEMCal = 0;
1196  Double_t clusESumEMCalRC = 0;
1197 
1198  // Define a 2D vector (initialized to 0) to store the sum of track pT, and another for cluster ET
1199  std::vector<std::vector<Double_t>> trackPtSumDCalRC(fNEtaBins, std::vector<Double_t>(fNPhiBins));
1200  std::vector<std::vector<Double_t>> clusESumDCalRC(fNEtaBins, std::vector<Double_t>(fNPhiBins));
1201 
1202  // Loop over tracks. Sum the track pT:
1203  // (1) in the entire TPC, (2) in the EMCal, (3) in the EMCal random cone,
1204  // (4) in a random cone at each eta-phi
1205  AliTrackContainer* trackCont = dynamic_cast<AliTrackContainer*>(GetParticleContainer("tracks"));
1206  AliTLorentzVector track;
1207  Double_t trackEta;
1208  Double_t trackPhi;
1209  Double_t trackPt;
1210  Double_t deltaR;
1211  for (auto trackIterator : trackCont->accepted_momentum() ) {
1212 
1213  track.Clear();
1214  track = trackIterator.first;
1215  trackEta = track.Eta();
1216  trackPhi = track.Phi_0_2pi();
1217  trackPt = track.Pt();
1218 
1219  // (1)
1220  if (TMath::Abs(trackEta) < etaTPC) {
1221  trackPtSumTPC += trackPt;
1222  }
1223 
1224  // (2)
1225  if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
1226  trackPtSumEMCal += trackPt;
1227  }
1228 
1229  // (3)
1230  deltaR = GetDeltaR(&track, etaEMCalRC, phiEMCalRC);
1231  if (deltaR < jetR) {
1232  trackPtSumEMCalRC += trackPt;
1233  }
1234 
1235  // (4)
1236  for (Int_t etaBin=0; etaBin < fNEtaBins; etaBin++) {
1237  for (Int_t phiBin=0; phiBin < fNPhiBins; phiBin++) {
1238  deltaR = GetDeltaR(&track, etaDCalRC[etaBin], phiDCalRC[phiBin]);
1239  if (deltaR < jetR) {
1240  trackPtSumDCalRC[etaBin][phiBin] += trackPt;
1241  }
1242  }
1243  }
1244 
1245  }
1246 
1247  // Loop over clusters. Sum the cluster ET:
1248  // (1) in the EMCal, (2) in the EMCal random cone, (3) in a random cone at each eta-phi
1250  AliTLorentzVector clus;
1251  Double_t clusEta;
1252  Double_t clusPhi;
1253  Double_t clusE;
1254  for (auto clusIterator : clusCont->accepted_momentum() ) {
1255 
1256  clus.Clear();
1257  clus = clusIterator.first;
1258  clusEta = clus.Eta();
1259  clusPhi = clus.Phi_0_2pi();
1260  clusE = clus.E();
1261 
1262  // (1)
1263  if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
1264  clusESumEMCal += clusE;
1265  }
1266 
1267  // (2)
1268  deltaR = GetDeltaR(&clus, etaEMCalRC, phiEMCalRC);
1269  if (deltaR < jetR) {
1270  clusESumEMCalRC += clusE;
1271  }
1272 
1273  // (3)
1274  for (Int_t etaBin=0; etaBin < fNEtaBins; etaBin++) {
1275  for (Int_t phiBin=0; phiBin < fNPhiBins; phiBin++) {
1276  deltaR = GetDeltaR(&clus, etaDCalRC[etaBin], phiDCalRC[phiBin]);
1277  if (deltaR < jetR) {
1278  clusESumDCalRC[etaBin][phiBin] += clusE;
1279  }
1280  }
1281  }
1282 
1283  }
1284 
1285  // Compute the scale factor for EMCal, as a function of centrality
1286  Double_t numerator = (trackPtSumEMCal + clusESumEMCal) / accEMCal;
1287  Double_t denominator = trackPtSumTPC / accTPC;
1288  Double_t scaleFactor = numerator / denominator;
1289  TString histname = TString::Format("%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
1290  fHistManager.FillTH2(histname, fCent, scaleFactor);
1291 
1292  // Compute the scale factor in each eta-phi bin, as a function of centrality
1293  for (Int_t etaBin=0; etaBin < fNEtaBins; etaBin++) {
1294  for (Int_t phiBin=0; phiBin < fNPhiBins; phiBin++) {
1295  numerator = (trackPtSumDCalRC[etaBin][phiBin] + clusESumDCalRC[etaBin][phiBin]) / accRC;
1296  scaleFactor = numerator / denominator;
1297  histname = TString::Format("%s/BackgroundHistograms/hScaleFactorEtaPhi", jetCont->GetArrayName().Data());
1298  Double_t x[4] = {etaDCalRC[etaBin], phiDCalRC[phiBin], fCent, scaleFactor};
1299  fHistManager.FillTHnSparse(histname, x);
1300  }
1301  }
1302 
1303  // Compute delta pT for EMCal, as a function of centrality
1304  Double_t rho = jetCont->GetRhoVal();
1305  Double_t deltaPt = trackPtSumEMCalRC + clusESumEMCalRC - rho * TMath::Pi() * jetR * jetR;
1306  histname = TString::Format("%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
1307  fHistManager.FillTH2(histname, fCent, deltaPt);
1308 
1309  // Compute delta pT in each eta-phi bin, as a function of centrality
1310  Double_t sf;
1311  for (Int_t etaBin=0; etaBin < fNEtaBins; etaBin++) {
1312  for (Int_t phiBin=0; phiBin < fNPhiBins; phiBin++) {
1314  sf = fBackgroundScalingWeights->GetBinContent(fBackgroundScalingWeights->FindBin(etaDCalRC[etaBin], phiDCalRC[phiBin]));
1315  rho = sf * jetCont->GetRhoVal();
1316  }
1317  deltaPt = trackPtSumDCalRC[etaBin][phiBin] + clusESumDCalRC[etaBin][phiBin] - rho * accRC;
1318  histname = TString::Format("%s/BackgroundHistograms/hDeltaPtEtaPhi", jetCont->GetArrayName().Data());
1319  Double_t x[4] = {etaDCalRC[etaBin], phiDCalRC[phiBin], fCent, deltaPt};
1320  fHistManager.FillTHnSparse(histname, x);
1321  }
1322  }
1323 
1324  delete r;
1325 
1326  }
1327 
1328 }
1329 
1334 {
1335 
1336  // Get eta-phi dependent jet pT scale factor
1337  Double_t jetPt = jet->Pt();
1338  if (fGapJetScalingWeights) {
1339  Double_t sf = fGapJetScalingWeights->GetBinContent(fGapJetScalingWeights->FindBin(jet->Eta(), jet->Phi_0_2pi()));
1340  jetPt = jetPt * (1 + sf * jet->NEF());
1341  }
1342 
1343  // Compute pTcorr
1344  Double_t rho = jetCont->GetRhoVal();
1345  Double_t pT = jetPt - rho * jet->Area();
1346 
1347  // If hard-core jet, don't subtract background
1348  TString jetContName = jetCont->GetName();
1349  if (jetContName.Contains("HardCore")) pT = jet->Pt();
1350 
1351  return pT;
1352 }
1353 
1358 {
1359  AliEmcalJet* leadingJet = 0;
1360 
1361  if (jetCont->GetRhoParameter()) {
1362  for(auto jetCand : jetCont->accepted()) {
1363  if (!jetCand) continue;
1364  Double_t jetCandPt = GetJetPt(jetCont, jetCand);
1365  if (leadingJet) {
1366  Double_t leadingJetPt = GetJetPt(jetCont, leadingJet);
1367  if ( jetCandPt < leadingJetPt ) continue;
1368  }
1369  leadingJet = jetCand;
1370  }
1371  }
1372  else {
1373  leadingJet = jetCont->GetLeadingJet();
1374  }
1375 
1376  return leadingJet;
1377 }
1378 
1383 {
1384  Double_t deltaPhi = TMath::Abs(jet1->Phi() - jet2->Phi());
1385  Double_t deltaEta = TMath::Abs(jet1->Eta() - jet2->Eta());
1386  Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
1387  return deltaR;
1388 }
1389 
1394 {
1395  Double_t deltaPhi = TMath::Abs(part->Phi_0_2pi() - phiRef);
1396  Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
1397  Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
1398  return deltaR;
1399 }
1400 
1405 {
1406  UInt_t jetType = jet->GetJetAcceptanceType();
1407  Double_t type = -1;
1408  if (jetType & AliEmcalJet::kEMCAL) {
1409  type = kEMCal;
1410  }
1411  else if (jetType & AliEmcalJet::kDCALonly) {
1412  type = kDCal;
1413  }
1414  else if (jetType & AliEmcalJet::kPHOS) {
1415  type = kPHOS;
1416  }
1417 
1418  return type;
1419 }
1420 
1421 
1429 {
1430 
1431  if (fComputeBackground) {
1433  }
1434 
1435  return kTRUE;
1436 }
1437 
1442 {
1443  Double_t contents[30]={0};
1444  TString histname = TString::Format("%s/DijetCandObservables", jets->GetArrayName().Data());
1445  THnSparse* histJetObservables = static_cast<THnSparse*>(fHistManager.FindObject(histname));
1446  if (!histJetObservables) return;
1447  for (Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
1448  TString title(histJetObservables->GetAxis(n)->GetTitle());
1449  if (title=="Centrality (%)")
1450  contents[n] = fCent;
1451  else if (title=="LeadingHadronRequired")
1452  contents[n] = fDijet.leadingHadronCutType;
1453  else if (title=="#it{p}_{T,trig jet} (GeV/#it{c})")
1454  contents[n] = fDijet.trigJetPt;
1455  else if (title=="#it{p}_{T,ass jet} (GeV/#it{c})")
1456  contents[n] = fDijet.assJetPt;
1457  else if (title=="#phi_{trig jet}")
1458  contents[n] = fDijet.trigJetPhi;
1459  else if (title=="#phi_{ass jet}")
1460  contents[n] = fDijet.assJetPhi;
1461  else if (title=="#eta_{trig jet}")
1462  contents[n] = fDijet.trigJetEta;
1463  else if (title=="#eta_{ass jet}")
1464  contents[n] = fDijet.assJetEta;
1465  else
1466  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
1467  }
1468  histJetObservables->Fill(contents);
1469 }
1470 
1475 {
1476  // Fill the dijet imbalance histogram (unless doing trigger simulation, in which case bypass this)
1477  if (!fDoTriggerSimulation) {
1478  Double_t contents[30]={0};
1479  TString histname = TString::Format("%s/DijetImbalanceObservables", jets->GetArrayName().Data());
1480  THnSparse* histJetObservables = static_cast<THnSparse*>(fHistManager.FindObject(histname));
1481  if (!histJetObservables) return;
1482  for (Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
1483  TString title(histJetObservables->GetAxis(n)->GetTitle());
1484  if (title=="Centrality (%)")
1485  contents[n] = fCent;
1486  else if (title=="#Delta#phi")
1487  contents[n] = fDijet.deltaPhi;
1488  else if (title=="#Delta#eta")
1489  contents[n] = fDijet.deltaEta;
1490  else if (title=="A_{J}")
1491  contents[n] = fDijet.AJ;
1492  else if (title=="x_{J}")
1493  contents[n] = fDijet.xJ;
1494  else if (title=="k_{Ty} (GeV)")
1495  contents[n] = fDijet.kTy;
1496  else if (title=="N_{tracks, trig jet}")
1497  contents[n] = fDijet.trigJet->GetNumberOfTracks();
1498  else if (title=="N_{tracks, ass jet}")
1499  contents[n] = fDijet.assJet->GetNumberOfTracks();
1500  else
1501  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
1502  }
1503  histJetObservables->Fill(contents);
1504  }
1505 
1506  // (Centrality, pT1, pT2) (upscaled)
1507  TString histname = TString::Format("%s/DijetJetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1509 
1510  // Get jet acceptance type
1511  AliEmcalJet* trigJet = fDijet.trigJet;
1512  Double_t type = GetJetType(trigJet);
1513 
1514  // (Centrality, pT, NEF, calo type)
1515  histname = TString::Format("%s/DijetJetHistograms/hNEFVsPt", jets->GetArrayName().Data());
1516  Double_t x[4] = {fCent, fDijet.trigJetPt, trigJet->NEF(), type};
1517  fHistManager.FillTHnSparse(histname, x);
1518 
1519  // (Centrality, pT, z-leading (charged), calo type)
1520  histname = TString::Format("%s/DijetJetHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
1521  TLorentzVector leadPart;
1522  jets->GetLeadingHadronMomentum(leadPart, trigJet);
1523  Double_t z = GetParallelFraction(leadPart.Vect(), trigJet);
1524  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
1525  Double_t y[4] = {fCent, fDijet.trigJetPt, z, type};
1526  fHistManager.FillTHnSparse(histname, y);
1527 
1528  // (Centrality, pT, z (charged), calo type)
1529  histname = TString::Format("%s/DijetJetHistograms/hZVsPt", jets->GetArrayName().Data());
1530  AliVTrack* track;
1531  for (Int_t i=0; i<trigJet->GetNumberOfTracks(); i++) {
1532  track = static_cast<AliVTrack*>(trigJet->Track(i));
1533  z = track->Pt() / TMath::Abs(fDijet.trigJetPt);
1534  Double_t y2[4] = {fCent, fDijet.trigJetPt, z, type};
1535  fHistManager.FillTHnSparse(histname, y2);
1536  }
1537 
1538  // (Centrality, pT, Nconst, calo type)
1539  histname = TString::Format("%s/DijetJetHistograms/hNConstVsPt", jets->GetArrayName().Data());
1540  Double_t a[4] = {fCent, fDijet.trigJetPt, 1.*trigJet->GetNumberOfConstituents(), type};
1541  fHistManager.FillTHnSparse(histname, a);
1542 
1543 }
1544 
1549 {
1550  Double_t contents[30]={0};
1551  THnSparse* histJetObservables = static_cast<THnSparse*>(fHistManager.FindObject(histname));
1552  if (!histJetObservables) return;
1553  for (Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
1554  TString title(histJetObservables->GetAxis(n)->GetTitle());
1555  if (title=="A_{J}")
1556  contents[n] = fDijet.AJ;
1557  else if (title=="#Delta#phi")
1558  contents[n] = deltaPhi;
1559  else if (title=="#it{p}_{T,particle} (GeV/#it{c})")
1560  contents[n] = trackPt;
1561  else if (title=="#it{p}_{T}#parallel (GeV/#it{c})")
1562  contents[n] = balancePt;
1563  else
1564  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
1565  }
1566  histJetObservables->Fill(contents);
1567 }
1568 
1573 {
1574  // Matching efficiency histogram
1575  TString histname = "GeometricalMatchingEfficiency";
1576 
1577  // If we have a matching di-jet, fill the geometrical matching histogram
1578  if (fMatchingDijet.assJet) {
1579  fHistManager.FillTH1(histname.Data(), 1);
1580 
1583  Bool_t isSwitched = trigDeltaR > fMatchingJetR;
1584 
1585  TString thnname = "GeometricalMatching";
1586  Double_t contents[30]={0};
1587  THnSparse* histJetObservables = static_cast<THnSparse*>(fHistManager.FindObject(thnname.Data()));
1588  if (!histJetObservables) return;
1589  for (Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
1590  TString title(histJetObservables->GetAxis(n)->GetTitle());
1591  if (title=="Centrality (%)")
1592  contents[n] = fCent;
1593  else if (title=="isSwitched")
1594  contents[n] = isSwitched;
1595  else if (title=="#DeltaR_{trig}")
1596  contents[n] = trigDeltaR;
1597  else if (title=="#DeltaR_{ass}")
1598  contents[n] = assDeltaR;
1599  else if (title=="trig #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}")
1600  contents[n] = fMatchingDijet.trigJetPt - fDijet.trigJetPt;
1601  else if (title=="ass #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}")
1602  contents[n] = fMatchingDijet.assJetPt - fDijet.assJetPt;
1603  else if (title=="A_{J} low-threshold")
1604  contents[n] = fMatchingDijet.AJ;
1605  else if (title=="A_{J} hard-core")
1606  contents[n] = fDijet.AJ;
1607  else
1608  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
1609  }
1610  histJetObservables->Fill(contents);
1611  }
1612  else {
1613  fHistManager.FillTH1(histname.Data(), 0.);
1614  }
1615 }
1616 
1621  const char *nclusters,
1622  const Double_t deltaPhiMin,
1623  const Bool_t doGeomMatching,
1624  const Double_t minTrPtHardCore,
1625  const Double_t minClPtHardCore,
1626  const Double_t jetR,
1627  const Bool_t includePHOS,
1628  const Double_t minTrPt,
1629  const Double_t minClPt,
1630  const char *suffix)
1631 {
1632 
1633  // Get the pointer to the existing analysis manager via the static access method.
1634  //==============================================================================
1635  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
1636  if (!mgr)
1637  {
1638  ::Error("AddTaskEmcalDijetImbalance", "No analysis manager to connect to.");
1639  return 0;
1640  }
1641 
1642  // Check the analysis type using the event handlers connected to the analysis manager.
1643  //==============================================================================
1644  AliVEventHandler* handler = mgr->GetInputEventHandler();
1645  if (!handler)
1646  {
1647  ::Error("AddTaskEmcalDijetImbalance", "This task requires an input event handler");
1648  return 0;
1649  }
1650 
1651  enum EDataType_t {
1652  kUnknown,
1653  kESD,
1654  kAOD
1655  };
1656 
1657  EDataType_t dataType = kUnknown;
1658 
1659  if (handler->InheritsFrom("AliESDInputHandler")) {
1660  dataType = kESD;
1661  }
1662  else if (handler->InheritsFrom("AliAODInputHandler")) {
1663  dataType = kAOD;
1664  }
1665 
1666  //-------------------------------------------------------
1667  // Init the task and do settings
1668  //-------------------------------------------------------
1669 
1670  TString trackName(ntracks);
1671  TString clusName(nclusters);
1672 
1673  if (trackName == "usedefault") {
1674  if (dataType == kESD) {
1675  trackName = "Tracks";
1676  }
1677  else if (dataType == kAOD) {
1678  trackName = "tracks";
1679  }
1680  else {
1681  trackName = "";
1682  }
1683  }
1684 
1685  if (clusName == "usedefault") {
1686  if (dataType == kESD) {
1687  clusName = "CaloClusters";
1688  }
1689  else if (dataType == kAOD) {
1690  clusName = "caloClusters";
1691  }
1692  else {
1693  clusName = "";
1694  }
1695  }
1696 
1697  TString name("AliAnalysisTaskEmcalDijetImbalance");
1698  if (!trackName.IsNull()) {
1699  name += "_";
1700  name += trackName;
1701  }
1702  if (!clusName.IsNull()) {
1703  name += "_";
1704  name += clusName;
1705  }
1706  if (strcmp(suffix,"") != 0) {
1707  name += "_";
1708  name += suffix;
1709  }
1710 
1712  // Configure di-jet task
1714  dijetTask->SetDeltaPhiCut(deltaPhiMin);
1715  if (doGeomMatching) dijetTask->SetDoGeometricalMatching(doGeomMatching, jetR, minTrPtHardCore, minClPtHardCore);
1716 
1718  // Create track and cluster containers with the standard cuts
1719 
1720  AliParticleContainer* partCont = 0;
1721  if (trackName == "mcparticles") {
1722  AliMCParticleContainer* mcpartCont = new AliMCParticleContainer(trackName);
1723  partCont = mcpartCont;
1724  }
1725  else if (trackName == "tracks" || trackName == "Tracks") {
1726  AliTrackContainer* trackCont = new AliTrackContainer(trackName);
1727  partCont = trackCont;
1728  }
1729  if (partCont) partCont->SetParticlePtCut(minTrPt);
1730  if (partCont) dijetTask->AdoptParticleContainer(partCont);
1731 
1732  AliClusterContainer* clusCont = 0;
1733  if (!clusName.IsNull()) {
1734  clusCont = new AliClusterContainer(clusName);
1735  clusCont->SetClusECut(0.);
1736  clusCont->SetClusPtCut(0.);
1737  clusCont->SetClusNonLinCorrEnergyCut(0.);
1738  clusCont->SetClusHadCorrEnergyCut(minClPt);
1739  clusCont->SetDefaultClusterEnergy(AliVCluster::kHadCorr);
1740  if (includePHOS) {
1741  clusCont->SetIncludePHOS(kTRUE);
1742  clusCont->SetPhosMinNcells(3);
1743  clusCont->SetPhosMinM02(0.2);
1744  }
1745  }
1746  if (clusCont) dijetTask->AdoptClusterContainer(clusCont);
1747 
1749  // Create track and cluster containers for constituent study with geometrical matching (if enabled)
1750 
1751  if (doGeomMatching) {
1752  AliParticleContainer* partContThresh = 0;
1753  if (trackName == "mcparticles") {
1754  AliMCParticleContainer* mcpartCont = new AliMCParticleContainer(trackName);
1755  partContThresh = mcpartCont;
1756  }
1757  else if (trackName == "tracks" || trackName == "Tracks") {
1758  AliTrackContainer* trackCont = new AliTrackContainer(trackName);
1759  partContThresh = trackCont;
1760  }
1761  if (partContThresh) {
1762  partContThresh->SetParticlePtCut(minTrPtHardCore);
1763  partContThresh->SetName("tracksThresh");
1764  dijetTask->AdoptParticleContainer(partContThresh);
1765  }
1766 
1767  AliClusterContainer* clusContThresh = 0;
1768  if (!clusName.IsNull()) {
1769  clusContThresh = new AliClusterContainer(clusName);
1770  clusContThresh->SetName("caloClustersThresh");
1771  clusContThresh->SetClusECut(0.);
1772  clusContThresh->SetClusPtCut(0.);
1773  clusContThresh->SetClusNonLinCorrEnergyCut(0.);
1774  clusContThresh->SetClusHadCorrEnergyCut(minClPtHardCore);
1775  clusContThresh->SetDefaultClusterEnergy(AliVCluster::kHadCorr);
1776  if (includePHOS) {
1777  clusContThresh->SetIncludePHOS(kTRUE);
1778  clusContThresh->SetPhosMinNcells(3);
1779  clusContThresh->SetPhosMinM02(0.2);
1780  }
1781  }
1782  if (clusContThresh) dijetTask->AdoptClusterContainer(clusContThresh);
1783  }
1784 
1785  //-------------------------------------------------------
1786  // Final settings, pass to manager and set the containers
1787  //-------------------------------------------------------
1788 
1789  mgr->AddTask(dijetTask);
1790 
1791  // Create containers for input/output
1792  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
1793  TString contname(name);
1794  contname += "_histos";
1795  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
1796  TList::Class(),AliAnalysisManager::kOutputContainer,
1797  Form("%s", AliAnalysisManager::GetCommonFileName()));
1798  mgr->ConnectInput (dijetTask, 0, cinput1 );
1799  mgr->ConnectOutput (dijetTask, 1, coutput1 );
1800 
1801  return dijetTask;
1802 }
AliEmcalJet * GetLeadingJet(AliJetContainer *jetCont)
Double_t Area() const
Definition: AliEmcalJet.h:130
void SetParticlePtCut(Double_t cut)
Double_t GetRhoVal() const
Int_t fNPhiBins
Number of phi bins in DCal region (for background/correction)
Int_t fNPtHistBins
! number of variable pt bins
double Double_t
Definition: External.C:58
const char * title
Definition: MakeQAPdf.C:27
AliJetContainer * GetJetContainer(Int_t i=0) const
PHOS acceptance.
Definition: AliEmcalJet.h:75
Bool_t fUseManualEventCuts
Flag to use manual event cuts.
UInt_t fOffTrigger
offline trigger for event selection
void AdoptParticleContainer(AliParticleContainer *cont)
Bool_t fUseAliEventCuts
Flag to use AliEventCuts (otherwise AliAnalysisTaskEmcal will be used)
Double_t Eta() const
Definition: AliEmcalJet.h:121
const AliClusterIterableMomentumContainer accepted_momentum() const
Int_t fNEtaBins
Number of eta bins in DCal region (for background/correction)
Double_t Phi() const
Definition: AliEmcalJet.h:117
Container with name, TClonesArray and cuts for particles.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
Declaration of class AliTLorentzVector.
Double_t phiMin
static AliEmcalDownscaleFactorsOCDB * Instance()
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.
Declaration of class AliAnalysisTaskEmcalEmbeddingHelper.
TH2D * fGapJetScalingWeights
Histogram storing eta-phi weights scaling jets near the gap region.
AliVParticle * Track(Int_t idx) const
Double_t fDijetLeadingHadronPt
leading hadron pT threshold for leading jet in dijet
Double_t GetDownscaleFactorForTriggerClass(const TString &trigger) const
void SetPhosMinM02(Double_t m)
void SetDoGeometricalMatching(Bool_t b, Double_t r, Double_t trackThresh, Double_t clusThresh)
Bool_t fkEMCEJE
! flag telling whether the event is "triggered" or not in "simulation"
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
TString part
use mixed event to constrain combinatorial background
Definition: InvMassFit.C:52
UShort_t GetNumberOfConstituents() const
Definition: AliEmcalJet.h:140
Container for particles within the EMCAL framework.
void SetCaloTriggerPatchInfoName(const char *n)
UShort_t GetNumberOfTracks() const
Definition: AliEmcalJet.h:139
Bool_t fDoMomentumBalance
Set whether to enable momentum balance study.
void AdoptClusterContainer(AliClusterContainer *cont)
void FindDijet(AliJetContainer *jetCont, Int_t leadingHadronCutBin)
Bool_t fPlotDijetImbalanceHistograms
Set whether to enable dijet imbalance histograms.
bool AddQAPlotsToList(TList *list)
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="")
bool IsInitialized() const
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Create a new TH2 within the container.
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
Double_t fClusterConstituentThreshold
constituent threshold for matching study
void SetClusNonLinCorrEnergyCut(Double_t cut)
Di-jet imbalance analysis with full jets.
AliEMCALGeometry * fGeom
!emcal geometry
UInt_t GetJetAcceptanceType() const
Definition: AliEmcalJet.h:367
Double_t Phi_0_2pi() const
EMCal acceptance.
Definition: AliEmcalJet.h:69
Implementation of task to embed external events.
Double_t phiMax
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
Definition: External.C:228
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
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:129
Double_t fCent
!event centrality
void LoadBackgroundScalingHistogram(const char *path="alien:///alice/cern.ch/user/j/jmulliga/scaleFactorEMCalLHC15o.root", const char *name1="hEtaPhiSFCorrection", const char *name2="hEtaPhiJetPtCorrection")
void SetIncludePHOS(Bool_t b)
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
AliRhoParameter * GetRhoParameter()
Bool_t fComputeMBDownscaling
Set whether to compute and plot MB downscaling factors.
Double_t Pt() const
Definition: AliEmcalJet.h:109
virtual Bool_t IsEventSelected()
Performing event selection.
static Double_t * GenerateFixedBinArray(Int_t n, Double_t min, Double_t max)
AliEmcalList * fOutput
!output list
Handler for downscale factors for various triggers obtained from the OCDB.
Bool_t fLoadBackgroundScalingWeights
Flag to load eta-phi weights for full-jet background scale factors.
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:51
const AliTrackIterableMomentumContainer accepted_momentum() const
Int_t GetRunNumber(TString)
Definition: PlotMuonQA.C:2235
void SetClusPtCut(Double_t cut)
Dijet_t fMatchingDijet
! low-threshold matching dijet, for matching study
TH2D * fBackgroundScalingWeights
Histogram storing eta-phi weights for full-jet background scale factors.
void UserCreateOutputObjects()
Main initialization function on the worker.
AliEmcalEmbeddingQA fEmbeddingQA
! QA hists for embedding (will only be added if embedding)
const Int_t nbins
const AliJetIterableContainer accepted() const
bool Bool_t
Definition: External.C:53
Double_t fTrackConstituentThreshold
constituent threshold for matching study
EDataType_t
Switch for the data type.
static AliAnalysisTaskEmcalDijetImbalance * AddTaskEmcalDijetImbalance(const char *ntracks="usedefault", const char *nclusters="usedefault", const Double_t deltaPhiMin=2 *TMath::Pi()/3, const Bool_t doGeomMatching=kFALSE, const Double_t minTrPtHardCore=3.0, const Double_t minClPtHardCore=3.0, const Double_t jetR=0.2, const Bool_t includePHOS=kTRUE, const Double_t minTrPt=0.15, const Double_t minClPt=0.30, const char *suffix="")
DCal acceptance – spans ONLY DCal (no PHOS or gap)
Definition: AliEmcalJet.h:73
Double_t NEF() const
Definition: AliEmcalJet.h:148
void SetClusECut(Double_t cut)
void SetDefaultClusterEnergy(Int_t d)
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.
Container for MC-true particles within the EMCAL framework.
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
void SetPhosMinNcells(Int_t n)
Container for jet within the EMCAL jet framework.
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 SetClusHadCorrEnergyCut(Double_t cut)
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()