AliPhysics  32b88a8 (32b88a8)
 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 <TClonesArray.h>
17 #include <TH1F.h>
18 #include <TH2F.h>
19 #include <TList.h>
20 
21 #include <AliVCluster.h>
22 #include <AliVParticle.h>
23 #include <AliLog.h>
24 
25 #include "AliTLorentzVector.h"
26 #include "AliEmcalJet.h"
27 #include "AliRhoParameter.h"
28 #include "AliJetContainer.h"
29 #include "AliParticleContainer.h"
30 #include "AliClusterContainer.h"
31 
33 
37 
43  fHistManager()
44 {
45 }
46 
53  AliAnalysisTaskEmcalJet(name, kTRUE),
54  fHistManager(name)
55 {
57 }
58 
63 {
64 }
65 
71 {
73 
80 
81  TIter next(fHistManager.GetListOfHistograms());
82  TObject* obj = 0;
83  while ((obj = next())) {
84  fOutput->Add(obj);
85  }
86 
87  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
88 }
89 
90 /*
91  * This function allocates the histograms for basic EMCal cluster QA.
92  * A set of histograms (energy, eta, phi, number of cluster) is allocated
93  * per each cluster container and per each centrality bin.
94  */
96 {
97  TString histname;
98  TString histtitle;
99  TString groupname;
100  AliClusterContainer* clusCont = 0;
101  TIter next(&fClusterCollArray);
102  while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
103  groupname = clusCont->GetName();
104  fHistManager.CreateHistoGroup(groupname);
105  for (Int_t cent = 0; cent < fNcentBins; cent++) {
106 
107  // Cluster histograms (PHOS+EMCal)
108 
109  histname = TString::Format("%s/histClusterEnergy_%d", groupname.Data(), cent);
110  histtitle = TString::Format("%s;#it{E}_{cluster} (GeV);counts", histname.Data());
111  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2);
112 
113  histname = TString::Format("%s/histClusterEtaPhi_%d", groupname.Data(), cent);
114  histtitle = TString::Format("%s;#it{#eta}_{cluster};#it{#phi}_{cluster};counts", histname.Data());
115  fHistManager.CreateTH2(histname, histtitle, fNbins / 6, -1, 1, fNbins / 2, 0, TMath::TwoPi());
116 
117  histname = TString::Format("%s/histNClusters_%d", groupname.Data(), cent);
118  histtitle = TString::Format("%s;number of clusters;events", histname.Data());
119  if (fForceBeamType != kpp) {
120  fHistManager.CreateTH1(histname, histtitle, 500, 0, 3000);
121  }
122  else {
123  fHistManager.CreateTH1(histname, histtitle, 200, 0, 200);
124  }
125 
126  // EMCal cluster histograms
127 
128  histname = TString::Format("%s/histEMCalClusterEnergy_%d", groupname.Data(), cent);
129  histtitle = TString::Format("%s;#it{E}_{cluster} (GeV);counts", histname.Data());
130  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2);
131 
132  histname = TString::Format("%s/histEMCalClusterEnergyExotic_%d", groupname.Data(), cent);
133  histtitle = TString::Format("%s;#it{E}_{cluster}^{exotic} (GeV);counts", histname.Data());
134  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2);
135 
136  histname = TString::Format("%s/histEMCalClusterNonLinCorrEnergy_%d", groupname.Data(), cent);
137  histtitle = TString::Format("%s;#it{E}_{cluster}^{non-lin.corr.} (GeV);counts", histname.Data());
138  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2);
139 
140  histname = TString::Format("%s/histEMCalClusterHadCorrEnergy_%d", groupname.Data(), cent);
141  histtitle = TString::Format("%s;#it{E}_{cluster}^{had.corr.} (GeV);counts", histname.Data());
142  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2);
143 
144  histname = TString::Format("%s/histEMCalClusterPhi_%d", groupname.Data(), cent);
145  histtitle = TString::Format("%s;#it{#phi}_{cluster};counts", histname.Data());
146  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, 0, TMath::TwoPi());
147 
148  histname = TString::Format("%s/histEMCalClusterEta_%d", groupname.Data(), cent);
149  histtitle = TString::Format("%s;#it{#eta}_{cluster};counts", histname.Data());
150  fHistManager.CreateTH1(histname, histtitle, fNbins / 6, -1, 1);
151 
152  histname = TString::Format("%s/histEMCalNClusters_%d", groupname.Data(), cent);
153  histtitle = TString::Format("%s;number of clusters;events", histname.Data());
154  if (fForceBeamType != kpp) {
155  fHistManager.CreateTH1(histname, histtitle, 500, 0, 3000);
156  }
157  else {
158  fHistManager.CreateTH1(histname, histtitle, 200, 0, 200);
159  }
160 
161  // PHOS cluster histograms
162 
163  histname = TString::Format("%s/histPHOSClusterEnergy_%d", groupname.Data(), cent);
164  histtitle = TString::Format("%s;#it{E}_{cluster} (GeV);counts", histname.Data());
165  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2);
166 
167  histname = TString::Format("%s/histPHOSClusterPhi_%d", groupname.Data(), cent);
168  histtitle = TString::Format("%s;#it{#phi}_{cluster};counts", histname.Data());
169  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, 0, TMath::TwoPi());
170 
171  histname = TString::Format("%s/histPHOSClusterEta_%d", groupname.Data(), cent);
172  histtitle = TString::Format("%s;#it{#eta}_{cluster};counts", histname.Data());
173  fHistManager.CreateTH1(histname, histtitle, fNbins / 6, -1, 1);
174 
175  histname = TString::Format("%s/histPHOSNClusters_%d", groupname.Data(), cent);
176  histtitle = TString::Format("%s;number of clusters;events", histname.Data());
177  if (fForceBeamType != kpp) {
178  fHistManager.CreateTH1(histname, histtitle, 500, 0, 3000);
179  }
180  else {
181  fHistManager.CreateTH1(histname, histtitle, 200, 0, 200);
182  }
183 
184  }
185  }
186 }
187 
188 /*
189  * This function allocates the histograms for basic EMCal QA.
190  * One 2D histogram with the cell energy spectra and the number of cells
191  * per event is allocated per each centrality bin.
192  */
194 {
195  TString histname;
196  TString histtitle;
197  TString groupname(fCaloCellsName);
198 
199  fHistManager.CreateHistoGroup(groupname);
200  for (Int_t cent = 0; cent < fNcentBins; cent++) {
201  histname = TString::Format("%s/histCellEnergyvsAbsId_%d", groupname.Data(), cent);
202  histtitle = TString::Format("%s;cell abs. ID;#it{E}_{cell} (GeV);counts", histname.Data());
203  fHistManager.CreateTH2(histname, histtitle, 20000, 0, 20000, fNbins / 2, fMinBinPt, fMaxBinPt / 2);
204 
205  histname = TString::Format("%s/histNCells_%d", groupname.Data(), cent);
206  histtitle = TString::Format("%s;number of cells;events", histname.Data());
207  if (fForceBeamType != kpp) {
208  fHistManager.CreateTH1(histname, histtitle, 500, 0, 6000);
209  }
210  else {
211  fHistManager.CreateTH1(histname, histtitle, 200, 0, 200);
212  }
213  }
214 }
215 
216 /*
217  * This function allocates the histograms for basic tracking QA.
218  * A set of histograms (pT, eta, phi, difference between kinematic properties
219  * at the vertex and at the EMCal surface, number of tracks) is allocated
220  * per each particle container and per each centrality bin.
221  */
223 {
224  TString histname;
225  TString histtitle;
226  TString groupname;
227  AliParticleContainer* partCont = 0;
228  TIter next(&fParticleCollArray);
229  while ((partCont = static_cast<AliParticleContainer*>(next()))) {
230  groupname = partCont->GetName();
231  fHistManager.CreateHistoGroup(groupname);
232  for (Int_t cent = 0; cent < fNcentBins; cent++) {
233  histname = TString::Format("%s/histTrackPt_%d", groupname.Data(), cent);
234  histtitle = TString::Format("%s;#it{p}_{T,track} (GeV/#it{c});counts", histname.Data());
235  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt / 2);
236 
237  histname = TString::Format("%s/histTrackPhi_%d", groupname.Data(), cent);
238  histtitle = TString::Format("%s;#it{#phi}_{track};counts", histname.Data());
239  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, 0, TMath::TwoPi());
240 
241  histname = TString::Format("%s/histTrackEta_%d", groupname.Data(), cent);
242  histtitle = TString::Format("%s;#it{#eta}_{track};counts", histname.Data());
243  fHistManager.CreateTH1(histname, histtitle, fNbins / 6, -1, 1);
244 
245  if (TClass(partCont->GetClassName()).InheritsFrom("AliVTrack")) {
246  histname = TString::Format("%s/fHistDeltaEtaPt_%d", groupname.Data(), cent);
247  histtitle = TString::Format("%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{#eta}_{track}^{vertex} - #it{#eta}_{track}^{EMCal};counts", histname.Data());
248  fHistManager.CreateTH2(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt, 50, -0.5, 0.5);
249 
250  histname = TString::Format("%s/fHistDeltaPhiPt_%d", groupname.Data(), cent);
251  histtitle = TString::Format("%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{#phi}_{track}^{vertex} - #it{#phi}_{track}^{EMCal};counts", histname.Data());
252  fHistManager.CreateTH2(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt, 200, -2, 2);
253 
254  histname = TString::Format("%s/fHistDeltaPtvsPt_%d", groupname.Data(), cent);
255  histtitle = TString::Format("%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{p}_{T,track}^{vertex} - #it{p}_{T,track}^{EMCal} (GeV/#it{c});counts", histname.Data());
256  fHistManager.CreateTH2(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt, fNbins / 2, -fMaxBinPt/2, fMaxBinPt/2);
257 
258  histname = TString::Format("%s/fHistEoverPvsP_%d", groupname.Data(), cent);
259  histtitle = TString::Format("%s;#it{P}_{track} (GeV/#it{c});#it{E}_{cluster} / #it{P}_{track} #it{c};counts", histname.Data());
260  fHistManager.CreateTH2(histname, histtitle, fNbins / 2, fMinBinPt, fMaxBinPt, fNbins / 2, 0, 4);
261  }
262 
263  histname = TString::Format("%s/histNTracks_%d", groupname.Data(), cent);
264  histtitle = TString::Format("%s;number of tracks;events", histname.Data());
265  if (fForceBeamType != kpp) {
266  fHistManager.CreateTH1(histname, histtitle, 500, 0, 5000);
267  }
268  else {
269  fHistManager.CreateTH1(histname, histtitle, 200, 0, 200);
270  }
271  }
272  }
273 }
274 
275 /*
276  * This function allocates the histograms for basic jet QA.
277  * A set of histograms (pT, eta, phi, area, number of jets, corrected pT) is allocated
278  * per each jet container and per each centrality bin.
279  */
281 {
282  TString histname;
283  TString histtitle;
284  TString groupname;
285  AliJetContainer* jetCont = 0;
286  TIter next(&fJetCollArray);
287  while ((jetCont = static_cast<AliJetContainer*>(next()))) {
288  groupname = jetCont->GetName();
289  fHistManager.CreateHistoGroup(groupname);
290  for (Int_t cent = 0; cent < fNcentBins; cent++) {
291  histname = TString::Format("%s/histJetPt_%d", groupname.Data(), cent);
292  histtitle = TString::Format("%s;#it{p}_{T,jet} (GeV/#it{c});counts", histname.Data());
293  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt);
294 
295  histname = TString::Format("%s/histJetArea_%d", groupname.Data(), cent);
296  histtitle = TString::Format("%s;#it{A}_{jet};counts", histname.Data());
297  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, 0, 3);
298 
299  histname = TString::Format("%s/histJetPhi_%d", groupname.Data(), cent);
300  histtitle = TString::Format("%s;#it{#phi}_{jet};counts", histname.Data());
301  fHistManager.CreateTH1(histname, histtitle, fNbins / 2, 0, TMath::TwoPi());
302 
303  histname = TString::Format("%s/histJetEta_%d", groupname.Data(), cent);
304  histtitle = TString::Format("%s;#it{#eta}_{jet};counts", histname.Data());
305  fHistManager.CreateTH1(histname, histtitle, fNbins / 6, -1, 1);
306 
307  histname = TString::Format("%s/histJetEtaPhi_%d", groupname.Data(), cent);
308  histtitle = TString::Format("%s;#it{#eta}_{jet};#it{#phi}_{jet};counts", histname.Data());
309  fHistManager.CreateTH2(histname, histtitle, fNbins / 6, -1, 1, fNbins / 2, 0, TMath::TwoPi());
310 
311  histname = TString::Format("%s/histNJets_%d", groupname.Data(), cent);
312  histtitle = TString::Format("%s;number of jets;events", histname.Data());
313  if (fForceBeamType != kpp) {
314  fHistManager.CreateTH1(histname, histtitle, 500, 0, 500);
315  }
316  else {
317  fHistManager.CreateTH1(histname, histtitle, 100, 0, 100);
318  }
319 
320  if (!jetCont->GetRhoName().IsNull()) {
321  histname = TString::Format("%s/histJetCorrPt_%d", groupname.Data(), cent);
322  histtitle = TString::Format("%s;#it{p}_{T,jet}^{corr} (GeV/#it{c});counts", histname.Data());
323  fHistManager.CreateTH1(histname, histtitle, fNbins, -fMaxBinPt / 2, fMaxBinPt / 2);
324  }
325  }
326  }
327 }
328 
329 /*
330  * This function allocates the histograms for the dijet analysis.
331  * A set of histograms is allocated per each jet container and per each centrality bin.
332  */
334 {
335  TString histname;
336  TString histtitle;
337  TString groupname;
338  AliJetContainer* jetCont = 0;
339  TIter next(&fJetCollArray);
340  while ((jetCont = static_cast<AliJetContainer*>(next()))) {
341  groupname = jetCont->GetName();
342  //fHistManager.CreateHistoGroup(groupname);
343  for (Int_t cent = 0; cent < fNcentBins; cent++) {
344 
345  // Some basic plots for di-jet pairs
346 
347  histname = TString::Format("%s/histDijetLeadingJetPt_%d", groupname.Data(), cent);
348  histtitle = TString::Format("%s;Leading Jet p_{T} (GeV);counts", histname.Data());
349  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt);
350 
351  histname = TString::Format("%s/histDijetSubleadingJetPt_%d", groupname.Data(), cent);
352  histtitle = TString::Format("%s;Subleading Jet p_{T} (GeV);counts", histname.Data());
353  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt);
354 
355  histname = TString::Format("%s/histDijetLeadingJetPhi_%d", groupname.Data(), cent);
356  histtitle = TString::Format("%s;Leading Jet #phi;counts", histname.Data());
357  fHistManager.CreateTH1(histname, histtitle, 100, 0, TMath::TwoPi());
358 
359  histname = TString::Format("%s/histDijetSubleadingJetPhi_%d", groupname.Data(), cent);
360  histtitle = TString::Format("%s;Subleading Jet #phi;counts", histname.Data());
361  fHistManager.CreateTH1(histname, histtitle, 100, 0, TMath::TwoPi());
362 
363  histname = TString::Format("%s/histDijetLeadingJetEta_%d", groupname.Data(), cent);
364  histtitle = TString::Format("%s;Leading Jet #eta;counts", histname.Data());
365  fHistManager.CreateTH1(histname, histtitle, 100, -1, 1);
366 
367  histname = TString::Format("%s/histDijetSubleadingJetEta_%d", groupname.Data(), cent);
368  histtitle = TString::Format("%s;Subleading Jet #eta;counts", histname.Data());
369  fHistManager.CreateTH1(histname, histtitle, 100, -1, 1);
370 
371  histname = TString::Format("%s/histDijetDeltaEta_%d", groupname.Data(), cent);
372  histtitle = TString::Format("%s;#Delta#eta;counts", histname.Data());
373  fHistManager.CreateTH1(histname, histtitle, 100, -2, 2);
374 
375  // Some di-jet observables
376 
377  histname = TString::Format("%s/histDijetAJ_%d", groupname.Data(), cent);
378  histtitle = TString::Format("%s;A_{J};counts", histname.Data());
379  fHistManager.CreateTH1(histname, histtitle, 100, 0, 1);
380 
381  histname = TString::Format("%s/histDijetxJ_%d", groupname.Data(), cent);
382  histtitle = TString::Format("%s;x_{J};counts", histname.Data());
383  fHistManager.CreateTH1(histname, histtitle, 100, 0, 1);
384 
385  histname = TString::Format("%s/histDijetDeltaPhi_%d", groupname.Data(), cent);
386  histtitle = TString::Format("%s;#Delta#phi;counts", histname.Data());
387  fHistManager.CreateTH1(histname, histtitle, 100, 0, 4);
388 
389  histname = TString::Format("%s/histDijetkT_%d", groupname.Data(), cent);
390  histtitle = TString::Format("%s;k_{Ty} (GeV);counts", histname.Data());
391  fHistManager.CreateTH1(histname, histtitle, 100, 0, 100);
392 
393  histname = TString::Format("%s/histDijetLeadingJetNTracks_%d", groupname.Data(), cent);
394  histtitle = TString::Format("%s;Leading Jet N tracks;counts", histname.Data());
395  fHistManager.CreateTH1(histname, histtitle, 100, 0, 100);
396 
397  histname = TString::Format("%s/histDijetSubleadingJetNTracks_%d", groupname.Data(), cent);
398  histtitle = TString::Format("%s;Subleading Jet N tracks;counts", histname.Data());
399  fHistManager.CreateTH1(histname, histtitle, 100, 0, 100);
400 
401  histname = TString::Format("%s/histDijetLeadingJetArea_%d", groupname.Data(), cent);
402  histtitle = TString::Format("%s;Leading Jet Area;counts", histname.Data());
403  fHistManager.CreateTH1(histname, histtitle, 100, 0, 3);
404 
405  histname = TString::Format("%s/histDijetSubleadingJetArea_%d", groupname.Data(), cent);
406  histtitle = TString::Format("%s;Subleading Jet Area;counts", histname.Data());
407  fHistManager.CreateTH1(histname, histtitle, 100, 0, 3);
408 
409  // Leading jets that don't have acceptable associated jet
410  histname = TString::Format("%s/histUnmatchedLeadingJetPt_%d", groupname.Data(), cent);
411  histtitle = TString::Format("%s;Leading Jet p_{T} (GeV);counts", histname.Data());
412  fHistManager.CreateTH1(histname, histtitle, fNbins, fMinBinPt, fMaxBinPt);
413 
414  }
415  }
416 }
417 
418 /*
419  * This function allocates the histograms that are filled at the end of the analysis.
420  * A set of histograms is allocated per each centrality bin.
421  */
423 {
424 
425  // Plot jet ratio R=0.2/R=0.4
426  TString groupnameRatio = "JetRatioPlots";
427  fHistManager.CreateHistoGroup(groupnameRatio);
428  TString histnameChRatio;
429  TString histnameFuRatio;
430  TString histtitleChRatio;
431  TString histtitleFuRatio;
432 
433  for (Int_t cent = 0; cent < fNcentBins; cent++) {
434 
435  // Create a ratio plot for each charged, full
436  histnameChRatio = TString::Format("%s/histChargedJetRatio0204_%d", groupnameRatio.Data(), cent);
437  histtitleChRatio = TString::Format("%s;#it{p}_{T,jet} (GeV/#it{c});Ratio", histnameChRatio.Data());
438  fHistManager.CreateTH1(histnameChRatio, histtitleChRatio, fNbins, fMinBinPt, fMaxBinPt);
439 
440  histnameFuRatio = TString::Format("%s/histFullJetRatio0204_%d", groupnameRatio.Data(), cent);
441  histtitleFuRatio = TString::Format("%s;#it{p}_{T,jet} (GeV/#it{c});Ratio", histnameFuRatio.Data());
442  fHistManager.CreateTH1(histnameFuRatio, histtitleFuRatio, fNbins, fMinBinPt, fMaxBinPt);
443 
444  }
445 
446 }
447 
455 {
456  DoJetLoop();
457  DoTrackLoop();
458  DoClusterLoop();
459  DoCellLoop();
460 
461  return kTRUE;
462 }
463 
469 {
470  TString histname;
471  TString groupname;
472  AliJetContainer* jetCont = 0;
473  TIter next(&fJetCollArray);
474  while ((jetCont = static_cast<AliJetContainer*>(next()))) {
475  groupname = jetCont->GetName();
476  UInt_t count = 0;
477  for(auto jet : jetCont->accepted()) {
478  if (!jet) continue;
479  count++;
480 
481  histname = TString::Format("%s/histJetPt_%d", groupname.Data(), fCentBin);
482  fHistManager.FillTH1(histname, jet->Pt());
483 
484  histname = TString::Format("%s/histJetArea_%d", groupname.Data(), fCentBin);
485  fHistManager.FillTH1(histname, jet->Area());
486 
487  histname = TString::Format("%s/histJetPhi_%d", groupname.Data(), fCentBin);
488  fHistManager.FillTH1(histname, jet->Phi());
489 
490  histname = TString::Format("%s/histJetEta_%d", groupname.Data(), fCentBin);
491  fHistManager.FillTH1(histname, jet->Eta());
492 
493  histname = TString::Format("%s/histJetEtaPhi_%d", groupname.Data(), fCentBin);
494  fHistManager.FillTH1(histname, jet->Eta(), jet->Phi());
495 
496  if (jetCont->GetRhoParameter()) {
497  histname = TString::Format("%s/histJetCorrPt_%d", groupname.Data(), fCentBin);
498  fHistManager.FillTH1(histname, jet->Pt() - jetCont->GetRhoVal() * jet->Area());
499  }
500  }
501  histname = TString::Format("%s/histNJets_%d", groupname.Data(), fCentBin);
502  fHistManager.FillTH1(histname, count);
503  }
504 }
505 
511 {
513 
514  TString histname;
515  TString groupname;
516  AliParticleContainer* partCont = 0;
517  TIter next(&fParticleCollArray);
518  while ((partCont = static_cast<AliParticleContainer*>(next()))) {
519  groupname = partCont->GetName();
520  UInt_t count = 0;
521  for(auto part : partCont->accepted()) {
522  if (!part) continue;
523  count++;
524 
525  histname = TString::Format("%s/histTrackPt_%d", groupname.Data(), fCentBin);
526  fHistManager.FillTH1(histname, part->Pt());
527 
528  histname = TString::Format("%s/histTrackPhi_%d", groupname.Data(), fCentBin);
529  fHistManager.FillTH1(histname, part->Phi());
530 
531  histname = TString::Format("%s/histTrackEta_%d", groupname.Data(), fCentBin);
532  fHistManager.FillTH1(histname, part->Eta());
533 
534  if (partCont->GetLoadedClass()->InheritsFrom("AliVTrack")) {
535  const AliVTrack* track = static_cast<const AliVTrack*>(part);
536 
537  histname = TString::Format("%s/fHistDeltaEtaPt_%d", groupname.Data(), fCentBin);
538  fHistManager.FillTH1(histname, track->Pt(), track->Eta() - track->GetTrackEtaOnEMCal());
539 
540  histname = TString::Format("%s/fHistDeltaPhiPt_%d", groupname.Data(), fCentBin);
541  fHistManager.FillTH1(histname, track->Pt(), track->Phi() - track->GetTrackPhiOnEMCal());
542 
543  histname = TString::Format("%s/fHistDeltaPtvsPt_%d", groupname.Data(), fCentBin);
544  fHistManager.FillTH1(histname, track->Pt(), track->Pt() - track->GetTrackPtOnEMCal());
545 
546  if (clusCont) {
547  Int_t iCluster = track->GetEMCALcluster();
548  if (iCluster >= 0) {
549  AliVCluster* cluster = clusCont->GetAcceptCluster(iCluster);
550  if (cluster) {
551  histname = TString::Format("%s/fHistEoverPvsP_%d", groupname.Data(), fCentBin);
552  fHistManager.FillTH2(histname, track->P(), cluster->GetNonLinCorrEnergy() / track->P());
553  }
554  }
555  }
556  }
557  }
558 
559  histname = TString::Format("%s/histNTracks_%d", groupname.Data(), fCentBin);
560  fHistManager.FillTH1(histname, count);
561  }
562 }
563 
569 {
570  TString histname;
571  TString groupname;
572  AliClusterContainer* clusCont = 0;
573  TIter next(&fClusterCollArray);
574  while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
575  groupname = clusCont->GetName();
576 
577  for(auto cluster : clusCont->all()) {
578  if (!cluster) continue;
579 
580  if (cluster->GetIsExotic()) {
581  histname = TString::Format("%s/histEMCalClusterEnergyExotic_%d", groupname.Data(), fCentBin);
582  fHistManager.FillTH1(histname, cluster->E());
583  }
584  }
585 
586  UInt_t count = 0;
587  UInt_t countEMCal = 0;
588  UInt_t countPHOS = 0;
589  for(auto cluster : clusCont->accepted()) {
590  if (!cluster) continue;
591  count++;
592 
593  AliTLorentzVector nPart;
594  cluster->GetMomentum(nPart, fVertex);
595 
596  histname = TString::Format("%s/histClusterEnergy_%d", groupname.Data(), fCentBin);
597  fHistManager.FillTH1(histname, cluster->E());
598 
599  histname = TString::Format("%s/histClusterEtaPhi_%d", groupname.Data(),fCentBin);
600  fHistManager.FillTH2(histname, nPart.Eta(), nPart.Phi_0_2pi());
601 
602  if (cluster->IsEMCAL()) {
603 
604  countEMCal++;
605 
606  histname = TString::Format("%s/histEMCalClusterEnergy_%d", groupname.Data(), fCentBin);
607  fHistManager.FillTH1(histname, cluster->E());
608 
609  histname = TString::Format("%s/histEMCalClusterNonLinCorrEnergy_%d", groupname.Data(), fCentBin);
610  fHistManager.FillTH1(histname, cluster->GetNonLinCorrEnergy());
611 
612  histname = TString::Format("%s/histEMCalClusterHadCorrEnergy_%d", groupname.Data(), fCentBin);
613  fHistManager.FillTH1(histname, cluster->GetHadCorrEnergy());
614 
615  histname = TString::Format("%s/histEMCalClusterPhi_%d", groupname.Data(), fCentBin);
616  fHistManager.FillTH1(histname, nPart.Phi_0_2pi());
617 
618  histname = TString::Format("%s/histEMCalClusterEta_%d", groupname.Data(), fCentBin);
619  fHistManager.FillTH1(histname, nPart.Eta());
620 
621  } else if (cluster->IsPHOS()){
622 
623  countPHOS++;
624 
625  histname = TString::Format("%s/histPHOSClusterEnergy_%d", groupname.Data(), fCentBin);
626  fHistManager.FillTH1(histname, cluster->E());
627 
628  histname = TString::Format("%s/histPHOSClusterPhi_%d", groupname.Data(), fCentBin);
629  fHistManager.FillTH1(histname, nPart.Phi_0_2pi());
630 
631  histname = TString::Format("%s/histPHOSClusterEta_%d", groupname.Data(), fCentBin);
632  fHistManager.FillTH1(histname, nPart.Eta());
633 
634  }
635  }
636 
637  histname = TString::Format("%s/histNClusters_%d", groupname.Data(), fCentBin);
638  fHistManager.FillTH1(histname, count);
639 
640  histname = TString::Format("%s/histEMCalNClusters_%d", groupname.Data(), fCentBin);
641  fHistManager.FillTH1(histname, countEMCal);
642 
643  histname = TString::Format("%s/histPHOSNClusters_%d", groupname.Data(), fCentBin);
644  fHistManager.FillTH1(histname, countPHOS);
645 
646  }
647 }
648 
654 {
655  if (!fCaloCells) return;
656 
657  TString histname;
658 
659  const Short_t ncells = fCaloCells->GetNumberOfCells();
660 
661  histname = TString::Format("%s/histNCells_%d", fCaloCellsName.Data(), fCentBin);
662  fHistManager.FillTH1(histname, ncells);
663 
664  histname = TString::Format("%s/histCellEnergyvsAbsId_%d", fCaloCellsName.Data(), fCentBin);
665  for (Short_t pos = 0; pos < ncells; pos++) {
666  Double_t amp = fCaloCells->GetAmplitude(pos);
667  Short_t absId = fCaloCells->GetCellNumber(pos);
668 
669  fHistManager.FillTH2(histname, absId, amp);
670  }
671 }
672 
678 {
680 }
681 
690 {
691  TString histname;
692  TString groupname;
693 
694  AliJetContainer* jetCont = 0;
695  TIter next(&fJetCollArray);
696  while ((jetCont = static_cast<AliJetContainer*>(next()))) {
697  groupname = jetCont->GetName();
698 
699  // Get trigger jet
700  AliEmcalJet *trigJet = jetCont->GetLeadingJet();
701  if(!trigJet) continue;
702  if(trigJet->Pt() < fTrigJetMinPt) continue;
703 
704  // Look for associated jet
705  AliEmcalJet *assJet = 0;
706  for(auto assJetCand : jetCont->accepted()) {
707  if (!assJetCand) continue;
708  if ( assJetCand->Pt() < fAssJetMinPt ) continue;
709  if ( TMath::Abs(trigJet->Phi() - assJetCand->Phi()) < fDeltaPhiMin ) continue;
710  if (assJet) { if ( assJetCand->Pt() < assJet->Pt() ) continue; }
711 
712  assJet = assJetCand;
713  }
714 
715  // If we find an acceptable associated jet, fill the di-jet histograms
716  if(assJet){
717 
718  // Define kinematic variables for the di-jet pair
719  Double_t trigJetPt = trigJet->Pt();
720  Double_t trigJetPhi = trigJet->Phi();
721  Double_t trigJetEta = trigJet->Eta();
722  Double_t assJetPt = assJet->Pt();
723  Double_t assJetPhi = assJet->Phi();
724  Double_t assJetEta = assJet->Eta();
725 
726  // Some basic plots for the found di-jet pairs
727 
728  histname = TString::Format("%s/histDijetLeadingJetPt_%d", groupname.Data(), fCentBin);
729  fHistManager.FillTH1(histname, trigJetPt);
730 
731  histname = TString::Format("%s/histDijetLeadingJetPhi_%d", groupname.Data(), fCentBin);
732  fHistManager.FillTH1(histname, trigJetPhi);
733 
734  histname = TString::Format("%s/histDijetLeadingJetEta_%d", groupname.Data(), fCentBin);
735  fHistManager.FillTH1(histname, trigJetEta);
736 
737  histname = TString::Format("%s/histDijetSubleadingJetPt_%d", groupname.Data(), fCentBin);
738  fHistManager.FillTH1(histname, assJetPt);
739 
740  histname = TString::Format("%s/histDijetSubleadingJetPhi_%d", groupname.Data(), fCentBin);
741  fHistManager.FillTH1(histname, assJetPhi);
742 
743  histname = TString::Format("%s/histDijetSubleadingJetEta_%d", groupname.Data(), fCentBin);
744  fHistManager.FillTH1(histname, assJetEta);
745 
746  Double_t deltaEta = trigJetEta - assJetEta;
747  histname = TString::Format("%s/histDijetDeltaEta_%d", groupname.Data(), fCentBin);
748  fHistManager.FillTH1(histname, deltaEta);
749 
750  // Some di-jet observables
751 
752  Double_t AJ = (trigJetPt - assJetPt)/(trigJetPt + assJetPt);
753  histname = TString::Format("%s/histDijetAJ_%d", groupname.Data(), fCentBin);
754  fHistManager.FillTH1(histname, AJ);
755 
756  Double_t xJ = assJetPt / trigJetPt;
757  histname = TString::Format("%s/histDijetxJ_%d", groupname.Data(), fCentBin);
758  fHistManager.FillTH1(histname, xJ);
759 
760  Double_t deltaPhi = TMath::Abs(trigJetPhi - assJetPhi);
761  histname = TString::Format("%s/histDijetDeltaPhi_%d", groupname.Data(), fCentBin);
762  fHistManager.FillTH1(histname, deltaPhi);
763 
764  Double_t kT = TMath::Abs( trigJetPt * TMath::Sin(deltaPhi) );
765  histname = TString::Format("%s/histDijetkT_%d", groupname.Data(), fCentBin);
766  fHistManager.FillTH1(histname, kT);
767 
768  // Study internal structure of the leading, subleading jets
769 
770  Double_t nTracksLeadingJet = trigJet->GetNumberOfTracks();
771  histname = TString::Format("%s/histDijetLeadingJetNTracks_%d", groupname.Data(), fCentBin);
772  fHistManager.FillTH1(histname, nTracksLeadingJet);
773 
774  Double_t nTracksSubleadingJet = assJet->GetNumberOfTracks();
775  histname = TString::Format("%s/histDijetSubleadingJetNTracks_%d", groupname.Data(), fCentBin);
776  fHistManager.FillTH1(histname, nTracksSubleadingJet);
777 
778  histname = TString::Format("%s/histDijetLeadingJetArea_%d", groupname.Data(), fCentBin);
779  fHistManager.FillTH1(histname, trigJet->Area());
780 
781  histname = TString::Format("%s/histDijetSubleadingJetArea_%d", groupname.Data(), fCentBin);
782  fHistManager.FillTH1(histname, assJet->Area());
783 
784  // Study momentum balance
785  // TO DO: loop through tracks/clusters in event (as in above loops) using ClusterAt(i)/TrackAt(i)
786  // and group according to proximity to leading, subleading jet axes
787 
788  } else { // If we don't find an associated jet
789 
790  // Plot leading jets that did not find any associated jet
791  histname = TString::Format("%s/histUnmatchedLeadingJetPt_%d", groupname.Data(), fCentBin);
792  fHistManager.FillTH1(histname, trigJet->Pt());
793 
794  }
795 
796  }
797 
798  return kTRUE;
799 }
800 
805 {
806 
807  // Plot jet ratio R=0.2/R=0.4
808 
809  TString groupnameRatio = "JetRatioPlots";
810  TString histnameChRatio;
811  TString histnameFuRatio;
812 
813  TString groupnameCh02 = "Jet_AKTChargedR020_tracks_pT0150_pt_scheme";
814  TString groupnameCh04 = "Jet_AKTChargedR040_tracks_pT0150_pt_scheme";
815  TString groupnameFu02 = "Jet_AKTFullR020_tracks_pT0150_caloClusters_E0300_pt_scheme";
816  TString groupnameFu04 = "Jet_AKTFullR040_tracks_pT0150_caloClusters_E0300_pt_scheme";
817  TString histnameCh02;
818  TString histnameCh04;
819  TString histnameFu02;
820  TString histnameFu04;
821 
822  for (Int_t cent = 0; cent < fNcentBins; cent++) {
823 
824  histnameChRatio = TString::Format("%s/histChargedJetRatio0204_%d", groupnameRatio.Data(), cent);
825  histnameFuRatio = TString::Format("%s/histFullJetRatio0204_%d", groupnameRatio.Data(), cent);
826 
827  // Get jet yield in each jet container at each pT bin, and fill ratio plot
828 
829  histnameCh02 = TString::Format("%s/histJetPt_%d", groupnameCh02.Data(), cent);
830  histnameCh04 = TString::Format("%s/histJetPt_%d", groupnameCh04.Data(), cent);
831  histnameFu02 = TString::Format("%s/histJetPt_%d", groupnameFu02.Data(), cent);
832  histnameFu04 = TString::Format("%s/histJetPt_%d", groupnameFu04.Data(), cent);
833 
834  TH1F* hCh02Yield = static_cast<TH1F*>(fHistManager.FindObject(histnameCh02));
835  TH1F* hCh04Yield = static_cast<TH1F*>(fHistManager.FindObject(histnameCh04));
836  TH1F* hChRatio = static_cast<TH1F*>(fHistManager.FindObject(histnameChRatio));
837 
838  TH1F* hFu02Yield = static_cast<TH1F*>(fHistManager.FindObject(histnameFu02));
839  TH1F* hFu04Yield = static_cast<TH1F*>(fHistManager.FindObject(histnameFu04));
840  TH1F* hFuRatio = static_cast<TH1F*>(fHistManager.FindObject(histnameFuRatio));
841 
842  for (Int_t bin = 1; bin < fNbins+1; bin++) {
843  Double_t Ch02Yield = hCh02Yield->GetBinContent(bin);
844  Double_t Ch04Yield = hCh04Yield->GetBinContent(bin);
845  if (Ch04Yield != 0)
846  hChRatio->SetBinContent(bin, Ch02Yield / Ch04Yield);
847 
848  Double_t Fu02Yield = hFu02Yield->GetBinContent(bin);
849  Double_t Fu04Yield = hFu04Yield->GetBinContent(bin);
850  if (Fu04Yield != 0)
851  hFuRatio->SetBinContent(bin, Fu02Yield / Fu04Yield);
852 
853  }
854 
855  }
856 
857 }
Double_t Area() const
Definition: AliEmcalJet.h:117
TObjArray fClusterCollArray
cluster collection array
Double_t GetRhoVal() const
const TString & GetRhoName() const
double Double_t
Definition: External.C:58
Double_t fAssJetMinPt
Pt threshold for trigger (full) jet.
Double_t Eta() const
Definition: AliEmcalJet.h:108
Double_t Phi() const
Definition: AliEmcalJet.h:104
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Declaration of class AliTLorentzVector.
Double_t fMinBinPt
min pt in histograms
Int_t fCentBin
!event centrality bin
Container for particles within the EMCAL framework.
UShort_t GetNumberOfTracks() const
Definition: AliEmcalJet.h:126
TObjArray fParticleCollArray
particle/track collection array
const AliClusterIterableContainer all() const
THashList * CreateHistoGroup(const char *groupname, const char *parent="/")
AliEmcalJet * GetLeadingJet(const char *opt="")
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
TObject * FindObject(const char *name) const
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
THashList * GetListOfHistograms() const
Definition: THistManager.h:504
Declaration of class AliAnalysisTaskEmcalDijetImbalance.
Double_t Phi_0_2pi() const
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
BeamType fForceBeamType
forced beam type
Int_t fNcentBins
how many centrality bins
AliClusterContainer * GetClusterContainer(Int_t i=0) const
AliVCluster * GetAcceptCluster(Int_t i) const
const AliClusterIterableContainer accepted() const
TString fCaloCellsName
name of calo cell collection
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
TObjArray fJetCollArray
jet collection array
THistManager fHistManager
Pt threshold for associated (charged) jet (note: unscaled)
short Short_t
Definition: External.C:23
AliVCaloCells * fCaloCells
!cells
AliRhoParameter * GetRhoParameter()
Double_t Pt() const
Definition: AliEmcalJet.h:96
AliEmcalList * fOutput
!output list
Double_t fMaxBinPt
max pt in histograms
Double_t fTrigJetMinPt
minimum delta phi between di-jets
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Double_t fVertex[3]
!event vertex
void SetMakeGeneralHistograms(Bool_t g)
Base task in the EMCAL jet framework.
Implementation of a sample jet analysis task.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
const AliParticleIterableContainer accepted() const
const char Option_t
Definition: External.C:48
const AliJetIterableContainer accepted() const
bool Bool_t
Definition: External.C:53
Container structure for EMCAL clusters.
Container for jet within the EMCAL jet framework.
Int_t fNbins
no. of pt bins