AliPhysics  2c8507d (2c8507d)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEmcalJetMass.cxx
Go to the documentation of this file.
1 //
2 // Jet mass analysis task.
3 //
4 // Author: M.Verweij
5 
6 #include <TClonesArray.h>
7 #include <TH1F.h>
8 #include <TH2F.h>
9 #include <TH3F.h>
10 #include <THnSparse.h>
11 #include <TList.h>
12 #include <TProfile.h>
13 
14 #include "AliVTrack.h"
15 #include "AliEmcalJet.h"
16 #include "AliRhoParameter.h"
17 #include "AliLog.h"
18 #include "AliEmcalParticle.h"
19 #include "AliAnalysisManager.h"
20 #include "AliJetContainer.h"
21 
22 #include "AliAODEvent.h"
23 
25 
27 
28 //________________________________________________________________________
31  fContainerBase(0),
32  fContainerUnsub(1),
33  fMinFractionShared(0),
34  fUseUnsubJet(0),
35  fJetMassType(kRaw),
36  fUseSumw2(0),
37  fh3PtJet1VsMassVsLeadPtAllSel(0),
38  fh3PtJet1VsMassVsLeadPtTagged(0),
39  fh3PtJet1VsMassVsLeadPtTaggedMatch(0),
40  fpPtVsMassJet1All(0),
41  fpPtVsMassJet1Tagged(0),
42  fpPtVsMassJet1TaggedMatch(0),
43  fh2MassVsAreaJet1All(0),
44  fh2MassVsAreaJet1Tagged(0),
45  fh2MassVsAreaJet1TaggedMatch(0),
46  fh2MassVsNConstJet1All(0),
47  fh2MassVsNConstJet1Tagged(0),
48  fh2MassVsNConstJet1TaggedMatch(0),
49  fh3PtJet1VsMassVsCentAllSel(0),
50  fh3PtJet1VsMassVsCentTagged(0),
51  fh3PtJet1VsMassVsCentTaggedMatch(0),
52  fh3PtJet1VsRatVsLeadPtAllSel(0),
53  fh3PtJet1VsRatVsLeadPtTagged(0),
54  fh3PtJet1VsRatVsLeadPtTaggedMatch(0),
55  fpPtVsRatJet1All(0),
56  fpPtVsRatJet1Tagged(0),
57  fpPtVsRatJet1TaggedMatch(0),
58  fh2RatVsAreaJet1All(0),
59  fh2RatVsAreaJet1Tagged(0),
60  fh2RatVsAreaJet1TaggedMatch(0),
61  fh2RatVsNConstJet1All(0),
62  fh2RatVsNConstJet1Tagged(0),
63  fh2RatVsNConstJet1TaggedMatch(0),
64  fh3JetPtVsMassVsEPRelAllSel(0),
65  fh3JetPtVsMassVsEPRelTagged(0),
66  fh3JetPtVsMassVsEPRelTaggedMatch(0),
67  fhnJetPtMassAndBkg(0)
68 {
69  // Default constructor.
70 
71  fh3PtJet1VsMassVsLeadPtAllSel = new TH3F*[fNcentBins];
72  fh3PtJet1VsMassVsLeadPtTagged = new TH3F*[fNcentBins];
73  fh3PtJet1VsMassVsLeadPtTaggedMatch = new TH3F*[fNcentBins];
74  fpPtVsMassJet1All = new TProfile*[fNcentBins];
75  fpPtVsMassJet1Tagged = new TProfile*[fNcentBins];
76  fpPtVsMassJet1TaggedMatch = new TProfile*[fNcentBins];
77  fh2MassVsAreaJet1All = new TH2F*[fNcentBins];
78  fh2MassVsAreaJet1Tagged = new TH2F*[fNcentBins];
79  fh2MassVsAreaJet1TaggedMatch = new TH2F*[fNcentBins];
80  fh2MassVsNConstJet1All = new TH2F*[fNcentBins];
81  fh2MassVsNConstJet1Tagged = new TH2F*[fNcentBins];
82  fh2MassVsNConstJet1TaggedMatch = new TH2F*[fNcentBins];
83 
84  fh3PtJet1VsRatVsLeadPtAllSel = new TH3F*[fNcentBins];
85  fh3PtJet1VsRatVsLeadPtTagged = new TH3F*[fNcentBins];
86  fh3PtJet1VsRatVsLeadPtTaggedMatch = new TH3F*[fNcentBins];
87  fpPtVsRatJet1All = new TProfile*[fNcentBins];
88  fpPtVsRatJet1Tagged = new TProfile*[fNcentBins];
89  fpPtVsRatJet1TaggedMatch = new TProfile*[fNcentBins];
90  fh2RatVsAreaJet1All = new TH2F*[fNcentBins];
91  fh2RatVsAreaJet1Tagged = new TH2F*[fNcentBins];
92  fh2RatVsAreaJet1TaggedMatch = new TH2F*[fNcentBins];
93  fh2RatVsNConstJet1All = new TH2F*[fNcentBins];
94  fh2RatVsNConstJet1Tagged = new TH2F*[fNcentBins];
95  fh2RatVsNConstJet1TaggedMatch = new TH2F*[fNcentBins];
96 
97  fh3JetPtVsMassVsEPRelAllSel = new TH3F*[fNcentBins];
98  fh3JetPtVsMassVsEPRelTagged = new TH3F*[fNcentBins];
99  fh3JetPtVsMassVsEPRelTaggedMatch = new TH3F*[fNcentBins];
100 
101  for (Int_t i = 0; i < fNcentBins; i++) {
102  fh3PtJet1VsMassVsLeadPtAllSel[i] = 0;
103  fh3PtJet1VsMassVsLeadPtTagged[i] = 0;
104  fh3PtJet1VsMassVsLeadPtTaggedMatch[i] = 0;
105  fpPtVsMassJet1All[i] = 0;
106  fpPtVsMassJet1Tagged[i] = 0;
107  fpPtVsMassJet1TaggedMatch[i] = 0;
108  fh2MassVsAreaJet1All[i] = 0;
109  fh2MassVsAreaJet1Tagged[i] = 0;
110  fh2MassVsAreaJet1TaggedMatch[i] = 0;
111  fh2MassVsNConstJet1All[i] = 0;
112  fh2MassVsNConstJet1Tagged[i] = 0;
113  fh2MassVsNConstJet1TaggedMatch[i] = 0;
114 
115  fh3PtJet1VsRatVsLeadPtAllSel[i] = 0;
116  fh3PtJet1VsRatVsLeadPtTagged[i] = 0;
117  fh3PtJet1VsRatVsLeadPtTaggedMatch[i] = 0;
118  fpPtVsRatJet1All[i] = 0;
119  fpPtVsRatJet1Tagged[i] = 0;
120  fpPtVsRatJet1TaggedMatch[i] = 0;
121  fh2RatVsAreaJet1All[i] = 0;
122  fh2RatVsAreaJet1Tagged[i] = 0;
123  fh2RatVsAreaJet1TaggedMatch[i] = 0;
124  fh2RatVsNConstJet1All[i] = 0;
125  fh2RatVsNConstJet1Tagged[i] = 0;
126  fh2RatVsNConstJet1TaggedMatch[i] = 0;
127 
128  fh3JetPtVsMassVsEPRelAllSel[i] = 0;
129  fh3JetPtVsMassVsEPRelTagged[i] = 0;
130  fh3JetPtVsMassVsEPRelTaggedMatch[i] = 0;
131 
132  }
133 
134  SetMakeGeneralHistograms(kTRUE);
135 }
136 
137 //________________________________________________________________________
139  AliAnalysisTaskEmcalJet(name, kTRUE),
140  fContainerBase(0),
141  fContainerUnsub(1),
142  fMinFractionShared(0),
143  fUseUnsubJet(0),
144  fJetMassType(kRaw),
145  fUseSumw2(0),
146  fh3PtJet1VsMassVsLeadPtAllSel(0),
147  fh3PtJet1VsMassVsLeadPtTagged(0),
148  fh3PtJet1VsMassVsLeadPtTaggedMatch(0),
149  fpPtVsMassJet1All(0),
150  fpPtVsMassJet1Tagged(0),
151  fpPtVsMassJet1TaggedMatch(0),
152  fh2MassVsAreaJet1All(0),
153  fh2MassVsAreaJet1Tagged(0),
154  fh2MassVsAreaJet1TaggedMatch(0),
155  fh2MassVsNConstJet1All(0),
156  fh2MassVsNConstJet1Tagged(0),
157  fh2MassVsNConstJet1TaggedMatch(0),
158  fh3PtJet1VsMassVsCentAllSel(0),
159  fh3PtJet1VsMassVsCentTagged(0),
160  fh3PtJet1VsMassVsCentTaggedMatch(0),
161  fh3PtJet1VsRatVsLeadPtAllSel(0),
162  fh3PtJet1VsRatVsLeadPtTagged(0),
163  fh3PtJet1VsRatVsLeadPtTaggedMatch(0),
164  fpPtVsRatJet1All(0),
165  fpPtVsRatJet1Tagged(0),
166  fpPtVsRatJet1TaggedMatch(0),
167  fh2RatVsAreaJet1All(0),
168  fh2RatVsAreaJet1Tagged(0),
169  fh2RatVsAreaJet1TaggedMatch(0),
170  fh2RatVsNConstJet1All(0),
171  fh2RatVsNConstJet1Tagged(0),
172  fh2RatVsNConstJet1TaggedMatch(0),
173  fh3JetPtVsMassVsEPRelAllSel(0),
174  fh3JetPtVsMassVsEPRelTagged(0),
175  fh3JetPtVsMassVsEPRelTaggedMatch(0),
176  fhnJetPtMassAndBkg(0)
177 {
178  // Standard constructor.
179 
183  fpPtVsMassJet1All = new TProfile*[fNcentBins];
184  fpPtVsMassJet1Tagged = new TProfile*[fNcentBins];
185  fpPtVsMassJet1TaggedMatch = new TProfile*[fNcentBins];
192 
196  fpPtVsRatJet1All = new TProfile*[fNcentBins];
197  fpPtVsRatJet1Tagged = new TProfile*[fNcentBins];
198  fpPtVsRatJet1TaggedMatch = new TProfile*[fNcentBins];
205 
209 
210  for (Int_t i = 0; i < fNcentBins; i++) {
214  fpPtVsMassJet1All[i] = 0;
215  fpPtVsMassJet1Tagged[i] = 0;
217  fh2MassVsAreaJet1All[i] = 0;
220  fh2MassVsNConstJet1All[i] = 0;
223 
227  fpPtVsRatJet1All[i] = 0;
228  fpPtVsRatJet1Tagged[i] = 0;
230  fh2RatVsAreaJet1All[i] = 0;
231  fh2RatVsAreaJet1Tagged[i] = 0;
233  fh2RatVsNConstJet1All[i] = 0;
236 
240  }
241 
243 }
244 
245 //________________________________________________________________________
247 {
248  // Destructor.
249 }
250 
251 //________________________________________________________________________
253 {
254  // Create user output.
255 
257 
258  Bool_t oldStatus = TH1::AddDirectoryStatus();
259  TH1::AddDirectory(kFALSE);
260 
261  const Int_t nBinsPt = 200;
262  const Double_t minPt = -50.;
263  const Double_t maxPt = 150.;
264 
265  const Int_t nBinsM = 100;
266  const Double_t minM = -20.;
267  const Double_t maxM = 80.;
268 
269  const Int_t nBinsR = 100;
270  const Double_t minR = -0.2;
271  const Double_t maxR = 0.8;
272 
273  const Int_t nBinsArea = 50;
274  const Double_t minArea = 0.;
275  const Double_t maxArea = 1.;
276 
277  const Int_t nBinsNConst = 200;
278  const Double_t minNConst = 0.;
279  const Double_t maxNConst = 200.;
280 
281  Int_t nBinsRho = 50;
282  Double_t minRho = 0.;
283  Double_t maxRho = 20.;
284  Int_t nBinsRhom = 50;
285  Double_t minRhom = 0.;
286  Double_t maxRhom = 1.;
287 
288  const Int_t nbinsCent = 101;
289  Double_t minCent = -1., maxCent = 100.;
290 
291  //#rho; #rho_{m}; #it{p}_{T,lead-jet} (GeV/#it{c}); #it{M}_{lead-jet} (GeV); centrality
292  const Int_t nBinsSparse = 5;
293  const Int_t nBins[nBinsSparse] = {nBinsRho, nBinsRhom, nBinsPt, nBinsM, nbinsCent};
294  const Double_t xmin[nBinsSparse] = {minRho, minRhom, minPt, minM, minCent};
295  const Double_t xmax[nBinsSparse] = {maxRho, maxRhom, maxPt, maxM, maxCent};
296 
297  TString histName = "";
298  TString histTitle = "";
299  for (Int_t i = 0; i < fNcentBins; i++) {
300  histName = TString::Format("fh3PtJet1VsMassVsLeadPtAllSel_%d",i);
301  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};#it{p}_{T,lead trk}",histName.Data());
302  fh3PtJet1VsMassVsLeadPtAllSel[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,20,0.,20.);
303  fOutput->Add(fh3PtJet1VsMassVsLeadPtAllSel[i]);
304 
305  histName = TString::Format("fh3PtJet1VsMassVsLeadPtTagged_%d",i);
306  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};#it{p}_{T,lead trk}",histName.Data());
307  fh3PtJet1VsMassVsLeadPtTagged[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,20,0.,20.);
308  fOutput->Add(fh3PtJet1VsMassVsLeadPtTagged[i]);
309 
310  histName = TString::Format("fh3PtJet1VsMassVsLeadPtTaggedMatch_%d",i);
311  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};#it{p}_{T,lead trk}",histName.Data());
312  fh3PtJet1VsMassVsLeadPtTaggedMatch[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,20,0.,20.);
313  fOutput->Add(fh3PtJet1VsMassVsLeadPtTaggedMatch[i]);
314 
315  histName = TString::Format("fpPtVsMassJet1All_%d",i);
316  histTitle = TString::Format("%s;#it{p}_{T,jet1};Avg #it{M}_{jet1}",histName.Data());
317  fpPtVsMassJet1All[i] = new TProfile(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt);
318  fOutput->Add(fpPtVsMassJet1All[i]);
319 
320  histName = TString::Format("fpPtVsMassJet1Tagged_%d",i);
321  histTitle = TString::Format("%s;#it{p}_{T,jet1};Avg #it{M}_{jet1}",histName.Data());
322  fpPtVsMassJet1Tagged[i] = new TProfile(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt);
323  fOutput->Add(fpPtVsMassJet1Tagged[i]);
324 
325  histName = TString::Format("fpPtVsMassJet1TaggedMatch_%d",i);
326  histTitle = TString::Format("%s;#it{p}_{T,jet1};Avg #it{M}_{jet1}",histName.Data());
327  fpPtVsMassJet1TaggedMatch[i] = new TProfile(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt);
328  fOutput->Add(fpPtVsMassJet1TaggedMatch[i]);
329 
330  histName = TString::Format("fh2MassVsAreaJet1All_%d",i);
331  histTitle = TString::Format("%s;#it{M}_{jet1};#it{A}",histName.Data());
332  fh2MassVsAreaJet1All[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsArea,minArea,maxArea);
333  fOutput->Add(fh2MassVsAreaJet1All[i]);
334 
335  histName = TString::Format("fh2MassVsAreaJet1Tagged_%d",i);
336  histTitle = TString::Format("%s;#it{M}_{jet1};#it{A}",histName.Data());
337  fh2MassVsAreaJet1Tagged[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsArea,minArea,maxArea);
338  fOutput->Add(fh2MassVsAreaJet1Tagged[i]);
339 
340  histName = TString::Format("fh2MassVsAreaJet1TaggedMatch_%d",i);
341  histTitle = TString::Format("%s;#it{M}_{jet1};#it{A}",histName.Data());
342  fh2MassVsAreaJet1TaggedMatch[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsArea,minArea,maxArea);
343  fOutput->Add(fh2MassVsAreaJet1TaggedMatch[i]);
344 
345  histName = TString::Format("fh2MassVsNConstJet1All_%d",i);
346  histTitle = TString::Format("%s;#it{M}_{jet1};#it{N}_{constituents}",histName.Data());
347  fh2MassVsNConstJet1All[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsNConst,minNConst,maxNConst);
348  fOutput->Add(fh2MassVsNConstJet1All[i]);
349 
350  histName = TString::Format("fh2MassVsNConstJet1Tagged_%d",i);
351  histTitle = TString::Format("%s;#it{M}_{jet1};#it{N}_{constituents}",histName.Data());
352  fh2MassVsNConstJet1Tagged[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsNConst,minNConst,maxNConst);
353  fOutput->Add(fh2MassVsNConstJet1Tagged[i]);
354 
355  histName = TString::Format("fh2MassVsNConstJet1TaggedMatch_%d",i);
356  histTitle = TString::Format("%s;#it{M}_{jet1};#it{N}_{constituents}",histName.Data());
357  fh2MassVsNConstJet1TaggedMatch[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsNConst,minNConst,maxNConst);
358  fOutput->Add(fh2MassVsNConstJet1TaggedMatch[i]);
359 
360  //
361  histName = TString::Format("fh3PtJet1VsRatVsLeadPtAllSel_%d",i);
362  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1}/#it{p}_{T,jet1};#it{p}_{T,lead trk}",histName.Data());
363  fh3PtJet1VsRatVsLeadPtAllSel[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsR,minR,maxR,20,0.,20.);
364  fOutput->Add(fh3PtJet1VsRatVsLeadPtAllSel[i]);
365 
366  histName = TString::Format("fh3PtJet1VsRatVsLeadPtTagged_%d",i);
367  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1}/#it{p}_{T,jet1};#it{p}_{T,lead trk}",histName.Data());
368  fh3PtJet1VsRatVsLeadPtTagged[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsR,minR,maxR,20,0.,20.);
369  fOutput->Add(fh3PtJet1VsRatVsLeadPtTagged[i]);
370 
371  histName = TString::Format("fh3PtJet1VsRatVsLeadPtTaggedMatch_%d",i);
372  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1}/#it{p}_{T,jet1};#it{p}_{T,lead trk}",histName.Data());
373  fh3PtJet1VsRatVsLeadPtTaggedMatch[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsR,minR,maxR,20,0.,20.);
374  fOutput->Add(fh3PtJet1VsRatVsLeadPtTaggedMatch[i]);
375 
376  histName = TString::Format("fpPtVsRatJet1All_%d",i);
377  histTitle = TString::Format("%s;#it{p}_{T,jet1};Avg #it{M}_{jet1}/#it{p}_{T,jet1}",histName.Data());
378  fpPtVsRatJet1All[i] = new TProfile(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt);
379  fOutput->Add(fpPtVsRatJet1All[i]);
380 
381  histName = TString::Format("fpPtVsRatJet1Tagged_%d",i);
382  histTitle = TString::Format("%s;#it{p}_{T,jet1};Avg #it{M}_{jet1}/#it{p}_{T,jet1}",histName.Data());
383  fpPtVsRatJet1Tagged[i] = new TProfile(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt);
384  fOutput->Add(fpPtVsRatJet1Tagged[i]);
385 
386  histName = TString::Format("fpPtVsRatJet1TaggedMatch_%d",i);
387  histTitle = TString::Format("%s;#it{p}_{T,jet1};Avg #it{M}_{jet1}/#it{p}_{T,jet1}",histName.Data());
388  fpPtVsRatJet1TaggedMatch[i] = new TProfile(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt);
389  fOutput->Add(fpPtVsRatJet1TaggedMatch[i]);
390 
391  histName = TString::Format("fh2RatVsAreaJet1All_%d",i);
392  histTitle = TString::Format("%s;#it{M}_{jet1}/#it{p}_{T,jet1};#it{A}",histName.Data());
393  fh2RatVsAreaJet1All[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsR,minR,maxR,nBinsArea,minArea,maxArea);
394  fOutput->Add(fh2RatVsAreaJet1All[i]);
395 
396  histName = TString::Format("fh2RatVsAreaJet1Tagged_%d",i);
397  histTitle = TString::Format("%s;#it{M}_{jet1}/#it{p}_{T,jet1};#it{A}",histName.Data());
398  fh2RatVsAreaJet1Tagged[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsR,minR,maxR,nBinsArea,minArea,maxArea);
399  fOutput->Add(fh2RatVsAreaJet1Tagged[i]);
400 
401  histName = TString::Format("fh2RatVsAreaJet1TaggedMatch_%d",i);
402  histTitle = TString::Format("%s;#it{M}_{jet1}/#it{p}_{T,jet1};#it{A}",histName.Data());
403  fh2RatVsAreaJet1TaggedMatch[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsR,minR,maxR,nBinsArea,minArea,maxArea);
404  fOutput->Add(fh2RatVsAreaJet1TaggedMatch[i]);
405 
406  histName = TString::Format("fh2RatVsNConstJet1All_%d",i);
407  histTitle = TString::Format("%s;#it{M}_{jet1}/#it{p}_{T,jet1};#it{N}_{constituents}",histName.Data());
408  fh2RatVsNConstJet1All[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsR,minR,maxR,nBinsNConst,minNConst,maxNConst);
409  fOutput->Add(fh2RatVsNConstJet1All[i]);
410 
411  histName = TString::Format("fh2RatVsNConstJet1Tagged_%d",i);
412  histTitle = TString::Format("%s;#it{M}_{jet1}/#it{p}_{T,jet1};#it{N}_{constituents}",histName.Data());
413  fh2RatVsNConstJet1Tagged[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsR,minR,maxR,nBinsNConst,minNConst,maxNConst);
414  fOutput->Add(fh2RatVsNConstJet1Tagged[i]);
415 
416  histName = TString::Format("fh2RatVsNConstJet1TaggedMatch_%d",i);
417  histTitle = TString::Format("%s;#it{M}_{jet1}/#it{p}_{T,jet1};#it{N}_{constituents}",histName.Data());
418  fh2RatVsNConstJet1TaggedMatch[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsR,minR,maxR,nBinsNConst,minNConst,maxNConst);
419  fOutput->Add(fh2RatVsNConstJet1TaggedMatch[i]);
420 
421  histName = TString::Format("fh3JetPtVsMassVsEPRelAllSel_%d",i);
422  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};#varphi_{jet}-#Psi",histName.Data());
423  fh3JetPtVsMassVsEPRelAllSel[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,100,0.,TMath::Pi());
424  fOutput->Add(fh3JetPtVsMassVsEPRelAllSel[i]);
425 
426  histName = TString::Format("fh3JetPtVsMassVsEPRelTagged_%d",i);
427  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};#varphi_{jet}-#Psi",histName.Data());
428  fh3JetPtVsMassVsEPRelTagged[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,100,0.,TMath::Pi());
429  fOutput->Add(fh3JetPtVsMassVsEPRelTagged[i]);
430 
431  histName = TString::Format("fh3JetPtVsMassVsEPRelTaggedMatch_%d",i);
432  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};#varphi_{jet}-#Psi",histName.Data());
433  fh3JetPtVsMassVsEPRelTaggedMatch[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,100,0.,TMath::Pi());
434  fOutput->Add(fh3JetPtVsMassVsEPRelTaggedMatch[i]);
435  }
436 
437  histName = TString::Format("fh3PtJet1VsMassVsCentAllSel");
438  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};centrality",histName.Data());
439  fh3PtJet1VsMassVsCentAllSel = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,101,-1.,100.);
440  fOutput->Add(fh3PtJet1VsMassVsCentAllSel);
441 
442  histName = TString::Format("fh3PtJet1VsMassVsCentTagged");
443  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};centrality",histName.Data());
444  fh3PtJet1VsMassVsCentTagged = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,101,-1.,100.);
445  fOutput->Add(fh3PtJet1VsMassVsCentTagged);
446 
447  histName = TString::Format("fh3PtJet1VsMassVsCentTaggedMatch");
448  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};centrality",histName.Data());
449  fh3PtJet1VsMassVsCentTaggedMatch = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,101,-1.,100.);
450  fOutput->Add(fh3PtJet1VsMassVsCentTaggedMatch);
451 
452  histName = "fhnRhoVsRhoMVsLeadJetPtVsMassVsCent";
453  histTitle = Form("Jets and background; #rho; #rho_{m}; #it{p}_{T,lead-jet} (GeV/#it{c}); #it{M}_{lead-jet} (GeV); centrality");
454 
455  fhnJetPtMassAndBkg = new THnSparseF(histName.Data(), histTitle.Data(), nBinsSparse, nBins, xmin, xmax);
457 
458  if(fUseSumw2) {
459  // =========== Switch on Sumw2 for all histos ===========
460  for (Int_t i=0; i<fOutput->GetEntries(); ++i) {
461  TH1 *h1 = dynamic_cast<TH1*>(fOutput->At(i));
462  if (h1){
463  h1->Sumw2();
464  continue;
465  }
466  THnSparse *hn = dynamic_cast<THnSparse*>(fOutput->At(i));
467  if(hn)hn->Sumw2();
468  }
469  }
470 
471  TH1::AddDirectory(oldStatus);
472 
473  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
474 }
475 
476 //________________________________________________________________________
478 {
479  // Run analysis code here, if needed. It will be executed before FillHistograms().
480  if(!GetNParticles()) {
481  return kFALSE;
482 
483  }
484  return kTRUE;
485 }
486 
487 //________________________________________________________________________
489 {
490  // Fill histograms.
491  AliEmcalJet* jet1 = NULL;
493  if(jetCont) {
494  AliRhoParameter* rhomParam = dynamic_cast<AliRhoParameter*>(InputEvent()->FindListObject(jetCont->GetRhoMassName()));
495  Double_t rhomassval = 0;
496  if (!rhomParam) {
497  AliError(Form("%s: Could not retrieve rho_m %s!", GetName(), jetCont->GetRhoMassName().Data()));
498 
499  } else rhomassval = rhomParam->GetVal();
500 
501  AliEmcalJet *lj = jetCont->GetLeadingJet(); //leading pt without rho subtraction
502  if(lj){
503  Double_t njetandbkg[5] = {jetCont->GetRhoVal(), rhomassval, lj->Pt() - GetRhoVal(fContainerBase)*lj->Area(), GetJetMass(lj), fCent};
504  //#rho; #rho_{m}; #it{p}_{T,lead-jet} (GeV/#it{c}); #it{M}_{lead-jet} (GeV); centrality
505 
506  fhnJetPtMassAndBkg->Fill(njetandbkg);
507  }
508  jetCont->ResetCurrentID();
509  while((jet1 = jetCont->GetNextAcceptJet())) {
510 
511  Double_t ptJet1 = jet1->Pt() - GetRhoVal(fContainerBase)*jet1->Area();
512  Double_t maxTrackPt = jet1->MaxTrackPt();
513  Double_t mJet1 = GetJetMass(jet1);
514  Double_t eJet1 = jet1->E();
515  Double_t rat = -1.;
516  if(eJet1<0. || eJet1>0.) rat = mJet1/eJet1;
517  Double_t ep = jet1->Phi() - fEPV0;
518  while (ep < 0) ep += TMath::Pi();
519  while (ep >= TMath::Pi()) ep -= TMath::Pi();
520 
521  //Printf("useUnsub: %d jet: %d pT: %f M: %f E: %f",fUseUnsubJet,jetCont->GetCurrentID(),ptJet1,mJet1,eJet1);
522 
523  Double_t fraction = -1.;
524  AliEmcalJet *jetUS = NULL;
525  if(fUseUnsubJet) {
527  Int_t ifound = 0;
528  Int_t ilab = -1;
529  for(Int_t i = 0; i<jetContUS->GetNJets(); i++) {
530  jetUS = jetContUS->GetJet(i);
531  if(jetUS->GetLabel()==jet1->GetLabel()) {
532  ifound++;
533  if(ifound==1) ilab = i;
534  }
535  }
536  if(ifound>1) AliDebug(2,Form("Found %d partners",ifound));
537  if(ilab>-1) {
538  jetUS = jetContUS->GetJet(ilab);
539  if(!jetUS) continue;
540  fraction = jetContUS->GetFractionSharedPt(jetUS);
541  maxTrackPt = jetUS->MaxTrackPt();
542  }
543  //Printf("subtracted jet ijet: %d lab: %d eta: %f phi: %f",jetCont->GetCurrentID(),jet1->GetLabel(),jet1->Eta(),jet1->Phi());
544  //Printf("unsubtracted jet ijet: %d lab: %d eta: %f phi: %f",ilab,jetUS->GetLabel(),jetUS->Eta(),jetUS->Phi());
545 
546  fraction = jetContUS->GetFractionSharedPt(jetUS);
547  maxTrackPt = jetUS->MaxTrackPt();
548  } else
549  fraction = jetCont->GetFractionSharedPt(jet1);
550 
551  fh3PtJet1VsMassVsLeadPtAllSel[fCentBin]->Fill(ptJet1,mJet1,maxTrackPt);
552  fpPtVsMassJet1All[fCentBin]->Fill(ptJet1,mJet1);
553  fh2MassVsAreaJet1All[fCentBin]->Fill(mJet1,jet1->Area());
555  fh3PtJet1VsMassVsCentAllSel->Fill(ptJet1,mJet1,fCent);
556  fh3JetPtVsMassVsEPRelAllSel[fCentBin]->Fill(ptJet1,mJet1,ep);
557 
558  fh3PtJet1VsRatVsLeadPtAllSel[fCentBin]->Fill(ptJet1,rat,maxTrackPt);
559  fpPtVsRatJet1All[fCentBin]->Fill(ptJet1,rat);
560  fh2RatVsAreaJet1All[fCentBin]->Fill(rat,jet1->Area());
562 
563  if(jet1->GetTagStatus()<1 || !jet1->GetTaggedJet())
564  continue;
565 
566  fh3PtJet1VsMassVsLeadPtTagged[fCentBin]->Fill(ptJet1,mJet1,maxTrackPt);
567  fpPtVsMassJet1Tagged[fCentBin]->Fill(ptJet1,mJet1);
568  fh2MassVsAreaJet1Tagged[fCentBin]->Fill(mJet1,jet1->Area());
570  fh3PtJet1VsMassVsCentTagged->Fill(ptJet1,mJet1,fCent);
571  fh3JetPtVsMassVsEPRelTagged[fCentBin]->Fill(ptJet1,mJet1,ep);
572 
573  fh3PtJet1VsRatVsLeadPtTagged[fCentBin]->Fill(ptJet1,rat,maxTrackPt);
574  fpPtVsRatJet1Tagged[fCentBin]->Fill(ptJet1,rat);
575  fh2RatVsAreaJet1Tagged[fCentBin]->Fill(rat,jet1->Area());
577 
578  //matching
579  if(fMinFractionShared>0. && fraction>fMinFractionShared) {
580  AliEmcalJet *jetM = NULL;
581  if(fUseUnsubJet) {
582  if(jetUS) jetM = jetUS->ClosestJet();
583  }
584  else jetM = jet1->ClosestJet();
585  if(jetM) maxTrackPt = jetM->MaxTrackPt();
586  else maxTrackPt = -1.;
587  fh3PtJet1VsMassVsLeadPtTaggedMatch[fCentBin]->Fill(ptJet1,mJet1,maxTrackPt);
588  fpPtVsMassJet1TaggedMatch[fCentBin]->Fill(ptJet1,mJet1);
589  fh2MassVsAreaJet1TaggedMatch[fCentBin]->Fill(mJet1,jet1->Area());
591  fh3PtJet1VsMassVsCentTaggedMatch->Fill(ptJet1,mJet1,fCent);
592  fh3JetPtVsMassVsEPRelTaggedMatch[fCentBin]->Fill(ptJet1,mJet1,ep);
593 
594  fh3PtJet1VsRatVsLeadPtTaggedMatch[fCentBin]->Fill(ptJet1,rat,maxTrackPt);
595  fpPtVsRatJet1TaggedMatch[fCentBin]->Fill(ptJet1,rat);
596  fh2RatVsAreaJet1TaggedMatch[fCentBin]->Fill(rat,jet1->Area());
598  }
599  }
600  }
601 
602  return kTRUE;
603 }
604 
605 //________________________________________________________________________
607  //calc subtracted jet mass
608  if(fJetMassType==kRaw)
609  return jet->M();
610  else if(fJetMassType==kDeriv)
612 
613  return 0;
614 }
615 
616 //________________________________________________________________________
618  //
619  // retrieve event objects
620  //
622  return kFALSE;
623 
624  return kTRUE;
625 }
626 
627 //_______________________________________________________________________
629 {
630  // Called once at the end of the analysis.
631 }
632 
TH3F * fh3PtJet1VsMassVsCentTagged
all jets after std selection: pt vs mass vs centrality
Double_t Area() const
Definition: AliEmcalJet.h:114
Double_t GetRhoVal() const
double Double_t
Definition: External.C:58
AliEmcalJet * GetTaggedJet() const
Definition: AliEmcalJet.h:220
Definition: External.C:260
Definition: External.C:236
THnSparse * fhnJetPtMassAndBkg
jet pt vs mass vs (phi-ep) for tagged matched jets
AliEmcalJet * ClosestJet() const
Definition: AliEmcalJet.h:210
AliJetContainer * GetJetContainer(Int_t i=0) const
Int_t GetTagStatus() const
Definition: AliEmcalJet.h:221
TH2F ** fh2MassVsNConstJet1Tagged
mass vs number of constituents of all jets
Double_t Phi() const
Definition: AliEmcalJet.h:101
TH3F ** fh3JetPtVsMassVsEPRelTagged
jet pt vs mass vs (phi-ep) for all jets
Double_t fEPV0
!event plane V0
Int_t GetLabel() const
Definition: AliEmcalJet.h:108
TH3F * fh3PtJet1VsMassVsCentTaggedMatch
tagged jets: pt vs mass vs centrality
ClassImp(AliAnalysisTaskEmcalJetMass) AliAnalysisTaskEmcalJetMass
Int_t fCentBin
!event centrality bin
TH2F ** fh2MassVsAreaJet1Tagged
mass vs area of all jets
TProfile ** fpPtVsRatJet1Tagged
pT vs avg mass/pt of all jets
TProfile ** fpPtVsMassJet1TaggedMatch
pT vs avg mass of tagged jets
TH3F * fh3PtJet1VsMassVsCentAllSel
mass vs number of constituents of tagged jets matched to MC
Double_t E() const
Definition: AliEmcalJet.h:103
UShort_t GetNumberOfConstituents() const
Definition: AliEmcalJet.h:124
TH3F ** fh3PtJet1VsRatVsLeadPtTaggedMatch
tagged jets pt vs mass/pt vs leading track pt
const TString & GetRhoMassName() const
AliEmcalJet * GetLeadingJet(const char *opt="")
Int_t GetNParticles(Int_t i=0) const
TH3F ** fh3JetPtVsMassVsEPRelTaggedMatch
jet pt vs mass vs (phi-ep) for tagged jets
TH2F ** fh2RatVsNConstJet1All
mass/pt vs area of tagged jets matched to MC
int Int_t
Definition: External.C:63
TProfile ** fpPtVsMassJet1Tagged
pT vs avg mass of all jets
TH3F ** fh3PtJet1VsMassVsLeadPtTagged
all jets after std selection pt vs mass vs leading track pt
TH2F ** fh2RatVsAreaJet1Tagged
mass/pt vs area of all jets
TH2F ** fh2MassVsAreaJet1All
pT vs avg mass of tagged jets matched to MC
Int_t GetNJets() const
Int_t fNcentBins
how many centrality bins
TProfile ** fpPtVsRatJet1TaggedMatch
pT vs avg mass/pt of tagged jets
Double_t MaxTrackPt() const
Definition: AliEmcalJet.h:139
TH2F ** fh2RatVsNConstJet1Tagged
mass/pt vs number of constituents of all jets
Double_t fCent
!event centrality
TProfile ** fpPtVsMassJet1All
tagged jets pt vs mass vs leading track pt matched to MC
TH2F ** fh2MassVsNConstJet1All
mass vs area of tagged jets matched to MC
AliEmcalJet * GetNextAcceptJet()
TH2F ** fh2RatVsAreaJet1All
pT vs avg mass/pt of tagged jets matched to MC
TH2F ** fh2RatVsAreaJet1TaggedMatch
mass/pt vs area of tagged jets
Double_t Pt() const
Definition: AliEmcalJet.h:93
TH2F ** fh2MassVsNConstJet1TaggedMatch
mass vs number of constituents of tagged jets
Double_t GetRhoVal(Int_t i=0) const
AliEmcalList * fOutput
!output list
void SetMakeGeneralHistograms(Bool_t g)
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
Double_t GetFractionSharedPt(const AliEmcalJet *jet, AliParticleContainer *cont2=0x0) const
TH2F ** fh2MassVsAreaJet1TaggedMatch
mass vs area of tagged jets
const char Option_t
Definition: External.C:48
TH3F ** fh3PtJet1VsRatVsLeadPtTagged
all jets after std selection pt vs mass/pt vs leading track pt
TH3F ** fh3PtJet1VsRatVsLeadPtAllSel
tagged jets: pt vs mass vs centrality matched to MC
bool Bool_t
Definition: External.C:53
AliEmcalJetShapeProperties * GetShapeProperties() const
Definition: AliEmcalJet.h:244
TH3F ** fh3PtJet1VsMassVsLeadPtTaggedMatch
tagged jets pt vs mass vs leading track pt
TProfile ** fpPtVsRatJet1All
tagged jets pt vs mas/pts vs leading track pt matched to MC
Double_t M() const
Definition: AliEmcalJet.h:104
Container for jet within the EMCAL jet framework.
Definition: External.C:196
AliEmcalJet * GetJet(Int_t i) const
TH2F ** fh2RatVsNConstJet1TaggedMatch
mass/pt vs number of constituents of tagged jets
TH3F ** fh3JetPtVsMassVsEPRelAllSel
mass/pt vs number of constituents of tagged jets matched to MC