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