AliPhysics  fde8a9f (fde8a9f)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliJetResponseMaker.cxx
Go to the documentation of this file.
1 /*************************************************************************
2  * Copyright(c) 1998-2009, 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 // Emcal jet response matrix maker task.
17 //
18 // Author: Salvatore Aiola, Yale University, salvatore.aiola@cern.ch
19 
20 #include "AliJetResponseMaker.h"
21 
22 #include <TClonesArray.h>
23 #include <TH2F.h>
24 #include <THnSparse.h>
25 
26 #include "AliTLorentzVector.h"
27 #include "AliAnalysisManager.h"
28 #include "AliVCluster.h"
29 #include "AliVTrack.h"
30 #include "AliEmcalJet.h"
31 #include "AliLog.h"
32 #include "AliRhoParameter.h"
33 #include "AliNamedArrayI.h"
34 #include "AliJetContainer.h"
35 #include "AliParticleContainer.h"
36 #include "AliClusterContainer.h"
37 
39 
40 //________________________________________________________________________
43  fMatching(kNoMatching),
44  fMatchingPar1(0),
45  fMatchingPar2(0),
46  fUseCellsToMatch(kFALSE),
47  fMinJetMCPt(1),
48  fHistoType(0),
49  fDeltaPtAxis(0),
50  fDeltaEtaDeltaPhiAxis(0),
51  fNEFAxis(0),
52  fZAxis(0),
53  fZgAxis(0),
54  fdRAxis(0),
55  fPtgAxis(0),
56  fFlavourZAxis(0),
57  fFlavourPtAxis(0),
58  fIsJet1Rho(kFALSE),
59  fIsJet2Rho(kFALSE),
60  fHistRejectionReason1(0),
61  fHistRejectionReason2(0),
62  fHistJets1(0),
63  fHistJets2(0),
64  fHistMatching(0),
65  fHistJets1PhiEta(0),
66  fHistJets1PtArea(0),
67  fHistJets1CorrPtArea(0),
68  fHistJets1NEFvsPt(0),
69  fHistJets1CEFvsCEFPt(0),
70  fHistJets1ZvsPt(0),
71  fHistJets2PhiEta(0),
72  fHistJets2PtArea(0),
73  fHistJets2CorrPtArea(0),
74  fHistJets2NEFvsPt(0),
75  fHistJets2CEFvsCEFPt(0),
76  fHistJets2ZvsPt(0),
77  fHistCommonEnergy1vsJet1Pt(0),
78  fHistCommonEnergy2vsJet2Pt(0),
79  fHistDistancevsJet1Pt(0),
80  fHistDistancevsJet2Pt(0),
81  fHistDistancevsCommonEnergy1(0),
82  fHistDistancevsCommonEnergy2(0),
83  fHistCommonEnergy1vsCommonEnergy2(0),
84  fHistDeltaEtaDeltaPhi(0),
85  fHistJet2PtOverJet1PtvsJet2Pt(0),
86  fHistJet1PtOverJet2PtvsJet1Pt(0),
87  fHistDeltaPtvsJet1Pt(0),
88  fHistDeltaPtvsJet2Pt(0),
89  fHistDeltaPtOverJet1PtvsJet1Pt(0),
90  fHistDeltaPtOverJet2PtvsJet2Pt(0),
91  fHistDeltaPtvsDistance(0),
92  fHistDeltaPtvsCommonEnergy1(0),
93  fHistDeltaPtvsCommonEnergy2(0),
94  fHistDeltaPtvsArea1(0),
95  fHistDeltaPtvsArea2(0),
96  fHistDeltaPtvsDeltaArea(0),
97  fHistJet1PtvsJet2Pt(0),
98  fHistDeltaCorrPtOverJet1CorrPtvsJet1CorrPt(0),
99  fHistDeltaCorrPtOverJet2CorrPtvsJet2CorrPt(0),
100  fHistDeltaCorrPtvsJet1CorrPt(0),
101  fHistDeltaCorrPtvsJet2CorrPt(0),
102  fHistDeltaCorrPtvsDistance(0),
103  fHistDeltaCorrPtvsCommonEnergy1(0),
104  fHistDeltaCorrPtvsCommonEnergy2(0),
105  fHistDeltaCorrPtvsArea1(0),
106  fHistDeltaCorrPtvsArea2(0),
107  fHistDeltaCorrPtvsDeltaArea(0),
108  fHistJet1CorrPtvsJet2CorrPt(0),
109  fHistDeltaMCPtOverJet1MCPtvsJet1MCPt(0),
110  fHistDeltaMCPtOverJet2PtvsJet2Pt(0),
111  fHistDeltaMCPtvsJet1MCPt(0),
112  fHistDeltaMCPtvsJet2Pt(0),
113  fHistDeltaMCPtvsDistance(0),
114  fHistDeltaMCPtvsCommonEnergy1(0),
115  fHistDeltaMCPtvsCommonEnergy2(0),
116  fHistDeltaMCPtvsArea1(0),
117  fHistDeltaMCPtvsArea2(0),
118  fHistDeltaMCPtvsDeltaArea(0),
119  fHistJet1MCPtvsJet2Pt(0)
120 {
121  // Default constructor.
122 
123  SetMakeGeneralHistograms(kTRUE);
124 }
125 
126 //________________________________________________________________________
128  AliAnalysisTaskEmcalJet(name, kTRUE),
129  fMatching(kNoMatching),
130  fMatchingPar1(0),
131  fMatchingPar2(0),
132  fUseCellsToMatch(kFALSE),
133  fMinJetMCPt(1),
134  fHistoType(0),
135  fDeltaPtAxis(0),
136  fDeltaEtaDeltaPhiAxis(0),
137  fNEFAxis(0),
138  fZAxis(0),
139  fZgAxis(0),
140  fdRAxis(0),
141  fPtgAxis(0),
142  fFlavourZAxis(0),
143  fFlavourPtAxis(0),
144  fIsJet1Rho(kFALSE),
145  fIsJet2Rho(kFALSE),
146  fHistRejectionReason1(0),
147  fHistRejectionReason2(0),
148  fHistJets1(0),
149  fHistJets2(0),
150  fHistMatching(0),
151  fHistJets1PhiEta(0),
152  fHistJets1PtArea(0),
153  fHistJets1CorrPtArea(0),
154  fHistJets1NEFvsPt(0),
155  fHistJets1CEFvsCEFPt(0),
156  fHistJets1ZvsPt(0),
157  fHistJets2PhiEta(0),
158  fHistJets2PtArea(0),
159  fHistJets2CorrPtArea(0),
160  fHistJets2NEFvsPt(0),
161  fHistJets2CEFvsCEFPt(0),
162  fHistJets2ZvsPt(0),
163  fHistCommonEnergy1vsJet1Pt(0),
164  fHistCommonEnergy2vsJet2Pt(0),
165  fHistDistancevsJet1Pt(0),
166  fHistDistancevsJet2Pt(0),
167  fHistDistancevsCommonEnergy1(0),
168  fHistDistancevsCommonEnergy2(0),
169  fHistCommonEnergy1vsCommonEnergy2(0),
170  fHistDeltaEtaDeltaPhi(0),
171  fHistJet2PtOverJet1PtvsJet2Pt(0),
172  fHistJet1PtOverJet2PtvsJet1Pt(0),
173  fHistDeltaPtvsJet1Pt(0),
174  fHistDeltaPtvsJet2Pt(0),
175  fHistDeltaPtOverJet1PtvsJet1Pt(0),
176  fHistDeltaPtOverJet2PtvsJet2Pt(0),
177  fHistDeltaPtvsDistance(0),
178  fHistDeltaPtvsCommonEnergy1(0),
179  fHistDeltaPtvsCommonEnergy2(0),
180  fHistDeltaPtvsArea1(0),
181  fHistDeltaPtvsArea2(0),
182  fHistDeltaPtvsDeltaArea(0),
183  fHistJet1PtvsJet2Pt(0),
184  fHistDeltaCorrPtOverJet1CorrPtvsJet1CorrPt(0),
185  fHistDeltaCorrPtOverJet2CorrPtvsJet2CorrPt(0),
186  fHistDeltaCorrPtvsJet1CorrPt(0),
187  fHistDeltaCorrPtvsJet2CorrPt(0),
188  fHistDeltaCorrPtvsDistance(0),
189  fHistDeltaCorrPtvsCommonEnergy1(0),
190  fHistDeltaCorrPtvsCommonEnergy2(0),
191  fHistDeltaCorrPtvsArea1(0),
192  fHistDeltaCorrPtvsArea2(0),
193  fHistDeltaCorrPtvsDeltaArea(0),
194  fHistJet1CorrPtvsJet2CorrPt(0),
195  fHistDeltaMCPtOverJet1MCPtvsJet1MCPt(0),
196  fHistDeltaMCPtOverJet2PtvsJet2Pt(0),
197  fHistDeltaMCPtvsJet1MCPt(0),
198  fHistDeltaMCPtvsJet2Pt(0),
199  fHistDeltaMCPtvsDistance(0),
200  fHistDeltaMCPtvsCommonEnergy1(0),
201  fHistDeltaMCPtvsCommonEnergy2(0),
202  fHistDeltaMCPtvsArea1(0),
203  fHistDeltaMCPtvsArea2(0),
204  fHistDeltaMCPtvsDeltaArea(0),
205  fHistJet1MCPtvsJet2Pt(0)
206 {
207  // Standard constructor.
208 
210 }
211 
212 //________________________________________________________________________
214 {
215  // Destructor
216 }
217 
218 
219 //________________________________________________________________________
221 {
222  // Allocate TH2 histograms.
223 
224  fHistJets1PhiEta = new TH2F("fHistJets1PhiEta", "fHistJets1PhiEta", 40, -1, 1, 40, 0, TMath::Pi()*2);
225  fHistJets1PhiEta->GetXaxis()->SetTitle("#eta");
226  fHistJets1PhiEta->GetYaxis()->SetTitle("#phi");
228 
229  fHistJets1PtArea = new TH2F("fHistJets1PtArea", "fHistJets1PtArea", fNbins/2, 0, 1.5, fNbins, fMinBinPt, fMaxBinPt);
230  fHistJets1PtArea->GetXaxis()->SetTitle("area");
231  fHistJets1PtArea->GetYaxis()->SetTitle("p_{T,1} (GeV/c)");
232  fHistJets1PtArea->GetZaxis()->SetTitle("counts");
234 
235  if (fIsJet1Rho) {
236  fHistJets1CorrPtArea = new TH2F("fHistJets1CorrPtArea", "fHistJets1CorrPtArea",
237  fNbins/2, 0, 1.5, 2*fNbins, -fMaxBinPt, fMaxBinPt);
238  fHistJets1CorrPtArea->GetXaxis()->SetTitle("area");
239  fHistJets1CorrPtArea->GetYaxis()->SetTitle("p_{T,1}^{corr} (GeV/c)");
240  fHistJets1CorrPtArea->GetZaxis()->SetTitle("counts");
242  }
243 
244  fHistJets1ZvsPt = new TH2F("fHistJets1ZvsPt", "fHistJets1ZvsPt", 120, 0, 1.2, fNbins, fMinBinPt, fMaxBinPt);
245  fHistJets1ZvsPt->GetXaxis()->SetTitle("Z");
246  fHistJets1ZvsPt->GetYaxis()->SetTitle("p_{T,1} (GeV/c)");
247  fHistJets1ZvsPt->GetZaxis()->SetTitle("counts");
248  fOutput->Add(fHistJets1ZvsPt);
249 
250  fHistJets1NEFvsPt = new TH2F("fHistJets1NEFvsPt", "fHistJets1NEFvsPt", 120, 0, 1.2, fNbins, fMinBinPt, fMaxBinPt);
251  fHistJets1NEFvsPt->GetXaxis()->SetTitle("NEF");
252  fHistJets1NEFvsPt->GetYaxis()->SetTitle("p_{T,1} (GeV/c)");
253  fHistJets1NEFvsPt->GetZaxis()->SetTitle("counts");
255 
256  fHistJets1CEFvsCEFPt = new TH2F("fHistJets1CEFvsCEFPt", "fHistJets1CEFvsCEFPt", 120, 0, 1.2, fNbins, fMinBinPt, fMaxBinPt);
257  fHistJets1CEFvsCEFPt->GetXaxis()->SetTitle("1-NEF");
258  fHistJets1CEFvsCEFPt->GetYaxis()->SetTitle("(1-NEF)*p_{T,1} (GeV/c)");
259  fHistJets1CEFvsCEFPt->GetZaxis()->SetTitle("counts");
261 
262  // Jets 2 histograms
263 
264  fHistJets2PhiEta = new TH2F("fHistJets2PhiEta", "fHistJets2PhiEta", 40, -1, 1, 40, 0, TMath::Pi()*2);
265  fHistJets2PhiEta->GetXaxis()->SetTitle("#eta");
266  fHistJets2PhiEta->GetYaxis()->SetTitle("#phi");
268 
269  fHistJets2PtArea = new TH2F("fHistJets2PtArea", "fHistJets2PtArea", fNbins/2, 0, 1.5, fNbins, fMinBinPt, fMaxBinPt);
270  fHistJets2PtArea->GetXaxis()->SetTitle("area");
271  fHistJets2PtArea->GetYaxis()->SetTitle("p_{T,2} (GeV/c)");
272  fHistJets2PtArea->GetZaxis()->SetTitle("counts");
274 
275  if (fIsJet2Rho) {
276  fHistJets2CorrPtArea = new TH2F("fHistJets2CorrPtArea", "fHistJets2CorrPtArea",
277  fNbins/2, 0, 1.5, 2*fNbins, -fMaxBinPt, fMaxBinPt);
278  fHistJets2CorrPtArea->GetXaxis()->SetTitle("area");
279  fHistJets2CorrPtArea->GetYaxis()->SetTitle("p_{T,2}^{corr} (GeV/c)");
280  fHistJets2CorrPtArea->GetZaxis()->SetTitle("counts");
282  }
283 
284  fHistJets2ZvsPt = new TH2F("fHistJets2ZvsPt", "fHistJets2ZvsPt", 120, 0, 1.2, fNbins, fMinBinPt, fMaxBinPt);
285  fHistJets2ZvsPt->GetXaxis()->SetTitle("Z");
286  fHistJets2ZvsPt->GetYaxis()->SetTitle("p_{T,2} (GeV/c)");
287  fHistJets2ZvsPt->GetZaxis()->SetTitle("counts");
288  fOutput->Add(fHistJets2ZvsPt);
289 
290  fHistJets2NEFvsPt = new TH2F("fHistJets2NEFvsPt", "fHistJets2NEFvsPt", 120, 0, 1.2, fNbins, fMinBinPt, fMaxBinPt);
291  fHistJets2NEFvsPt->GetXaxis()->SetTitle("NEF");
292  fHistJets2NEFvsPt->GetYaxis()->SetTitle("p_{T,2} (GeV/c)");
293  fHistJets2NEFvsPt->GetZaxis()->SetTitle("counts");
295 
296  fHistJets2CEFvsCEFPt = new TH2F("fHistJets2CEFvsCEFPt", "fHistJets2CEFvsCEFPt", 120, 0, 1.2, fNbins, fMinBinPt, fMaxBinPt);
297  fHistJets2CEFvsCEFPt->GetXaxis()->SetTitle("1-NEF");
298  fHistJets2CEFvsCEFPt->GetYaxis()->SetTitle("(1-NEF)*p_{T,2} (GeV/c)");
299  fHistJets2CEFvsCEFPt->GetZaxis()->SetTitle("counts");
301 
302  // Matching histograms
303 
304  fHistCommonEnergy1vsJet1Pt = new TH2F("fHistCommonEnergy1vsJet1Pt", "fHistCommonEnergy1vsJet1Pt", fNbins/2, 0, 1.2, fNbins/2, fMinBinPt, fMaxBinPt);
305  fHistCommonEnergy1vsJet1Pt->GetXaxis()->SetTitle("Common energy 1 (%)");
306  fHistCommonEnergy1vsJet1Pt->GetYaxis()->SetTitle("p_{T,1}");
307  fHistCommonEnergy1vsJet1Pt->GetZaxis()->SetTitle("counts");
309 
310  fHistCommonEnergy2vsJet2Pt = new TH2F("fHistCommonEnergy2vsJet2Pt", "fHistCommonEnergy2vsJet2Pt", fNbins/2, 0, 1.2, fNbins/2, fMinBinPt, fMaxBinPt);
311  fHistCommonEnergy2vsJet2Pt->GetXaxis()->SetTitle("Common energy 2 (%)");
312  fHistCommonEnergy2vsJet2Pt->GetYaxis()->SetTitle("p_{T,2}");
313  fHistCommonEnergy2vsJet2Pt->GetZaxis()->SetTitle("counts");
315 
316  fHistDistancevsJet1Pt = new TH2F("fHistDistancevsJet1Pt", "fHistDistancevsJet1Pt", fNbins/2, 0, 1.2, fNbins/2, fMinBinPt, fMaxBinPt);
317  fHistDistancevsJet1Pt->GetXaxis()->SetTitle("Distance");
318  fHistDistancevsJet1Pt->GetYaxis()->SetTitle("p_{T,1}");
319  fHistDistancevsJet1Pt->GetZaxis()->SetTitle("counts");
321 
322  fHistDistancevsJet2Pt = new TH2F("fHistDistancevsJet2Pt", "fHistDistancevsJet2Pt", fNbins/2, 0, 1.2, fNbins/2, fMinBinPt, fMaxBinPt);
323  fHistDistancevsJet2Pt->GetXaxis()->SetTitle("Distance");
324  fHistDistancevsJet2Pt->GetYaxis()->SetTitle("p_{T,2}");
325  fHistDistancevsJet2Pt->GetZaxis()->SetTitle("counts");
327 
328  fHistDistancevsCommonEnergy1 = new TH2F("fHistDistancevsCommonEnergy1", "fHistDistancevsCommonEnergy1", fNbins/2, 0, 1.2, fNbins/2, 0, 1.2);
329  fHistDistancevsCommonEnergy1->GetXaxis()->SetTitle("Distance");
330  fHistDistancevsCommonEnergy1->GetYaxis()->SetTitle("Common energy 1 (%)");
331  fHistDistancevsCommonEnergy1->GetZaxis()->SetTitle("counts");
333 
334  fHistDistancevsCommonEnergy2 = new TH2F("fHistDistancevsCommonEnergy2", "fHistDistancevsCommonEnergy2", fNbins/2, 0, 1.2, fNbins/2, 0, 1.2);
335  fHistDistancevsCommonEnergy2->GetXaxis()->SetTitle("Distance");
336  fHistDistancevsCommonEnergy2->GetYaxis()->SetTitle("Common energy 2 (%)");
337  fHistDistancevsCommonEnergy2->GetZaxis()->SetTitle("counts");
339 
340  fHistCommonEnergy1vsCommonEnergy2 = new TH2F("fHistCommonEnergy1vsCommonEnergy2", "fHistCommonEnergy1vsCommonEnergy2", fNbins/2, 0, 1.2, fNbins/2, 0, 1.2);
341  fHistCommonEnergy1vsCommonEnergy2->GetXaxis()->SetTitle("Common energy 1 (%)");
342  fHistCommonEnergy1vsCommonEnergy2->GetYaxis()->SetTitle("Common energy 2 (%)");
343  fHistCommonEnergy1vsCommonEnergy2->GetZaxis()->SetTitle("counts");
345 
346  fHistDeltaEtaDeltaPhi = new TH2F("fHistDeltaEtaDeltaPhi", "fHistDeltaEtaDeltaPhi", fNbins/4, -1, 1, fNbins/4, -TMath::Pi()/2, TMath::Pi()*3/2);
347  fHistDeltaEtaDeltaPhi->GetXaxis()->SetTitle("Common energy 1 (%)");
348  fHistDeltaEtaDeltaPhi->GetYaxis()->SetTitle("Common energy 2 (%)");
349  fHistDeltaEtaDeltaPhi->GetZaxis()->SetTitle("counts");
351 
352  fHistJet2PtOverJet1PtvsJet2Pt = new TH2F("fHistJet2PtOverJet1PtvsJet2Pt", "fHistJet2PtOverJet1PtvsJet2Pt", fNbins, fMinBinPt, fMaxBinPt, 300, 0, 1.5);
353  fHistJet2PtOverJet1PtvsJet2Pt->GetXaxis()->SetTitle("p_{T,2}");
354  fHistJet2PtOverJet1PtvsJet2Pt->GetYaxis()->SetTitle("p_{T,2} / p_{T,1}");
355  fHistJet2PtOverJet1PtvsJet2Pt->GetZaxis()->SetTitle("counts");
357 
358  fHistJet1PtOverJet2PtvsJet1Pt = new TH2F("fHistJet1PtOverJet2PtvsJet1Pt", "fHistJet1PtOverJet2PtvsJet1Pt", fNbins, fMinBinPt, fMaxBinPt, 300, 0, 1.5);
359  fHistJet1PtOverJet2PtvsJet1Pt->GetXaxis()->SetTitle("p_{T,1}");
360  fHistJet1PtOverJet2PtvsJet1Pt->GetYaxis()->SetTitle("p_{T,1} / p_{T,2}");
361  fHistJet1PtOverJet2PtvsJet1Pt->GetZaxis()->SetTitle("counts");
363 
364  fHistDeltaPtvsJet1Pt = new TH2F("fHistDeltaPtvsJet1Pt", "fHistDeltaPtvsJet1Pt",
366  fHistDeltaPtvsJet1Pt->GetXaxis()->SetTitle("p_{T,1}");
367  fHistDeltaPtvsJet1Pt->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
368  fHistDeltaPtvsJet1Pt->GetZaxis()->SetTitle("counts");
370 
371  fHistDeltaPtvsJet2Pt = new TH2F("fHistDeltaPtvsJet2Pt", "fHistDeltaPtvsJet2Pt",
373  fHistDeltaPtvsJet2Pt->GetXaxis()->SetTitle("p_{T,2}");
374  fHistDeltaPtvsJet2Pt->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
375  fHistDeltaPtvsJet2Pt->GetZaxis()->SetTitle("counts");
377 
378  fHistDeltaPtOverJet1PtvsJet1Pt = new TH2F("fHistDeltaPtOverJet1PtvsJet1Pt", "fHistDeltaPtOverJet1PtvsJet1Pt",
379  fNbins, fMinBinPt, fMaxBinPt, fNbins, -5, 5);
380  fHistDeltaPtOverJet1PtvsJet1Pt->GetXaxis()->SetTitle("p_{T,1}");
381  fHistDeltaPtOverJet1PtvsJet1Pt->GetYaxis()->SetTitle("#deltap_{T} / p_{T,1}");
382  fHistDeltaPtOverJet1PtvsJet1Pt->GetZaxis()->SetTitle("counts");
384 
385  fHistDeltaPtOverJet2PtvsJet2Pt = new TH2F("fHistDeltaPtOverJet2PtvsJet2Pt", "fHistDeltaPtOverJet2PtvsJet2Pt",
386  fNbins, fMinBinPt, fMaxBinPt, fNbins, -5, 5);
387  fHistDeltaPtOverJet2PtvsJet2Pt->GetXaxis()->SetTitle("p_{T,2}");
388  fHistDeltaPtOverJet2PtvsJet2Pt->GetYaxis()->SetTitle("#deltap_{T} / p_{T,2}");
389  fHistDeltaPtOverJet2PtvsJet2Pt->GetZaxis()->SetTitle("counts");
391 
392  fHistDeltaPtvsDistance = new TH2F("fHistDeltaPtvsDistance", "fHistDeltaPtvsDistance",
393  fNbins/2, 0, 1.2, 2*fNbins, -fMaxBinPt, fMaxBinPt);
394  fHistDeltaPtvsDistance->GetXaxis()->SetTitle("Distance");
395  fHistDeltaPtvsDistance->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
396  fHistDeltaPtvsDistance->GetZaxis()->SetTitle("counts");
398 
399  fHistDeltaPtvsCommonEnergy1 = new TH2F("fHistDeltaPtvsCommonEnergy1", "fHistDeltaPtvsCommonEnergy1",
400  fNbins/2, 0, 1.2, 2*fNbins, -fMaxBinPt, fMaxBinPt);
401  fHistDeltaPtvsCommonEnergy1->GetXaxis()->SetTitle("Common energy 1 (%)");
402  fHistDeltaPtvsCommonEnergy1->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
403  fHistDeltaPtvsCommonEnergy1->GetZaxis()->SetTitle("counts");
405 
406  fHistDeltaPtvsCommonEnergy2 = new TH2F("fHistDeltaPtvsCommonEnergy2", "fHistDeltaPtvsCommonEnergy2",
407  fNbins/2, 0, 1.2, 2*fNbins, -fMaxBinPt, fMaxBinPt);
408  fHistDeltaPtvsCommonEnergy2->GetXaxis()->SetTitle("Common energy 2 (%)");
409  fHistDeltaPtvsCommonEnergy2->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
410  fHistDeltaPtvsCommonEnergy2->GetZaxis()->SetTitle("counts");
412 
413  fHistDeltaPtvsArea1 = new TH2F("fHistDeltaPtvsArea1", "fHistDeltaPtvsArea1",
414  fNbins/2, 0, 1.5, 2*fNbins, -fMaxBinPt, fMaxBinPt);
415  fHistDeltaPtvsArea1->GetXaxis()->SetTitle("A_{jet,1}");
416  fHistDeltaPtvsArea1->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
417  fHistDeltaPtvsArea1->GetZaxis()->SetTitle("counts");
419 
420  fHistDeltaPtvsArea2 = new TH2F("fHistDeltaPtvsArea2", "fHistDeltaPtvsArea2",
421  fNbins/2, 0, 1.5, 2*fNbins, -fMaxBinPt, fMaxBinPt);
422  fHistDeltaPtvsArea2->GetXaxis()->SetTitle("A_{jet,2}");
423  fHistDeltaPtvsArea2->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
424  fHistDeltaPtvsArea2->GetZaxis()->SetTitle("counts");
426 
427  fHistDeltaPtvsDeltaArea = new TH2F("fHistDeltaPtvsDeltaArea", "fHistDeltaPtvsDeltaArea",
428  fNbins, -1.+1./fNbins, 1.+1./fNbins, 2*fNbins, -fMaxBinPt, fMaxBinPt);
429  fHistDeltaPtvsDeltaArea->GetXaxis()->SetTitle("#deltaA_{jet}");
430  fHistDeltaPtvsDeltaArea->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
431  fHistDeltaPtvsDeltaArea->GetZaxis()->SetTitle("counts");
433 
434  fHistJet1PtvsJet2Pt = new TH2F("fHistJet1PtvsJet2Pt", "fHistJet1PtvsJet2Pt", fNbins, fMinBinPt, fMaxBinPt, fNbins, fMinBinPt, fMaxBinPt);
435  fHistJet1PtvsJet2Pt->GetXaxis()->SetTitle("p_{T,1}");
436  fHistJet1PtvsJet2Pt->GetYaxis()->SetTitle("p_{T,2}");
437  fHistJet1PtvsJet2Pt->GetZaxis()->SetTitle("counts");
439 
440  if (fIsJet1Rho || fIsJet2Rho) {
441  if (!fIsJet1Rho)
442  fHistDeltaCorrPtvsJet1CorrPt = new TH2F("fHistDeltaCorrPtvsJet1CorrPt", "fHistDeltaCorrPtvsJet1CorrPt",
444  else
445  fHistDeltaCorrPtvsJet1CorrPt = new TH2F("fHistDeltaCorrPtvsJet1CorrPt", "fHistDeltaCorrPtvsJet1CorrPt",
447 
448  fHistDeltaCorrPtvsJet1CorrPt->GetXaxis()->SetTitle("p_{T,1}^{corr}");
449  fHistDeltaCorrPtvsJet1CorrPt->GetYaxis()->SetTitle("#deltap_{T}^{corr} (GeV/c)");
450  fHistDeltaCorrPtvsJet1CorrPt->GetZaxis()->SetTitle("counts");
452 
453  if (!fIsJet2Rho)
454  fHistDeltaCorrPtvsJet2CorrPt = new TH2F("fHistDeltaCorrPtvsJet2CorrPt", "fHistDeltaCorrPtvsJet2CorrPt",
456  else
457  fHistDeltaCorrPtvsJet2CorrPt = new TH2F("fHistDeltaCorrPtvsJet2CorrPt", "fHistDeltaCorrPtvsJet2CorrPt",
459 
460  fHistDeltaCorrPtvsJet2CorrPt->GetXaxis()->SetTitle("p_{T,2}^{corr}");
461  fHistDeltaCorrPtvsJet2CorrPt->GetYaxis()->SetTitle("#deltap_{T}^{corr} (GeV/c)");
462  fHistDeltaCorrPtvsJet2CorrPt->GetZaxis()->SetTitle("counts");
464 
465  fHistDeltaCorrPtOverJet1CorrPtvsJet1CorrPt = new TH2F("fHistDeltaCorrPtOverJet1CorrPtvsJet1CorrPt", "fHistDeltaCorrPtOverJet1CorrPtvsJet1CorrPt",
466  2*fNbins, -fMaxBinPt, fMaxBinPt, fNbins, -5, 5);
467  fHistDeltaCorrPtOverJet1CorrPtvsJet1CorrPt->GetXaxis()->SetTitle("p_{T,1}^{corr}");
468  fHistDeltaCorrPtOverJet1CorrPtvsJet1CorrPt->GetYaxis()->SetTitle("#deltap_{T}^{corr} / p_{T,1}^{corr}");
469  fHistDeltaCorrPtOverJet1CorrPtvsJet1CorrPt->GetZaxis()->SetTitle("counts");
471 
472  fHistDeltaCorrPtOverJet2CorrPtvsJet2CorrPt = new TH2F("fHistDeltaCorrPtOverJet2CorrPtvsJet2CorrPt", "fHistDeltaCorrPtOverJet2CorrPtvsJet2CorrPt",
473  2*fNbins, -fMaxBinPt, fMaxBinPt, fNbins, -5, 5);
474  fHistDeltaCorrPtOverJet2CorrPtvsJet2CorrPt->GetXaxis()->SetTitle("p_{T,2}^{corr}");
475  fHistDeltaCorrPtOverJet2CorrPtvsJet2CorrPt->GetYaxis()->SetTitle("#deltap_{T}^{corr} / p_{T,2}^{corr}");
476  fHistDeltaCorrPtOverJet2CorrPtvsJet2CorrPt->GetZaxis()->SetTitle("counts");
478 
479  fHistDeltaCorrPtvsDistance = new TH2F("fHistDeltaCorrPtvsDistance", "fHistDeltaCorrPtvsDistance",
480  fNbins/2, 0, 1.2, 2*fNbins, -fMaxBinPt, fMaxBinPt);
481  fHistDeltaCorrPtvsDistance->GetXaxis()->SetTitle("Distance");
482  fHistDeltaCorrPtvsDistance->GetYaxis()->SetTitle("#deltap_{T}^{corr} (GeV/c)");
483  fHistDeltaCorrPtvsDistance->GetZaxis()->SetTitle("counts");
485 
486  fHistDeltaCorrPtvsCommonEnergy1 = new TH2F("fHistDeltaCorrPtvsCommonEnergy1", "fHistDeltaCorrPtvsCommonEnergy1",
487  fNbins/2, 0, 1.2, 2*fNbins, -fMaxBinPt, fMaxBinPt);
488  fHistDeltaCorrPtvsCommonEnergy1->GetXaxis()->SetTitle("Common energy 1 (%)");
489  fHistDeltaCorrPtvsCommonEnergy1->GetYaxis()->SetTitle("#deltap_{T}^{corr} (GeV/c)");
490  fHistDeltaCorrPtvsCommonEnergy1->GetZaxis()->SetTitle("counts");
492 
493  fHistDeltaCorrPtvsCommonEnergy2 = new TH2F("fHistDeltaCorrPtvsCommonEnergy2", "fHistDeltaCorrPtvsCommonEnergy2",
494  fNbins/2, 0, 1.2, 2*fNbins, -fMaxBinPt, fMaxBinPt);
495  fHistDeltaCorrPtvsCommonEnergy2->GetXaxis()->SetTitle("Common energy 2 (%)");
496  fHistDeltaCorrPtvsCommonEnergy2->GetYaxis()->SetTitle("#deltap_{T}^{corr} (GeV/c)");
497  fHistDeltaCorrPtvsCommonEnergy2->GetZaxis()->SetTitle("counts");
499 
500  fHistDeltaCorrPtvsArea1 = new TH2F("fHistDeltaCorrPtvsArea1", "fHistDeltaCorrPtvsArea1",
501  fNbins/2, 0, 1.5, 2*fNbins, -fMaxBinPt, fMaxBinPt);
502  fHistDeltaCorrPtvsArea1->GetXaxis()->SetTitle("A_{jet,1}");
503  fHistDeltaCorrPtvsArea1->GetYaxis()->SetTitle("#deltap_{T}^{corr} (GeV/c)");
504  fHistDeltaCorrPtvsArea1->GetZaxis()->SetTitle("counts");
506 
507  fHistDeltaCorrPtvsArea2 = new TH2F("fHistDeltaCorrPtvsArea2", "fHistDeltaCorrPtvsArea2",
508  fNbins/2, 0, 1.5, 2*fNbins, -fMaxBinPt, fMaxBinPt);
509  fHistDeltaCorrPtvsArea2->GetXaxis()->SetTitle("A_{jet,2}");
510  fHistDeltaCorrPtvsArea2->GetYaxis()->SetTitle("#deltap_{T}^{corr} (GeV/c)");
511  fHistDeltaCorrPtvsArea2->GetZaxis()->SetTitle("counts");
513 
514  fHistDeltaCorrPtvsDeltaArea = new TH2F("fHistDeltaCorrPtvsDeltaArea", "fHistDeltaCorrPtvsDeltaArea",
515  fNbins, -1.+1./fNbins, 1.+1./fNbins, 2*fNbins, -fMaxBinPt, fMaxBinPt);
516  fHistDeltaCorrPtvsDeltaArea->GetXaxis()->SetTitle("#deltaA_{jet}");
517  fHistDeltaCorrPtvsDeltaArea->GetYaxis()->SetTitle("#deltap_{T}^{corr} (GeV/c)");
518  fHistDeltaCorrPtvsDeltaArea->GetZaxis()->SetTitle("counts");
520 
521  if (!fIsJet1Rho)
522  fHistJet1CorrPtvsJet2CorrPt = new TH2F("fHistJet1CorrPtvsJet2CorrPt", "fHistJet1CorrPtvsJet2CorrPt",
524  else if (!fIsJet2Rho)
525  fHistJet1CorrPtvsJet2CorrPt = new TH2F("fHistJet1CorrPtvsJet2CorrPt", "fHistJet1CorrPtvsJet2CorrPt",
527  else
528  fHistJet1CorrPtvsJet2CorrPt = new TH2F("fHistJet1CorrPtvsJet2CorrPt", "fHistJet1CorrPtvsJet2CorrPt",
530  2*fNbins, -fMaxBinPt, fMaxBinPt);
531  fHistJet1CorrPtvsJet2CorrPt->GetXaxis()->SetTitle("p_{T,1}^{corr}");
532  fHistJet1CorrPtvsJet2CorrPt->GetYaxis()->SetTitle("p_{T,2}^{corr}");
533  fHistJet1CorrPtvsJet2CorrPt->GetZaxis()->SetTitle("counts");
535  }
536 
537  if (fIsEmbedded) {
538  fHistDeltaMCPtvsJet1MCPt = new TH2F("fHistDeltaMCPtvsJet1MCPt", "fHistDeltaMCPtvsJet1MCPt",
540  fHistDeltaMCPtvsJet1MCPt->GetXaxis()->SetTitle("p_{T,1}^{MC}");
541  fHistDeltaMCPtvsJet1MCPt->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
542  fHistDeltaMCPtvsJet1MCPt->GetZaxis()->SetTitle("counts");
544 
545  fHistDeltaMCPtvsJet2Pt = new TH2F("fHistDeltaMCPtvsJet2Pt", "fHistDeltaMCPtvsJet2Pt",
547  fHistDeltaMCPtvsJet2Pt->GetXaxis()->SetTitle("p_{T,2}");
548  fHistDeltaMCPtvsJet2Pt->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
549  fHistDeltaMCPtvsJet2Pt->GetZaxis()->SetTitle("counts");
551 
552  fHistDeltaMCPtOverJet1MCPtvsJet1MCPt = new TH2F("fHistDeltaMCPtOverJet1MCPtvsJet1MCPt", "fHistDeltaMCPtOverJet1MCPtvsJet1MCPt",
553  fNbins, fMinBinPt, fMaxBinPt, fNbins, -5, 5);
554  fHistDeltaMCPtOverJet1MCPtvsJet1MCPt->GetXaxis()->SetTitle("p_{T,1}^{MC}");
555  fHistDeltaMCPtOverJet1MCPtvsJet1MCPt->GetYaxis()->SetTitle("#deltap_{T} / p_{T,1}^{MC}");
556  fHistDeltaMCPtOverJet1MCPtvsJet1MCPt->GetZaxis()->SetTitle("counts");
558 
559  fHistDeltaMCPtOverJet2PtvsJet2Pt = new TH2F("fHistDeltaMCPtOverJet2PtvsJet2Pt", "fHistDeltaMCPtOverJet2PtvsJet2Pt",
560  fNbins, fMinBinPt, fMaxBinPt, fNbins, -5, 5);
561  fHistDeltaMCPtOverJet2PtvsJet2Pt->GetXaxis()->SetTitle("p_{T,2}");
562  fHistDeltaMCPtOverJet2PtvsJet2Pt->GetYaxis()->SetTitle("#deltap_{T} / p_{T,2}");
563  fHistDeltaMCPtOverJet2PtvsJet2Pt->GetZaxis()->SetTitle("counts");
565 
566  fHistDeltaMCPtvsDistance = new TH2F("fHistDeltaMCPtvsDistance", "fHistDeltaMCPtvsDistance",
567  fNbins/2, 0, 1.2, 2*fNbins, -fMaxBinPt, fMaxBinPt);
568  fHistDeltaMCPtvsDistance->GetXaxis()->SetTitle("Distance");
569  fHistDeltaMCPtvsDistance->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
570  fHistDeltaMCPtvsDistance->GetZaxis()->SetTitle("counts");
572 
573  fHistDeltaMCPtvsCommonEnergy1 = new TH2F("fHistDeltaMCPtvsCommonEnergy1", "fHistDeltaMCPtvsCommonEnergy1",
574  fNbins/2, 0, 1.2, 2*fNbins, -fMaxBinPt, fMaxBinPt);
575  fHistDeltaMCPtvsCommonEnergy1->GetXaxis()->SetTitle("Common energy 1 (%)");
576  fHistDeltaMCPtvsCommonEnergy1->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
577  fHistDeltaMCPtvsCommonEnergy1->GetZaxis()->SetTitle("counts");
579 
580  fHistDeltaMCPtvsCommonEnergy2 = new TH2F("fHistDeltaMCPtvsCommonEnergy2", "fHistDeltaMCPtvsCommonEnergy2",
581  fNbins/2, 0, 1.2, 2*fNbins, -fMaxBinPt, fMaxBinPt);
582  fHistDeltaMCPtvsCommonEnergy2->GetXaxis()->SetTitle("Common energy 2 (%)");
583  fHistDeltaMCPtvsCommonEnergy2->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
584  fHistDeltaMCPtvsCommonEnergy2->GetZaxis()->SetTitle("counts");
586 
587  fHistDeltaMCPtvsArea1 = new TH2F("fHistDeltaMCPtvsArea1", "fHistDeltaMCPtvsArea1",
588  fNbins/2, 0, 1.5, 2*fNbins, -fMaxBinPt, fMaxBinPt);
589  fHistDeltaMCPtvsArea1->GetXaxis()->SetTitle("A_{jet,1}");
590  fHistDeltaMCPtvsArea1->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
591  fHistDeltaMCPtvsArea1->GetZaxis()->SetTitle("counts");
593 
594  fHistDeltaMCPtvsArea2 = new TH2F("fHistDeltaMCPtvsArea2", "fHistDeltaMCPtvsArea2",
595  fNbins/2, 0, 1.5, 2*fNbins, -fMaxBinPt, fMaxBinPt);
596  fHistDeltaMCPtvsArea2->GetXaxis()->SetTitle("A_{jet,2}");
597  fHistDeltaMCPtvsArea2->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
598  fHistDeltaMCPtvsArea2->GetZaxis()->SetTitle("counts");
600 
601  fHistDeltaMCPtvsDeltaArea = new TH2F("fHistDeltaMCPtvsDeltaArea", "fHistDeltaMCPtvsDeltaArea",
602  fNbins, -1.+1./fNbins, 1.+1./fNbins, 2*fNbins, -fMaxBinPt, fMaxBinPt);
603  fHistDeltaMCPtvsDeltaArea->GetXaxis()->SetTitle("#deltaA_{jet}");
604  fHistDeltaMCPtvsDeltaArea->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
605  fHistDeltaMCPtvsDeltaArea->GetZaxis()->SetTitle("counts");
607 
608  fHistJet1MCPtvsJet2Pt = new TH2F("fHistJet1MCPtvsJet2Pt", "fHistJet1MCPtvsJet2Pt",
610  fHistJet1MCPtvsJet2Pt->GetXaxis()->SetTitle("p_{T,1}^{MC}");
611  fHistJet1MCPtvsJet2Pt->GetYaxis()->SetTitle("p_{T,2}");
612  fHistJet1MCPtvsJet2Pt->GetZaxis()->SetTitle("counts");
614  }
615 }
616 
617 //________________________________________________________________________
619 {
620  // Allocate THnSparse histograms.
621 
622  TString title[25]= {""};
623  Int_t nbins[25] = {0};
624  Double_t min[25] = {0.};
625  Double_t max[25] = {0.};
626  Int_t dim = 0;
627 
628  title[dim] = "#phi";
629  nbins[dim] = fNbins/4;
630  min[dim] = 0;
631  max[dim] = 2*TMath::Pi()*(1 + 1./(nbins[dim]-1));
632  dim++;
633 
634  title[dim] = "#eta";
635  nbins[dim] = fNbins/4;
636  min[dim] = -1;
637  max[dim] = 1;
638  dim++;
639 
640  title[dim] = "p_{T}";
641  nbins[dim] = fNbins;
642  min[dim] = 0;
643  max[dim] = 250;
644  dim++;
645 
646  title[dim] = "A_{jet}";
647  nbins[dim] = fNbins/4;
648  min[dim] = 0;
649  max[dim] = 1.5;
650  dim++;
651 
652  if (fNEFAxis) {
653  title[dim] = "NEF";
654  nbins[dim] = 120;
655  min[dim] = 0.0;
656  max[dim] = 1.2;
657  dim++;
658  }
659 
660  if (fZAxis) {
661  title[dim] = "Z";
662  nbins[dim] = 120;
663  min[dim] = 0.0;
664  max[dim] = 1.2;
665  dim++;
666  }
667 
668  if (fFlavourZAxis) {
669  title[dim] = "z_{flavour}";
670  nbins[dim] = 100;
671  min[dim] = 0.0;
672  max[dim] = 2.0;
673  dim++;
674  }
675 
676  if (fFlavourPtAxis) {
677  title[dim] = "p_{T}^{D}";
678  nbins[dim] = fNbins/2;
679  min[dim] = 0;
680  max[dim] = 125;
681  dim++;
682  }
683 
684  title[dim] = "p_{T,particle}^{leading} (GeV/c)";
685  nbins[dim] = 120;
686  min[dim] = 0;
687  max[dim] = 120;
688  dim++;
689 
690  Int_t dim1 = dim, dim2 = dim;
691 
692  if (fIsJet1Rho) {
693  title[dim1] = "p_{T}^{corr}";
694  nbins[dim1] = fNbins*2;
695  min[dim1] = -250;
696  max[dim1] = 250;
697  dim1++;
698  }
699 
700  if (fIsEmbedded) {
701  title[dim1] = "p_{T}^{MC}";
702  nbins[dim1] = fNbins;
703  min[dim1] = 0;
704  max[dim1] = 250;
705  dim1++;
706  }
707 
708  fHistJets1 = new THnSparseD("fHistJets1","fHistJets1",dim1,nbins,min,max);
709  for (Int_t i = 0; i < dim1; i++)
710  fHistJets1->GetAxis(i)->SetTitle(title[i]);
711  fOutput->Add(fHistJets1);
712 
713  if (fIsJet2Rho) {
714  title[dim2] = "p_{T}^{corr}";
715  nbins[dim2] = fNbins*2;
716  min[dim2] = -250;
717  max[dim2] = 250;
718  dim2++;
719  }
720 
721  fHistJets2 = new THnSparseD("fHistJets2","fHistJets2",dim2,nbins,min,max);
722  for (Int_t i = 0; i < dim2; i++)
723  fHistJets2->GetAxis(i)->SetTitle(title[i]);
724  fOutput->Add(fHistJets2);
725 
726  // Matching
727 
728  dim = 0;
729 
730  title[dim] = "p_{T,1}";
731  nbins[dim] = fNbins;
732  min[dim] = 0;
733  max[dim] = 250;
734  dim++;
735 
736  title[dim] = "p_{T,2}";
737  nbins[dim] = fNbins;
738  min[dim] = 0;
739  max[dim] = 250;
740  dim++;
741 
742  title[dim] = "A_{jet,1}";
743  nbins[dim] = fNbins/4;
744  min[dim] = 0;
745  max[dim] = 1.5;
746  dim++;
747 
748  title[dim] = "A_{jet,2}";
749  nbins[dim] = fNbins/4;
750  min[dim] = 0;
751  max[dim] = 1.5;
752  dim++;
753 
754  title[dim] = "distance";
755  nbins[dim] = fNbins/2;
756  min[dim] = 0;
757  max[dim] = 1.2;
758  dim++;
759 
760  title[dim] = "CE1";
761  nbins[dim] = fNbins/2;
762  min[dim] = 0;
763  max[dim] = 1.2;
764  dim++;
765 
766  title[dim] = "CE2";
767  nbins[dim] = fNbins/2;
768  min[dim] = 0;
769  max[dim] = 1.2;
770  dim++;
771 
772  title[dim] = "p_{T,particle,1}^{leading} (GeV/c)";
773  nbins[dim] = 120;
774  min[dim] = 0;
775  max[dim] = 120;
776  dim++;
777 
778  title[dim] = "p_{T,particle,2}^{leading} (GeV/c)";
779  nbins[dim] = 120;
780  min[dim] = 0;
781  max[dim] = 120;
782  dim++;
783 
784  if (fDeltaPtAxis) {
785  title[dim] = "#deltaA_{jet}";
786  nbins[dim] = fNbins/2;
787  min[dim] = -1;
788  max[dim] = 1;
789  dim++;
790 
791  title[dim] = "#deltap_{T}";
792  nbins[dim] = fNbins*2;
793  min[dim] = -250;
794  max[dim] = 250;
795  dim++;
796  }
797  if (fIsJet1Rho) {
798  title[dim] = "p_{T,1}^{corr}";
799  nbins[dim] = fNbins*2;
800  min[dim] = -250;
801  max[dim] = 250;
802  dim++;
803  }
804  if (fIsJet2Rho) {
805  title[dim] = "p_{T,2}^{corr}";
806  nbins[dim] = fNbins*2;
807  min[dim] = -250;
808  max[dim] = 250;
809  dim++;
810  }
811  if (fDeltaPtAxis && (fIsJet1Rho || fIsJet2Rho)) {
812  title[dim] = "#deltap_{T}^{corr}";
813  nbins[dim] = fNbins*2;
814  min[dim] = -250;
815  max[dim] = 250;
816  dim++;
817  }
818  if (fDeltaEtaDeltaPhiAxis) {
819  title[dim] = "#delta#eta";
820  nbins[dim] = fNbins/2;
821  min[dim] = -1;
822  max[dim] = 1;
823  dim++;
824 
825  title[dim] = "#delta#phi";
826  nbins[dim] = fNbins/2;
827  min[dim] = -TMath::Pi()/2;
828  max[dim] = TMath::Pi()*3/2;
829  dim++;
830  }
831  if (fIsEmbedded) {
832  title[dim] = "p_{T,1}^{MC}";
833  nbins[dim] = fNbins;
834  min[dim] = 0;
835  max[dim] = 250;
836  dim++;
837 
838  if (fDeltaPtAxis) {
839  title[dim] = "#deltap_{T}^{MC}";
840  nbins[dim] = fNbins*2;
841  min[dim] = -250;
842  max[dim] = 250;
843  dim++;
844  }
845  }
846 
847  if (fNEFAxis) {
848  title[dim] = "NEF_{1}";
849  nbins[dim] = 120;
850  min[dim] = 0.0;
851  max[dim] = 1.2;
852  dim++;
853 
854  title[dim] = "NEF_{2}";
855  nbins[dim] = 120;
856  min[dim] = 0.0;
857  max[dim] = 1.2;
858  dim++;
859  }
860 
861  if (fZAxis) {
862  title[dim] = "Z_{1}";
863  nbins[dim] = 120;
864  min[dim] = 0.0;
865  max[dim] = 1.2;
866  dim++;
867 
868  title[dim] = "Z_{2}";
869  nbins[dim] = 120;
870  min[dim] = 0.0;
871  max[dim] = 1.2;
872  dim++;
873  }
874 
875  if (fFlavourZAxis) {
876  title[dim] = "z_{flavour,1}";
877  nbins[dim] = 100;
878  min[dim] = 0.0;
879  max[dim] = 2.0;
880  dim++;
881 
882  title[dim] = "z_{flavour,2}";
883  nbins[dim] = 100;
884  min[dim] = 0.0;
885  max[dim] = 2.0;
886  dim++;
887  }
888 
889  if (fFlavourPtAxis) {
890  title[dim] = "p_{T,1}^{D}";
891  nbins[dim] = fNbins/2;
892  min[dim] = 0;
893  max[dim] = 125;
894  dim++;
895 
896  title[dim] = "p_{T,2}^{D}";
897  nbins[dim] = fNbins/2;
898  min[dim] = 0;
899  max[dim] = 125;
900  dim++;
901  }
902 
903  if (fZgAxis) {
904  title[dim] = "Z_{g,1}";
905  nbins[dim] = 20;
906  min[dim] = 0.0;
907  max[dim] = 1.0;
908  dim++;
909  title[dim] = "Z_{g,2}";
910  nbins[dim] = 20;
911  min[dim] = 0.0;
912  max[dim] = 1.0;
913  dim++;
914  }
915 
916  if (fdRAxis) {
917  title[dim] = "dR_{1}";
918  nbins[dim] = 40;
919  min[dim] = 0.0;
920  max[dim] = 0.5;
921  dim++;
922  title[dim] = "dR_{2}";
923  nbins[dim] = 40;
924  min[dim] = 0.0;
925  max[dim] = 0.5;
926  dim++;
927  }
928 
929  if (fPtgAxis) {
930  title[dim] = "p_{T,g,1}";
931  nbins[dim] = 16;
932  min[dim] = 0.0;
933  max[dim] = 160.0;
934  dim++;
935  title[dim] = "p_{T,g,2}";
936  nbins[dim] = 16;
937  min[dim] = 0.0;
938  max[dim] = 160.0;
939  dim++;
940  }
941 
942  fHistMatching = new THnSparseD("fHistMatching","fHistMatching",dim,nbins,min,max);
943 
944  for (Int_t i = 0; i < dim; i++)
945  fHistMatching->GetAxis(i)->SetTitle(title[i]);
946 
947  fOutput->Add(fHistMatching);
948 }
949 
950 //________________________________________________________________________
952 {
953  // Create user objects.
954 
956 
957  AliJetContainer *jets1 = static_cast<AliJetContainer*>(fJetCollArray.At(0));
958  AliJetContainer *jets2 = static_cast<AliJetContainer*>(fJetCollArray.At(1));
959 
960  if (!jets1 || !jets2) return;
961 
962  if (jets1->GetRhoName().IsNull()) fIsJet1Rho = kFALSE;
963  else fIsJet1Rho = kTRUE;
964  if (jets2->GetRhoName().IsNull()) fIsJet2Rho = kFALSE;
965  else fIsJet2Rho = kTRUE;
966 
967  fHistRejectionReason1 = new TH2F("fHistRejectionReason1", "fHistRejectionReason1", 32, 0, 32, 100, 0, 250);
968  fHistRejectionReason1->GetXaxis()->SetTitle("Rejection reason");
969  fHistRejectionReason1->GetYaxis()->SetTitle("p_{T,jet} (GeV/c)");
970  fHistRejectionReason1->GetZaxis()->SetTitle("counts");
973 
974  fHistRejectionReason2 = new TH2F("fHistRejectionReason2", "fHistRejectionReason2", 32, 0, 32, 100, 0, 250);
975  fHistRejectionReason2->GetXaxis()->SetTitle("Rejection reason");
976  fHistRejectionReason2->GetYaxis()->SetTitle("p_{T,jet} (GeV/c)");
977  fHistRejectionReason2->GetZaxis()->SetTitle("counts");
980 
981  if (fHistoType==0)
982  AllocateTH2();
983  else
985 
986  PostData(1, fOutput); // Post data for ALL output slots > 0 here, to get at least an empty histogram
987 }
988 
989 //________________________________________________________________________
991 {
992  AliJetContainer* jets = GetJetContainer(Set-1);
993 
994  AliTLorentzVector leadPart;
995  jets->GetLeadingHadronMomentum(leadPart, jet);
996  Double_t zleading = GetParallelFraction(leadPart.Vect(), jet);
997  if (zleading == 1 || (zleading > 1 && zleading - 1 < 1e-3)) zleading = 0.999; // so that it will contribute to the bin 0.9-1 rather than 1-1.1
998 
999  Double_t corrpt = jet->Pt() - jets->GetRhoVal() * jet->Area();
1000  Double_t zflavour = 0;
1001  Double_t ptflavour = 0;
1002  AliVParticle* hftrack = jet->GetFlavourTrack();
1003  if (hftrack) {
1004  zflavour = GetParallelFraction(hftrack, jet);
1005  ptflavour = hftrack->Pt();
1006 
1007  if (zflavour == 1 || (zflavour > 1 && zflavour - 1 < 1e-3)) zflavour = 0.999; // so that it will contribute to the bin 0.9-1 rather than 1-1.1
1008  }
1009 
1010  if (fHistoType==1) {
1011  THnSparse *histo = 0;
1012  if (Set==1) {
1013  histo = fHistJets1;
1014  }
1015  else if (Set==2) {
1016  histo = fHistJets2;
1017  }
1018 
1019  if (!histo) return;
1020 
1021  Double_t contents[20]={0};
1022 
1023  for (Int_t i = 0; i < histo->GetNdimensions(); i++) {
1024  TString title(histo->GetAxis(i)->GetTitle());
1025  if (title=="#phi")
1026  contents[i] = jet->Phi();
1027  else if (title=="#eta")
1028  contents[i] = jet->Eta();
1029  else if (title=="p_{T}")
1030  contents[i] = jet->Pt();
1031  else if (title=="A_{jet}")
1032  contents[i] = jet->Area();
1033  else if (title=="NEF")
1034  contents[i] = jet->NEF();
1035  else if (title=="Z")
1036  contents[i] = zleading;
1037  else if (title=="p_{T}^{corr}")
1038  contents[i] = corrpt;
1039  else if (title=="p_{T}^{MC}")
1040  contents[i] = jet->MCPt();
1041  else if (title=="p_{T,particle}^{leading} (GeV/c)")
1042  contents[i] = leadPart.Pt();
1043  else if (title=="z_{flavour}")
1044  contents[i] = zflavour;
1045  else if (title=="p_{T}^{D}")
1046  contents[i] = ptflavour;
1047  else
1048  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
1049  }
1050 
1051  histo->Fill(contents);
1052  }
1053  else {
1054  if (Set == 1) {
1055  fHistJets1PtArea->Fill(jet->Area(), jet->Pt());
1056  fHistJets1PhiEta->Fill(jet->Eta(), jet->Phi());
1057  fHistJets1ZvsPt->Fill(zleading, jet->Pt());
1058  fHistJets1NEFvsPt->Fill(jet->NEF(), jet->Pt());
1059  fHistJets1CEFvsCEFPt->Fill(1-jet->NEF(), (1-jet->NEF())*jet->Pt());
1060  if (fIsJet1Rho)
1061  fHistJets1CorrPtArea->Fill(jet->Area(), corrpt);
1062  }
1063  else if (Set == 2) {
1064  fHistJets2PtArea->Fill(jet->Area(), jet->Pt());
1065  fHistJets2PhiEta->Fill(jet->Eta(), jet->Phi());
1066  fHistJets2ZvsPt->Fill(zleading, jet->Pt());
1067  fHistJets2NEFvsPt->Fill(jet->NEF(), jet->Pt());
1068  fHistJets2CEFvsCEFPt->Fill(1-jet->NEF(), (1-jet->NEF())*jet->Pt());
1069  if (fIsJet2Rho)
1070  fHistJets2CorrPtArea->Fill(jet->Area(), corrpt);
1071  }
1072  }
1073 }
1074 
1075 //________________________________________________________________________
1077 {
1078  AliJetContainer* jets1 = GetJetContainer(0);
1079  AliJetContainer* jets2 = GetJetContainer(1);
1080 
1081  /*
1082  Printf("Detector level jet");
1083  jet1->Print();
1084 
1085  jet1->PrintConstituents(jets1->GetParticleContainer() != 0 ? jets1->GetParticleContainer()->GetArray() : 0,
1086  jets1->GetClusterContainer() != 0 ? jets1->GetClusterContainer()->GetArray() : 0);
1087 
1088  Printf("Matched with particle level jet");
1089  jet2->Print();
1090  jet2->PrintConstituents(jets2->GetParticleContainer() != 0 ? jets2->GetParticleContainer()->GetArray() : 0,
1091  jets2->GetClusterContainer() != 0 ? jets2->GetClusterContainer()->GetArray() : 0);
1092  */
1093 
1094  AliTLorentzVector leadPart1;
1095  jets1->GetLeadingHadronMomentum(leadPart1, jet1);
1096  Double_t zleading1 = GetParallelFraction(leadPart1.Vect(), jet1);
1097  if (zleading1 == 1 || (zleading1 > 1 && zleading1 - 1 < 1e-3)) zleading1 = 0.999; // so that it will contribute to the bin 0.9-1 rather than 1-1.1
1098 
1099  Double_t corrpt1 = jet1->Pt() - jets1->GetRhoVal() * jet1->Area();
1100  Double_t zflavour1 = 0;
1101  Double_t ptflavour1 = 0;
1102  AliVParticle* hftrack1 = jet1->GetFlavourTrack();
1103  if (hftrack1) {
1104  zflavour1 = GetParallelFraction(hftrack1, jet1);
1105  ptflavour1 = hftrack1->Pt();
1106 
1107  if (zflavour1 == 1 || (zflavour1 > 1 && zflavour1 - 1 < 1e-3)) zflavour1 = 0.999; // so that it will contribute to the bin 0.9-1 rather than 1-1.1
1108  }
1109 
1110 
1111  AliTLorentzVector leadPart2;
1112  jets2->GetLeadingHadronMomentum(leadPart2, jet2);
1113  Double_t zleading2 = GetParallelFraction(leadPart2.Vect(), jet2);
1114  if (zleading2 == 1 || (zleading2 > 1 && zleading2 - 1 < 1e-3)) zleading2 = 0.999; // so that it will contribute to the bin 0.9-1 rather than 1-1.1
1115 
1116  Double_t corrpt2 = jet2->Pt() - jets2->GetRhoVal() * jet2->Area();
1117  Double_t zflavour2 = 0;
1118  Double_t ptflavour2 = 0;
1119  AliVParticle* hftrack2 = jet2->GetFlavourTrack();
1120  if (hftrack2) {
1121  zflavour2 = GetParallelFraction(hftrack2, jet2);
1122  ptflavour2 = hftrack2->Pt();
1123 
1124  if (zflavour2 == 1 || (zflavour2 > 1 && zflavour2 - 1 < 1e-3)) zflavour2 = 0.999; // so that it will contribute to the bin 0.9-1 rather than 1-1.1
1125  }
1126 
1127  if (fHistoType==1) {
1128  Double_t contents[20]={0};
1129 
1130  for (Int_t i = 0; i < fHistMatching->GetNdimensions(); i++) {
1131  TString title(fHistMatching->GetAxis(i)->GetTitle());
1132  if (title=="p_{T,1}")
1133  contents[i] = jet1->Pt();
1134  else if (title=="p_{T,2}")
1135  contents[i] = jet2->Pt();
1136  else if (title=="A_{jet,1}")
1137  contents[i] = jet1->Area();
1138  else if (title=="A_{jet,2}")
1139  contents[i] = jet2->Area();
1140  else if (title=="distance")
1141  contents[i] = d;
1142  else if (title=="CE1")
1143  contents[i] = CE1;
1144  else if (title=="CE2")
1145  contents[i] = CE2;
1146  else if (title=="#deltaA_{jet}")
1147  contents[i] = jet1->Area()-jet2->Area();
1148  else if (title=="#deltap_{T}")
1149  contents[i] = jet1->Pt()-jet2->Pt();
1150  else if (title=="#delta#eta")
1151  contents[i] = jet1->Eta()-jet2->Eta();
1152  else if (title=="#delta#phi")
1153  contents[i] = jet1->Phi()-jet2->Phi();
1154  else if (title=="p_{T,1}^{corr}")
1155  contents[i] = corrpt1;
1156  else if (title=="p_{T,2}^{corr}")
1157  contents[i] = corrpt2;
1158  else if (title=="#deltap_{T}^{corr}")
1159  contents[i] = corrpt1-corrpt2;
1160  else if (title=="p_{T,1}^{MC}")
1161  contents[i] = jet1->MCPt();
1162  else if (title=="#deltap_{T}^{MC}")
1163  contents[i] = jet1->MCPt()-jet2->Pt();
1164  else if (title=="NEF_{1}")
1165  contents[i] = jet1->NEF();
1166  else if (title=="NEF_{2}")
1167  contents[i] = jet2->NEF();
1168  else if (title=="Z_{1}")
1169  contents[i] = zleading1;
1170  else if (title=="Z_{2}")
1171  contents[i] = zleading2;
1172  else if (title=="p_{T,particle,1}^{leading} (GeV/c)")
1173  contents[i] = leadPart1.Pt();
1174  else if (title=="p_{T,particle,2}^{leading} (GeV/c)")
1175  contents[i] = leadPart2.Pt();
1176  else if (title=="z_{flavour,1}")
1177  contents[i] = zflavour1;
1178  else if (title=="z_{flavour,2}")
1179  contents[i] = zflavour2;
1180  else if (title=="p_{T,1}^{D}")
1181  contents[i] = ptflavour1;
1182  else if (title=="p_{T,2}^{D}")
1183  contents[i] = ptflavour2;
1184  else if (title=="Z_{g,1}")
1185  contents[i] = jet1->GetShapeProperties()->GetSoftDropZg();
1186  else if (title=="Z_{g,2}")
1187  contents[i] = jet2->GetShapeProperties()->GetSoftDropZg();
1188  else if (title=="dR_{1}")
1189  contents[i] = jet1->GetShapeProperties()->GetSoftDropdR();
1190  else if (title=="dR_{2}")
1191  contents[i] = jet2->GetShapeProperties()->GetSoftDropdR();
1192  else if (title=="p_{T,g,1}")
1193  contents[i] = ( jet1->GetShapeProperties()->GetSoftDropPtfrac() )*( jet1->Pt() );
1194  else if (title=="p_{T,g,2}")
1195  contents[i] = ( jet2->GetShapeProperties()->GetSoftDropPtfrac() )*( jet2->Pt() );
1196  else
1197  AliWarning(Form("Unable to fill dimension %s!",title.Data()));
1198  }
1199 
1200  fHistMatching->Fill(contents);
1201  }
1202  else {
1203  fHistCommonEnergy1vsJet1Pt->Fill(CE1, jet1->Pt());
1204  fHistCommonEnergy2vsJet2Pt->Fill(CE2, jet2->Pt());
1205 
1206  fHistDistancevsJet1Pt->Fill(d, jet1->Pt());
1207  fHistDistancevsJet2Pt->Fill(d, jet2->Pt());
1208 
1209  fHistDistancevsCommonEnergy1->Fill(d, CE1);
1210  fHistDistancevsCommonEnergy2->Fill(d, CE2);
1211  fHistCommonEnergy1vsCommonEnergy2->Fill(CE1, CE2);
1212 
1213  fHistDeltaEtaDeltaPhi->Fill(jet1->Eta()-jet2->Eta(),jet1->Phi()-jet2->Phi());
1214 
1215  fHistJet2PtOverJet1PtvsJet2Pt->Fill(jet2->Pt(), jet2->Pt() / jet1->Pt());
1216  fHistJet1PtOverJet2PtvsJet1Pt->Fill(jet1->Pt(), jet1->Pt() / jet2->Pt());
1217 
1218  Double_t dpt = jet1->Pt() - jet2->Pt();
1219  fHistDeltaPtvsJet1Pt->Fill(jet1->Pt(), dpt);
1220  fHistDeltaPtvsJet2Pt->Fill(jet2->Pt(), dpt);
1221  fHistDeltaPtOverJet1PtvsJet1Pt->Fill(jet1->Pt(), dpt/jet1->Pt());
1222  fHistDeltaPtOverJet2PtvsJet2Pt->Fill(jet2->Pt(), dpt/jet2->Pt());
1223 
1224  fHistDeltaPtvsDistance->Fill(d, dpt);
1225  fHistDeltaPtvsCommonEnergy1->Fill(CE1, dpt);
1226  fHistDeltaPtvsCommonEnergy2->Fill(CE2, dpt);
1227 
1228  fHistDeltaPtvsArea1->Fill(jet1->Area(), dpt);
1229  fHistDeltaPtvsArea2->Fill(jet2->Area(), dpt);
1230 
1231  Double_t darea = jet1->Area() - jet2->Area();
1232  fHistDeltaPtvsDeltaArea->Fill(darea, dpt);
1233 
1234  fHistJet1PtvsJet2Pt->Fill(jet1->Pt(), jet2->Pt());
1235 
1236  if (fIsJet1Rho || fIsJet2Rho) {
1237  Double_t dcorrpt = corrpt1 - corrpt2;
1238  fHistDeltaCorrPtvsJet1CorrPt->Fill(corrpt1, dcorrpt);
1239  fHistDeltaCorrPtvsJet2CorrPt->Fill(corrpt2, dcorrpt);
1240  fHistDeltaCorrPtOverJet1CorrPtvsJet1CorrPt->Fill(corrpt1, dcorrpt/corrpt1);
1241  fHistDeltaCorrPtOverJet2CorrPtvsJet2CorrPt->Fill(corrpt2, dcorrpt/corrpt2);
1242  fHistDeltaCorrPtvsDistance->Fill(d, dcorrpt);
1243  fHistDeltaCorrPtvsCommonEnergy1->Fill(CE1, dcorrpt);
1244  fHistDeltaCorrPtvsCommonEnergy2->Fill(CE2, dcorrpt);
1245  fHistDeltaCorrPtvsArea1->Fill(jet1->Area(), dcorrpt);
1246  fHistDeltaCorrPtvsArea2->Fill(jet2->Area(), dcorrpt);
1247  fHistDeltaCorrPtvsDeltaArea->Fill(darea, dcorrpt);
1248  fHistJet1CorrPtvsJet2CorrPt->Fill(corrpt1, corrpt2);
1249  }
1250 
1251  if (fIsEmbedded) {
1252  Double_t dmcpt = jet1->MCPt() - jet2->Pt();
1253  fHistDeltaMCPtvsJet1MCPt->Fill(jet1->MCPt(), dmcpt);
1254  fHistDeltaMCPtvsJet2Pt->Fill(jet2->MCPt(), dmcpt);
1255  fHistDeltaMCPtOverJet1MCPtvsJet1MCPt->Fill(jet1->MCPt(), dmcpt/jet1->MCPt());
1256  fHistDeltaMCPtOverJet2PtvsJet2Pt->Fill(jet2->Pt(), dmcpt/jet2->Pt());
1257  fHistDeltaMCPtvsDistance->Fill(d, dmcpt);
1258  fHistDeltaMCPtvsCommonEnergy1->Fill(CE1, dmcpt);
1259  fHistDeltaMCPtvsCommonEnergy2->Fill(CE2, dmcpt);
1260  fHistDeltaMCPtvsArea1->Fill(jet1->Area(), dmcpt);
1261  fHistDeltaMCPtvsArea2->Fill(jet2->Area(), dmcpt);
1262  fHistDeltaMCPtvsDeltaArea->Fill(darea, dmcpt);
1263  fHistJet1MCPtvsJet2Pt->Fill(jet1->MCPt(), jet2->Pt());
1264  }
1265  }
1266 }
1267 
1268 //________________________________________________________________________
1270 {
1271  // Execute once.
1272 
1274 
1275  AliJetContainer *jets1 = static_cast<AliJetContainer*>(fJetCollArray.At(0));
1276  AliJetContainer *jets2 = static_cast<AliJetContainer*>(fJetCollArray.At(1));
1277 
1278  if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray()) return;
1279 
1280  if (fMatching == kMCLabel && (!jets2->GetIsParticleLevel() || jets1->GetIsParticleLevel())) {
1281  if (jets1->GetIsParticleLevel() == jets2->GetIsParticleLevel()) {
1282  AliWarning("Changing matching type from MC label to same collection...");
1284  }
1285  else {
1286  AliWarning("Changing matching type from MC label to geometrical...");
1288  }
1289  }
1290  else if (fMatching == kSameCollections && jets1->GetIsParticleLevel() != jets2->GetIsParticleLevel()) {
1291  if (jets2->GetIsParticleLevel() && !jets1->GetIsParticleLevel()) {
1292  AliWarning("Changing matching type from same collection to MC label...");
1293  fMatching = kMCLabel;
1294  }
1295  else {
1296  AliWarning("Changing matching type from same collection to geometrical...");
1298  }
1299  }
1300 }
1301 
1302 //________________________________________________________________________
1304 {
1305  // Find the closest jets
1306 
1307  if (fMatching == kNoMatching)
1308  return kTRUE;
1309  else
1310  return DoJetMatching();
1311 }
1312 
1313 //________________________________________________________________________
1315 {
1316  AliJetContainer *jets1 = static_cast<AliJetContainer*>(fJetCollArray.At(0));
1317  AliJetContainer *jets2 = static_cast<AliJetContainer*>(fJetCollArray.At(1));
1318 
1319  if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray()) return kFALSE;
1320 
1321  DoJetLoop();
1322 
1323  AliEmcalJet* jet1 = 0;
1324 
1325  jets1->ResetCurrentID();
1326  while ((jet1 = jets1->GetNextJet())) {
1327 
1328  AliEmcalJet *jet2 = jet1->ClosestJet();
1329 
1330  if (!jet2) continue;
1331  if (jet2->ClosestJet() != jet1) continue;
1332  if (jet1->ClosestJetDistance() > fMatchingPar1 || jet2->ClosestJetDistance() > fMatchingPar2) continue;
1333 
1334  // Matched jet found
1337  AliDebug(2,Form("Found matching: jet1 pt = %f, eta = %f, phi = %f, jet2 pt = %f, eta = %f, phi = %f",
1338  jet1->Pt(), jet1->Eta(), jet1->Phi(),
1339  jet2->Pt(), jet2->Eta(), jet2->Phi()));
1340  }
1341 
1342  return kTRUE;
1343 }
1344 
1345 //________________________________________________________________________
1347 {
1348  // Do the jet loop.
1349 
1350  AliJetContainer *jets1 = static_cast<AliJetContainer*>(fJetCollArray.At(0));
1351  AliJetContainer *jets2 = static_cast<AliJetContainer*>(fJetCollArray.At(1));
1352 
1353  if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray()) return;
1354 
1355  AliEmcalJet* jet1 = 0;
1356  AliEmcalJet* jet2 = 0;
1357 
1358  jets2->ResetCurrentID();
1359  while ((jet2 = jets2->GetNextJet())) jet2->ResetMatching();
1360 
1361  jets1->ResetCurrentID();
1362  while ((jet1 = jets1->GetNextJet())) {
1363  jet1->ResetMatching();
1364 
1365  if (jet1->MCPt() < fMinJetMCPt) continue;
1366 
1367  jets2->ResetCurrentID();
1368  while ((jet2 = jets2->GetNextJet())) {
1369  SetMatchingLevel(jet1, jet2, fMatching);
1370  } // jet2 loop
1371  } // jet1 loop
1372 }
1373 
1374 //________________________________________________________________________
1376 {
1377  d = jet1->DeltaR(jet2);
1378 }
1379 
1380 //________________________________________________________________________
1382 {
1383  AliJetContainer *jets1 = static_cast<AliJetContainer*>(fJetCollArray.At(0));
1384  AliJetContainer *jets2 = static_cast<AliJetContainer*>(fJetCollArray.At(1));
1385 
1386  if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray()) return;
1387 
1388  AliParticleContainer *tracks1 = jets1->GetParticleContainer();
1389  AliClusterContainer *clusters1 = jets1->GetClusterContainer();
1390  AliParticleContainer *tracks2 = jets2->GetParticleContainer();
1391 
1392  // d1 and d2 represent the matching level: 0 = maximum level of matching, 1 = the two jets are completely unrelated
1393  d1 = jet1->Pt();
1394  d2 = jet2->Pt();
1395  Double_t totalPt1 = d1; // the total pt of the reconstructed jet will be cleaned from the background
1396 
1397  // remove completely tracks that are not MC particles (label == 0)
1398  if (tracks1 && tracks1->GetArray()) {
1399  for (Int_t iTrack = 0; iTrack < jet1->GetNumberOfTracks(); iTrack++) {
1400  AliVParticle *track = jet1->TrackAt(iTrack,tracks1->GetArray());
1401  if (!track) {
1402  AliWarning(Form("Could not find track %d!", iTrack));
1403  continue;
1404  }
1405 
1406  Int_t MClabel = TMath::Abs(track->GetLabel());
1407  MClabel -= fMCLabelShift;
1408  if (MClabel != 0) continue;
1409 
1410  // this is not a MC particle; remove it completely
1411  AliDebug(3,Form("Track %d (pT = %f) is not a MC particle (MClabel = %d)!",iTrack,track->Pt(),MClabel));
1412  totalPt1 -= track->Pt();
1413  d1 -= track->Pt();
1414  }
1415  }
1416 
1417  // remove completely clusters that are not MC particles (label == 0)
1418  if (fUseCellsToMatch && fCaloCells) {
1419  for (Int_t iClus = 0; iClus < jet1->GetNumberOfClusters(); iClus++) {
1420  AliVCluster *clus = jet1->ClusterAt(iClus,clusters1->GetArray());
1421  if (!clus) {
1422  AliWarning(Form("Could not find cluster %d!", iClus));
1423  continue;
1424  }
1425  AliTLorentzVector part;
1426  clus->GetMomentum(part, fVertex);
1427 
1428  for (Int_t iCell = 0; iCell < clus->GetNCells(); iCell++) {
1429  Int_t cellId = clus->GetCellAbsId(iCell);
1430  Double_t cellFrac = clus->GetCellAmplitudeFraction(iCell);
1431 
1432  Int_t MClabel = TMath::Abs(fCaloCells->GetCellMCLabel(cellId));
1433  MClabel -= fMCLabelShift;
1434  if (MClabel != 0) continue;
1435 
1436  // this is not a MC particle; remove it completely
1437  AliDebug(3,Form("Cell %d (frac = %f) is not a MC particle (MClabel = %d)!",iCell,cellFrac,MClabel));
1438  totalPt1 -= part.Pt() * cellFrac;
1439  d1 -= part.Pt() * cellFrac;
1440  }
1441  }
1442  }
1443  else {
1444  for (Int_t iClus = 0; iClus < jet1->GetNumberOfClusters(); iClus++) {
1445  AliVCluster *clus = jet1->ClusterAt(iClus,clusters1->GetArray());
1446  if (!clus) {
1447  AliWarning(Form("Could not find cluster %d!", iClus));
1448  continue;
1449  }
1450  TLorentzVector part;
1451  clus->GetMomentum(part, fVertex);
1452 
1453  Int_t MClabel = TMath::Abs(clus->GetLabel());
1454  MClabel -= fMCLabelShift;
1455  if (MClabel != 0) continue;
1456 
1457  // this is not a MC particle; remove it completely
1458  AliDebug(3,Form("Cluster %d (pT = %f) is not a MC particle (MClabel = %d)!",iClus,part.Pt(),MClabel));
1459  totalPt1 -= part.Pt();
1460  d1 -= part.Pt();
1461  }
1462  }
1463 
1464  for (Int_t iTrack2 = 0; iTrack2 < jet2->GetNumberOfTracks(); iTrack2++) {
1465  Bool_t track2Found = kFALSE;
1466  Int_t index2 = jet2->TrackAt(iTrack2);
1467 
1468  // now look for common particles in the track array
1469  for (Int_t iTrack = 0; iTrack < jet1->GetNumberOfTracks(); iTrack++) {
1470  AliVParticle *track = jet1->TrackAt(iTrack,tracks1->GetArray());
1471  if (!track) {
1472  AliWarning(Form("Could not find track %d!", iTrack));
1473  continue;
1474  }
1475  Int_t MClabel = TMath::Abs(track->GetLabel());
1476  MClabel -= fMCLabelShift;
1477  if (MClabel <= 0) continue;
1478 
1479  Int_t index = -1;
1480  index = tracks2->GetIndexFromLabel(MClabel);
1481  if (index < 0) {
1482  AliDebug(2,Form("Track %d (pT = %f) does not have an associated MC particle (MClabel = %d)!",iTrack,track->Pt(),MClabel));
1483  continue;
1484  }
1485 
1486  if (index2 != index) continue;
1487 
1488  // found common particle
1489  d1 -= track->Pt();
1490 
1491  if (!track2Found) {
1492  AliVParticle *MCpart = tracks2->GetParticle(index2);
1493  AliDebug(3,Form("Track %d (pT = %f, eta = %f, phi = %f) is associated with the MC particle %d (pT = %f, eta = %f, phi = %f)!",
1494  iTrack,track->Pt(),track->Eta(),track->Phi(),MClabel,MCpart->Pt(),MCpart->Eta(),MCpart->Phi()));
1495  d2 -= MCpart->Pt();
1496  }
1497 
1498  track2Found = kTRUE;
1499  }
1500 
1501  // now look for common particles in the cluster array
1502  if (fUseCellsToMatch && fCaloCells) { // if the cell colection is available, look for cells with a matched MC particle
1503  for (Int_t iClus = 0; iClus < jet1->GetNumberOfClusters(); iClus++) {
1504  AliVCluster *clus = jet1->ClusterAt(iClus,fCaloClusters);
1505  if (!clus) {
1506  AliWarning(Form("Could not find cluster %d!", iClus));
1507  continue;
1508  }
1509  AliTLorentzVector part;
1510  clus->GetMomentum(part, fVertex);
1511 
1512  for (Int_t iCell = 0; iCell < clus->GetNCells(); iCell++) {
1513  Int_t cellId = clus->GetCellAbsId(iCell);
1514  Double_t cellFrac = clus->GetCellAmplitudeFraction(iCell);
1515 
1516  Int_t MClabel = TMath::Abs(fCaloCells->GetCellMCLabel(cellId));
1517  MClabel -= fMCLabelShift;
1518  if (MClabel <= 0) continue;
1519 
1520  Int_t index1 = -1;
1521  index1 = tracks2->GetIndexFromLabel(MClabel);
1522  if (index1 < 0) {
1523  AliDebug(3,Form("Cell %d (frac = %f) does not have an associated MC particle (MClabel = %d)!",iCell,cellFrac,MClabel));
1524  continue;
1525  }
1526 
1527  if (index2 != index1) continue;
1528 
1529  // found common particle
1530  d1 -= part.Pt() * cellFrac;
1531 
1532  if (!track2Found) { // only if it is not already found among charged tracks (charged particles are most likely already found)
1533  AliVParticle *MCpart = tracks2->GetParticle(index2);
1534  AliDebug(3,Form("Cell %d belonging to cluster %d (pT = %f, eta = %f, phi = %f) is associated with the MC particle %d (pT = %f, eta = %f, phi = %f)!",
1535  iCell,iClus,part.Pt(),part.Eta(),part.Phi_0_2pi(),MClabel,MCpart->Pt(),MCpart->Eta(),MCpart->Phi()));
1536  d2 -= MCpart->Pt() * cellFrac;
1537  }
1538 
1539  track2Found = kTRUE;
1540  }
1541  }
1542  }
1543  else { //otherwise look for the first contributor to the cluster, and if matched to a MC label remove it
1544  for (Int_t iClus = 0; iClus < jet1->GetNumberOfClusters(); iClus++) {
1545  AliVCluster *clus = jet1->ClusterAt(iClus,fCaloClusters);
1546  if (!clus) {
1547  AliWarning(Form("Could not find cluster %d!", iClus));
1548  continue;
1549  }
1550  AliTLorentzVector part;
1551  clus->GetMomentum(part, fVertex);
1552 
1553  Int_t MClabel = TMath::Abs(clus->GetLabel());
1554  MClabel -= fMCLabelShift;
1555  if (MClabel <= 0) continue;
1556 
1557  Int_t index = -1;
1558  index = tracks2->GetIndexFromLabel(MClabel);
1559 
1560  if (index < 0) {
1561  AliDebug(3,Form("Cluster %d (pT = %f) does not have an associated MC particle (MClabel = %d)!",iClus,part.Pt(),MClabel));
1562  continue;
1563  }
1564 
1565  if (index2 != index) continue;
1566 
1567  // found common particle
1568  d1 -= part.Pt();
1569 
1570  if (!track2Found) { // only if it is not already found among charged tracks (charged particles are most likely already found)
1571  AliVParticle *MCpart = tracks2->GetParticle(index2);
1572  AliDebug(3,Form("Cluster %d (pT = %f, eta = %f, phi = %f) is associated with the MC particle %d (pT = %f, eta = %f, phi = %f)!",
1573  iClus,part.Pt(),part.Eta(),part.Phi_0_2pi(),MClabel,MCpart->Pt(),MCpart->Eta(),MCpart->Phi()));
1574 
1575  d2 -= MCpart->Pt();
1576  }
1577 
1578  track2Found = kTRUE;
1579  }
1580  }
1581  }
1582 
1583  if (d1 < 0)
1584  d1 = 0;
1585 
1586  if (d2 < 0)
1587  d2 = 0;
1588 
1589  if (totalPt1 < 1)
1590  d1 = -1;
1591  else
1592  d1 /= totalPt1;
1593 
1594  if (jet2->Pt() < 1)
1595  d2 = -1;
1596  else
1597  d2 /= jet2->Pt();
1598 }
1599 
1600 //________________________________________________________________________
1602 {
1603  AliJetContainer *jets1 = static_cast<AliJetContainer*>(fJetCollArray.At(0));
1604  AliJetContainer *jets2 = static_cast<AliJetContainer*>(fJetCollArray.At(1));
1605 
1606  if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray()) return;
1607 
1608  AliParticleContainer *tracks1 = jets1->GetParticleContainer();
1609  AliClusterContainer *clusters1 = jets1->GetClusterContainer();
1610  AliParticleContainer *tracks2 = jets2->GetParticleContainer();
1611  AliClusterContainer *clusters2 = jets2->GetClusterContainer();
1612 
1613  // d1 and d2 represent the matching level: 0 = maximum level of matching, 1 = the two jets are completely unrelated
1614  d1 = jet1->Pt();
1615  d2 = jet2->Pt();
1616 
1617  if (tracks1 && tracks2) {
1618 
1619  for (Int_t iTrack2 = 0; iTrack2 < jet2->GetNumberOfTracks(); iTrack2++) {
1620  Int_t index2 = jet2->TrackAt(iTrack2);
1621  for (Int_t iTrack1 = 0; iTrack1 < jet1->GetNumberOfTracks(); iTrack1++) {
1622  Int_t index1 = jet1->TrackAt(iTrack1);
1623  if (index2 == index1) { // found common particle
1624  AliVParticle *part1 = tracks1->GetParticle(index1);
1625  if (!part1) {
1626  AliWarning(Form("Could not find track %d!", index1));
1627  continue;
1628  }
1629  AliVParticle *part2 = tracks2->GetParticle(index2);
1630  if (!part2) {
1631  AliWarning(Form("Could not find track %d!", index2));
1632  continue;
1633  }
1634 
1635  d1 -= part1->Pt();
1636  d2 -= part2->Pt();
1637  break;
1638  }
1639  }
1640  }
1641 
1642  }
1643 
1644  if (clusters1 && clusters2) {
1645 
1646  if (fUseCellsToMatch && fCaloCells) {
1647  // Note: this section of the code needs to be revised and tested heavily
1648  // While fixing some inconsistencies in AliAnalysisTaskEMCALClusterizeFast
1649  // some issues came up, e.g. memory leaks (fixed) and inconsistent use of
1650  // fCaloCells. In principle the two cluster collections may use cells
1651  // from different sources (embedding / non-embedding). This is not handled
1652  // correctly in the current version of this code.
1653  AliWarning("ATTENTION ATTENTION ATTENTION: this section of the AliJetResponseMaker code needs to be revised and tested before using it for physics!!!");
1654  const Int_t nClus1 = jet1->GetNumberOfClusters();
1655 
1656  Int_t ncells1[nClus1];
1657  UShort_t *cellsId1[nClus1];
1658  Double_t *cellsFrac1[nClus1];
1659  Double_t *cellsClusFrac1[nClus1];
1660  Int_t *sortedIndexes1[nClus1];
1661  Double_t ptClus1[nClus1];
1662  for (Int_t iClus1 = 0; iClus1 < nClus1; iClus1++) {
1663  Int_t index1 = jet1->ClusterAt(iClus1);
1664  AliVCluster *clus1 = clusters1->GetCluster(index1);
1665  if (!clus1) {
1666  AliWarning(Form("Could not find cluster %d!", index1));
1667  ncells1[iClus1] = 0;
1668  cellsId1[iClus1] = 0;
1669  cellsFrac1[iClus1] = 0;
1670  cellsClusFrac1[iClus1] = 0;
1671  sortedIndexes1[iClus1] = 0;
1672  ptClus1[iClus1] = 0;
1673  continue;
1674  }
1675  TLorentzVector part1;
1676  clus1->GetMomentum(part1, fVertex);
1677 
1678  ncells1[iClus1] = clus1->GetNCells();
1679  cellsId1[iClus1] = clus1->GetCellsAbsId();
1680  cellsFrac1[iClus1] = clus1->GetCellsAmplitudeFraction();
1681  cellsClusFrac1[iClus1] = new Double_t[ncells1[iClus1]];
1682  sortedIndexes1[iClus1] = new Int_t[ncells1[iClus1]];
1683  ptClus1[iClus1] = part1.Pt();
1684 
1685  for (Int_t iCell = 0; iCell < ncells1[iClus1]; iCell++) {
1686  cellsClusFrac1[iClus1][iCell] = fCaloCells->GetCellAmplitude(cellsId1[iClus1][iCell]) / clus1->E();
1687  }
1688 
1689  TMath::Sort(ncells1[iClus1], cellsId1[iClus1], sortedIndexes1[iClus1], kFALSE);
1690  }
1691 
1692  const Int_t nClus2 = jet2->GetNumberOfClusters();
1693 
1694  const Int_t maxNcells2 = 11520;
1695  Int_t sortedIndexes2[maxNcells2];
1696  for (Int_t iClus2 = 0; iClus2 < nClus2; iClus2++) {
1697  Int_t index2 = jet2->ClusterAt(iClus2);
1698  AliVCluster *clus2 = clusters2->GetCluster(index2);
1699  if (!clus2) {
1700  AliWarning(Form("Could not find cluster %d!", index2));
1701  continue;
1702  }
1703  Int_t ncells2 = clus2->GetNCells();
1704  if (ncells2 >= maxNcells2) {
1705  AliError(Form("Number of cells in the cluster %d >= %d",ncells2,maxNcells2));
1706  continue;
1707  }
1708  UShort_t *cellsId2 = clus2->GetCellsAbsId();
1709  Double_t *cellsFrac2 = clus2->GetCellsAmplitudeFraction();
1710  Double_t *cellsClusFrac2 = new Double_t[ncells2];
1711 
1712  for (Int_t iCell = 0; iCell < ncells2; iCell++) {
1713  cellsClusFrac2[iCell] = fCaloCells->GetCellAmplitude(cellsId2[iCell]) / clus2->E();
1714  }
1715 
1716  TLorentzVector part2;
1717  clus2->GetMomentum(part2, fVertex);
1718  Double_t ptClus2 = part2.Pt();
1719 
1720  TMath::Sort(ncells2, cellsId2, sortedIndexes2, kFALSE);
1721 
1722  for (Int_t iClus1 = 0; iClus1 < nClus1; iClus1++) {
1723  if (sortedIndexes1[iClus1] == 0)
1724  continue;
1725  Int_t iCell1 = 0, iCell2 = 0;
1726  while (iCell1 < ncells1[iClus1] && iCell2 < ncells2) {
1727  if (cellsId1[iClus1][sortedIndexes1[iClus1][iCell1]] == cellsId2[sortedIndexes2[iCell2]]) { // found a common cell
1728  d1 -= cellsFrac1[iClus1][sortedIndexes1[iClus1][iCell1]] * cellsClusFrac1[iClus1][sortedIndexes1[iClus1][iCell1]] * ptClus1[iClus1];
1729  d2 -= cellsFrac2[sortedIndexes2[iCell2]] * cellsClusFrac2[sortedIndexes2[iCell2]] * ptClus2;
1730  iCell1++;
1731  iCell2++;
1732  }
1733  else if (cellsId1[iClus1][sortedIndexes1[iClus1][iCell1]] > cellsId2[sortedIndexes2[iCell2]]) {
1734  iCell2++;
1735  }
1736  else {
1737  iCell1++;
1738  }
1739  }
1740  }
1741  delete[] cellsClusFrac2;
1742  }
1743  for (Int_t iClus1 = 0; iClus1 < nClus1; iClus1++) {
1744  delete[] cellsClusFrac1[iClus1];
1745  delete[] sortedIndexes1[iClus1];
1746  }
1747  }
1748  else {
1749  for (Int_t iClus2 = 0; iClus2 < jet2->GetNumberOfClusters(); iClus2++) {
1750  Int_t index2 = jet2->ClusterAt(iClus2);
1751  for (Int_t iClus1 = 0; iClus1 < jet1->GetNumberOfClusters(); iClus1++) {
1752  Int_t index1 = jet1->ClusterAt(iClus1);
1753  if (index2 == index1) { // found common particle
1754  AliVCluster *clus1 = clusters1->GetCluster(index1);
1755  if (!clus1) {
1756  AliWarning(Form("Could not find cluster %d!", index1));
1757  continue;
1758  }
1759  AliVCluster *clus2 = clusters2->GetCluster(index2);
1760  if (!clus2) {
1761  AliWarning(Form("Could not find cluster %d!", index2));
1762  continue;
1763  }
1764  TLorentzVector part1, part2;
1765  clus1->GetMomentum(part1, fVertex);
1766  clus2->GetMomentum(part2, fVertex);
1767 
1768  d1 -= part1.Pt();
1769  d2 -= part2.Pt();
1770  break;
1771  }
1772  }
1773  }
1774  }
1775  }
1776 
1777  if (d1 < 0)
1778  d1 = 0;
1779 
1780  if (d2 < 0)
1781  d2 = 0;
1782 
1783  if (jet1->Pt() > 0)
1784  d1 /= jet1->Pt();
1785  else
1786  d1 = -1;
1787 
1788  if (jet2->Pt() > 0)
1789  d2 /= jet2->Pt();
1790  else
1791  d2 = -1;
1792 }
1793 
1794 //________________________________________________________________________
1796 {
1797  Double_t d1 = -1;
1798  Double_t d2 = -1;
1799 
1800  switch (matching) {
1801  case kGeometrical:
1802  GetGeometricalMatchingLevel(jet1,jet2,d1);
1803  d2 = d1;
1804  break;
1805  case kMCLabel: // jet1 = detector level and jet2 = particle level!
1806  GetMCLabelMatchingLevel(jet1,jet2,d1,d2);
1807  break;
1808  case kSameCollections:
1809  GetSameCollectionsMatchingLevel(jet1,jet2,d1,d2);
1810  break;
1811  default:
1812  ;
1813  }
1814 
1815  if (d1 >= 0) {
1816 
1817  if (d1 < jet1->ClosestJetDistance()) {
1818  jet1->SetSecondClosestJet(jet1->ClosestJet(), jet1->ClosestJetDistance());
1819  jet1->SetClosestJet(jet2, d1);
1820  }
1821  else if (d1 < jet1->SecondClosestJetDistance()) {
1822  jet1->SetSecondClosestJet(jet2, d1);
1823  }
1824  }
1825 
1826  if (d2 >= 0) {
1827 
1828  if (d2 < jet2->ClosestJetDistance()) {
1829  jet2->SetSecondClosestJet(jet2->ClosestJet(), jet2->ClosestJetDistance());
1830  jet2->SetClosestJet(jet1, d2);
1831  }
1832  else if (d2 < jet2->SecondClosestJetDistance()) {
1833  jet2->SetSecondClosestJet(jet1, d2);
1834  }
1835  }
1836 }
1837 
1838 //________________________________________________________________________
1840 {
1841  // Fill histograms.
1842 
1843  AliJetContainer *jets1 = static_cast<AliJetContainer*>(fJetCollArray.At(0));
1844  AliJetContainer *jets2 = static_cast<AliJetContainer*>(fJetCollArray.At(1));
1845 
1846  if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray()) return kFALSE;
1847 
1848  AliEmcalJet* jet1 = 0;
1849  AliEmcalJet* jet2 = 0;
1850 
1851  jets2->ResetCurrentID();
1852  while ((jet2 = jets2->GetNextJet())) {
1853 
1854  AliDebug(2,Form("Processing jet (2) %d", jets2->GetCurrentID()));
1855 
1856  if (jet2->Pt() < jets2->GetJetPtCut()) continue;
1857 
1858  UInt_t rejectionReason = 0;
1859  if (jets2->AcceptJet(jet2, rejectionReason))
1860  FillJetHisto(jet2, 2);
1861  else
1862  fHistRejectionReason2->Fill(jets2->GetRejectionReasonBitPosition(rejectionReason), jet2->Pt());
1863 
1864  jet1 = jet2->MatchedJet();
1865 
1866  if (!jet1) continue;
1867  rejectionReason = 0;
1868  if (!jets1->AcceptJet(jet1, rejectionReason)) continue;
1869  if (jet1->MCPt() < fMinJetMCPt) continue;
1870 
1871  Double_t d=-1, ce1=-1, ce2=-1;
1872  if (jet2->GetMatchingType() == kGeometrical) {
1873  if (jets2->GetIsParticleLevel() && !jets1->GetIsParticleLevel()) // the other way around is not supported
1874  GetMCLabelMatchingLevel(jet1, jet2, ce1, ce2);
1875  else if (jets1->GetIsParticleLevel() == jets2->GetIsParticleLevel())
1876  GetSameCollectionsMatchingLevel(jet1, jet2, ce1, ce2);
1877 
1878  d = jet2->ClosestJetDistance();
1879  }
1880  else if (jet2->GetMatchingType() == kMCLabel || jet2->GetMatchingType() == kSameCollections) {
1881  GetGeometricalMatchingLevel(jet1, jet2, d);
1882 
1883  ce1 = jet1->ClosestJetDistance();
1884  ce2 = jet2->ClosestJetDistance();
1885  }
1886 
1887  FillMatchingHistos(jet1, jet2, d, ce1, ce2);
1888  }
1889 
1890  jets1->ResetCurrentID();
1891  while ((jet1 = jets1->GetNextJet())) {
1892  UInt_t rejectionReason = 0;
1893  if (!jets1->AcceptJet(jet1, rejectionReason)) {
1894  fHistRejectionReason1->Fill(jets1->GetRejectionReasonBitPosition(rejectionReason), jet1->Pt());
1895  continue;
1896  }
1897  if (jet1->MCPt() < fMinJetMCPt) continue;
1898  AliDebug(2,Form("Processing jet (1) %d", jets1->GetCurrentID()));
1899 
1900  FillJetHisto(jet1, 1);
1901  }
1902  return kTRUE;
1903 }
void SetSecondClosestJet(AliEmcalJet *j, Double_t d)
Definition: AliEmcalJet.h:210
TH2 * fHistJets2PtArea
phi-eta distribution of jets 2
Double_t Area() const
Definition: AliEmcalJet.h:117
TH2 * fHistRejectionReason1
whether the jet2 collection has to be average subtracted
TH2 * fHistJets2CorrPtArea
inclusive jet pt vs. area histogram 2
Double_t GetRhoVal() const
const TString & GetRhoName() const
double Double_t
Definition: External.C:58
TH2 * fHistDeltaPtvsCommonEnergy1
delta pt between matched jets vs distance
TH2 * fHistJet2PtOverJet1PtvsJet2Pt
delta eta vs delta phi of matched jets
Definition: External.C:236
const char * title
Definition: MakeQAPdf.C:26
Double_t MCPt() const
Definition: AliEmcalJet.h:140
TH2 * fHistDeltaPtvsDeltaArea
delta pt between matched jets vs jet 2 area
AliEmcalJet * ClosestJet() const
Definition: AliEmcalJet.h:213
AliJetContainer * GetJetContainer(Int_t i=0) const
Double_t ClosestJetDistance() const
Definition: AliEmcalJet.h:214
Double_t Eta() const
Definition: AliEmcalJet.h:108
TH2 * fHistJets2PhiEta
Constituent Pt over Jet Pt ratio vs. jet pt 1.
TH2 * fHistDeltaCorrPtvsArea2
delta pt corr between matched jets vs jet 1 area
void FillJetHisto(AliEmcalJet *jet, Int_t Set)
Double_t Phi() const
Definition: AliEmcalJet.h:104
AliEmcalJet * MatchedJet() const
Definition: AliEmcalJet.h:217
Declaration of class AliTLorentzVector.
void GetSameCollectionsMatchingLevel(AliEmcalJet *jet1, AliEmcalJet *jet2, Double_t &d1, Double_t &d2) const
Double_t fMinBinPt
min pt in histograms
TH2 * fHistDeltaMCPtvsCommonEnergy2
jet 1 MC pt - jet2 pt vs common energy 1 (%)
AliClusterContainer * GetClusterContainer() const
TH2 * fHistJets1ZvsPt
Jet charged energy fraction vs. charged jet pt 1.
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
THnSparse * fHistMatching
jet2 THnSparse
TH2 * fHistDeltaEtaDeltaPhi
common energy 1 (%) vs common energy 2 (%)
ClassImp(AliJetResponseMaker) AliJetResponseMaker
TH2 * fHistDeltaMCPtvsCommonEnergy1
jet 1 MC pt - jet2 pt vs distance
TH2 * fHistDeltaCorrPtOverJet2CorrPtvsJet2CorrPt
delta pt corr / jet 1 corr pt between matched jets vs jet 1 corr pt
TH2 * fHistCommonEnergy1vsCommonEnergy2
distance vs common energy 2 (%)
TH2 * fHistDeltaPtvsCommonEnergy2
delta pt between matched jets vs common energy 1 (%)
TH2 * fHistDeltaMCPtvsDistance
jet 1 MC pt - jet2 pt vs jet 2 pt
AliVParticle * GetFlavourTrack(Int_t i=0) const
Container for particles within the EMCAL framework.
TH2 * fHistJets1NEFvsPt
inclusive jet pt vs. area histogram 1
TH2 * fHistJets2ZvsPt
Jet charged energy fraction vs. charged jet pt 2.
Bool_t fIsEmbedded
trigger, embedded signal
UShort_t GetNumberOfTracks() const
Definition: AliEmcalJet.h:126
Bool_t fIsJet2Rho
whether the jet1 collection has to be average subtracted
void ResetMatching()
TH2 * fHistDeltaPtvsJet1Pt
jet 1 pt over jet 2 pt vs jet 1 pt
TH2 * fHistDeltaCorrPtvsCommonEnergy2
delta pt corr between matched jets vs common energy 1 (%)
AliParticleContainer * GetParticleContainer() const
void GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
TClonesArray * fCaloClusters
!clusters
TH2 * fHistDeltaPtvsJet2Pt
delta pt between matched jets vs jet 1 pt
Short_t ClusterAt(Int_t idx) const
Definition: AliEmcalJet.h:124
TH2 * fHistJets1PhiEta
matching THnSparse
int Int_t
Definition: External.C:63
UShort_t GetNumberOfClusters() const
Definition: AliEmcalJet.h:125
unsigned int UInt_t
Definition: External.C:33
THnSparse * fHistJets1
Rejection reason vs. jet pt.
UShort_t GetMatchingType() const
Definition: AliEmcalJet.h:218
TH2 * fHistJet1PtOverJet2PtvsJet1Pt
jet 2 pt over jet 1 pt vs jet 2 pt
Double_t Phi_0_2pi() const
TH2 * fHistDeltaCorrPtvsDistance
delta pt corr between matched jets vs jet 2 corr pt
virtual AliVParticle * GetParticle(Int_t i=-1) const
void FillMatchingHistos(AliEmcalJet *jet1, AliEmcalJet *jet2, Double_t d, Double_t CE1, Double_t CE2)
TH2 * fHistJet1PtvsJet2Pt
delta pt between matched jets vs delta area
TH2 * fHistDeltaCorrPtvsJet1CorrPt
delta pt corr / jet 2 corr pt between matched jets vs jet 2 corr pt
TH2 * fHistDeltaMCPtOverJet2PtvsJet2Pt
jet 1 MC pt - jet2 pt / jet 1 MC pt vs jet 1 pt
TH2 * fHistDistancevsCommonEnergy2
distance vs common energy 1 (%)
Double_t GetJetPtCut() const
TH2 * fHistRejectionReason2
Rejection reason vs. jet pt.
Int_t fMCLabelShift
if MC label > fMCLabelShift, MC label -= fMCLabelShift
TH2 * fHistDistancevsJet1Pt
common energy 2 (%) vs jet 2 pt
TH2 * fHistDeltaMCPtOverJet1MCPtvsJet1MCPt
correlation jet 1 corr pt vs jet 2 corr pt
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
AliVCluster * GetCluster(Int_t i) const
TH2 * fHistDeltaPtOverJet1PtvsJet1Pt
delta pt between matched jets vs jet 2 pt
TObjArray fJetCollArray
jet collection array
Double_t DeltaR(const AliVParticle *part) const
TH2 * fHistDeltaCorrPtvsArea1
delta pt corr between matched jets vs common energy 2 (%)
AliVCaloCells * fCaloCells
!cells
TH2 * fHistCommonEnergy1vsJet1Pt
Constituent Pt over Jet Pt ratio vs. jet pt 2.
void SetMatchingLevel(AliEmcalJet *jet1, AliEmcalJet *jet2, MatchingType matching)
Double_t Pt() const
Definition: AliEmcalJet.h:96
TH2 * fHistJets1CorrPtArea
inclusive jet pt vs. area histogram 1
AliEmcalJet * GetNextJet()
AliEmcalList * fOutput
!output list
Double_t fMaxBinPt
max pt in histograms
TH2 * fHistDeltaMCPtvsJet1MCPt
jet 1 MC pt - jet2 pt / jet 2 pt vs jet 2 pt
void SetClosestJet(AliEmcalJet *j, Double_t d)
Definition: AliEmcalJet.h:209
TH2 * fHistDeltaMCPtvsArea2
jet 1 MC pt - jet2 pt vs jet 1 area
Short_t TrackAt(Int_t idx) const
Definition: AliEmcalJet.h:147
TH2 * fHistDeltaMCPtvsJet2Pt
jet 1 MC pt - jet2 pt vs jet 1 MC pt
TH2 * fHistDistancevsJet2Pt
distance vs jet 1 pt
TH2 * fHistDeltaPtvsArea1
delta pt between matched jets vs common energy 2 (%)
Double_t fVertex[3]
!event vertex
TH2 * fHistDeltaCorrPtvsJet2CorrPt
delta pt corr between matched jets vs jet 1 corr pt
void GetGeometricalMatchingLevel(AliEmcalJet *jet1, AliEmcalJet *jet2, Double_t &d) const
THnSparse * fHistJets2
jet1 THnSparse
TH2 * fHistDeltaPtOverJet2PtvsJet2Pt
delta pt / jet 1 pt between matched jets vs jet 1 pt
TH2 * fHistDeltaPtvsArea2
delta pt between matched jets vs jet 1 area
void SetMakeGeneralHistograms(Bool_t g)
TH2 * fHistJets2NEFvsPt
inclusive jet pt vs. area histogram 2
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
TH2 * fHistCommonEnergy2vsJet2Pt
common energy 1 (%) vs jet 1 pt
unsigned short UShort_t
Definition: External.C:28
TH2 * fHistDeltaPtvsDistance
delta pt / jet 2 pt between matched jets vs jet 2 pt
TH2 * fHistJet1MCPtvsJet2Pt
jet 1 MC pt - jet2 pt vs delta area
TH2 * fHistJets2CEFvsCEFPt
Jet neutral energy fraction vs. jet pt 2.
void SetRejectionReasonLabels(TAxis *axis)
TH2 * fHistDistancevsCommonEnergy1
distance vs jet 2 pt
TH2 * fHistJets1CEFvsCEFPt
Jet neutral energy fraction vs. jet pt 1.
const Int_t nbins
bool Bool_t
Definition: External.C:53
TH2 * fHistDeltaMCPtvsArea1
jet 1 MC pt - jet2 pt vs common energy 2 (%)
AliEmcalJetShapeProperties * GetShapeProperties() const
Definition: AliEmcalJet.h:247
TH2 * fHistDeltaCorrPtOverJet1CorrPtvsJet1CorrPt
correlation jet 1 pt vs jet 2 pt
TH2 * fHistJets1PtArea
phi-eta distribution of jets 1
Double_t NEF() const
Definition: AliEmcalJet.h:135
TH2 * fHistDeltaMCPtvsDeltaArea
jet 1 MC pt - jet2 pt vs jet 2 area
Container structure for EMCAL clusters.
TH2 * fHistDeltaCorrPtvsCommonEnergy1
delta pt corr between matched jets vs distance
void GetMCLabelMatchingLevel(AliEmcalJet *jet1, AliEmcalJet *jet2, Double_t &d1, Double_t &d2) const
Container for jet within the EMCAL jet framework.
void SetMatchedToClosest(UShort_t m)
Definition: AliEmcalJet.h:211
Int_t fNbins
no. of pt bins
TH2 * fHistJet1CorrPtvsJet2CorrPt
delta pt corr between matched jets vs delta area
TH2 * fHistDeltaCorrPtvsDeltaArea
delta pt corr between matched jets vs jet 2 area