AliPhysics  8bb951a (8bb951a)
 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  fh3RhoVsLeadJetPtVsCent(0),
68  fh3RhoMVsLeadJetPtVsCent(0)
69 {
70  // Default constructor.
71 
72  fh3PtJet1VsMassVsLeadPtAllSel = new TH3F*[fNcentBins];
73  fh3PtJet1VsMassVsLeadPtTagged = new TH3F*[fNcentBins];
74  fh3PtJet1VsMassVsLeadPtTaggedMatch = new TH3F*[fNcentBins];
75  fpPtVsMassJet1All = new TProfile*[fNcentBins];
76  fpPtVsMassJet1Tagged = new TProfile*[fNcentBins];
77  fpPtVsMassJet1TaggedMatch = new TProfile*[fNcentBins];
78  fh2MassVsAreaJet1All = new TH2F*[fNcentBins];
79  fh2MassVsAreaJet1Tagged = new TH2F*[fNcentBins];
80  fh2MassVsAreaJet1TaggedMatch = new TH2F*[fNcentBins];
81  fh2MassVsNConstJet1All = new TH2F*[fNcentBins];
82  fh2MassVsNConstJet1Tagged = new TH2F*[fNcentBins];
83  fh2MassVsNConstJet1TaggedMatch = new TH2F*[fNcentBins];
84 
85  fh3PtJet1VsRatVsLeadPtAllSel = new TH3F*[fNcentBins];
86  fh3PtJet1VsRatVsLeadPtTagged = new TH3F*[fNcentBins];
87  fh3PtJet1VsRatVsLeadPtTaggedMatch = new TH3F*[fNcentBins];
88  fpPtVsRatJet1All = new TProfile*[fNcentBins];
89  fpPtVsRatJet1Tagged = new TProfile*[fNcentBins];
90  fpPtVsRatJet1TaggedMatch = new TProfile*[fNcentBins];
91  fh2RatVsAreaJet1All = new TH2F*[fNcentBins];
92  fh2RatVsAreaJet1Tagged = new TH2F*[fNcentBins];
93  fh2RatVsAreaJet1TaggedMatch = new TH2F*[fNcentBins];
94  fh2RatVsNConstJet1All = new TH2F*[fNcentBins];
95  fh2RatVsNConstJet1Tagged = new TH2F*[fNcentBins];
96  fh2RatVsNConstJet1TaggedMatch = new TH2F*[fNcentBins];
97 
98  fh3JetPtVsMassVsEPRelAllSel = new TH3F*[fNcentBins];
99  fh3JetPtVsMassVsEPRelTagged = new TH3F*[fNcentBins];
100  fh3JetPtVsMassVsEPRelTaggedMatch = new TH3F*[fNcentBins];
101 
102  for (Int_t i = 0; i < fNcentBins; i++) {
103  fh3PtJet1VsMassVsLeadPtAllSel[i] = 0;
104  fh3PtJet1VsMassVsLeadPtTagged[i] = 0;
105  fh3PtJet1VsMassVsLeadPtTaggedMatch[i] = 0;
106  fpPtVsMassJet1All[i] = 0;
107  fpPtVsMassJet1Tagged[i] = 0;
108  fpPtVsMassJet1TaggedMatch[i] = 0;
109  fh2MassVsAreaJet1All[i] = 0;
110  fh2MassVsAreaJet1Tagged[i] = 0;
111  fh2MassVsAreaJet1TaggedMatch[i] = 0;
112  fh2MassVsNConstJet1All[i] = 0;
113  fh2MassVsNConstJet1Tagged[i] = 0;
114  fh2MassVsNConstJet1TaggedMatch[i] = 0;
115 
116  fh3PtJet1VsRatVsLeadPtAllSel[i] = 0;
117  fh3PtJet1VsRatVsLeadPtTagged[i] = 0;
118  fh3PtJet1VsRatVsLeadPtTaggedMatch[i] = 0;
119  fpPtVsRatJet1All[i] = 0;
120  fpPtVsRatJet1Tagged[i] = 0;
121  fpPtVsRatJet1TaggedMatch[i] = 0;
122  fh2RatVsAreaJet1All[i] = 0;
123  fh2RatVsAreaJet1Tagged[i] = 0;
124  fh2RatVsAreaJet1TaggedMatch[i] = 0;
125  fh2RatVsNConstJet1All[i] = 0;
126  fh2RatVsNConstJet1Tagged[i] = 0;
127  fh2RatVsNConstJet1TaggedMatch[i] = 0;
128 
129  fh3JetPtVsMassVsEPRelAllSel[i] = 0;
130  fh3JetPtVsMassVsEPRelTagged[i] = 0;
131  fh3JetPtVsMassVsEPRelTaggedMatch[i] = 0;
132 
133  }
134 
135  SetMakeGeneralHistograms(kTRUE);
136 }
137 
138 //________________________________________________________________________
140  AliAnalysisTaskEmcalJet(name, kTRUE),
141  fContainerBase(0),
142  fContainerUnsub(1),
143  fMinFractionShared(0),
144  fUseUnsubJet(0),
145  fJetMassType(kRaw),
146  fUseSumw2(0),
147  fh3PtJet1VsMassVsLeadPtAllSel(0),
148  fh3PtJet1VsMassVsLeadPtTagged(0),
149  fh3PtJet1VsMassVsLeadPtTaggedMatch(0),
150  fpPtVsMassJet1All(0),
151  fpPtVsMassJet1Tagged(0),
152  fpPtVsMassJet1TaggedMatch(0),
153  fh2MassVsAreaJet1All(0),
154  fh2MassVsAreaJet1Tagged(0),
155  fh2MassVsAreaJet1TaggedMatch(0),
156  fh2MassVsNConstJet1All(0),
157  fh2MassVsNConstJet1Tagged(0),
158  fh2MassVsNConstJet1TaggedMatch(0),
159  fh3PtJet1VsMassVsCentAllSel(0),
160  fh3PtJet1VsMassVsCentTagged(0),
161  fh3PtJet1VsMassVsCentTaggedMatch(0),
162  fh3PtJet1VsRatVsLeadPtAllSel(0),
163  fh3PtJet1VsRatVsLeadPtTagged(0),
164  fh3PtJet1VsRatVsLeadPtTaggedMatch(0),
165  fpPtVsRatJet1All(0),
166  fpPtVsRatJet1Tagged(0),
167  fpPtVsRatJet1TaggedMatch(0),
168  fh2RatVsAreaJet1All(0),
169  fh2RatVsAreaJet1Tagged(0),
170  fh2RatVsAreaJet1TaggedMatch(0),
171  fh2RatVsNConstJet1All(0),
172  fh2RatVsNConstJet1Tagged(0),
173  fh2RatVsNConstJet1TaggedMatch(0),
174  fh3JetPtVsMassVsEPRelAllSel(0),
175  fh3JetPtVsMassVsEPRelTagged(0),
176  fh3JetPtVsMassVsEPRelTaggedMatch(0),
177  fh3RhoVsLeadJetPtVsCent(0),
178  fh3RhoMVsLeadJetPtVsCent(0)
179 {
180  // Standard constructor.
181 
185  fpPtVsMassJet1All = new TProfile*[fNcentBins];
186  fpPtVsMassJet1Tagged = new TProfile*[fNcentBins];
187  fpPtVsMassJet1TaggedMatch = new TProfile*[fNcentBins];
188  fh2MassVsAreaJet1All = new TH2F*[fNcentBins];
189  fh2MassVsAreaJet1Tagged = new TH2F*[fNcentBins];
191  fh2MassVsNConstJet1All = new TH2F*[fNcentBins];
194 
198  fpPtVsRatJet1All = new TProfile*[fNcentBins];
199  fpPtVsRatJet1Tagged = new TProfile*[fNcentBins];
200  fpPtVsRatJet1TaggedMatch = new TProfile*[fNcentBins];
201  fh2RatVsAreaJet1All = new TH2F*[fNcentBins];
202  fh2RatVsAreaJet1Tagged = new TH2F*[fNcentBins];
204  fh2RatVsNConstJet1All = new TH2F*[fNcentBins];
207 
211 
212  for (Int_t i = 0; i < fNcentBins; i++) {
216  fpPtVsMassJet1All[i] = 0;
217  fpPtVsMassJet1Tagged[i] = 0;
219  fh2MassVsAreaJet1All[i] = 0;
222  fh2MassVsNConstJet1All[i] = 0;
225 
229  fpPtVsRatJet1All[i] = 0;
230  fpPtVsRatJet1Tagged[i] = 0;
232  fh2RatVsAreaJet1All[i] = 0;
233  fh2RatVsAreaJet1Tagged[i] = 0;
235  fh2RatVsNConstJet1All[i] = 0;
238 
242  }
243 
245 }
246 
247 //________________________________________________________________________
249 {
250  // Destructor.
251 }
252 
253 //________________________________________________________________________
255 {
256  // Create user output.
257 
259 
260  Bool_t oldStatus = TH1::AddDirectoryStatus();
261  TH1::AddDirectory(kFALSE);
262 
263  const Int_t nBinsPt = 200;
264  const Double_t minPt = -50.;
265  const Double_t maxPt = 150.;
266 
267  const Int_t nBinsM = 100;
268  const Double_t minM = -20.;
269  const Double_t maxM = 80.;
270 
271  const Int_t nBinsR = 100;
272  const Double_t minR = -0.2;
273  const Double_t maxR = 0.8;
274 
275  const Int_t nBinsArea = 50;
276  const Double_t minArea = 0.;
277  const Double_t maxArea = 1.;
278 
279  const Int_t nBinsNConst = 200;
280  const Double_t minNConst = 0.;
281  const Double_t maxNConst = 200.;
282 
283  Int_t nBinsRho = 200;
284  Double_t minRho = 0.;
285  Double_t maxRho = 20.;
286  Int_t nBinsRhom = 200;
287  Double_t minRhom = 0.;
288  Double_t maxRhom = 1.;
289 
290  TString histName = "";
291  TString histTitle = "";
292  for (Int_t i = 0; i < fNcentBins; i++) {
293  histName = TString::Format("fh3PtJet1VsMassVsLeadPtAllSel_%d",i);
294  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};#it{p}_{T,lead trk}",histName.Data());
295  fh3PtJet1VsMassVsLeadPtAllSel[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,20,0.,20.);
296  fOutput->Add(fh3PtJet1VsMassVsLeadPtAllSel[i]);
297 
298  histName = TString::Format("fh3PtJet1VsMassVsLeadPtTagged_%d",i);
299  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};#it{p}_{T,lead trk}",histName.Data());
300  fh3PtJet1VsMassVsLeadPtTagged[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,20,0.,20.);
301  fOutput->Add(fh3PtJet1VsMassVsLeadPtTagged[i]);
302 
303  histName = TString::Format("fh3PtJet1VsMassVsLeadPtTaggedMatch_%d",i);
304  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};#it{p}_{T,lead trk}",histName.Data());
305  fh3PtJet1VsMassVsLeadPtTaggedMatch[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,20,0.,20.);
306  fOutput->Add(fh3PtJet1VsMassVsLeadPtTaggedMatch[i]);
307 
308  histName = TString::Format("fpPtVsMassJet1All_%d",i);
309  histTitle = TString::Format("%s;#it{p}_{T,jet1};Avg #it{M}_{jet1}",histName.Data());
310  fpPtVsMassJet1All[i] = new TProfile(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt);
311  fOutput->Add(fpPtVsMassJet1All[i]);
312 
313  histName = TString::Format("fpPtVsMassJet1Tagged_%d",i);
314  histTitle = TString::Format("%s;#it{p}_{T,jet1};Avg #it{M}_{jet1}",histName.Data());
315  fpPtVsMassJet1Tagged[i] = new TProfile(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt);
316  fOutput->Add(fpPtVsMassJet1Tagged[i]);
317 
318  histName = TString::Format("fpPtVsMassJet1TaggedMatch_%d",i);
319  histTitle = TString::Format("%s;#it{p}_{T,jet1};Avg #it{M}_{jet1}",histName.Data());
320  fpPtVsMassJet1TaggedMatch[i] = new TProfile(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt);
321  fOutput->Add(fpPtVsMassJet1TaggedMatch[i]);
322 
323  histName = TString::Format("fh2MassVsAreaJet1All_%d",i);
324  histTitle = TString::Format("%s;#it{M}_{jet1};#it{A}",histName.Data());
325  fh2MassVsAreaJet1All[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsArea,minArea,maxArea);
326  fOutput->Add(fh2MassVsAreaJet1All[i]);
327 
328  histName = TString::Format("fh2MassVsAreaJet1Tagged_%d",i);
329  histTitle = TString::Format("%s;#it{M}_{jet1};#it{A}",histName.Data());
330  fh2MassVsAreaJet1Tagged[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsArea,minArea,maxArea);
331  fOutput->Add(fh2MassVsAreaJet1Tagged[i]);
332 
333  histName = TString::Format("fh2MassVsAreaJet1TaggedMatch_%d",i);
334  histTitle = TString::Format("%s;#it{M}_{jet1};#it{A}",histName.Data());
335  fh2MassVsAreaJet1TaggedMatch[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsArea,minArea,maxArea);
336  fOutput->Add(fh2MassVsAreaJet1TaggedMatch[i]);
337 
338  histName = TString::Format("fh2MassVsNConstJet1All_%d",i);
339  histTitle = TString::Format("%s;#it{M}_{jet1};#it{N}_{constituents}",histName.Data());
340  fh2MassVsNConstJet1All[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsNConst,minNConst,maxNConst);
341  fOutput->Add(fh2MassVsNConstJet1All[i]);
342 
343  histName = TString::Format("fh2MassVsNConstJet1Tagged_%d",i);
344  histTitle = TString::Format("%s;#it{M}_{jet1};#it{N}_{constituents}",histName.Data());
345  fh2MassVsNConstJet1Tagged[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsNConst,minNConst,maxNConst);
346  fOutput->Add(fh2MassVsNConstJet1Tagged[i]);
347 
348  histName = TString::Format("fh2MassVsNConstJet1TaggedMatch_%d",i);
349  histTitle = TString::Format("%s;#it{M}_{jet1};#it{N}_{constituents}",histName.Data());
350  fh2MassVsNConstJet1TaggedMatch[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsM,minM,maxM,nBinsNConst,minNConst,maxNConst);
351  fOutput->Add(fh2MassVsNConstJet1TaggedMatch[i]);
352 
353  //
354  histName = TString::Format("fh3PtJet1VsRatVsLeadPtAllSel_%d",i);
355  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1}/#it{p}_{T,jet1};#it{p}_{T,lead trk}",histName.Data());
356  fh3PtJet1VsRatVsLeadPtAllSel[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsR,minR,maxR,20,0.,20.);
357  fOutput->Add(fh3PtJet1VsRatVsLeadPtAllSel[i]);
358 
359  histName = TString::Format("fh3PtJet1VsRatVsLeadPtTagged_%d",i);
360  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1}/#it{p}_{T,jet1};#it{p}_{T,lead trk}",histName.Data());
361  fh3PtJet1VsRatVsLeadPtTagged[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsR,minR,maxR,20,0.,20.);
362  fOutput->Add(fh3PtJet1VsRatVsLeadPtTagged[i]);
363 
364  histName = TString::Format("fh3PtJet1VsRatVsLeadPtTaggedMatch_%d",i);
365  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1}/#it{p}_{T,jet1};#it{p}_{T,lead trk}",histName.Data());
366  fh3PtJet1VsRatVsLeadPtTaggedMatch[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsR,minR,maxR,20,0.,20.);
367  fOutput->Add(fh3PtJet1VsRatVsLeadPtTaggedMatch[i]);
368 
369  histName = TString::Format("fpPtVsRatJet1All_%d",i);
370  histTitle = TString::Format("%s;#it{p}_{T,jet1};Avg #it{M}_{jet1}/#it{p}_{T,jet1}",histName.Data());
371  fpPtVsRatJet1All[i] = new TProfile(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt);
372  fOutput->Add(fpPtVsRatJet1All[i]);
373 
374  histName = TString::Format("fpPtVsRatJet1Tagged_%d",i);
375  histTitle = TString::Format("%s;#it{p}_{T,jet1};Avg #it{M}_{jet1}/#it{p}_{T,jet1}",histName.Data());
376  fpPtVsRatJet1Tagged[i] = new TProfile(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt);
377  fOutput->Add(fpPtVsRatJet1Tagged[i]);
378 
379  histName = TString::Format("fpPtVsRatJet1TaggedMatch_%d",i);
380  histTitle = TString::Format("%s;#it{p}_{T,jet1};Avg #it{M}_{jet1}/#it{p}_{T,jet1}",histName.Data());
381  fpPtVsRatJet1TaggedMatch[i] = new TProfile(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt);
382  fOutput->Add(fpPtVsRatJet1TaggedMatch[i]);
383 
384  histName = TString::Format("fh2RatVsAreaJet1All_%d",i);
385  histTitle = TString::Format("%s;#it{M}_{jet1}/#it{p}_{T,jet1};#it{A}",histName.Data());
386  fh2RatVsAreaJet1All[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsR,minR,maxR,nBinsArea,minArea,maxArea);
387  fOutput->Add(fh2RatVsAreaJet1All[i]);
388 
389  histName = TString::Format("fh2RatVsAreaJet1Tagged_%d",i);
390  histTitle = TString::Format("%s;#it{M}_{jet1}/#it{p}_{T,jet1};#it{A}",histName.Data());
391  fh2RatVsAreaJet1Tagged[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsR,minR,maxR,nBinsArea,minArea,maxArea);
392  fOutput->Add(fh2RatVsAreaJet1Tagged[i]);
393 
394  histName = TString::Format("fh2RatVsAreaJet1TaggedMatch_%d",i);
395  histTitle = TString::Format("%s;#it{M}_{jet1}/#it{p}_{T,jet1};#it{A}",histName.Data());
396  fh2RatVsAreaJet1TaggedMatch[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsR,minR,maxR,nBinsArea,minArea,maxArea);
397  fOutput->Add(fh2RatVsAreaJet1TaggedMatch[i]);
398 
399  histName = TString::Format("fh2RatVsNConstJet1All_%d",i);
400  histTitle = TString::Format("%s;#it{M}_{jet1}/#it{p}_{T,jet1};#it{N}_{constituents}",histName.Data());
401  fh2RatVsNConstJet1All[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsR,minR,maxR,nBinsNConst,minNConst,maxNConst);
402  fOutput->Add(fh2RatVsNConstJet1All[i]);
403 
404  histName = TString::Format("fh2RatVsNConstJet1Tagged_%d",i);
405  histTitle = TString::Format("%s;#it{M}_{jet1}/#it{p}_{T,jet1};#it{N}_{constituents}",histName.Data());
406  fh2RatVsNConstJet1Tagged[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsR,minR,maxR,nBinsNConst,minNConst,maxNConst);
407  fOutput->Add(fh2RatVsNConstJet1Tagged[i]);
408 
409  histName = TString::Format("fh2RatVsNConstJet1TaggedMatch_%d",i);
410  histTitle = TString::Format("%s;#it{M}_{jet1}/#it{p}_{T,jet1};#it{N}_{constituents}",histName.Data());
411  fh2RatVsNConstJet1TaggedMatch[i] = new TH2F(histName.Data(),histTitle.Data(),nBinsR,minR,maxR,nBinsNConst,minNConst,maxNConst);
412  fOutput->Add(fh2RatVsNConstJet1TaggedMatch[i]);
413 
414  histName = TString::Format("fh3JetPtVsMassVsEPRelAllSel_%d",i);
415  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};#varphi_{jet}-#Psi",histName.Data());
416  fh3JetPtVsMassVsEPRelAllSel[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,100,0.,TMath::Pi());
417  fOutput->Add(fh3JetPtVsMassVsEPRelAllSel[i]);
418 
419  histName = TString::Format("fh3JetPtVsMassVsEPRelTagged_%d",i);
420  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};#varphi_{jet}-#Psi",histName.Data());
421  fh3JetPtVsMassVsEPRelTagged[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,100,0.,TMath::Pi());
422  fOutput->Add(fh3JetPtVsMassVsEPRelTagged[i]);
423 
424  histName = TString::Format("fh3JetPtVsMassVsEPRelTaggedMatch_%d",i);
425  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};#varphi_{jet}-#Psi",histName.Data());
426  fh3JetPtVsMassVsEPRelTaggedMatch[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,100,0.,TMath::Pi());
427  fOutput->Add(fh3JetPtVsMassVsEPRelTaggedMatch[i]);
428  }
429 
430  histName = TString::Format("fh3PtJet1VsMassVsCentAllSel");
431  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};centrality",histName.Data());
432  fh3PtJet1VsMassVsCentAllSel = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,101,-1.,100.);
433  fOutput->Add(fh3PtJet1VsMassVsCentAllSel);
434 
435  histName = TString::Format("fh3PtJet1VsMassVsCentTagged");
436  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};centrality",histName.Data());
437  fh3PtJet1VsMassVsCentTagged = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,101,-1.,100.);
438  fOutput->Add(fh3PtJet1VsMassVsCentTagged);
439 
440  histName = TString::Format("fh3PtJet1VsMassVsCentTaggedMatch");
441  histTitle = TString::Format("%s;#it{p}_{T,jet1};#it{M}_{jet1};centrality",histName.Data());
442  fh3PtJet1VsMassVsCentTaggedMatch = new TH3F(histName.Data(),histTitle.Data(),nBinsPt,minPt,maxPt,nBinsM,minM,maxM,101,-1.,100.);
443  fOutput->Add(fh3PtJet1VsMassVsCentTaggedMatch);
444 
445  histName = "fh2RhoVsLeadJetPtVsCent";
446  histTitle = Form("Rho Vs LeadJetPt Vs Cent; #rho;#it{p}_{T,lead-jet} (GeV/#it{c});centrality");
447  fh3RhoVsLeadJetPtVsCent = new TH3F(histName.Data(), histTitle.Data(), nBinsRho, minRho, maxRho, nBinsPt, minPt, maxPt, 101, -1., 100.);
449 
450  histName = "fh2RhoMVsLeadJetPtVsCent";
451  histTitle = Form("RhoM Vs LeadJetPt Vs Cent; #rho_{m};#it{p}_{T,lead-jet} (GeV/#it{c});centrality");
452  fh3RhoMVsLeadJetPtVsCent = new TH3F(histName.Data(), histTitle.Data(), nBinsRhom, minRhom, maxRhom, nBinsPt, minPt, maxPt, 101, -1., 100.);
454 
455  if(fUseSumw2) {
456  // =========== Switch on Sumw2 for all histos ===========
457  for (Int_t i=0; i<fOutput->GetEntries(); ++i) {
458  TH1 *h1 = dynamic_cast<TH1*>(fOutput->At(i));
459  if (h1){
460  h1->Sumw2();
461  continue;
462  }
463  THnSparse *hn = dynamic_cast<THnSparse*>(fOutput->At(i));
464  if(hn)hn->Sumw2();
465  }
466  }
467 
468  TH1::AddDirectory(oldStatus);
469 
470  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
471 }
472 
473 //________________________________________________________________________
475 {
476  // Run analysis code here, if needed. It will be executed before FillHistograms().
477  if(!GetNParticles()) {
478  return kFALSE;
479 
480  }
481  return kTRUE;
482 }
483 
484 //________________________________________________________________________
486 {
487  // Fill histograms.
488  AliEmcalJet* jet1 = NULL;
490  if(jetCont) {
491  AliRhoParameter* rhomParam = dynamic_cast<AliRhoParameter*>(InputEvent()->FindListObject(jetCont->GetRhoMassName()));
492  Double_t rhomassval = 0;
493  if (!rhomParam) {
494  AliError(Form("%s: Could not retrieve rho_m %s!", GetName(), jetCont->GetRhoMassName().Data()));
495 
496  } else rhomassval = rhomParam->GetVal();
497 
498  AliEmcalJet *lj = jetCont->GetLeadingJet(); //leading pt without rho subtraction
499  if(lj){
500  fh3RhoVsLeadJetPtVsCent->Fill(jetCont->GetRhoVal(),lj->Pt(),fCent);
501  fh3RhoMVsLeadJetPtVsCent->Fill(rhomassval,lj->Pt(),fCent);
502  }
503  jetCont->ResetCurrentID();
504  while((jet1 = jetCont->GetNextAcceptJet())) {
505 
506  Double_t ptJet1 = jet1->Pt() - GetRhoVal(fContainerBase)*jet1->Area();
507  Double_t maxTrackPt = jet1->MaxTrackPt();
508  Double_t mJet1 = GetJetMass(jet1);
509  Double_t eJet1 = jet1->E();
510  Double_t rat = -1.;
511  if(eJet1<0. || eJet1>0.) rat = mJet1/eJet1;
512  Double_t ep = jet1->Phi() - fEPV0;
513  while (ep < 0) ep += TMath::Pi();
514  while (ep >= TMath::Pi()) ep -= TMath::Pi();
515 
516  //Printf("useUnsub: %d jet: %d pT: %f M: %f E: %f",fUseUnsubJet,jetCont->GetCurrentID(),ptJet1,mJet1,eJet1);
517 
518  Double_t fraction = -1.;
519  AliEmcalJet *jetUS = NULL;
520  if(fUseUnsubJet) {
522  Int_t ifound = 0;
523  Int_t ilab = -1;
524  for(Int_t i = 0; i<jetContUS->GetNJets(); i++) {
525  jetUS = jetContUS->GetJet(i);
526  if(jetUS->GetLabel()==jet1->GetLabel()) {
527  ifound++;
528  if(ifound==1) ilab = i;
529  }
530  }
531  if(ifound>1) AliDebug(2,Form("Found %d partners",ifound));
532  if(ilab>-1) {
533  jetUS = jetContUS->GetJet(ilab);
534  if(!jetUS) continue;
535  fraction = jetContUS->GetFractionSharedPt(jetUS);
536  maxTrackPt = jetUS->MaxTrackPt();
537  }
538  //Printf("subtracted jet ijet: %d lab: %d eta: %f phi: %f",jetCont->GetCurrentID(),jet1->GetLabel(),jet1->Eta(),jet1->Phi());
539  //Printf("unsubtracted jet ijet: %d lab: %d eta: %f phi: %f",ilab,jetUS->GetLabel(),jetUS->Eta(),jetUS->Phi());
540 
541  fraction = jetContUS->GetFractionSharedPt(jetUS);
542  maxTrackPt = jetUS->MaxTrackPt();
543  } else
544  fraction = jetCont->GetFractionSharedPt(jet1);
545 
546  fh3PtJet1VsMassVsLeadPtAllSel[fCentBin]->Fill(ptJet1,mJet1,maxTrackPt);
547  fpPtVsMassJet1All[fCentBin]->Fill(ptJet1,mJet1);
548  fh2MassVsAreaJet1All[fCentBin]->Fill(mJet1,jet1->Area());
550  fh3PtJet1VsMassVsCentAllSel->Fill(ptJet1,mJet1,fCent);
551  fh3JetPtVsMassVsEPRelAllSel[fCentBin]->Fill(ptJet1,mJet1,ep);
552 
553  fh3PtJet1VsRatVsLeadPtAllSel[fCentBin]->Fill(ptJet1,rat,maxTrackPt);
554  fpPtVsRatJet1All[fCentBin]->Fill(ptJet1,rat);
555  fh2RatVsAreaJet1All[fCentBin]->Fill(rat,jet1->Area());
557 
558  if(jet1->GetTagStatus()<1 || !jet1->GetTaggedJet())
559  continue;
560 
561  fh3PtJet1VsMassVsLeadPtTagged[fCentBin]->Fill(ptJet1,mJet1,maxTrackPt);
562  fpPtVsMassJet1Tagged[fCentBin]->Fill(ptJet1,mJet1);
563  fh2MassVsAreaJet1Tagged[fCentBin]->Fill(mJet1,jet1->Area());
565  fh3PtJet1VsMassVsCentTagged->Fill(ptJet1,mJet1,fCent);
566  fh3JetPtVsMassVsEPRelTagged[fCentBin]->Fill(ptJet1,mJet1,ep);
567 
568  fh3PtJet1VsRatVsLeadPtTagged[fCentBin]->Fill(ptJet1,rat,maxTrackPt);
569  fpPtVsRatJet1Tagged[fCentBin]->Fill(ptJet1,rat);
570  fh2RatVsAreaJet1Tagged[fCentBin]->Fill(rat,jet1->Area());
572 
573  //matching
574  if(fMinFractionShared>0. && fraction>fMinFractionShared) {
575  AliEmcalJet *jetM = NULL;
576  if(fUseUnsubJet) {
577  if(jetUS) jetM = jetUS->ClosestJet();
578  }
579  else jetM = jet1->ClosestJet();
580  if(jetM) maxTrackPt = jetM->MaxTrackPt();
581  else maxTrackPt = -1.;
582  fh3PtJet1VsMassVsLeadPtTaggedMatch[fCentBin]->Fill(ptJet1,mJet1,maxTrackPt);
583  fpPtVsMassJet1TaggedMatch[fCentBin]->Fill(ptJet1,mJet1);
584  fh2MassVsAreaJet1TaggedMatch[fCentBin]->Fill(mJet1,jet1->Area());
586  fh3PtJet1VsMassVsCentTaggedMatch->Fill(ptJet1,mJet1,fCent);
587  fh3JetPtVsMassVsEPRelTaggedMatch[fCentBin]->Fill(ptJet1,mJet1,ep);
588 
589  fh3PtJet1VsRatVsLeadPtTaggedMatch[fCentBin]->Fill(ptJet1,rat,maxTrackPt);
590  fpPtVsRatJet1TaggedMatch[fCentBin]->Fill(ptJet1,rat);
591  fh2RatVsAreaJet1TaggedMatch[fCentBin]->Fill(rat,jet1->Area());
593  }
594  }
595  }
596 
597  return kTRUE;
598 }
599 
600 //________________________________________________________________________
602  //calc subtracted jet mass
603  if(fJetMassType==kRaw)
604  return jet->M();
605  else if(fJetMassType==kDeriv)
606  return jet->GetSecondOrderSubtracted();
607 
608  return 0;
609 }
610 
611 //________________________________________________________________________
613  //
614  // retrieve event objects
615  //
617  return kFALSE;
618 
619  return kTRUE;
620 }
621 
622 //_______________________________________________________________________
624 {
625  // Called once at the end of the analysis.
626 }
627 
TH3F * fh3PtJet1VsMassVsCentTagged
all jets after std selection: pt vs mass vs centrality
Double_t Area() const
Definition: AliEmcalJet.h:69
Double_t GetRhoVal() const
AliEmcalJet * GetTaggedJet() const
Definition: AliEmcalJet.h:167
AliEmcalJet * ClosestJet() const
Definition: AliEmcalJet.h:158
AliJetContainer * GetJetContainer(Int_t i=0) const
Int_t GetTagStatus() const
Definition: AliEmcalJet.h:168
TH2F ** fh2MassVsNConstJet1Tagged
mass vs number of constituents of all jets
Double_t Phi() const
Definition: AliEmcalJet.h:55
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:63
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:58
TList * fOutput
!output list
UShort_t GetNumberOfConstituents() const
Definition: AliEmcalJet.h:84
TH3F ** fh3PtJet1VsRatVsLeadPtTaggedMatch
tagged jets pt vs mass/pt vs leading track pt
const TString & GetRhoMassName() const
TH3F * fh3RhoVsLeadJetPtVsCent
jet pt vs mass vs (phi-ep) for tagged matched jets
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
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:99
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 GetSecondOrderSubtracted() const
Definition: AliEmcalJet.h:179
Double_t Pt() const
Definition: AliEmcalJet.h:47
TH2F ** fh2MassVsNConstJet1TaggedMatch
mass vs number of constituents of tagged jets
Double_t GetRhoVal(Int_t i=0) const
void SetMakeGeneralHistograms(Bool_t g)
Double_t GetFractionSharedPt(const AliEmcalJet *jet, AliParticleContainer *cont2=0x0) const
TH2F ** fh2MassVsAreaJet1TaggedMatch
mass vs area of tagged jets
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
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
TH3F * fh3RhoMVsLeadJetPtVsCent
Rho vs pT leading jet (non sub) vs centrality.
Double_t M() const
Definition: AliEmcalJet.h:59
void ResetCurrentID(Int_t i=-1)
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