changed binning, vertex range, leading, subleading
[u/mrichter/AliRoot.git] / PWGJE / AliAnalysisTaskJetCore.cxx
1
2 // ******************************************
3 // This task computes several jet observables like 
4 // the fraction of energy in inner and outer coronnas,
5 // the distance from track to jet axis and a 
6 // correlation strength distribution of particles inside jets.    
7 // Author: lcunquei@cern.ch
8 // *******************************************
9
10
11 /**************************************************************************
12  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
13  *                                                                        *
14  * Author: The ALICE Off-line Project.                                    *
15  * Contributors are mentioned in the code where appropriate.              *
16  *                                                                        *
17  * Permission to use, copy, modify and distribute this software and its   *
18  * documentation strictly for non-commercial purposes is hereby granted   *
19  * without fee, provided that the above copyright notice appears in all   *
20  * copies and that both the copyright notice and this permission notice   *
21  * appear in the supporting documentation. The authors make no claims     *
22  * about the suitability of this software for any purpose. It is          *
23  * provided "as is" without express or implied warranty.                  *
24  **************************************************************************/
25
26
27 #include "TChain.h"
28 #include "TTree.h"
29 #include "TMath.h"
30 #include "TH1F.h"
31 #include "TH2F.h"
32 #include "TH3F.h"
33 #include "THnSparse.h"
34 #include "TCanvas.h"
35
36 #include "AliLog.h"
37
38 #include "AliAnalysisTask.h"
39 #include "AliAnalysisManager.h"
40
41 #include "AliVEvent.h"
42 #include "AliESDEvent.h"
43 #include "AliESDInputHandler.h"
44 #include "AliCentrality.h"
45 #include "AliAnalysisHelperJetTasks.h"
46 #include "AliInputEventHandler.h"
47 #include "AliAODJetEventBackground.h"
48 #include "AliAnalysisTaskFastEmbedding.h"
49
50 #include "AliAODEvent.h"
51 #include "AliAODHandler.h"
52 #include "AliAODJet.h"
53
54 #include "AliAnalysisTaskJetCore.h"
55
56 ClassImp(AliAnalysisTaskJetCore)
57
58 AliAnalysisTaskJetCore::AliAnalysisTaskJetCore() :
59 AliAnalysisTaskSE(),
60 fESD(0x0),
61 fAOD(0x0),
62 fAODExtension(0x0),
63 fBackgroundBranch(""),
64 fNonStdFile(""),
65 fIsPbPb(kTRUE),
66 fOfflineTrgMask(AliVEvent::kAny),
67 fMinContribVtx(1),
68 fVtxZMin(-10.),
69 fVtxZMax(10.),
70 fEvtClassMin(0),
71 fEvtClassMax(4),
72 fRadioFrac(0.2),
73 fMinDist(0.1),
74 fCentMin(0.),
75 fCentMax(100.),
76 fNInputTracksMin(0),
77 fNInputTracksMax(-1),
78 fAngStructCloseTracks(0),
79 fJetEtaMin(-.5),
80 fJetEtaMax(.5),
81 fJetPtMin(20.),
82 fJetTriggerExcludeMask(AliAODJet::kHighTrackPtTriggered),
83 fJetPtFractionMin(0.5),
84 fNMatchJets(4),
85 fMatchMaxDist(0.8),
86 fKeepJets(kFALSE),
87 fkNbranches(2),
88 fkEvtClasses(12),
89 fOutputList(0x0),
90 fbEvent(kTRUE),
91 fHistEvtSelection(0x0),
92 fHistJetSelection(0x0),
93 fh2JetSelection(0x0),
94 fh2JetCoreMethod1C10(0x0),
95 fh2JetCoreMethod2C10(0x0),
96 fh2JetCoreMethod3C10(0x0),
97 fh2JetCoreMethod1C20(0x0),
98 fh2JetCoreMethod2C20(0x0),
99 fh2JetCoreMethod3C20(0x0),
100 fh2JetCoreMethod1C30(0x0),
101 fh2JetCoreMethod2C30(0x0),
102 fh2JetCoreMethod3C30(0x0),
103 fh2JetCoreMethod1C60(0x0),
104 fh2JetCoreMethod2C60(0x0),
105 fh2JetCoreMethod3C60(0x0),
106 fh2JetCoreMethod3C10lead(0x0),
107 fh2JetCoreMethod3C20lead(0x0),
108 fh2JetCoreMethod3C30lead(0x0),
109 fh2JetCoreMethod3C60lead(0x0),
110 fh2JetCoreMethod3C10sublead(0x0),
111 fh2JetCoreMethod3C20sublead(0x0),
112 fh2JetCoreMethod3C30sublead(0x0),
113 fh2JetCoreMethod3C60sublead(0x0),
114 fh2SumPtInC10(0x0),
115 fh2SumPtInC20(0x0),
116 fh2SumPtInC30(0x0),
117 fh2SumPtInC60(0x0),
118 fh2SumPtInC10lead(0x0),
119 fh2SumPtInC20lead(0x0),
120 fh2SumPtInC30lead(0x0),
121 fh2SumPtInC60lead(0x0),
122 fh2SumPtInC10sublead(0x0),
123 fh2SumPtInC20sublead(0x0),
124 fh2SumPtInC30sublead(0x0),
125 fh2SumPtInC60sublead(0x0),
126 fh2SumPtOutC10(0x0),
127 fh2SumPtOutC20(0x0),
128 fh2SumPtOutC30(0x0),
129 fh2SumPtOutC60(0x0),
130 fh2SumPtOutC10lead(0x0),
131 fh2SumPtOutC20lead(0x0),
132 fh2SumPtOutC30lead(0x0),
133 fh2SumPtOutC60lead(0x0),
134 fh2SumPtOutC10sublead(0x0),
135 fh2SumPtOutC20sublead(0x0),
136 fh2SumPtOutC30sublead(0x0),
137 fh2SumPtOutC60sublead(0x0),
138 fh2SumPtInC10bkg(0x0),
139 fh2SumPtInC20bkg(0x0),
140 fh2SumPtInC30bkg(0x0),
141 fh2SumPtInC60bkg(0x0),
142 fh2SumPtInC10bkglead(0x0),
143 fh2SumPtInC20bkglead(0x0),
144 fh2SumPtInC30bkglead(0x0),
145 fh2SumPtInC60bkglead(0x0),
146 fh2SumPtInC10bkgsublead(0x0),
147 fh2SumPtInC20bkgsublead(0x0),
148 fh2SumPtInC30bkgsublead(0x0),
149 fh2SumPtInC60bkgsublead(0x0),
150 fh2SumPtOutC10bkg(0x0),
151 fh2SumPtOutC20bkg(0x0),
152 fh2SumPtOutC30bkg(0x0),
153 fh2SumPtOutC60bkg(0x0),
154 fh2SumPtOutC10bkglead(0x0),
155 fh2SumPtOutC20bkglead(0x0),
156 fh2SumPtOutC30bkglead(0x0),
157 fh2SumPtOutC60bkglead(0x0),
158 fh2SumPtOutC10bkgsublead(0x0),
159 fh2SumPtOutC20bkgsublead(0x0),
160 fh2SumPtOutC30bkgsublead(0x0),
161 fh2SumPtOutC60bkgsublead(0x0),
162 fh2DeltaRC10pt1(0x0),
163 fh2DeltaRC20pt1(0x0),
164 fh2DeltaRC30pt1(0x0),
165 fh2DeltaRC60pt1(0x0),  
166 fh2DeltaRC10pt2(0x0),
167 fh2DeltaRC20pt2(0x0),
168 fh2DeltaRC30pt2(0x0),
169 fh2DeltaRC60pt2(0x0),  
170 fh2DeltaRC10pt3(0x0),
171 fh2DeltaRC20pt3(0x0),
172 fh2DeltaRC30pt3(0x0),
173 fh2DeltaRC60pt3(0x0),  
174 fh2DeltaRC10pt4(0x0),
175 fh2DeltaRC20pt4(0x0),
176 fh2DeltaRC30pt4(0x0),
177 fh2DeltaRC60pt4(0x0),
178 fh2DeltaEtaC10pt1(0x0),
179 fh2DeltaEtaC20pt1(0x0),
180 fh2DeltaEtaC30pt1(0x0),
181 fh2DeltaEtaC60pt1(0x0),  
182 fh2DeltaEtaC10pt2(0x0),
183 fh2DeltaEtaC20pt2(0x0),
184 fh2DeltaEtaC30pt2(0x0),
185 fh2DeltaEtaC60pt2(0x0),  
186 fh2DeltaEtaC10pt3(0x0),
187 fh2DeltaEtaC20pt3(0x0),
188 fh2DeltaEtaC30pt3(0x0),
189 fh2DeltaEtaC60pt3(0x0),  
190 fh2DeltaEtaC10pt4(0x0),
191 fh2DeltaEtaC20pt4(0x0),
192 fh2DeltaEtaC30pt4(0x0),
193 fh2DeltaEtaC60pt4(0x0),
194 fh2DeltaPhiC10pt1(0x0),
195 fh2DeltaPhiC20pt1(0x0),
196 fh2DeltaPhiC30pt1(0x0),
197 fh2DeltaPhiC60pt1(0x0),  
198 fh2DeltaPhiC10pt2(0x0),
199 fh2DeltaPhiC20pt2(0x0),
200 fh2DeltaPhiC30pt2(0x0),
201 fh2DeltaPhiC60pt2(0x0),  
202 fh2DeltaPhiC10pt3(0x0),
203 fh2DeltaPhiC20pt3(0x0),
204 fh2DeltaPhiC30pt3(0x0),
205 fh2DeltaPhiC60pt3(0x0),  
206 fh2DeltaPhiC10pt4(0x0),
207 fh2DeltaPhiC20pt4(0x0),
208 fh2DeltaPhiC30pt4(0x0),
209 fh2DeltaPhiC60pt4(0x0),
210 fh2DeltaRC10pt1lead(0x0),
211 fh2DeltaRC20pt1lead(0x0),
212 fh2DeltaRC30pt1lead(0x0),
213 fh2DeltaRC60pt1lead(0x0),  
214 fh2DeltaRC10pt2lead(0x0),
215 fh2DeltaRC20pt2lead(0x0),
216 fh2DeltaRC30pt2lead(0x0),
217 fh2DeltaRC60pt2lead(0x0),  
218 fh2DeltaRC10pt3lead(0x0),
219 fh2DeltaRC20pt3lead(0x0),
220 fh2DeltaRC30pt3lead(0x0),
221 fh2DeltaRC60pt3lead(0x0),  
222 fh2DeltaRC10pt4lead(0x0),
223 fh2DeltaRC20pt4lead(0x0),
224 fh2DeltaRC30pt4lead(0x0),
225 fh2DeltaRC60pt4lead(0x0),
226 fh2DeltaEtaC10pt1lead(0x0),
227 fh2DeltaEtaC20pt1lead(0x0),
228 fh2DeltaEtaC30pt1lead(0x0),
229 fh2DeltaEtaC60pt1lead(0x0),  
230 fh2DeltaEtaC10pt2lead(0x0),
231 fh2DeltaEtaC20pt2lead(0x0),
232 fh2DeltaEtaC30pt2lead(0x0),
233 fh2DeltaEtaC60pt2lead(0x0),  
234 fh2DeltaEtaC10pt3lead(0x0),
235 fh2DeltaEtaC20pt3lead(0x0),
236 fh2DeltaEtaC30pt3lead(0x0),
237 fh2DeltaEtaC60pt3lead(0x0),  
238 fh2DeltaEtaC10pt4lead(0x0),
239 fh2DeltaEtaC20pt4lead(0x0),
240 fh2DeltaEtaC30pt4lead(0x0),
241 fh2DeltaEtaC60pt4lead(0x0),
242 fh2DeltaPhiC10pt1lead(0x0),
243 fh2DeltaPhiC20pt1lead(0x0),
244 fh2DeltaPhiC30pt1lead(0x0),
245 fh2DeltaPhiC60pt1lead(0x0),  
246 fh2DeltaPhiC10pt2lead(0x0),
247 fh2DeltaPhiC20pt2lead(0x0),
248 fh2DeltaPhiC30pt2lead(0x0),
249 fh2DeltaPhiC60pt2lead(0x0),  
250 fh2DeltaPhiC10pt3lead(0x0),
251 fh2DeltaPhiC20pt3lead(0x0),
252 fh2DeltaPhiC30pt3lead(0x0),
253 fh2DeltaPhiC60pt3lead(0x0),  
254 fh2DeltaPhiC10pt4lead(0x0),
255 fh2DeltaPhiC20pt4lead(0x0),
256 fh2DeltaPhiC30pt4lead(0x0),
257 fh2DeltaPhiC60pt4lead(0x0),
258 fh2DeltaRC10pt1sublead(0x0),
259 fh2DeltaRC20pt1sublead(0x0),
260 fh2DeltaRC30pt1sublead(0x0),
261 fh2DeltaRC60pt1sublead(0x0),  
262 fh2DeltaRC10pt2sublead(0x0),
263 fh2DeltaRC20pt2sublead(0x0),
264 fh2DeltaRC30pt2sublead(0x0),
265 fh2DeltaRC60pt2sublead(0x0),  
266 fh2DeltaRC10pt3sublead(0x0),
267 fh2DeltaRC20pt3sublead(0x0),
268 fh2DeltaRC30pt3sublead(0x0),
269 fh2DeltaRC60pt3sublead(0x0),  
270 fh2DeltaRC10pt4sublead(0x0),
271 fh2DeltaRC20pt4sublead(0x0),
272 fh2DeltaRC30pt4sublead(0x0),
273 fh2DeltaRC60pt4sublead(0x0),
274 fh2DeltaEtaC10pt1sublead(0x0),
275 fh2DeltaEtaC20pt1sublead(0x0),
276 fh2DeltaEtaC30pt1sublead(0x0),
277 fh2DeltaEtaC60pt1sublead(0x0),  
278 fh2DeltaEtaC10pt2sublead(0x0),
279 fh2DeltaEtaC20pt2sublead(0x0),
280 fh2DeltaEtaC30pt2sublead(0x0),
281 fh2DeltaEtaC60pt2sublead(0x0),  
282 fh2DeltaEtaC10pt3sublead(0x0),
283 fh2DeltaEtaC20pt3sublead(0x0),
284 fh2DeltaEtaC30pt3sublead(0x0),
285 fh2DeltaEtaC60pt3sublead(0x0),  
286 fh2DeltaEtaC10pt4sublead(0x0),
287 fh2DeltaEtaC20pt4sublead(0x0),
288 fh2DeltaEtaC30pt4sublead(0x0),
289 fh2DeltaEtaC60pt4sublead(0x0),
290 fh2DeltaPhiC10pt1sublead(0x0),
291 fh2DeltaPhiC20pt1sublead(0x0),
292 fh2DeltaPhiC30pt1sublead(0x0),
293 fh2DeltaPhiC60pt1sublead(0x0),  
294 fh2DeltaPhiC10pt2sublead(0x0),
295 fh2DeltaPhiC20pt2sublead(0x0),
296 fh2DeltaPhiC30pt2sublead(0x0),
297 fh2DeltaPhiC60pt2sublead(0x0),  
298 fh2DeltaPhiC10pt3sublead(0x0),
299 fh2DeltaPhiC20pt3sublead(0x0),
300 fh2DeltaPhiC30pt3sublead(0x0),
301 fh2DeltaPhiC60pt3sublead(0x0),  
302 fh2DeltaPhiC10pt4sublead(0x0),
303 fh2DeltaPhiC20pt4sublead(0x0),
304 fh2DeltaPhiC30pt4sublead(0x0),
305 fh2DeltaPhiC60pt4sublead(0x0),
306 fh2AngStructpt1C10(0x0),
307 fh2AngStructpt2C10(0x0),
308 fh2AngStructpt3C10(0x0),
309 fh2AngStructpt4C10(0x0),
310 fh2AngStructpt1C20(0x0),
311 fh2AngStructpt2C20(0x0),
312 fh2AngStructpt3C20(0x0),
313 fh2AngStructpt4C20(0x0),    
314 fh2AngStructpt1C30(0x0),
315 fh2AngStructpt2C30(0x0),
316 fh2AngStructpt3C30(0x0),
317 fh2AngStructpt4C30(0x0),   
318 fh2AngStructpt1C60(0x0),
319 fh2AngStructpt2C60(0x0),
320 fh2AngStructpt3C60(0x0),
321 fh2AngStructpt4C60(0x0)
322 {
323    // default Constructor
324
325    fJetBranchName[0] = "";
326    fJetBranchName[1] = "";
327
328    fListJets[0] = new TList;
329    fListJets[1] = new TList;
330 }
331
332 AliAnalysisTaskJetCore::AliAnalysisTaskJetCore(const char *name) :
333 AliAnalysisTaskSE(name),
334 fESD(0x0),
335 fAOD(0x0),
336 fAODExtension(0x0),
337 fBackgroundBranch(""),
338 fNonStdFile(""),
339 fIsPbPb(kTRUE),
340 fOfflineTrgMask(AliVEvent::kAny),
341 fMinContribVtx(1),
342 fVtxZMin(-10.),
343 fVtxZMax(10.),
344 fEvtClassMin(0),
345 fEvtClassMax(4),
346 fRadioFrac(0.2),
347 fMinDist(0.1),
348 fCentMin(0.),
349 fCentMax(100.),
350 fNInputTracksMin(0),
351 fNInputTracksMax(-1),
352 fAngStructCloseTracks(0),
353 fJetEtaMin(-.5),
354 fJetEtaMax(.5),
355 fJetPtMin(20.),
356 fJetTriggerExcludeMask(AliAODJet::kHighTrackPtTriggered),
357 fJetPtFractionMin(0.5),
358 fNMatchJets(4),
359 fMatchMaxDist(0.8),
360 fKeepJets(kFALSE),
361 fkNbranches(2),
362 fkEvtClasses(12),
363 fOutputList(0x0),
364 fbEvent(kTRUE),
365 fHistEvtSelection(0x0),
366 fHistJetSelection(0x0),
367 fh2JetSelection(0x0),
368 fh2JetCoreMethod1C10(0x0),
369 fh2JetCoreMethod2C10(0x0),
370 fh2JetCoreMethod3C10(0x0),
371 fh2JetCoreMethod1C20(0x0),
372 fh2JetCoreMethod2C20(0x0),
373 fh2JetCoreMethod3C20(0x0),
374 fh2JetCoreMethod1C30(0x0),
375 fh2JetCoreMethod2C30(0x0),
376 fh2JetCoreMethod3C30(0x0),
377 fh2JetCoreMethod1C60(0x0),
378 fh2JetCoreMethod2C60(0x0),
379 fh2JetCoreMethod3C60(0x0),
380 fh2JetCoreMethod3C10lead(0x0),
381 fh2JetCoreMethod3C20lead(0x0),
382 fh2JetCoreMethod3C30lead(0x0),
383 fh2JetCoreMethod3C60lead(0x0),
384 fh2JetCoreMethod3C10sublead(0x0),
385 fh2JetCoreMethod3C20sublead(0x0),
386 fh2JetCoreMethod3C30sublead(0x0),
387 fh2JetCoreMethod3C60sublead(0x0),
388 fh2SumPtInC10(0x0),
389 fh2SumPtInC20(0x0),
390 fh2SumPtInC30(0x0),
391 fh2SumPtInC60(0x0),
392 fh2SumPtInC10lead(0x0),
393 fh2SumPtInC20lead(0x0),
394 fh2SumPtInC30lead(0x0),
395 fh2SumPtInC60lead(0x0),
396 fh2SumPtInC10sublead(0x0),
397 fh2SumPtInC20sublead(0x0),
398 fh2SumPtInC30sublead(0x0),
399 fh2SumPtInC60sublead(0x0),
400 fh2SumPtOutC10(0x0),
401 fh2SumPtOutC20(0x0),
402 fh2SumPtOutC30(0x0),
403 fh2SumPtOutC60(0x0),
404 fh2SumPtOutC10lead(0x0),
405 fh2SumPtOutC20lead(0x0),
406 fh2SumPtOutC30lead(0x0),
407 fh2SumPtOutC60lead(0x0),
408 fh2SumPtOutC10sublead(0x0),
409 fh2SumPtOutC20sublead(0x0),
410 fh2SumPtOutC30sublead(0x0),
411 fh2SumPtOutC60sublead(0x0),
412 fh2SumPtInC10bkg(0x0),
413 fh2SumPtInC20bkg(0x0),
414 fh2SumPtInC30bkg(0x0),
415 fh2SumPtInC60bkg(0x0),
416 fh2SumPtInC10bkglead(0x0),
417 fh2SumPtInC20bkglead(0x0),
418 fh2SumPtInC30bkglead(0x0),
419 fh2SumPtInC60bkglead(0x0),
420 fh2SumPtInC10bkgsublead(0x0),
421 fh2SumPtInC20bkgsublead(0x0),
422 fh2SumPtInC30bkgsublead(0x0),
423 fh2SumPtInC60bkgsublead(0x0),
424 fh2SumPtOutC10bkg(0x0),
425 fh2SumPtOutC20bkg(0x0),
426 fh2SumPtOutC30bkg(0x0),
427 fh2SumPtOutC60bkg(0x0),
428 fh2SumPtOutC10bkglead(0x0),
429 fh2SumPtOutC20bkglead(0x0),
430 fh2SumPtOutC30bkglead(0x0),
431 fh2SumPtOutC60bkglead(0x0),
432 fh2SumPtOutC10bkgsublead(0x0),
433 fh2SumPtOutC20bkgsublead(0x0),
434 fh2SumPtOutC30bkgsublead(0x0),
435 fh2SumPtOutC60bkgsublead(0x0),
436 fh2DeltaRC10pt1(0x0),
437 fh2DeltaRC20pt1(0x0),
438 fh2DeltaRC30pt1(0x0),
439 fh2DeltaRC60pt1(0x0),  
440 fh2DeltaRC10pt2(0x0),
441 fh2DeltaRC20pt2(0x0),
442 fh2DeltaRC30pt2(0x0),
443 fh2DeltaRC60pt2(0x0),  
444 fh2DeltaRC10pt3(0x0),
445 fh2DeltaRC20pt3(0x0),
446 fh2DeltaRC30pt3(0x0),
447 fh2DeltaRC60pt3(0x0),  
448 fh2DeltaRC10pt4(0x0),
449 fh2DeltaRC20pt4(0x0),
450 fh2DeltaRC30pt4(0x0),
451 fh2DeltaRC60pt4(0x0),
452 fh2DeltaEtaC10pt1(0x0),
453 fh2DeltaEtaC20pt1(0x0),
454 fh2DeltaEtaC30pt1(0x0),
455 fh2DeltaEtaC60pt1(0x0),  
456 fh2DeltaEtaC10pt2(0x0),
457 fh2DeltaEtaC20pt2(0x0),
458 fh2DeltaEtaC30pt2(0x0),
459 fh2DeltaEtaC60pt2(0x0),  
460 fh2DeltaEtaC10pt3(0x0),
461 fh2DeltaEtaC20pt3(0x0),
462 fh2DeltaEtaC30pt3(0x0),
463 fh2DeltaEtaC60pt3(0x0),  
464 fh2DeltaEtaC10pt4(0x0),
465 fh2DeltaEtaC20pt4(0x0),
466 fh2DeltaEtaC30pt4(0x0),
467 fh2DeltaEtaC60pt4(0x0),
468 fh2DeltaPhiC10pt1(0x0),
469 fh2DeltaPhiC20pt1(0x0),
470 fh2DeltaPhiC30pt1(0x0),
471 fh2DeltaPhiC60pt1(0x0),  
472 fh2DeltaPhiC10pt2(0x0),
473 fh2DeltaPhiC20pt2(0x0),
474 fh2DeltaPhiC30pt2(0x0),
475 fh2DeltaPhiC60pt2(0x0),  
476 fh2DeltaPhiC10pt3(0x0),
477 fh2DeltaPhiC20pt3(0x0),
478 fh2DeltaPhiC30pt3(0x0),
479 fh2DeltaPhiC60pt3(0x0),  
480 fh2DeltaPhiC10pt4(0x0),
481 fh2DeltaPhiC20pt4(0x0),
482 fh2DeltaPhiC30pt4(0x0),
483 fh2DeltaPhiC60pt4(0x0),
484 fh2DeltaRC10pt1lead(0x0),
485 fh2DeltaRC20pt1lead(0x0),
486 fh2DeltaRC30pt1lead(0x0),
487 fh2DeltaRC60pt1lead(0x0),  
488 fh2DeltaRC10pt2lead(0x0),
489 fh2DeltaRC20pt2lead(0x0),
490 fh2DeltaRC30pt2lead(0x0),
491 fh2DeltaRC60pt2lead(0x0),  
492 fh2DeltaRC10pt3lead(0x0),
493 fh2DeltaRC20pt3lead(0x0),
494 fh2DeltaRC30pt3lead(0x0),
495 fh2DeltaRC60pt3lead(0x0),  
496 fh2DeltaRC10pt4lead(0x0),
497 fh2DeltaRC20pt4lead(0x0),
498 fh2DeltaRC30pt4lead(0x0),
499 fh2DeltaRC60pt4lead(0x0),
500 fh2DeltaEtaC10pt1lead(0x0),
501 fh2DeltaEtaC20pt1lead(0x0),
502 fh2DeltaEtaC30pt1lead(0x0),
503 fh2DeltaEtaC60pt1lead(0x0),  
504 fh2DeltaEtaC10pt2lead(0x0),
505 fh2DeltaEtaC20pt2lead(0x0),
506 fh2DeltaEtaC30pt2lead(0x0),
507 fh2DeltaEtaC60pt2lead(0x0),  
508 fh2DeltaEtaC10pt3lead(0x0),
509 fh2DeltaEtaC20pt3lead(0x0),
510 fh2DeltaEtaC30pt3lead(0x0),
511 fh2DeltaEtaC60pt3lead(0x0),  
512 fh2DeltaEtaC10pt4lead(0x0),
513 fh2DeltaEtaC20pt4lead(0x0),
514 fh2DeltaEtaC30pt4lead(0x0),
515 fh2DeltaEtaC60pt4lead(0x0),
516 fh2DeltaPhiC10pt1lead(0x0),
517 fh2DeltaPhiC20pt1lead(0x0),
518 fh2DeltaPhiC30pt1lead(0x0),
519 fh2DeltaPhiC60pt1lead(0x0),  
520 fh2DeltaPhiC10pt2lead(0x0),
521 fh2DeltaPhiC20pt2lead(0x0),
522 fh2DeltaPhiC30pt2lead(0x0),
523 fh2DeltaPhiC60pt2lead(0x0),  
524 fh2DeltaPhiC10pt3lead(0x0),
525 fh2DeltaPhiC20pt3lead(0x0),
526 fh2DeltaPhiC30pt3lead(0x0),
527 fh2DeltaPhiC60pt3lead(0x0),  
528 fh2DeltaPhiC10pt4lead(0x0),
529 fh2DeltaPhiC20pt4lead(0x0),
530 fh2DeltaPhiC30pt4lead(0x0),
531 fh2DeltaPhiC60pt4lead(0x0),
532 fh2DeltaRC10pt1sublead(0x0),
533 fh2DeltaRC20pt1sublead(0x0),
534 fh2DeltaRC30pt1sublead(0x0),
535 fh2DeltaRC60pt1sublead(0x0),  
536 fh2DeltaRC10pt2sublead(0x0),
537 fh2DeltaRC20pt2sublead(0x0),
538 fh2DeltaRC30pt2sublead(0x0),
539 fh2DeltaRC60pt2sublead(0x0),  
540 fh2DeltaRC10pt3sublead(0x0),
541 fh2DeltaRC20pt3sublead(0x0),
542 fh2DeltaRC30pt3sublead(0x0),
543 fh2DeltaRC60pt3sublead(0x0),  
544 fh2DeltaRC10pt4sublead(0x0),
545 fh2DeltaRC20pt4sublead(0x0),
546 fh2DeltaRC30pt4sublead(0x0),
547 fh2DeltaRC60pt4sublead(0x0),
548 fh2DeltaEtaC10pt1sublead(0x0),
549 fh2DeltaEtaC20pt1sublead(0x0),
550 fh2DeltaEtaC30pt1sublead(0x0),
551 fh2DeltaEtaC60pt1sublead(0x0),  
552 fh2DeltaEtaC10pt2sublead(0x0),
553 fh2DeltaEtaC20pt2sublead(0x0),
554 fh2DeltaEtaC30pt2sublead(0x0),
555 fh2DeltaEtaC60pt2sublead(0x0),  
556 fh2DeltaEtaC10pt3sublead(0x0),
557 fh2DeltaEtaC20pt3sublead(0x0),
558 fh2DeltaEtaC30pt3sublead(0x0),
559 fh2DeltaEtaC60pt3sublead(0x0),  
560 fh2DeltaEtaC10pt4sublead(0x0),
561 fh2DeltaEtaC20pt4sublead(0x0),
562 fh2DeltaEtaC30pt4sublead(0x0),
563 fh2DeltaEtaC60pt4sublead(0x0),
564 fh2DeltaPhiC10pt1sublead(0x0),
565 fh2DeltaPhiC20pt1sublead(0x0),
566 fh2DeltaPhiC30pt1sublead(0x0),
567 fh2DeltaPhiC60pt1sublead(0x0),  
568 fh2DeltaPhiC10pt2sublead(0x0),
569 fh2DeltaPhiC20pt2sublead(0x0),
570 fh2DeltaPhiC30pt2sublead(0x0),
571 fh2DeltaPhiC60pt2sublead(0x0),  
572 fh2DeltaPhiC10pt3sublead(0x0),
573 fh2DeltaPhiC20pt3sublead(0x0),
574 fh2DeltaPhiC30pt3sublead(0x0),
575 fh2DeltaPhiC60pt3sublead(0x0),  
576 fh2DeltaPhiC10pt4sublead(0x0),
577 fh2DeltaPhiC20pt4sublead(0x0),
578 fh2DeltaPhiC30pt4sublead(0x0),
579 fh2DeltaPhiC60pt4sublead(0x0),
580 fh2AngStructpt1C10(0x0),
581 fh2AngStructpt2C10(0x0),
582 fh2AngStructpt3C10(0x0),
583 fh2AngStructpt4C10(0x0),
584 fh2AngStructpt1C20(0x0),
585 fh2AngStructpt2C20(0x0),
586 fh2AngStructpt3C20(0x0),
587 fh2AngStructpt4C20(0x0),    
588 fh2AngStructpt1C30(0x0),
589 fh2AngStructpt2C30(0x0),
590 fh2AngStructpt3C30(0x0),
591 fh2AngStructpt4C30(0x0),   
592 fh2AngStructpt1C60(0x0),
593 fh2AngStructpt2C60(0x0),
594 fh2AngStructpt3C60(0x0),
595 fh2AngStructpt4C60(0x0)    
596
597  {
598    // Constructor
599
600    fJetBranchName[0] = "";
601    fJetBranchName[1] = "";
602
603    fListJets[0] = new TList;
604    fListJets[1] = new TList;
605
606    DefineOutput(1, TList::Class());
607 }
608
609 AliAnalysisTaskJetCore::~AliAnalysisTaskJetCore()
610 {
611    delete fListJets[0];
612    delete fListJets[1];
613 }
614
615 void AliAnalysisTaskJetCore::SetBranchNames(const TString &branch1, const TString &branch2)
616 {
617    fJetBranchName[0] = branch1;
618    fJetBranchName[1] = branch2;
619 }
620
621 void AliAnalysisTaskJetCore::Init()
622 {
623
624    // check for jet branches
625    if(!strlen(fJetBranchName[0].Data()) || !strlen(fJetBranchName[1].Data())){
626       AliError("Jet branch name not set.");
627    }
628
629 }
630
631 void AliAnalysisTaskJetCore::UserCreateOutputObjects()
632 {
633    // Create histograms
634    // Called once
635    OpenFile(1);
636    if(!fOutputList) fOutputList = new TList;
637    fOutputList->SetOwner(kTRUE);
638
639    Bool_t oldStatus = TH1::AddDirectoryStatus();
640    TH1::AddDirectory(kFALSE);
641
642
643    fHistEvtSelection = new TH1I("fHistEvtSelection", "event selection", 6, -0.5, 5.5);
644    fHistEvtSelection->GetXaxis()->SetBinLabel(1,"ACCEPTED");
645    fHistEvtSelection->GetXaxis()->SetBinLabel(2,"events IN");
646    fHistEvtSelection->GetXaxis()->SetBinLabel(3,"event selection (rejected)");
647    fHistEvtSelection->GetXaxis()->SetBinLabel(4,"vertex cut (rejected)");
648    fHistEvtSelection->GetXaxis()->SetBinLabel(5,"centrality (rejected)");
649    fHistEvtSelection->GetXaxis()->SetBinLabel(6,"multiplicity (rejected)");
650
651    fHistJetSelection = new TH1I("fHistJetSelection", "jet selection", 8, -0.5, 7.5);
652    fHistJetSelection->GetXaxis()->SetBinLabel(1,"ACCEPTED");
653    fHistJetSelection->GetXaxis()->SetBinLabel(2,"probes IN");
654    fHistJetSelection->GetXaxis()->SetBinLabel(3,"no matching jet");
655    fHistJetSelection->GetXaxis()->SetBinLabel(4,"not in list");
656    fHistJetSelection->GetXaxis()->SetBinLabel(5,"fraction cut");
657    fHistJetSelection->GetXaxis()->SetBinLabel(6,"acceptance cut");
658    fHistJetSelection->GetXaxis()->SetBinLabel(7,"p_{T} cut");
659    fHistJetSelection->GetXaxis()->SetBinLabel(8,"trigger exclude mask");
660
661    fh2JetSelection = new TH2F("fh2JetSelection", "jet selection", 8, -0.5, 7.5,100,0.,200.);
662    fh2JetSelection->GetXaxis()->SetBinLabel(1,"ACCEPTED");
663    fh2JetSelection->GetXaxis()->SetBinLabel(2,"probes IN");
664    fh2JetSelection->GetXaxis()->SetBinLabel(3,"no matching jet");
665    fh2JetSelection->GetXaxis()->SetBinLabel(4,"not in list");
666    fh2JetSelection->GetXaxis()->SetBinLabel(5,"fraction cut");
667    fh2JetSelection->GetXaxis()->SetBinLabel(6,"acceptance cut");
668    fh2JetSelection->GetXaxis()->SetBinLabel(7,"p_{T} cut");
669    fh2JetSelection->GetXaxis()->SetBinLabel(8,"trigger exclude mask");
670
671
672    //UInt_t entries = 0; // bit coded, see GetDimParams() below
673    //UInt_t opt = 0;  // bit coded, default (0) or high resolution (1)
674
675    //  Int_t bins[5]={10,10,150,150,15};
676    //Double_t xmin[5]={0.,0.,0.,0.,0.};
677    //Double_t xmax[5]={100.,6.5,150.,1.5,1.5};     
678    //fhnDeltaRjets = new THnSparseF("fhnDeltaRjets", "fhnDeltaRjets",5,bins,xmin,xmax);
679
680
681
682     fh2JetCoreMethod1C10 = new TH2F("JetCoreMethod1C10","",150, 0., 150.,100, 0., 1.5);
683     fh2JetCoreMethod2C10 = new TH2F("JetCoreMethod2C10","",150, 0., 150.,100, 0., 1.5);
684     fh2JetCoreMethod3C10 = new TH2F("JetCoreMethod3C10","",150, 0., 150.,100, 0., 1.5); 
685     fh2JetCoreMethod1C20 = new TH2F("JetCoreMethod1C20","",150, 0., 150.,100, 0., 1.5);
686     fh2JetCoreMethod2C20 = new TH2F("JetCoreMethod2C20","",150, 0., 150.,100, 0., 1.5);
687     fh2JetCoreMethod3C20 = new TH2F("JetCoreMethod3C20","",150, 0., 150.,100, 0., 1.5); 
688     fh2JetCoreMethod1C30 = new TH2F("JetCoreMethod1C30","",150, 0., 150.,100, 0., 1.5);
689     fh2JetCoreMethod2C30 = new TH2F("JetCoreMethod2C30","",150, 0., 150.,100, 0., 1.5);
690     fh2JetCoreMethod3C30 = new TH2F("JetCoreMethod3C30","",150, 0., 150.,100, 0., 1.5); 
691     fh2JetCoreMethod1C60 = new TH2F("JetCoreMethod1C60","",150, 0., 150.,100, 0., 1.5);
692     fh2JetCoreMethod2C60 = new TH2F("JetCoreMethod2C60","",150, 0., 150.,100, 0., 1.5);
693     fh2JetCoreMethod3C60 = new TH2F("JetCoreMethod3C60","",150, 0., 150.,100, 0., 1.5); 
694     fh2JetCoreMethod3C10lead = new TH2F("JetCoreMethod3C10lead","",150, 0., 150.,100, 0., 1.5); 
695     fh2JetCoreMethod3C20lead = new TH2F("JetCoreMethod3C20lead","",150, 0., 150.,100, 0., 1.5);
696     fh2JetCoreMethod3C30lead = new TH2F("JetCoreMethod3C30lead","",150, 0., 150.,100, 0., 1.5);
697     fh2JetCoreMethod3C60lead = new TH2F("JetCoreMethod3C60lead","",150, 0., 150.,100, 0., 1.5); 
698     fh2JetCoreMethod3C10sublead = new TH2F("JetCoreMethod3C10sublead","",150, 0., 150.,100, 0., 1.5); 
699     fh2JetCoreMethod3C20sublead = new TH2F("JetCoreMethod3C20sublead","",150, 0., 150.,100, 0., 1.5);
700     fh2JetCoreMethod3C30sublead = new TH2F("JetCoreMethod3C30sublead","",150, 0., 150.,100, 0., 1.5);
701     fh2JetCoreMethod3C60sublead = new TH2F("JetCoreMethod3C60sublead","",150, 0., 150.,100, 0., 1.5); 
702    
703     fh2SumPtInC10 = new TH2F("PtSumInC10","",150, 0., 150.,5000, 0., 25.); 
704     fh2SumPtInC20 = new TH2F("PtSumInC20","",150, 0., 150.,5000, 0., 25.); 
705     fh2SumPtInC30 = new TH2F("PtSumInC30","",150, 0., 150.,5000, 0., 25.); 
706     fh2SumPtInC60 = new TH2F("PtSumInC60","",150, 0., 150.,5000, 0., 25.); 
707     fh2SumPtInC10lead = new TH2F("PtSumInC10lead","",150, 0., 150.,5000, 0., 25.); 
708     fh2SumPtInC20lead = new TH2F("PtSumInC20lead","",150, 0., 150.,5000, 0., 25.); 
709     fh2SumPtInC30lead = new TH2F("PtSumInC30lead","",150, 0., 150.,5000, 0., 25.); 
710     fh2SumPtInC60lead = new TH2F("PtSumInC60lead","",150, 0., 150.,5000, 0., 25.); 
711     fh2SumPtInC10sublead = new TH2F("PtSumInC10sublead","",150, 0., 150.,5000, 0., 25.); 
712     fh2SumPtInC20sublead = new TH2F("PtSumInC20sublead","",150, 0., 150.,5000, 0., 25.); 
713     fh2SumPtInC30sublead = new TH2F("PtSumInC30sublead","",150, 0., 150.,5000, 0., 25.); 
714     fh2SumPtInC60sublead = new TH2F("PtSumInC60sublead","",150, 0., 150.,5000, 0., 25.); 
715
716     fh2SumPtOutC10 = new TH2F("PtSumOutC10","",150, 0., 150.,5000, 0., 25.);
717     fh2SumPtOutC20 = new TH2F("PtSumOutC20","",150, 0., 150.,5000, 0., 25.); 
718     fh2SumPtOutC30 = new TH2F("PtSumOutC30","",150, 0., 150.,5000, 0., 25.); 
719     fh2SumPtOutC60 = new TH2F("PtSumOutC60","",150, 0., 150.,5000, 0., 25.); 
720     fh2SumPtOutC10lead = new TH2F("PtSumOutC10lead","",150, 0., 150.,5000, 0., 25.);
721     fh2SumPtOutC20lead = new TH2F("PtSumOutC20lead","",150, 0., 150.,5000, 0., 25.); 
722     fh2SumPtOutC30lead = new TH2F("PtSumOutC30lead","",150, 0., 150.,5000, 0., 25.); 
723     fh2SumPtOutC60lead = new TH2F("PtSumOutC60lead","",150, 0., 150.,5000, 0., 25.);      
724     fh2SumPtOutC10sublead = new TH2F("PtSumOutC10sublead","",150, 0., 150.,5000, 0., 25.);
725     fh2SumPtOutC20sublead = new TH2F("PtSumOutC20sublead","",150, 0., 150.,5000, 0., 25.); 
726     fh2SumPtOutC30sublead = new TH2F("PtSumOutC30sublead","",150, 0., 150.,5000, 0., 25.); 
727     fh2SumPtOutC60sublead = new TH2F("PtSumOutC60sublead","",150, 0., 150.,5000, 0., 25.);      
728
729
730     fh2SumPtInC10bkg = new TH2F("PtSumInC10bkg","",150, 0., 150.,5000, 0., 25.); 
731     fh2SumPtInC20bkg = new TH2F("PtSumInC20bkg","",150, 0., 150.,5000, 0., 25.); 
732     fh2SumPtInC30bkg = new TH2F("PtSumInC30bkg","",150, 0., 150.,5000, 0., 25.); 
733     fh2SumPtInC60bkg = new TH2F("PtSumInC60bkg","",150, 0., 150.,5000, 0., 25.); 
734     fh2SumPtInC10bkglead = new TH2F("PtSumInC10bkglead","",150, 0., 150.,5000, 0., 25.); 
735     fh2SumPtInC20bkglead = new TH2F("PtSumInC20bkglead","",150, 0., 150.,5000, 0., 25.); 
736     fh2SumPtInC30bkglead = new TH2F("PtSumInC30bkglead","",150, 0., 150.,5000, 0., 25.); 
737     fh2SumPtInC60bkglead = new TH2F("PtSumInC60bkglead","",150, 0., 150.,5000, 0., 25.); 
738     fh2SumPtInC10bkgsublead = new TH2F("PtSumInC10bkgsublead","",150, 0., 150.,5000, 0., 25.); 
739     fh2SumPtInC20bkgsublead = new TH2F("PtSumInC20bkgsublead","",150, 0., 150.,5000, 0., 25.); 
740     fh2SumPtInC30bkgsublead = new TH2F("PtSumInC30bkgsublead","",150, 0., 150.,5000, 0., 25.); 
741     fh2SumPtInC60bkgsublead = new TH2F("PtSumInC60bkgsublead","",150, 0., 150.,5000, 0., 25.); 
742
743
744     fh2SumPtOutC10bkg = new TH2F("PtSumOutC10bkg","",150, 0., 150.,5000, 0., 25.); 
745     fh2SumPtOutC20bkg = new TH2F("PtSumOutC20bkg","",150, 0., 150.,5000, 0., 25.); 
746     fh2SumPtOutC30bkg = new TH2F("PtSumOutC30bkg","",150, 0., 150.,5000, 0., 25.); 
747     fh2SumPtOutC60bkg = new TH2F("PtSumOutC60bkg","",150, 0., 150.,5000, 0., 25.); 
748     fh2SumPtOutC10bkglead = new TH2F("PtSumOutC10bkglead","",150, 0., 150.,5000, 0., 25.); 
749     fh2SumPtOutC20bkglead = new TH2F("PtSumOutC20bkglead","",150, 0., 150.,5000, 0., 25.); 
750     fh2SumPtOutC30bkglead = new TH2F("PtSumOutC30bkglead","",150, 0., 150.,5000, 0., 25.); 
751     fh2SumPtOutC60bkglead = new TH2F("PtSumOutC60bkglead","",150, 0., 150.,5000, 0., 25.); 
752     fh2SumPtOutC10bkgsublead = new TH2F("PtSumOutC10bkgsublead","",150, 0., 150.,5000, 0., 25.); 
753     fh2SumPtOutC20bkgsublead = new TH2F("PtSumOutC20bkgsublead","",150, 0., 150.,5000, 0., 25.); 
754     fh2SumPtOutC30bkgsublead = new TH2F("PtSumOutC30bkgsublead","",150, 0., 150.,5000, 0., 25.); 
755     fh2SumPtOutC60bkgsublead = new TH2F("PtSumOutC60bkgsublead","",150, 0., 150.,5000, 0., 25.); 
756
757
758
759     fh2DeltaRC10pt1 = new TH2F("DeltaRC10pt1","",150, 0., 150.,100,0.,1.5); 
760     fh2DeltaRC20pt1 = new TH2F("DeltaRC20pt1","",150, 0., 150.,100,0.,1.5); 
761     fh2DeltaRC30pt1 = new TH2F("DeltaRC30pt1","",150, 0., 150.,100,0.,1.5); 
762     fh2DeltaRC60pt1 = new TH2F("DeltaRC60pt1","",150, 0., 150.,100,0.,1.5); 
763     fh2DeltaRC10pt2 = new TH2F("DeltaRC10pt2","",150, 0., 150.,100,0.,1.5); 
764     fh2DeltaRC20pt2 = new TH2F("DeltaRC20pt2","",150, 0., 150.,100,0.,1.5); 
765     fh2DeltaRC30pt2 = new TH2F("DeltaRC30pt2","",150, 0., 150.,100,0.,1.5); 
766     fh2DeltaRC60pt2 = new TH2F("DeltaRC60pt2","",150, 0., 150.,100,0.,1.5); 
767     fh2DeltaRC10pt3 = new TH2F("DeltaRC10pt3","",150, 0., 150.,100,0.,1.5); 
768     fh2DeltaRC20pt3 = new TH2F("DeltaRC20pt3","",150, 0., 150.,100,0.,1.5); 
769     fh2DeltaRC30pt3 = new TH2F("DeltaRC30pt3","",150, 0., 150.,100,0.,1.5); 
770     fh2DeltaRC60pt3 = new TH2F("DeltaRC60pt3","",150, 0., 150.,100,0.,1.5); 
771     fh2DeltaRC10pt4 = new TH2F("DeltaRC10pt4","",150, 0., 150.,100,0.,1.5); 
772     fh2DeltaRC20pt4 = new TH2F("DeltaRC20pt4","",150, 0., 150.,100,0.,1.5); 
773     fh2DeltaRC30pt4 = new TH2F("DeltaRC30pt4","",150, 0., 150.,100,0.,1.5); 
774     fh2DeltaRC60pt4 = new TH2F("DeltaRC60pt4","",150, 0., 150.,100,0.,1.5); 
775     fh2DeltaEtaC10pt1 = new TH2F("DeltaEtaC10pt1","",150, 0., 150.,100,-1.5,1.5); 
776     fh2DeltaEtaC20pt1 = new TH2F("DeltaEtaC20pt1","",150, 0., 150.,100,-1.5,1.5); 
777     fh2DeltaEtaC30pt1 = new TH2F("DeltaEtaC30pt1","",150, 0., 150.,100,-1.5,1.5); 
778     fh2DeltaEtaC60pt1 = new TH2F("DeltaEtaC60pt1","",150, 0., 150.,100,-1.5,1.5); 
779     fh2DeltaEtaC10pt2 = new TH2F("DeltaEtaC10pt2","",150, 0., 150.,100,-1.5,1.5); 
780     fh2DeltaEtaC20pt2 = new TH2F("DeltaEtaC20pt2","",150, 0., 150.,100,-1.5,1.5); 
781     fh2DeltaEtaC30pt2 = new TH2F("DeltaEtaC30pt2","",150, 0., 150.,100,-1.5,1.5); 
782     fh2DeltaEtaC60pt2 = new TH2F("DeltaEtaC60pt2","",150, 0., 150.,100,-1.5,1.5); 
783     fh2DeltaEtaC10pt3 = new TH2F("DeltaEtaC10pt3","",150, 0., 150.,100,-1.5,1.5); 
784     fh2DeltaEtaC20pt3 = new TH2F("DeltaEtaC20pt3","",150, 0., 150.,100,-1.5,1.5); 
785     fh2DeltaEtaC30pt3 = new TH2F("DeltaEtaC30pt3","",150, 0., 150.,100,-1.5,1.5); 
786     fh2DeltaEtaC60pt3 = new TH2F("DeltaEtaC60pt3","",150, 0., 150.,100,-1.5,1.5); 
787     fh2DeltaEtaC10pt4 = new TH2F("DeltaEtaC10pt4","",150, 0., 150.,100,-1.5,1.5); 
788     fh2DeltaEtaC20pt4 = new TH2F("DeltaEtaC20pt4","",150, 0., 150.,100,-1.5,1.5); 
789     fh2DeltaEtaC30pt4 = new TH2F("DeltaEtaC30pt4","",150, 0., 150.,100,-1.5,1.5); 
790     fh2DeltaEtaC60pt4 = new TH2F("DeltaEtaC60pt4","",150, 0., 150.,100,-1.5,1.5); 
791     fh2DeltaPhiC10pt1 = new TH2F("DeltaPhiC10pt1","",150, 0., 150.,100,-6.5,6.5); 
792     fh2DeltaPhiC20pt1 = new TH2F("DeltaPhiC20pt1","",150, 0., 150.,100,-6.5,6.5); 
793     fh2DeltaPhiC30pt1 = new TH2F("DeltaPhiC30pt1","",150, 0., 150.,100,-6.5,6.5); 
794     fh2DeltaPhiC60pt1 = new TH2F("DeltaPhiC60pt1","",150, 0., 150.,100,-6.5,6.5); 
795     fh2DeltaPhiC10pt2 = new TH2F("DeltaPhiC10pt2","",150, 0., 150.,100,-6.5,6.5); 
796     fh2DeltaPhiC20pt2 = new TH2F("DeltaPhiC20pt2","",150, 0., 150.,100,-6.5,6.5); 
797     fh2DeltaPhiC30pt2 = new TH2F("DeltaPhiC30pt2","",150, 0., 150.,100,-6.5,6.5); 
798     fh2DeltaPhiC60pt2 = new TH2F("DeltaPhiC60pt2","",150, 0., 150.,100,-6.5,6.5); 
799     fh2DeltaPhiC10pt3 = new TH2F("DeltaPhiC10pt3","",150, 0., 150.,100,-6.5,6.5); 
800     fh2DeltaPhiC20pt3 = new TH2F("DeltaPhiC20pt3","",150, 0., 150.,100,-6.5,6.5); 
801     fh2DeltaPhiC30pt3 = new TH2F("DeltaPhiC30pt3","",150, 0., 150.,100,-6.5,6.5); 
802     fh2DeltaPhiC60pt3 = new TH2F("DeltaPhiC60pt3","",150, 0., 150.,100,-6.5,6.5); 
803     fh2DeltaPhiC10pt4 = new TH2F("DeltaPhiC10pt4","",150, 0., 150.,100,-6.5,6.5); 
804     fh2DeltaPhiC20pt4 = new TH2F("DeltaPhiC20pt4","",150, 0., 150.,100,-6.5,6.5); 
805     fh2DeltaPhiC30pt4 = new TH2F("DeltaPhiC30pt4","",150, 0., 150.,100,-6.5,6.5); 
806     fh2DeltaPhiC60pt4 = new TH2F("DeltaPhiC60pt4","",150, 0., 150.,100,-6.5,6.5); 
807
808     fh2DeltaRC10pt1lead = new TH2F("DeltaRC10pt1lead","",150, 0., 150.,100,0.,1.5); 
809     fh2DeltaRC20pt1lead = new TH2F("DeltaRC20pt1lead","",150, 0., 150.,100,0.,1.5); 
810     fh2DeltaRC30pt1lead = new TH2F("DeltaRC30pt1lead","",150, 0., 150.,100,0.,1.5); 
811     fh2DeltaRC60pt1lead = new TH2F("DeltaRC60pt1lead","",150, 0., 150.,100,0.,1.5); 
812     fh2DeltaRC10pt2lead = new TH2F("DeltaRC10pt2lead","",150, 0., 150.,100,0.,1.5); 
813     fh2DeltaRC20pt2lead = new TH2F("DeltaRC20pt2lead","",150, 0., 150.,100,0.,1.5); 
814     fh2DeltaRC30pt2lead = new TH2F("DeltaRC30pt2lead","",150, 0., 150.,100,0.,1.5); 
815     fh2DeltaRC60pt2lead = new TH2F("DeltaRC60pt2lead","",150, 0., 150.,100,0.,1.5); 
816     fh2DeltaRC10pt3lead = new TH2F("DeltaRC10pt3lead","",150, 0., 150.,100,0.,1.5); 
817     fh2DeltaRC20pt3lead = new TH2F("DeltaRC20pt3lead","",150, 0., 150.,100,0.,1.5); 
818     fh2DeltaRC30pt3lead = new TH2F("DeltaRC30pt3lead","",150, 0., 150.,100,0.,1.5); 
819     fh2DeltaRC60pt3lead = new TH2F("DeltaRC60pt3lead","",150, 0., 150.,100,0.,1.5); 
820     fh2DeltaRC10pt4lead = new TH2F("DeltaRC10pt4lead","",150, 0., 150.,100,0.,1.5); 
821     fh2DeltaRC20pt4lead = new TH2F("DeltaRC20pt4lead","",150, 0., 150.,100,0.,1.5); 
822     fh2DeltaRC30pt4lead = new TH2F("DeltaRC30pt4lead","",150, 0., 150.,100,0.,1.5); 
823     fh2DeltaRC60pt4lead = new TH2F("DeltaRC60pt4lead","",150, 0., 150.,100,0.,1.5); 
824     fh2DeltaEtaC10pt1lead = new TH2F("DeltaEtaC10pt1lead","",150, 0., 150.,100,-1.5,1.5); 
825     fh2DeltaEtaC20pt1lead = new TH2F("DeltaEtaC20pt1lead","",150, 0., 150.,100,-1.5,1.5); 
826     fh2DeltaEtaC30pt1lead = new TH2F("DeltaEtaC30pt1lead","",150, 0., 150.,100,-1.5,1.5); 
827     fh2DeltaEtaC60pt1lead = new TH2F("DeltaEtaC60pt1lead","",150, 0., 150.,100,-1.5,1.5); 
828     fh2DeltaEtaC10pt2lead = new TH2F("DeltaEtaC10pt2lead","",150, 0., 150.,100,-1.5,1.5); 
829     fh2DeltaEtaC20pt2lead = new TH2F("DeltaEtaC20pt2lead","",150, 0., 150.,100,-1.5,1.5); 
830     fh2DeltaEtaC30pt2lead = new TH2F("DeltaEtaC30pt2lead","",150, 0., 150.,100,-1.5,1.5); 
831     fh2DeltaEtaC60pt2lead = new TH2F("DeltaEtaC60pt2lead","",150, 0., 150.,100,-1.5,1.5); 
832     fh2DeltaEtaC10pt3lead = new TH2F("DeltaEtaC10pt3lead","",150, 0., 150.,100,-1.5,1.5); 
833     fh2DeltaEtaC20pt3lead = new TH2F("DeltaEtaC20pt3lead","",150, 0., 150.,100,-1.5,1.5); 
834     fh2DeltaEtaC30pt3lead = new TH2F("DeltaEtaC30pt3lead","",150, 0., 150.,100,-1.5,1.5); 
835     fh2DeltaEtaC60pt3lead = new TH2F("DeltaEtaC60pt3lead","",150, 0., 150.,100,-1.5,1.5); 
836     fh2DeltaEtaC10pt4lead = new TH2F("DeltaEtaC10pt4lead","",150, 0., 150.,100,-1.5,1.5); 
837     fh2DeltaEtaC20pt4lead = new TH2F("DeltaEtaC20pt4lead","",150, 0., 150.,100,-1.5,1.5); 
838     fh2DeltaEtaC30pt4lead = new TH2F("DeltaEtaC30pt4lead","",150, 0., 150.,100,-1.5,1.5); 
839     fh2DeltaEtaC60pt4lead = new TH2F("DeltaEtaC60pt4lead","",150, 0., 150.,100,-1.5,1.5); 
840     fh2DeltaPhiC10pt1lead = new TH2F("DeltaPhiC10pt1lead","",150, 0., 150.,100,-6.5,6.5); 
841     fh2DeltaPhiC20pt1lead = new TH2F("DeltaPhiC20pt1lead","",150, 0., 150.,100,-6.5,6.5); 
842     fh2DeltaPhiC30pt1lead = new TH2F("DeltaPhiC30pt1lead","",150, 0., 150.,100,-6.5,6.5); 
843     fh2DeltaPhiC60pt1lead = new TH2F("DeltaPhiC60pt1lead","",150, 0., 150.,100,-6.5,6.5); 
844     fh2DeltaPhiC10pt2lead = new TH2F("DeltaPhiC10pt2lead","",150, 0., 150.,100,-6.5,6.5); 
845     fh2DeltaPhiC20pt2lead = new TH2F("DeltaPhiC20pt2lead","",150, 0., 150.,100,-6.5,6.5); 
846     fh2DeltaPhiC30pt2lead = new TH2F("DeltaPhiC30pt2lead","",150, 0., 150.,100,-6.5,6.5); 
847     fh2DeltaPhiC60pt2lead = new TH2F("DeltaPhiC60pt2lead","",150, 0., 150.,100,-6.5,6.5); 
848     fh2DeltaPhiC10pt3lead = new TH2F("DeltaPhiC10pt3lead","",150, 0., 150.,100,-6.5,6.5); 
849     fh2DeltaPhiC20pt3lead = new TH2F("DeltaPhiC20pt3lead","",150, 0., 150.,100,-6.5,6.5); 
850     fh2DeltaPhiC30pt3lead = new TH2F("DeltaPhiC30pt3lead","",150, 0., 150.,100,-6.5,6.5); 
851     fh2DeltaPhiC60pt3lead = new TH2F("DeltaPhiC60pt3lead","",150, 0., 150.,100,-6.5,6.5); 
852     fh2DeltaPhiC10pt4lead = new TH2F("DeltaPhiC10pt4lead","",150, 0., 150.,100,-6.5,6.5); 
853     fh2DeltaPhiC20pt4lead = new TH2F("DeltaPhiC20pt4lead","",150, 0., 150.,100,-6.5,6.5); 
854     fh2DeltaPhiC30pt4lead = new TH2F("DeltaPhiC30pt4lead","",150, 0., 150.,100,-6.5,6.5); 
855     fh2DeltaPhiC60pt4lead = new TH2F("DeltaPhiC60pt4lead","",150, 0., 150.,100,-6.5,6.5); 
856
857
858     fh2DeltaRC10pt1sublead = new TH2F("DeltaRC10pt1sublead","",150, 0., 150.,100,0.,1.5); 
859     fh2DeltaRC20pt1sublead = new TH2F("DeltaRC20pt1sublead","",150, 0., 150.,100,0.,1.5); 
860     fh2DeltaRC30pt1sublead = new TH2F("DeltaRC30pt1sublead","",150, 0., 150.,100,0.,1.5); 
861     fh2DeltaRC60pt1sublead = new TH2F("DeltaRC60pt1sublead","",150, 0., 150.,100,0.,1.5); 
862     fh2DeltaRC10pt2sublead = new TH2F("DeltaRC10pt2sublead","",150, 0., 150.,100,0.,1.5); 
863     fh2DeltaRC20pt2sublead = new TH2F("DeltaRC20pt2sublead","",150, 0., 150.,100,0.,1.5); 
864     fh2DeltaRC30pt2sublead = new TH2F("DeltaRC30pt2sublead","",150, 0., 150.,100,0.,1.5); 
865     fh2DeltaRC60pt2sublead = new TH2F("DeltaRC60pt2sublead","",150, 0., 150.,100,0.,1.5); 
866     fh2DeltaRC10pt3sublead = new TH2F("DeltaRC10pt3sublead","",150, 0., 150.,100,0.,1.5); 
867     fh2DeltaRC20pt3sublead = new TH2F("DeltaRC20pt3sublead","",150, 0., 150.,100,0.,1.5); 
868     fh2DeltaRC30pt3sublead = new TH2F("DeltaRC30pt3sublead","",150, 0., 150.,100,0.,1.5); 
869     fh2DeltaRC60pt3sublead = new TH2F("DeltaRC60pt3sublead","",150, 0., 150.,100,0.,1.5); 
870     fh2DeltaRC10pt4sublead = new TH2F("DeltaRC10pt4sublead","",150, 0., 150.,100,0.,1.5); 
871     fh2DeltaRC20pt4sublead = new TH2F("DeltaRC20pt4sublead","",150, 0., 150.,100,0.,1.5); 
872     fh2DeltaRC30pt4sublead = new TH2F("DeltaRC30pt4sublead","",150, 0., 150.,100,0.,1.5); 
873     fh2DeltaRC60pt4sublead = new TH2F("DeltaRC60pt4sublead","",150, 0., 150.,100,0.,1.5); 
874     fh2DeltaEtaC10pt1sublead = new TH2F("DeltaEtaC10pt1sublead","",150, 0., 150.,100,-1.5,1.5); 
875     fh2DeltaEtaC20pt1sublead = new TH2F("DeltaEtaC20pt1sublead","",150, 0., 150.,100,-1.5,1.5); 
876     fh2DeltaEtaC30pt1sublead = new TH2F("DeltaEtaC30pt1sublead","",150, 0., 150.,100,-1.5,1.5); 
877     fh2DeltaEtaC60pt1sublead = new TH2F("DeltaEtaC60pt1sublead","",150, 0., 150.,100,-1.5,1.5); 
878     fh2DeltaEtaC10pt2sublead = new TH2F("DeltaEtaC10pt2sublead","",150, 0., 150.,100,-1.5,1.5); 
879     fh2DeltaEtaC20pt2sublead = new TH2F("DeltaEtaC20pt2sublead","",150, 0., 150.,100,-1.5,1.5); 
880     fh2DeltaEtaC30pt2sublead = new TH2F("DeltaEtaC30pt2sublead","",150, 0., 150.,100,-1.5,1.5); 
881     fh2DeltaEtaC60pt2sublead = new TH2F("DeltaEtaC60pt2sublead","",150, 0., 150.,100,-1.5,1.5); 
882     fh2DeltaEtaC10pt3sublead = new TH2F("DeltaEtaC10pt3sublead","",150, 0., 150.,100,-1.5,1.5); 
883     fh2DeltaEtaC20pt3sublead = new TH2F("DeltaEtaC20pt3sublead","",150, 0., 150.,100,-1.5,1.5); 
884     fh2DeltaEtaC30pt3sublead = new TH2F("DeltaEtaC30pt3sublead","",150, 0., 150.,100,-1.5,1.5); 
885     fh2DeltaEtaC60pt3sublead = new TH2F("DeltaEtaC60pt3sublead","",150, 0., 150.,100,-1.5,1.5); 
886     fh2DeltaEtaC10pt4sublead = new TH2F("DeltaEtaC10pt4sublead","",150, 0., 150.,100,-1.5,1.5); 
887     fh2DeltaEtaC20pt4sublead = new TH2F("DeltaEtaC20pt4sublead","",150, 0., 150.,100,-1.5,1.5); 
888     fh2DeltaEtaC30pt4sublead = new TH2F("DeltaEtaC30pt4sublead","",150, 0., 150.,100,-1.5,1.5); 
889     fh2DeltaEtaC60pt4sublead = new TH2F("DeltaEtaC60pt4sublead","",150, 0., 150.,100,-1.5,1.5); 
890     fh2DeltaPhiC10pt1sublead = new TH2F("DeltaPhiC10pt1sublead","",150, 0., 150.,100,-6.5,6.5); 
891     fh2DeltaPhiC20pt1sublead = new TH2F("DeltaPhiC20pt1sublead","",150, 0., 150.,100,-6.5,6.5); 
892     fh2DeltaPhiC30pt1sublead = new TH2F("DeltaPhiC30pt1sublead","",150, 0., 150.,100,-6.5,6.5); 
893     fh2DeltaPhiC60pt1sublead = new TH2F("DeltaPhiC60pt1sublead","",150, 0., 150.,100,-6.5,6.5); 
894     fh2DeltaPhiC10pt2sublead = new TH2F("DeltaPhiC10pt2sublead","",150, 0., 150.,100,-6.5,6.5); 
895     fh2DeltaPhiC20pt2sublead = new TH2F("DeltaPhiC20pt2sublead","",150, 0., 150.,100,-6.5,6.5); 
896     fh2DeltaPhiC30pt2sublead = new TH2F("DeltaPhiC30pt2sublead","",150, 0., 150.,100,-6.5,6.5); 
897     fh2DeltaPhiC60pt2sublead = new TH2F("DeltaPhiC60pt2sublead","",150, 0., 150.,100,-6.5,6.5); 
898     fh2DeltaPhiC10pt3sublead = new TH2F("DeltaPhiC10pt3sublead","",150, 0., 150.,100,-6.5,6.5); 
899     fh2DeltaPhiC20pt3sublead = new TH2F("DeltaPhiC20pt3sublead","",150, 0., 150.,100,-6.5,6.5); 
900     fh2DeltaPhiC30pt3sublead = new TH2F("DeltaPhiC30pt3sublead","",150, 0., 150.,100,-6.5,6.5); 
901     fh2DeltaPhiC60pt3sublead = new TH2F("DeltaPhiC60pt3sublead","",150, 0., 150.,100,-6.5,6.5); 
902     fh2DeltaPhiC10pt4sublead = new TH2F("DeltaPhiC10pt4sublead","",150, 0., 150.,100,-6.5,6.5); 
903     fh2DeltaPhiC20pt4sublead = new TH2F("DeltaPhiC20pt4sublead","",150, 0., 150.,100,-6.5,6.5); 
904     fh2DeltaPhiC30pt4sublead = new TH2F("DeltaPhiC30pt4sublead","",150, 0., 150.,100,-6.5,6.5); 
905     fh2DeltaPhiC60pt4sublead = new TH2F("DeltaPhiC60pt4sublead","",150, 0., 150.,100,-6.5,6.5); 
906
907
908
909
910
911       if(fAngStructCloseTracks>0){
912     fh2AngStructpt1C10 = new TH2F("Ang struct pt1 C10","",15,0.,1.5,150,0.,10.);
913     fh2AngStructpt2C10 = new TH2F("Ang struct pt2 C10","",15,0.,1.5,150,0.,10.);
914     fh2AngStructpt3C10 = new TH2F("Ang struct pt3 C10","",15,0.,1.5,150,0.,10.);
915     fh2AngStructpt4C10 = new TH2F("Ang struct pt4 C10","",15,0.,1.5,150,0.,10.);
916     fh2AngStructpt1C20 = new TH2F("Ang struct pt1 C20","",15,0.,1.5,150,0.,10.);
917     fh2AngStructpt2C20 = new TH2F("Ang struct pt2 C20","",15,0.,1.5,150,0.,10.);
918     fh2AngStructpt3C20 = new TH2F("Ang struct pt3 C20","",15,0.,1.5,150,0.,10.);
919     fh2AngStructpt4C20 = new TH2F("Ang struct pt4 C20","",15,0.,1.5,150,0.,10.);
920     fh2AngStructpt1C30 = new TH2F("Ang struct pt1 C30","",15,0.,1.5,150,0.,10.);
921     fh2AngStructpt2C30 = new TH2F("Ang struct pt2 C30","",15,0.,1.5,150,0.,10.);
922     fh2AngStructpt3C30 = new TH2F("Ang struct pt3 C30","",15,0.,1.5,150,0.,10.);
923     fh2AngStructpt4C30 = new TH2F("Ang struct pt4 C30","",15,0.,1.5,150,0.,10.);
924     fh2AngStructpt1C60 = new TH2F("Ang struct pt1 C60","",15,0.,1.5,150,0.,10.);
925     fh2AngStructpt2C60 = new TH2F("Ang struct pt2 C60","",15,0.,1.5,150,0.,10.);
926     fh2AngStructpt3C60 = new TH2F("Ang struct pt3 C60","",15,0.,1.5,150,0.,10.);
927     fh2AngStructpt4C60 = new TH2F("Ang struct pt4 C60","",15,0.,1.5,150,0.,10.); }
928
929    fOutputList->Add(fHistEvtSelection);
930    fOutputList->Add(fHistJetSelection);
931    fOutputList->Add(fh2JetSelection);
932
933       fOutputList->Add(fh2JetCoreMethod1C10);
934       fOutputList->Add(fh2JetCoreMethod2C10);
935       fOutputList->Add(fh2JetCoreMethod3C10);
936       fOutputList->Add(fh2JetCoreMethod1C20);
937       fOutputList->Add(fh2JetCoreMethod2C20);
938       fOutputList->Add(fh2JetCoreMethod3C20);
939       fOutputList->Add(fh2JetCoreMethod1C30);
940       fOutputList->Add(fh2JetCoreMethod2C30);
941       fOutputList->Add(fh2JetCoreMethod3C30);
942       fOutputList->Add(fh2JetCoreMethod1C60);
943       fOutputList->Add(fh2JetCoreMethod2C60);
944       fOutputList->Add(fh2JetCoreMethod3C60);
945       
946       fOutputList->Add(fh2JetCoreMethod3C10lead);
947       fOutputList->Add(fh2JetCoreMethod3C20lead);
948       fOutputList->Add(fh2JetCoreMethod3C30lead);
949       fOutputList->Add(fh2JetCoreMethod3C60lead);
950       fOutputList->Add(fh2JetCoreMethod3C10sublead);
951       fOutputList->Add(fh2JetCoreMethod3C20sublead);
952       fOutputList->Add(fh2JetCoreMethod3C30sublead);
953       fOutputList->Add(fh2JetCoreMethod3C60sublead);
954
955       fOutputList->Add(fh2SumPtInC10);
956       fOutputList->Add(fh2SumPtInC20);
957       fOutputList->Add(fh2SumPtInC30);
958       fOutputList->Add(fh2SumPtInC60);
959       fOutputList->Add(fh2SumPtInC10lead);
960       fOutputList->Add(fh2SumPtInC20lead);
961       fOutputList->Add(fh2SumPtInC30lead);
962       fOutputList->Add(fh2SumPtInC60lead);
963       fOutputList->Add(fh2SumPtInC10sublead);
964       fOutputList->Add(fh2SumPtInC20sublead);
965       fOutputList->Add(fh2SumPtInC30sublead);
966       fOutputList->Add(fh2SumPtInC60sublead); 
967
968       fOutputList->Add(fh2SumPtOutC10);
969       fOutputList->Add(fh2SumPtOutC20);
970       fOutputList->Add(fh2SumPtOutC30);
971       fOutputList->Add(fh2SumPtOutC60);
972       fOutputList->Add(fh2SumPtOutC10lead);
973       fOutputList->Add(fh2SumPtOutC20lead);
974       fOutputList->Add(fh2SumPtOutC30lead);
975       fOutputList->Add(fh2SumPtOutC60lead);
976       fOutputList->Add(fh2SumPtOutC10sublead);
977       fOutputList->Add(fh2SumPtOutC20sublead);
978       fOutputList->Add(fh2SumPtOutC30sublead);
979       fOutputList->Add(fh2SumPtOutC60sublead);
980       
981       fOutputList->Add(fh2SumPtInC10bkg);
982       fOutputList->Add(fh2SumPtInC20bkg);
983       fOutputList->Add(fh2SumPtInC30bkg);
984       fOutputList->Add(fh2SumPtInC60bkg);
985       fOutputList->Add(fh2SumPtInC10bkglead);
986       fOutputList->Add(fh2SumPtInC20bkglead);
987       fOutputList->Add(fh2SumPtInC30bkglead);
988       fOutputList->Add(fh2SumPtInC60bkglead);
989       fOutputList->Add(fh2SumPtInC10bkgsublead);
990       fOutputList->Add(fh2SumPtInC20bkgsublead);
991       fOutputList->Add(fh2SumPtInC30bkgsublead);
992       fOutputList->Add(fh2SumPtInC60bkgsublead);
993
994       fOutputList->Add(fh2SumPtOutC10bkg);
995       fOutputList->Add(fh2SumPtOutC20bkg);
996       fOutputList->Add(fh2SumPtOutC30bkg);
997       fOutputList->Add(fh2SumPtOutC60bkg);     
998       fOutputList->Add(fh2SumPtOutC10bkglead);
999       fOutputList->Add(fh2SumPtOutC20bkglead);
1000       fOutputList->Add(fh2SumPtOutC30bkglead);
1001       fOutputList->Add(fh2SumPtOutC60bkglead);     
1002       fOutputList->Add(fh2SumPtOutC10bkgsublead);
1003       fOutputList->Add(fh2SumPtOutC20bkgsublead);
1004       fOutputList->Add(fh2SumPtOutC30bkgsublead);
1005       fOutputList->Add(fh2SumPtOutC60bkgsublead);     
1006       
1007       fOutputList->Add(fh2DeltaRC10pt1);
1008       fOutputList->Add(fh2DeltaRC20pt1);
1009       fOutputList->Add(fh2DeltaRC30pt1);
1010       fOutputList->Add(fh2DeltaRC60pt1); 
1011       fOutputList->Add(fh2DeltaRC10pt2);
1012       fOutputList->Add(fh2DeltaRC20pt2);
1013       fOutputList->Add(fh2DeltaRC30pt2);
1014       fOutputList->Add(fh2DeltaRC60pt2); 
1015       fOutputList->Add(fh2DeltaRC10pt3);
1016       fOutputList->Add(fh2DeltaRC20pt3);
1017       fOutputList->Add(fh2DeltaRC30pt3);
1018       fOutputList->Add(fh2DeltaRC60pt3); 
1019       fOutputList->Add(fh2DeltaRC10pt4);
1020       fOutputList->Add(fh2DeltaRC20pt4);
1021       fOutputList->Add(fh2DeltaRC30pt4);
1022       fOutputList->Add(fh2DeltaRC60pt4);
1023       fOutputList->Add(fh2DeltaEtaC10pt1);
1024       fOutputList->Add(fh2DeltaEtaC20pt1);
1025       fOutputList->Add(fh2DeltaEtaC30pt1);
1026       fOutputList->Add(fh2DeltaEtaC60pt1); 
1027       fOutputList->Add(fh2DeltaEtaC10pt2);
1028       fOutputList->Add(fh2DeltaEtaC20pt2);
1029       fOutputList->Add(fh2DeltaEtaC30pt2);
1030       fOutputList->Add(fh2DeltaEtaC60pt2); 
1031       fOutputList->Add(fh2DeltaEtaC10pt3);
1032       fOutputList->Add(fh2DeltaEtaC20pt3);
1033       fOutputList->Add(fh2DeltaEtaC30pt3);
1034       fOutputList->Add(fh2DeltaEtaC60pt3); 
1035       fOutputList->Add(fh2DeltaEtaC10pt4);
1036       fOutputList->Add(fh2DeltaEtaC20pt4);
1037       fOutputList->Add(fh2DeltaEtaC30pt4);
1038       fOutputList->Add(fh2DeltaEtaC60pt4); 
1039       fOutputList->Add(fh2DeltaPhiC10pt1);
1040       fOutputList->Add(fh2DeltaPhiC20pt1);
1041       fOutputList->Add(fh2DeltaPhiC30pt1);
1042       fOutputList->Add(fh2DeltaPhiC60pt1); 
1043       fOutputList->Add(fh2DeltaPhiC10pt2);
1044       fOutputList->Add(fh2DeltaPhiC20pt2);
1045       fOutputList->Add(fh2DeltaPhiC30pt2);
1046       fOutputList->Add(fh2DeltaPhiC60pt2); 
1047       fOutputList->Add(fh2DeltaPhiC10pt3);
1048       fOutputList->Add(fh2DeltaPhiC20pt3);
1049       fOutputList->Add(fh2DeltaPhiC30pt3);
1050       fOutputList->Add(fh2DeltaPhiC60pt3); 
1051       fOutputList->Add(fh2DeltaPhiC10pt4);
1052       fOutputList->Add(fh2DeltaPhiC20pt4);
1053       fOutputList->Add(fh2DeltaPhiC30pt4);
1054       fOutputList->Add(fh2DeltaPhiC60pt4);      
1055
1056       fOutputList->Add(fh2DeltaRC10pt1lead);
1057       fOutputList->Add(fh2DeltaRC20pt1lead);
1058       fOutputList->Add(fh2DeltaRC30pt1lead);
1059       fOutputList->Add(fh2DeltaRC60pt1lead); 
1060       fOutputList->Add(fh2DeltaRC10pt2lead);
1061       fOutputList->Add(fh2DeltaRC20pt2lead);
1062       fOutputList->Add(fh2DeltaRC30pt2lead);
1063       fOutputList->Add(fh2DeltaRC60pt2lead); 
1064       fOutputList->Add(fh2DeltaRC10pt3lead);
1065       fOutputList->Add(fh2DeltaRC20pt3lead);
1066       fOutputList->Add(fh2DeltaRC30pt3lead);
1067       fOutputList->Add(fh2DeltaRC60pt3lead); 
1068       fOutputList->Add(fh2DeltaRC10pt4lead);
1069       fOutputList->Add(fh2DeltaRC20pt4lead);
1070       fOutputList->Add(fh2DeltaRC30pt4lead);
1071       fOutputList->Add(fh2DeltaRC60pt4lead);
1072       fOutputList->Add(fh2DeltaEtaC10pt1lead);
1073       fOutputList->Add(fh2DeltaEtaC20pt1lead);
1074       fOutputList->Add(fh2DeltaEtaC30pt1lead);
1075       fOutputList->Add(fh2DeltaEtaC60pt1lead); 
1076       fOutputList->Add(fh2DeltaEtaC10pt2lead);
1077       fOutputList->Add(fh2DeltaEtaC20pt2lead);
1078       fOutputList->Add(fh2DeltaEtaC30pt2lead);
1079       fOutputList->Add(fh2DeltaEtaC60pt2lead); 
1080       fOutputList->Add(fh2DeltaEtaC10pt3lead);
1081       fOutputList->Add(fh2DeltaEtaC20pt3lead);
1082       fOutputList->Add(fh2DeltaEtaC30pt3lead);
1083       fOutputList->Add(fh2DeltaEtaC60pt3lead); 
1084       fOutputList->Add(fh2DeltaEtaC10pt4lead);
1085       fOutputList->Add(fh2DeltaEtaC20pt4lead);
1086       fOutputList->Add(fh2DeltaEtaC30pt4lead);
1087       fOutputList->Add(fh2DeltaEtaC60pt4lead); 
1088       fOutputList->Add(fh2DeltaPhiC10pt1lead);
1089       fOutputList->Add(fh2DeltaPhiC20pt1lead);
1090       fOutputList->Add(fh2DeltaPhiC30pt1lead);
1091       fOutputList->Add(fh2DeltaPhiC60pt1lead); 
1092       fOutputList->Add(fh2DeltaPhiC10pt2lead);
1093       fOutputList->Add(fh2DeltaPhiC20pt2lead);
1094       fOutputList->Add(fh2DeltaPhiC30pt2lead);
1095       fOutputList->Add(fh2DeltaPhiC60pt2lead); 
1096       fOutputList->Add(fh2DeltaPhiC10pt3lead);
1097       fOutputList->Add(fh2DeltaPhiC20pt3lead);
1098       fOutputList->Add(fh2DeltaPhiC30pt3lead);
1099       fOutputList->Add(fh2DeltaPhiC60pt3lead); 
1100       fOutputList->Add(fh2DeltaPhiC10pt4lead);
1101       fOutputList->Add(fh2DeltaPhiC20pt4lead);
1102       fOutputList->Add(fh2DeltaPhiC30pt4lead);
1103       fOutputList->Add(fh2DeltaPhiC60pt4lead);      
1104
1105
1106
1107       fOutputList->Add(fh2DeltaRC10pt1sublead);
1108       fOutputList->Add(fh2DeltaRC20pt1sublead);
1109       fOutputList->Add(fh2DeltaRC30pt1sublead);
1110       fOutputList->Add(fh2DeltaRC60pt1sublead); 
1111       fOutputList->Add(fh2DeltaRC10pt2sublead);
1112       fOutputList->Add(fh2DeltaRC20pt2sublead);
1113       fOutputList->Add(fh2DeltaRC30pt2sublead);
1114       fOutputList->Add(fh2DeltaRC60pt2sublead); 
1115       fOutputList->Add(fh2DeltaRC10pt3sublead);
1116       fOutputList->Add(fh2DeltaRC20pt3sublead);
1117       fOutputList->Add(fh2DeltaRC30pt3sublead);
1118       fOutputList->Add(fh2DeltaRC60pt3sublead); 
1119       fOutputList->Add(fh2DeltaRC10pt4sublead);
1120       fOutputList->Add(fh2DeltaRC20pt4sublead);
1121       fOutputList->Add(fh2DeltaRC30pt4sublead);
1122       fOutputList->Add(fh2DeltaRC60pt4sublead);
1123       fOutputList->Add(fh2DeltaEtaC10pt1sublead);
1124       fOutputList->Add(fh2DeltaEtaC20pt1sublead);
1125       fOutputList->Add(fh2DeltaEtaC30pt1sublead);
1126       fOutputList->Add(fh2DeltaEtaC60pt1sublead); 
1127       fOutputList->Add(fh2DeltaEtaC10pt2sublead);
1128       fOutputList->Add(fh2DeltaEtaC20pt2sublead);
1129       fOutputList->Add(fh2DeltaEtaC30pt2sublead);
1130       fOutputList->Add(fh2DeltaEtaC60pt2sublead); 
1131       fOutputList->Add(fh2DeltaEtaC10pt3sublead);
1132       fOutputList->Add(fh2DeltaEtaC20pt3sublead);
1133       fOutputList->Add(fh2DeltaEtaC30pt3sublead);
1134       fOutputList->Add(fh2DeltaEtaC60pt3sublead); 
1135       fOutputList->Add(fh2DeltaEtaC10pt4sublead);
1136       fOutputList->Add(fh2DeltaEtaC20pt4sublead);
1137       fOutputList->Add(fh2DeltaEtaC30pt4sublead);
1138       fOutputList->Add(fh2DeltaEtaC60pt4sublead); 
1139       fOutputList->Add(fh2DeltaPhiC10pt1sublead);
1140       fOutputList->Add(fh2DeltaPhiC20pt1sublead);
1141       fOutputList->Add(fh2DeltaPhiC30pt1sublead);
1142       fOutputList->Add(fh2DeltaPhiC60pt1sublead); 
1143       fOutputList->Add(fh2DeltaPhiC10pt2sublead);
1144       fOutputList->Add(fh2DeltaPhiC20pt2sublead);
1145       fOutputList->Add(fh2DeltaPhiC30pt2sublead);
1146       fOutputList->Add(fh2DeltaPhiC60pt2sublead); 
1147       fOutputList->Add(fh2DeltaPhiC10pt3sublead);
1148       fOutputList->Add(fh2DeltaPhiC20pt3sublead);
1149       fOutputList->Add(fh2DeltaPhiC30pt3sublead);
1150       fOutputList->Add(fh2DeltaPhiC60pt3sublead); 
1151       fOutputList->Add(fh2DeltaPhiC10pt4sublead);
1152       fOutputList->Add(fh2DeltaPhiC20pt4sublead);
1153       fOutputList->Add(fh2DeltaPhiC30pt4sublead);
1154       fOutputList->Add(fh2DeltaPhiC60pt4sublead);      
1155      
1156        
1157
1158
1159
1160         if(fAngStructCloseTracks>0){
1161        fOutputList->Add(fh2AngStructpt1C10);
1162        fOutputList->Add(fh2AngStructpt2C10);
1163        fOutputList->Add(fh2AngStructpt3C10);
1164        fOutputList->Add(fh2AngStructpt4C10); 
1165        fOutputList->Add(fh2AngStructpt1C20);
1166        fOutputList->Add(fh2AngStructpt2C20);
1167        fOutputList->Add(fh2AngStructpt3C20);
1168        fOutputList->Add(fh2AngStructpt4C20); 
1169        fOutputList->Add(fh2AngStructpt1C30);
1170        fOutputList->Add(fh2AngStructpt2C30);
1171        fOutputList->Add(fh2AngStructpt3C30);
1172        fOutputList->Add(fh2AngStructpt4C30);
1173        fOutputList->Add(fh2AngStructpt1C60);
1174        fOutputList->Add(fh2AngStructpt2C60);
1175        fOutputList->Add(fh2AngStructpt3C60);
1176        fOutputList->Add(fh2AngStructpt4C60);}  
1177
1178
1179
1180
1181    // =========== Switch on Sumw2 for all histos ===========
1182    for (Int_t i=0; i<fOutputList->GetEntries(); ++i) {
1183       TH1 *h1 = dynamic_cast<TH1*>(fOutputList->At(i));
1184       if (h1){
1185          h1->Sumw2();
1186          continue;
1187       }
1188     THnSparse *hn = dynamic_cast<THnSparse*>(fOutputList->At(i));
1189       if (hn){
1190          hn->Sumw2();
1191       }   
1192    }
1193    TH1::AddDirectory(oldStatus);
1194
1195    PostData(1, fOutputList);
1196 }
1197
1198 void AliAnalysisTaskJetCore::UserExec(Option_t *)
1199 {
1200    
1201
1202    if(!strlen(fJetBranchName[0].Data()) || !strlen(fJetBranchName[1].Data())){
1203       AliError("Jet branch name not set.");
1204       return;
1205    }
1206
1207    fESD=dynamic_cast<AliESDEvent*>(InputEvent());
1208    if (!fESD) {
1209       AliError("ESD not available");
1210       fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
1211    } else {
1212       fAOD = dynamic_cast<AliAODEvent*>(AODEvent());
1213    }
1214  
1215     if(fNonStdFile.Length()!=0){
1216     // case that we have an AOD extension we need can fetch the jets from the extended output
1217     AliAODHandler *aodH = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler());
1218     fAODExtension = (aodH?aodH->GetExtension(fNonStdFile.Data()):0);
1219     if(!fAODExtension){
1220       if(fDebug>1)Printf("AODExtension found for %s",fNonStdFile.Data());
1221     }}
1222     
1223
1224
1225
1226
1227    // -- event selection --
1228    fHistEvtSelection->Fill(1); // number of events before event selection
1229
1230    // physics selection
1231    AliInputEventHandler* inputHandler = (AliInputEventHandler*)
1232    ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
1233    if(!(inputHandler->IsEventSelected() & fOfflineTrgMask)){
1234       if(fDebug) Printf(" Trigger Selection: event REJECTED ... ");
1235       fHistEvtSelection->Fill(2);
1236       PostData(1, fOutputList);
1237       return;
1238    }
1239
1240    // vertex selection
1241    AliAODVertex* primVtx = fAOD->GetPrimaryVertex();
1242    Int_t nTracksPrim = primVtx->GetNContributors();
1243    if ((nTracksPrim < fMinContribVtx) ||
1244          (primVtx->GetZ() < fVtxZMin) ||
1245          (primVtx->GetZ() > fVtxZMax) ){
1246       if(fDebug) Printf("%s:%d primary vertex z = %f: event REJECTED...",(char*)__FILE__,__LINE__,primVtx->GetZ());
1247       fHistEvtSelection->Fill(3);
1248       PostData(1, fOutputList);
1249       return;
1250    }
1251
1252    // event class selection (from jet helper task)
1253    Int_t eventClass = AliAnalysisHelperJetTasks::EventClass();
1254    if(fDebug) Printf("Event class %d", eventClass);
1255    if (eventClass < fEvtClassMin || eventClass > fEvtClassMax){
1256       fHistEvtSelection->Fill(4);
1257       PostData(1, fOutputList);
1258       return;
1259    }
1260
1261    // centrality selection
1262    AliCentrality *cent = 0x0;
1263    Float_t centValue = 0.; 
1264    if(fESD) cent = fESD->GetCentrality();
1265    if(cent) centValue = cent->GetCentralityPercentile("V0M");
1266    if(fDebug) printf("centrality: %f\n", centValue);
1267    if (centValue < fCentMin || centValue > fCentMax){
1268       fHistEvtSelection->Fill(4);
1269       PostData(1, fOutputList);
1270       return;
1271    }
1272
1273
1274    // multiplicity due to input tracks
1275    //Int_t nInputTracks = GetNInputTracks();
1276    //if (nInputTracks < fNInputTracksMin || (fNInputTracksMax > -1 && nInputTracks > fNInputTracksMax)){
1277    //   fHistEvtSelection->Fill(5);
1278    //   PostData(1, fOutputList);
1279    //   return;
1280    // }
1281
1282    
1283    fHistEvtSelection->Fill(0); 
1284    // accepted events  
1285    // -- end event selection --
1286   
1287    // get background
1288    AliAODJetEventBackground* externalBackground = 0;
1289    if(fAOD&&!externalBackground&&fBackgroundBranch.Length()){
1290       externalBackground =  (AliAODJetEventBackground*)(fAOD->FindListObject(fBackgroundBranch.Data()));
1291       if(!externalBackground)Printf("%s:%d Background branch not found %s",(char*)__FILE__,__LINE__,fBackgroundBranch.Data());;
1292    }
1293    if(fAODExtension&&!externalBackground&&fBackgroundBranch.Length()){
1294      externalBackground =  (AliAODJetEventBackground*)(fAODExtension->GetAOD()->FindListObject(fBackgroundBranch.Data()));
1295       if(!externalBackground)Printf("%s:%d Background branch not found %s",(char*)__FILE__,__LINE__,fBackgroundBranch.Data());;
1296    }
1297    
1298    Float_t rho = 0;
1299    if(externalBackground)rho = externalBackground->GetBackground(0);
1300
1301
1302    // fetch jets
1303    TClonesArray *aodJets[2];
1304    aodJets[0]=0;
1305    if(fAOD&&!aodJets[0]){
1306    aodJets[0] = dynamic_cast<TClonesArray*>(fAOD->FindListObject(fJetBranchName[0].Data())); 
1307    aodJets[1] = dynamic_cast<TClonesArray*>(fAOD->FindListObject(fJetBranchName[1].Data()));  }
1308    if(fAODExtension && !aodJets[0]){ 
1309      aodJets[0] = dynamic_cast<TClonesArray*>(fAODExtension->GetAOD()->FindListObject(fJetBranchName[0].Data())); 
1310      aodJets[1] = dynamic_cast<TClonesArray*>(fAODExtension->GetAOD()->FindListObject(fJetBranchName[1].Data()));  }
1311
1312    Double_t ptsub[aodJets[0]->GetEntriesFast()];
1313    Int_t inord[aodJets[0]->GetEntriesFast()];
1314    for(Int_t n=0;n<aodJets[0]->GetEntriesFast();n++){
1315      ptsub[n]=0;
1316      inord[n]=0;}   
1317
1318    TList ParticleList;
1319    Int_t nT = GetListOfTracks(&ParticleList);
1320      for (Int_t iJetType = 0; iJetType < 2; iJetType++) {
1321       fListJets[iJetType]->Clear();
1322       if (!aodJets[iJetType]) continue;
1323
1324       if(fDebug) Printf("%s: %d jets",fJetBranchName[iJetType].Data(),aodJets[iJetType]->GetEntriesFast());
1325       
1326    
1327       for (Int_t iJet = 0; iJet < aodJets[iJetType]->GetEntriesFast(); iJet++) {
1328          AliAODJet *jet = dynamic_cast<AliAODJet*>((*aodJets[iJetType])[iJet]);
1329          if (jet) fListJets[iJetType]->Add(jet);
1330          if(iJetType==0){
1331            ptsub[iJet]=jet->Pt()-rho*jet->EffectiveAreaCharged();
1332          }}}
1333    
1334    Double_t etabig=0;
1335    Double_t ptbig=0;
1336    Double_t areabig=0;
1337    Double_t phibig=0.;
1338    Double_t etasmall=0;
1339    Double_t ptsmall=0;
1340    Double_t areasmall=0;
1341    Double_t distr=0.;
1342    Double_t phismall=0.;
1343    Int_t indexlead=-1;
1344    Int_t indexsublead=-1;
1345    Int_t indexstop=-1;
1346   
1347    TMath::Sort(fListJets[0]->GetEntries(),ptsub,inord);
1348
1349    for(Int_t jj=0;jj<fListJets[0]->GetEntries();jj++){
1350    AliAODJet* jetlead = (AliAODJet*)(fListJets[0]->At(inord[jj]));
1351    if(jetlead->Pt()-rho*jetlead->EffectiveAreaCharged()<=0) continue;
1352    if((jetlead->Eta()<fJetEtaMin)||(jetlead->Eta()>fJetEtaMax)) continue;
1353    indexlead=inord[jj];
1354    indexstop=jj;
1355    break;}
1356    if((indexstop>-1)&&(indexstop+1<fListJets[0]->GetEntries()-1)){
1357    for(Int_t k=indexstop+1;k<fListJets[0]->GetEntries();k++){
1358    AliAODJet* jetsublead = (AliAODJet*)(fListJets[0]->At(inord[k]));
1359    if(jetsublead->Pt()-rho*jetsublead->EffectiveAreaCharged()<=0) continue;
1360    if((jetsublead->Eta()<fJetEtaMin)||(jetsublead->Eta()>fJetEtaMax)) continue;
1361    indexsublead=inord[k];
1362    break;}}
1363          
1364
1365    Double_t up1[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
1366    Double_t up2[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
1367    Double_t up3[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
1368    Double_t up4[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
1369    Double_t down1[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
1370    Double_t down2[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
1371    Double_t down3[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
1372    Double_t down4[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
1373
1374
1375
1376    for(Int_t i=0; i<fListJets[0]->GetEntries(); ++i){
1377            AliAODJet* jetbig = (AliAODJet*)(fListJets[0]->At(i));
1378            etabig  = jetbig->Eta();
1379            phibig  = jetbig->Phi();
1380            ptbig   = jetbig->Pt();
1381            if(ptbig==0) continue; 
1382            areabig = jetbig->EffectiveAreaCharged();
1383            Double_t ptcorr=ptbig-rho*areabig;
1384            if(ptcorr<=0) continue;
1385            if((etabig<fJetEtaMin)||(etabig>fJetEtaMax)) continue;
1386                    Double_t dismin=100.;
1387                    Double_t ptmax=-10.; 
1388                    Int_t index1=-1;
1389                    Int_t index2=-1;
1390                    Double_t fracin=0.;
1391                    Double_t sumPtIn=0.;
1392                    Double_t sumPtOut=0.; 
1393            //compute sum of the pt of the tracks in a concentric cone
1394            TRefArray *genTrackList = jetbig->GetRefTracks();
1395            Int_t nTracksGenJet = genTrackList->GetEntriesFast();
1396            AliAODTrack* genTrack;
1397              for(Int_t ir=0; ir<nTracksGenJet; ++ir){
1398              genTrack = (AliAODTrack*)(genTrackList->At(ir));
1399              Float_t etr=genTrack->Eta();
1400              Float_t phir=genTrack->Phi();
1401              distr=(etr-etabig)*(etr-etabig)+(phir-phibig)*(phir-phibig);
1402              distr=TMath::Sqrt(distr);
1403              if(distr<=fRadioFrac){ fracin=fracin+genTrack->Pt();}}
1404     
1405              if(centValue<10) {fh2JetCoreMethod3C10->Fill(ptcorr,fracin/ptbig);
1406                if(i==indexlead) fh2JetCoreMethod3C10lead->Fill(ptcorr,fracin/ptbig);
1407                if(i==indexsublead) fh2JetCoreMethod3C10sublead->Fill(ptcorr,fracin/ptbig);}
1408
1409               
1410              if((centValue>20)&&(centValue<40)) {fh2JetCoreMethod3C20->Fill(ptcorr,fracin/ptbig);
1411                                                  if(i==indexlead) fh2JetCoreMethod3C20lead->Fill(ptcorr,fracin/ptbig);
1412                                                  if(i==indexsublead) fh2JetCoreMethod3C20sublead->Fill(ptcorr,fracin/ptbig);}
1413              if((centValue>30)&&(centValue<60)){ fh2JetCoreMethod3C30->Fill(ptcorr,fracin/ptbig);
1414                                                 if(i==indexlead) fh2JetCoreMethod3C30lead->Fill(ptcorr,fracin/ptbig);
1415                                                 if(i==indexsublead) fh2JetCoreMethod3C30sublead->Fill(ptcorr,fracin/ptbig);}
1416              if(centValue>60){fh2JetCoreMethod3C60->Fill(ptcorr,fracin/ptbig);
1417                                                 if(i==indexlead) fh2JetCoreMethod3C60lead->Fill(ptcorr,fracin/ptbig);
1418                                                 if(i==indexsublead) fh2JetCoreMethod3C60sublead->Fill(ptcorr,fracin/ptbig);}
1419    
1420              
1421
1422                 for(Int_t j=0; j<fListJets[1]->GetEntries(); ++j){
1423                   AliAODJet* jetsmall = (AliAODJet*)(fListJets[1]->At(j));
1424                   etasmall  = jetsmall->Eta();
1425                   phismall = jetsmall->Phi();
1426                   ptsmall   = jetsmall->Pt();
1427                   areasmall = jetsmall->EffectiveAreaCharged();
1428                   Double_t tmpDeltaR=(phismall-phibig)*(phismall-phibig)+(etasmall-etabig)*(etasmall-etabig);
1429                   tmpDeltaR=TMath::Sqrt(tmpDeltaR);
1430                      //Fraction in the jet core  
1431                     if((ptsmall>ptmax)&&(tmpDeltaR<=fRadioFrac)){ptmax=ptsmall;  
1432                     index2=j;}  
1433                     if(tmpDeltaR<=dismin){ dismin=tmpDeltaR;
1434                       index1=j;}} //en of loop over R=0.2 jets
1435                 //method1:most concentric jet=core 
1436                 if(dismin<fMinDist){ AliAODJet* jetmethod1 = (AliAODJet*)(fListJets[1]->At(index1));       
1437                   if(centValue<10) fh2JetCoreMethod1C10->Fill(ptcorr,jetmethod1->Pt()/ptbig);
1438                   if((centValue>20)&&(centValue<40)) fh2JetCoreMethod1C20->Fill(ptcorr,jetmethod1->Pt()/ptbig);
1439                   if((centValue>30)&&(centValue<60)) fh2JetCoreMethod1C30->Fill(ptcorr,jetmethod1->Pt()/ptbig);
1440                   if(centValue>60) fh2JetCoreMethod1C60->Fill(ptcorr,jetmethod1->Pt()/ptbig); }
1441                 //method2:hardest contained jet=core   
1442                 if(index2!=-1){ 
1443                   AliAODJet* jetmethod2 = (AliAODJet*)(fListJets[1]->At(index2));
1444                   if(centValue<10) fh2JetCoreMethod2C10->Fill(ptcorr,jetmethod2->Pt()/ptbig);
1445                   if((centValue>20)&&(centValue<40)) fh2JetCoreMethod2C20->Fill(ptcorr,jetmethod2->Pt()/ptbig); 
1446                   if((centValue>30)&&(centValue<60)) fh2JetCoreMethod2C30->Fill(ptcorr,jetmethod2->Pt()/ptbig);
1447                   if(centValue>60) fh2JetCoreMethod2C60->Fill(ptcorr,jetmethod2->Pt()/ptbig); }  
1448
1449      Double_t R=fRadioFrac*2.;      
1450   
1451      for(int it = 0;it<nT;++it){
1452
1453           AliVParticle *part = (AliVParticle*)ParticleList.At(it);
1454           Float_t deltaR = jetbig->DeltaR(part);
1455           Float_t deltaEta = part->Eta()-etabig;
1456           Float_t deltaPhi = part->Phi()-phibig;  
1457           if((deltaR>=0.4)&&(deltaR<=0.6))sumPtIn=sumPtIn+part->Pt();                     
1458           if((deltaR>=0.8)&&(deltaR<=1.))sumPtOut=sumPtOut+part->Pt();     
1459           if(centValue<10.){
1460             
1461                if((ptcorr>=70.)&&(ptcorr<85.)) {fh2DeltaRC10pt1->Fill(part->Pt(),deltaR);
1462                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R))fh2DeltaEtaC10pt1->Fill(part->Pt(),deltaEta);
1463                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC10pt1->Fill(part->Pt(),deltaPhi);}
1464                if((ptcorr>=85.)&&(ptcorr<100.)) {fh2DeltaRC10pt2->Fill(part->Pt(),deltaR);
1465                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC10pt2->Fill(part->Pt(),deltaEta);
1466                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC10pt2->Fill(part->Pt(),deltaPhi); }
1467                if((ptcorr>=100.)&&(ptcorr<120.)) {fh2DeltaRC10pt3->Fill(part->Pt(),deltaR);
1468                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC10pt3->Fill(part->Pt(),deltaEta);
1469                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC10pt3->Fill(part->Pt(),deltaPhi);}
1470                if((ptcorr>=120.)&&(ptcorr<140.)) {fh2DeltaRC10pt4->Fill(part->Pt(),deltaR); 
1471                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC10pt4->Fill(part->Pt(),deltaEta);
1472                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC10pt4->Fill(part->Pt(),deltaPhi); }
1473
1474                if(i==indexlead){
1475                if((ptcorr>=70.)&&(ptcorr<85.)) {fh2DeltaRC10pt1lead->Fill(part->Pt(),deltaR);
1476                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R))fh2DeltaEtaC10pt1lead->Fill(part->Pt(),deltaEta);
1477                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC10pt1lead->Fill(part->Pt(),deltaPhi);}
1478                if((ptcorr>=85.)&&(ptcorr<100.)) {fh2DeltaRC10pt2lead->Fill(part->Pt(),deltaR);
1479                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC10pt2lead->Fill(part->Pt(),deltaEta);
1480                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC10pt2lead->Fill(part->Pt(),deltaPhi); }
1481                if((ptcorr>=100.)&&(ptcorr<120.)) {fh2DeltaRC10pt3lead->Fill(part->Pt(),deltaR);
1482                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC10pt3lead->Fill(part->Pt(),deltaEta);
1483                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC10pt3lead->Fill(part->Pt(),deltaPhi);}
1484                if((ptcorr>=120.)&&(ptcorr<140.)) {fh2DeltaRC10pt4lead->Fill(part->Pt(),deltaR); 
1485                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC10pt4lead->Fill(part->Pt(),deltaEta);
1486                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC10pt4lead->Fill(part->Pt(),deltaPhi); }}
1487
1488
1489                if(i==indexsublead){
1490                if((ptcorr>=70.)&&(ptcorr<85.)) {fh2DeltaRC10pt1sublead->Fill(part->Pt(),deltaR);
1491                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R))fh2DeltaEtaC10pt1sublead->Fill(part->Pt(),deltaEta);
1492                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC10pt1sublead->Fill(part->Pt(),deltaPhi);}
1493                if((ptcorr>=85.)&&(ptcorr<100.)) {fh2DeltaRC10pt2sublead->Fill(part->Pt(),deltaR);
1494                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC10pt2sublead->Fill(part->Pt(),deltaEta);
1495                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC10pt2sublead->Fill(part->Pt(),deltaPhi); }
1496                if((ptcorr>=100.)&&(ptcorr<120.)) {fh2DeltaRC10pt3sublead->Fill(part->Pt(),deltaR);
1497                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC10pt3sublead->Fill(part->Pt(),deltaEta);
1498                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC10pt3sublead->Fill(part->Pt(),deltaPhi);}
1499                if((ptcorr>=120.)&&(ptcorr<140.)) {fh2DeltaRC10pt4sublead->Fill(part->Pt(),deltaR); 
1500                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC10pt4sublead->Fill(part->Pt(),deltaEta);
1501                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC10pt4sublead->Fill(part->Pt(),deltaPhi); }} 
1502
1503  
1504
1505
1506           }
1507
1508           if((centValue>20.)&&(centValue<40.)){
1509               if((ptcorr>=70.)&&(ptcorr<85.)) {fh2DeltaRC20pt1->Fill(part->Pt(),deltaR);
1510               if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R))fh2DeltaEtaC20pt1->Fill(part->Pt(),deltaEta);
1511               if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC20pt1->Fill(part->Pt(),deltaPhi);}
1512               if((ptcorr>=85.)&&(ptcorr<100.)) {fh2DeltaRC20pt2->Fill(part->Pt(),deltaR);
1513               if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC20pt2->Fill(part->Pt(),deltaEta);
1514               if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC20pt2->Fill(part->Pt(),deltaPhi); }
1515               if((ptcorr>=100.)&&(ptcorr<120.)) {fh2DeltaRC20pt3->Fill(part->Pt(),deltaR);
1516               if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC20pt3->Fill(part->Pt(),deltaEta);
1517               if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC20pt3->Fill(part->Pt(),deltaPhi);}
1518               if((ptcorr>=120.)&&(ptcorr<140.)) {fh2DeltaRC20pt4->Fill(part->Pt(),deltaR); 
1519               if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC20pt4->Fill(part->Pt(),deltaEta);
1520               if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC20pt4->Fill(part->Pt(),deltaPhi); }
1521
1522                if(i==indexlead){
1523                if((ptcorr>=70.)&&(ptcorr<85.)) {fh2DeltaRC20pt1lead->Fill(part->Pt(),deltaR);
1524                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R))fh2DeltaEtaC20pt1lead->Fill(part->Pt(),deltaEta);
1525                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC20pt1lead->Fill(part->Pt(),deltaPhi);}
1526                if((ptcorr>=85.)&&(ptcorr<100.)) {fh2DeltaRC20pt2lead->Fill(part->Pt(),deltaR);
1527                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC20pt2lead->Fill(part->Pt(),deltaEta);
1528                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC20pt2lead->Fill(part->Pt(),deltaPhi); }
1529                if((ptcorr>=100.)&&(ptcorr<120.)) {fh2DeltaRC20pt3lead->Fill(part->Pt(),deltaR);
1530                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC20pt3lead->Fill(part->Pt(),deltaEta);
1531                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC20pt3lead->Fill(part->Pt(),deltaPhi);}
1532                if((ptcorr>=120.)&&(ptcorr<140.)) {fh2DeltaRC20pt4lead->Fill(part->Pt(),deltaR); 
1533                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC20pt4lead->Fill(part->Pt(),deltaEta);
1534                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC20pt4lead->Fill(part->Pt(),deltaPhi); }}
1535                              
1536                if(i==indexsublead){
1537                if((ptcorr>=70.)&&(ptcorr<85.)) {fh2DeltaRC20pt1sublead->Fill(part->Pt(),deltaR);
1538                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R))fh2DeltaEtaC20pt1sublead->Fill(part->Pt(),deltaEta);
1539                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC20pt1sublead->Fill(part->Pt(),deltaPhi);}
1540                if((ptcorr>=85.)&&(ptcorr<100.)) {fh2DeltaRC20pt2sublead->Fill(part->Pt(),deltaR);
1541                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC20pt2sublead->Fill(part->Pt(),deltaEta);
1542                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC20pt2sublead->Fill(part->Pt(),deltaPhi); }
1543                if((ptcorr>=100.)&&(ptcorr<120.)) {fh2DeltaRC20pt3sublead->Fill(part->Pt(),deltaR);
1544                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC20pt3sublead->Fill(part->Pt(),deltaEta);
1545                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC20pt3sublead->Fill(part->Pt(),deltaPhi);}
1546                if((ptcorr>=120.)&&(ptcorr<140.)) {fh2DeltaRC20pt4sublead->Fill(part->Pt(),deltaR); 
1547                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC20pt4sublead->Fill(part->Pt(),deltaEta);
1548                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC20pt4sublead->Fill(part->Pt(),deltaPhi); }} 
1549
1550           }
1551
1552           if((centValue>30.)&&(centValue<60.)){
1553
1554               if((ptcorr>=70.)&&(ptcorr<85.)) {fh2DeltaRC30pt1->Fill(part->Pt(),deltaR);
1555               if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R))fh2DeltaEtaC30pt1->Fill(part->Pt(),deltaEta);
1556               if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC30pt1->Fill(part->Pt(),deltaPhi);}
1557               if((ptcorr>=85.)&&(ptcorr<100.)) {fh2DeltaRC30pt2->Fill(part->Pt(),deltaR);
1558               if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC30pt2->Fill(part->Pt(),deltaEta);
1559               if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC30pt2->Fill(part->Pt(),deltaPhi); }
1560               if((ptcorr>=100.)&&(ptcorr<120.)) {fh2DeltaRC30pt3->Fill(part->Pt(),deltaR);
1561               if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC30pt3->Fill(part->Pt(),deltaEta);
1562               if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC30pt3->Fill(part->Pt(),deltaPhi);}
1563               if((ptcorr>=120.)&&(ptcorr<140.)) {fh2DeltaRC30pt4->Fill(part->Pt(),deltaR); 
1564               if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC30pt4->Fill(part->Pt(),deltaEta);
1565               if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC30pt4->Fill(part->Pt(),deltaPhi); }
1566
1567                if(i==indexlead){
1568                if((ptcorr>=70.)&&(ptcorr<85.)) {fh2DeltaRC30pt1lead->Fill(part->Pt(),deltaR);
1569                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R))fh2DeltaEtaC30pt1lead->Fill(part->Pt(),deltaEta);
1570                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC30pt1lead->Fill(part->Pt(),deltaPhi);}
1571                if((ptcorr>=85.)&&(ptcorr<100.)) {fh2DeltaRC30pt2lead->Fill(part->Pt(),deltaR);
1572                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC30pt2lead->Fill(part->Pt(),deltaEta);
1573                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC30pt2lead->Fill(part->Pt(),deltaPhi); }
1574                if((ptcorr>=100.)&&(ptcorr<120.)) {fh2DeltaRC30pt3lead->Fill(part->Pt(),deltaR);
1575                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC30pt3lead->Fill(part->Pt(),deltaEta);
1576                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC30pt3lead->Fill(part->Pt(),deltaPhi);}
1577                if((ptcorr>=120.)&&(ptcorr<140.)) {fh2DeltaRC30pt4lead->Fill(part->Pt(),deltaR); 
1578                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC30pt4lead->Fill(part->Pt(),deltaEta);
1579                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC30pt4lead->Fill(part->Pt(),deltaPhi); }}
1580
1581
1582                 if(i==indexsublead){
1583                if((ptcorr>=70.)&&(ptcorr<85.)) {fh2DeltaRC30pt1sublead->Fill(part->Pt(),deltaR);
1584                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R))fh2DeltaEtaC30pt1sublead->Fill(part->Pt(),deltaEta);
1585                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC30pt1sublead->Fill(part->Pt(),deltaPhi);}
1586                if((ptcorr>=85.)&&(ptcorr<100.)) {fh2DeltaRC30pt2sublead->Fill(part->Pt(),deltaR);
1587                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC30pt2sublead->Fill(part->Pt(),deltaEta);
1588                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC30pt2sublead->Fill(part->Pt(),deltaPhi); }
1589                if((ptcorr>=100.)&&(ptcorr<120.)) {fh2DeltaRC30pt3sublead->Fill(part->Pt(),deltaR);
1590                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC30pt3sublead->Fill(part->Pt(),deltaEta);
1591                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC30pt3sublead->Fill(part->Pt(),deltaPhi);}
1592                if((ptcorr>=120.)&&(ptcorr<140.)) {fh2DeltaRC30pt4sublead->Fill(part->Pt(),deltaR); 
1593                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC30pt4sublead->Fill(part->Pt(),deltaEta);
1594                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC30pt4sublead->Fill(part->Pt(),deltaPhi); }} 
1595
1596
1597
1598
1599
1600           }
1601                  
1602
1603           if(centValue>60.){
1604               if((ptcorr>=70.)&&(ptcorr<85.)) {fh2DeltaRC60pt1->Fill(part->Pt(),deltaR);
1605               if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R))fh2DeltaEtaC60pt1->Fill(part->Pt(),deltaEta);
1606               if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC60pt1->Fill(part->Pt(),deltaPhi);}
1607               if((ptcorr>=85.)&&(ptcorr<100.)) {fh2DeltaRC60pt2->Fill(part->Pt(),deltaR);
1608               if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC60pt2->Fill(part->Pt(),deltaEta);
1609               if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC60pt2->Fill(part->Pt(),deltaPhi); }
1610               if((ptcorr>=100.)&&(ptcorr<120.)) {fh2DeltaRC60pt3->Fill(part->Pt(),deltaR);
1611               if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC60pt3->Fill(part->Pt(),deltaEta);
1612               if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC60pt3->Fill(part->Pt(),deltaPhi);}
1613               if((ptcorr>=120.)&&(ptcorr<140.)) {fh2DeltaRC60pt4->Fill(part->Pt(),deltaR); 
1614               if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC60pt4->Fill(part->Pt(),deltaEta);
1615               if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC60pt4->Fill(part->Pt(),deltaPhi);}
1616
1617                if(i==indexlead){
1618                if((ptcorr>=70.)&&(ptcorr<85.)) {fh2DeltaRC60pt1lead->Fill(part->Pt(),deltaR);
1619                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R))fh2DeltaEtaC60pt1lead->Fill(part->Pt(),deltaEta);
1620                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC60pt1lead->Fill(part->Pt(),deltaPhi);}
1621                if((ptcorr>=85.)&&(ptcorr<100.)) {fh2DeltaRC60pt2lead->Fill(part->Pt(),deltaR);
1622                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC60pt2lead->Fill(part->Pt(),deltaEta);
1623                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC60pt2lead->Fill(part->Pt(),deltaPhi); }
1624                if((ptcorr>=100.)&&(ptcorr<120.)) {fh2DeltaRC60pt3lead->Fill(part->Pt(),deltaR);
1625                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC60pt3lead->Fill(part->Pt(),deltaEta);
1626                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC60pt3lead->Fill(part->Pt(),deltaPhi);}
1627                if((ptcorr>=120.)&&(ptcorr<140.)) {fh2DeltaRC60pt4lead->Fill(part->Pt(),deltaR); 
1628                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC60pt4lead->Fill(part->Pt(),deltaEta);
1629                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC60pt4lead->Fill(part->Pt(),deltaPhi); }}
1630
1631                 if(i==indexsublead){
1632                if((ptcorr>=70.)&&(ptcorr<85.)) {fh2DeltaRC60pt1sublead->Fill(part->Pt(),deltaR);
1633                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R))fh2DeltaEtaC60pt1sublead->Fill(part->Pt(),deltaEta);
1634                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC60pt1sublead->Fill(part->Pt(),deltaPhi);}
1635                if((ptcorr>=85.)&&(ptcorr<100.)) {fh2DeltaRC60pt2sublead->Fill(part->Pt(),deltaR);
1636                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC60pt2sublead->Fill(part->Pt(),deltaEta);
1637                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC60pt2sublead->Fill(part->Pt(),deltaPhi); }
1638                if((ptcorr>=100.)&&(ptcorr<120.)) {fh2DeltaRC60pt3sublead->Fill(part->Pt(),deltaR);
1639                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC60pt3sublead->Fill(part->Pt(),deltaEta);
1640                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R)) fh2DeltaPhiC60pt3sublead->Fill(part->Pt(),deltaPhi);}
1641                if((ptcorr>=120.)&&(ptcorr<140.)) {fh2DeltaRC60pt4sublead->Fill(part->Pt(),deltaR); 
1642                if((part->Phi()<=phibig+R)&&(part->Phi()>=phibig-R)) fh2DeltaEtaC60pt4sublead->Fill(part->Pt(),deltaEta);
1643                if((part->Eta()<=etabig+R)&&(part->Eta()>=etabig-R))fh2DeltaPhiC60pt4sublead->Fill(part->Pt(),deltaPhi); }} 
1644
1645           }
1646                  
1647      } 
1648      //end of track loop
1649      Double_t coronain=rho*TMath::Pi()*(1.-0.8*0.8);
1650      Double_t coronaout=rho*TMath::Pi()*(0.6*0.6-0.4*0.4);
1651      if(centValue<10.){  
1652      fh2SumPtInC10bkg->Fill(ptcorr,coronain/ptbig);       
1653      fh2SumPtOutC10bkg->Fill(ptcorr,coronaout/ptbig);           
1654      fh2SumPtInC10->Fill(ptcorr,sumPtIn/ptbig);
1655      fh2SumPtOutC10->Fill(ptcorr,sumPtOut/ptbig); 
1656      if(i==indexlead){  fh2SumPtInC10bkglead->Fill(ptcorr,coronain/ptbig);       
1657                         fh2SumPtOutC10bkglead->Fill(ptcorr,coronaout/ptbig);           
1658                         fh2SumPtInC10lead->Fill(ptcorr,sumPtIn/ptbig);
1659                         fh2SumPtOutC10lead->Fill(ptcorr,sumPtOut/ptbig);}    
1660      if(i==indexsublead){ fh2SumPtInC10bkgsublead->Fill(ptcorr,coronain/ptbig);       
1661                          fh2SumPtOutC10bkgsublead->Fill(ptcorr,coronaout/ptbig);           
1662                          fh2SumPtInC10sublead->Fill(ptcorr,sumPtIn/ptbig);
1663                          fh2SumPtOutC10sublead->Fill(ptcorr,sumPtOut/ptbig);}
1664      }
1665      if((centValue>20.)&&(centValue<40.)){             
1666      fh2SumPtInC20bkg->Fill(ptcorr,coronain/ptbig);
1667      fh2SumPtOutC20bkg->Fill(ptcorr,coronaout/ptbig);    
1668      fh2SumPtInC20->Fill(ptcorr,sumPtIn/ptbig);
1669      fh2SumPtOutC20->Fill(ptcorr,sumPtOut/ptbig); 
1670       if(i==indexlead){ fh2SumPtInC20bkglead->Fill(ptcorr,coronain/ptbig);       
1671                         fh2SumPtOutC20bkglead->Fill(ptcorr,coronaout/ptbig);           
1672                         fh2SumPtInC20lead->Fill(ptcorr,sumPtIn/ptbig);
1673                         fh2SumPtOutC20lead->Fill(ptcorr,sumPtOut/ptbig);}    
1674      if(i==indexsublead){ fh2SumPtInC20bkgsublead->Fill(ptcorr,coronain/ptbig);       
1675                          fh2SumPtOutC20bkgsublead->Fill(ptcorr,coronaout/ptbig);           
1676                          fh2SumPtInC20sublead->Fill(ptcorr,sumPtIn/ptbig);
1677                          fh2SumPtOutC20sublead->Fill(ptcorr,sumPtOut/ptbig);}
1678
1679
1680
1681      }
1682      if((centValue>30.)&&(centValue<60.)){
1683      fh2SumPtInC30bkg->Fill(ptcorr,coronain/ptbig);
1684      fh2SumPtOutC30bkg->Fill(ptcorr,coronaout/ptbig);                    
1685      fh2SumPtInC30->Fill(ptcorr,sumPtIn/ptbig);
1686      fh2SumPtOutC30->Fill(ptcorr,sumPtOut/ptbig); 
1687
1688      if(i==indexlead){  fh2SumPtInC30bkglead->Fill(ptcorr,coronain/ptbig);       
1689                         fh2SumPtOutC30bkglead->Fill(ptcorr,coronaout/ptbig);           
1690                         fh2SumPtInC30lead->Fill(ptcorr,sumPtIn/ptbig);
1691                         fh2SumPtOutC30lead->Fill(ptcorr,sumPtOut/ptbig);}    
1692      if(i==indexsublead){ fh2SumPtInC30bkgsublead->Fill(ptcorr,coronain/ptbig);       
1693                          fh2SumPtOutC30bkgsublead->Fill(ptcorr,coronaout/ptbig);           
1694                          fh2SumPtInC30sublead->Fill(ptcorr,sumPtIn/ptbig);
1695                          fh2SumPtOutC30sublead->Fill(ptcorr,sumPtOut/ptbig);}
1696
1697      }
1698      if(centValue>60.){         
1699      fh2SumPtInC60bkg->Fill(ptcorr,coronain/ptbig);
1700      fh2SumPtOutC60bkg->Fill(ptcorr,coronaout/ptbig);      
1701      fh2SumPtInC60->Fill(ptcorr,sumPtIn/ptbig);
1702      fh2SumPtOutC60->Fill(ptcorr,sumPtOut/ptbig);
1703
1704      if(i==indexlead){  fh2SumPtInC60bkglead->Fill(ptcorr,coronain/ptbig);       
1705                         fh2SumPtOutC60bkglead->Fill(ptcorr,coronaout/ptbig);           
1706                         fh2SumPtInC60lead->Fill(ptcorr,sumPtIn/ptbig);
1707                         fh2SumPtOutC60lead->Fill(ptcorr,sumPtOut/ptbig);}    
1708      if(i==indexsublead){ fh2SumPtInC60bkgsublead->Fill(ptcorr,coronain/ptbig);       
1709                          fh2SumPtOutC60bkgsublead->Fill(ptcorr,coronaout/ptbig);           
1710                          fh2SumPtInC60sublead->Fill(ptcorr,sumPtIn/ptbig);
1711                          fh2SumPtOutC60sublead->Fill(ptcorr,sumPtOut/ptbig);}
1712
1713      }      
1714   
1715      //////////////////ANGULAR STRUCTURE//////////////////////////////////////
1716
1717      //tracks up to R=0.8 distant from the jet axis
1718      if(fAngStructCloseTracks==1){
1719       TList CloseTrackList;
1720       Int_t nn=GetListOfTracksCloseToJet(&CloseTrackList,jetbig);
1721       Double_t difR=0.04;
1722       for(Int_t l=0;l<15;l++){
1723       Double_t rr=l*0.1+0.1;
1724        for(int it = 0;it<nn;++it){
1725            AliVParticle *part1 = (AliVParticle*)CloseTrackList.At(it);
1726            for(int itu=it+1;itu<CloseTrackList.GetEntries();itu++){      
1727            AliVParticle *part2 = (AliVParticle*)CloseTrackList.At(itu);  
1728            Double_t ptm=part1->Pt();
1729            Double_t ptn=part2->Pt();    
1730            Double_t Rnm = (part1->Eta()-part2->Eta())*(part1->Eta()-part2->Eta())+(part1->Phi()-part2->Phi())*(part1->Phi()-part2->Phi());
1731                       Rnm=TMath::Sqrt(Rnm);
1732                       Double_t deltag=(1./(TMath::Sqrt(2*TMath::Pi())*difR))*TMath::Exp(-1.*(rr-Rnm)*(rr-Rnm)/(2.*difR*difR));      
1733                       Double_t stepf=0.5*(1.+TMath::Erf((rr-Rnm)/(TMath::Sqrt(2.)*difR)));
1734                       if((ptcorr<85.) && (ptcorr>=70.)){up1[l]=up1[l]+ptm*ptn*Rnm*Rnm*deltag;
1735                                                         down1[l]=down1[l]+ptm*ptn*Rnm*Rnm*stepf;}
1736                       if((ptcorr<100.) && (ptcorr>=85.)){up2[l]=up2[l]+ptm*ptn*Rnm*Rnm*deltag;
1737                                                         down2[l]=down2[l]+ptm*ptn*Rnm*Rnm*stepf;}  
1738                       if((ptcorr<120.) && (ptcorr>=100.)){up3[l]=up3[l]+ptm*ptn*Rnm*Rnm*deltag;
1739                                                          down3[l]=down3[l]+ptm*ptn*Rnm*Rnm*stepf;}
1740                       if((ptcorr<140.) && (ptcorr>=120.)){up4[l]=up4[l]+ptm*ptn*Rnm*Rnm*deltag;
1741                         down4[l]=down4[l]+ptm*ptn*Rnm*Rnm*stepf;}}}}
1742      }
1743     
1744      //only jet constituents
1745       if(fAngStructCloseTracks==2){
1746
1747       Double_t difR=0.04;
1748       for(Int_t l=0;l<15;l++){
1749       Double_t rr=l*0.1+0.1;
1750
1751     
1752       AliAODTrack* part1;
1753       AliAODTrack* part2;
1754           for(Int_t it=0; it<nTracksGenJet; ++it){
1755              part1 = (AliAODTrack*)(genTrackList->At(it));
1756            for(Int_t itu=0; itu<nTracksGenJet; ++itu){
1757              part2 = (AliAODTrack*)(genTrackList->At(itu));
1758            Double_t ptm=part1->Pt();
1759            Double_t ptn=part2->Pt();    
1760            Double_t Rnm = (part1->Eta()-part2->Eta())*(part1->Eta()-part2->Eta())+(part1->Phi()-part2->Phi())*(part1->Phi()-part2->Phi());
1761                       Rnm=TMath::Sqrt(Rnm);
1762                       Double_t deltag=(1./(TMath::Sqrt(2*TMath::Pi())*difR))*TMath::Exp(-1.*(rr-Rnm)*(rr-Rnm)/(2.*difR*difR));
1763                       Double_t stepf=0.5*(1.+TMath::Erf((rr-Rnm)/(TMath::Sqrt(2.)*difR))); 
1764                       if((ptcorr<85.) && (ptcorr>=70.)){up1[l]=up1[l]+ptm*ptn*Rnm*Rnm*deltag;
1765                                                         down1[l]=down1[l]+ptm*ptn*Rnm*Rnm*stepf;}
1766                       if((ptcorr<100.) && (ptcorr>=85.)){up2[l]=up2[l]+ptm*ptn*Rnm*Rnm*deltag;
1767                                                         down2[l]=down2[l]+ptm*ptn*Rnm*Rnm*stepf;}  
1768                       if((ptcorr<120.) && (ptcorr>=100.)){up3[l]=up3[l]+ptm*ptn*Rnm*Rnm*deltag;
1769                                                          down3[l]=down3[l]+ptm*ptn*Rnm*Rnm*stepf;}
1770                       if((ptcorr<140.) && (ptcorr>=120.)){up4[l]=up4[l]+ptm*ptn*Rnm*Rnm*deltag;
1771                         down4[l]=down4[l]+ptm*ptn*Rnm*Rnm*stepf;}}}}}
1772
1773
1774    
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787    }
1788
1789
1790      //end loop over R=0.4 jets 
1791       if(fAngStructCloseTracks>0){
1792      for(Int_t l=0;l<15;l++){
1793      Double_t rr=l*0.1+0.1;
1794         if(down1[l]!=0){  
1795         if(centValue<10.)fh2AngStructpt1C10->Fill(rr,rr*up1[l]/down1[l]);
1796         if(centValue>20. && centValue<40.) fh2AngStructpt1C20->Fill(rr,rr*up1[l]/down1[l]);
1797         if(centValue>30. && centValue<60.) fh2AngStructpt1C30->Fill(rr,rr*up1[l]/down1[l]);
1798         if(centValue>60.) fh2AngStructpt1C60->Fill(rr,rr*up1[l]/down1[l]);}
1799         if(down2[l]!=0){  
1800         if(centValue<10.) fh2AngStructpt2C10->Fill(rr,rr*up2[l]/down2[l]);
1801         if(centValue>20. && centValue<40.) fh2AngStructpt2C20->Fill(rr,rr*up2[l]/down2[l]);
1802         if(centValue>30. && centValue<60.) fh2AngStructpt2C30->Fill(rr,rr*up2[l]/down2[l]);
1803         if(centValue>60.) fh2AngStructpt2C60->Fill(rr,rr*up2[l]/down2[l]);}
1804         if(down3[l]!=0){  
1805         if(centValue<10.) fh2AngStructpt3C10->Fill(rr,rr*up3[l]/down3[l]);
1806         if(centValue>20. && centValue<40.) fh2AngStructpt3C20->Fill(rr,rr*up3[l]/down3[l]);
1807         if(centValue>30. && centValue<60.) fh2AngStructpt3C30->Fill(rr,rr*up3[l]/down3[l]);
1808         if(centValue>60.) fh2AngStructpt3C60->Fill(rr,rr*up3[l]/down3[l]);}
1809         if(down4[l]!=0){  
1810         if(centValue<10.) fh2AngStructpt4C10->Fill(rr,rr*up4[l]/down4[l]);
1811         if(centValue>20. && centValue<40.) fh2AngStructpt4C20->Fill(rr,rr*up4[l]/down4[l]);
1812         if(centValue>30. && centValue<60.) fh2AngStructpt4C30->Fill(rr,rr*up4[l]/down4[l]);
1813         if(centValue>60.) fh2AngStructpt4C60->Fill(rr,rr*up4[l]/down4[l]);}}}
1814
1815     
1816
1817
1818
1819
1820
1821    PostData(1, fOutputList);
1822      }
1823
1824 void AliAnalysisTaskJetCore::Terminate(const Option_t *)
1825 {
1826    // Draw result to the screen
1827    // Called once at the end of the query
1828
1829    if (!GetOutputData(1))
1830    return;
1831 }
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843 Int_t  AliAnalysisTaskJetCore::GetListOfTracks(TList *list){
1844
1845     Int_t iCount = 0;
1846  
1847   Int_t fFilterMask=272;
1848     for(int it = 0;it < fAOD->GetNumberOfTracks();++it){
1849       AliAODTrack *tr = fAOD->GetTrack(it);
1850       if((fFilterMask>0)&&!(tr->TestFilterBit(fFilterMask)))continue;
1851       if(TMath::Abs(tr->Eta())>0.9)continue;
1852       if(tr->Pt()<0.15)continue;
1853       list->Add(tr);
1854       //cout<<fAOD->GetNumberOfTracks()<<" "<<tr->Pt()<<endl;
1855       iCount++;
1856     }
1857   
1858    list->Sort();
1859   return iCount;
1860  
1861 }
1862
1863  Int_t  AliAnalysisTaskJetCore::GetListOfTracksCloseToJet(TList *list,AliAODJet *jetbig){
1864
1865     Int_t iCount = 0;
1866  
1867   Int_t fFilterMask=272;
1868     for(int it = 0;it < fAOD->GetNumberOfTracks();++it){
1869       AliAODTrack *tr = fAOD->GetTrack(it);
1870       if((fFilterMask>0)&&!(tr->TestFilterBit(fFilterMask)))continue;
1871       if(TMath::Abs(tr->Eta())>0.9)continue;
1872       if(tr->Pt()<0.15)continue;
1873       Double_t disR=jetbig->DeltaR(tr);
1874       if(disR>0.8)  continue;
1875       list->Add(tr);
1876       //cout<<fAOD->GetNumberOfTracks()<<" "<<tr->Pt()<<endl;
1877       iCount++;
1878     }
1879   
1880    list->Sort();
1881    return iCount;
1882
1883 }
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895 Int_t AliAnalysisTaskJetCore::GetNInputTracks()
1896 {
1897
1898    Int_t nInputTracks = 0;
1899
1900    TString jbname(fJetBranchName[1]);
1901    //needs complete event, use jets without background subtraction
1902    for(Int_t i=1; i<=3; ++i){
1903       if(jbname.Contains(Form("B%d",i))) jbname.ReplaceAll(Form("B%d",i),"B0");
1904    }
1905    // use only HI event
1906    if(jbname.Contains("AODextraonly")) jbname.ReplaceAll("AODextraonly","AOD");
1907    if(jbname.Contains("AODextra")) jbname.ReplaceAll("AODextra","AOD");
1908
1909    if(fDebug) Printf("Multiplicity from jet branch %s", jbname.Data());
1910    TClonesArray *tmpAODjets = dynamic_cast<TClonesArray*>(fAOD->FindListObject(jbname.Data()));
1911    if(!tmpAODjets){
1912       Printf("Jet branch %s not found", jbname.Data());
1913       Printf("AliAnalysisTaskJetCore::GetNInputTracks FAILED");
1914       return -1;
1915    }
1916    
1917    for (Int_t iJet=0; iJet<tmpAODjets->GetEntriesFast(); iJet++){
1918       AliAODJet *jet = dynamic_cast<AliAODJet*>((*tmpAODjets)[iJet]);
1919       if(!jet) continue;
1920       TRefArray *trackList = jet->GetRefTracks();
1921       Int_t nTracks = trackList->GetEntriesFast();
1922       nInputTracks += nTracks;
1923       if(fDebug) Printf("#jet%d: %d tracks", iJet, nTracks);
1924    }
1925    if(fDebug) Printf("---> input tracks: %d", nInputTracks);
1926
1927    return nInputTracks;  
1928 }
1929
1930
1931
1932 Double_t AliAnalysisTaskJetCore::RelativePhi(Double_t mphi,Double_t vphi){
1933
1934   if (vphi < -1*TMath::Pi()) vphi += (2*TMath::Pi());
1935   else if (vphi > TMath::Pi()) vphi -= (2*TMath::Pi());
1936   if (mphi < -1*TMath::Pi()) mphi += (2*TMath::Pi());
1937   else if (mphi > TMath::Pi()) mphi -= (2*TMath::Pi());
1938   double dphi = mphi-vphi;
1939   if (dphi < -1*TMath::Pi()) dphi += (2*TMath::Pi());
1940   else if (dphi > TMath::Pi()) dphi -= (2*TMath::Pi());
1941   return dphi;//dphi in [-Pi, Pi]
1942 }
1943
1944
1945