Adding ability to use multiple test functions
[u/mrichter/AliRoot.git] / PWGJE / AliAnalysisTaskFragmentationFunction.cxx
1 // *************************************************************************
2 // *                                                                       *
3 // * Task for Fragmentation Function Analysis in PWG4 Jet Task Force Train *
4 // *                                                                       *
5 // *************************************************************************
6
7
8 /**************************************************************************
9  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
10  *                                                                        *
11  * Author: The ALICE Off-line Project.                                    *
12  * Contributors are mentioned in the code where appropriate.              *
13  *                                                                        *
14  * Permission to use, copy, modify and distribute this software and its   *
15  * documentation strictly for non-commercial purposes is hereby granted   *
16  * without fee, provided that the above copyright notice appears in all   *
17  * copies and that both the copyright notice and this permission notice   *
18  * appear in the supporting documentation. The authors make no claims     *
19  * about the suitability of this software for any purpose. It is          *
20  * provided "as is" without express or implied warranty.                  *
21  **************************************************************************/
22
23 /* $Id: */
24
25 #include "TList.h"
26 #include "TH1F.h"
27 #include "TH2F.h"
28 #include "TH3F.h"
29 #include "TString.h"
30 #include "THnSparse.h"
31 #include "TProfile.h"
32 #include "TFile.h"
33 #include "TKey.h"
34 #include "TRandom3.h"
35
36 #include "AliAODInputHandler.h" 
37 #include "AliAODHandler.h" 
38 #include "AliESDEvent.h"
39 #include "AliAODMCParticle.h"
40 #include "AliAODJet.h"
41 #include "AliAODJetEventBackground.h"
42 #include "AliGenPythiaEventHeader.h"
43 #include "AliGenHijingEventHeader.h"
44 #include "AliInputEventHandler.h"
45
46 #include "AliAnalysisHelperJetTasks.h"
47 #include "AliAnalysisManager.h"
48 #include "AliAnalysisTaskSE.h"
49 #include "AliVParticle.h"
50 #include "AliVEvent.h"
51
52 #include "AliAnalysisTaskFragmentationFunction.h"
53
54 ClassImp(AliAnalysisTaskFragmentationFunction)
55
56 //____________________________________________________________________________
57 AliAnalysisTaskFragmentationFunction::AliAnalysisTaskFragmentationFunction()
58    : AliAnalysisTaskSE()
59    ,fESD(0)
60    ,fAOD(0)
61    ,fAODJets(0)  
62    ,fAODExtension(0)
63    ,fNonStdFile("")
64    ,fBranchRecJets("jets")
65    ,fBranchRecBackJets("")
66    ,fBranchRecBckgClusters("")
67    ,fBranchGenJets("")
68    ,fBranchEmbeddedJets("")
69    ,fTrackTypeGen(0)
70    ,fJetTypeGen(0)
71    ,fJetTypeRecEff(0)
72    ,fUseAODInputJets(kTRUE)
73    ,fFilterMask(0)
74    ,fUsePhysicsSelection(kTRUE)
75    ,fEvtSelectionMask(0)
76    ,fEventClass(0)
77    ,fMaxVertexZ(10)
78    ,fTrackPtCut(0)
79    ,fTrackEtaMin(0)
80    ,fTrackEtaMax(0)
81    ,fTrackPhiMin(0)
82    ,fTrackPhiMax(0)
83    ,fUseExtraTracks(0)
84    ,fUseExtraTracksBgr(0)
85    ,fCutFractionPtEmbedded(0)
86    ,fUseEmbeddedJetAxis(0)
87    ,fUseEmbeddedJetPt(0)
88    ,fJetPtCut(0)
89    ,fJetEtaMin(0)
90    ,fJetEtaMax(0)
91    ,fJetPhiMin(0)
92    ,fJetPhiMax(0)
93    ,fDiJetCut(0)
94    ,fDiJetDeltaPhiCut(0)
95    ,fDiJetPtFractionCut(0)
96    ,fDiJetCDFCut(0)
97    ,fDiJetKindBins(0)
98    ,fFFRadius(0)
99    ,fFFMaxTrackPt(-1)
100    ,fFFMinnTracks(0)
101    ,fFFBckgRadius(0)
102    ,fBckgMode(0)
103    ,fIJMode(0)
104    ,fQAMode(0)
105    ,fFFMode(0)
106    ,fDJMode(0)
107    ,fEffMode(0)
108    ,fPhiCorrMode(0)
109    ,fUseRecEffRecJetPtBins(0)
110    ,fUseResponseRecJetPtBins(1)
111    ,fAvgTrials(0)
112    ,fTracksRec(0)
113    ,fTracksRecCuts(0)
114    ,fTracksGen(0)
115    ,fTracksAODMCCharged(0)
116    ,fTracksAODMCChargedSec(0)
117    ,fTracksRecQualityCuts(0)
118    ,fJetsRec(0)
119    ,fJetsRecCuts(0)
120    ,fJetsGen(0)
121    ,fJetsRecEff(0)
122    ,fJetsEmbedded(0)
123    ,fBckgJetsRec(0)
124    ,fBckgJetsRecCuts(0)
125    ,fBckgJetsGen(0)
126    ,fQATrackHistosRec(0)
127    ,fQATrackHistosRecCuts(0)
128    ,fQATrackHistosGen(0)
129    ,fQAJetHistosRec(0)
130    ,fQAJetHistosRecCuts(0)
131    ,fQAJetHistosRecCutsLeading(0)
132    ,fQAJetHistosGen(0)
133    ,fQAJetHistosGenLeading(0)
134    ,fQAJetHistosRecEffLeading(0)
135    ,fFFHistosRecCuts(0)
136    ,fFFHistosRecLeading(0)
137    ,fFFHistosRecLeadingTrack(0)
138    ,fFFHistosGen(0)
139    ,fFFHistosGenLeading(0)
140    ,fFFHistosGenLeadingTrack(0)
141    ,fIJHistosRecCuts(0)
142    ,fIJHistosRecLeading(0)
143    ,fIJHistosRecLeadingTrack(0)
144    ,fIJHistosGen(0)
145    ,fIJHistosGenLeading(0)
146    ,fIJHistosGenLeadingTrack(0)
147    ,fFFDiJetHistosRecCuts(0)
148    ,fFFDiJetHistosRecLeading(0)
149    ,fFFDiJetHistosRecLeadingTrack(0)
150    ,fFFDiJetHistosGen(0)
151    ,fFFDiJetHistosGenLeading(0)
152    ,fFFDiJetHistosGenLeadingTrack(0)
153    ,fQADiJetHistosRecCuts(0)
154    ,fQADiJetHistosGen(0)
155    ,fPhiCorrHistosJetArea(0)
156    ,fPhiCorrHistosTransverseArea(0)
157    ,fPhiCorrHistosAwayArea(0)
158    ,fQATrackHighPtThreshold(0)
159    ,fFFNBinsJetPt(0)    
160    ,fFFJetPtMin(0) 
161    ,fFFJetPtMax(0)
162    ,fFFNBinsPt(0)      
163    ,fFFPtMin(0)        
164    ,fFFPtMax(0)        
165    ,fFFNBinsXi(0)      
166    ,fFFXiMin(0)        
167    ,fFFXiMax(0)        
168    ,fFFNBinsZ(0)       
169    ,fFFZMin(0)         
170    ,fFFZMax(0)
171    ,fFFLogZBins(kTRUE)         
172    ,fQAJetNBinsPt(0)   
173    ,fQAJetPtMin(0)     
174    ,fQAJetPtMax(0)     
175    ,fQAJetNBinsEta(0)  
176    ,fQAJetEtaMin(0)    
177    ,fQAJetEtaMax(0)    
178    ,fQAJetNBinsPhi(0)  
179    ,fQAJetPhiMin(0)    
180    ,fQAJetPhiMax(0)    
181    ,fQATrackNBinsPt(0) 
182    ,fQATrackPtMin(0)   
183    ,fQATrackPtMax(0)   
184    ,fQATrackNBinsEta(0)
185    ,fQATrackEtaMin(0)  
186    ,fQATrackEtaMax(0)  
187    ,fQATrackNBinsPhi(0)
188    ,fQATrackPhiMin(0)  
189    ,fQATrackPhiMax(0)
190    ,fIJNBinsJetPt(0)
191    ,fIJJetPtMin(0)
192    ,fIJJetPtMax(0)
193    ,fIJNBinsPt(0)
194    ,fIJPtMin(0)
195    ,fIJPtMax(0)
196    ,fIJNBinsZ(0)
197    ,fIJZMin(0)
198    ,fIJZMax(0)
199    ,fIJNBinsCosTheta(0)
200    ,fIJCosThetaMin(0)
201    ,fIJCosThetaMax(0)
202    ,fIJNBinsTheta(0)
203    ,fIJThetaMin(0)
204    ,fIJThetaMax(0)
205    ,fIJNBinsJt(0)
206    ,fIJJtMin(0)
207    ,fIJJtMax(0)
208    ,fDiJetNBinsJetInvMass(0)
209    ,fDiJetJetInvMassMin(0)
210    ,fDiJetJetInvMassMax(0)
211    ,fDiJetNBinsJetPt(0)
212    ,fDiJetJetPtMin(0)
213    ,fDiJetJetPtMax(0)
214    ,fDiJetNBinsPt(0)
215    ,fDiJetPtMin(0)
216    ,fDiJetPtMax(0)
217    ,fDiJetNBinsXi(0)
218    ,fDiJetXiMin(0)
219    ,fDiJetXiMax(0)
220    ,fDiJetNBinsZ(0)
221    ,fDiJetZMin(0)
222    ,fDiJetZMax(0)
223    ,fQADiJetNBinsInvMass(0)
224    ,fQADiJetInvMassMin(0)
225    ,fQADiJetInvMassMax(0)
226    ,fQADiJetNBinsJetPt(0)
227    ,fQADiJetJetPtMin(0)
228    ,fQADiJetJetPtMax(0)
229    ,fQADiJetNBinsDeltaPhi(0)
230    ,fQADiJetDeltaPhiMin(0)
231    ,fQADiJetDeltaPhiMax(0)
232    ,fQADiJetNBinsDeltaEta(0)
233    ,fQADiJetDeltaEtaMin(0)
234    ,fQADiJetDeltaEtaMax(0)
235    ,fQADiJetNBinsDeltaPt(0)
236    ,fQADiJetDeltaPtMin(0)
237    ,fQADiJetDeltaPtMax(0)
238    ,fQADiJetNBinsInBal(0)  
239    ,fQADiJetInBalMin(0)    
240    ,fQADiJetInBalMax(0)    
241    ,fPhiCorrNBinsPt(0)
242    ,fPhiCorrPtMin(0)
243    ,fPhiCorrPtMax(0)
244    ,fPhiCorrNBinsEta(0)
245    ,fPhiCorrEtaMin(0)
246    ,fPhiCorrEtaMax(0)
247    ,fPhiCorrNBinsPhi(0)
248    ,fPhiCorrPhiMin(0)
249    ,fPhiCorrPhiMax(0)
250    ,fCommonHistList(0)
251    ,fh1EvtSelection(0)
252    ,fh1VertexNContributors(0)
253    ,fh1VertexZ(0)
254    ,fh1EvtMult(0)
255    ,fh1EvtCent(0)
256    ,fh2TrackPtVsDCAXY(0)
257    ,fh2TrackPtVsDCAZ(0)
258    ,fh1Xsec(0)
259    ,fh1Trials(0)
260    ,fh1PtHard(0)
261    ,fh1PtHardTrials(0)
262    ,fh1nRecJetsCuts(0)
263    ,fh1nGenJets(0)
264    ,fh1nRecEffJets(0)
265    ,fh1nEmbeddedJets(0)
266    ,fh1nRecBckgJetsCuts(0)
267    ,fh1nGenBckgJets(0)
268    ,fh2PtRecVsGenPrim(0)
269    ,fh2PtRecVsGenSec(0)
270    ,fQATrackHistosRecEffGen(0)  
271    ,fQATrackHistosRecEffRec(0)
272    ,fQATrackHistosSecRec(0)   
273    ,fFFHistosRecEffGen(0)    
274    ,fFFHistosRecEffRec(0)
275    ,fFFHistosSecRec(0)
276    ,fhnResponseSinglePt(0)
277    ,fh2SingleInvPtRecMnGenVsPtGen(0)   
278    ,fhnResponseJetTrackPt(0)  
279    ,fhnResponseJetZ(0)        
280    ,fhnResponseJetXi(0)       
281    // Background
282    ,fh1OutLeadingMult(0)
283    ,fh1OutLeadingStatMult(0)
284    ,fh1PerpMult(0)
285    ,fh1ASideMult(0)
286    ,fh1ASideWindowMult(0)
287    ,fh1PerpWindowMult(0)
288    ,fh1Out2JetsMult(0)
289    ,fh1Out3JetsMult(0)
290    ,fh1MedianClustersMult(0)
291    ,fh1OutClustersMult(0)
292    ,fh1FractionPtEmbedded(0)
293    ,fh1IndexEmbedded(0)
294    ,fh2DeltaPtVsJetPtEmbedded(0)
295    ,fh2DeltaPtVsRecJetPtEmbedded(0)
296    ,fh1DeltaREmbedded(0)
297    ,fh2ptVsDistNN_pt50_rec(0) 
298    ,fh2ptVsDistNN_pt50_nonRec(0) 
299    ,fh2ptVsDistNN_pt10_rec(0) 
300    ,fh2ptVsDistNN_pt10_nonRec(0) 
301    ,fQABckgHisto0RecCuts(0)  
302    ,fQABckgHisto0Gen(0)      
303    ,fQABckgHisto1RecCuts(0)  
304    ,fQABckgHisto1Gen(0)      
305    ,fQABckgHisto2RecCuts(0)  
306    ,fQABckgHisto2Gen(0)
307    ,fQABckgHisto3RecCuts(0)
308    ,fQABckgHisto3Gen(0)
309    ,fQABckgHisto4RecCuts(0)
310    ,fQABckgHisto4Gen(0)
311    ,fFFBckgHisto0RecCuts(0)
312    ,fFFBckgHisto0RecLeading(0)
313    ,fFFBckgHisto0Gen(0)       
314    ,fFFBckgHisto0GenLeading(0)
315    ,fFFBckgHisto1RecCuts(0)
316    ,fFFBckgHisto1RecLeading(0)
317    ,fFFBckgHisto1Gen(0)       
318    ,fFFBckgHisto1GenLeading(0)
319    ,fFFBckgHisto2RecCuts(0)
320    ,fFFBckgHisto2RecLeading(0)
321    ,fFFBckgHisto2Gen(0)       
322    ,fFFBckgHisto2GenLeading(0)
323    ,fFFBckgHisto3RecCuts(0)
324    ,fFFBckgHisto3RecLeading(0)
325    ,fFFBckgHisto3Gen(0)       
326    ,fFFBckgHisto3GenLeading(0)
327    ,fFFBckgHisto4RecCuts(0)
328    ,fFFBckgHisto4RecLeading(0)
329    ,fFFBckgHisto4Gen(0)       
330    ,fFFBckgHisto4GenLeading(0)
331    ,fIJBckgHisto0RecCuts(0)   
332    ,fIJBckgHisto0RecLeading(0)
333    ,fIJBckgHisto0Gen(0)       
334    ,fIJBckgHisto0GenLeading(0)
335    ,fIJBckgHisto1RecCuts(0)   
336    ,fIJBckgHisto1RecLeading(0)
337    ,fIJBckgHisto1Gen(0)       
338    ,fIJBckgHisto1GenLeading(0)
339    ,fIJBckgHisto2RecCuts(0)   
340    ,fIJBckgHisto2RecLeading(0)
341    ,fIJBckgHisto2Gen(0)       
342    ,fIJBckgHisto2GenLeading(0)
343    ,fIJBckgHisto3RecCuts(0)   
344    ,fIJBckgHisto3RecLeading(0)
345    ,fIJBckgHisto3Gen(0)       
346    ,fIJBckgHisto3GenLeading(0)
347    ,fIJBckgHisto4RecCuts(0)   
348    ,fIJBckgHisto4RecLeading(0)
349    ,fIJBckgHisto4Gen(0)       
350    ,fIJBckgHisto4GenLeading(0)
351    ,fRandom(0)
352    ,fBckgSubMethod(0)
353 {
354    // default constructor
355   fBckgType[0] = 0;
356   fBckgType[1] = 0;
357   fBckgType[2] = 0;
358   fBckgType[3] = 0;
359   fBckgType[4] = 0;
360 }
361
362 //__________________________________________________________________________________________
363 AliAnalysisTaskFragmentationFunction::AliAnalysisTaskFragmentationFunction(const char *name) 
364   : AliAnalysisTaskSE(name)
365   ,fESD(0)
366   ,fAOD(0)
367   ,fAODJets(0)  
368   ,fAODExtension(0)
369   ,fNonStdFile("")
370   ,fBranchRecJets("jets")
371   ,fBranchRecBackJets("")
372   ,fBranchRecBckgClusters("")
373   ,fBranchGenJets("")
374   ,fBranchEmbeddedJets("")
375   ,fTrackTypeGen(0)
376   ,fJetTypeGen(0)
377   ,fJetTypeRecEff(0)
378   ,fUseAODInputJets(kTRUE)
379   ,fFilterMask(0)
380   ,fUsePhysicsSelection(kTRUE)
381   ,fEvtSelectionMask(0)
382   ,fEventClass(0)
383   ,fMaxVertexZ(10)
384   ,fTrackPtCut(0)
385   ,fTrackEtaMin(0)
386   ,fTrackEtaMax(0)
387   ,fTrackPhiMin(0)
388   ,fTrackPhiMax(0)
389   ,fUseExtraTracks(0)
390   ,fUseExtraTracksBgr(0)
391   ,fCutFractionPtEmbedded(0)
392   ,fUseEmbeddedJetAxis(0)
393   ,fUseEmbeddedJetPt(0)  
394   ,fJetPtCut(0)
395   ,fJetEtaMin(0)
396   ,fJetEtaMax(0)
397   ,fJetPhiMin(0)
398   ,fJetPhiMax(0)
399   ,fDiJetCut(0)
400   ,fDiJetDeltaPhiCut(0)
401   ,fDiJetPtFractionCut(0)
402   ,fDiJetCDFCut(0)
403   ,fDiJetKindBins(0)
404   ,fFFRadius(0)
405   ,fFFMaxTrackPt(-1)
406   ,fFFMinnTracks(0)
407   ,fFFBckgRadius(0)
408   ,fBckgMode(0)
409   ,fIJMode(0)
410   ,fQAMode(0)
411   ,fFFMode(0)
412   ,fDJMode(0)
413   ,fEffMode(0)
414   ,fPhiCorrMode(0)
415   ,fUseRecEffRecJetPtBins(0)
416   ,fUseResponseRecJetPtBins(1)
417   ,fAvgTrials(0)
418   ,fTracksRec(0)
419   ,fTracksRecCuts(0)
420   ,fTracksGen(0)
421   ,fTracksAODMCCharged(0)
422   ,fTracksAODMCChargedSec(0)
423   ,fTracksRecQualityCuts(0)
424   ,fJetsRec(0)
425   ,fJetsRecCuts(0)
426   ,fJetsGen(0)
427   ,fJetsRecEff(0)
428   ,fJetsEmbedded(0)
429   ,fBckgJetsRec(0)
430   ,fBckgJetsRecCuts(0)
431   ,fBckgJetsGen(0)
432   ,fQATrackHistosRec(0)
433   ,fQATrackHistosRecCuts(0)
434   ,fQATrackHistosGen(0)
435   ,fQAJetHistosRec(0)
436   ,fQAJetHistosRecCuts(0)
437   ,fQAJetHistosRecCutsLeading(0)
438   ,fQAJetHistosGen(0)
439   ,fQAJetHistosGenLeading(0)
440   ,fQAJetHistosRecEffLeading(0)
441   ,fFFHistosRecCuts(0)
442   ,fFFHistosRecLeading(0)
443   ,fFFHistosRecLeadingTrack(0)
444   ,fFFHistosGen(0)
445   ,fFFHistosGenLeading(0)
446   ,fFFHistosGenLeadingTrack(0)
447   ,fIJHistosRecCuts(0)
448   ,fIJHistosRecLeading(0)
449   ,fIJHistosRecLeadingTrack(0)
450   ,fIJHistosGen(0)
451   ,fIJHistosGenLeading(0)
452   ,fIJHistosGenLeadingTrack(0)
453   ,fFFDiJetHistosRecCuts(0)
454   ,fFFDiJetHistosRecLeading(0)
455   ,fFFDiJetHistosRecLeadingTrack(0)
456   ,fFFDiJetHistosGen(0)
457   ,fFFDiJetHistosGenLeading(0)
458   ,fFFDiJetHistosGenLeadingTrack(0)
459   ,fQADiJetHistosRecCuts(0)
460   ,fQADiJetHistosGen(0)
461   ,fPhiCorrHistosJetArea(0)
462   ,fPhiCorrHistosTransverseArea(0)
463   ,fPhiCorrHistosAwayArea(0)
464   ,fQATrackHighPtThreshold(0) 
465   ,fFFNBinsJetPt(0)    
466   ,fFFJetPtMin(0) 
467   ,fFFJetPtMax(0)
468   ,fFFNBinsPt(0)      
469   ,fFFPtMin(0)        
470   ,fFFPtMax(0)        
471   ,fFFNBinsXi(0)      
472   ,fFFXiMin(0)        
473   ,fFFXiMax(0)        
474   ,fFFNBinsZ(0)       
475   ,fFFZMin(0)         
476   ,fFFZMax(0)         
477   ,fFFLogZBins(kTRUE)         
478   ,fQAJetNBinsPt(0)   
479   ,fQAJetPtMin(0)     
480   ,fQAJetPtMax(0)     
481   ,fQAJetNBinsEta(0)  
482   ,fQAJetEtaMin(0)    
483   ,fQAJetEtaMax(0)    
484   ,fQAJetNBinsPhi(0)  
485   ,fQAJetPhiMin(0)    
486   ,fQAJetPhiMax(0)    
487   ,fQATrackNBinsPt(0) 
488   ,fQATrackPtMin(0)   
489   ,fQATrackPtMax(0)   
490   ,fQATrackNBinsEta(0)
491   ,fQATrackEtaMin(0)  
492   ,fQATrackEtaMax(0)  
493   ,fQATrackNBinsPhi(0)
494   ,fQATrackPhiMin(0)  
495   ,fQATrackPhiMax(0)  
496   ,fIJNBinsJetPt(0)
497   ,fIJJetPtMin(0)
498   ,fIJJetPtMax(0)
499   ,fIJNBinsPt(0)
500   ,fIJPtMin(0)
501   ,fIJPtMax(0)
502   ,fIJNBinsZ(0)
503   ,fIJZMin(0)
504   ,fIJZMax(0)
505   ,fIJNBinsCosTheta(0)
506   ,fIJCosThetaMin(0)
507   ,fIJCosThetaMax(0)
508   ,fIJNBinsTheta(0)
509   ,fIJThetaMin(0)
510   ,fIJThetaMax(0)
511   ,fIJNBinsJt(0)
512   ,fIJJtMin(0)
513   ,fIJJtMax(0)
514   ,fDiJetNBinsJetInvMass(0)
515   ,fDiJetJetInvMassMin(0)
516   ,fDiJetJetInvMassMax(0)
517   ,fDiJetNBinsJetPt(0)
518   ,fDiJetJetPtMin(0)
519   ,fDiJetJetPtMax(0)
520   ,fDiJetNBinsPt(0)
521   ,fDiJetPtMin(0)
522   ,fDiJetPtMax(0)
523   ,fDiJetNBinsXi(0)
524   ,fDiJetXiMin(0)
525   ,fDiJetXiMax(0)
526   ,fDiJetNBinsZ(0)
527   ,fDiJetZMin(0)
528   ,fDiJetZMax(0)
529   ,fQADiJetNBinsInvMass(0)
530   ,fQADiJetInvMassMin(0)
531   ,fQADiJetInvMassMax(0)
532   ,fQADiJetNBinsJetPt(0)
533   ,fQADiJetJetPtMin(0)
534   ,fQADiJetJetPtMax(0)
535   ,fQADiJetNBinsDeltaPhi(0)
536   ,fQADiJetDeltaPhiMin(0)
537   ,fQADiJetDeltaPhiMax(0)
538   ,fQADiJetNBinsDeltaEta(0)
539   ,fQADiJetDeltaEtaMin(0)
540   ,fQADiJetDeltaEtaMax(0)
541   ,fQADiJetNBinsDeltaPt(0)
542   ,fQADiJetDeltaPtMin(0)
543   ,fQADiJetDeltaPtMax(0)
544   ,fQADiJetNBinsInBal(0)  
545   ,fQADiJetInBalMin(0)    
546   ,fQADiJetInBalMax(0)    
547   ,fPhiCorrNBinsPt(0)
548   ,fPhiCorrPtMin(0)
549   ,fPhiCorrPtMax(0)
550   ,fPhiCorrNBinsEta(0)
551   ,fPhiCorrEtaMin(0)
552   ,fPhiCorrEtaMax(0)
553   ,fPhiCorrNBinsPhi(0)
554   ,fPhiCorrPhiMin(0)
555   ,fPhiCorrPhiMax(0)
556   ,fCommonHistList(0)
557   ,fh1EvtSelection(0)
558   ,fh1VertexNContributors(0)
559   ,fh1VertexZ(0)
560   ,fh1EvtMult(0)
561   ,fh1EvtCent(0)
562   ,fh2TrackPtVsDCAXY(0)
563   ,fh2TrackPtVsDCAZ(0)
564   ,fh1Xsec(0)
565   ,fh1Trials(0)
566   ,fh1PtHard(0)
567   ,fh1PtHardTrials(0)
568   ,fh1nRecJetsCuts(0)
569   ,fh1nGenJets(0)
570   ,fh1nRecEffJets(0)
571   ,fh1nEmbeddedJets(0)
572   ,fh1nRecBckgJetsCuts(0)
573   ,fh1nGenBckgJets(0)
574   ,fh2PtRecVsGenPrim(0)
575   ,fh2PtRecVsGenSec(0)
576   ,fQATrackHistosRecEffGen(0)  
577   ,fQATrackHistosRecEffRec(0)
578   ,fQATrackHistosSecRec(0) 
579   ,fFFHistosRecEffGen(0)    
580   ,fFFHistosRecEffRec(0)
581   ,fFFHistosSecRec(0)
582   ,fhnResponseSinglePt(0)  
583   ,fh2SingleInvPtRecMnGenVsPtGen(0) 
584   ,fhnResponseJetTrackPt(0)  
585   ,fhnResponseJetZ(0)        
586   ,fhnResponseJetXi(0)       
587   // Background
588   ,fh1OutLeadingMult(0)
589   ,fh1OutLeadingStatMult(0)
590   ,fh1PerpMult(0)
591   ,fh1ASideMult(0)
592   ,fh1ASideWindowMult(0)
593   ,fh1PerpWindowMult(0)
594   ,fh1Out2JetsMult(0)
595   ,fh1Out3JetsMult(0)
596   ,fh1MedianClustersMult(0)
597   ,fh1OutClustersMult(0)
598   ,fh1FractionPtEmbedded(0)
599   ,fh1IndexEmbedded(0)
600   ,fh2DeltaPtVsJetPtEmbedded(0)
601   ,fh2DeltaPtVsRecJetPtEmbedded(0)
602   ,fh1DeltaREmbedded(0)
603   ,fh2ptVsDistNN_pt50_rec(0) 
604   ,fh2ptVsDistNN_pt50_nonRec(0) 
605   ,fh2ptVsDistNN_pt10_rec(0) 
606   ,fh2ptVsDistNN_pt10_nonRec(0)
607   ,fQABckgHisto0RecCuts(0)  
608   ,fQABckgHisto0Gen(0)      
609   ,fQABckgHisto1RecCuts(0)  
610   ,fQABckgHisto1Gen(0)      
611   ,fQABckgHisto2RecCuts(0)  
612   ,fQABckgHisto2Gen(0) 
613   ,fQABckgHisto3RecCuts(0)  
614   ,fQABckgHisto3Gen(0)
615   ,fQABckgHisto4RecCuts(0)  
616   ,fQABckgHisto4Gen(0)
617   ,fFFBckgHisto0RecCuts(0)
618   ,fFFBckgHisto0RecLeading(0)
619   ,fFFBckgHisto0Gen(0)       
620   ,fFFBckgHisto0GenLeading(0)
621   ,fFFBckgHisto1RecCuts(0)
622   ,fFFBckgHisto1RecLeading(0)
623   ,fFFBckgHisto1Gen(0)       
624   ,fFFBckgHisto1GenLeading(0)
625   ,fFFBckgHisto2RecCuts(0)
626   ,fFFBckgHisto2RecLeading(0)
627   ,fFFBckgHisto2Gen(0)       
628   ,fFFBckgHisto2GenLeading(0)
629   ,fFFBckgHisto3RecCuts(0)
630   ,fFFBckgHisto3RecLeading(0)
631   ,fFFBckgHisto3Gen(0)       
632   ,fFFBckgHisto3GenLeading(0)
633   ,fFFBckgHisto4RecCuts(0)
634   ,fFFBckgHisto4RecLeading(0)
635   ,fFFBckgHisto4Gen(0)       
636   ,fFFBckgHisto4GenLeading(0)
637   ,fIJBckgHisto0RecCuts(0)   
638   ,fIJBckgHisto0RecLeading(0)
639   ,fIJBckgHisto0Gen(0)       
640   ,fIJBckgHisto0GenLeading(0)
641   ,fIJBckgHisto1RecCuts(0)   
642   ,fIJBckgHisto1RecLeading(0)
643   ,fIJBckgHisto1Gen(0)       
644   ,fIJBckgHisto1GenLeading(0)
645   ,fIJBckgHisto2RecCuts(0)   
646   ,fIJBckgHisto2RecLeading(0)
647   ,fIJBckgHisto2Gen(0)       
648   ,fIJBckgHisto2GenLeading(0)
649   ,fIJBckgHisto3RecCuts(0)   
650   ,fIJBckgHisto3RecLeading(0)
651   ,fIJBckgHisto3Gen(0)       
652   ,fIJBckgHisto3GenLeading(0)
653   ,fIJBckgHisto4RecCuts(0)   
654   ,fIJBckgHisto4RecLeading(0)
655   ,fIJBckgHisto4Gen(0)       
656   ,fIJBckgHisto4GenLeading(0)
657   ,fRandom(0)
658   ,fBckgSubMethod(0)
659 {
660   // constructor
661   fBckgType[0] = 0;
662   fBckgType[1] = 0;
663   fBckgType[2] = 0;
664   fBckgType[3] = 0;
665   fBckgType[4] = 0;
666
667   DefineOutput(1,TList::Class());
668   
669
670 }
671
672 //__________________________________________________________________________________________________________________________
673 AliAnalysisTaskFragmentationFunction::AliAnalysisTaskFragmentationFunction(const  AliAnalysisTaskFragmentationFunction &copy)
674   : AliAnalysisTaskSE()
675   ,fESD(copy.fESD)
676   ,fAOD(copy.fAOD)
677   ,fAODJets(copy.fAODJets)  
678   ,fAODExtension(copy.fAODExtension)
679   ,fNonStdFile(copy.fNonStdFile)
680   ,fBranchRecJets(copy.fBranchRecJets)
681   ,fBranchRecBackJets(copy.fBranchRecBackJets)
682   ,fBranchRecBckgClusters(copy.fBranchRecBckgClusters)
683   ,fBranchGenJets(copy.fBranchGenJets)
684   ,fBranchEmbeddedJets(copy.fBranchEmbeddedJets)
685   ,fTrackTypeGen(copy.fTrackTypeGen)
686   ,fJetTypeGen(copy.fJetTypeGen)
687   ,fJetTypeRecEff(copy.fJetTypeRecEff)
688   ,fUseAODInputJets(copy.fUseAODInputJets)
689   ,fFilterMask(copy.fFilterMask)
690   ,fUsePhysicsSelection(copy.fUsePhysicsSelection)
691   ,fEvtSelectionMask(copy.fEvtSelectionMask)
692   ,fEventClass(copy.fEventClass)
693   ,fMaxVertexZ(copy.fMaxVertexZ)
694   ,fTrackPtCut(copy.fTrackPtCut)
695   ,fTrackEtaMin(copy.fTrackEtaMin)
696   ,fTrackEtaMax(copy.fTrackEtaMax)
697   ,fTrackPhiMin(copy.fTrackPhiMin)
698   ,fTrackPhiMax(copy.fTrackPhiMax)
699   ,fUseExtraTracks(copy.fUseExtraTracks)
700   ,fUseExtraTracksBgr(copy.fUseExtraTracksBgr)
701   ,fCutFractionPtEmbedded(copy.fCutFractionPtEmbedded)
702   ,fUseEmbeddedJetAxis(copy.fUseEmbeddedJetAxis)
703   ,fUseEmbeddedJetPt(copy.fUseEmbeddedJetPt)
704   ,fJetPtCut(copy.fJetPtCut)
705   ,fJetEtaMin(copy.fJetEtaMin)
706   ,fJetEtaMax(copy.fJetEtaMax)
707   ,fJetPhiMin(copy.fJetPhiMin)
708   ,fJetPhiMax(copy.fJetPhiMax)
709   ,fDiJetCut(copy.fDiJetCut)
710   ,fDiJetDeltaPhiCut(copy.fDiJetDeltaPhiCut)
711   ,fDiJetPtFractionCut(copy.fDiJetPtFractionCut)
712   ,fDiJetCDFCut(copy.fDiJetCDFCut)
713   ,fDiJetKindBins(copy.fDiJetKindBins)
714   ,fFFRadius(copy.fFFRadius)
715   ,fFFMaxTrackPt(copy.fFFMaxTrackPt)
716   ,fFFMinnTracks(copy.fFFMinnTracks)
717   ,fFFBckgRadius(copy.fFFBckgRadius)
718   ,fBckgMode(copy.fBckgMode)
719   ,fIJMode(copy.fIJMode)
720   ,fQAMode(copy.fQAMode)
721   ,fFFMode(copy.fFFMode)
722   ,fDJMode(copy.fDJMode)
723   ,fEffMode(copy.fEffMode)
724   ,fPhiCorrMode(copy.fPhiCorrMode)
725   ,fUseRecEffRecJetPtBins(copy.fUseRecEffRecJetPtBins)
726   ,fUseResponseRecJetPtBins(copy.fUseResponseRecJetPtBins)
727   ,fAvgTrials(copy.fAvgTrials)
728   ,fTracksRec(copy.fTracksRec)
729   ,fTracksRecCuts(copy.fTracksRecCuts)
730   ,fTracksGen(copy.fTracksGen)
731   ,fTracksAODMCCharged(copy.fTracksAODMCCharged)
732   ,fTracksAODMCChargedSec(copy.fTracksAODMCChargedSec)
733   ,fTracksRecQualityCuts(copy.fTracksRecQualityCuts)
734   ,fJetsRec(copy.fJetsRec)
735   ,fJetsRecCuts(copy.fJetsRecCuts)
736   ,fJetsGen(copy.fJetsGen)
737   ,fJetsRecEff(copy.fJetsRecEff)
738   ,fJetsEmbedded(copy.fJetsEmbedded)
739   ,fBckgJetsRec(copy.fBckgJetsRec)
740   ,fBckgJetsRecCuts(copy.fBckgJetsRecCuts)
741   ,fBckgJetsGen(copy.fBckgJetsGen)
742   ,fQATrackHistosRec(copy.fQATrackHistosRec)
743   ,fQATrackHistosRecCuts(copy.fQATrackHistosRecCuts)
744   ,fQATrackHistosGen(copy.fQATrackHistosGen)
745   ,fQAJetHistosRec(copy.fQAJetHistosRec)
746   ,fQAJetHistosRecCuts(copy.fQAJetHistosRecCuts)
747   ,fQAJetHistosRecCutsLeading(copy.fQAJetHistosRecCutsLeading)
748   ,fQAJetHistosGen(copy.fQAJetHistosGen)
749   ,fQAJetHistosGenLeading(copy.fQAJetHistosGenLeading)
750   ,fQAJetHistosRecEffLeading(copy.fQAJetHistosRecEffLeading)
751   ,fFFHistosRecCuts(copy.fFFHistosRecCuts)
752   ,fFFHistosRecLeading(copy.fFFHistosRecLeading)
753   ,fFFHistosRecLeadingTrack(copy.fFFHistosRecLeadingTrack)
754   ,fFFHistosGen(copy.fFFHistosGen)
755   ,fFFHistosGenLeading(copy.fFFHistosGenLeading)
756   ,fFFHistosGenLeadingTrack(copy.fFFHistosGenLeadingTrack)
757   ,fIJHistosRecCuts(copy.fIJHistosRecCuts)
758   ,fIJHistosRecLeading(copy.fIJHistosRecLeading)
759   ,fIJHistosRecLeadingTrack(copy.fIJHistosRecLeadingTrack)
760   ,fIJHistosGen(copy.fIJHistosGen)
761   ,fIJHistosGenLeading(copy.fIJHistosGenLeading)
762   ,fIJHistosGenLeadingTrack(copy.fIJHistosGenLeadingTrack)
763   ,fFFDiJetHistosRecCuts(copy.fFFDiJetHistosRecCuts)
764   ,fFFDiJetHistosRecLeading(copy.fFFDiJetHistosRecLeading)
765   ,fFFDiJetHistosRecLeadingTrack(copy.fFFDiJetHistosRecLeadingTrack)
766   ,fFFDiJetHistosGen(copy.fFFDiJetHistosGen)
767   ,fFFDiJetHistosGenLeading(copy.fFFDiJetHistosGenLeading)
768   ,fFFDiJetHistosGenLeadingTrack(copy.fFFDiJetHistosGenLeadingTrack)
769   ,fQADiJetHistosRecCuts(copy.fQADiJetHistosRecCuts)
770   ,fQADiJetHistosGen(copy.fQADiJetHistosGen)
771   ,fPhiCorrHistosJetArea(copy.fPhiCorrHistosJetArea)
772   ,fPhiCorrHistosTransverseArea(copy.fPhiCorrHistosTransverseArea)
773   ,fPhiCorrHistosAwayArea(copy.fPhiCorrHistosAwayArea)
774   ,fQATrackHighPtThreshold(copy.fQATrackHighPtThreshold) 
775   ,fFFNBinsJetPt(copy.fFFNBinsJetPt)    
776   ,fFFJetPtMin(copy.fFFJetPtMin) 
777   ,fFFJetPtMax(copy.fFFJetPtMax)
778   ,fFFNBinsPt(copy.fFFNBinsPt)      
779   ,fFFPtMin(copy.fFFPtMin)        
780   ,fFFPtMax(copy.fFFPtMax)        
781   ,fFFNBinsXi(copy.fFFNBinsXi)      
782   ,fFFXiMin(copy.fFFXiMin)        
783   ,fFFXiMax(copy.fFFXiMax)        
784   ,fFFNBinsZ(copy.fFFNBinsZ)       
785   ,fFFZMin(copy.fFFZMin)         
786   ,fFFZMax(copy.fFFZMax)         
787   ,fFFLogZBins(copy.fFFLogZBins)         
788   ,fQAJetNBinsPt(copy.fQAJetNBinsPt)   
789   ,fQAJetPtMin(copy.fQAJetPtMin)     
790   ,fQAJetPtMax(copy.fQAJetPtMax)     
791   ,fQAJetNBinsEta(copy.fQAJetNBinsEta)  
792   ,fQAJetEtaMin(copy.fQAJetEtaMin)    
793   ,fQAJetEtaMax(copy.fQAJetEtaMax)    
794   ,fQAJetNBinsPhi(copy.fQAJetNBinsPhi)  
795   ,fQAJetPhiMin(copy.fQAJetPhiMin)    
796   ,fQAJetPhiMax(copy.fQAJetPhiMax)    
797   ,fQATrackNBinsPt(copy.fQATrackNBinsPt) 
798   ,fQATrackPtMin(copy.fQATrackPtMin)   
799   ,fQATrackPtMax(copy.fQATrackPtMax)   
800   ,fQATrackNBinsEta(copy.fQATrackNBinsEta)
801   ,fQATrackEtaMin(copy.fQATrackEtaMin)  
802   ,fQATrackEtaMax(copy.fQATrackEtaMax)  
803   ,fQATrackNBinsPhi(copy.fQATrackNBinsPhi)
804   ,fQATrackPhiMin(copy.fQATrackPhiMin)  
805   ,fQATrackPhiMax(copy.fQATrackPhiMax)
806   ,fIJNBinsJetPt(copy.fIJNBinsJetPt)
807   ,fIJJetPtMin(copy.fIJJetPtMin)
808   ,fIJJetPtMax(copy.fIJJetPtMax)
809   ,fIJNBinsPt(copy.fIJNBinsPt)
810   ,fIJPtMin(copy.fIJPtMin)
811   ,fIJPtMax(copy.fIJPtMax)
812   ,fIJNBinsZ(copy.fIJNBinsZ)
813   ,fIJZMin(copy.fIJZMin)
814   ,fIJZMax(copy.fIJZMax)
815   ,fIJNBinsCosTheta(copy.fIJNBinsCosTheta)
816   ,fIJCosThetaMin(copy.fIJCosThetaMin)
817   ,fIJCosThetaMax(copy.fIJCosThetaMax)
818   ,fIJNBinsTheta(copy.fIJNBinsTheta)
819   ,fIJThetaMin(copy.fIJThetaMin)
820   ,fIJThetaMax(copy.fIJThetaMax)
821   ,fIJNBinsJt(copy.fIJNBinsJt)
822   ,fIJJtMin(copy.fIJJtMin)
823   ,fIJJtMax(copy.fIJJtMax)
824   ,fDiJetNBinsJetInvMass(copy.fDiJetNBinsJetInvMass)
825   ,fDiJetJetInvMassMin(copy.fDiJetJetInvMassMin)
826   ,fDiJetJetInvMassMax(copy.fDiJetJetInvMassMax)
827   ,fDiJetNBinsJetPt(copy.fDiJetNBinsJetPt)
828   ,fDiJetJetPtMin(copy.fDiJetJetPtMin)
829   ,fDiJetJetPtMax(copy.fDiJetJetPtMax)
830   ,fDiJetNBinsPt(copy.fDiJetNBinsPt)
831   ,fDiJetPtMin(copy.fDiJetPtMin)
832   ,fDiJetPtMax(copy.fDiJetPtMax)
833   ,fDiJetNBinsXi(copy.fDiJetNBinsXi)
834   ,fDiJetXiMin(copy.fDiJetXiMin)
835   ,fDiJetXiMax(copy.fDiJetXiMax)
836   ,fDiJetNBinsZ(copy.fDiJetNBinsZ)
837   ,fDiJetZMin(copy.fDiJetZMin)
838   ,fDiJetZMax(copy.fDiJetZMax)
839   ,fQADiJetNBinsInvMass(copy.fQADiJetNBinsInvMass)
840   ,fQADiJetInvMassMin(copy.fQADiJetInvMassMin)
841   ,fQADiJetInvMassMax(copy.fQADiJetInvMassMax)
842   ,fQADiJetNBinsJetPt(copy.fQADiJetNBinsJetPt)
843   ,fQADiJetJetPtMin(copy.fQADiJetJetPtMin)
844   ,fQADiJetJetPtMax(copy.fQADiJetJetPtMax)
845   ,fQADiJetNBinsDeltaPhi(copy.fQADiJetNBinsDeltaPhi)
846   ,fQADiJetDeltaPhiMin(copy.fQADiJetDeltaPhiMin)
847   ,fQADiJetDeltaPhiMax(copy.fQADiJetDeltaPhiMax)
848   ,fQADiJetNBinsDeltaEta(copy.fQADiJetNBinsDeltaEta)
849   ,fQADiJetDeltaEtaMin(copy.fQADiJetDeltaEtaMin)
850   ,fQADiJetDeltaEtaMax(copy.fQADiJetDeltaEtaMax)
851   ,fQADiJetNBinsDeltaPt(copy.fQADiJetNBinsDeltaPt)
852   ,fQADiJetDeltaPtMin(copy.fQADiJetDeltaPtMin)
853   ,fQADiJetDeltaPtMax(copy.fQADiJetDeltaPtMax)
854   ,fQADiJetNBinsInBal(copy.fQADiJetNBinsInBal)
855   ,fQADiJetInBalMin(copy.fQADiJetInBalMin)
856   ,fQADiJetInBalMax(copy.fQADiJetInBalMax)
857   ,fPhiCorrNBinsPt(copy.fPhiCorrNBinsPt)
858   ,fPhiCorrPtMin(copy.fPhiCorrPtMin)
859   ,fPhiCorrPtMax(copy.fPhiCorrPtMax)
860   ,fPhiCorrNBinsEta(copy.fPhiCorrNBinsEta)
861   ,fPhiCorrEtaMin(copy.fPhiCorrEtaMin)
862   ,fPhiCorrEtaMax(copy.fPhiCorrEtaMax)
863   ,fPhiCorrNBinsPhi(copy.fPhiCorrNBinsPhi)
864   ,fPhiCorrPhiMin(copy.fPhiCorrPhiMin)
865   ,fPhiCorrPhiMax(copy.fPhiCorrPhiMax)
866   ,fCommonHistList(copy.fCommonHistList)
867   ,fh1EvtSelection(copy.fh1EvtSelection)
868   ,fh1VertexNContributors(copy.fh1VertexNContributors)
869   ,fh1VertexZ(copy.fh1VertexZ)
870   ,fh1EvtMult(copy.fh1EvtMult)
871   ,fh1EvtCent(copy.fh1EvtCent)
872   ,fh2TrackPtVsDCAXY(copy.fh2TrackPtVsDCAXY)
873   ,fh2TrackPtVsDCAZ(copy.fh2TrackPtVsDCAXY)
874   ,fh1Xsec(copy.fh1Xsec)
875   ,fh1Trials(copy.fh1Trials)
876   ,fh1PtHard(copy.fh1PtHard)  
877   ,fh1PtHardTrials(copy.fh1PtHardTrials)  
878   ,fh1nRecJetsCuts(copy.fh1nRecJetsCuts)
879   ,fh1nGenJets(copy.fh1nGenJets)
880   ,fh1nRecEffJets(copy.fh1nRecEffJets)
881   ,fh1nEmbeddedJets(copy.fh1nEmbeddedJets)
882   ,fh1nRecBckgJetsCuts(copy.fh1nRecBckgJetsCuts)
883   ,fh1nGenBckgJets(copy.fh1nGenBckgJets)
884   ,fh2PtRecVsGenPrim(copy.fh2PtRecVsGenPrim)
885   ,fh2PtRecVsGenSec(copy.fh2PtRecVsGenSec)
886   ,fQATrackHistosRecEffGen(copy.fQATrackHistosRecEffGen)  
887   ,fQATrackHistosRecEffRec(copy.fQATrackHistosRecEffRec)  
888   ,fQATrackHistosSecRec(copy.fQATrackHistosSecRec)  
889   ,fFFHistosRecEffGen(copy.fFFHistosRecEffGen)    
890   ,fFFHistosRecEffRec(copy.fFFHistosRecEffRec)  
891   ,fFFHistosSecRec(copy.fFFHistosSecRec)   
892   ,fhnResponseSinglePt(copy.fhnResponseSinglePt)
893   ,fh2SingleInvPtRecMnGenVsPtGen(copy.fh2SingleInvPtRecMnGenVsPtGen) 
894   ,fhnResponseJetTrackPt(copy.fhnResponseJetTrackPt)
895   ,fhnResponseJetZ(copy.fhnResponseJetZ)
896   ,fhnResponseJetXi(copy.fhnResponseJetXi)
897   // Background
898   ,fh1OutLeadingMult(copy.fh1OutLeadingMult)
899   ,fh1OutLeadingStatMult(copy.fh1OutLeadingStatMult)
900   ,fh1PerpMult(copy.fh1PerpMult)
901   ,fh1ASideMult(copy.fh1ASideMult)
902   ,fh1ASideWindowMult(copy.fh1ASideWindowMult)
903   ,fh1PerpWindowMult(copy.fh1PerpWindowMult)
904   ,fh1Out2JetsMult(copy.fh1Out2JetsMult)
905   ,fh1Out3JetsMult(copy.fh1Out3JetsMult)
906   ,fh1MedianClustersMult(copy.fh1MedianClustersMult)
907   ,fh1OutClustersMult(copy.fh1OutClustersMult)
908   ,fh1FractionPtEmbedded(copy.fh1FractionPtEmbedded)
909   ,fh1IndexEmbedded(copy.fh1IndexEmbedded)
910   ,fh2DeltaPtVsJetPtEmbedded(copy.fh2DeltaPtVsJetPtEmbedded)
911   ,fh2DeltaPtVsRecJetPtEmbedded(copy.fh2DeltaPtVsRecJetPtEmbedded)
912   ,fh1DeltaREmbedded(copy.fh1DeltaREmbedded)
913   ,fh2ptVsDistNN_pt50_rec(copy.fh2ptVsDistNN_pt50_rec)    
914   ,fh2ptVsDistNN_pt50_nonRec(copy.fh2ptVsDistNN_pt50_nonRec) 
915   ,fh2ptVsDistNN_pt10_rec(copy.fh2ptVsDistNN_pt10_rec)    
916   ,fh2ptVsDistNN_pt10_nonRec(copy.fh2ptVsDistNN_pt10_nonRec) 
917   ,fQABckgHisto0RecCuts(copy.fQABckgHisto0RecCuts)  
918   ,fQABckgHisto0Gen(copy.fQABckgHisto0Gen)      
919   ,fQABckgHisto1RecCuts(copy.fQABckgHisto1RecCuts)  
920   ,fQABckgHisto1Gen(copy.fQABckgHisto1Gen)      
921   ,fQABckgHisto2RecCuts(copy.fQABckgHisto2RecCuts)  
922   ,fQABckgHisto2Gen(copy.fQABckgHisto2Gen)
923   ,fQABckgHisto3RecCuts(copy.fQABckgHisto3RecCuts)  
924   ,fQABckgHisto3Gen(copy.fQABckgHisto3Gen)     
925   ,fQABckgHisto4RecCuts(copy.fQABckgHisto4RecCuts)  
926   ,fQABckgHisto4Gen(copy.fQABckgHisto4Gen)     
927   ,fFFBckgHisto0RecCuts(copy.fFFBckgHisto0RecCuts)
928   ,fFFBckgHisto0RecLeading(copy.fFFBckgHisto0RecLeading)
929   ,fFFBckgHisto0Gen(copy.fFFBckgHisto0Gen)       
930   ,fFFBckgHisto0GenLeading(copy.fFFBckgHisto0GenLeading)
931   ,fFFBckgHisto1RecCuts(copy.fFFBckgHisto1RecCuts)
932   ,fFFBckgHisto1RecLeading(copy.fFFBckgHisto1RecLeading)
933   ,fFFBckgHisto1Gen(copy.fFFBckgHisto1Gen)       
934   ,fFFBckgHisto1GenLeading(copy.fFFBckgHisto1GenLeading)
935   ,fFFBckgHisto2RecCuts(copy.fFFBckgHisto2RecCuts)
936   ,fFFBckgHisto2RecLeading(copy.fFFBckgHisto2RecLeading)
937   ,fFFBckgHisto2Gen(copy.fFFBckgHisto2Gen)       
938   ,fFFBckgHisto2GenLeading(copy.fFFBckgHisto2GenLeading)
939   ,fFFBckgHisto3RecCuts(copy.fFFBckgHisto3RecCuts)
940   ,fFFBckgHisto3RecLeading(copy.fFFBckgHisto3RecLeading)
941   ,fFFBckgHisto3Gen(copy.fFFBckgHisto3Gen)       
942   ,fFFBckgHisto3GenLeading(copy.fFFBckgHisto3GenLeading)
943   ,fFFBckgHisto4RecCuts(copy.fFFBckgHisto4RecCuts)
944   ,fFFBckgHisto4RecLeading(copy.fFFBckgHisto4RecLeading)
945   ,fFFBckgHisto4Gen(copy.fFFBckgHisto4Gen)       
946   ,fFFBckgHisto4GenLeading(copy.fFFBckgHisto4GenLeading)
947   ,fIJBckgHisto0RecCuts(copy.fIJBckgHisto0RecCuts)   
948   ,fIJBckgHisto0RecLeading(copy.fIJBckgHisto0RecLeading)
949   ,fIJBckgHisto0Gen(copy.fIJBckgHisto0Gen)       
950   ,fIJBckgHisto0GenLeading(copy.fIJBckgHisto0GenLeading)
951   ,fIJBckgHisto1RecCuts(copy.fIJBckgHisto1RecCuts)   
952   ,fIJBckgHisto1RecLeading(copy.fIJBckgHisto1RecLeading)
953   ,fIJBckgHisto1Gen(copy.fIJBckgHisto1Gen)       
954   ,fIJBckgHisto1GenLeading(copy.fIJBckgHisto1GenLeading)
955   ,fIJBckgHisto2RecCuts(copy.fIJBckgHisto2RecCuts)   
956   ,fIJBckgHisto2RecLeading(copy.fIJBckgHisto2RecLeading)
957   ,fIJBckgHisto2Gen(copy.fIJBckgHisto2Gen)       
958   ,fIJBckgHisto2GenLeading(copy.fIJBckgHisto2GenLeading)
959   ,fIJBckgHisto3RecCuts(copy.fIJBckgHisto3RecCuts)   
960   ,fIJBckgHisto3RecLeading(copy.fIJBckgHisto3RecLeading)
961   ,fIJBckgHisto3Gen(copy.fIJBckgHisto3Gen)       
962   ,fIJBckgHisto3GenLeading(copy.fIJBckgHisto3GenLeading)
963   ,fIJBckgHisto4RecCuts(copy.fIJBckgHisto4RecCuts)   
964   ,fIJBckgHisto4RecLeading(copy.fIJBckgHisto4RecLeading)
965   ,fIJBckgHisto4Gen(copy.fIJBckgHisto4Gen)       
966   ,fIJBckgHisto4GenLeading(copy.fIJBckgHisto4GenLeading)
967   ,fRandom(copy.fRandom)
968   ,fBckgSubMethod(copy.fBckgSubMethod)
969 {
970   // copy constructor
971   fBckgType[0] = copy.fBckgType[0];
972   fBckgType[1] = copy.fBckgType[1];
973   fBckgType[2] = copy.fBckgType[2];
974   fBckgType[3] = copy.fBckgType[3];
975   fBckgType[4] = copy.fBckgType[4];
976 }
977
978 // _________________________________________________________________________________________________________________________________
979 AliAnalysisTaskFragmentationFunction& AliAnalysisTaskFragmentationFunction::operator=(const AliAnalysisTaskFragmentationFunction& o)
980 {
981   // assignment
982   
983   if(this!=&o){
984
985     AliAnalysisTaskSE::operator=(o);
986     fESD                          = o.fESD;
987     fAOD                          = o.fAOD;
988     fAODJets                      = o.fAODJets;  
989     fAODExtension                 = o.fAODExtension;
990     fNonStdFile                   = o.fNonStdFile;
991     fBranchRecJets                = o.fBranchRecJets;
992     fBranchRecBackJets            = o.fBranchRecBackJets;
993     fBranchRecBckgClusters        = o.fBranchRecBckgClusters;
994     fBranchGenJets                = o.fBranchGenJets;
995     fBranchEmbeddedJets           = o.fBranchEmbeddedJets;
996     fTrackTypeGen                 = o.fTrackTypeGen;
997     fJetTypeGen                   = o.fJetTypeGen;
998     fJetTypeRecEff                = o.fJetTypeRecEff;
999     fUseAODInputJets              = o.fUseAODInputJets;
1000     fFilterMask                   = o.fFilterMask;
1001     fUsePhysicsSelection          = o.fUsePhysicsSelection;
1002     fEvtSelectionMask             = o.fEvtSelectionMask;
1003     fEventClass                   = o.fEventClass;
1004     fMaxVertexZ                   = o.fMaxVertexZ;
1005     fTrackPtCut                   = o.fTrackPtCut;
1006     fTrackEtaMin                  = o.fTrackEtaMin;
1007     fTrackEtaMax                  = o.fTrackEtaMax;
1008     fTrackPhiMin                  = o.fTrackPhiMin;
1009     fTrackPhiMax                  = o.fTrackPhiMax;
1010     fUseExtraTracks               = o.fUseExtraTracks;
1011     fUseExtraTracksBgr            = o.fUseExtraTracksBgr;
1012     fCutFractionPtEmbedded        = o.fCutFractionPtEmbedded;
1013     fUseEmbeddedJetAxis           = o.fUseEmbeddedJetAxis;
1014     fUseEmbeddedJetPt             = o.fUseEmbeddedJetPt;
1015     fJetPtCut                     = o.fJetPtCut;
1016     fJetEtaMin                    = o.fJetEtaMin;
1017     fJetEtaMax                    = o.fJetEtaMax;
1018     fJetPhiMin                    = o.fJetPhiMin;
1019     fJetPhiMax                    = o.fJetPhiMin;
1020     fDiJetCut                     = o.fDiJetCut;
1021     fDiJetDeltaPhiCut             = o.fDiJetDeltaPhiCut;
1022     fDiJetPtFractionCut           = o.fDiJetPtFractionCut;
1023     fDiJetCDFCut                  = o.fDiJetCDFCut;
1024     fDiJetKindBins                = o.fDiJetKindBins;
1025     fFFRadius                     = o.fFFRadius;
1026     fFFMaxTrackPt                 = o.fFFMaxTrackPt;
1027     fFFMinnTracks                 = o.fFFMinnTracks;
1028     fFFBckgRadius                 = o.fFFBckgRadius;
1029     fBckgMode                     = o.fBckgMode;
1030     fIJMode                       = o.fIJMode;
1031     fQAMode                       = o.fQAMode;
1032     fFFMode                       = o.fFFMode;
1033     fDJMode                       = o.fDJMode;
1034     fEffMode                      = o.fEffMode;
1035     fPhiCorrMode                  = o.fPhiCorrMode;
1036     fBckgType[0]                  = o.fBckgType[0];
1037     fBckgType[1]                  = o.fBckgType[1];
1038     fBckgType[2]                  = o.fBckgType[2];
1039     fBckgType[3]                  = o.fBckgType[3];
1040     fBckgType[4]                  = o.fBckgType[4];
1041     fUseRecEffRecJetPtBins        = o.fUseRecEffRecJetPtBins;
1042     fUseResponseRecJetPtBins      = o.fUseResponseRecJetPtBins;
1043     fAvgTrials                    = o.fAvgTrials;
1044     fTracksRec                    = o.fTracksRec;
1045     fTracksRecCuts                = o.fTracksRecCuts;
1046     fTracksGen                    = o.fTracksGen;
1047     fTracksAODMCCharged           = o.fTracksAODMCCharged;
1048     fTracksAODMCChargedSec        = o.fTracksAODMCChargedSec;
1049     fTracksRecQualityCuts         = o.fTracksRecQualityCuts;
1050     fJetsRec                      = o.fJetsRec;
1051     fJetsRecCuts                  = o.fJetsRecCuts;
1052     fJetsGen                      = o.fJetsGen;
1053     fJetsRecEff                   = o.fJetsRecEff;
1054     fJetsEmbedded                 = o.fJetsEmbedded;
1055     fBckgJetsRec                  = o.fBckgJetsRec;
1056     fBckgJetsRecCuts              = o.fBckgJetsRecCuts;
1057     fBckgJetsGen                  = o.fBckgJetsGen;
1058     fQATrackHistosRec             = o.fQATrackHistosRec;
1059     fQATrackHistosRecCuts         = o.fQATrackHistosRecCuts;
1060     fQATrackHistosGen             = o.fQATrackHistosGen;
1061     fQAJetHistosRec               = o.fQAJetHistosRec;
1062     fQAJetHistosRecCuts           = o.fQAJetHistosRecCuts;
1063     fQAJetHistosRecCutsLeading    = o.fQAJetHistosRecCutsLeading;
1064     fQAJetHistosGen               = o.fQAJetHistosGen;
1065     fQAJetHistosGenLeading        = o.fQAJetHistosGenLeading;
1066     fQAJetHistosRecEffLeading     = o.fQAJetHistosRecEffLeading;
1067     fFFHistosRecCuts              = o.fFFHistosRecCuts;
1068     fFFHistosRecLeading           = o.fFFHistosRecLeading;
1069     fFFHistosRecLeadingTrack      = o.fFFHistosRecLeadingTrack;
1070     fFFHistosGen                  = o.fFFHistosGen;
1071     fFFHistosGenLeading           = o.fFFHistosGenLeading;
1072     fFFHistosGenLeadingTrack      = o.fFFHistosGenLeadingTrack;
1073     fIJHistosRecCuts              = o.fIJHistosRecCuts;
1074     fIJHistosRecLeading           = o.fIJHistosRecLeading;
1075     fIJHistosRecLeadingTrack      = o.fIJHistosRecLeadingTrack;
1076     fIJHistosGen                  = o.fIJHistosGen;
1077     fIJHistosGenLeading           = o.fIJHistosGenLeading;
1078     fIJHistosGenLeadingTrack      = o.fIJHistosGenLeadingTrack;
1079     fFFDiJetHistosRecCuts         = o.fFFDiJetHistosRecCuts;
1080     fFFDiJetHistosRecLeading      = o.fFFDiJetHistosRecLeading;
1081     fFFDiJetHistosRecLeadingTrack = o.fFFDiJetHistosRecLeadingTrack;
1082     fFFDiJetHistosGen             = o.fFFDiJetHistosGen;
1083     fFFDiJetHistosGenLeading      = o.fFFDiJetHistosGenLeading;
1084     fFFDiJetHistosGenLeadingTrack = o.fFFDiJetHistosGenLeadingTrack;
1085     fQADiJetHistosRecCuts         = o.fQADiJetHistosRecCuts;
1086     fQADiJetHistosGen             = o.fQADiJetHistosGen;
1087     fPhiCorrHistosJetArea         = o.fPhiCorrHistosJetArea;
1088     fPhiCorrHistosTransverseArea  = o.fPhiCorrHistosTransverseArea;
1089     fPhiCorrHistosAwayArea        = o.fPhiCorrHistosAwayArea;
1090     fQATrackHighPtThreshold       = o.fQATrackHighPtThreshold; 
1091     fFFNBinsJetPt                 = o.fFFNBinsJetPt;    
1092     fFFJetPtMin                   = o.fFFJetPtMin; 
1093     fFFJetPtMax                   = o.fFFJetPtMax;
1094     fFFNBinsPt                    = o.fFFNBinsPt;      
1095     fFFPtMin                      = o.fFFPtMin;        
1096     fFFPtMax                      = o.fFFPtMax;        
1097     fFFNBinsXi                    = o.fFFNBinsXi;      
1098     fFFXiMin                      = o.fFFXiMin;        
1099     fFFXiMax                      = o.fFFXiMax;        
1100     fFFNBinsZ                     = o.fFFNBinsZ;       
1101     fFFZMin                       = o.fFFZMin;         
1102     fFFZMax                       = o.fFFZMax;         
1103     fFFLogZBins                   = o.fFFLogZBins;         
1104     fQAJetNBinsPt                 = o.fQAJetNBinsPt;   
1105     fQAJetPtMin                   = o.fQAJetPtMin;     
1106     fQAJetPtMax                   = o.fQAJetPtMax;     
1107     fQAJetNBinsEta                = o.fQAJetNBinsEta;  
1108     fQAJetEtaMin                  = o.fQAJetEtaMin;    
1109     fQAJetEtaMax                  = o.fQAJetEtaMax;    
1110     fQAJetNBinsPhi                = o.fQAJetNBinsPhi;  
1111     fQAJetPhiMin                  = o.fQAJetPhiMin;    
1112     fQAJetPhiMax                  = o.fQAJetPhiMax;    
1113     fQATrackNBinsPt               = o.fQATrackNBinsPt; 
1114     fQATrackPtMin                 = o.fQATrackPtMin;   
1115     fQATrackPtMax                 = o.fQATrackPtMax;   
1116     fQATrackNBinsEta              = o.fQATrackNBinsEta;
1117     fQATrackEtaMin                = o.fQATrackEtaMin;  
1118     fQATrackEtaMax                = o.fQATrackEtaMax;  
1119     fQATrackNBinsPhi              = o.fQATrackNBinsPhi;
1120     fQATrackPhiMin                = o.fQATrackPhiMin;  
1121     fQATrackPhiMax                = o.fQATrackPhiMax;  
1122     fIJNBinsJetPt                 = o.fIJNBinsJetPt;
1123     fIJJetPtMin                   = o.fIJJetPtMin;
1124     fIJJetPtMax                   = o.fIJJetPtMax;
1125     fIJNBinsPt                    = o.fIJNBinsPt;
1126     fIJPtMin                      = o.fIJPtMin;
1127     fIJPtMax                      = o.fIJPtMax;
1128     fIJNBinsZ                     = o.fIJNBinsZ;
1129     fIJZMin                       = o.fIJZMin;
1130     fIJZMax                       = o.fIJZMax;
1131     fIJNBinsCosTheta              = o.fIJNBinsCosTheta;
1132     fIJCosThetaMin                = o.fIJCosThetaMin;
1133     fIJCosThetaMax                = o.fIJCosThetaMax;
1134     fIJNBinsTheta                 = o.fIJNBinsTheta;
1135     fIJThetaMin                   = o.fIJThetaMin;
1136     fIJThetaMax                   = o.fIJThetaMax;
1137     fIJNBinsJt                    = o.fIJNBinsJt;
1138     fIJJtMin                      = o.fIJJtMin;
1139     fIJJtMax                      = o.fIJJtMax;
1140     fDiJetNBinsJetInvMass         = o.fDiJetNBinsJetInvMass;
1141     fDiJetJetInvMassMin           = o.fDiJetJetInvMassMin;
1142     fDiJetJetInvMassMax           = o.fDiJetJetInvMassMax;
1143     fDiJetNBinsJetPt              = o.fDiJetNBinsJetPt;
1144     fDiJetJetPtMin                = o.fDiJetJetPtMin;
1145     fDiJetJetPtMax                = o.fDiJetJetPtMax;
1146     fDiJetNBinsPt                 = o.fDiJetNBinsPt;
1147     fDiJetPtMin                   = o.fDiJetPtMin;
1148     fDiJetPtMax                   = o.fDiJetPtMax;
1149     fDiJetNBinsXi                 = o.fDiJetNBinsXi;
1150     fDiJetXiMin                   = o.fDiJetXiMin;
1151     fDiJetXiMax                   = o.fDiJetXiMax;
1152     fDiJetNBinsZ                  = o.fDiJetNBinsZ;
1153     fDiJetZMin                    = o.fDiJetZMin;
1154     fDiJetZMax                    = o.fDiJetZMax;
1155     fQADiJetNBinsInvMass          = o.fQADiJetNBinsInvMass;
1156     fQADiJetInvMassMin            = o.fQADiJetInvMassMin;
1157     fQADiJetInvMassMax            = o.fQADiJetInvMassMax;
1158     fQADiJetNBinsJetPt            = o.fQADiJetNBinsJetPt;
1159     fQADiJetJetPtMin              = o.fQADiJetJetPtMin;
1160     fQADiJetJetPtMax              = o.fQADiJetJetPtMax;
1161     fQADiJetNBinsDeltaPhi         = o.fQADiJetNBinsDeltaPhi;
1162     fQADiJetDeltaPhiMin           = o.fQADiJetDeltaPhiMin;
1163     fQADiJetDeltaPhiMax           = o.fQADiJetDeltaPhiMax;
1164     fQADiJetNBinsDeltaEta         = o.fQADiJetNBinsDeltaEta;
1165     fQADiJetDeltaEtaMin           = o.fQADiJetDeltaEtaMin;
1166     fQADiJetDeltaEtaMax           = o.fQADiJetDeltaEtaMax;
1167     fQADiJetNBinsDeltaPt          = o.fQADiJetNBinsDeltaPt;
1168     fQADiJetDeltaPtMin            = o.fQADiJetDeltaPtMin;
1169     fQADiJetDeltaPtMax            = o.fQADiJetDeltaPtMax;
1170     fQADiJetNBinsInBal            = o.fQADiJetNBinsInBal;
1171     fQADiJetInBalMin              = o.fQADiJetInBalMin;
1172     fQADiJetInBalMax              = o.fQADiJetInBalMax;
1173     fPhiCorrNBinsPt               = o.fPhiCorrNBinsPt;
1174     fPhiCorrPtMin                 = o.fPhiCorrPtMin;
1175     fPhiCorrPtMax                 = o.fPhiCorrPtMax;
1176     fPhiCorrNBinsEta              = o.fPhiCorrNBinsEta;
1177     fPhiCorrEtaMin                = o.fPhiCorrEtaMin;
1178     fPhiCorrEtaMax                = o.fPhiCorrEtaMax;
1179     fPhiCorrNBinsPhi              = o.fPhiCorrNBinsPhi;
1180     fPhiCorrPhiMin                = o.fPhiCorrPhiMin;
1181     fPhiCorrPhiMax                = o.fPhiCorrPhiMax;
1182     fCommonHistList               = o.fCommonHistList;
1183     fh1EvtSelection               = o.fh1EvtSelection;
1184     fh1VertexNContributors        = o.fh1VertexNContributors;
1185     fh1VertexZ                    = o.fh1VertexZ;
1186     fh1EvtMult                    = o.fh1EvtMult;
1187     fh1EvtCent                    = o.fh1EvtCent;
1188     fh2TrackPtVsDCAXY             = o.fh2TrackPtVsDCAXY;
1189     fh2TrackPtVsDCAZ              = o.fh2TrackPtVsDCAXY;
1190     fh1Xsec                       = o.fh1Xsec;
1191     fh1Trials                     = o.fh1Trials;
1192     fh1PtHard                     = o.fh1PtHard;
1193     fh1PtHardTrials               = o.fh1PtHardTrials;
1194     fh1nRecJetsCuts               = o.fh1nRecJetsCuts;
1195     fh1nGenJets                   = o.fh1nGenJets; 
1196     fh1nRecEffJets                = o.fh1nRecEffJets;
1197     fh1nEmbeddedJets              = o.fh1nEmbeddedJets;
1198     fh2PtRecVsGenPrim             = o.fh2PtRecVsGenPrim;
1199     fh2PtRecVsGenSec              = o.fh2PtRecVsGenSec;
1200     fQATrackHistosRecEffGen       = o.fQATrackHistosRecEffGen;  
1201     fQATrackHistosRecEffRec       = o.fQATrackHistosRecEffRec;  
1202     fQATrackHistosSecRec          = o.fQATrackHistosSecRec;  
1203     fFFHistosRecEffGen            = o.fFFHistosRecEffGen;    
1204     fFFHistosRecEffRec            = o.fFFHistosRecEffRec;  
1205     fFFHistosSecRec               = o.fFFHistosSecRec;   
1206     fhnResponseSinglePt           = o.fhnResponseSinglePt;
1207     fh2SingleInvPtRecMnGenVsPtGen = o.fh2SingleInvPtRecMnGenVsPtGen;
1208     fhnResponseJetTrackPt         = o.fhnResponseJetTrackPt;
1209     fhnResponseJetZ               = o.fhnResponseJetZ;
1210     fhnResponseJetXi              = o.fhnResponseJetXi;
1211     // Background
1212     fh1OutLeadingMult             = o.fh1OutLeadingMult;
1213     fh1OutLeadingStatMult         = o.fh1OutLeadingStatMult;
1214     fh1PerpMult                   = o.fh1PerpMult;
1215     fh1ASideMult                  = o.fh1ASideMult;
1216     fh1ASideWindowMult            = o.fh1ASideWindowMult;
1217     fh1PerpWindowMult             = o.fh1PerpWindowMult;
1218     fh1Out2JetsMult               = o.fh1Out2JetsMult;
1219     fh1Out3JetsMult               = o.fh1Out3JetsMult;
1220     fh1MedianClustersMult         = o.fh1MedianClustersMult;
1221     fh1OutClustersMult            = o.fh1OutClustersMult;
1222     fh1FractionPtEmbedded         = o.fh1FractionPtEmbedded;
1223     fh1IndexEmbedded              = o.fh1IndexEmbedded;
1224     fh2DeltaPtVsJetPtEmbedded     = o.fh2DeltaPtVsJetPtEmbedded;
1225     fh2DeltaPtVsRecJetPtEmbedded  = o.fh2DeltaPtVsRecJetPtEmbedded;
1226     fh1DeltaREmbedded             = o.fh1DeltaREmbedded;
1227     fh2ptVsDistNN_pt50_rec        = o.fh2ptVsDistNN_pt50_rec;    
1228     fh2ptVsDistNN_pt50_nonRec     = o.fh2ptVsDistNN_pt50_nonRec; 
1229     fh2ptVsDistNN_pt10_rec        = o.fh2ptVsDistNN_pt10_rec;    
1230     fh2ptVsDistNN_pt10_nonRec     = o.fh2ptVsDistNN_pt10_nonRec; 
1231     fQABckgHisto0RecCuts          = o.fQABckgHisto0RecCuts;  
1232     fQABckgHisto0Gen              = o.fQABckgHisto0Gen;      
1233     fQABckgHisto1RecCuts          = o.fQABckgHisto1RecCuts;  
1234     fQABckgHisto1Gen              = o.fQABckgHisto1Gen;      
1235     fQABckgHisto2RecCuts          = o.fQABckgHisto2RecCuts;  
1236     fQABckgHisto2Gen              = o.fQABckgHisto2Gen;  
1237     fQABckgHisto3RecCuts          = o.fQABckgHisto3RecCuts;  
1238     fQABckgHisto3Gen              = o.fQABckgHisto3Gen;  
1239     fQABckgHisto4RecCuts          = o.fQABckgHisto4RecCuts;  
1240     fQABckgHisto4Gen              = o.fQABckgHisto4Gen;  
1241     fFFBckgHisto0RecCuts          = o.fFFBckgHisto0RecCuts;
1242     fFFBckgHisto0RecLeading       = o.fFFBckgHisto0RecLeading;
1243     fFFBckgHisto0Gen              = o.fFFBckgHisto0Gen;       
1244     fFFBckgHisto0GenLeading       = o.fFFBckgHisto0GenLeading;
1245     fFFBckgHisto1RecCuts          = o.fFFBckgHisto1RecCuts;
1246     fFFBckgHisto1RecLeading       = o.fFFBckgHisto1RecLeading;
1247     fFFBckgHisto1Gen              = o.fFFBckgHisto1Gen;       
1248     fFFBckgHisto1GenLeading       = o.fFFBckgHisto1GenLeading;
1249     fFFBckgHisto2RecCuts          = o.fFFBckgHisto2RecCuts;
1250     fFFBckgHisto2RecLeading       = o.fFFBckgHisto2RecLeading;
1251     fFFBckgHisto2Gen              = o.fFFBckgHisto2Gen;       
1252     fFFBckgHisto2GenLeading       = o.fFFBckgHisto2GenLeading;
1253     fFFBckgHisto3RecCuts          = o.fFFBckgHisto3RecCuts;
1254     fFFBckgHisto3RecLeading       = o.fFFBckgHisto3RecLeading;
1255     fFFBckgHisto3Gen              = o.fFFBckgHisto3Gen;       
1256     fFFBckgHisto3GenLeading       = o.fFFBckgHisto3GenLeading;
1257     fFFBckgHisto4RecCuts          = o.fFFBckgHisto4RecCuts;
1258     fFFBckgHisto4RecLeading       = o.fFFBckgHisto4RecLeading;
1259     fFFBckgHisto4Gen              = o.fFFBckgHisto4Gen;       
1260     fFFBckgHisto4GenLeading       = o.fFFBckgHisto4GenLeading;
1261     fIJBckgHisto0RecCuts          = o.fIJBckgHisto0RecCuts;   
1262     fIJBckgHisto0RecLeading       = o.fIJBckgHisto0RecLeading;
1263     fIJBckgHisto0Gen              = o.fIJBckgHisto0Gen;       
1264     fIJBckgHisto0GenLeading       = o.fIJBckgHisto0GenLeading;
1265     fIJBckgHisto1RecCuts          = o.fIJBckgHisto1RecCuts;   
1266     fIJBckgHisto1RecLeading       = o.fIJBckgHisto1RecLeading;
1267     fIJBckgHisto1Gen              = o.fIJBckgHisto1Gen;       
1268     fIJBckgHisto1GenLeading       = o.fIJBckgHisto1GenLeading;
1269     fIJBckgHisto2RecCuts          = o.fIJBckgHisto2RecCuts;   
1270     fIJBckgHisto2RecLeading       = o.fIJBckgHisto2RecLeading;
1271     fIJBckgHisto2Gen              = o.fIJBckgHisto2Gen;       
1272     fIJBckgHisto2GenLeading       = o.fIJBckgHisto2GenLeading;
1273     fIJBckgHisto3Gen              = o.fIJBckgHisto3Gen;       
1274     fIJBckgHisto3GenLeading       = o.fIJBckgHisto3GenLeading;
1275     fIJBckgHisto4Gen              = o.fIJBckgHisto4Gen;       
1276     fIJBckgHisto4GenLeading       = o.fIJBckgHisto4GenLeading;
1277     fRandom                       = o.fRandom;
1278     fBckgSubMethod                = o.fBckgSubMethod;
1279   }
1280     
1281   return *this;
1282 }
1283
1284 //___________________________________________________________________________
1285 AliAnalysisTaskFragmentationFunction::~AliAnalysisTaskFragmentationFunction()
1286 {
1287   // destructor
1288   
1289   if(fTracksRec)             delete fTracksRec;
1290   if(fTracksRecCuts)         delete fTracksRecCuts;
1291   if(fTracksGen)             delete fTracksGen;
1292   if(fTracksAODMCCharged)    delete fTracksAODMCCharged;  
1293   if(fTracksAODMCChargedSec) delete fTracksAODMCChargedSec;  
1294   if(fTracksRecQualityCuts)  delete fTracksRecQualityCuts; 
1295   if(fJetsRec)               delete fJetsRec;
1296   if(fJetsRecCuts)           delete fJetsRecCuts;
1297   if(fJetsGen)               delete fJetsGen;
1298   if(fJetsRecEff)            delete fJetsRecEff;
1299   if(fJetsEmbedded)          delete fJetsEmbedded;
1300
1301   if(fBckgMode && 
1302      (fBckgType[0]==kBckgClusters || fBckgType[1]==kBckgClusters || fBckgType[2]==kBckgClusters || fBckgType[3]==kBckgClusters || fBckgType[4]==kBckgClusters ||
1303       fBckgType[0]==kBckgClustersOutLeading || fBckgType[1]==kBckgClustersOutLeading || fBckgType[2]==kBckgClustersOutLeading || 
1304       fBckgType[3]==kBckgClustersOutLeading || fBckgType[4]==kBckgClustersOutLeading)){
1305
1306     if(fBckgJetsRec)          delete fBckgJetsRec;
1307     if(fBckgJetsRecCuts)      delete fBckgJetsRecCuts;
1308     if(fBckgJetsGen)          delete fBckgJetsGen;
1309   }
1310   if(fRandom)               delete fRandom;
1311 }
1312
1313 //______________________________________________________________________________________________________
1314 AliAnalysisTaskFragmentationFunction::AliFragFuncHistos::AliFragFuncHistos(const char* name, 
1315                                                          Int_t nJetPt, Float_t jetPtMin, Float_t jetPtMax,  
1316                                                          Int_t nPt, Float_t ptMin, Float_t ptMax,
1317                                                          Int_t nXi, Float_t xiMin, Float_t xiMax,
1318                                                          Int_t nZ , Float_t zMin , Float_t zMax, Bool_t useLogZBins)
1319   : TObject()
1320   ,fNBinsJetPt(nJetPt)
1321   ,fJetPtMin(jetPtMin)
1322   ,fJetPtMax(jetPtMax)
1323   ,fNBinsPt(nPt) 
1324   ,fPtMin(ptMin)   
1325   ,fPtMax(ptMax)   
1326   ,fNBinsXi(nXi) 
1327   ,fXiMin(xiMin)   
1328   ,fXiMax(xiMax)   
1329   ,fNBinsZ(nZ)  
1330   ,fZMin(zMin)    
1331   ,fZMax(zMax)
1332   ,fLogZBins(useLogZBins)
1333   ,fh2TrackPt(0)
1334   ,fh2Xi(0)
1335   ,fh2Z(0)
1336   ,fh1JetPt(0)
1337   ,fNameFF(name)
1338 {
1339   // default constructor
1340
1341 }
1342
1343 //___________________________________________________________________________
1344 AliAnalysisTaskFragmentationFunction::AliFragFuncHistos::AliFragFuncHistos(const AliFragFuncHistos& copy)
1345   : TObject()
1346   ,fNBinsJetPt(copy.fNBinsJetPt)
1347   ,fJetPtMin(copy.fJetPtMin)
1348   ,fJetPtMax(copy.fJetPtMax)
1349   ,fNBinsPt(copy.fNBinsPt) 
1350   ,fPtMin(copy.fPtMin)   
1351   ,fPtMax(copy.fPtMax)   
1352   ,fNBinsXi(copy.fNBinsXi) 
1353   ,fXiMin(copy.fXiMin)   
1354   ,fXiMax(copy.fXiMax)   
1355   ,fNBinsZ(copy.fNBinsZ)  
1356   ,fZMin(copy.fZMin)    
1357   ,fZMax(copy.fZMax)
1358   ,fLogZBins(copy.fLogZBins)
1359   ,fh2TrackPt(copy.fh2TrackPt)
1360   ,fh2Xi(copy.fh2Xi)
1361   ,fh2Z(copy.fh2Z)
1362   ,fh1JetPt(copy.fh1JetPt)
1363   ,fNameFF(copy.fNameFF)
1364 {
1365   // copy constructor
1366 }
1367
1368 //_______________________________________________________________________________________________________________________________________________________________
1369 AliAnalysisTaskFragmentationFunction::AliFragFuncHistos& AliAnalysisTaskFragmentationFunction::AliFragFuncHistos::operator=(const AliAnalysisTaskFragmentationFunction::AliFragFuncHistos& o)
1370 {
1371   // assignment
1372   
1373   if(this!=&o){
1374     TObject::operator=(o);
1375     fNBinsJetPt = o.fNBinsJetPt;
1376     fJetPtMin   = o.fJetPtMin;
1377     fJetPtMax   = o.fJetPtMax;
1378     fNBinsPt    = o.fNBinsPt; 
1379     fPtMin      = o.fPtMin;   
1380     fPtMax      = o.fPtMax;   
1381     fNBinsXi    = o.fNBinsXi; 
1382     fXiMin      = o.fXiMin;   
1383     fXiMax      = o.fXiMax;   
1384     fNBinsZ     = o.fNBinsZ;  
1385     fZMin       = o.fZMin;    
1386     fZMax       = o.fZMax;    
1387     fLogZBins   = o.fLogZBins;
1388     fh2TrackPt  = o.fh2TrackPt;
1389     fh2Xi       = o.fh2Xi;
1390     fh2Z        = o.fh2Z;
1391     fh1JetPt    = o.fh1JetPt;
1392     fNameFF     = o.fNameFF;
1393   }
1394     
1395   return *this;
1396 }
1397
1398 //_________________________________________________________
1399 AliAnalysisTaskFragmentationFunction::AliFragFuncHistos::~AliFragFuncHistos()
1400 {
1401   // destructor 
1402
1403   if(fh1JetPt)   delete fh1JetPt;
1404   if(fh2TrackPt) delete fh2TrackPt;
1405   if(fh2Xi)      delete fh2Xi;
1406   if(fh2Z)       delete fh2Z;
1407 }
1408
1409 //_________________________________________________________________
1410 void AliAnalysisTaskFragmentationFunction::AliFragFuncHistos::DefineHistos()
1411 {
1412   // book FF histos
1413
1414   fh1JetPt   = new TH1F(Form("fh1FFJetPt%s", fNameFF.Data()),"",fNBinsJetPt,fJetPtMin,fJetPtMax);
1415   fh2TrackPt = new TH2F(Form("fh2FFTrackPt%s",fNameFF.Data()),"",fNBinsJetPt, fJetPtMin, fJetPtMax,fNBinsPt, fPtMin, fPtMax);
1416   fh2Xi      = new TH2F(Form("fh2FFXi%s",fNameFF.Data()),"",fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsXi, fXiMin, fXiMax);
1417
1418   if(!fLogZBins) fh2Z       = new TH2F(Form("fh2FFZ%s",fNameFF.Data()),"",fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsZ, fZMin, fZMax);
1419   else{ // logartihmic z binning
1420
1421     Double_t binLimsZ[fNBinsXi+1];      
1422     
1423     Int_t binZ = 0;
1424     for(Int_t binXi = fh2Xi->GetYaxis()->GetNbins(); binXi>0; binXi--){
1425       
1426       Double_t xiLo = fh2Xi->GetYaxis()->GetBinLowEdge(binXi);
1427       Double_t xiUp = fh2Xi->GetYaxis()->GetBinUpEdge(binXi);
1428       
1429       Double_t zUp = TMath::Exp(-1*xiLo);       
1430       Double_t zLo = TMath::Exp(-1*xiUp);       
1431       
1432       if(binZ == 0) binLimsZ[binZ] = zLo;
1433       binLimsZ[binZ+1] = zUp;
1434       
1435       binZ++;
1436     }
1437     
1438     fNBinsZ = binZ;
1439     fh2Z    = new TH2F(Form("fh2FFZ%s",fNameFF.Data()),"",fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsZ, binLimsZ);
1440   }
1441
1442   AliAnalysisTaskFragmentationFunction::SetProperties(fh1JetPt, "p_{T} [GeV/c]", "entries"); 
1443   AliAnalysisTaskFragmentationFunction::SetProperties(fh2TrackPt,"jet p_{T} [GeV/c]","p_{T} [GeV/c]","entries");
1444   AliAnalysisTaskFragmentationFunction::SetProperties(fh2Xi,"jet p_{T} [GeV/c]","#xi", "entries");
1445   AliAnalysisTaskFragmentationFunction::SetProperties(fh2Z,"jet p_{T} [GeV/c]","z","entries");
1446 }
1447
1448 //_______________________________________________________________________________________________________________
1449 void AliAnalysisTaskFragmentationFunction::AliFragFuncHistos::FillFF(Float_t trackPt, Float_t jetPt, Bool_t incrementJetPt, Float_t norm)
1450 {
1451   // fill FF
1452  
1453   if(incrementJetPt && norm) fh1JetPt->Fill(jetPt,1/norm);
1454   else if(incrementJetPt) fh1JetPt->Fill(jetPt);
1455
1456  // Added for proper normalization of FF background estimation
1457   // when zero track are found in the background region
1458   if((int)trackPt==-1) return;
1459  
1460   if(norm)fh2TrackPt->Fill(jetPt,trackPt,1/norm);
1461   else fh2TrackPt->Fill(jetPt,trackPt);
1462   
1463   Double_t z = 0.;
1464   if(jetPt>0) z = trackPt / jetPt;
1465   Double_t xi = 0;
1466   if(z>0) xi = TMath::Log(1/z);
1467   
1468   if(norm){
1469     fh2Xi->Fill(jetPt,xi,1/norm);
1470     fh2Z->Fill(jetPt,z,1/norm);
1471   }
1472   else {
1473     fh2Xi->Fill(jetPt,xi);
1474     fh2Z->Fill(jetPt,z);
1475   }
1476 }
1477
1478 //_________________________________________________________________________________
1479 void AliAnalysisTaskFragmentationFunction::AliFragFuncHistos::AddToOutput(TList* list) const
1480 {
1481   // add histos to list
1482
1483   list->Add(fh1JetPt);
1484   
1485   list->Add(fh2TrackPt);
1486   list->Add(fh2Xi);
1487   list->Add(fh2Z);
1488 }
1489
1490 //_________________________________________________________________________________________________________
1491 AliAnalysisTaskFragmentationFunction::AliFragFuncQAJetHistos::AliFragFuncQAJetHistos(const char* name,
1492                                                                Int_t nPt,   Float_t ptMin,   Float_t ptMax,
1493                                                                Int_t nEta,  Float_t etaMin,  Float_t etaMax,
1494                                                                Int_t nPhi,  Float_t phiMin,  Float_t phiMax)
1495   : TObject()
1496   ,fNBinsPt(nPt)
1497   ,fPtMin(ptMin)
1498   ,fPtMax(ptMax)
1499   ,fNBinsEta(nEta)
1500   ,fEtaMin(etaMin)
1501   ,fEtaMax(etaMax)
1502   ,fNBinsPhi(nPhi)
1503   ,fPhiMin(phiMin)
1504   ,fPhiMax(phiMax)
1505   ,fh2EtaPhi(0)
1506   ,fh1Pt(0)
1507   ,fNameQAJ(name)
1508 {
1509   // default constructor
1510 }
1511
1512 //____________________________________________________________________________________
1513 AliAnalysisTaskFragmentationFunction::AliFragFuncQAJetHistos::AliFragFuncQAJetHistos(const AliFragFuncQAJetHistos& copy)
1514   : TObject()
1515   ,fNBinsPt(copy.fNBinsPt)
1516   ,fPtMin(copy.fPtMin)
1517   ,fPtMax(copy.fPtMax)
1518   ,fNBinsEta(copy.fNBinsEta)
1519   ,fEtaMin(copy.fEtaMin)
1520   ,fEtaMax(copy.fEtaMax)
1521   ,fNBinsPhi(copy.fNBinsPhi)
1522   ,fPhiMin(copy.fPhiMin)
1523   ,fPhiMax(copy.fPhiMax)
1524   ,fh2EtaPhi(copy.fh2EtaPhi)
1525   ,fh1Pt(copy.fh1Pt)
1526   ,fNameQAJ(copy.fNameQAJ)
1527 {
1528   // copy constructor
1529 }
1530
1531 //________________________________________________________________________________________________________________________________________________________________________
1532 AliAnalysisTaskFragmentationFunction::AliFragFuncQAJetHistos& AliAnalysisTaskFragmentationFunction::AliFragFuncQAJetHistos::operator=(const AliAnalysisTaskFragmentationFunction::AliFragFuncQAJetHistos& o)
1533 {
1534   // assignment
1535   
1536   if(this!=&o){
1537     TObject::operator=(o);
1538     fNBinsPt  = o.fNBinsPt;
1539     fPtMin    = o.fPtMin;
1540     fPtMax    = o.fPtMax;
1541     fNBinsEta = o.fNBinsEta;
1542     fEtaMin   = o.fEtaMin;
1543     fEtaMax   = o.fEtaMax;
1544     fNBinsPhi = o.fNBinsPhi;
1545     fPhiMin   = o.fPhiMin;
1546     fPhiMax   = o.fPhiMax;
1547     fh2EtaPhi = o.fh2EtaPhi;
1548     fh1Pt     = o.fh1Pt;
1549     fNameQAJ  = o.fNameQAJ;
1550   }
1551   
1552   return *this;
1553 }
1554
1555 //______________________________________________________________
1556 AliAnalysisTaskFragmentationFunction::AliFragFuncQAJetHistos::~AliFragFuncQAJetHistos()
1557 {
1558   // destructor 
1559   
1560   if(fh2EtaPhi) delete fh2EtaPhi;
1561   if(fh1Pt)     delete fh1Pt;
1562 }
1563
1564 //____________________________________________________________________
1565 void AliAnalysisTaskFragmentationFunction::AliFragFuncQAJetHistos::DefineHistos()
1566 {
1567   // book jet QA histos
1568
1569   fh2EtaPhi  = new TH2F(Form("fh2JetQAEtaPhi%s", fNameQAJ.Data()), Form("%s: #eta - #phi distribution", fNameQAJ.Data()), fNBinsEta, fEtaMin, fEtaMax, fNBinsPhi, fPhiMin, fPhiMax);
1570   fh1Pt      = new TH1F(Form("fh1JetQAPt%s", fNameQAJ.Data()), Form("%s: p_{T} distribution", fNameQAJ.Data()), fNBinsPt, fPtMin, fPtMax);
1571         
1572   AliAnalysisTaskFragmentationFunction::SetProperties(fh2EtaPhi, "#eta", "#phi"); 
1573   AliAnalysisTaskFragmentationFunction::SetProperties(fh1Pt, "p_{T} [GeV/c]", "entries");
1574 }
1575
1576 //____________________________________________________________________________________________________
1577 void AliAnalysisTaskFragmentationFunction::AliFragFuncQAJetHistos::FillJetQA(Float_t eta, Float_t phi, Float_t pt)
1578 {
1579   // fill jet QA histos 
1580
1581   fh2EtaPhi->Fill( eta, phi);
1582   fh1Pt->Fill( pt );
1583 }
1584
1585 //____________________________________________________________________________________
1586 void AliAnalysisTaskFragmentationFunction::AliFragFuncQAJetHistos::AddToOutput(TList* list) const 
1587 {
1588   // add histos to list
1589
1590   list->Add(fh2EtaPhi);
1591   list->Add(fh1Pt);
1592 }
1593
1594 //___________________________________________________________________________________________________________
1595 AliAnalysisTaskFragmentationFunction::AliFragFuncQATrackHistos::AliFragFuncQATrackHistos(const char* name,
1596                                                                    Int_t nPt, Float_t ptMin, Float_t ptMax,
1597                                                                    Int_t nEta, Float_t etaMin, Float_t etaMax,
1598                                                                    Int_t nPhi, Float_t phiMin, Float_t phiMax,
1599                                                                    Float_t ptThresh) 
1600   : TObject()
1601   ,fNBinsPt(nPt)
1602   ,fPtMin(ptMin)
1603   ,fPtMax(ptMax)
1604   ,fNBinsEta(nEta)
1605   ,fEtaMin(etaMin)
1606   ,fEtaMax(etaMax)
1607   ,fNBinsPhi(nPhi)
1608   ,fPhiMin(phiMin)
1609   ,fPhiMax(phiMax)
1610   ,fHighPtThreshold(ptThresh)
1611   ,fh2EtaPhi(0)
1612   ,fh1Pt(0)
1613   ,fh2HighPtEtaPhi(0)
1614   ,fh2PhiPt(0)
1615   ,fNameQAT(name)
1616 {
1617   // default constructor
1618 }
1619
1620 //__________________________________________________________________________________________
1621 AliAnalysisTaskFragmentationFunction::AliFragFuncQATrackHistos::AliFragFuncQATrackHistos(const AliFragFuncQATrackHistos& copy)
1622   : TObject()
1623   ,fNBinsPt(copy.fNBinsPt)
1624   ,fPtMin(copy.fPtMin)
1625   ,fPtMax(copy.fPtMax)
1626   ,fNBinsEta(copy.fNBinsEta)
1627   ,fEtaMin(copy.fEtaMin)
1628   ,fEtaMax(copy.fEtaMax)
1629   ,fNBinsPhi(copy.fNBinsPhi)
1630   ,fPhiMin(copy.fPhiMin)
1631   ,fPhiMax(copy.fPhiMax)
1632   ,fHighPtThreshold(copy.fHighPtThreshold)
1633   ,fh2EtaPhi(copy.fh2EtaPhi)
1634   ,fh1Pt(copy.fh1Pt)
1635   ,fh2HighPtEtaPhi(copy.fh2HighPtEtaPhi)
1636   ,fh2PhiPt(copy.fh2PhiPt)
1637   ,fNameQAT(copy.fNameQAT)
1638 {
1639   // copy constructor
1640 }
1641
1642 // _____________________________________________________________________________________________________________________________________________________________________________
1643 AliAnalysisTaskFragmentationFunction::AliFragFuncQATrackHistos& AliAnalysisTaskFragmentationFunction::AliFragFuncQATrackHistos::operator=(const AliAnalysisTaskFragmentationFunction::AliFragFuncQATrackHistos& o)
1644 {
1645   // assignment
1646   
1647   if(this!=&o){
1648     TObject::operator=(o);
1649     fNBinsPt         = o.fNBinsPt;
1650     fPtMin           = o.fPtMin;
1651     fPtMax           = o.fPtMax;
1652     fNBinsEta        = o.fNBinsEta;
1653     fEtaMin          = o.fEtaMin;
1654     fEtaMax          = o.fEtaMax;
1655     fNBinsPhi        = o.fNBinsPhi;
1656     fPhiMin          = o.fPhiMin;
1657     fPhiMax          = o.fPhiMax;
1658     fHighPtThreshold = o.fHighPtThreshold;
1659     fh2EtaPhi        = o.fh2EtaPhi;
1660     fh1Pt            = o.fh1Pt;
1661     fh2HighPtEtaPhi  = o.fh2HighPtEtaPhi;
1662     fh2PhiPt         = o.fh2PhiPt;
1663     fNameQAT         = o.fNameQAT;
1664   }
1665   
1666   return *this;
1667 }
1668
1669 //___________________________________________________________________
1670 AliAnalysisTaskFragmentationFunction::AliFragFuncQATrackHistos::~AliFragFuncQATrackHistos()
1671 {
1672   // destructor 
1673   
1674   if(fh2EtaPhi)       delete fh2EtaPhi;
1675   if(fh2HighPtEtaPhi) delete fh2HighPtEtaPhi;
1676   if(fh1Pt)           delete fh1Pt;
1677   if(fh2PhiPt)        delete fh2PhiPt;
1678 }
1679
1680 //______________________________________________________________________
1681 void AliAnalysisTaskFragmentationFunction::AliFragFuncQATrackHistos::DefineHistos()
1682 {
1683   // book track QA histos
1684
1685   fh2EtaPhi       = new TH2F(Form("fh2TrackQAEtaPhi%s", fNameQAT.Data()), Form("%s: #eta - #phi distribution", fNameQAT.Data()), fNBinsEta, fEtaMin, fEtaMax, fNBinsPhi, fPhiMin, fPhiMax);
1686   fh2HighPtEtaPhi = new TH2F(Form("fh2TrackQAHighPtEtaPhi%s", fNameQAT.Data()), Form("%s: #eta - #phi distribution for high-p_{T}", fNameQAT.Data()), fNBinsEta, fEtaMin, fEtaMax, fNBinsPhi, fPhiMin, fPhiMax);
1687   fh1Pt           = new TH1F(Form("fh1TrackQAPt%s", fNameQAT.Data()), Form("%s: p_{T} distribution", fNameQAT.Data()), fNBinsPt, fPtMin, fPtMax);
1688     fh2PhiPt        = new TH2F(Form("fh2TrackQAPhiPt%s", fNameQAT.Data()), Form("%s: #phi - p_{T} distribution", fNameQAT.Data()), fNBinsPhi, fPhiMin, fPhiMax, fNBinsPt, fPtMin, fPtMax);
1689
1690   AliAnalysisTaskFragmentationFunction::SetProperties(fh2EtaPhi, "#eta", "#phi"); 
1691   AliAnalysisTaskFragmentationFunction::SetProperties(fh2HighPtEtaPhi, "#eta", "#phi");
1692   AliAnalysisTaskFragmentationFunction::SetProperties(fh1Pt, "p_{T} [GeV/c]", "entries");
1693   AliAnalysisTaskFragmentationFunction::SetProperties(fh2PhiPt, "#phi", "p_{T} [GeV/c]"); 
1694 }
1695
1696 //________________________________________________________________________________________________________
1697 void AliAnalysisTaskFragmentationFunction::AliFragFuncQATrackHistos::FillTrackQA(Float_t eta, Float_t phi, Float_t pt, Bool_t weightPt, Float_t norm)
1698 {
1699   // fill track QA histos
1700   Float_t weight = 1.;
1701   if(weightPt) weight = pt;  
1702   fh2EtaPhi->Fill( eta, phi, weight);
1703   if(pt > fHighPtThreshold) fh2HighPtEtaPhi->Fill( eta, phi, weight);
1704   if(norm) fh1Pt->Fill( pt, 1/norm );
1705   else fh1Pt->Fill( pt );
1706   fh2PhiPt->Fill(phi, pt);
1707 }
1708
1709 //______________________________________________________________________________________
1710 void AliAnalysisTaskFragmentationFunction::AliFragFuncQATrackHistos::AddToOutput(TList* list) const
1711 {
1712   // add histos to list
1713
1714   list->Add(fh2EtaPhi);
1715   list->Add(fh2HighPtEtaPhi);
1716   list->Add(fh1Pt);
1717   list->Add(fh2PhiPt);
1718 }
1719
1720 //______________________________________________________________________________________________________
1721 AliAnalysisTaskFragmentationFunction::AliFragFuncIntraJetHistos::AliFragFuncIntraJetHistos(const char* name, 
1722                                                          Int_t nJetPt, Float_t jetPtMin, Float_t jetPtMax,  
1723                                                          Int_t nPt, Float_t ptMin, Float_t ptMax,
1724                                                          Int_t nZ , Float_t zMin , Float_t zMax,
1725                                                          Int_t nCosTheta , Float_t costhetaMin , Float_t costhetaMax,
1726                                                          Int_t nTheta , Float_t thetaMin , Float_t thetaMax,
1727                                                          Int_t nJt , Float_t jtMin , Float_t jtMax)
1728   : TObject()
1729   ,fNBinsJetPt(nJetPt)
1730   ,fJetPtMin(jetPtMin)
1731   ,fJetPtMax(jetPtMax)
1732   ,fNBinsPt(nPt) 
1733   ,fPtMin(ptMin)   
1734   ,fPtMax(ptMax)   
1735   ,fNBinsZ(nZ) 
1736   ,fZMin(zMin)   
1737   ,fZMax(zMax)   
1738   ,fNBinsJt(nJt)
1739   ,fJtMin(jtMin)
1740   ,fJtMax(jtMax)
1741   ,fNBinsTheta(nTheta)
1742   ,fThetaMin(thetaMin)
1743   ,fThetaMax(thetaMax)
1744   ,fNBinsCosTheta(nCosTheta)
1745   ,fCosThetaMin(costhetaMin)
1746   ,fCosThetaMax(costhetaMax)
1747   ,fh2CosTheta(0)
1748   ,fh2PtZ(0)
1749   ,fh3ThetaZ(0)
1750   ,fh3JtTheta(0)
1751   ,fh3JtZ(0)
1752   ,fNameIJ(name)
1753 {
1754   // default constructor
1755
1756 }
1757
1758 //___________________________________________________________________________
1759 AliAnalysisTaskFragmentationFunction::AliFragFuncIntraJetHistos::AliFragFuncIntraJetHistos(const AliFragFuncIntraJetHistos& copy)
1760   : TObject()
1761   ,fNBinsJetPt(copy.fNBinsJetPt)
1762   ,fJetPtMin(copy.fJetPtMin)
1763   ,fJetPtMax(copy.fJetPtMax)
1764   ,fNBinsPt(copy.fNBinsPt) 
1765   ,fPtMin(copy.fPtMin)   
1766   ,fPtMax(copy.fPtMax)   
1767   ,fNBinsZ(copy.fNBinsZ) 
1768   ,fZMin(copy.fZMin)   
1769   ,fZMax(copy.fZMax)   
1770   ,fNBinsJt(copy.fNBinsJt)
1771   ,fJtMin(copy.fJtMin)
1772   ,fJtMax(copy.fJtMax)
1773   ,fNBinsTheta(copy.fNBinsTheta)
1774   ,fThetaMin(copy.fThetaMin)
1775   ,fThetaMax(copy.fThetaMax)
1776   ,fNBinsCosTheta(copy.fNBinsCosTheta)
1777   ,fCosThetaMin(copy.fCosThetaMin)
1778   ,fCosThetaMax(copy.fCosThetaMax)
1779   ,fh2CosTheta(copy.fh2CosTheta)
1780   ,fh2PtZ(copy.fh2PtZ)
1781   ,fh3ThetaZ(copy.fh3ThetaZ)
1782   ,fh3JtTheta(copy.fh3JtTheta)
1783   ,fh3JtZ(copy.fh3JtZ)
1784   ,fNameIJ(copy.fNameIJ)
1785 {
1786   // copy constructor
1787 }
1788
1789 //_______________________________________________________________________________________________________________________________________________________________
1790 AliAnalysisTaskFragmentationFunction::AliFragFuncIntraJetHistos& AliAnalysisTaskFragmentationFunction::AliFragFuncIntraJetHistos::operator=(const AliAnalysisTaskFragmentationFunction::AliFragFuncIntraJetHistos& o)
1791 {
1792   // assignment
1793   
1794   if(this!=&o){
1795     TObject::operator=(o);
1796     fNBinsJetPt       = o.fNBinsJetPt;
1797     fJetPtMin         = o.fJetPtMin;
1798     fJetPtMax         = o.fJetPtMax;
1799     fNBinsPt          = o.fNBinsPt; 
1800     fPtMin            = o.fPtMin;   
1801     fPtMax            = o.fPtMax;   
1802     fNBinsZ           = o.fNBinsZ; 
1803     fZMin             = o.fZMin;   
1804     fZMax             = o.fZMax;   
1805     fNBinsJt          = o.fNBinsJt;
1806     fJtMin            = o.fJtMin;
1807     fJtMax            = o.fJtMax;
1808     fNBinsTheta       = o.fNBinsTheta;
1809     fThetaMin         = o.fThetaMin;
1810     fThetaMax         = o.fThetaMax;
1811     fNBinsCosTheta    = o.fNBinsCosTheta;
1812     fCosThetaMin      = o.fCosThetaMin;
1813     fCosThetaMax      = o.fCosThetaMax;
1814     fh2CosTheta       = o.fh2CosTheta;
1815     fh2PtZ            = o.fh2PtZ;
1816     fh3ThetaZ         = o.fh3ThetaZ;
1817     fh3JtTheta        = o.fh3JtTheta;
1818     fh3JtZ            = o.fh3JtZ;
1819     fNameIJ           = o.fNameIJ;
1820   }
1821     
1822   return *this;
1823 }
1824
1825 //_________________________________________________________
1826 AliAnalysisTaskFragmentationFunction::AliFragFuncIntraJetHistos::~AliFragFuncIntraJetHistos()
1827 {
1828   // destructor 
1829
1830
1831   if(fh2CosTheta)       delete fh2CosTheta;
1832   if(fh2PtZ)            delete fh2PtZ;
1833   if(fh3ThetaZ)         delete fh3ThetaZ;             
1834   if(fh3JtTheta)        delete fh3JtTheta;
1835   if(fh3JtZ)            delete fh3JtZ;
1836
1837 }
1838
1839 //_________________________________________________________________
1840 void AliAnalysisTaskFragmentationFunction::AliFragFuncIntraJetHistos::DefineHistos()
1841 {
1842   // book FF histos
1843
1844   fh2CosTheta = new TH2F(Form("fh2IJcosTheta%s",fNameIJ.Data()),"",fNBinsJetPt, fJetPtMin, fJetPtMax,fNBinsCosTheta, fCosThetaMin, fCosThetaMax);
1845   fh2PtZ      = new TH2F(Form("fh2IJPtZ%s",fNameIJ.Data()),"",fNBinsPt, fPtMin, fPtMax, fNBinsZ, fZMin, fZMax);
1846   fh3ThetaZ   = new TH3F(Form("fh3IJThetaZ%s",fNameIJ.Data()),"",fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsTheta, fThetaMin, fThetaMax, fNBinsZ, fZMin, fZMax);
1847   fh3JtTheta  = new TH3F(Form("fh3IJJtTheta%s",fNameIJ.Data()),"",fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsJt, fJtMin, fJtMax, fNBinsTheta, fThetaMin, fThetaMax);
1848   fh3JtZ      = new TH3F(Form("fh3IJJtZ%s",fNameIJ.Data()),"",fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsJt, fJtMin, fJtMax, fNBinsZ, fZMin, fZMax);
1849   
1850   AliAnalysisTaskFragmentationFunction::SetProperties(fh2CosTheta,"jet p_{T} [GeV/c]","cos(#Theta)", "entries");
1851   AliAnalysisTaskFragmentationFunction::SetProperties(fh2PtZ,"had p_{T} [GeV/c]","z=p_{T}^{had}/p_{T}^{jet}","entries");
1852   AliAnalysisTaskFragmentationFunction::SetProperties(fh3ThetaZ,"jet p_{T} [GeV/c]","#Theta [rad]","z=p_{T}^{had}/p_{T}^{jet}");
1853   AliAnalysisTaskFragmentationFunction::SetProperties(fh3JtTheta,"jet p_{T} [GeV/c]","j_{T} [GeV/c]","#Theta [rad]");
1854   AliAnalysisTaskFragmentationFunction::SetProperties(fh3JtZ,"jet p_{T} [GeV/c]","j_{T} [GeV/c]","z=p_{T}^{had}/p_{T}^{jet}");
1855
1856 }
1857
1858 //_______________________________________________________________________________________________________________
1859 void AliAnalysisTaskFragmentationFunction::AliFragFuncIntraJetHistos::FillIntraJet(const TLorentzVector* trackV, const TLorentzVector* jetV, Float_t norm)
1860 {
1861   // fill IntraJet histos
1862  
1863   Float_t cosTheta = 0.; Float_t theta = 0.; 
1864   Float_t jt = 0.; Float_t z = 0.; 
1865   // For Theta distribution
1866   Float_t pxT  = trackV->Px();
1867   Float_t pyT  = trackV->Py();
1868   Float_t pzT  = trackV->Pz();
1869   Float_t ptT  = trackV->Pt();
1870   Float_t pT   = trackV->P();
1871   Float_t etaT = trackV->Eta();
1872   Float_t phiT = trackV->Phi(); // Check the value returned
1873   Float_t pxJ = jetV->Px();
1874   Float_t pyJ = jetV->Py();
1875   Float_t pzJ = jetV->Pz();
1876   Float_t ptJ = jetV->Pt();
1877   Float_t pJ  = jetV->P();
1878
1879   // Compute z
1880   if(ptJ>0) z = (Float_t)(ptT/ptJ);
1881
1882   // Compute theta
1883   cosTheta = (pxT*pxJ+pyT*pyJ+pzT*pzJ)/(pT*pJ);
1884   theta = TMath::ACos(cosTheta);
1885
1886   // Compute jt
1887   TVector3 trackP; TVector3 jetP;
1888   jetP[0] = pxJ;
1889   jetP[1] = pyJ;
1890   jetP[2] = pzJ;
1891   trackP.SetPtEtaPhi(ptT,etaT,phiT);
1892   jt = TMath::Sin(trackP.Angle(jetP))*trackP.Mag();
1893
1894   // Fill histos
1895   if(norm){
1896     fh2CosTheta->Fill(ptJ,cosTheta,1/norm);
1897     fh2PtZ->Fill(ptT,z,1/norm);
1898     fh3ThetaZ->Fill(ptJ,theta,z,1/norm);
1899     fh3JtTheta->Fill(ptJ,jt,theta,1/norm);
1900     fh3JtZ->Fill(ptJ,jt,z,1/norm);
1901   }
1902   else {
1903     fh2CosTheta->Fill(ptJ,cosTheta);
1904     fh2PtZ->Fill(ptT,z);
1905     fh3ThetaZ->Fill(ptJ,theta,z);
1906     fh3JtTheta->Fill(ptJ,jt,theta);
1907     fh3JtZ->Fill(ptJ,jt,z);
1908   }
1909
1910 }
1911
1912 //______________________________________________________________________________________________________
1913 AliAnalysisTaskFragmentationFunction::AliFragFuncDiJetHistos::AliFragFuncDiJetHistos(const char* name, Int_t kindSlices,
1914                                                          Int_t nJetInvMass, Float_t jetInvMassMin, Float_t jetInvMassMax,  
1915                                                          Int_t nJetPt, Float_t jetPtMin, Float_t jetPtMax,  
1916                                                          Int_t nPt, Float_t ptMin, Float_t ptMax,
1917                                                          Int_t nXi, Float_t xiMin, Float_t xiMax,
1918                                                          Int_t nZ , Float_t zMin , Float_t zMax)
1919   : TObject()
1920   ,fKindSlices(kindSlices)
1921   ,fNBinsJetInvMass(nJetInvMass)
1922   ,fJetInvMassMin(jetInvMassMin)
1923   ,fJetInvMassMax(jetInvMassMax)
1924   ,fNBinsJetPt(nJetPt)
1925   ,fJetPtMin(jetPtMin)
1926   ,fJetPtMax(jetPtMax)
1927   ,fNBinsPt(nPt) 
1928   ,fPtMin(ptMin)   
1929   ,fPtMax(ptMax)   
1930   ,fNBinsXi(nXi) 
1931   ,fXiMin(xiMin)   
1932   ,fXiMax(xiMax)   
1933   ,fNBinsZ(nZ)  
1934   ,fZMin(zMin)    
1935   ,fZMax(zMax)
1936   ,fh2TrackPtJet1(0)
1937   ,fh2TrackPtJet2(0)
1938   ,fh2TrackPtJet(0)
1939   ,fh1Jet1Pt(0)
1940   ,fh1Jet2Pt(0)
1941   ,fh1JetPt(0)
1942   ,fh2Xi1(0)
1943   ,fh2Xi2(0)
1944   ,fh2Xi(0)
1945   ,fh2Z1(0)
1946   ,fh2Z2(0)
1947   ,fh2Z(0)
1948   ,fh2Pt1(0)
1949   ,fh2Pt2(0)
1950   ,fh2Pt(0)
1951   ,fNameDJ(name)
1952 {
1953   // default constructor
1954
1955 }
1956
1957 //______________________________________________________________________________________________________
1958 AliAnalysisTaskFragmentationFunction::AliFragFuncDiJetHistos::AliFragFuncDiJetHistos(const AliFragFuncDiJetHistos& copy)
1959   : TObject()
1960   ,fKindSlices(copy.fKindSlices)
1961   ,fNBinsJetInvMass(copy.fNBinsJetInvMass)
1962   ,fJetInvMassMin(copy.fJetInvMassMin)
1963   ,fJetInvMassMax(copy.fJetInvMassMax)
1964   ,fNBinsJetPt(copy.fNBinsJetPt)
1965   ,fJetPtMin(copy.fJetPtMin)
1966   ,fJetPtMax(copy.fJetPtMax)
1967   ,fNBinsPt(copy.fNBinsPt) 
1968   ,fPtMin(copy.fPtMin)   
1969   ,fPtMax(copy.fPtMax)   
1970   ,fNBinsXi(copy.fNBinsXi) 
1971   ,fXiMin(copy.fXiMin)   
1972   ,fXiMax(copy.fXiMax)   
1973   ,fNBinsZ(copy.fNBinsZ)  
1974   ,fZMin(copy.fZMin)    
1975   ,fZMax(copy.fZMax)
1976   ,fh2TrackPtJet1(copy.fh2TrackPtJet1)
1977   ,fh2TrackPtJet2(copy.fh2TrackPtJet2)
1978   ,fh2TrackPtJet(copy.fh2TrackPtJet)
1979   ,fh1Jet1Pt(copy.fh1Jet1Pt)
1980   ,fh1Jet2Pt(copy.fh1Jet2Pt)
1981   ,fh1JetPt(copy.fh1JetPt)
1982   ,fh2Xi1(copy.fh2Xi1)
1983   ,fh2Xi2(copy.fh2Xi2)
1984   ,fh2Xi(copy.fh2Xi2)
1985   ,fh2Z1(copy.fh2Z1)
1986   ,fh2Z2(copy.fh2Z2)
1987   ,fh2Z(copy.fh2Z)
1988   ,fh2Pt1(copy.fh2Pt1)
1989   ,fh2Pt2(copy.fh2Pt2)
1990   ,fh2Pt(copy.fh2Pt)
1991   ,fNameDJ(copy.fNameDJ)
1992 {
1993   // default constructor
1994
1995 }
1996
1997 //_______________________________________________________________________________________________________________________________________________________________
1998 AliAnalysisTaskFragmentationFunction::AliFragFuncDiJetHistos& AliAnalysisTaskFragmentationFunction::AliFragFuncDiJetHistos::operator=(const AliAnalysisTaskFragmentationFunction::AliFragFuncDiJetHistos& o)
1999 {
2000   // assignment
2001   
2002   if(this!=&o){
2003     TObject::operator=(o);
2004     fKindSlices      = o.fKindSlices;
2005     fNBinsJetInvMass = o.fNBinsJetInvMass;
2006     fJetInvMassMin   = o.fJetInvMassMin;
2007     fJetInvMassMax   = o.fJetInvMassMax;
2008     fNBinsJetPt      = o.fNBinsJetPt;
2009     fJetPtMin        = o.fJetPtMin;
2010     fJetPtMax        = o.fJetPtMax;
2011     fNBinsPt         = o.fNBinsPt; 
2012     fPtMin           = o.fPtMin;   
2013     fPtMax           = o.fPtMax;   
2014     fNBinsXi         = o.fNBinsXi; 
2015     fXiMin           = o.fXiMin;   
2016     fXiMax           = o.fXiMax;   
2017     fNBinsZ          = o.fNBinsZ;  
2018     fZMin            = o.fZMin;    
2019     fZMax            = o.fZMax;   
2020     fh2TrackPtJet1   = o.fh2TrackPtJet1;
2021     fh2TrackPtJet2   = o.fh2TrackPtJet2;
2022     fh2TrackPtJet    = o.fh2TrackPtJet;
2023     fh1Jet1Pt        = o.fh1Jet1Pt;
2024     fh1Jet2Pt        = o.fh1Jet2Pt;
2025     fh1JetPt         = o.fh1JetPt;
2026     fh2Xi1           = o.fh2Xi1;
2027     fh2Xi2           = o.fh2Xi2;
2028     fh2Xi            = o.fh2Xi;
2029     fh2Z1            = o.fh2Z1;
2030     fh2Z2            = o.fh2Z2;
2031     fh2Z             = o.fh2Z;
2032     fh2Pt1           = o.fh2Pt1;
2033     fh2Pt2           = o.fh2Pt2;
2034     fh2Pt            = o.fh2Pt;
2035     fNameDJ          = o.fNameDJ;
2036   }
2037     
2038   return *this;
2039 }
2040
2041 //_________________________________________________________
2042 AliAnalysisTaskFragmentationFunction::AliFragFuncDiJetHistos::~AliFragFuncDiJetHistos()
2043 {
2044   // destructor 
2045
2046   if(fh2TrackPtJet1) delete fh2TrackPtJet1;
2047   if(fh2TrackPtJet2) delete fh2TrackPtJet2;
2048   if(fh2TrackPtJet ) delete fh2TrackPtJet;
2049   if(fh1Jet1Pt)      delete fh1Jet1Pt;
2050   if(fh1Jet2Pt)      delete fh1Jet2Pt;
2051   if(fh1JetPt)       delete fh1JetPt;
2052   if(fh2Xi1)         delete fh2Xi1;
2053   if(fh2Xi2)         delete fh2Xi2;
2054   if(fh2Xi)          delete fh2Xi;
2055   if(fh2Z1)          delete fh2Z1;
2056   if(fh2Z2)          delete fh2Z2;
2057   if(fh2Z)           delete fh2Z;
2058   if(fh2Pt1)         delete fh2Pt1;
2059   if(fh2Pt2)         delete fh2Pt2;
2060   if(fh2Pt)          delete fh2Pt;
2061 }
2062
2063 //________________________________________________________________________
2064 void AliAnalysisTaskFragmentationFunction::AliFragFuncDiJetHistos::DefineDiJetHistos()
2065 {
2066   // book DiJet histos
2067   
2068   Int_t nBins = 0;
2069   Double_t min = 0.;
2070   Double_t max = 0.;
2071   const char *xaxis = "";
2072   if(fKindSlices == 1)
2073     {
2074       nBins = fNBinsJetInvMass;
2075       min   = fJetInvMassMin;
2076       max   = fJetInvMassMax;
2077       xaxis = "M_{JJ} [GeV]";
2078     }
2079   if(fKindSlices == 2 || fKindSlices == 3)
2080     {
2081       nBins = fNBinsJetPt;
2082       min   = fJetPtMin;
2083       max   = fJetPtMax;
2084       if(fKindSlices == 2) xaxis = "E_{Tmean} [GeV]";
2085       if(fKindSlices == 3) xaxis ="leading jet p_{T} [GeV/c]";
2086     }
2087   
2088   fh1Jet1Pt      = new TH1F(Form("fh1DJJet1Pt%s", fNameDJ.Data()), "", fNBinsJetPt, fJetPtMin, fJetPtMax);
2089   fh1Jet2Pt      = new TH1F(Form("fh1DJJet2Pt%s", fNameDJ.Data()), "", fNBinsJetPt, fJetPtMin, fJetPtMax);
2090   fh1JetPt       = new TH1F(Form("fh1DJJetPt%s",  fNameDJ.Data()), "", fNBinsJetPt, fJetPtMin, fJetPtMax);
2091   
2092   fh2TrackPtJet1 = new TH2F(Form("fh2DJTrackPtJet1%s", fNameDJ.Data()), "",nBins, min, max, fNBinsPt, fPtMin, fPtMax);
2093   fh2TrackPtJet2 = new TH2F(Form("fh2DJTrackPtJet2%s", fNameDJ.Data()), "",nBins, min, max, fNBinsPt, fPtMin, fPtMax);
2094   fh2TrackPtJet  = new TH2F(Form("fh2DJTrackPtJet%s", fNameDJ.Data()),  "",nBins, min, max, fNBinsPt, fPtMin, fPtMax);
2095   
2096   fh2Xi1         = new TH2F(Form("fh2DJXi1%s", fNameDJ.Data()), "",nBins, min, max, fNBinsXi, fXiMin, fXiMax);
2097   fh2Xi2         = new TH2F(Form("fh2DJXi2%s", fNameDJ.Data()), "",nBins, min, max, fNBinsXi, fXiMin, fXiMax);
2098   fh2Xi          = new TH2F(Form("fh2DJXi%s", fNameDJ.Data()),  "",nBins, min, max, fNBinsXi, fXiMin, fXiMax);
2099   
2100   fh2Z1          = new TH2F(Form("fh2DJZ1%s", fNameDJ.Data()), "",nBins, min, max, fNBinsZ, fZMin, fZMax);
2101   fh2Z2          = new TH2F(Form("fh2DJZ2%s", fNameDJ.Data()), "",nBins, min, max, fNBinsZ, fZMin, fZMax);
2102   fh2Z           = new TH2F(Form("fh2DJZ%s", fNameDJ.Data()),  "",nBins, min, max, fNBinsZ, fZMin, fZMax);
2103   
2104   fh2Pt1         = new TH2F(Form("fh2DJPt1%s", fNameDJ.Data()), "",nBins, min, max, fNBinsPt, fPtMin, fPtMax);
2105   fh2Pt2         = new TH2F(Form("fh2DJPt2%s", fNameDJ.Data()), "",nBins, min, max, fNBinsPt, fPtMin, fPtMax);
2106   fh2Pt          = new TH2F(Form("fh2DJPtZ%s", fNameDJ.Data()),  "",nBins, min, max, fNBinsPt, fPtMin, fPtMax);
2107       
2108   AliAnalysisTaskFragmentationFunction::SetProperties(fh1Jet1Pt, "p_{T} [GeV/c]", "entries");
2109   AliAnalysisTaskFragmentationFunction::SetProperties(fh1Jet2Pt, "p_{T} [GeV/c]", "entries");
2110   AliAnalysisTaskFragmentationFunction::SetProperties(fh1JetPt, "p_{T} [GeV/c]", "entries");
2111
2112   AliAnalysisTaskFragmentationFunction::SetProperties(fh2TrackPtJet1, xaxis, "p_{T} [GeV/c]", "Entries");
2113   AliAnalysisTaskFragmentationFunction::SetProperties(fh2TrackPtJet2, xaxis, "p_{T} [GeV/c]", "Entries");
2114   AliAnalysisTaskFragmentationFunction::SetProperties(fh2TrackPtJet, xaxis, "p_{T} [GeV/c]", "Entries");
2115   AliAnalysisTaskFragmentationFunction::SetProperties(fh2Xi1, xaxis, "#xi", "Entries");
2116   AliAnalysisTaskFragmentationFunction::SetProperties(fh2Xi2, xaxis, "#xi", "Entries");
2117   AliAnalysisTaskFragmentationFunction::SetProperties(fh2Xi, xaxis, "#xi", "Entries");
2118   AliAnalysisTaskFragmentationFunction::SetProperties(fh2Z1, xaxis, "z", "Entries");
2119   AliAnalysisTaskFragmentationFunction::SetProperties(fh2Z2, xaxis, "z", "Entries");
2120   AliAnalysisTaskFragmentationFunction::SetProperties(fh2Z, xaxis, "z", "Entries");
2121   AliAnalysisTaskFragmentationFunction::SetProperties(fh2Pt1, xaxis, "p_{T} [GeV/c]", "Entries");
2122   AliAnalysisTaskFragmentationFunction::SetProperties(fh2Pt2, xaxis, "p_{T} [GeV/c]", "Entries");
2123   AliAnalysisTaskFragmentationFunction::SetProperties(fh2Pt, xaxis, "p_{T} [GeV/c]", "Entries");
2124 }
2125
2126 //________________________________________________________________________
2127 void AliAnalysisTaskFragmentationFunction::AliFragFuncDiJetHistos::FillDiJetFF(Int_t jetType, Float_t trackPt, Float_t jetPt, Double_t jetBin, Bool_t incrementJetPt)
2128 {
2129   // fill DiJet FF
2130
2131   if(jetType == 0)
2132     {
2133       if(incrementJetPt) fh1JetPt->Fill(jetPt);  
2134       
2135       fh2TrackPtJet->Fill(jetBin, trackPt);
2136       
2137       Double_t z = trackPt / jetPt;
2138       Double_t xi = 0;
2139       if(z>0) xi = TMath::Log(1/z);
2140       
2141       fh2Xi->Fill(jetBin, xi);
2142       fh2Z->Fill(jetBin, z);
2143     }
2144   if(jetType == 1)
2145     {
2146       if(incrementJetPt) fh1Jet1Pt->Fill(jetPt);
2147       
2148       fh2TrackPtJet1->Fill(jetBin, trackPt);
2149       
2150       Double_t z = trackPt / jetPt;
2151       Double_t xi = 0;
2152       if(z>0) xi = TMath::Log(1/z);
2153       
2154       fh2Xi1->Fill(jetBin, xi);
2155       fh2Z1->Fill(jetBin, z);
2156     }
2157   if(jetType == 2)
2158     {
2159       if(incrementJetPt) fh1Jet2Pt->Fill(jetPt);
2160       
2161       fh2TrackPtJet2->Fill(jetBin, trackPt);
2162       
2163       Double_t z = trackPt / jetPt;
2164       Double_t xi = 0;
2165       if(z>0) xi = TMath::Log(1/z);
2166       
2167       fh2Xi2->Fill(jetBin, xi);
2168       fh2Z2->Fill(jetBin, z);
2169     }
2170
2171
2172 }
2173
2174 //________________________________________________________________________
2175 void AliAnalysisTaskFragmentationFunction::AliFragFuncDiJetHistos::AddToOutput(TList* list)const
2176 {
2177   // add histos to list
2178
2179   list->Add(fh1Jet1Pt);
2180   list->Add(fh1Jet2Pt);
2181   list->Add(fh1JetPt);
2182   list->Add(fh2TrackPtJet1);
2183   list->Add(fh2TrackPtJet2);
2184   list->Add(fh2TrackPtJet);
2185   list->Add(fh2Xi1);
2186   list->Add(fh2Xi2);
2187   list->Add(fh2Xi);
2188   list->Add(fh2Z1);
2189   list->Add(fh2Z2);
2190   list->Add(fh2Z);
2191 }
2192
2193 //______________________________________________________________________________________________________
2194 AliAnalysisTaskFragmentationFunction::AliFragFuncQADiJetHistos::AliFragFuncQADiJetHistos(const char* name, Int_t kindSlices,
2195                                              Int_t nInvMass, Float_t invMassMin, Float_t invMassMax, 
2196                                              Int_t nJetPt, Float_t jetPtMin, Float_t jetPtMax,  
2197                                              Int_t nDeltaPhi, Float_t deltaPhiMin, Float_t deltaPhiMax, 
2198                                              Int_t nDeltaEta, Float_t deltaEtaMin, Float_t deltaEtaMax, 
2199                                              Int_t nDeltaPt, Float_t deltaPtMin, Float_t deltaPtMax, 
2200                                              Int_t nInBal, Float_t inBalMin, Float_t inBalMax)
2201   : TObject()
2202   ,fKindSlices(kindSlices)
2203   ,fNBinsJetInvMass(nInvMass)
2204   ,fJetInvMassMin(invMassMin)
2205   ,fJetInvMassMax(invMassMax)
2206   ,fNBinsJetPt(nJetPt)
2207   ,fJetPtMin(jetPtMin)
2208   ,fJetPtMax(jetPtMax)
2209   ,fNBinsDeltaPhi(nDeltaPhi)
2210   ,fDeltaPhiMin(deltaPhiMin)
2211   ,fDeltaPhiMax(deltaPhiMax)
2212   ,fNBinsDeltaEta(nDeltaEta)
2213   ,fDeltaEtaMin(deltaEtaMin)
2214   ,fDeltaEtaMax(deltaEtaMax)
2215   ,fNBinsDeltaPt(nDeltaPt)
2216   ,fDeltaPtMin(deltaPtMin)
2217   ,fDeltaPtMax(deltaPtMax)
2218   ,fNBinsInBal(nInBal)
2219   ,fInBalMin(inBalMin)
2220   ,fInBalMax(inBalMax)
2221   ,fh2InvMass(0)
2222   ,fh2DeltaPhi(0)
2223   ,fh2DeltaEta(0)
2224   ,fh2DeltaPt(0)
2225   ,fh2InBal(0)
2226   ,fNameQADJ(name)
2227 {
2228   // default constructor
2229
2230 }
2231
2232 //______________________________________________________________________________________________________
2233 AliAnalysisTaskFragmentationFunction::AliFragFuncQADiJetHistos::AliFragFuncQADiJetHistos(const AliFragFuncQADiJetHistos& copy)
2234   : TObject()
2235   ,fKindSlices(copy.fKindSlices)
2236   ,fNBinsJetInvMass(copy.fNBinsJetInvMass)
2237   ,fJetInvMassMin(copy.fJetInvMassMin)
2238   ,fJetInvMassMax(copy.fJetInvMassMax)
2239   ,fNBinsJetPt(copy.fNBinsJetPt)
2240   ,fJetPtMin(copy.fJetPtMin)
2241   ,fJetPtMax(copy.fJetPtMax)
2242   ,fNBinsDeltaPhi(copy.fNBinsDeltaPhi)
2243   ,fDeltaPhiMin(copy.fDeltaPhiMin)
2244   ,fDeltaPhiMax(copy.fDeltaPhiMax)
2245   ,fNBinsDeltaEta(copy.fNBinsDeltaEta)
2246   ,fDeltaEtaMin(copy.fDeltaEtaMin)
2247   ,fDeltaEtaMax(copy.fDeltaEtaMax)
2248   ,fNBinsDeltaPt(copy.fNBinsDeltaPt)
2249   ,fDeltaPtMin(copy.fDeltaPtMin)
2250   ,fDeltaPtMax(copy.fDeltaPtMax)
2251   ,fNBinsInBal(copy.fNBinsInBal)
2252   ,fInBalMin(copy.fInBalMin)
2253   ,fInBalMax(copy.fInBalMax)
2254   ,fh2InvMass(copy.fh2InvMass)
2255   ,fh2DeltaPhi(copy.fh2DeltaPhi)
2256   ,fh2DeltaEta(copy.fh2DeltaEta)
2257   ,fh2DeltaPt(copy.fh2DeltaPt)
2258   ,fh2InBal(copy.fh2InBal)
2259   ,fNameQADJ(copy.fNameQADJ)
2260 {
2261   // default constructor
2262
2263 }
2264
2265 //_______________________________________________________________________________________________________________________________________________________________
2266 AliAnalysisTaskFragmentationFunction::AliFragFuncQADiJetHistos& AliAnalysisTaskFragmentationFunction::AliFragFuncQADiJetHistos::operator=(const AliAnalysisTaskFragmentationFunction::AliFragFuncQADiJetHistos& o)
2267 {
2268   // assignment
2269   
2270   if(this!=&o){
2271     TObject::operator=(o);
2272     fKindSlices       = o.fKindSlices;
2273     fNBinsJetInvMass  = o.fNBinsJetInvMass;
2274     fJetInvMassMin    = o.fJetInvMassMin;
2275     fJetInvMassMax    = o.fJetInvMassMax;
2276     fNBinsJetPt       = o.fNBinsJetPt;
2277     fJetPtMin         = o.fJetPtMin;
2278     fJetPtMax         = o.fJetPtMax;
2279     fNBinsDeltaPhi    = o.fNBinsDeltaPhi;
2280     fDeltaPhiMin      = o.fDeltaPhiMin;
2281     fDeltaPhiMax      = o.fDeltaPhiMax;
2282     fNBinsDeltaEta    = o.fNBinsDeltaEta;
2283     fDeltaEtaMin      = o.fDeltaEtaMin;
2284     fDeltaEtaMax      = o.fDeltaEtaMax;
2285     fNBinsDeltaPt     = o.fNBinsDeltaPt;
2286     fDeltaPtMin       = o.fDeltaPtMin;
2287     fDeltaPtMax       = o.fDeltaPtMax;
2288     fNBinsInBal       = o.fNBinsInBal;
2289     fInBalMin         = o.fInBalMin;
2290     fInBalMax         = o.fInBalMax;
2291     fh2InvMass        = o.fh2InvMass;
2292     fh2DeltaPhi       = o.fh2DeltaPhi;
2293     fh2DeltaEta       = o.fh2DeltaEta;
2294     fh2DeltaPt        = o.fh2DeltaPt;
2295     fh2InBal          = o.fh2InBal;
2296     fNameQADJ         = o.fNameQADJ;
2297   }
2298     
2299   return *this;
2300 }
2301
2302 //_________________________________________________________
2303 AliAnalysisTaskFragmentationFunction::AliFragFuncQADiJetHistos::~AliFragFuncQADiJetHistos()
2304 {
2305   // destructor 
2306
2307   if(fh2InvMass)  delete fh2InvMass;
2308   if(fh2DeltaPhi) delete fh2DeltaPhi;
2309   if(fh2DeltaEta) delete fh2DeltaEta;
2310   if(fh2DeltaPt)  delete fh2DeltaPt;
2311   if(fh2InBal)    delete fh2InBal;
2312 }
2313
2314 //________________________________________________________________________
2315 void AliAnalysisTaskFragmentationFunction::AliFragFuncQADiJetHistos::DefineQADiJetHistos()
2316 {
2317   // define histos
2318   
2319   Int_t nBins = 0;
2320   Double_t min = 0.;
2321   Double_t max = 0.;
2322   const char *xaxis = "";
2323   if(fKindSlices == 1)
2324     {
2325       nBins = fNBinsJetInvMass;
2326       min   = fJetInvMassMin;
2327       max   = fJetInvMassMax;
2328       xaxis = "M_{JJ} [GeV]";
2329     }
2330   if(fKindSlices == 2 || fKindSlices == 3)
2331     {
2332       nBins = fNBinsJetPt;
2333       min   = fJetPtMin;
2334       max   = fJetPtMax;
2335       if(fKindSlices == 2) xaxis = "E_{Tmean} [GeV]";
2336       if(fKindSlices == 3) xaxis ="leading jet p_{T} [GeV/c]";
2337     }
2338   
2339   
2340   fh2InvMass  = new TH2F(Form("fh2DJInvMassPositionCut%s",  fNameQADJ.Data()), "",nBins, min, max, fNBinsJetInvMass, fJetInvMassMin, fJetInvMassMax);
2341   fh2DeltaPhi = new TH2F(Form("fh2DJDeltaPhiPositionCut%s", fNameQADJ.Data()), "",nBins, min, max, fNBinsDeltaPhi, fDeltaPhiMin, fDeltaPhiMax);
2342   fh2DeltaEta = new TH2F(Form("fh2DJDeltaEtaPositionCut%s", fNameQADJ.Data()), "",nBins, min, max, fNBinsDeltaEta, fDeltaEtaMin, fDeltaEtaMax);
2343   fh2DeltaPt  = new TH2F(Form("fh2DJDeltaPtPositionCut%s",  fNameQADJ.Data()), "",nBins, min, max, fNBinsDeltaPt, fDeltaPtMin, fDeltaPtMax);
2344   fh2InBal  = new TH2F(Form("fh2DJInBalPositionCut%s",  fNameQADJ.Data()), "",nBins, min, max, fNBinsInBal, fInBalMin, fInBalMax);
2345
2346   AliAnalysisTaskFragmentationFunction::SetProperties(fh2InvMass, xaxis, "Invariant Mass", "Entries");
2347   AliAnalysisTaskFragmentationFunction::SetProperties(fh2DeltaPhi, xaxis, "#Delta #phi", "Entries");
2348   AliAnalysisTaskFragmentationFunction::SetProperties(fh2DeltaEta, xaxis, "#Delta #eta", "Entries");
2349   AliAnalysisTaskFragmentationFunction::SetProperties(fh2DeltaPt, xaxis, "#Delta p_{T}", "Entries");
2350   AliAnalysisTaskFragmentationFunction::SetProperties(fh2InBal, xaxis, "(p_{T}^{1}-p_{T}^{2})/(p_{T}^{1}+p_{T}^{2})", "Entries");
2351
2352 }
2353
2354 //________________________________________________________________________
2355 void AliAnalysisTaskFragmentationFunction::AliFragFuncQADiJetHistos::FillDiJetQA(Double_t invMass, Double_t deltaPhi, Double_t deltaEta,Double_t deltaPt, Double_t inbal, Double_t jetBin)
2356 {
2357   // fill dijet QA
2358
2359   fh2InvMass->Fill(jetBin, invMass);
2360   fh2DeltaPhi->Fill(jetBin, deltaPhi);
2361   fh2DeltaEta->Fill(jetBin, deltaEta);
2362   fh2DeltaPt->Fill(jetBin, deltaPt);
2363   fh2InBal->Fill(jetBin, inbal);
2364 }
2365
2366 //________________________________________________________________________
2367 void AliAnalysisTaskFragmentationFunction::AliFragFuncQADiJetHistos::AddToOutput(TList* list)const
2368 {
2369   // add histos to list
2370
2371   list->Add(fh2InvMass);
2372   list->Add(fh2DeltaPhi);
2373   list->Add(fh2DeltaEta);
2374   list->Add(fh2DeltaPt);
2375   list->Add(fh2InBal);
2376 }
2377
2378 //_________________________________________________________________________________
2379 void AliAnalysisTaskFragmentationFunction::AliFragFuncIntraJetHistos::AddToOutput(TList* list) const
2380 {
2381   // add histos to list
2382
2383   list->Add(fh2CosTheta);
2384   list->Add(fh2PtZ);
2385   list->Add(fh3ThetaZ);
2386   list->Add(fh3JtTheta);
2387   list->Add(fh3JtZ);
2388
2389 }
2390
2391 //_________________________________________________________________________________
2392 Bool_t AliAnalysisTaskFragmentationFunction::Notify()
2393 {
2394   //
2395   // Implemented Notify() to read the cross sections
2396   // and number of trials from pyxsec.root
2397   // (taken from AliAnalysisTaskJetSpectrum2)
2398   // 
2399   TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
2400   Float_t xsection = 0;
2401   Float_t ftrials  = 1;
2402
2403   fAvgTrials = 1;
2404   if(tree){
2405     TFile *curfile = tree->GetCurrentFile();
2406     if (!curfile) {
2407       Error("Notify","No current file");
2408       return kFALSE;
2409     }
2410     if(!fh1Xsec||!fh1Trials){
2411       Printf("%s%d No Histogram fh1Xsec",(char*)__FILE__,__LINE__);
2412       return kFALSE;
2413     }
2414     AliAnalysisHelperJetTasks::PythiaInfoFromFile(curfile->GetName(),xsection,ftrials);
2415     fh1Xsec->Fill("<#sigma>",xsection);
2416     // construct a poor man average trials 
2417     Float_t nEntries = (Float_t)tree->GetTree()->GetEntries();
2418     if(ftrials>=nEntries && nEntries>0.)fAvgTrials = ftrials/nEntries;
2419   }
2420
2421   // Set seed for backg study
2422   fRandom = new TRandom3();
2423   fRandom->SetSeed(0);
2424
2425   return kTRUE;
2426 }
2427
2428
2429
2430 //__________________________________________________________________
2431 void AliAnalysisTaskFragmentationFunction::UserCreateOutputObjects()
2432 {
2433   // create output objects
2434
2435   if(fDebug > 1) Printf("AliAnalysisTaskFragmentationFunction::UserCreateOutputObjects()");
2436  
2437   // create list of tracks and jets 
2438   
2439   fTracksRec = new TList();
2440   fTracksRec->SetOwner(kFALSE);  
2441
2442   fTracksRecCuts = new TList();
2443   fTracksRecCuts->SetOwner(kFALSE);  
2444
2445   fTracksGen = new TList();
2446   fTracksGen->SetOwner(kFALSE);
2447
2448   fTracksAODMCCharged = new TList();
2449   fTracksAODMCCharged->SetOwner(kFALSE);
2450     
2451   fTracksAODMCChargedSec = new TList();
2452   fTracksAODMCChargedSec->SetOwner(kFALSE);
2453
2454   fTracksRecQualityCuts = new TList(); 
2455   fTracksRecQualityCuts->SetOwner(kFALSE);
2456
2457   fJetsRec = new TList();
2458   fJetsRec->SetOwner(kFALSE);
2459   if(fBranchRecJets.Contains("KT") && fBckgSubMethod) fJetsRec->SetOwner(kTRUE);
2460
2461   fJetsRecCuts = new TList();
2462   fJetsRecCuts->SetOwner(kFALSE);
2463   if(fBranchRecJets.Contains("KT") && fBckgSubMethod) fJetsRecCuts->SetOwner(kTRUE);
2464
2465   fJetsGen = new TList();
2466   fJetsGen->SetOwner(kFALSE);
2467
2468   fJetsRecEff = new TList();
2469   fJetsRecEff->SetOwner(kFALSE);
2470
2471   fJetsEmbedded = new TList();
2472   fJetsEmbedded->SetOwner(kFALSE);
2473
2474
2475   if(fBckgMode && 
2476      (fBckgType[0]==kBckgClusters || fBckgType[1]==kBckgClusters || fBckgType[2]==kBckgClusters ||  fBckgType[3]==kBckgClusters || fBckgType[4]==kBckgClusters ||
2477       fBckgType[0]==kBckgClustersOutLeading || fBckgType[1]==kBckgClustersOutLeading || fBckgType[2]==kBckgClustersOutLeading || 
2478       fBckgType[3]==kBckgClustersOutLeading || fBckgType[4]==kBckgClustersOutLeading)){
2479     
2480     fBckgJetsRec = new TList();
2481     fBckgJetsRec->SetOwner(kFALSE);
2482
2483     fBckgJetsRecCuts = new TList();
2484     fBckgJetsRecCuts->SetOwner(kFALSE);
2485
2486     fBckgJetsGen = new TList();
2487     fBckgJetsGen->SetOwner(kFALSE);
2488   }
2489
2490   //
2491   // Create histograms / output container
2492   //
2493
2494   OpenFile(1);
2495   fCommonHistList = new TList();
2496   fCommonHistList->SetOwner(kTRUE);
2497
2498   Bool_t oldStatus = TH1::AddDirectoryStatus();
2499   TH1::AddDirectory(kFALSE);
2500   
2501   
2502   // Histograms 
2503   fh1EvtSelection            = new TH1F("fh1EvtSelection", "Event Selection", 6, -0.5, 5.5);
2504   fh1EvtSelection->GetXaxis()->SetBinLabel(1,"ACCEPTED");
2505   fh1EvtSelection->GetXaxis()->SetBinLabel(2,"event selection: rejected");
2506   fh1EvtSelection->GetXaxis()->SetBinLabel(3,"event class: rejected");
2507   fh1EvtSelection->GetXaxis()->SetBinLabel(4,"vertex Ncontr: rejected");
2508   fh1EvtSelection->GetXaxis()->SetBinLabel(5,"vertex z: rejected");
2509   fh1EvtSelection->GetXaxis()->SetBinLabel(6,"vertex type: rejected");
2510   
2511   fh1VertexNContributors     = new TH1F("fh1VertexNContributors", "Vertex N contributors", 2500,-.5, 2499.5);
2512   fh1VertexZ                 = new TH1F("fh1VertexZ", "Vertex z distribution", 30, -15., 15.);
2513   fh1EvtMult                 = new TH1F("fh1EvtMult","Event multiplicity, track pT cut > 150 MeV/c, |#eta| < 0.9",120,0.,12000.);
2514   fh1EvtCent                 = new TH1F("fh1EvtCent","centrality",100,0.,100.);
2515   fh2TrackPtVsDCAXY          = new TH2F("fh2TrackPtVsDCAXY","",400,-0.02,0.02,100,0.,10.); 
2516   fh2TrackPtVsDCAZ           = new TH2F("fh2TrackPtVsDCAZ","",100,-0.050,0.050,100,0.,10.);
2517
2518   fh1Xsec                    = new TProfile("fh1Xsec","xsec from pyxsec.root",1,0,1);
2519   fh1Xsec->GetXaxis()->SetBinLabel(1,"<#sigma>");
2520   fh1Trials                  = new TH1F("fh1Trials","trials from pyxsec.root",1,0,1);
2521   fh1Trials->GetXaxis()->SetBinLabel(1,"#sum{ntrials}");
2522   fh1PtHard                  = new TH1F("fh1PtHard","PYTHIA Pt hard;p_{T,hard}",350,-.5,349.5);
2523   fh1PtHardTrials            = new TH1F("fh1PtHardTrials","PYTHIA Pt hard weight with trials;p_{T,hard}",350,-.5,349.5);
2524
2525   fh1nRecJetsCuts            = new TH1F("fh1nRecJetsCuts","reconstructed jets per event",10,-0.5,9.5);
2526   fh1nGenJets                = new TH1F("fh1nGenJets","generated jets per event",10,-0.5,9.5);
2527   fh1nRecEffJets             = new TH1F("fh1nRecEffJets","reconstruction effiency: jets per event",10,-0.5,9.5);
2528   fh1nEmbeddedJets           = new TH1F("fh1nEmbeddedJets","embedded jets per event",10,-0.5,9.5);
2529
2530   fh2PtRecVsGenPrim          = new TH2F("fh2PtRecVsGenPrim","rec vs gen pt",fQATrackNBinsPt,fQATrackPtMin,fQATrackPtMax,fQATrackNBinsPt,fQATrackPtMin,fQATrackPtMax);
2531   fh2PtRecVsGenSec           = new TH2F("fh2PtRecVsGenSec","rec vs gen pt",fQATrackNBinsPt,fQATrackPtMin,fQATrackPtMax,fQATrackNBinsPt,fQATrackPtMin,fQATrackPtMax);
2532
2533
2534   // Background
2535   if(fBckgMode) {
2536     if(fBckgType[0]==kBckgClusters || fBckgType[1]==kBckgClusters || fBckgType[2]==kBckgClusters || fBckgType[3]==kBckgClusters || fBckgType[4]==kBckgClusters || 
2537        fBckgType[0]==kBckgClustersOutLeading || fBckgType[1]==kBckgClustersOutLeading || fBckgType[2]==kBckgClustersOutLeading || 
2538        fBckgType[3]==kBckgClustersOutLeading || fBckgType[4]==kBckgClustersOutLeading){
2539       
2540       fh1nRecBckgJetsCuts        = new TH1F("fh1nRecBckgJetsCuts","reconstructed background jets per event",10,-0.5,9.5);
2541       fh1nGenBckgJets            = new TH1F("fh1nGenBckgJets","generated background jets per event",10,-0.5,9.5);
2542     }
2543
2544     if(fBckgType[0]==kBckgPerp || fBckgType[1]==kBckgPerp || fBckgType[2]==kBckgPerp || fBckgType[3]==kBckgPerp || fBckgType[4]==kBckgPerp )
2545       fh1PerpMult                = new TH1F("fh1PerpMult","Background multiplicity - Cone perpendicular to leading jet axis",500,0.,500.);
2546     if(fBckgType[0]==kBckgASide || fBckgType[1]==kBckgASide || fBckgType[2]==kBckgASide || fBckgType[3]==kBckgASide || fBckgType[4]==kBckgASide)
2547       fh1ASideMult               = new TH1F("fh1ASideMult","Background multiplicity - Cone in the away side of leading jet axis",500,0.,500.);
2548     if(fBckgType[0]==kBckgASideWindow || fBckgType[1]==kBckgASideWindow || fBckgType[2]==kBckgASideWindow || fBckgType[3]==kBckgASideWindow || fBckgType[4]==kBckgASideWindow)
2549       fh1ASideWindowMult         = new TH1F("fh1ASideWindowMult","Background multiplicity - Cone in the away side of leading jet axis",500,0.,500.);
2550     if(fBckgType[0]==kBckgPerpWindow || fBckgType[1]==kBckgPerpWindow || fBckgType[2]==kBckgPerpWindow || fBckgType[3]==kBckgPerpWindow || fBckgType[4]==kBckgPerpWindow)
2551       fh1PerpWindowMult         = new TH1F("fh1PerpWindowMult","Background multiplicity - Cone in the perp direction of leading jet axis",500,0.,500.);
2552     if(fBckgType[0]==kBckgOutLJ || fBckgType[1]==kBckgOutLJ || fBckgType[2]==kBckgOutLJ || fBckgType[3]==kBckgOutLJ || fBckgType[4]==kBckgOutLJ)
2553       fh1OutLeadingMult          = new TH1F("fh1OutLeadingMult","Background multiplicity - Cone outside leading jet",500,0,500.);
2554     if(fBckgType[0]==kBckgOutLJStat || fBckgType[1]==kBckgOutLJStat || fBckgType[2]==kBckgOutLJStat || fBckgType[3]==kBckgOutLJStat || fBckgType[4]==kBckgOutLJStat)
2555       fh1OutLeadingStatMult      = new TH1F("fh1OutLeadingStatMult","Background multiplicity - Cone outside leading jet",3000,0,3000.);
2556     if(fBckgType[0]==kBckgOut2J || fBckgType[1]==kBckgOut2J || fBckgType[2]==kBckgOut2J || fBckgType[3]==kBckgOut2J || fBckgType[4]==kBckgOut2J)
2557       fh1Out2JetsMult            = new TH1F("fh1Out2JetsMult","Background multiplicity - Cone outside 2 jets",500,0.,500.);
2558     if(fBckgType[0]==kBckgOut3J || fBckgType[1]==kBckgOut3J || fBckgType[2]==kBckgOut3J || fBckgType[3]==kBckgOut3J || fBckgType[4]==kBckgOut3J)
2559       fh1Out3JetsMult            = new TH1F("fh1Out3JetsMult","Background multiplicity - Cone outside 3 jets",500,0.,500.);
2560     if(fBckgType[0]==kBckgClusters || fBckgType[1]==kBckgClusters || fBckgType[2]==kBckgClusters || fBckgType[3]==kBckgClusters || fBckgType[4]==kBckgClusters)
2561       fh1MedianClustersMult  = new TH1F("fh1MedianClustersMult","Background multiplicity - median cluster",500,0.,500.);
2562     if(fBckgType[0]==kBckgClustersOutLeading || fBckgType[1]==kBckgClustersOutLeading || fBckgType[2]==kBckgClustersOutLeading || fBckgType[3]==kBckgClustersOutLeading 
2563        || fBckgType[4]==kBckgClustersOutLeading)
2564       fh1OutClustersMult            = new TH1F("fh1OutClustersMult","Background multiplicity - clusters outside leading jet",3000,0.,3000.);
2565   }
2566   
2567   // embedding
2568   if(fBranchEmbeddedJets.Length()){
2569     fh1FractionPtEmbedded         = new TH1F("fh1FractionPtEmbedded","",200,0,2);
2570     fh1IndexEmbedded              = new TH1F("fh1IndexEmbedded","",11,-1,10);
2571     fh2DeltaPtVsJetPtEmbedded     = new TH2F("fh2DeltaPtVsJetPtEmbedded","",250,0,250,200,-100,100);
2572     fh2DeltaPtVsRecJetPtEmbedded  = new TH2F("fh2DeltaPtVsRecJetPtEmbedded","",250,0,250,200,-100,100);
2573     fh1DeltaREmbedded             = new TH1F("fh1DeltaREmbedded","",50,0,0.5);
2574     fh1nEmbeddedJets              = new TH1F("fh1nEmbeddedJets","embedded jets per event",10,-0.5,9.5);
2575   }
2576
2577   if(fEffMode){
2578     fh2ptVsDistNN_pt50_rec          = new TH2F("fh2ptVsDistNN_pt50_rec","",200,0,0.2,500,0.,100);    
2579     fh2ptVsDistNN_pt50_nonRec       = new TH2F("fh2ptVsDistNN_pt50_nonRec","",200,0,0.2,500,0.,100);    
2580     fh2ptVsDistNN_pt10_rec          = new TH2F("fh2ptVsDistNN_pt10_rec","",200,0,0.2,500,0.,100);    
2581     fh2ptVsDistNN_pt10_nonRec       = new TH2F("fh2ptVsDistNN_pt10_nonRec","",200,0,0.2,500,0.,100);    
2582   }
2583
2584   if(fQAMode){
2585     if(fQAMode&1){ // track QA
2586       fQATrackHistosRec          = new AliFragFuncQATrackHistos("Rec", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, 
2587                                                                 fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2588                                                                 fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, 
2589                                                                 fQATrackHighPtThreshold);
2590       fQATrackHistosRecCuts      = new AliFragFuncQATrackHistos("RecCuts", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, 
2591                                                                 fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2592                                                                 fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, 
2593                                                                 fQATrackHighPtThreshold);
2594       fQATrackHistosGen          = new AliFragFuncQATrackHistos("Gen", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, 
2595                                                                 fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2596                                                                 fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, 
2597                                                                 fQATrackHighPtThreshold);
2598     }
2599
2600     if(fQAMode&2){ // jet QA
2601       fQAJetHistosRec            = new AliFragFuncQAJetHistos("Rec", fQAJetNBinsPt, fQAJetPtMin, fQAJetPtMax, 
2602                                                               fQAJetNBinsEta, fQAJetEtaMin, fQAJetEtaMax,
2603                                                               fQAJetNBinsPhi, fQAJetPhiMin, fQAJetPhiMax);
2604       fQAJetHistosRecCuts        = new AliFragFuncQAJetHistos("RecCuts", fQAJetNBinsPt, fQAJetPtMin, fQAJetPtMax, 
2605                                                               fQAJetNBinsEta, fQAJetEtaMin, fQAJetEtaMax,
2606                                                               fQAJetNBinsPhi, fQAJetPhiMin, fQAJetPhiMax);
2607       fQAJetHistosRecCutsLeading = new AliFragFuncQAJetHistos("RecCutsLeading", fQAJetNBinsPt, fQAJetPtMin, fQAJetPtMax, 
2608                                                               fQAJetNBinsEta, fQAJetEtaMin, fQAJetEtaMax,
2609                                                               fQAJetNBinsPhi, fQAJetPhiMin, fQAJetPhiMax);
2610       fQAJetHistosGen            = new AliFragFuncQAJetHistos("Gen", fQAJetNBinsPt, fQAJetPtMin, fQAJetPtMax, 
2611                                                               fQAJetNBinsEta, fQAJetEtaMin, fQAJetEtaMax,
2612                                                               fQAJetNBinsPhi, fQAJetPhiMin, fQAJetPhiMax);
2613       fQAJetHistosGenLeading     = new AliFragFuncQAJetHistos("GenLeading", fQAJetNBinsPt, fQAJetPtMin, fQAJetPtMax, 
2614                                                               fQAJetNBinsEta, fQAJetEtaMin, fQAJetEtaMax,
2615                                                               fQAJetNBinsPhi, fQAJetPhiMin, fQAJetPhiMax);  
2616       if(fEffMode) fQAJetHistosRecEffLeading  = new AliFragFuncQAJetHistos("RecEffLeading", fQAJetNBinsPt, fQAJetPtMin, fQAJetPtMax, 
2617                                                                            fQAJetNBinsEta, fQAJetEtaMin, fQAJetEtaMax,fQAJetNBinsPhi, fQAJetPhiMin, fQAJetPhiMax);
2618     }
2619   } // end: QA
2620
2621   if(fFFMode){
2622
2623     fFFHistosRecCuts         = new AliFragFuncHistos("RecCuts", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2624                                                      fFFNBinsPt, fFFPtMin, fFFPtMax, 
2625                                                      fFFNBinsXi, fFFXiMin, fFFXiMax,  
2626                                                      fFFNBinsZ , fFFZMin , fFFZMax , fFFLogZBins);
2627     fFFHistosRecLeading        = new AliFragFuncHistos("RecLeading", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2628                                                        fFFNBinsPt, fFFPtMin, fFFPtMax, 
2629                                                        fFFNBinsXi, fFFXiMin, fFFXiMax,  
2630                                                        fFFNBinsZ , fFFZMin , fFFZMax, fFFLogZBins);
2631     fFFHistosRecLeadingTrack   = new AliFragFuncHistos("RecLeadingTrack", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2632                                                        fFFNBinsPt, fFFPtMin, fFFPtMax, 
2633                                                        fFFNBinsXi, fFFXiMin, fFFXiMax,  
2634                                                        fFFNBinsZ , fFFZMin , fFFZMax, fFFLogZBins);
2635     fFFHistosGen             = new AliFragFuncHistos("Gen", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2636                                                      fFFNBinsPt, fFFPtMin, fFFPtMax, 
2637                                                      fFFNBinsXi, fFFXiMin, fFFXiMax,  
2638                                                      fFFNBinsZ , fFFZMin , fFFZMax, fFFLogZBins);
2639     fFFHistosGenLeading        = new AliFragFuncHistos("GenLeading", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2640                                                        fFFNBinsPt, fFFPtMin, fFFPtMax, 
2641                                                        fFFNBinsXi, fFFXiMin, fFFXiMax,  
2642                                                        fFFNBinsZ , fFFZMin , fFFZMax, fFFLogZBins);
2643     fFFHistosGenLeadingTrack   = new AliFragFuncHistos("GenLeadingTrack", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2644                                                        fFFNBinsPt, fFFPtMin, fFFPtMax, 
2645                                                        fFFNBinsXi, fFFXiMin, fFFXiMax,  
2646                                                        fFFNBinsZ , fFFZMin , fFFZMax, fFFLogZBins);
2647   } // end: FF
2648
2649   if(fIJMode)
2650     {
2651       fIJHistosRecCuts               = new AliFragFuncIntraJetHistos("RecCuts", fIJNBinsJetPt, fIJJetPtMin, fIJJetPtMax, 
2652                                                                      fIJNBinsPt, fIJPtMin, fIJPtMax, 
2653                                                                      fIJNBinsZ, fIJZMin, fIJZMax,  
2654                                                                      fIJNBinsCosTheta , fIJCosThetaMin , fIJCosThetaMax, 
2655                                                                      fIJNBinsTheta , fIJThetaMin , fIJThetaMax,
2656                                                                      fIJNBinsJt , fIJJtMin , fIJJtMax);
2657       fIJHistosRecLeading        = new AliFragFuncIntraJetHistos("RecLeading", fIJNBinsJetPt, fIJJetPtMin, fIJJetPtMax, 
2658                                                                  fIJNBinsPt, fIJPtMin, fIJPtMax, 
2659                                                                  fIJNBinsZ, fIJZMin, fIJZMax,  
2660                                                                  fIJNBinsCosTheta , fIJCosThetaMin , fIJCosThetaMax, 
2661                                                                  fIJNBinsTheta , fIJThetaMin , fIJThetaMax, 
2662                                                                  fIJNBinsJt , fIJJtMin , fIJJtMax);
2663       fIJHistosRecLeadingTrack   = new AliFragFuncIntraJetHistos("RecLeadingTrack", fIJNBinsJetPt, fIJJetPtMin, fIJJetPtMax, 
2664                                                                  fIJNBinsPt, fIJPtMin, fIJPtMax, 
2665                                                                  fIJNBinsZ, fIJZMin, fIJZMax,  
2666                                                                  fIJNBinsCosTheta , fIJCosThetaMin , fIJCosThetaMax, 
2667                                                                  fIJNBinsTheta , fIJThetaMin , fIJThetaMax, 
2668                                                                  fIJNBinsJt , fIJJtMin , fIJJtMax);
2669       fIJHistosGen           = new AliFragFuncIntraJetHistos("Gen", fIJNBinsJetPt, fIJJetPtMin, fIJJetPtMax, 
2670                                                              fIJNBinsPt, fIJPtMin, fIJPtMax, 
2671                                                              fIJNBinsZ, fIJZMin, fIJZMax,  
2672                                                              fIJNBinsCosTheta , fIJCosThetaMin , fIJCosThetaMax, 
2673                                                              fIJNBinsTheta , fIJThetaMin , fIJThetaMax, 
2674                                                              fIJNBinsJt , fIJJtMin , fIJJtMax);
2675       fIJHistosGenLeading        = new AliFragFuncIntraJetHistos("GenLeading", fIJNBinsJetPt, fIJJetPtMin, fIJJetPtMax, 
2676                                                                  fIJNBinsPt, fIJPtMin, fIJPtMax, 
2677                                                                  fIJNBinsZ, fIJZMin, fIJZMax,  
2678                                                                  fIJNBinsCosTheta , fIJCosThetaMin , fIJCosThetaMax, 
2679                                                                  fIJNBinsTheta , fIJThetaMin , fIJThetaMax, 
2680                                                                  fIJNBinsJt , fIJJtMin , fIJJtMax);
2681       fIJHistosGenLeadingTrack   = new AliFragFuncIntraJetHistos("GenLeadingTrack", fIJNBinsJetPt, fIJJetPtMin, fIJJetPtMax, 
2682                                                                  fIJNBinsPt, fIJPtMin, fIJPtMax, 
2683                                                                  fIJNBinsZ, fIJZMin, fIJZMax,  
2684                                                                  fIJNBinsCosTheta , fIJCosThetaMin , fIJCosThetaMax, 
2685                                                                  fIJNBinsTheta , fIJThetaMin , fIJThetaMax, 
2686                                                                  fIJNBinsJt , fIJJtMin , fIJJtMax);
2687     } // end: intra-jet
2688   
2689   if(fDJMode){
2690     if(fDJMode&1){
2691       fFFDiJetHistosRecCuts         = new AliFragFuncDiJetHistos("RecCuts", fDiJetKindBins, 
2692                                                                  fDiJetNBinsJetInvMass, fDiJetJetInvMassMin, fDiJetJetInvMassMax,
2693                                                                  fDiJetNBinsJetPt, fDiJetJetPtMin, fDiJetJetPtMax,
2694                                                                  fDiJetNBinsPt, fDiJetPtMin, fDiJetPtMax, 
2695                                                                  fDiJetNBinsXi, fDiJetXiMin, fDiJetXiMax, 
2696                                                                  fDiJetNBinsZ, fDiJetZMin, fDiJetZMax);
2697       fFFDiJetHistosRecLeading      = new AliFragFuncDiJetHistos("RecLeading", fDiJetKindBins, 
2698                                                                  fDiJetNBinsJetInvMass, fDiJetJetInvMassMin, fDiJetJetInvMassMax,
2699                                                                  fDiJetNBinsJetPt, fDiJetJetPtMin, fDiJetJetPtMax, 
2700                                                                  fDiJetNBinsPt, fDiJetPtMin, fDiJetPtMax, 
2701                                                                  fDiJetNBinsXi, fDiJetXiMin, fDiJetXiMax, 
2702                                                                  fDiJetNBinsZ, fDiJetZMin, fDiJetZMax); 
2703       fFFDiJetHistosRecLeadingTrack = new AliFragFuncDiJetHistos("RecLeadingTrack", fDiJetKindBins, 
2704                                                                  fDiJetNBinsJetInvMass, fDiJetJetInvMassMin, fDiJetJetInvMassMax,
2705                                                                  fDiJetNBinsJetPt, fDiJetJetPtMin, fDiJetJetPtMax, 
2706                                                                  fDiJetNBinsPt, fDiJetPtMin, fDiJetPtMax, 
2707                                                                  fDiJetNBinsXi, fDiJetXiMin, fDiJetXiMax, 
2708                                                                  fDiJetNBinsZ, fDiJetZMin, fDiJetZMax);
2709       
2710       fFFDiJetHistosGen             = new AliFragFuncDiJetHistos("Gen", fDiJetKindBins, 
2711                                                                  fDiJetNBinsJetInvMass, fDiJetJetInvMassMin, fDiJetJetInvMassMax,
2712                                                                  fDiJetNBinsJetPt, fDiJetJetPtMin, fDiJetJetPtMax,
2713                                                                  fDiJetNBinsPt, fDiJetPtMin, fDiJetPtMax, 
2714                                                                  fDiJetNBinsXi, fDiJetXiMin, fDiJetXiMax,
2715                                                                  fDiJetNBinsZ, fDiJetZMin, fDiJetZMax);
2716       fFFDiJetHistosGenLeading      = new AliFragFuncDiJetHistos("GenLeading", fDiJetKindBins, 
2717                                                                  fDiJetNBinsJetInvMass, fDiJetJetInvMassMin, fDiJetJetInvMassMax,
2718                                                                  fDiJetNBinsJetPt, fDiJetJetPtMin, fDiJetJetPtMax,
2719                                                                  fDiJetNBinsPt, fDiJetPtMin, fDiJetPtMax,
2720                                                                  fDiJetNBinsXi, fDiJetXiMin, fDiJetXiMax,
2721                                                                  fDiJetNBinsZ, fDiJetZMin, fDiJetZMax);
2722       fFFDiJetHistosGenLeadingTrack = new AliFragFuncDiJetHistos("GenLeadingTrack", fDiJetKindBins, 
2723                                                                  fDiJetNBinsJetInvMass, fDiJetJetInvMassMin, fDiJetJetInvMassMax,
2724                                                                  fDiJetNBinsJetPt, fDiJetJetPtMin, fDiJetJetPtMax, 
2725                                                                  fDiJetNBinsPt, fDiJetPtMin, fDiJetPtMax, 
2726                                                                  fDiJetNBinsXi, fDiJetXiMin, fDiJetXiMax, 
2727                                                                  fDiJetNBinsZ, fDiJetZMin, fDiJetZMax);
2728     }
2729     
2730     if(fDJMode&2){
2731       fQADiJetHistosRecCuts = new AliFragFuncQADiJetHistos("RecCuts", fDiJetKindBins, 
2732                                                            fQADiJetNBinsInvMass, fQADiJetInvMassMin, fQADiJetInvMassMax,
2733                                                            fQADiJetNBinsJetPt, fQADiJetJetPtMin, fQADiJetJetPtMax,
2734                                                            fQADiJetNBinsDeltaPhi, fQADiJetDeltaPhiMin, fQADiJetDeltaPhiMax , 
2735                                                            fQADiJetNBinsDeltaEta, fQADiJetDeltaEtaMin, fQADiJetDeltaEtaMax , 
2736                                                            fQADiJetNBinsDeltaPt, fQADiJetDeltaPtMin, fQADiJetDeltaPtMax,
2737                                                            fQADiJetNBinsInBal, fQADiJetInBalMin, fQADiJetInBalMax);
2738       fQADiJetHistosGen     = new AliFragFuncQADiJetHistos("Gen", fDiJetKindBins, 
2739                                                            fQADiJetNBinsInvMass, fQADiJetInvMassMin,  fQADiJetInvMassMax, 
2740                                                            fDiJetNBinsJetPt, fDiJetJetPtMin, fDiJetJetPtMax,
2741                                                            fQADiJetNBinsDeltaPhi, fQADiJetDeltaPhiMin, fQADiJetDeltaPhiMax,
2742                                                            fQADiJetNBinsDeltaEta, fQADiJetDeltaEtaMin, fQADiJetDeltaEtaMax,
2743                                                            fQADiJetNBinsDeltaPt, fQADiJetDeltaPtMin, fQADiJetDeltaPtMax,
2744                                                            fQADiJetNBinsInBal, fQADiJetInBalMin, fQADiJetInBalMax);
2745     }
2746   } // end: di-jet
2747
2748   // efficiency
2749
2750   if(fEffMode){
2751     if(fQAMode&1){
2752       fQATrackHistosRecEffGen = new AliFragFuncQATrackHistos("RecEffGen", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, 
2753                                                              fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2754                                                              fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, 
2755                                                              fQATrackHighPtThreshold);
2756       
2757       fQATrackHistosRecEffRec = new AliFragFuncQATrackHistos("RecEffRec", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, 
2758                                                              fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2759                                                              fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, 
2760                                                              fQATrackHighPtThreshold);
2761
2762       fQATrackHistosSecRec    = new AliFragFuncQATrackHistos("SecRec", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, 
2763                                                              fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2764                                                              fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, 
2765                                                              fQATrackHighPtThreshold);
2766
2767
2768       Int_t    nBinsResponseSinglePt[2]     = {fFFNBinsPt, fFFNBinsPt};
2769       Double_t binMinResponseSinglePt[2]    = {fFFPtMin, fFFPtMin};
2770       Double_t binMaxResponseSinglePt[2]    = {fFFPtMax, fFFPtMax};
2771       const char* labelsResponseSinglePt[2] = {"rec p_{T} [GeV/c]", "gen p_{T} [GeV/c]"};
2772
2773       fhnResponseSinglePt  = new THnSparseF("fhnResponseSinglePt","track pt gen : track pt rec",2,
2774                                             nBinsResponseSinglePt,binMinResponseSinglePt,binMaxResponseSinglePt);
2775      
2776       AliAnalysisTaskFragmentationFunction::SetProperties(fhnResponseSinglePt,2,labelsResponseSinglePt);
2777
2778       // TH2F inv pt diff
2779       fh2SingleInvPtRecMnGenVsPtGen = new TH2F("fh2SingleInvPtRecMnGenVsPtGen","",fQATrackNBinsPt,fQATrackPtMin,fQATrackPtMax,200,-1,1);
2780     }
2781     if(fFFMode){
2782       fFFHistosRecEffGen      = new AliFragFuncHistos("RecEffGen", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2783                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2784                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2785                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2786       
2787       fFFHistosRecEffRec      = new AliFragFuncHistos("RecEffRec", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2788                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2789                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2790                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2791
2792       fFFHistosSecRec         = new AliFragFuncHistos("SecRec", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2793                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2794                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2795                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2796
2797
2798       Int_t    nBinsResponseJetTrackPt[3]     = {fFFNBinsJetPt,fFFNBinsPt,fFFNBinsPt};
2799       Double_t binMinResponseJetTrackPt[3]    = {fFFJetPtMin,fFFPtMin, fFFPtMin};
2800       Double_t binMaxResponseJetTrackPt[3]    = {fFFJetPtMax,fFFPtMax,fFFPtMax};
2801       const char* labelsResponseJetTrackPt[3] = { "jet p_{T} [GeV/c]","rec p_{T} [GeV/c]", "gen p_{T} [GeV/c]"};
2802
2803       fhnResponseJetTrackPt  = new THnSparseF("fhnResponseJetTrackPt","jet pt:track pt rec:track pt gen",3,
2804                                               nBinsResponseJetTrackPt,binMinResponseJetTrackPt,binMaxResponseJetTrackPt);
2805      
2806       AliAnalysisTaskFragmentationFunction::SetProperties(fhnResponseJetTrackPt,3,labelsResponseJetTrackPt);
2807
2808       Int_t    nBinsResponseJetZ[3]     = {fFFNBinsJetPt, fFFNBinsZ,fFFNBinsZ};
2809       Double_t binMinResponseJetZ[3]    = {fFFJetPtMin, fFFZMin, fFFZMin};
2810       Double_t binMaxResponseJetZ[3]    = {fFFJetPtMax, fFFZMax, fFFZMax};
2811       const char* labelsResponseJetZ[3] = { "jet p_{T} [GeV/c]","rec z","gen z"};
2812
2813       fhnResponseJetZ  = new THnSparseF("fhnResponseJetZ","jet pt:track pt rec:track pt gen",3,
2814                                         nBinsResponseJetZ,binMinResponseJetZ,binMaxResponseJetZ);
2815       
2816       AliAnalysisTaskFragmentationFunction::SetProperties(fhnResponseJetZ,3,labelsResponseJetZ);
2817       
2818       Int_t    nBinsResponseJetXi[3]     = {fFFNBinsJetPt, fFFNBinsXi,fFFNBinsXi};
2819       Double_t binMinResponseJetXi[3]    = {fFFJetPtMin, fFFXiMin, fFFXiMin};
2820       Double_t binMaxResponseJetXi[3]    = {fFFJetPtMax, fFFXiMax, fFFXiMax};
2821       const char* labelsResponseJetXi[3] = { "jet p_{T} [GeV/c]","rec xi","gen xi"};
2822
2823       fhnResponseJetXi  = new THnSparseF("fhnResponseJetXi","jet pt:track xi rec:track xi gen",3,
2824                                         nBinsResponseJetXi,binMinResponseJetXi,binMaxResponseJetXi);
2825       
2826       AliAnalysisTaskFragmentationFunction::SetProperties(fhnResponseJetXi,3,labelsResponseJetXi);
2827
2828     }
2829   } // end: efficiency
2830
2831   // Background
2832   if(fBckgMode){
2833     // Track QA
2834     TString title[5];
2835     for(Int_t i=0; i<5; i++){
2836       if(fBckgType[i]==kBckgPerp) title[i]="Perp";
2837       else if(fBckgType[i]==kBckgPerpWindow) title[i]="PerpW";
2838       else if(fBckgType[i]==kBckgASide) title[i]="ASide";
2839       else if(fBckgType[i]==kBckgASideWindow) title[i]="ASideW";
2840       else if(fBckgType[i]==kBckgOutLJ) title[i]="OutLeadingJet";
2841       else if(fBckgType[i]==kBckgOut2J) title[i]="Out2Jets";
2842       else if(fBckgType[i]==kBckgOut3J) title[i]="Out3Jets";
2843       else if(fBckgType[i]==kBckgOutAJ) title[i]="AllJets";
2844       else if(fBckgType[i]==kBckgOutLJStat) title[i]="OutLeadingJetStat";
2845       else if(fBckgType[i]==kBckgOut2JStat) title[i]="Out2JetsStat";
2846       else if(fBckgType[i]==kBckgOut3JStat) title[i]="Out3JetsStat";
2847       else if(fBckgType[i]==kBckgOutAJStat) title[i]="AllJetsStat";
2848       else if(fBckgType[i]==kBckgClustersOutLeading) title[i]="OutClusters";
2849       else if(fBckgType[i]==kBckgClusters) title[i]="MedianClusters";
2850       else printf("Please chose background method number %d!",i);
2851     }
2852
2853     if(fQAMode&1){
2854       fQABckgHisto0RecCuts      = new AliFragFuncQATrackHistos("Bckg"+title[0]+"RecCuts", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, 
2855                                                                fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2856                                                                fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, 
2857                                                                fQATrackHighPtThreshold);
2858       fQABckgHisto0Gen          = new AliFragFuncQATrackHistos("Bckg"+title[0]+"Gen", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, 
2859                                                                fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2860                                                                fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, 
2861                                                                fQATrackHighPtThreshold);
2862       fQABckgHisto1RecCuts      = new AliFragFuncQATrackHistos("Bckg"+title[1]+"RecCuts", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, 
2863                                                                fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2864                                                                fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, 
2865                                                                fQATrackHighPtThreshold);
2866       fQABckgHisto1Gen          = new AliFragFuncQATrackHistos("Bckg"+title[1]+"Gen", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, 
2867                                                                fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2868                                                                fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, 
2869                                                                fQATrackHighPtThreshold);
2870       fQABckgHisto2RecCuts      = new AliFragFuncQATrackHistos("Bckg"+title[2]+"RecCuts", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, 
2871                                                                fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2872                                                                fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, 
2873                                                                fQATrackHighPtThreshold);
2874       fQABckgHisto2Gen          = new AliFragFuncQATrackHistos("Bckg"+title[2]+"Gen", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, 
2875                                                                fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2876                                                                fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, 
2877                                                                fQATrackHighPtThreshold);
2878       fQABckgHisto3RecCuts      = new AliFragFuncQATrackHistos("Bckg"+title[3]+"RecCuts", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, 
2879                                                                fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2880                                                                fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, 
2881                                                                fQATrackHighPtThreshold);
2882       fQABckgHisto3Gen          = new AliFragFuncQATrackHistos("Bckg"+title[3]+"Gen", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, 
2883                                                                fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2884                                                                fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, 
2885                                                                fQATrackHighPtThreshold);
2886       fQABckgHisto4RecCuts      = new AliFragFuncQATrackHistos("Bckg"+title[4]+"RecCuts", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, 
2887                                                                fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2888                                                                fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, 
2889                                                                fQATrackHighPtThreshold);
2890       fQABckgHisto4Gen          = new AliFragFuncQATrackHistos("Bckg"+title[4]+"Gen", fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax, 
2891                                                                fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2892                                                                fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax, 
2893                                                                fQATrackHighPtThreshold);
2894
2895
2896     } // end: background QA
2897
2898     if(fFFMode){
2899       // outside leading jet or 2 jets or more
2900       fFFBckgHisto0RecCuts    = new AliFragFuncHistos("Bckg"+title[0]+"RecCuts", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2901                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2902                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2903                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2904       fFFBckgHisto0RecLeading = new AliFragFuncHistos("Bckg"+title[0]+"RecLeading", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2905                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2906                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2907                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2908       fFFBckgHisto0Gen        = new AliFragFuncHistos("Bckg"+title[0]+"Gen", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2909                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2910                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2911                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2912       fFFBckgHisto0GenLeading = new AliFragFuncHistos("Bckg"+title[0]+"GenLeading", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2913                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2914                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2915                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2916       
2917       fFFBckgHisto1RecCuts    = new AliFragFuncHistos("Bckg"+title[1]+"RecCuts", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2918                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2919                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2920                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2921       fFFBckgHisto1RecLeading = new AliFragFuncHistos("Bckg"+title[1]+"RecLeading", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2922                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2923                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2924                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2925       fFFBckgHisto1Gen        = new AliFragFuncHistos("Bckg"+title[1]+"Gen", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2926                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2927                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2928                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2929       fFFBckgHisto1GenLeading = new AliFragFuncHistos("Bckg"+title[1]+"GenLeading", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2930                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2931                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2932                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2933       
2934       fFFBckgHisto2RecCuts    = new AliFragFuncHistos("Bckg"+title[2]+"RecCuts", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2935                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2936                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2937                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2938       fFFBckgHisto2RecLeading = new AliFragFuncHistos("Bckg"+title[2]+"RecLeading", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2939                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2940                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2941                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2942       fFFBckgHisto2Gen        = new AliFragFuncHistos("Bckg"+title[2]+"Gen", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2943                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2944                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2945                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2946       fFFBckgHisto2GenLeading = new AliFragFuncHistos("Bckg"+title[2]+"GenLeading", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2947                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2948                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2949                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2950       fFFBckgHisto3RecCuts    = new AliFragFuncHistos("Bckg"+title[3]+"RecCuts", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2951                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2952                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2953                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2954       fFFBckgHisto3RecLeading = new AliFragFuncHistos("Bckg"+title[3]+"RecLeading", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2955                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2956                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2957                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2958       fFFBckgHisto3Gen        = new AliFragFuncHistos("Bckg"+title[3]+"Gen", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2959                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2960                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2961                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2962       fFFBckgHisto3GenLeading = new AliFragFuncHistos("Bckg"+title[3]+"GenLeading", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2963                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2964                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2965                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2966       fFFBckgHisto4RecCuts    = new AliFragFuncHistos("Bckg"+title[4]+"RecCuts", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2967                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2968                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2969                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2970       fFFBckgHisto4RecLeading = new AliFragFuncHistos("Bckg"+title[4]+"RecLeading", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2971                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2972                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2973                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2974       fFFBckgHisto4Gen        = new AliFragFuncHistos("Bckg"+title[4]+"Gen", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2975                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2976                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2977                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2978       fFFBckgHisto4GenLeading = new AliFragFuncHistos("Bckg"+title[4]+"GenLeading", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax, 
2979                                                       fFFNBinsPt, fFFPtMin, fFFPtMax, 
2980                                                       fFFNBinsXi, fFFXiMin, fFFXiMax,  
2981                                                       fFFNBinsZ , fFFZMin , fFFZMax);
2982
2983     } // end: background FF
2984
2985     if(fIJMode){    
2986       fIJBckgHisto0RecCuts           = new AliFragFuncIntraJetHistos("Bckg"+title[0]+"RecCuts