AliPhysics  f05a842 (f05a842)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskJetChem.cxx
Go to the documentation of this file.
1 /*************************************************************************
2  * *
3  * *
4  * Task for Jet Chemistry Analysis in PWG-JE Jet Task Force Train *
5  * Analysis of K0s, Lambda and Antilambda with and without Jetevents *
6  * *
7  *************************************************************************/
8 
9 /**************************************************************************
10  * Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
11  * *
12  * Author: The ALICE Off-line Project. *
13  * Contributors are mentioned in the code where appropriate. *
14  * *
15  * Permission to use, copy, modify and distribute this software and its *
16  * documentation strictly for non-commercial purposes is hereby grante *
17  * *
18  * without fee, provided that the above copyright notice appears in all *
19  * copies and that both the copyright notice and this permission notice *
20  * appear in the supporting documentation. The authors make no claims *
21  * about the suitability of this software for any purpose. It is *
22  * provided "as is" without express or implied warranty. *
23  **************************************************************************/
24 //Task for K0s, Lambda and Antilambda analysis in jets in Pb-Pb collisions
25 //Author: Alice Zimmermann (zimmermann@physi.uni-heidelberg.de)
26 
27 
28 /* $Id: */
29 
30 #include "Riostream.h"
31 #include <iostream>
32 #include "TH2.h"
33 #include "TH3.h"
34 #include "TH2F.h"
35 #include "TH3F.h"
36 #include "TH2D.h"
37 #include "TH3D.h"
38 #include "TChain.h"
39 #include "TTree.h"
40 #include "TList.h"
41 #include "TCanvas.h"
42 #include "TProfile.h"
43 #include "THnSparse.h"
44 #include <algorithm>
45 #include <string>
47 #include "TDatabasePDG.h"
48 #include "TPDGCode.h"
49 #include "AliAnalysisManager.h"
50 #include "AliAODHandler.h"
51 #include "AliAODHeader.h"
52 #include "AliAODInputHandler.h"
53 #include "AliESDEvent.h"
54 #include "AliGenPythiaEventHeader.h"
55 #include "AliGenHijingEventHeader.h"
56 #include "AliGenEventHeader.h"
57 #include "TLorentzVector.h"
58 #include "AliAODEvent.h"
59 #include "AliAODJet.h"
60 #include "AliAODv0.h"
61 #include "AliAODTrack.h"
62 #include "AliCentrality.h"
63 #include "AliAnalysisTaskSE.h"
64 #include "AliESDtrack.h"
65 #include "AliESDtrackCuts.h"
66 #include "AliESDEvent.h"
67 #include "AliESDInputHandler.h"
68 #include "AliPID.h"
69 #include "AliPIDResponse.h"
70 #include "AliAODPid.h"
71 #include "AliExternalTrackParam.h"
72 #include "AliAnalysisTaskJetChem.h"
73 #include "AliPhysicsSelection.h"
74 #include "AliBackgroundSelection.h"
75 #include "AliInputEventHandler.h"
76 #include "AliAODMCHeader.h"
77 #include "AliAODPid.h"
78 #include "AliVEvent.h"
79 #include "AliAODMCParticle.h"
80 #include "TVector3.h"
81 #include "TRandom3.h"
82 
84 
85 using std::cout;
86 using std::endl;
87 
88 
89 //____________________________________________________________________________
91  : AliAnalysisTaskFragmentationFunction()
92 
93  ,fRandom(0)
94  ,fMatchMode(0)
95  ,fEPAnalysis(0)
96  ,fIsNJEventEmb(0)
97  ,fAnalysisMC(0)
98  ,fDeltaVertexZ(0)
99  ,fCutjetEta(0)
100  ,fCuttrackNegNcls(0)
101  ,fCuttrackPosNcls(0)
102  ,fCutPostrackRap(0)
103  ,fCutNegtrackRap(0)
104  ,fCutRap(0)
105  ,fCutPostrackEta(0)
106  ,fCutNegtrackEta(0)
107  ,fCutEta(0)
108  ,fusePosV0Eta(0)
109  ,fuseNegV0Eta(0)
110  ,fusePosMCV0Eta(0)
111  ,fuseNegMCV0Eta(0)
112  ,fCutK0cosPointAngle(0)
113  ,fCutLacosPointAngle(0)
114  ,fKinkDaughters(0)
115  ,fRequireTPCRefit(0)
116  ,fCutArmenteros(0)
117  ,fCutV0DecayMin(0)
118  ,fCutV0DecayMax(0)
119  ,fCutV0totMom(0)
120  ,fCutDcaV0Daughters(0)
121  ,fCutDcaPosToPrimVertex(0)
122  ,fCutDcaNegToPrimVertex(0)
123  ,fCutV0RadiusMin(0)
124  ,fCutV0RadiusMax(0)
125  ,fCutBetheBloch(0)
126  ,fCutRatio(0)
127  ,fCutFractionPtEmbedded(0)
128  ,fCutDeltaREmbedded(0)
129  //,fBranchEmbeddedJets("")
130  ,fK0Type(0)
131  ,fFilterMaskK0(0)
132  ,jettracklist(0)
133  ,jetConeK0list(0)
134  ,jetConeLalist(0)
135  ,jetConeALalist(0)
136  ,jetConeK0Emblist(0)
137  ,jetConeLaEmblist(0)
138  ,jetConeALaEmblist(0)
139  ,jetConeK0EmbStlist(0)
140  ,jetConeLaEmbStlist(0)
141  ,jetConeALaEmbStlist(0)
142 
143  ,jetConeK0EmbMClist(0)
144  ,jetConeLaEmbMClist(0)
145  ,jetConeALaEmbMClist(0)
146 
147  ,jetPerpConeK0list(0)
148  ,jetPerpRecCutslist(0)
149  ,jetPerpConeK0Emblist(0)
150  ,jetPerpConeLalist(0)
151  ,jetPerpConeLaEmblist(0)
152  ,jetPerpConeALalist(0)
153  ,jetPerpConeALaEmblist(0)
154  ,jetMedianConeK0list(0)
155  ,jetMedianConeLalist(0)
156  ,jetMedianConeALalist(0)
157  ,jetMedianRecCutslist(0)
158  ,fListK0sRC(0)
159  ,fListLaRC(0)
160  ,fListALaRC(0)
161  ,fTracksRecCutsRC(0)
162  ,fTracksRecBckgCuts(0)
163  ,fTracksPerpCone(0)
164  ,fListK0s(0)
165  ,fListK0sMC(0)
166  ,fListK0sStandard(0)
167  ,fPIDResponse(0)
168  ,fV0QAK0(0)
169  ,fFFHistosRecCutsK0Evt(0)
170  //,fFFHistosIMK0AllEvt(0)
171  //,fFFHistosIMK0Jet(0)
172  //,fFFHistosIMK0Cone(0)
173  ,fLaType(0)
174  ,fFilterMaskLa(0)
175  ,fListLa(0)
176  ,fListLaMC(0)
177  ,fListLaStandard(0)
178  // ,fFFHistosIMLaAllEvt(0)
179  // ,fFFHistosIMLaJet(0)
180  //,fFFHistosIMLaCone(0)
181  ,fALaType(0)
182  ,fFilterMaskALa(0)
183  ,fListALa(0)
184  ,fListALaMC(0)
185  ,fListALaStandard(0)
186  ,fListFeeddownLaCand(0)
187  ,fListFeeddownALaCand(0)
188  ,jetConeFDLalist(0)
189  ,jetConeFDALalist(0)
190  ,fListMCgenK0s(0)
191  ,fListMCgenLa(0)
192  ,fListMCgenALa(0)
193  ,fListMCgenK0sCone(0)
194  ,fListMCgenLaCone(0)
195  ,fListMCgenALaCone(0)
196  ,IsArmenterosSelected(0)
197  ,fUseNJEvents(0)
198  ,fUseExtraTracks(0)
199  ,fUseExtraJetPt(0)
200  ,fUseEmbeddedJetPt(0)
201 
202  ,fUseStandard(0)
203  // ,fFFHistosIMALaAllEvt(0)
204  // ,fFFHistosIMALaJet(0)
205  // ,fFFHistosIMALaCone(0)
206  ,fFFIMNBinsJetPt(0)
207  ,fFFIMJetPtMin(0)
208  ,fFFIMJetPtMax(0)
209  ,fFFIMNBinsInvM(0)
210  ,fFFIMInvMMin(0)
211  ,fFFIMInvMMax(0)
212  ,fFFIMNBinsPt(0)
213  ,fFFIMPtMin(0)
214  ,fFFIMPtMax(0)
215  ,fFFIMNBinsXi(0)
216  ,fFFIMXiMin(0)
217  ,fFFIMXiMax(0)
218  ,fFFIMNBinsZ(0)
219  ,fFFIMZMin(0)
220  ,fFFIMZMax(0)
221  ,fFFIMLaNBinsJetPt(0)
222  ,fFFIMLaJetPtMin(0)
223  ,fFFIMLaJetPtMax(0)
224  ,fFFIMLaNBinsInvM(0)
225  ,fFFIMLaInvMMin(0)
226  ,fFFIMLaInvMMax(0)
227  ,fFFIMLaNBinsPt(0)
228  ,fFFIMLaPtMin(0)
229  ,fFFIMLaPtMax(0)
230  ,fFFIMLaNBinsXi(0)
231  ,fFFIMLaXiMin(0)
232  ,fFFIMLaXiMax(0)
233  ,fFFIMLaNBinsZ(0)
234  ,fFFIMLaZMin(0)
235  ,fFFIMLaZMax(0)
236  ,fh1EvtAllCent(0)
237  ,fh1Evt(0)
238  ,fh1EP2(0)
239  ,fh1EP3(0)
240  ,fh1K0Mult(0)
241  ,fh1dPhiJetK0(0)
242  ,fh1LaMult(0)
243  ,fh1dPhiJetLa(0)
244  ,fh1ALaMult(0)
245  ,fh1dPhiJetALa(0)
246  ,fh1JetEta(0)
247  ,fh1JetPhi(0)
248  ,fh2JetEtaPhi(0)
249  ,fh1nEmbeddedJets(0)
250  ,fh1nGenJets(0)
251  ,fh1IndexEmbedded(0)
252  ,fh1IndexEmbeddedMC(0)
253  ,fh1EmbeddedJetPhiDelta(0)
254  ,fh1PtEmbBeforeMatch(0)
255  ,fh1PtEmbExtraOnly(0)
256  ,fh1PtEmbReject(0)
257  ,fh2PtEtaEmbReject(0)
258  ,fh1PtEmbAfterMatch(0)
259  ,fh1FractionPtEmbedded(0)
260  ,fh1DeltaREmbedded(0)
261  ,fh1FractionPtEmbeddedMC(0)
262  ,fh2FractionPtVsEmbeddedJetPtMC(0)
263  ,fh1DeltaREmbeddedMC(0)
264  ,fh1JetPtEmbGenAfterMatch(0)
265  ,fh2TracksPerpCone(0)
266  ,fh1PerpCone(0)
267  //,fh1V0JetPt(0)
268  ,fh1V0PtCandidate(0)
269  ,fh1IMK0Cone(0)
270  ,fh1IMLaCone(0)
271  ,fh1IMALaCone(0)
272  ,fh1IMK0EmbCone(0)
273  ,fh1IMLaEmbCone(0)
274  ,fh1IMALaEmbCone(0)
275  ,fh2FFJetTrackEta(0)
276  //,fh1trackPosNCls(0)
277  //,fh1trackNegNCls(0)
278  ,fh1trackPosRap(0)
279  ,fh1trackNegRap(0)
280  //,fh1V0Rap(0)
281  ,fh1trackPosEta(0)
282  ,fh1trackNegEta(0)
283  ,fh1V0Eta(0)
284  //,fh1V0totMom(0)
285  ,fh1CosPointAngle(0)
286  ,fh1DecayLengthV0(0)
287  ,fh2ProperLifetimeK0sVsPtBeforeCut(0)
288  ,fh2ProperLifetimeK0sVsPtAfterCut(0)
289  ,fh1V0Radius(0)
290  ,fh1DcaV0Daughters(0)
291  ,fh1DcaPosToPrimVertex(0)
292  ,fh1DcaNegToPrimVertex(0)
293  ,fh2ArmenterosBeforeCuts(0)
294  ,fh2ArmenterosAfterCuts(0)
295  ,fh2BBLaPos(0)
296  ,fh2BBLaNeg(0)
297  ,fh1PosDaughterCharge(0)
298  ,fh1NegDaughterCharge(0)
299  ,fh1PtMCK0s(0)
300  ,fh1PtMCLa(0)
301  ,fh1PtMCALa(0)
302  ,fh1EtaK0s(0)
303  ,fh1EtaLa(0)
304  ,fh1EtaALa(0)
305  ,fh1RC(0)
306  ,fh1RCBiasK0(0)
307  ,fh1RCBiasLa(0)
308  ,fh1RCBiasALa(0)
309  ,fh1MCC(0)
310  ,fh1OC(0)
311  ,fh1NJ(0)
312  ,fh1NJEmbEvt(0)
313  ,fh1BckgJets(0)
314  ,fh1BckgJetsPtBias(0)
315  ,fhnInvMassEtaTrackPtK0s(0)
316  ,fhnInvMassEtaTrackPtLa(0)
317  ,fhnInvMassEtaTrackPtALa(0)
318  ,fh1TrackMultCone(0)
319  ,fh2TrackMultCone(0)
320  ,fhnNJK0(0)
321  ,fhnNJLa(0)
322  ,fhnNJALa(0)
323  //,fh2ChTracksNJ(0)
324  //,fh2ChTracksRC(0)
325  // ,fh2ChTracksOC(0)
326  //,fh2ChTracksMCC(0)
327  //,fh2ChTracksPC(0)
328  ,fhnMCgenK0Cone(0)
329  ,fhnMCgenLaCone(0)
330  // ,fh2MCgenALaCone(0)
331  //,fh2MCEtagenK0Cone(0)
332  //,fh2MCEtagenLaCone(0)
333  // ,fh2MCEtagenALaCone(0)
334  /* ,fh2CorrHijingLaProton(0)
335  ,fh2CorrInjectLaProton(0)
336  ,fh2CorrHijingALaAProton(0)
337  ,fh2CorrInjectALaAProton(0)*/
338  ,fh1IMK0ConeSmear(0)
339  ,fh1IMLaConeSmear(0)
340  ,fh1IMALaConeSmear(0)
341  ,fh2MC2K0Cone(0)
342  ,fh2MC2LaCone(0)
343  ,fh2MC2ALaCone(0)
344  /*,fh2MCEtaVsPtHijingLa(0)
345  ,fh2MCEtaVsPtInjectLa(0)
346  ,fh2MCEtaVsPtHijingALa(0)
347  ,fh2MCEtaVsPtInjectALa(0)
348  ,fhnrecMCHijingLaIncl(0)
349  ,fhnrecMCHijingLaCone(0)
350  ,fhnrecMCHijingALaIncl(0)
351  ,fhnrecMCHijingALaCone(0)
352  ,fhnrecMCInjectLaIncl(0)
353  ,fhnrecMCInjectLaCone(0)
354  ,fhnrecMCInjectALaIncl(0)
355  ,fhnrecMCInjectALaCone(0)*/
356  ,fhnMCrecK0Cone(0)
357  ,fhnMCrecLaCone(0)
358  ,fhnMCrecALaCone(0)
359  /*,fhnMCrecK0ConeSmear(0)
360  ,fhnMCrecLaConeSmear(0)
361  ,fhnMCrecALaConeSmear(0)
362  ,fhnK0sSecContinCone(0)
363  ,fhnLaSecContinCone(0)
364  ,fhnALaSecContinCone(0)*/
365  ,fhnK0sIncl(0)
366  ,fhnK0sCone(0)
367  ,fhnK0sEmbCone(0)
368  ,fhnK0sEmbConeRef(0)
369  ,fhnK0sEmbConeStandard(0)
370  ,fhnLaIncl(0)
371  ,fhnLaCone(0)
372  ,fhnLaEmbCone(0)
373  ,fhnLaEmbConeRef(0)
374  ,fhnLaEmbConeStandard(0)
375  ,fhnALaIncl(0)
376  ,fhnALaCone(0)
377  ,fhnALaEmbCone(0)
378  ,fhnALaEmbConeRef(0)
379  ,fhnALaEmbConeStandard(0)
380  ,fh2MCEmbK0sJetPt(0)
381  ,fh2MCEmbLaJetPt(0)
382  ,fh2MCEmbALaJetPt(0)
383  ,fhnK0sPC(0)
384  ,fhnK0sEmbPC(0)
385  ,fhnLaPC(0)
386  ,fhnLaEmbPC(0)
387  ,fhnALaPC(0)
388  ,fhnALaEmbPC(0)
389  ,fhnK0sMCC(0)
390  ,fhnLaMCC(0)
391  ,fhnALaMCC(0)
392  ,fhnK0sRC(0)
393  ,fhnLaRC(0)
394  ,fhnALaRC(0)
395  ,fhnK0sRCBias(0)
396  ,fhnLaRCBias(0)
397  ,fhnALaRCBias(0)
398  ,fhnK0sOC(0)
399  ,fhnLaOC(0)
400  ,fhnALaOC(0)
401  ,fh1AreaExcluded(0)
402  ,fh1MedianEta(0)
403  ,fh1JetPtMedian(0)
404  ,fh1MCMultiplicityPrimary(0)
405  ,fh1MCMultiplicityTracks(0)
406  ,fhnFeedDownLa(0)
407  ,fhnFeedDownALa(0)
408  ,fhnFeedDownLaCone(0)
409  ,fhnFeedDownALaCone(0)
410  ,fh2FeedDownXiLa(0)
411  ,fh2FeedDownXiALa(0)
412  ,fh1MCProdRadiusK0s(0)
413  ,fh1MCProdRadiusLambda(0)
414  ,fh1MCProdRadiusAntiLambda(0)
415  ,fh1MCPtV0s(0)
416  ,fh1MCPtK0s(0)
417  ,fh1MCPtLambda(0)
418  ,fh1MCPtAntiLambda(0)
419  ,fh1MCXiPt(0)
420  ,fh1MCXibarPt(0)
421  ,fh2MCEtaVsPtK0s(0)
422  ,fh2MCEtaVsPtLa(0)
423  ,fh2MCEtaVsPtALa(0)
424  //,fh1MCRapK0s(0)
425  //,fh1MCRapLambda(0)
426  //,fh1MCRapAntiLambda(0)
427  ,fh1MCEtaAllK0s(0)
428  ,fh1MCEtaK0s(0)
429  ,fh1MCEtaLambda(0)
430  ,fh1MCEtaAntiLambda(0)
431 
432 {
433  // default constructor
434 }
435 
436 //__________________________________________________________________________________________
438  : AliAnalysisTaskFragmentationFunction(name)
439 
440  ,fRandom(0)
441  ,fMatchMode(0)
442  ,fEPAnalysis(0)
443  ,fIsNJEventEmb(0)
444  ,fAnalysisMC(0)
445  ,fDeltaVertexZ(0)
446  ,fCutjetEta(0)
447  ,fCuttrackNegNcls(0)
448  ,fCuttrackPosNcls(0)
449  ,fCutPostrackRap(0)
450  ,fCutNegtrackRap(0)
451  ,fCutRap(0)
452  ,fCutPostrackEta(0)
453  ,fCutNegtrackEta(0)
454  ,fCutEta(0)
455  ,fusePosV0Eta(0)
456  ,fuseNegV0Eta(0)
457  ,fusePosMCV0Eta(0)
458  ,fuseNegMCV0Eta(0)
459  ,fCutK0cosPointAngle(0)
460  ,fCutLacosPointAngle(0)
461  ,fKinkDaughters(0)
462  ,fRequireTPCRefit(0)
463  ,fCutArmenteros(0)
464  ,fCutV0DecayMin(0)
465  ,fCutV0DecayMax(0)
466  ,fCutV0totMom(0)
467  ,fCutDcaV0Daughters(0)
468  ,fCutDcaPosToPrimVertex(0)
469  ,fCutDcaNegToPrimVertex(0)
470  ,fCutV0RadiusMin(0)
471  ,fCutV0RadiusMax(0)
472  ,fCutBetheBloch(0)
473  ,fCutRatio(0)
474  ,fCutFractionPtEmbedded(0)
475  ,fCutDeltaREmbedded(0)
476  //,fBranchEmbeddedJets("")
477  ,fK0Type(0)
478  ,fFilterMaskK0(0)
479  ,jettracklist(0)
480  ,jetConeK0list(0)
481  ,jetConeLalist(0)
482  ,jetConeALalist(0)
483  ,jetConeK0Emblist(0)
484  ,jetConeLaEmblist(0)
485  ,jetConeALaEmblist(0)
486  ,jetConeK0EmbStlist(0)
487  ,jetConeLaEmbStlist(0)
488  ,jetConeALaEmbStlist(0)
489 
490  ,jetConeK0EmbMClist(0)
491  ,jetConeLaEmbMClist(0)
492  ,jetConeALaEmbMClist(0)
493 
494  ,jetPerpConeK0list(0)
495  ,jetPerpRecCutslist(0)
496  ,jetPerpConeK0Emblist(0)
497  ,jetPerpConeLalist(0)
498  ,jetPerpConeLaEmblist(0)
499  ,jetPerpConeALalist(0)
500  ,jetPerpConeALaEmblist(0)
501  ,jetMedianConeK0list(0)
502  ,jetMedianConeLalist(0)
503  ,jetMedianConeALalist(0)
504  ,jetMedianRecCutslist(0)
505  ,fListK0sRC(0)
506  ,fListLaRC(0)
507  ,fListALaRC(0)
508  ,fTracksRecCutsRC(0)
509  ,fTracksRecBckgCuts(0)
510  ,fTracksPerpCone(0)
511  ,fListK0s(0)
512  ,fListK0sMC(0)
513  ,fListK0sStandard(0)
514  ,fPIDResponse(0)
515  ,fV0QAK0(0)
516  ,fFFHistosRecCutsK0Evt(0)
517  //,fFFHistosIMK0AllEvt(0)
518  //,fFFHistosIMK0Jet(0)
519  //,fFFHistosIMK0Cone(0)
520  ,fLaType(0)
521  ,fFilterMaskLa(0)
522  ,fListLa(0)
523  ,fListLaMC(0)
524  ,fListLaStandard(0)
525  //,fFFHistosIMLaAllEvt(0)
526  //,fFFHistosIMLaJet(0)
527  //,fFFHistosIMLaCone(0)
528  ,fALaType(0)
529  ,fFilterMaskALa(0)
530  ,fListALa(0)
531  ,fListALaMC(0)
532  ,fListALaStandard(0)
533  ,fListFeeddownLaCand(0)
534  ,fListFeeddownALaCand(0)
535  ,jetConeFDLalist(0)
536  ,jetConeFDALalist(0)
537  ,fListMCgenK0s(0)
538  ,fListMCgenLa(0)
539  ,fListMCgenALa(0)
540  ,fListMCgenK0sCone(0)
541  ,fListMCgenLaCone(0)
542  ,fListMCgenALaCone(0)
543  ,IsArmenterosSelected(0)
544  ,fUseNJEvents(0)
545  ,fUseExtraTracks(0)
546  ,fUseExtraJetPt(0)
547  ,fUseEmbeddedJetPt(0)
548 
549  ,fUseStandard(0)
550  //,fFFHistosIMALaAllEvt(0)
551  //,fFFHistosIMALaJet(0)
552  // ,fFFHistosIMALaCone(0)
553  ,fFFIMNBinsJetPt(0)
554  ,fFFIMJetPtMin(0)
555  ,fFFIMJetPtMax(0)
556  ,fFFIMNBinsInvM(0)
557  ,fFFIMInvMMin(0)
558  ,fFFIMInvMMax(0)
559  ,fFFIMNBinsPt(0)
560  ,fFFIMPtMin(0)
561  ,fFFIMPtMax(0)
562  ,fFFIMNBinsXi(0)
563  ,fFFIMXiMin(0)
564  ,fFFIMXiMax(0)
565  ,fFFIMNBinsZ(0)
566  ,fFFIMZMin(0)
567  ,fFFIMZMax(0)
568  ,fFFIMLaNBinsJetPt(0)
569  ,fFFIMLaJetPtMin(0)
570  ,fFFIMLaJetPtMax(0)
571  ,fFFIMLaNBinsInvM(0)
572  ,fFFIMLaInvMMin(0)
573  ,fFFIMLaInvMMax(0)
574  ,fFFIMLaNBinsPt(0)
575  ,fFFIMLaPtMin(0)
576  ,fFFIMLaPtMax(0)
577  ,fFFIMLaNBinsXi(0)
578  ,fFFIMLaXiMin(0)
579  ,fFFIMLaXiMax(0)
580  ,fFFIMLaNBinsZ(0)
581  ,fFFIMLaZMin(0)
582  ,fFFIMLaZMax(0)
583  ,fh1EvtAllCent(0)
584  ,fh1Evt(0)
585  ,fh1EP2(0)
586  ,fh1EP3(0)
587  ,fh1K0Mult(0)
588  ,fh1dPhiJetK0(0)
589  ,fh1LaMult(0)
590  ,fh1dPhiJetLa(0)
591  ,fh1ALaMult(0)
592  ,fh1dPhiJetALa(0)
593  ,fh1JetEta(0)
594  ,fh1JetPhi(0)
595  ,fh2JetEtaPhi(0)
596  ,fh1nEmbeddedJets(0)
597  ,fh1nGenJets(0)
598  ,fh1IndexEmbedded(0)
599  ,fh1IndexEmbeddedMC(0)
600  ,fh1EmbeddedJetPhiDelta(0)
601  ,fh1PtEmbBeforeMatch(0)
602  ,fh1PtEmbExtraOnly(0)
603  ,fh1PtEmbReject(0)
604  ,fh2PtEtaEmbReject(0)
605  ,fh1PtEmbAfterMatch(0)
606  ,fh1FractionPtEmbedded(0)
607  ,fh1DeltaREmbedded(0)
608  ,fh1FractionPtEmbeddedMC(0)
609  ,fh2FractionPtVsEmbeddedJetPtMC(0)
610  ,fh1DeltaREmbeddedMC(0)
611  ,fh1JetPtEmbGenAfterMatch(0)
612  ,fh2TracksPerpCone(0)
613  ,fh1PerpCone(0)
614  // ,fh1V0JetPt(0)
615  ,fh1V0PtCandidate(0)
616  ,fh1IMK0Cone(0)
617  ,fh1IMLaCone(0)
618  ,fh1IMALaCone(0)
619  ,fh1IMK0EmbCone(0)
620  ,fh1IMLaEmbCone(0)
621  ,fh1IMALaEmbCone(0)
622  ,fh2FFJetTrackEta(0)
623  // ,fh1trackPosNCls(0)
624  // ,fh1trackNegNCls(0)
625  ,fh1trackPosRap(0)
626  ,fh1trackNegRap(0)
627  //,fh1V0Rap(0)
628  ,fh1trackPosEta(0)
629  ,fh1trackNegEta(0)
630  ,fh1V0Eta(0)
631  // ,fh1V0totMom(0)
632  ,fh1CosPointAngle(0)
633  ,fh1DecayLengthV0(0)
634  ,fh2ProperLifetimeK0sVsPtBeforeCut(0)
635  ,fh2ProperLifetimeK0sVsPtAfterCut(0)
636  ,fh1V0Radius(0)
637  ,fh1DcaV0Daughters(0)
638  ,fh1DcaPosToPrimVertex(0)
639  ,fh1DcaNegToPrimVertex(0)
640  ,fh2ArmenterosBeforeCuts(0)
641  ,fh2ArmenterosAfterCuts(0)
642  ,fh2BBLaPos(0)
643  ,fh2BBLaNeg(0)
644  ,fh1PosDaughterCharge(0)
645  ,fh1NegDaughterCharge(0)
646  ,fh1PtMCK0s(0)
647  ,fh1PtMCLa(0)
648  ,fh1PtMCALa(0)
649  ,fh1EtaK0s(0)
650  ,fh1EtaLa(0)
651  ,fh1EtaALa(0)
652  ,fh1RC(0)
653  ,fh1RCBiasK0(0)
654  ,fh1RCBiasLa(0)
655  ,fh1RCBiasALa(0)
656  ,fh1MCC(0)
657  ,fh1OC(0)
658  ,fh1NJ(0)
659  ,fh1NJEmbEvt(0)
660  ,fh1BckgJets(0)
661  ,fh1BckgJetsPtBias(0)
662  ,fhnInvMassEtaTrackPtK0s(0)
663  ,fhnInvMassEtaTrackPtLa(0)
664  ,fhnInvMassEtaTrackPtALa(0)
665  ,fh1TrackMultCone(0)
666  ,fh2TrackMultCone(0)
667  ,fhnNJK0(0)
668  ,fhnNJLa(0)
669  ,fhnNJALa(0)
670  //,fh2ChTracksNJ(0)
671  //,fh2ChTracksRC(0)
672  // ,fh2ChTracksOC(0)
673  //,fh2ChTracksMCC(0)
674  //,fh2ChTracksPC(0)
675  ,fhnMCgenK0Cone(0)
676  ,fhnMCgenLaCone(0)
677  //,fh2MCgenALaCone(0)
678  //,fh2MCEtagenK0Cone(0)
679  //,fh2MCEtagenLaCone(0)
680  //,fh2MCEtagenALaCone(0)
681  /* ,fh2CorrHijingLaProton(0)
682  ,fh2CorrInjectLaProton(0)
683  ,fh2CorrHijingALaAProton(0)
684  ,fh2CorrInjectALaAProton(0)*/
685  ,fh1IMK0ConeSmear(0)
686  ,fh1IMLaConeSmear(0)
687  ,fh1IMALaConeSmear(0)
688  ,fh2MC2K0Cone(0)
689  ,fh2MC2LaCone(0)
690  ,fh2MC2ALaCone(0)
691  /* ,fh2MCEtaVsPtHijingLa(0)
692  ,fh2MCEtaVsPtInjectLa(0)
693  ,fh2MCEtaVsPtHijingALa(0)
694  ,fh2MCEtaVsPtInjectALa(0)
695  ,fhnrecMCHijingLaIncl(0)
696  ,fhnrecMCHijingLaCone(0)
697  ,fhnrecMCHijingALaIncl(0)
698  ,fhnrecMCHijingALaCone(0)
699  ,fhnrecMCInjectLaIncl(0)
700  ,fhnrecMCInjectLaCone(0)
701  ,fhnrecMCInjectALaIncl(0)
702  ,fhnrecMCInjectALaCone(0)*/
703  ,fhnMCrecK0Cone(0)
704  ,fhnMCrecLaCone(0)
705  ,fhnMCrecALaCone(0)
706  /*,fhnMCrecK0ConeSmear(0)
707  ,fhnMCrecLaConeSmear(0)
708  ,fhnMCrecALaConeSmear(0)
709  ,fhnK0sSecContinCone(0)
710  ,fhnLaSecContinCone(0)
711  ,fhnALaSecContinCone(0)*/
712  ,fhnK0sIncl(0)
713  ,fhnK0sCone(0)
714  ,fhnK0sEmbCone(0)
715  ,fhnK0sEmbConeRef(0)
716  ,fhnK0sEmbConeStandard(0)
717  ,fhnLaIncl(0)
718  ,fhnLaCone(0)
719  ,fhnLaEmbCone(0)
720  ,fhnLaEmbConeRef(0)
721  ,fhnLaEmbConeStandard(0)
722  ,fhnALaIncl(0)
723  ,fhnALaCone(0)
724  ,fhnALaEmbCone(0)
725  ,fhnALaEmbConeRef(0)
726  ,fhnALaEmbConeStandard(0)
727  ,fh2MCEmbK0sJetPt(0)
728  ,fh2MCEmbLaJetPt(0)
729  ,fh2MCEmbALaJetPt(0)
730  ,fhnK0sPC(0)
731  ,fhnK0sEmbPC(0)
732  ,fhnLaPC(0)
733  ,fhnLaEmbPC(0)
734  ,fhnALaPC(0)
735  ,fhnALaEmbPC(0)
736  ,fhnK0sMCC(0)
737  ,fhnLaMCC(0)
738  ,fhnALaMCC(0)
739  ,fhnK0sRC(0)
740  ,fhnLaRC(0)
741  ,fhnALaRC(0)
742  ,fhnK0sRCBias(0)
743  ,fhnLaRCBias(0)
744  ,fhnALaRCBias(0)
745  ,fhnK0sOC(0)
746  ,fhnLaOC(0)
747  ,fhnALaOC(0)
748  ,fh1AreaExcluded(0)
749  ,fh1MedianEta(0)
750  ,fh1JetPtMedian(0)
751  ,fh1MCMultiplicityPrimary(0)
752  ,fh1MCMultiplicityTracks(0)
753  ,fhnFeedDownLa(0)
754  ,fhnFeedDownALa(0)
755  ,fhnFeedDownLaCone(0)
756  ,fhnFeedDownALaCone(0)
757  ,fh2FeedDownXiLa(0)
758  ,fh2FeedDownXiALa(0)
759  ,fh1MCProdRadiusK0s(0)
760  ,fh1MCProdRadiusLambda(0)
761  ,fh1MCProdRadiusAntiLambda(0)
762  ,fh1MCPtV0s(0)
763  ,fh1MCPtK0s(0)
764  ,fh1MCPtLambda(0)
765  ,fh1MCPtAntiLambda(0)
766  ,fh1MCXiPt(0)
767  ,fh1MCXibarPt(0)
768  ,fh2MCEtaVsPtK0s(0)
769  ,fh2MCEtaVsPtLa(0)
770  ,fh2MCEtaVsPtALa(0)
771  //,fh1MCRapK0s(0)
772  //,fh1MCRapLambda(0)
773  //,fh1MCRapAntiLambda(0)
774  ,fh1MCEtaAllK0s(0)
775  ,fh1MCEtaK0s(0)
776  ,fh1MCEtaLambda(0)
777  ,fh1MCEtaAntiLambda(0)
778 
779 
780 {
781  // constructor
782 
783  DefineOutput(1,TList::Class());
784 }
785 
786 //__________________________________________________________________________________________________________________________
788  : AliAnalysisTaskFragmentationFunction()
789 
790  ,fRandom(copy.fRandom)
791  ,fMatchMode(copy.fMatchMode)
792  ,fEPAnalysis(copy.fEPAnalysis)
793  ,fIsNJEventEmb(copy.fIsNJEventEmb)
794  ,fAnalysisMC(copy.fAnalysisMC)
795  ,fDeltaVertexZ(copy.fDeltaVertexZ)
796  ,fCutjetEta(copy.fCutjetEta)
797  ,fCuttrackNegNcls(copy.fCuttrackNegNcls)
798  ,fCuttrackPosNcls(copy.fCuttrackPosNcls)
799  ,fCutPostrackRap(copy.fCutPostrackRap)
800  ,fCutNegtrackRap(copy.fCutNegtrackRap)
801  ,fCutRap(copy.fCutRap)
802  ,fCutPostrackEta(copy.fCutPostrackEta)
803  ,fCutNegtrackEta(copy.fCutNegtrackEta)
804  ,fCutEta(copy.fCutEta)
805  ,fusePosV0Eta(copy.fusePosV0Eta)
806  ,fuseNegV0Eta(copy.fuseNegV0Eta)
807  ,fusePosMCV0Eta(copy.fusePosMCV0Eta)
808  ,fuseNegMCV0Eta(copy.fuseNegMCV0Eta)
809  ,fCutK0cosPointAngle(copy.fCutK0cosPointAngle)
810  ,fCutLacosPointAngle(copy.fCutLacosPointAngle)
811  ,fKinkDaughters(copy.fKinkDaughters)
812  ,fRequireTPCRefit(copy.fRequireTPCRefit)
813  ,fCutArmenteros(copy.fCutArmenteros)
814  ,fCutV0DecayMin(copy.fCutV0DecayMin)
815  ,fCutV0DecayMax(copy.fCutV0DecayMax)
816  ,fCutV0totMom(copy.fCutV0totMom)
817  ,fCutDcaV0Daughters(copy.fCutDcaV0Daughters)
818  ,fCutDcaPosToPrimVertex(copy.fCutDcaPosToPrimVertex)
819  ,fCutDcaNegToPrimVertex(copy.fCutDcaNegToPrimVertex)
820  ,fCutV0RadiusMin(copy.fCutV0RadiusMin)
821  ,fCutV0RadiusMax(copy.fCutV0RadiusMax)
822  ,fCutBetheBloch(copy.fCutBetheBloch)
823  ,fCutRatio(copy.fCutRatio)
824  ,fCutFractionPtEmbedded(copy.fCutFractionPtEmbedded)
825  ,fCutDeltaREmbedded(copy.fCutDeltaREmbedded)
826  //,fBranchEmbeddedJets(copy.fBranchEmbeddedJets)
827  ,fK0Type(copy.fK0Type)
828  ,fFilterMaskK0(copy.fFilterMaskK0)
829  ,jettracklist(copy.jettracklist)
830  ,jetConeK0list(copy.jetConeK0list)
831  ,jetConeLalist(copy.jetConeLalist)
832  ,jetConeALalist(copy.jetConeALalist)
833  ,jetConeK0Emblist(copy.jetConeK0Emblist)
834  ,jetConeLaEmblist(copy.jetConeLaEmblist)
835  ,jetConeALaEmblist(copy.jetConeALaEmblist)
836  ,jetConeK0EmbStlist(copy.jetConeK0EmbStlist)
837  ,jetConeLaEmbStlist(copy.jetConeLaEmbStlist)
838  ,jetConeALaEmbStlist(copy.jetConeALaEmbStlist)
839 
840  ,jetConeK0EmbMClist(copy.jetConeK0EmbMClist)
841  ,jetConeLaEmbMClist(copy.jetConeLaEmbMClist)
842  ,jetConeALaEmbMClist(copy.jetConeALaEmbMClist)
843 
844  ,jetPerpConeK0list(copy.jetPerpConeK0list)
845  ,jetPerpRecCutslist(copy.jetPerpRecCutslist)
846  ,jetPerpConeK0Emblist(copy.jetPerpConeK0Emblist)
847  ,jetPerpConeLalist(copy.jetPerpConeLalist)
848  ,jetPerpConeLaEmblist(copy.jetPerpConeLaEmblist)
849  ,jetPerpConeALalist(copy.jetPerpConeALalist)
850  ,jetPerpConeALaEmblist(copy.jetPerpConeALaEmblist)
851  ,jetMedianConeK0list(copy.jetMedianConeK0list)
852  ,jetMedianConeLalist(copy.jetMedianConeLalist)
853  ,jetMedianConeALalist(copy.jetMedianConeALalist)
854  ,jetMedianRecCutslist(copy.jetMedianRecCutslist)
855  ,fListK0sRC(copy.fListK0sRC)
856  ,fListLaRC(copy.fListLaRC)
857  ,fListALaRC(copy.fListALaRC)
858  ,fTracksRecCutsRC(copy.fTracksRecCutsRC)
859  ,fTracksRecBckgCuts(copy.fTracksRecBckgCuts)
860  ,fTracksPerpCone(copy.fTracksPerpCone)
861  ,fListK0s(copy.fListK0s)
862  ,fListK0sMC(copy.fListK0sMC)
863  ,fListK0sStandard(copy.fListK0sStandard)
864  ,fPIDResponse(copy.fPIDResponse)
865  ,fV0QAK0(copy.fV0QAK0)
866  ,fFFHistosRecCutsK0Evt(copy.fFFHistosRecCutsK0Evt)
867  //,fFFHistosIMK0AllEvt(copy.fFFHistosIMK0AllEvt)
868  //,fFFHistosIMK0Jet(copy.fFFHistosIMK0Jet)
869  //,fFFHistosIMK0Cone(copy.fFFHistosIMK0Cone)
870  ,fLaType(copy.fLaType)
871  ,fFilterMaskLa(copy.fFilterMaskLa)
872  ,fListLa(copy.fListLa)
873  ,fListLaMC(copy.fListLaMC)
874  ,fListLaStandard(copy.fListLaStandard)
875  //,fFFHistosIMLaAllEvt(copy.fFFHistosIMLaAllEvt)
876  //,fFFHistosIMLaJet(copy.fFFHistosIMLaJet)
877  //,fFFHistosIMLaCone(copy.fFFHistosIMLaCone)
878  ,fALaType(copy.fALaType)
879  ,fFilterMaskALa(copy.fFilterMaskALa)
880  ,fListALa(copy.fListALa)
881  ,fListALaMC(copy.fListALaMC)
882  ,fListALaStandard(copy.fListALaStandard)
883  ,fListFeeddownLaCand(copy.fListFeeddownLaCand)
884  ,fListFeeddownALaCand(copy.fListFeeddownALaCand)
885  ,jetConeFDLalist(copy.jetConeFDLalist)
886  ,jetConeFDALalist(copy.jetConeFDALalist)
887  ,fListMCgenK0s(copy.fListMCgenK0s)
888  ,fListMCgenLa(copy.fListMCgenLa)
889  ,fListMCgenALa(copy.fListMCgenALa)
890  ,fListMCgenK0sCone(copy.fListMCgenK0sCone)
891  ,fListMCgenLaCone(copy.fListMCgenLaCone)
892  ,fListMCgenALaCone(copy.fListMCgenALaCone)
893  ,IsArmenterosSelected(copy.IsArmenterosSelected)
894  ,fUseNJEvents(copy.fUseNJEvents)
895  ,fUseExtraTracks(copy.fUseExtraTracks)
896  ,fUseExtraJetPt(copy.fUseExtraJetPt)
897  ,fUseEmbeddedJetPt(copy.fUseEmbeddedJetPt)
898 
899  ,fUseStandard(copy.fUseStandard)
900  //,fFFHistosIMALaAllEvt(copy.fFFHistosIMALaAllEvt)
901  //,fFFHistosIMALaJet(copy.fFFHistosIMALaJet)
902  //,fFFHistosIMALaCone(copy.fFFHistosIMALaCone)
903  ,fFFIMNBinsJetPt(copy.fFFIMNBinsJetPt)
904  ,fFFIMJetPtMin(copy.fFFIMJetPtMin)
905  ,fFFIMJetPtMax(copy.fFFIMJetPtMax)
906  ,fFFIMNBinsInvM(copy.fFFIMNBinsInvM)
907  ,fFFIMInvMMin(copy.fFFIMInvMMin)
908  ,fFFIMInvMMax(copy.fFFIMInvMMax)
909  ,fFFIMNBinsPt(copy.fFFIMNBinsPt)
910  ,fFFIMPtMin(copy.fFFIMPtMin)
911  ,fFFIMPtMax(copy.fFFIMPtMax)
912  ,fFFIMNBinsXi(copy.fFFIMNBinsXi)
913  ,fFFIMXiMin(copy.fFFIMXiMin)
914  ,fFFIMXiMax(copy.fFFIMXiMax)
915  ,fFFIMNBinsZ(copy.fFFIMNBinsZ)
916  ,fFFIMZMin(copy.fFFIMZMin)
917  ,fFFIMZMax(copy.fFFIMZMax)
918  ,fFFIMLaNBinsJetPt(copy.fFFIMLaNBinsJetPt)
919  ,fFFIMLaJetPtMin(copy.fFFIMLaJetPtMin)
920  ,fFFIMLaJetPtMax(copy.fFFIMLaJetPtMax)
921  ,fFFIMLaNBinsInvM(copy.fFFIMLaNBinsInvM)
922  ,fFFIMLaInvMMin(copy.fFFIMLaInvMMin)
923  ,fFFIMLaInvMMax(copy.fFFIMLaInvMMax)
924  ,fFFIMLaNBinsPt(copy.fFFIMLaNBinsPt)
925  ,fFFIMLaPtMin(copy.fFFIMLaPtMin)
926  ,fFFIMLaPtMax(copy.fFFIMLaPtMax)
927  ,fFFIMLaNBinsXi(copy.fFFIMLaNBinsXi)
928  ,fFFIMLaXiMin(copy.fFFIMLaXiMin)
929  ,fFFIMLaXiMax(copy.fFFIMLaXiMax)
930  ,fFFIMLaNBinsZ(copy.fFFIMLaNBinsZ)
931  ,fFFIMLaZMin(copy.fFFIMLaZMin)
932  ,fFFIMLaZMax(copy.fFFIMLaZMax)
933  ,fh1EvtAllCent(copy.fh1EvtAllCent)
934  ,fh1Evt(copy.fh1Evt)
935  ,fh1EP2(copy.fh1EP2)
936  ,fh1EP3(copy.fh1EP3)
937  ,fh1K0Mult(copy.fh1K0Mult)
938  ,fh1dPhiJetK0(copy.fh1dPhiJetK0)
939  ,fh1LaMult(copy.fh1LaMult)
940  ,fh1dPhiJetLa(copy.fh1dPhiJetLa)
941  ,fh1ALaMult(copy.fh1ALaMult)
942  ,fh1dPhiJetALa(copy.fh1dPhiJetALa)
943  ,fh1JetEta(copy.fh1JetEta)
944  ,fh1JetPhi(copy.fh1JetPhi)
945  ,fh2JetEtaPhi(copy.fh2JetEtaPhi)
946  ,fh1nEmbeddedJets(copy.fh1nEmbeddedJets)
947  ,fh1nGenJets(copy.fh1nGenJets)
948  ,fh1IndexEmbedded(copy.fh1IndexEmbedded)
949  ,fh1IndexEmbeddedMC(copy.fh1IndexEmbeddedMC)
950  ,fh1EmbeddedJetPhiDelta(copy.fh1EmbeddedJetPhiDelta)
951  ,fh1PtEmbBeforeMatch(copy.fh1PtEmbBeforeMatch)
952  ,fh1PtEmbExtraOnly(copy.fh1PtEmbExtraOnly)
953  ,fh1PtEmbReject(copy.fh1PtEmbReject)
954  ,fh2PtEtaEmbReject(copy.fh2PtEtaEmbReject)
955  ,fh1PtEmbAfterMatch(copy.fh1PtEmbAfterMatch)
956  ,fh1FractionPtEmbedded(copy.fh1FractionPtEmbedded)
957  ,fh1DeltaREmbedded(copy.fh1DeltaREmbedded)
958  ,fh1FractionPtEmbeddedMC(copy.fh1FractionPtEmbeddedMC)
959  ,fh2FractionPtVsEmbeddedJetPtMC(copy.fh2FractionPtVsEmbeddedJetPtMC)
960  ,fh1DeltaREmbeddedMC(copy.fh1DeltaREmbeddedMC)
961  ,fh1JetPtEmbGenAfterMatch(copy.fh1JetPtEmbGenAfterMatch)
962  ,fh2TracksPerpCone(copy.fh2TracksPerpCone)
963  ,fh1PerpCone(copy.fh1PerpCone)
964  //,fh1V0JetPt(copy.fh1V0JetPt)
965  ,fh1V0PtCandidate(copy.fh1V0PtCandidate)
966  ,fh1IMK0Cone(copy.fh1IMK0Cone)
967  ,fh1IMLaCone(copy.fh1IMLaCone)
968  ,fh1IMALaCone(copy.fh1IMALaCone)
969  ,fh1IMK0EmbCone(copy.fh1IMK0EmbCone)
970  ,fh1IMLaEmbCone(copy.fh1IMLaEmbCone)
971  ,fh1IMALaEmbCone(copy.fh1IMALaEmbCone)
972  ,fh2FFJetTrackEta(copy.fh2FFJetTrackEta)
973  //,fh1trackPosNCls(copy.fh1trackPosNCls)
974  //,fh1trackNegNCls(copy.fh1trackNegNCls)
975  ,fh1trackPosRap(copy.fh1trackPosRap)
976  ,fh1trackNegRap(copy.fh1trackNegRap)
977  //,fh1V0Rap(copy.fh1V0Rap)
978  ,fh1trackPosEta(copy.fh1trackPosEta)
979  ,fh1trackNegEta(copy.fh1trackNegEta)
980  ,fh1V0Eta(copy.fh1V0Eta)
981  //,fh1V0totMom(copy.fh1V0totMom)
982  ,fh1CosPointAngle(copy.fh1CosPointAngle)
983  ,fh1DecayLengthV0(copy.fh1DecayLengthV0)
984  ,fh2ProperLifetimeK0sVsPtBeforeCut(copy.fh2ProperLifetimeK0sVsPtBeforeCut)
985  ,fh2ProperLifetimeK0sVsPtAfterCut(copy.fh2ProperLifetimeK0sVsPtAfterCut)
986  ,fh1V0Radius(copy.fh1V0Radius)
987  ,fh1DcaV0Daughters(copy.fh1DcaV0Daughters)
988  ,fh1DcaPosToPrimVertex(copy.fh1DcaPosToPrimVertex)
989  ,fh1DcaNegToPrimVertex(copy.fh1DcaNegToPrimVertex)
990  ,fh2ArmenterosBeforeCuts(copy.fh2ArmenterosBeforeCuts)
991  ,fh2ArmenterosAfterCuts(copy.fh2ArmenterosAfterCuts)
992  ,fh2BBLaPos(copy.fh2BBLaPos)
993  ,fh2BBLaNeg(copy.fh2BBLaPos)
994  ,fh1PosDaughterCharge(copy.fh1PosDaughterCharge)
995  ,fh1NegDaughterCharge(copy.fh1NegDaughterCharge)
996  ,fh1PtMCK0s(copy.fh1PtMCK0s)
997  ,fh1PtMCLa(copy.fh1PtMCLa)
998  ,fh1PtMCALa(copy.fh1PtMCALa)
999  ,fh1EtaK0s(copy.fh1EtaK0s)
1000  ,fh1EtaLa(copy.fh1EtaLa)
1001  ,fh1EtaALa(copy.fh1EtaALa)
1002  ,fh1RC(copy.fh1RC)
1003  ,fh1RCBiasK0(copy.fh1RCBiasK0)
1004  ,fh1RCBiasLa(copy.fh1RCBiasLa)
1005  ,fh1RCBiasALa(copy.fh1RCBiasALa)
1006  ,fh1MCC(copy.fh1MCC)
1007  ,fh1OC(copy.fh1OC)
1008  ,fh1NJ(copy.fh1NJ)
1009  ,fh1NJEmbEvt(copy.fh1NJEmbEvt)
1010  ,fh1BckgJets(copy.fh1BckgJets)
1011  ,fh1BckgJetsPtBias(copy.fh1BckgJetsPtBias)
1012  ,fhnInvMassEtaTrackPtK0s(copy.fhnInvMassEtaTrackPtK0s)
1013  ,fhnInvMassEtaTrackPtLa(copy.fhnInvMassEtaTrackPtLa)
1014  ,fhnInvMassEtaTrackPtALa(copy.fhnInvMassEtaTrackPtALa)
1015  ,fh1TrackMultCone(copy.fh1TrackMultCone)
1016  ,fh2TrackMultCone(copy.fh2TrackMultCone)
1017  ,fhnNJK0(copy.fhnNJK0)
1018  ,fhnNJLa(copy.fhnNJLa)
1019  ,fhnNJALa(copy.fhnNJALa)
1020  //,fh2ChTracksNJ(copy.fh2ChTracksNJ)
1021  //,fh2ChTracksRC(copy.fh2ChTracksRC)
1022  // ,fh2ChTracksOC(copy.fh2ChTracksOC)
1023  //,fh2ChTracksMCC(copy.fh2ChTracksMCC)
1024  //,fh2ChTracksPC(copy.fh2ChTracksPC)
1025  ,fhnMCgenK0Cone(copy.fhnMCgenK0Cone)
1026  ,fhnMCgenLaCone(copy.fhnMCgenLaCone)
1027  //,fh2MCgenALaCone(copy.fh2MCgenALaCone)
1028  //,fh2MCEtagenK0Cone(copy.fh2MCEtagenK0Cone)
1029  // ,fh2MCEtagenLaCone(copy.fh2MCEtagenLaCone)
1030  //,fh2MCEtagenALaCone(copy.fh2MCEtagenALaCone)
1031  /* ,fh2CorrHijingLaProton(copy.fh2CorrHijingLaProton)
1032  ,fh2CorrInjectLaProton(copy.fh2CorrInjectLaProton)
1033  ,fh2CorrHijingALaAProton(copy.fh2CorrHijingALaAProton)
1034  ,fh2CorrInjectALaAProton(copy.fh2CorrInjectALaAProton)*/
1035  ,fh1IMK0ConeSmear(copy.fh1IMK0ConeSmear)
1036  ,fh1IMLaConeSmear(copy.fh1IMLaConeSmear)
1037  ,fh1IMALaConeSmear(copy.fh1IMALaConeSmear)
1038  ,fh2MC2K0Cone(copy.fh2MC2K0Cone)
1039  ,fh2MC2LaCone(copy.fh2MC2LaCone)
1040  ,fh2MC2ALaCone(copy.fh2MC2ALaCone)
1041  /*
1042  ,fh2MCEtaVsPtHijingLa(copy.fh2MCEtaVsPtHijingLa)
1043  ,fh2MCEtaVsPtInjectLa(copy.fh2MCEtaVsPtInjectLa)
1044  ,fh2MCEtaVsPtHijingALa(copy.fh2MCEtaVsPtHijingALa)
1045  ,fh2MCEtaVsPtInjectALa(copy.fh2MCEtaVsPtInjectALa)
1046  ,fhnrecMCHijingLaIncl(copy.fhnrecMCHijingLaIncl)
1047  ,fhnrecMCHijingLaCone(copy.fhnrecMCHijingLaCone)
1048  ,fhnrecMCHijingALaIncl(copy.fhnrecMCHijingALaIncl)
1049  ,fhnrecMCHijingALaCone(copy.fhnrecMCHijingALaCone)
1050  ,fhnrecMCInjectLaIncl(copy.fhnrecMCInjectLaIncl)
1051  ,fhnrecMCInjectLaCone(copy.fhnrecMCInjectLaCone)
1052  ,fhnrecMCInjectALaIncl(copy.fhnrecMCInjectALaIncl)
1053  ,fhnrecMCInjectALaCone(copy.fhnrecMCInjectALaCone) */
1054  ,fhnMCrecK0Cone(copy.fhnMCrecK0Cone)
1055  ,fhnMCrecLaCone(copy.fhnMCrecLaCone)
1056  ,fhnMCrecALaCone(copy.fhnMCrecALaCone)
1057  /*,fhnMCrecK0ConeSmear(copy.fhnMCrecK0ConeSmear)
1058  ,fhnMCrecLaConeSmear(copy.fhnMCrecLaConeSmear)
1059  ,fhnMCrecALaConeSmear(copy.fhnMCrecALaConeSmear)
1060  ,fhnK0sSecContinCone(copy.fhnK0sSecContinCone)
1061  ,fhnLaSecContinCone(copy.fhnLaSecContinCone)
1062  ,fhnALaSecContinCone(copy.fhnALaSecContinCone)*/
1063  ,fhnK0sIncl(copy.fhnK0sIncl)
1064  ,fhnK0sCone(copy.fhnK0sCone)
1065  ,fhnK0sEmbCone(copy.fhnK0sEmbCone)
1066  ,fhnK0sEmbConeRef(copy.fhnK0sEmbConeRef)
1067  ,fhnK0sEmbConeStandard(copy.fhnK0sEmbConeStandard)
1068  ,fhnLaIncl(copy.fhnLaIncl)
1069  ,fhnLaCone(copy.fhnLaCone)
1070  ,fhnLaEmbCone(copy.fhnLaEmbCone)
1071  ,fhnLaEmbConeRef(copy.fhnLaEmbConeRef)
1072  ,fhnLaEmbConeStandard(copy.fhnLaEmbConeStandard)
1073  ,fhnALaIncl(copy.fhnALaIncl)
1074  ,fhnALaCone(copy.fhnALaCone)
1075  ,fhnALaEmbCone(copy.fhnALaEmbCone)
1076  ,fhnALaEmbConeRef(copy.fhnALaEmbConeRef)
1077  ,fhnALaEmbConeStandard(copy.fhnALaEmbConeStandard)
1078 
1079  ,fh2MCEmbK0sJetPt(copy.fh2MCEmbK0sJetPt)
1080  ,fh2MCEmbLaJetPt(copy.fh2MCEmbLaJetPt)
1081  ,fh2MCEmbALaJetPt(copy.fh2MCEmbALaJetPt)
1082 
1083  ,fhnK0sPC(copy.fhnK0sPC)
1084  ,fhnK0sEmbPC(copy.fhnK0sEmbPC)
1085  ,fhnLaPC(copy.fhnLaPC)
1086  ,fhnLaEmbPC(copy.fhnLaEmbPC)
1087  ,fhnALaPC(copy.fhnALaPC)
1088  ,fhnALaEmbPC(copy.fhnALaEmbPC)
1089  ,fhnK0sMCC(copy.fhnK0sMCC)
1090  ,fhnLaMCC(copy.fhnLaMCC)
1091  ,fhnALaMCC(copy.fhnALaMCC)
1092  ,fhnK0sRC(copy.fhnK0sRC)
1093  ,fhnLaRC(copy.fhnLaRC)
1094  ,fhnALaRC(copy.fhnALaRC)
1095  ,fhnK0sRCBias(copy.fhnK0sRCBias)
1096  ,fhnLaRCBias(copy.fhnLaRCBias)
1097  ,fhnALaRCBias(copy.fhnALaRCBias)
1098  ,fhnK0sOC(copy.fhnK0sOC)
1099  ,fhnLaOC(copy.fhnLaOC)
1100  ,fhnALaOC(copy.fhnALaOC)
1101  ,fh1AreaExcluded(copy.fh1AreaExcluded)
1102  ,fh1MedianEta(copy.fh1MedianEta)
1103  ,fh1JetPtMedian(copy.fh1JetPtMedian)
1104  ,fh1MCMultiplicityPrimary(copy.fh1MCMultiplicityPrimary)
1105  ,fh1MCMultiplicityTracks(copy.fh1MCMultiplicityTracks)
1106  ,fhnFeedDownLa(copy.fhnFeedDownLa)
1107  ,fhnFeedDownALa(copy.fhnFeedDownALa)
1108  ,fhnFeedDownLaCone(copy.fhnFeedDownLaCone)
1109  ,fhnFeedDownALaCone(copy.fhnFeedDownALaCone)
1110  ,fh2FeedDownXiLa(copy.fh2FeedDownXiLa)
1111  ,fh2FeedDownXiALa(copy.fh2FeedDownXiALa)
1112  ,fh1MCProdRadiusK0s(copy.fh1MCProdRadiusK0s)
1113  ,fh1MCProdRadiusLambda(copy.fh1MCProdRadiusLambda)
1114  ,fh1MCProdRadiusAntiLambda(copy.fh1MCProdRadiusAntiLambda)
1115  ,fh1MCPtV0s(copy.fh1MCPtV0s)
1116  ,fh1MCPtK0s(copy.fh1MCPtK0s)
1117  ,fh1MCPtLambda(copy.fh1MCPtLambda)
1118  ,fh1MCPtAntiLambda(copy.fh1MCPtAntiLambda)
1119  ,fh1MCXiPt(copy.fh1MCXiPt)
1120  ,fh1MCXibarPt(copy.fh1MCXibarPt)
1121  ,fh2MCEtaVsPtK0s(copy.fh2MCEtaVsPtK0s)
1122  ,fh2MCEtaVsPtLa(copy.fh2MCEtaVsPtLa)
1123  ,fh2MCEtaVsPtALa(copy.fh2MCEtaVsPtALa)
1124  //,fh1MCRapK0s(copy.fh1MCRapK0s)
1125  //,fh1MCRapLambda(copy.fh1MCRapLambda)
1126  //,fh1MCRapAntiLambda(copy.fh1MCRapAntiLambda)
1127  ,fh1MCEtaAllK0s(copy.fh1MCEtaAllK0s)
1128  ,fh1MCEtaK0s(copy.fh1MCEtaK0s)
1129  ,fh1MCEtaLambda(copy.fh1MCEtaLambda)
1130  ,fh1MCEtaAntiLambda(copy.fh1MCEtaAntiLambda)
1131 
1132 {
1133  // copy constructor
1134 
1135 }
1136 
1137 // _________________________________________________________________________________________________________________________________
1139 {
1140  // assignment
1141 
1142  if(this!=&o){
1143  AliAnalysisTaskFragmentationFunction::operator=(o);
1144 
1145  fRandom = o.fRandom;
1146  fMatchMode = o.fMatchMode;
1151  fCutjetEta = o.fCutjetEta;
1156  fCutRap = o.fCutRap;
1159  fCutEta = o.fCutEta;
1178  fCutRatio = o.fCutRatio;
1181  //fBranchEmbeddedJets = o.fBranchEmbeddedJets;
1182  fK0Type = o.fK0Type;
1194 
1198 
1210  fListK0sRC = o.fListK0sRC;
1211  fListLaRC = o.fListLaRC;
1212  fListALaRC = o.fListALaRC;
1216  fListK0s = o.fListK0s;
1217  fListK0sMC = o.fListK0sMC;
1220  fV0QAK0 = o.fV0QAK0;
1222  //fFFHistosIMK0AllEvt = o.fFFHistosIMK0AllEvt;
1223  //fFFHistosIMK0Jet = o.fFFHistosIMK0Jet;
1224  //fFFHistosIMK0Cone = o.fFFHistosIMK0Cone;
1225  fLaType = o.fLaType;
1227  fListLa = o.fListLa;
1228  fListLaMC = o.fListLaMC;
1230  //fFFHistosIMLaAllEvt = o.fFFHistosIMLaAllEvt;
1231  //fFFHistosIMLaJet = o.fFFHistosIMLaJet;
1232  //fFFHistosIMLaCone = o.fFFHistosIMLaCone;
1233  fALaType = o.fALaType;
1235  fListALa = o.fListALa;
1236  fListALaMC = o.fListALaMC;
1253 
1255  // fFFHistosIMALaAllEvt = o.fFFHistosIMALaAllEvt;
1256  // fFFHistosIMALaJet = o.fFFHistosIMALaJet;
1257  // fFFHistosIMALaCone = o.fFFHistosIMALaCone;
1262  fFFIMPtMin = o.fFFIMPtMin;
1263  fFFIMPtMax = o.fFFIMPtMax;
1265  fFFIMXiMin = o.fFFIMXiMin;
1266  fFFIMXiMax = o.fFFIMXiMax;
1267  fFFIMNBinsZ = o.fFFIMNBinsZ;
1268  fFFIMZMin = o.fFFIMZMin;
1269  fFFIMZMax = o.fFFIMZMax;
1280  fFFIMLaZMin = o.fFFIMLaZMin;
1283  fh1Evt = o.fh1Evt;
1284  fh1EP2 = o.fh1EP2;
1285  fh1EP3 = o.fh1EP3;
1286  fh1K0Mult = o.fh1K0Mult;
1288  fh1LaMult = o.fh1LaMult;
1290  fh1ALaMult = o.fh1ALaMult;
1292  fh1JetEta = o.fh1JetEta;
1293  fh1JetPhi = o.fh1JetPhi;
1296  fh1nGenJets = o.fh1nGenJets;
1313  //fh1V0JetPt = o.fh1V0JetPt;
1322  //fh1trackPosNCls = o.fh1trackPosNCls;
1323  //fh1trackNegNCls = o.fh1trackNegNCls;
1326  //fh1V0Rap = o.fh1V0Rap;
1329  fh1V0Eta = o.fh1V0Eta;
1330  // fh1V0totMom = o.fh1V0totMom;
1335  fh1V0Radius = o.fh1V0Radius;
1341  fh2BBLaPos = o.fh2BBLaPos;
1342  fh2BBLaNeg = o.fh2BBLaPos;
1345  fh1PtMCK0s = o.fh1PtMCK0s;
1346  fh1PtMCLa = o.fh1PtMCLa;
1347  fh1PtMCALa = o.fh1PtMCALa;
1348  fh1EtaK0s = o.fh1EtaK0s;
1349  fh1EtaLa = o.fh1EtaLa;
1350  fh1EtaALa = o.fh1EtaALa;
1351  fh1RC = o.fh1RC;
1355  fh1MCC = o.fh1MCC;
1356  fh1OC = o.fh1OC;
1357  fh1NJ = o.fh1NJ;
1366  fhnNJK0 = o.fhnNJK0;
1367  fhnNJLa = o.fhnNJLa;
1368  fhnNJALa = o.fhnNJALa;
1369  //fh2ChTracksNJ = o.fh2ChTracksNJ;
1370  //fh2ChTracksRC = o.fh2ChTracksRC;
1371  // fh2ChTracksOC = o.fh2ChTracksOC;
1372  //fh2ChTracksMCC = o.fh2ChTracksMCC;
1373  //fh2ChTracksPC = o.fh2ChTracksPC;
1376  //fh2MCgenALaCone = o.fh2MCgenALaCone;
1377  //fh2MCEtagenK0Cone = o.fh2MCEtagenK0Cone;
1378  //fh2MCEtagenLaCone = o.fh2MCEtagenLaCone;
1379  //fh2MCEtagenALaCone = o.fh2MCEtagenALaCone;
1386  /*
1387  fh2MCEtaVsPtHijingLa = o.fh2MCEtaVsPtHijingLa;
1388  fh2MCEtaVsPtInjectLa = o.fh2MCEtaVsPtInjectLa;
1389  fh2MCEtaVsPtHijingALa = o.fh2MCEtaVsPtHijingALa;
1390  fh2MCEtaVsPtInjectALa = o.fh2MCEtaVsPtInjectALa;
1391  fhnrecMCHijingLaIncl = o.fhnrecMCHijingLaIncl;
1392  fhnrecMCHijingLaCone = o.fhnrecMCHijingLaCone;
1393  fhnrecMCHijingALaIncl = o.fhnrecMCHijingALaIncl;
1394  fhnrecMCHijingALaCone = o.fhnrecMCHijingALaCone;
1395  fhnrecMCInjectLaIncl = o.fhnrecMCInjectLaIncl;
1396  fhnrecMCInjectLaCone = o.fhnrecMCInjectLaCone;
1397  fhnrecMCInjectALaIncl = o.fhnrecMCInjectALaIncl;
1398  fhnrecMCInjectALaCone = o.fhnrecMCInjectALaCone; */
1402  /* fhnMCrecK0ConeSmear = o.fhnMCrecK0ConeSmear;
1403  fhnMCrecLaConeSmear = o.fhnMCrecLaConeSmear;
1404  fhnMCrecALaConeSmear = o.fhnMCrecALaConeSmear;
1405  fhnK0sSecContinCone = o.fhnK0sSecContinCone;
1406  fhnLaSecContinCone = o.fhnLaSecContinCone;
1407  fhnALaSecContinCone = o.fhnALaSecContinCone;*/
1408  fhnK0sIncl = o.fhnK0sIncl;
1409  fhnK0sCone = o.fhnK0sCone;
1413  fhnLaIncl = o.fhnLaIncl;
1414  fhnLaCone = o.fhnLaCone;
1418  fhnALaIncl = o.fhnALaIncl;
1419  fhnALaCone = o.fhnALaCone;
1423 
1427 
1428  fhnK0sPC = o.fhnK0sPC;
1430  fhnLaPC = o.fhnLaPC;
1431  fhnLaEmbPC = o.fhnLaEmbPC;
1432  fhnALaPC = o.fhnALaPC;
1434  fhnK0sRC = o.fhnK0sRC;
1435  fhnLaRC = o.fhnLaRC;
1436  fhnALaRC = o.fhnALaRC;
1440  fhnK0sOC = o.fhnK0sOC;
1441  fhnLaOC = o.fhnLaOC;
1442  fhnALaOC = o.fhnALaOC;
1457  fh1MCPtV0s = o.fh1MCPtV0s;
1458  fh1MCPtK0s = o.fh1MCPtK0s;
1461  fh1MCXiPt = o.fh1MCXiPt;
1466  //fh1MCRapK0s = o.fh1MCRapK0s;
1467  //fh1MCRapLambda = o.fh1MCRapLambda;
1468  //fh1MCRapAntiLambda = o.fh1MCRapAntiLambda;
1470  fh1MCEtaK0s = o.fh1MCEtaK0s;
1473 }
1474 
1475  return *this;
1476 }
1477 
1478 //_______________________________________________
1480 {
1481  // destructor
1482 
1483  if(jettracklist) delete jettracklist;
1484  if(jetConeK0list) delete jetConeK0list;
1485  if(jetConeLalist) delete jetConeLalist;
1486  if(jetConeALalist) delete jetConeALalist;
1493 
1497 
1509  if(fListK0sRC) delete fListK0sRC;
1510  if(fListLaRC) delete fListLaRC;
1511  if(fListALaRC) delete fListALaRC;
1514  if(fTracksPerpCone) delete fTracksPerpCone;
1515  if(fListK0s) delete fListK0s;
1516  if(fListK0sMC) delete fListK0sMC;
1517  if(fListLa) delete fListLa;
1518  if(fListLaMC) delete fListLaMC;
1519  if(fListALa) delete fListALa;
1520  if(fListALaMC) delete fListALaMC;
1522  if(fListLaStandard) delete fListLaStandard;
1526  if(jetConeFDLalist) delete jetConeFDLalist;
1527  if(jetConeFDALalist) delete jetConeFDALalist;
1528  if(fListMCgenK0s) delete fListMCgenK0s;
1529  if(fListMCgenLa) delete fListMCgenLa;
1530  if(fListMCgenALa) delete fListMCgenALa;
1534  if(fRandom) delete fRandom;
1535 
1536 }
1537 
1538 //________________________________________________________________________________________________________________________________
1540  Int_t nJetPt, Float_t jetPtMin, Float_t jetPtMax,
1541  Int_t nInvMass, Float_t invMassMin, Float_t invMassMax,
1543  Int_t nXi, Float_t xiMin, Float_t xiMax,
1544  Int_t nZ , Float_t zMin , Float_t zMax )
1545  : TObject()
1546  ,fNBinsJetPt(nJetPt)
1547  ,fJetPtMin(jetPtMin)
1548  ,fJetPtMax(jetPtMax)
1549  ,fNBinsInvMass(nInvMass)
1550  ,fInvMassMin(invMassMin)
1551  ,fInvMassMax(invMassMax)
1552  ,fNBinsPt(nPt)
1553  ,fPtMin(ptMin)
1554  ,fPtMax(ptMax)
1555  ,fNBinsXi(nXi)
1556  ,fXiMin(xiMin)
1557  ,fXiMax(xiMax)
1558  ,fNBinsZ(nZ)
1559  ,fZMin(zMin)
1560  ,fZMax(zMax)
1561  ,fh3TrackPt(0)
1562  ,fh3Xi(0)
1563  ,fh3Z(0)
1564  ,fh1JetPt(0)
1565  ,fNameFF(name)
1566 {
1567  // default constructor
1568 
1569 }
1570 
1571 //______________________________________________________________________________________________________________
1573  : TObject()
1574  ,fNBinsJetPt(copy.fNBinsJetPt)
1575  ,fJetPtMin(copy.fJetPtMin)
1576  ,fJetPtMax(copy.fJetPtMax)
1577  ,fNBinsInvMass(copy.fNBinsInvMass)
1578  ,fInvMassMin(copy.fInvMassMin)
1579  ,fInvMassMax(copy.fInvMassMax)
1580  ,fNBinsPt(copy.fNBinsPt)
1581  ,fPtMin(copy.fPtMin)
1582  ,fPtMax(copy.fPtMax)
1583  ,fNBinsXi(copy.fNBinsXi)
1584  ,fXiMin(copy.fXiMin)
1585  ,fXiMax(copy.fXiMax)
1586  ,fNBinsZ(copy.fNBinsZ)
1587  ,fZMin(copy.fZMin)
1588  ,fZMax(copy.fZMax)
1589  ,fh3TrackPt(copy.fh3TrackPt)
1590  ,fh3Xi(copy.fh3Xi)
1591  ,fh3Z(copy.fh3Z)
1592  ,fh1JetPt(copy.fh1JetPt)
1593  ,fNameFF(copy.fNameFF)
1594 {
1595  // copy constructor
1596 }
1597 
1598 //______________________________________________________________________________________________________________________________________________________________________
1600 {
1601  // assignment
1602 
1603  if(this!=&o){
1604  TObject::operator=(o);
1605  fNBinsJetPt = o.fNBinsJetPt;
1606  fJetPtMin = o.fJetPtMin;
1607  fJetPtMax = o.fJetPtMax;
1608  fNBinsInvMass = o.fNBinsInvMass;
1609  fInvMassMin = o.fInvMassMin;
1610  fInvMassMax = o.fInvMassMax;
1611  fNBinsPt = o.fNBinsPt;
1612  fPtMin = o.fPtMin;
1613  fPtMax = o.fPtMax;
1614  fNBinsXi = o.fNBinsXi;
1615  fXiMin = o.fXiMin;
1616  fXiMax = o.fXiMax;
1617  fNBinsZ = o.fNBinsZ;
1618  fZMin = o.fZMin;
1619  fZMax = o.fZMax;
1620  fh3TrackPt = o.fh3TrackPt;
1621  fh3Xi = o.fh3Xi;
1622  fh3Z = o.fh3Z;
1623  fh1JetPt = o.fh1JetPt;
1624  fNameFF = o.fNameFF;
1625  }
1626 
1627  return *this;
1628 }
1629 
1630 //___________________________________________________________________________
1632 {
1633  // destructor
1634 
1635  if(fh1JetPt) delete fh1JetPt;
1636  if(fh3TrackPt) delete fh3TrackPt;
1637  if(fh3Xi) delete fh3Xi;
1638  if(fh3Z) delete fh3Z;
1639 }
1640 
1641 //_________________________________________________________________
1643 {
1644  // book FF histos
1645 
1646  fh1JetPt = new TH1F(Form("fh1FFJetPtIM%s", fNameFF.Data()),"",fNBinsJetPt,fJetPtMin,fJetPtMax);
1647  fh3TrackPt = new TH3F(Form("fh3FFTrackPtIM%s",fNameFF.Data()),"",fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsInvMass, fInvMassMin, fInvMassMax, fNBinsPt, fPtMin, fPtMax);
1648  fh3Xi = new TH3F(Form("fh3FFXiIM%s", fNameFF.Data()),"", fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsInvMass, fInvMassMin, fInvMassMax, fNBinsXi, fXiMin, fXiMax);
1649  fh3Z = new TH3F(Form("fh3FFZIM%s", fNameFF.Data()),"", fNBinsJetPt, fJetPtMin, fJetPtMax, fNBinsInvMass, fInvMassMin, fInvMassMax, fNBinsZ, fZMin, fZMax);
1650 
1651  AliAnalysisTaskFragmentationFunction::SetProperties(fh1JetPt, "p_{t} (GeV/c)", "entries");
1652  AliAnalysisTaskJetChem::SetProperties(fh3TrackPt,"jet p_{t} (GeV/c)","inv Mass (GeV/c^2)","p_{t} (GeV/c)");
1653  AliAnalysisTaskJetChem::SetProperties(fh3Xi,"jet p_{t} (GeV/c)","inv Mass (GeV/c^2)","#xi");
1654  AliAnalysisTaskJetChem::SetProperties(fh3Z,"jet p_{t} (GeV/c)","inv Mass (GeV/c^2)","z");
1655 }
1656 
1657 //________________________________________________________________________________________________________________________________
1659 {
1660  // fill FF, don't use TH3F anymore use THnSparse instead to save memory
1661 
1662  if(incrementJetPt) fh1JetPt->Fill(jetPt);
1663  //fh3TrackPt->Fill(jetPt,invM,trackPt);//Fill(x,y,z)
1664  invM = 0;
1665  Double_t z = 0.;
1666  if(jetPt>0) z = trackPt / jetPt;
1667  // Double_t xi = 0;
1668  //if(z>0) xi = TMath::Log(1/z);
1669 
1670  //fh3Xi->Fill(jetPt,invM,xi);
1671  //fh3Z->Fill(jetPt,invM,z);
1672 }
1673 
1674 //___________________________________________________________________________________
1676 {
1677  // add histos to list
1678 
1679  list->Add(fh1JetPt);
1680  //list->Add(fh3TrackPt);
1681  //list->Add(fh3Xi);
1682  //list->Add(fh3Z);
1683 }
1684 
1685 
1686 //____________________________________________________
1688 {
1689  // create output objects
1690 
1691  fRandom = new TRandom3(0);
1692  fRandom->SetSeed(0);
1693 
1694  if(fDebug > 1) Printf("AliAnalysisTaskJetChem::UserCreateOutputObjects()");
1695 
1696  // create list of tracks and jets
1697  jettracklist = new TList();
1698  jettracklist->SetOwner(kFALSE);
1699  jetConeK0list = new TList();
1700  jetConeK0list->SetOwner(kFALSE);
1701  jetConeLalist = new TList();
1702  jetConeLalist->SetOwner(kFALSE);
1703  jetConeALalist = new TList();
1704  jetConeALalist->SetOwner(kFALSE);
1705  jetConeK0Emblist = new TList();
1706  jetConeK0Emblist->SetOwner(kFALSE);
1707  jetConeLaEmblist = new TList();
1708  jetConeLaEmblist->SetOwner(kFALSE);
1709  jetConeALaEmblist = new TList();
1710  jetConeALaEmblist->SetOwner(kFALSE);
1711  jetConeK0EmbStlist = new TList();
1712  jetConeK0EmbStlist->SetOwner(kFALSE);
1713  jetConeLaEmbStlist = new TList();
1714  jetConeLaEmbStlist->SetOwner(kFALSE);
1715  jetConeALaEmbStlist = new TList();
1716  jetConeALaEmbStlist->SetOwner(kFALSE);
1717 
1718  jetConeK0EmbMClist = new TList();
1719  jetConeK0EmbMClist->SetOwner(kFALSE);
1720  jetConeLaEmbMClist = new TList();
1721  jetConeLaEmbMClist->SetOwner(kFALSE);
1722  jetConeALaEmbMClist = new TList();
1723  jetConeALaEmbMClist->SetOwner(kFALSE);
1724 
1725  jetPerpConeK0list = new TList();
1726  jetPerpConeK0list->SetOwner(kFALSE);
1727  jetPerpRecCutslist = new TList();
1728  jetPerpRecCutslist->SetOwner(kFALSE);
1729  jetPerpConeK0Emblist = new TList();
1730  jetPerpConeK0Emblist->SetOwner(kFALSE);
1731  jetPerpConeLalist = new TList();
1732  jetPerpConeLalist->SetOwner(kFALSE);
1733  jetPerpConeLaEmblist = new TList();
1734  jetPerpConeLaEmblist->SetOwner(kFALSE);
1735  jetPerpConeALalist = new TList();
1736  jetPerpConeALalist->SetOwner(kFALSE);
1737  jetPerpConeALaEmblist = new TList();
1738  jetPerpConeALaEmblist->SetOwner(kFALSE);
1739  jetMedianConeK0list = new TList();
1740  jetMedianConeK0list->SetOwner(kFALSE);
1741  jetMedianConeLalist = new TList();
1742  jetMedianConeLalist->SetOwner(kFALSE);
1743  jetMedianConeALalist = new TList();
1744  jetMedianConeALalist->SetOwner(kFALSE);
1745  jetMedianRecCutslist = new TList();
1746  jetMedianRecCutslist->SetOwner(kFALSE);
1747  fListK0sRC = new TList();
1748  fListK0sRC->SetOwner(kFALSE);
1749  fListLaRC = new TList();
1750  fListLaRC->SetOwner(kFALSE);
1751  fListALaRC = new TList();
1752  fListALaRC->SetOwner(kFALSE);
1753  fTracksRecCutsRC = new TList();
1754  fTracksRecCutsRC->SetOwner(kFALSE);
1755  fTracksRecBckgCuts = new TList();
1756  fTracksRecBckgCuts->SetOwner(kFALSE);
1757  fTracksRecCuts = new TList();
1758  fTracksRecCuts->SetOwner(kFALSE); //objects in TList wont be deleted when TList is deleted
1759  fTracksGen = new TList();
1760  fTracksGen->SetOwner(kFALSE);
1761  fTracksPerpCone = new TList();
1762  fTracksPerpCone->SetOwner(kFALSE);
1763  fJetsRecCuts = new TList();
1764  fJetsRecCuts->SetOwner(kFALSE);
1765  fJetsGen = new TList();
1766  fJetsGen->SetOwner(kFALSE);
1767  fJetsEmbedded = new TList();
1768  fJetsEmbedded->SetOwner(kFALSE);
1769  fBckgJetsRec = new TList();
1770  fBckgJetsRec->SetOwner(kFALSE);
1771  fListK0s = new TList();
1772  fListK0s->SetOwner(kFALSE);
1773  fListK0sMC = new TList();
1774  fListK0sMC->SetOwner(kFALSE);
1775  fListLa = new TList();
1776  fListLa->SetOwner(kFALSE);
1777  fListLaMC = new TList();
1778  fListLaMC->SetOwner(kFALSE);
1779  fListALa = new TList();
1780  fListALa->SetOwner(kFALSE);
1781  fListALaMC = new TList();
1782  fListALaMC->SetOwner(kFALSE);
1783  fListK0sStandard = new TList();
1784  fListK0sStandard->SetOwner(kFALSE);
1785  fListLaStandard = new TList();
1786  fListLaStandard->SetOwner(kFALSE);
1787  fListALaStandard = new TList();
1788  fListALaStandard->SetOwner(kFALSE);
1789  fListFeeddownLaCand = new TList(); //feeddown Lambda candidates
1790  fListFeeddownLaCand->SetOwner(kFALSE);
1791  fListFeeddownALaCand = new TList(); //feeddown Antilambda candidates
1792  fListFeeddownALaCand->SetOwner(kFALSE);
1793  jetConeFDLalist = new TList();
1794  jetConeFDLalist->SetOwner(kFALSE); //feeddown Lambda candidates in jet cone
1795  jetConeFDALalist = new TList();
1796  jetConeFDALalist->SetOwner(kFALSE); //feeddown Antilambda candidates in jet cone
1797  fListMCgenK0s = new TList(); //MC generated K0s
1798  fListMCgenK0s->SetOwner(kFALSE);
1799  fListMCgenLa = new TList(); //MC generated Lambdas
1800  fListMCgenLa->SetOwner(kFALSE);
1801  fListMCgenALa = new TList(); //MC generated Antilambdas
1802  fListMCgenALa->SetOwner(kFALSE);
1803  fListMCgenK0sCone = new TList();
1804  fListMCgenK0sCone->SetOwner(kFALSE);
1805  fListMCgenLaCone = new TList();
1806  fListMCgenLaCone->SetOwner(kFALSE);
1807  fListMCgenALaCone = new TList();
1808  fListMCgenALaCone->SetOwner(kFALSE);
1809 
1810  // Create histograms / output container
1811 
1812  fCommonHistList = new TList();
1813  fCommonHistList->SetOwner();
1814 
1815  Bool_t oldStatus = TH1::AddDirectoryStatus();
1816  TH1::AddDirectory(kFALSE);//By default (fAddDirectory = kTRUE), histograms are automatically added to the list of objects in memory
1817 
1818  // histograms inherited from AliAnalysisTaskFragmentationFunction
1819 
1820  fh1EvtSelection = new TH1F("fh1EvtSelection", "Event Selection", 6, -0.5, 5.5);
1821  fh1EvtSelection->GetXaxis()->SetBinLabel(1,"ACCEPTED");
1822  fh1EvtSelection->GetXaxis()->SetBinLabel(2,"event trigger selection: rejected");
1823  fh1EvtSelection->GetXaxis()->SetBinLabel(3,"event class: rejected");
1824  fh1EvtSelection->GetXaxis()->SetBinLabel(4,"vertex Ncontr: rejected");
1825  fh1EvtSelection->GetXaxis()->SetBinLabel(5,"vertex z: rejected");
1826  fh1EvtSelection->GetXaxis()->SetBinLabel(6,"vertex type: rejected");
1827 
1828 
1829  fh1EvtCent = new TH1F("fh1EvtCent","centrality",100,0.,100.);
1830  fh1VertexNContributors = new TH1F("fh1VertexNContributors", "Vertex N contributors", 11,-.5, 10.5);
1831  fh1VertexZ = new TH1F("fh1VertexZ", "Vertex z distribution", 30, -15., 15.);
1832  fh1Xsec = new TProfile("fh1Xsec","xsec from pyxsec.root",1,0,1);
1833  fh1Xsec->GetXaxis()->SetBinLabel(1,"<#sigma>");
1834  fh1Trials = new TH1F("fh1Trials","trials from pyxsec.root",1,0,1);
1835  fh1Trials->GetXaxis()->SetBinLabel(1,"#sum{ntrials}");
1836  fh1PtHard = new TH1F("fh1PtHard","PYTHIA Pt hard;p_{T,hard}",350,-.5,349.5);
1837  fh1PtHardTrials = new TH1F("fh1PtHardTrials","PYTHIA Pt hard weight with trials;p_{T,hard}",350,-.5,349.5);
1838  fh1nRecJetsCuts = new TH1F("fh1nRecJetsCuts","reconstructed jets per event",100,-0.5,99.5);
1839 
1840  // histograms JetChem task
1841 
1842  fh1EvtAllCent = new TH1F("fh1EvtAllCent","before centrality selection",100,0.,100.);
1843  fh1Evt = new TH1F("fh1Evt", "All events runned over", 3, 0.,1.);
1844  fh1EP2 = new TH1F("fh1EP2","2nd order harmonic event plane distribution ESD events",200,-2.,2.);
1845  fh1EP3 = new TH1F("fh1EP3","3rd order harmonic event plane distribution ESD events",200,-2.,2.);
1846  fh1EvtMult = new TH1F("fh1EvtMult","multiplicity",240,0.,240.);
1847  fh1K0Mult = new TH1F("fh1K0Mult","K0 multiplicity",100,0.,100.);//500. all
1848  fh1dPhiJetK0 = new TH1F("fh1dPhiJetK0","",64,-1,5.4);
1849  fh1LaMult = new TH1F("fh1LaMult","La multiplicity",100,0.,100.);
1850  fh1dPhiJetLa = new TH1F("fh1dPhiJetLa","",64,-1,5.4);
1851  fh1ALaMult = new TH1F("fh1ALaMult","ALa multiplicity",100,0.,100.);
1852  fh1dPhiJetALa = new TH1F("fh1dPhiJetALa","",64,-1,5.4);
1853  fh1JetEta = new TH1F("fh1JetEta","#eta distribution of all jets",40,-2.,2.);
1854  fh1JetPhi = new TH1F("fh1JetPhi","#phi distribution of all jets",63,0.,6.3);
1855  fh2JetEtaPhi = new TH2F("fh2JetEtaPhi","#eta and #phi distribution of all jets",400,-2.,2.,63,0.,6.3);
1856 
1857  if(fDebug>2)std::cout<<"fBranchEmbeddedJets.Length(): "<<fBranchEmbeddedJets.Length()<<std::endl;
1858  if(fDebug>2)std::cout<<"fBranchGenJets.Length(): "<<fBranchGenJets.Length()<<std::endl;
1859 
1860 
1861  //embedding
1862  fh1nEmbeddedJets = new TH1F("fh1nEmbeddedJets","Number of embedded jets",10,-0.5,9.5);
1863  fh1nGenJets = new TH1F("fh1nGenJets","generated jets per event",10,-0.5,9.5);
1864  fh2TracksPerpCone = new TH2F("fh2TracksPerpCone","Charged tracks in 2 perp. cones;#it{p^{ch,jet}}_{T} (GeV/#it{c});#it{p^{ch}}_{T} (GeV/#it{c})",19,5.,100.,120,0.,12.);
1865  fh1IndexEmbedded = new TH1F("fh1IndexEmbedded","",11,-1.,10.);
1866  fh1EmbeddedJetPhiDelta = new TH1F("fh1EmbeddedJetPhiDelta","Delta: 2nd order harmonic Eventplane - jetphi",120,-6.,6.);
1867 
1868  fh1PtEmbBeforeMatch = new TH1F("fh1PtEmbBeforeMatch","Pt spectrum of jets before JetMatching",19,5.,100.);
1869  fh1PtEmbExtraOnly = new TH1F("fh1PtEmbExtraOnly","Pt spectrum of jets from ExtraOnly tracks (embedded truth)",19,5.,100.);
1870 
1871  fh1PtEmbReject = new TH1F("fh1PtEmbReject","Pt spectrum of jets rejected by JetMatching cuts",19,5.,100.);
1872  fh2PtEtaEmbReject = new TH2F("fh2PtEtaEmbReject","Pt #eta distribution of jets rejected by JetMatching cuts #eta; #it{p}_{T}",19,5.,100.,200,-1.,1.);
1873  fh1PtEmbAfterMatch = new TH1F("fh1PtEmbAfterMatch","Pt spectrum of jets after JetMatching cuts and with leading constituent cut",19,5.,100.);
1874 
1875  fh1FractionPtEmbedded = new TH1F("fh1FractionPtEmbedded","",110,0.,1.1);
1876  fh1DeltaREmbedded = new TH1F("fh1DeltaREmbedded","",50,0.,0.5);
1877 
1878  fh1IndexEmbeddedMC = new TH1F("fh1IndexEmbeddedMC","",11,-1.,10.);
1879  fh1FractionPtEmbeddedMC = new TH1F("fh1FractionPtEmbeddedMC","",110,0,1.1);
1880  fh2FractionPtVsEmbeddedJetPtMC = new TH2F("fh2FractionPtVsEmbeddedJetPtMC","",250,0,250,110,0,1.1);
1881  fh1DeltaREmbeddedMC = new TH1F("fh1DeltaREmbeddedMC","",50,0,0.5);
1882  fh1JetPtEmbGenAfterMatch = new TH1F("fh1JetPtEmbGenAfterMatch","Pt spectrum of jets after JetMatching cuts and with leading constituent cut",19,5.,100.);
1883 
1884  //
1885 
1886 
1887  fh1PerpCone = new TH1F("fh1PerpCone","Number of perp. cones for charged tracks in event",2.,0.5,1.5);
1888  fh1V0PtCandidate = new TH1F("fh1V0PtCandidate","p_{T} distribution of all v0s candidates of PYTHIA",200,0.,200.);
1889  fh1IMK0Cone = new TH1F("fh1IMK0Cone","p_{T} distribution of all jets containing K0s candidates",19,5.,100.);
1890  fh1IMLaCone = new TH1F("fh1IMLaCone","p_{T} distribution of all jets containing #Lambda candidates",19,5.,100.);
1891  fh1IMALaCone = new TH1F("fh1IMALaCone","p_{T} distribution of all jets containing #bar{#Lambda} candidates",19,5.,100.);
1892  fh1IMK0EmbCone = new TH1F("fh1IMK0EmbCone","p_{T} distribution of all embedded and selected jets containing K0s candidates",19,5.,100.);
1893  fh1IMLaEmbCone = new TH1F("fh1IMLaEmbCone","p_{T} distribution of all embedded and selected jets containing #Lambda candidates",19,5.,100.);
1894  fh1IMALaEmbCone = new TH1F("fh1IMALaEmbCone","p_{T} distribution of all embedded and selected jets containing #bar{#Lambda} candidates",19,5.,100.);
1895  fh2FFJetTrackEta = new TH2F("fh2FFJetTrackEta","charged track eta distr. in jet cone",200,-1.,1.,40,0.,200.);
1896  //fh1trackPosNCls = new TH1F("fh1trackPosNCls","NTPC clusters positive daughters",10,0.,100.);
1897  //fh1trackNegNCls = new TH1F("fh1trackNegNCls","NTPC clusters negative daughters",10,0.,100.);
1898  fh1trackPosEta = new TH1F("fh1trackPosEta","eta positive daughters",100,-2.,2.);
1899  fh1trackNegEta = new TH1F("fh1trackNegEta","eta negative daughters",100,-2.,2.);
1900  fh1V0Eta = new TH1F("fh1V0Eta","V0 eta",60,-1.5,1.5);
1901  //fh1V0totMom = new TH1F("fh1V0totMom","V0 tot mom",100,0.,20.);
1902  fh1CosPointAngle = new TH1F("fh1CosPointAngle", "Cosine of V0's pointing angle",50,0.99,1.0);
1903  fh1DecayLengthV0 = new TH1F("fh1DecayLengthV0", "V0s decay Length;decay length(cm)",1200,0.,120.);
1904  fh2ProperLifetimeK0sVsPtBeforeCut = new TH2F("fh2ProperLifetimeK0sVsPtBeforeCut"," K0s ProperLifetime vs Pt; p_{T} (GeV/#it{c})",150,0.,15.,250,0.,250.);
1905  fh2ProperLifetimeK0sVsPtAfterCut = new TH2F("fh2ProperLifetimeK0sVsPtAfterCut"," K0s ProperLifetime vs Pt; p_{T} (GeV/#it{c})",150,0.,15.,250,0.,250.);
1906  fh1V0Radius = new TH1F("fh1V0Radius", "V0s Radius;Radius(cm)",200,0.,40.);
1907  fh1DcaV0Daughters = new TH1F("fh1DcaV0Daughters", "DCA between daughters;dca(cm)",200,0.,2.);
1908  fh1DcaPosToPrimVertex = new TH1F("fh1DcaPosToPrimVertex", "Positive V0 daughter;dca(cm)",100,0.,10.);
1909  fh1DcaNegToPrimVertex = new TH1F("fh1DcaNegToPrimVertex", "Negative V0 daughter;dca(cm)",100,0.,10.);
1910  fh2ArmenterosBeforeCuts = new TH2F("fh2ArmenterosBeforeCuts","Armenteros Podolanski Plot for K0s Candidates;#alpha;(p^{arm})_{T}/(GeV/#it{c})",200,-1.2,1.2,350,0.,0.35);
1911  fh2ArmenterosAfterCuts = new TH2F("fh2ArmenterosAfterCuts","Armenteros Podolanski Plot for K0s Candidates;#alpha;(p^{arm})_{T}/(GeV/#it{c});",200,-1.2,1.2,350,0.,0.35);
1912  fh2BBLaPos = new TH2F("fh2BBLaPos","PID of the positive daughter of La candidates; P (GeV); -dE/dx (keV/cm ?)",100,0,10,200,0,200);
1913  fh2BBLaNeg = new TH2F("fh2BBLaNeg","PID of the negative daughter of La candidates; P (GeV); -dE/dx (keV/cm ?)",100,0,10,200,0,200);
1914  fh1PosDaughterCharge = new TH1F("fh1PosDaughterCharge","charge of V0 positive daughters; V0 daughters",3,-2.,2.);
1915  fh1NegDaughterCharge = new TH1F("fh1NegDaughterCharge","charge of V0 negative daughters; V0 daughters",3,-2.,2.);
1916  fh1PtMCK0s = new TH1F("fh1PtMCK0s","Pt of MC rec K0s; #it{p}_{T} (GeV/#it{c})",200,0.,20.);
1917  fh1PtMCLa = new TH1F("fh1PtMCLa","Pt of MC rec La; #it{p}_{T} (GeV/#it{c})",200,0.,20.);
1918  fh1PtMCALa = new TH1F("fh1PtMCALa","Pt of MC rec ALa; #it{p}_{T} (GeV/#it{c})",200,0.,20.);
1919  fh1EtaK0s = new TH1F("fh1EtaK0s","K^{0}_{s} entries ;#eta",200,-1.,1.);
1920  fh1EtaLa = new TH1F("fh1EtaLa","#Lambda entries ;#eta",200,-1.,1.);
1921  fh1EtaALa = new TH1F("fh1EtaALa","#bar{#Lambda} entries ;#eta",200,-1.,1.);
1922 
1923  //histos for normalisation of MCC, RC, OC and NJ
1924 
1925  fh1RC = new TH1F("fh1RC"," # random cones used",1,0.5,1.5);
1926  fh1RCBiasK0 = new TH1F("fh1RCBiasK0"," # random cones with K0s trigger particle",1,0.5,1.5);
1927  fh1RCBiasLa = new TH1F("fh1RCBiasLa"," # random cones with La trigger particle",1,0.5,1.5);
1928  fh1RCBiasALa = new TH1F("fh1RCBiasALa"," # random cones with ALa trigger particle",1,0.5,1.5);
1929  fh1MCC = new TH1F("fh1MCC","# median cluster cones used",1,0.5,1.5);
1930  fh1OC = new TH1F("fh1OC","# outside cones used, number of jet events",1,0.5,1.5);
1931  fh1NJ = new TH1F("fh1NJ","# non-jet events used",1,0.5,1.5);
1932  fh1NJEmbEvt = new TH1F("fh1NJEmbEvt","# Embedding non-jet events used",1,0.5,1.5);
1933  fh1BckgJets = new TH1F("fh1BckgJets","Jet pT distribution of bckg jets (anti-kt data jets) used in Embedding study",19,5.,100.);
1934  fh1BckgJetsPtBias = new TH1F("fh1BckgJetsPtBias","Jet pT distribution after JetPtBias of bckg jets (anti-kt data jets) used in Embedding study",19,5.,100.);
1935 
1936 
1937  Int_t binsInvMassEtaTrackPtK0s[3] = {200, 200, 120};//eta,invM,trackPt
1938  Double_t xminInvMassEtaTrackPtK0s[3] = {-1.,0.3,0.};
1939  Double_t xmaxInvMassEtaTrackPtK0s[3] = {1.,0.7,12.};
1940 
1941  fhnInvMassEtaTrackPtK0s = new THnSparseF("fhnInvMassEtaTrackPtK0s","#eta; K0s invM (GeV/{#it{c}}^{2}); #it{p}_{T} (GeV/#it{c})",3,binsInvMassEtaTrackPtK0s,xminInvMassEtaTrackPtK0s,xmaxInvMassEtaTrackPtK0s);
1942 
1943  Int_t binsInvMassEtaTrackPtLa[3] = {200, 200, 120};//eta,invM,trackPt
1944  Double_t xminInvMassEtaTrackPtLa[3] = {-1.,1.05,0.};
1945  Double_t xmaxInvMassEtaTrackPtLa[3] = {1.,1.25,12.};
1946 
1947  fhnInvMassEtaTrackPtLa = new THnSparseF("fhnInvMassEtaTrackPtLa","#eta; #Lambda invM (GeV/{#it{c}}^{2}); #it{p}_{T} (GeV/#it{c})",3,binsInvMassEtaTrackPtLa,xminInvMassEtaTrackPtLa,xmaxInvMassEtaTrackPtLa);
1948 
1949  Int_t binsInvMassEtaTrackPtALa[3] = {200, 200, 120};//eta,invM,trackPt
1950  Double_t xminInvMassEtaTrackPtALa[3] = {-1.,1.05,0.};
1951  Double_t xmaxInvMassEtaTrackPtALa[3] = {1.,1.25,12.};
1952 
1953  fhnInvMassEtaTrackPtALa = new THnSparseF("fhnInvMassEtaTrackPtALa","#eta; #bar{#Lambda} invM (GeV/{#it{c}}^{2}); #it{p}_{T} (GeV/#it{c})",3,binsInvMassEtaTrackPtALa,xminInvMassEtaTrackPtALa,xmaxInvMassEtaTrackPtALa);
1954 
1955  Int_t binsK0sPC[4] = {19, 200, 120, 200};
1956  Double_t xminK0sPC[4] = {5.,0.3, 0., -1.};
1957  Double_t xmaxK0sPC[4] = {100.,0.7, 12., 1.};
1958  fhnK0sPC = new THnSparseF("fhnK0sPC","two perp cones;jet pT; K0s invM; particle pT; particle #eta",4,binsK0sPC,xminK0sPC,xmaxK0sPC);
1959 
1960  Int_t binsLaPC[4] = {19, 200, 120, 200};
1961  Double_t xminLaPC[4] = {5.,1.05, 0., -1.};
1962  Double_t xmaxLaPC[4] = {100.,1.25, 12., 1.};
1963  fhnLaPC = new THnSparseF("fhnLaPC","two perp cones;jet pT; #Lambda invM; particle pT; particle #eta",4,binsLaPC,xminLaPC,xmaxLaPC);
1964 
1965  Int_t binsALaPC[4] = {19, 200, 120, 200};
1966  Double_t xminALaPC[4] = {5.,1.05, 0., -1.};
1967  Double_t xmaxALaPC[4] = {100.,1.25, 12., 1.};
1968  fhnALaPC = new THnSparseF("fhnALaPC","two perp cones;jet pT; #bar#Lambda invM; particle pT; particle #eta",4,binsALaPC,xminALaPC,xmaxALaPC);
1969 
1970  Int_t binsK0sEmbPC[4] = {19, 200, 120, 200};
1971  Double_t xminK0sEmbPC[4] = {5.,0.3, 0., -1.};
1972  Double_t xmaxK0sEmbPC[4] = {100.,0.7, 12., 1.};
1973  fhnK0sEmbPC = new THnSparseF("fhnK0sEmbPC","two perp cones;jet pT; K0s invM; particle pT; particle #eta",4,binsK0sEmbPC,xminK0sEmbPC,xmaxK0sEmbPC);
1974 
1975  Int_t binsLaEmbPC[4] = {19, 200, 120, 200};
1976  Double_t xminLaEmbPC[4] = {5.,1.05, 0., -1.};
1977  Double_t xmaxLaEmbPC[4] = {100.,1.25, 12., 1.};
1978  fhnLaEmbPC = new THnSparseF("fhnLaEmbPC","two perp cones;jet pT; #Lambda invM; particle pT; particle #eta",4,binsLaEmbPC,xminLaEmbPC,xmaxLaEmbPC);
1979 
1980  Int_t binsALaEmbPC[4] = {19, 200, 120, 200};
1981  Double_t xminALaEmbPC[4] = {5.,1.05, 0., -1.};
1982  Double_t xmaxALaEmbPC[4] = {100.,1.25, 12., 1.};
1983  fhnALaEmbPC = new THnSparseF("fhnALaEmbPC","two perp cones;jet pT; #bar#Lambda invM; particle pT; particle #eta",4,binsALaEmbPC,xminALaEmbPC,xmaxALaEmbPC);
1984 
1985  Int_t binsK0sMCC[3] = {200, 120, 200};
1986  Double_t xminK0sMCC[3] = {0.3, 0., -1.};
1987  Double_t xmaxK0sMCC[3] = {0.7, 12., 1.};
1988  fhnK0sMCC = new THnSparseF("fhnK0sMCC","two perp cones;jet pT; K0s invM; particle pT; particle #eta",3,binsK0sMCC,xminK0sMCC,xmaxK0sMCC);
1989 
1990  Int_t binsLaMCC[3] = {200, 120, 200};
1991  Double_t xminLaMCC[3] = {1.05, 0., -1.};
1992  Double_t xmaxLaMCC[3] = {1.25, 12., 1.};
1993  fhnLaMCC = new THnSparseF("fhnLaMCC","two perp cones;jet pT; #Lambda invM; particle pT; particle #eta",3,binsLaMCC,xminLaMCC,xmaxLaMCC);
1994 
1995  Int_t binsALaMCC[3] = {200, 120, 200};
1996  Double_t xminALaMCC[3] = {1.05, 0., -1.};
1997  Double_t xmaxALaMCC[3] = {1.25, 12., 1.};
1998  fhnALaMCC = new THnSparseF("fhnALaMCC","two perp cones;jet pT; #bara#Lambda invM; particle pT; particle #eta",3,binsALaMCC,xminALaMCC,xmaxALaMCC);
1999 
2000  Int_t binsK0sRC[3] = {200, 120, 200};
2001  Double_t xminK0sRC[3] = {0.3, 0., -1.};
2002  Double_t xmaxK0sRC[3] = {0.7, 12., 1.};
2003  fhnK0sRC = new THnSparseF("fhnK0sRC","two perp cones;jet pT; K0s invM; particle pT; particle #eta",3,binsK0sRC,xminK0sRC,xmaxK0sRC);
2004 
2005  Int_t binsLaRC[3] = {200, 120, 200};
2006  Double_t xminLaRC[3] = {1.05, 0., -1.};
2007  Double_t xmaxLaRC[3] = {1.25, 12., 1.};
2008  fhnLaRC = new THnSparseF("fhnLaRC","two perp cones;jet pT; #Lambda invM; particle pT; particle #eta",3,binsLaRC,xminLaRC,xmaxLaRC);
2009 
2010  Int_t binsALaRC[3] = {200, 120, 200};
2011  Double_t xminALaRC[3] = {1.05, 0., -1.};
2012  Double_t xmaxALaRC[3] = {1.25, 12., 1.};
2013  fhnALaRC = new THnSparseF("fhnALaRC","two perp cones;jet pT; #bara#Lambda invM; particle pT; particle #eta",3,binsALaRC,xminALaRC,xmaxALaRC);
2014 
2015  Int_t binsK0sRCBias[3] = {200, 120, 200};
2016  Double_t xminK0sRCBias[3] = {0.3, 0., -1.};
2017  Double_t xmaxK0sRCBias[3] = {0.7, 12., 1.};
2018  fhnK0sRCBias = new THnSparseF("fhnK0sRCBias","two perp cones;jet pT; K0s invM; particle pT; particle #eta",3,binsK0sRCBias,xminK0sRCBias,xmaxK0sRCBias);
2019 
2020  Int_t binsLaRCBias[3] = {200, 120, 200};
2021  Double_t xminLaRCBias[3] = {1.05, 0., -1.};
2022  Double_t xmaxLaRCBias[3] = {1.25, 12., 1.};
2023  fhnLaRCBias = new THnSparseF("fhnLaRCBias","two perp cones;jet pT; #Lambda invM; particle pT; particle #eta",3,binsLaRCBias,xminLaRCBias,xmaxLaRCBias);
2024 
2025  Int_t binsALaRCBias[3] = {200, 120, 200};
2026  Double_t xminALaRCBias[3] = {1.05, 0., -1.};
2027  Double_t xmaxALaRCBias[3] = {1.25, 12., 1.};
2028  fhnALaRCBias = new THnSparseF("fhnALaRCBias","two perp cones;jet pT; #bara#Lambda invM; particle pT; particle #eta",3,binsALaRCBias,xminALaRCBias,xmaxALaRCBias);
2029 
2030  Int_t binsK0sOC[3] = {200, 120, 200};
2031  Double_t xminK0sOC[3] = {0.3, 0., -1.};
2032  Double_t xmaxK0sOC[3] = {0.7, 12., 1.};
2033  fhnK0sOC = new THnSparseF("fhnK0sOC","two perp cones;jet pT; K0s invM; particle pT; particle #eta",3,binsK0sOC,xminK0sOC,xmaxK0sOC);
2034 
2035  Int_t binsLaOC[3] = {200, 120, 200};
2036  Double_t xminLaOC[3] = {1.05, 0., -1.};
2037  Double_t xmaxLaOC[3] = {1.25, 12., 1.};
2038  fhnLaOC = new THnSparseF("fhnLaOC","two perp cones;jet pT; #Lambda invM; particle pT; particle #eta",3,binsLaOC,xminLaOC,xmaxLaOC);
2039 
2040  Int_t binsALaOC[3] = {200, 120, 200};
2041  Double_t xminALaOC[3] = {1.05, 0., -1.};
2042  Double_t xmaxALaOC[3] = {1.25, 12., 1.};
2043 
2044  fhnALaOC = new THnSparseF("fhnALaOC","two perp cones;jet pT; #bara#Lambda invM; particle pT; particle #eta",3,binsALaOC,xminALaOC,xmaxALaOC);
2045 
2046  fh1AreaExcluded = new TH1F("fh1AreaExcluded","area excluded for selected jets in event acceptance",50,0.,1.);
2047 
2048  fh1MedianEta = new TH1F("fh1MedianEta","Median cluster axis ;#eta",200,-1.,1.);
2049  fh1JetPtMedian = new TH1F("fh1JetPtMedian"," (selected) jet it{p}_{T} distribution for MCC method; #GeV/it{c}",19,5.,100.);
2050 
2051  fh1TrackMultCone = new TH1F("fh1TrackMultCone","track multiplicity in jet cone; number of tracks",20,0.,50.);
2052 
2053  fh2TrackMultCone = new TH2F("fh2TrackMultCone","track multiplicity in jet cone vs. jet momentum; number of tracks; jet it{p}_{T} (GeV/it{c})",50,0.,50.,19,5.,100.);
2054 
2055  Int_t binsNJK0[3] = {200, 120, 200};
2056  Double_t xminNJK0[3] = {0.3, 0., -1.};
2057  Double_t xmaxNJK0[3] = {0.7, 12., 1.};
2058  fhnNJK0 = new THnSparseF("fhnNJK0","K0s candidates in events wo selected jets;",3,binsNJK0,xminNJK0,xmaxNJK0);
2059 
2060  Int_t binsNJLa[3] = {200, 120, 200};
2061  Double_t xminNJLa[3] = {1.05, 0., -1.};
2062  Double_t xmaxNJLa[3] = {1.25, 12., 1.};
2063  fhnNJLa = new THnSparseF("fhnNJLa","La candidates in events wo selected jets; ",3,binsNJLa,xminNJLa,xmaxNJLa);
2064 
2065  Int_t binsNJALa[3] = {200, 120, 200};
2066  Double_t xminNJALa[3] = {1.05, 0., -1.};
2067  Double_t xmaxNJALa[3] = {1.25, 12., 1.};
2068  fhnNJALa = new THnSparseF("fhnNJALa","ALa candidates in events wo selected jets; ",3,binsNJALa,xminNJALa,xmaxNJALa);
2069 
2070  //fh2ChTracksNJ = new TH2F("fh2ChTracksNJ","charged tracks in non-jet events; it{p}_{T} (GeV/it{c};#eta)",120,0.,12.,200,-1.,1.);
2071 
2072  //fh2ChTracksRC = new TH2F("fh2ChTracksRC","charged tracks in random cones; it{p}_{T} (GeV/it{c};#eta)",120,0.,12.,200,-1.,1.);
2073  //fh2ChTracksOC = new TH2F("fh2ChTracksOC","charged tracks outside cones; it{p}_{T} (GeV/it{c};#eta)",120,0.,12.,200,-1.,1.);
2074 
2075  //fh2ChTracksMCC = new TH2F("fh2ChTracksMCC","charged tracks in non-jet events; it{p}_{T} (GeV/it{c};#eta)",120,0.,12.,200,-1.,1.);
2076 
2077  //fh2ChTracksPC = new TH2F("fh2ChTracksPC","charged tracks in perpendicular cones; it{p}_{T} (GeV/it{c};#eta)",120,0.,12.,200,-1.,1.);
2078 
2079  fFFHistosRecCuts = new AliFragFuncHistos("RecCuts", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax,
2080  fFFNBinsPt, fFFPtMin, fFFPtMax,
2081  fFFNBinsXi, fFFXiMin, fFFXiMax,
2082  fFFNBinsZ , fFFZMin , fFFZMax);
2083 
2084  fV0QAK0 = new AliFragFuncQATrackHistos("V0QAK0",fQATrackNBinsPt, fQATrackPtMin, fQATrackPtMax,
2085  fQATrackNBinsEta, fQATrackEtaMin, fQATrackEtaMax,
2086  fQATrackNBinsPhi, fQATrackPhiMin, fQATrackPhiMax,
2087  fQATrackHighPtThreshold);
2088 
2089  fFFHistosRecCutsK0Evt = new AliFragFuncHistos("RecCutsK0Evt", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax,
2090  fFFNBinsPt, fFFPtMin, fFFPtMax,
2091  fFFNBinsXi, fFFXiMin, fFFXiMax,
2092  fFFNBinsZ , fFFZMin , fFFZMax);
2093 
2094  fFFHistosGen = new AliFragFuncHistos("Gen", fFFNBinsJetPt, fFFJetPtMin, fFFJetPtMax,
2095  fFFNBinsPt, fFFPtMin, fFFPtMax,
2096  fFFNBinsXi, fFFXiMin, fFFXiMax,
2097  fFFNBinsZ , fFFZMin , fFFZMax);
2098 
2099  //***************
2100  // MC histograms
2101  //***************
2102 
2103  //fh2MCgenK0Cone = new TH2F("fh2MCgenK0Cone", "MC gen {K^{0}}^{s} #it{p}_{T} in cone around rec jet axis versus jet #it{p}_{T}; jet #it{p}_{T}",19,5.,100.,200,0.,20.);
2104  //fh2MCgenLaCone = new TH2F("fh2MCgenLaCone", "MC gen #Lambda #it{p}_{T} in cone around rec jet axis versus jet #it{p}_{T} ; jet #it{p}_{T}",19,5.,100.,200,0.,20.);
2105  //fh2MCgenALaCone = new TH2F("fh2MCgenALaCone", "MC gen #Antilambda #it{p}_{T} in cone around rec jet axis versus jet #it{p}_{T}; jet #it{p}_{T}",19,5.,100.,200,0.,20.);
2106 
2107  Int_t binsMCgenK0Cone[4] = {19, 120, 200};
2108  Double_t xminMCgenK0Cone[4] = {5., 0., -1.};
2109  Double_t xmaxMCgenK0Cone[4] = {100., 12., 1.};
2110  fhnMCgenK0Cone = new THnSparseF("fhnMCgenK0Cone", "MC gen {K^{0}}^{s} #it{p}_{T} in cone around jet axis",3,binsMCgenK0Cone,xminMCgenK0Cone,xmaxMCgenK0Cone);
2111 
2112 
2113  Int_t binsMCgenLaCone[4] = {19, 120, 200};
2114  Double_t xminMCgenLaCone[4] = {5., 0., -1.};
2115  Double_t xmaxMCgenLaCone[4] = {100., 12., 1.};
2116  fhnMCgenLaCone = new THnSparseF("fhnMCgenLaCone", "MC gen #Lambda #it{p}_{T} in cone around jet axis",3,binsMCgenLaCone,xminMCgenLaCone,xmaxMCgenLaCone);
2117 
2118 
2119  //fh2MCgenK0Cone->GetYaxis()->SetTitle("MC gen K^{0}}^{s} #it{p}_{T}");
2120  //fh2MCgenLaCone->GetYaxis()->SetTitle("MC gen #Lambda #it{p}_{T}");
2121  //fh2MCgenALaCone->GetYaxis()->SetTitle("MC gen #Antilambda #it{p}_{T}");
2122 
2123  //fh2MCEtagenK0Cone = new TH2F("fh2MCEtagenK0Cone","MC gen {K^{0}}^{s} #it{p}_{T} #eta distribution in jet cone;#eta",19,5.,100.,200,-1.,1.);
2124  //fh2MCEtagenLaCone = new TH2F("fh2MCEtagenLaCone","MC gen #Lambda #it{p}_{T} #eta distribution in jet cone;#eta",19,5.,100.,200,-1.,1.);
2125  //fh2MCEtagenALaCone = new TH2F("fh2MCEtagenALaCone","MC gen #Antilambda #it{p}_{T} #eta distribution in jet cone;#eta",19,5.,100.,200,-1.,1.);
2126 
2127  fh1IMK0ConeSmear = new TH1F("fh1IMK0ConeSmear","Smeared jet pt study for K0s-in-cone-jets; smeared jet #it{p}_{T}", 19,5.,100.);
2128  fh1IMLaConeSmear = new TH1F("fh1IMLaConeSmear","Smeared jet pt study for La-in-cone-jets; smeared jet #it{p}_{T}", 19,5.,100.);
2129  fh1IMALaConeSmear = new TH1F("fh1IMALaConeSmear","Smeared jet pt study for ALa-in-cone-jets; smeared jet #it{p}_{T}", 19,5.,100.);
2130 
2131  fh2MC2K0Cone = new TH2F("fh2MC2K0Cone", "MC true {K^{0}}^{s} #it{p}_{T} in cone around jet axis versus jet #it{p}_{T}; jet #it{p}_{T}",19,5.,100.,120,0.,12.);
2132  fh2MC2LaCone = new TH2F("fh2MC2LaCone", "MC true {#Lambda #it{p}_{T} in cone around jet axis versus jet #it{p}_{T}; jet #it{p}_{T}",19,5.,100.,120,0.,12.);
2133  fh2MC2ALaCone = new TH2F("fh2MC2ALaCone", "MC true {#bar{#Lambda} #it{p}_{T} in cone around jet axis versus jet #it{p}_{T}; jet #it{p}_{T}",19,5.,100.,120,0.,12.);
2134 
2135  /*
2136  fh2CorrHijingLaProton = new TH2F("fh2CorrHijingLaProton","#Lambda - proton pT correlation, Hijing;#it{p^{#Lambda}}_{T} (GeV/c);#it{p^{proton}}_{T} (GeV/c)",120,0.,12.,120,0.,12.);
2137  fh2CorrInjectLaProton = new TH2F("fh2CorrInjectLaProton","#Lambda - proton pT correlation, Injected;#it{p^{#Lambda}}_{T} (GeV/c);#it{p^{proton}}_{T} (GeV/c)",120,0.,12.,120,0.,12.);
2138  fh2CorrHijingALaAProton = new TH2F("fh2CorrHijingALaAProton","#bar{#Lambda} - proton pT correlation, Hijing;#it{p^{#Lambda}}_{T} (GeV/c);#it{p^{#bar{proton}}}_{T} (GeV/c)",120,0.,12.,120,0.,12.);
2139  fh2CorrInjectALaAProton = new TH2F("fh2CorrInjectALaAProton","#bar{#Lambda} - proton pT correlation, Injected;#it{p^{#Lambda}}_{T} (GeV/c);#it{p^{#bar{proton}}}_{T} (GeV/c)",120,0.,12.,120,0.,12.);
2140  //12 new histograms: Cone, Incl, Lambda, Antilambda, Hijing, Injected:
2141 
2142  fh2MCEtaVsPtHijingLa = new TH2F("fh2MCEtaVsPtHijingLa","MC Hijing gen. #Lambda #eta; #it{p}_{T}",200,0.,20.,200,-1.,1.);
2143  fh2MCEtaVsPtInjectLa = new TH2F("fh2MCEtaVsPtInjectLa","MC injected gen. #Lambda #eta; #it{p}_{T}",200,0.,20.,200,-1.,1.);
2144  fh2MCEtaVsPtHijingALa = new TH2F("fh2MCEtaVsPtHijingALa","MC gen. Hijing #bar{#Lambda} #eta; #it{p}_{T}",200,0.,20.,200,-1.,1.);
2145  fh2MCEtaVsPtInjectALa = new TH2F("fh2MCEtaVsPtInjectALa","MC gen. injected #bar{#Lambda} #eta; #it{p}_{T}",200,0.,20.,200,-1.,1.);
2146 
2147  Int_t binsrecMCHijingLaIncl[3] = {200, 120, 200};
2148  Double_t xminrecMCHijingLaIncl[3] = {1.05, 0., -1.};
2149  Double_t xmaxrecMCHijingLaIncl[3] = {1.25, 12., 1.};
2150  fhnrecMCHijingLaIncl = new THnSparseF("fhnrecMCHijingLaIncl","La inv. mass; particle pT; particle #eta",3,binsrecMCHijingLaIncl,xminrecMCHijingLaIncl,xmaxrecMCHijingLaIncl);
2151 
2152  Int_t binsrecMCHijingLaCone[4] = {19, 200, 120, 200};
2153  Double_t xminrecMCHijingLaCone[4] = {5., 1.05, 0., -1.};
2154  Double_t xmaxrecMCHijingLaCone[4] = {100., 1.25, 12., 1.};
2155  fhnrecMCHijingLaCone = new THnSparseF("fhnrecMCHijingLaCone","La inv. mass; particle pT; particle #eta",4,binsrecMCHijingLaCone,xminrecMCHijingLaCone,xmaxrecMCHijingLaCone);
2156 
2157  Int_t binsrecMCHijingALaIncl[3] = {200, 120, 200};
2158  Double_t xminrecMCHijingALaIncl[3] = {1.05, 0., -1.};
2159  Double_t xmaxrecMCHijingALaIncl[3] = {1.25, 12., 1.};
2160  fhnrecMCHijingALaIncl = new THnSparseF("fhnrecMCHijingALaIncl","ALa inv. mass; particle pT; particle #eta",3,binsrecMCHijingALaIncl,xminrecMCHijingALaIncl,xmaxrecMCHijingALaIncl);
2161 
2162  Int_t binsrecMCHijingALaCone[4] = {19, 200, 120, 200};
2163  Double_t xminrecMCHijingALaCone[4] = {5., 1.05, 0., -1.};
2164  Double_t xmaxrecMCHijingALaCone[4] = {100., 1.25, 12., 1.};
2165  fhnrecMCHijingALaCone = new THnSparseF("fhnrecMCHijingALaCone","ALa inv. mass; particle pT; particle #eta",4,binsrecMCHijingALaCone,xminrecMCHijingALaCone,xmaxrecMCHijingALaCone);
2166 
2167  Int_t binsrecMCInjectLaIncl[3] = {200, 120, 200};
2168  Double_t xminrecMCInjectLaIncl[3] = {1.05, 0., -1.};
2169  Double_t xmaxrecMCInjectLaIncl[3] = {1.25, 12., 1.};
2170  fhnrecMCInjectLaIncl = new THnSparseF("fhnrecMCInjectLaIncl","La inv. mass; particle pT; particle #eta",3,binsrecMCInjectLaIncl,xminrecMCInjectLaIncl,xmaxrecMCInjectLaIncl);
2171 
2172  Int_t binsrecMCInjectLaCone[4] = {19, 200, 120, 200};
2173  Double_t xminrecMCInjectLaCone[4] = {5., 1.05, 0., -1.};
2174  Double_t xmaxrecMCInjectLaCone[4] = {100., 1.25, 12., 1.};
2175  fhnrecMCInjectLaCone = new THnSparseF("fhnrecMCInjectLaCone","La jet pT;inv. mass; particle pT; particle #eta",4,binsrecMCInjectLaCone,xminrecMCInjectLaCone,xmaxrecMCInjectLaCone);
2176 
2177  Int_t binsrecMCInjectALaIncl[3] = {200, 120, 200};
2178  Double_t xminrecMCInjectALaIncl[3] = {1.05, 0., -1.};
2179  Double_t xmaxrecMCInjectALaIncl[3] = {1.25, 12., 1.};
2180  fhnrecMCInjectALaIncl = new THnSparseF("fhnrecMCInjectALaIncl","ALa inv. mass; particle pT; particle #eta",3,binsrecMCInjectALaIncl,xminrecMCInjectALaIncl,xmaxrecMCInjectALaIncl);
2181 
2182  Int_t binsrecMCInjectALaCone[4] = {19, 200, 120, 200};
2183  Double_t xminrecMCInjectALaCone[4] = {5., 1.05, 0., -1.};
2184  Double_t xmaxrecMCInjectALaCone[4] = {100., 1.25, 12., 1.};
2185  fhnrecMCInjectALaCone = new THnSparseF("fhnrecMCInjectALaCone","ALa inv. mass; particle pT; particle #eta",4,binsrecMCInjectALaCone,xminrecMCInjectALaCone,xmaxrecMCInjectALaCone);
2186  */
2187 
2188  Int_t binsMCrecK0Cone[4] = {19, 200, 120, 200};
2189  Double_t xminMCrecK0Cone[4] = {5.,0.3, 0., -1.};
2190  Double_t xmaxMCrecK0Cone[4] = {100.,0.7, 12., 1.};
2191  fhnMCrecK0Cone = new THnSparseF("fhnMCrecK0Cone", "MC rec {K^{0}}^{s} #it{p}_{T} in cone around jet axis matching MC gen particle; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2};#it{p}_{T}",4,binsMCrecK0Cone,xminMCrecK0Cone,xmaxMCrecK0Cone);
2192 
2193  Int_t binsMCrecLaCone[4] = {19, 200, 120, 200};
2194  Double_t xminMCrecLaCone[4] = {5.,0.3, 0., -1.};
2195  Double_t xmaxMCrecLaCone[4] = {100.,0.7, 12., 1.};
2196  fhnMCrecLaCone = new THnSparseF("fhnMCrecLaCone", "MC rec {#Lambda #it{p}_{T} in cone around jet axis matching MC gen particle; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2};#it{p}_{T}",4,binsMCrecLaCone,xminMCrecLaCone,xmaxMCrecLaCone);
2197 
2198  Int_t binsMCrecALaCone[4] = {19, 200, 120, 200};
2199  Double_t xminMCrecALaCone[4] = {5.,0.3, 0., -1.};
2200  Double_t xmaxMCrecALaCone[4] = {100.,0.7, 12., 1.};
2201  fhnMCrecALaCone = new THnSparseF("fhnMCrecALaCone", "MC rec {#bar{#Lambda} #it{p}_{T} in cone around jet axis matching MC gen particle; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2};#it{p}_{T}",4,binsMCrecALaCone,xminMCrecALaCone,xmaxMCrecALaCone);
2202  /*
2203  Int_t binsMCrecK0ConeSmear[4] = {19, 200, 120, 200};
2204  Double_t xminMCrecK0ConeSmear[4] = {5.,0.3, 0., -1.};
2205  Double_t xmaxMCrecK0ConeSmear[4] = {100.,0.7, 12., 1.};
2206  fhnMCrecK0ConeSmear = new THnSparseF("fhnMCrecK0ConeSmear", "MC rec {K^{0}}^{s} #it{p}_{T} in cone around jet axis matching MC gen particle; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2};#it{p}_{T}",4,binsMCrecK0ConeSmear,xminMCrecK0ConeSmear,xmaxMCrecK0ConeSmear);
2207 
2208  Int_t binsMCrecLaConeSmear[4] = {19, 200, 120, 200};
2209  Double_t xminMCrecLaConeSmear[4] = {5.,1.05, 0., -1.};
2210  Double_t xmaxMCrecLaConeSmear[4] = {100.,1.25, 12., 1.};
2211  fhnMCrecLaConeSmear = new THnSparseF("fhnMCrecLaConeSmear", "MC rec {#Lambda #it{p}_{T} in cone around jet axis matching MC gen particle; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2};#it{p}_{T}",4,binsMCrecLaConeSmear,xminMCrecLaConeSmear,xmaxMCrecLaConeSmear);
2212 
2213  Int_t binsMCrecALaConeSmear[4] = {19, 200, 120, 200};
2214  Double_t xminMCrecALaConeSmear[4] = {5.,1.05, 0., -1.};
2215  Double_t xmaxMCrecALaConeSmear[4] = {100.,1.25, 12., 1.};
2216  fhnMCrecALaConeSmear = new THnSparseF("fhnMCrecALaConeSmear", "MC rec {#bar{#Lambda} #it{p}_{T} in cone around jet axis matching MC gen particle; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2};#it{p}_{T}",4,binsMCrecALaConeSmear,xminMCrecALaConeSmear,xmaxMCrecALaConeSmear); */
2217  /*
2218  Int_t binsK0sSecContinCone[3] = {19, 120, 200};
2219  Double_t xminK0sSecContinCone[3] = {5.,0., -1.};
2220  Double_t xmaxK0sSecContinCone[3] = {100.,12., 1.};
2221  fhnK0sSecContinCone = new THnSparseF("fhnK0sSecContinCone", "Secondary contamination {K^{0}}^{s} #it{p}_{T} in cone around jet axis; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2};#it{p}_{T}",3,binsK0sSecContinCone,xminK0sSecContinCone,xmaxK0sSecContinCone);
2222 
2223  Int_t binsLaSecContinCone[3] = {19, 120, 200};
2224  Double_t xminLaSecContinCone[3] = {5.,0., -1.};
2225  Double_t xmaxLaSecContinCone[3] = {100.,12., 1.};
2226  fhnLaSecContinCone = new THnSparseF("fhnLaSecContinCone", "Secondary contamination {#Lambda #it{p}_{T} in cone around jet axis; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2};#it{p}_{T}",3,binsLaSecContinCone,xminLaSecContinCone,xmaxLaSecContinCone);
2227 
2228  Int_t binsALaSecContinCone[3] = {19, 120, 200};
2229  Double_t xminALaSecContinCone[3] = {5.,0., -1.};
2230  Double_t xmaxALaSecContinCone[3] = {100.,12., 1.};
2231  fhnALaSecContinCone = new THnSparseF("fhnALaSecContinCone", "Secondary contamination {#bar{#Lambda} #it{p}_{T} in cone around jet axis; jet #it{p}_{T}; inv mass (GeV/#it{c}^{2};#it{p}_{T}",3,binsALaSecContinCone,xminALaSecContinCone,xmaxALaSecContinCone);
2232  */
2233  Int_t binsK0sIncl[3] = {200, 120, 200};
2234  Double_t xminK0sIncl[3] = {0.3, 0., -1.};
2235  Double_t xmaxK0sIncl[3] = {0.7, 12., 1.};
2236  fhnK0sIncl = new THnSparseF("fhnK0sIncl","Inclusive K0s",3,binsK0sIncl,xminK0sIncl,xmaxK0sIncl);
2237 
2238  Int_t binsK0sCone[4] = {19, 200, 120, 200};
2239  Double_t xminK0sCone[4] = {5.,0.3, 0., -1.};
2240  Double_t xmaxK0sCone[4] = {100.,0.7, 12., 1.};
2241  fhnK0sCone = new THnSparseF("fhnK0sCone","K0s in jet cone",4,binsK0sCone,xminK0sCone,xmaxK0sCone);
2242 
2243  Int_t binsK0sEmbCone[4] = {19, 200, 120, 200};
2244  Double_t xminK0sEmbCone[4] = {5.,0.3, 0., -1.};
2245  Double_t xmaxK0sEmbCone[4] = {100.,0.7, 12., 1.};
2246  fhnK0sEmbCone = new THnSparseF("fhnK0sEmbCone","Embedded K0s in jet cone",4,binsK0sEmbCone,xminK0sEmbCone,xmaxK0sEmbCone);
2247 
2248 
2249  Int_t binsK0sEmbConeRef[4] = {19, 200, 120, 200};
2250  Double_t xminK0sEmbConeRef[4] = {5.,0.3, 0., -1.};
2251  Double_t xmaxK0sEmbConeRef[4] = {100.,0.7, 12., 1.};
2252  fhnK0sEmbConeRef = new THnSparseF("fhnK0sEmbConeRef","K0s Embedded reference in jet cone",4,binsK0sEmbConeRef,xminK0sEmbConeRef,xmaxK0sEmbConeRef);
2253 
2254  Int_t binsK0sEmbConeStandard[4] = {19, 200, 120, 200};
2255  Double_t xminK0sEmbConeStandard[4] = {5.,0.3, 0., -1.};
2256  Double_t xmaxK0sEmbConeStandard[4] = {100.,0.7, 12., 1.};
2257  fhnK0sEmbConeStandard = new THnSparseF("fhnK0sEmbConeStandard","Standard K0s in matched jet cone",4,binsK0sEmbConeStandard,xminK0sEmbConeStandard,xmaxK0sEmbConeStandard);
2258 
2259 
2260  Int_t binsLaIncl[3] = {200, 120, 200};
2261  Double_t xminLaIncl[3] = {1.05, 0., -1.};
2262  Double_t xmaxLaIncl[3] = {1.25, 12., 1.};
2263  fhnLaIncl = new THnSparseF("fhnLaIncl","Inclusive #Lambda",3,binsLaIncl,xminLaIncl,xmaxLaIncl);
2264 
2265  Int_t binsLaCone[4] = {19, 200, 120, 200};
2266  Double_t xminLaCone[4] = {5.,1.05, 0., -1.};
2267  Double_t xmaxLaCone[4] = {100.,1.25, 12., 1.};
2268  fhnLaCone = new THnSparseF("fhnLaCone","#Lambda in jet cone",4,binsLaCone,xminLaCone,xmaxLaCone);
2269 
2270  Int_t binsLaEmbCone[4] = {19, 200, 120, 200};
2271  Double_t xminLaEmbCone[4] = {5.,1.05, 0., -1.};
2272  Double_t xmaxLaEmbCone[4] = {100.,1.25, 12., 1.};
2273  fhnLaEmbCone = new THnSparseF("fhnLaEmbCone","Embedded #Lambda in jet cone",4,binsLaEmbCone,xminLaEmbCone,xmaxLaEmbCone);
2274 
2275 
2276  Int_t binsLaEmbConeRef[4] = {19, 200, 120, 200};
2277  Double_t xminLaEmbConeRef[4] = {5.,1.05, 0., -1.};
2278  Double_t xmaxLaEmbConeRef[4] = {100.,1.25, 12., 1.};
2279  fhnLaEmbConeRef = new THnSparseF("fhnLaEmbConeRef","#Lambda Embedded reference in jet cone",4,binsLaEmbConeRef,xminLaEmbConeRef,xmaxLaEmbConeRef);
2280 
2281  Int_t binsLaEmbConeStandard[4] = {19, 200, 120, 200};
2282  Double_t xminLaEmbConeStandard[4] = {5.,1.05, 0., -1.};
2283  Double_t xmaxLaEmbConeStandard[4] = {100.,1.25, 12., 1.};
2284  fhnLaEmbConeStandard = new THnSparseF("fhnLaEmbConeStandard","Standard #Lambda in matched jet cone",4,binsLaEmbConeStandard,xminLaEmbConeStandard,xmaxLaEmbConeStandard);
2285 
2286 
2287  Int_t binsALaIncl[3] = {200, 120, 200};
2288  Double_t xminALaIncl[3] = {1.05, 0., -1.};
2289  Double_t xmaxALaIncl[3] = {1.25, 12., 1.};
2290  fhnALaIncl = new THnSparseF("fhnALaIncl","Inclusive #bar{#Lambda}",3,binsALaIncl,xminALaIncl,xmaxALaIncl);
2291 
2292  Int_t binsALaCone[4] = {19, 200, 120, 200};
2293  Double_t xminALaCone[4] = {5.,1.05, 0., -1.};
2294  Double_t xmaxALaCone[4] = {100.,1.25, 12., 1.};
2295  fhnALaCone = new THnSparseF("fhnALaCone","#bar{#Lambda} in jet cone",4,binsALaCone,xminALaCone,xmaxALaCone);
2296 
2297  Int_t binsALaEmbCone[4] = {19, 200, 120, 200};
2298  Double_t xminALaEmbCone[4] = {5.,1.05, 0., -1.};
2299  Double_t xmaxALaEmbCone[4] = {100.,1.25, 12., 1.};
2300  fhnALaEmbCone = new THnSparseF("fhnALaEmbCone","Embedded #bar{#Lambda} in jet cone",4,binsALaEmbCone,xminALaEmbCone,xmaxALaEmbCone);
2301 
2302  Int_t binsALaEmbConeRef[4] = {19, 200, 120, 200};
2303  Double_t xminALaEmbConeRef[4] = {5.,1.05, 0., -1.};
2304  Double_t xmaxALaEmbConeRef[4] = {100.,1.25, 12., 1.};
2305  fhnALaEmbConeRef = new THnSparseF("fhnALaEmbConeRef","#bar{#Lambda} Embedded reference in jet cone",4,binsALaEmbConeRef,xminALaEmbConeRef,xmaxALaEmbConeRef);
2306 
2307  Int_t binsALaEmbConeStandard[4] = {19, 200, 120, 200};
2308  Double_t xminALaEmbConeStandard[4] = {5.,1.05, 0., -1.};
2309  Double_t xmaxALaEmbConeStandard[4] = {100.,1.25, 12., 1.};
2310  fhnALaEmbConeStandard = new THnSparseF("fhnALaEmbConeStandard","Standard #Lambda in matched jet cone",4,binsALaEmbConeStandard,xminALaEmbConeStandard,xmaxALaEmbConeStandard);
2311 
2312 
2313  fh2MCEmbK0sJetPt = new TH2F("fh2MCEmbK0sJetPt","PYTHIA gen. K^{0}_{s} ;#it{p^{ch,jet}}_{T}; MC gen.#it{p}_{T}",19,5.,100.,120,0.,12.);
2314  fh2MCEmbLaJetPt = new TH2F("fh2MCEmbLaJetPt"," PYTHIA gen. #Lambda ;#it{p^{ch,jet}}_{T}; MC gen.#it{p}_{T}",19,5.,100.,120,0.,12.);
2315  fh2MCEmbALaJetPt = new TH2F("fh2MCEmbALaJetPt","PYTHIA gen. #bar{#Lambda};#it{p^{ch,jet}}_{T}; MC gen.#it{p}_{T}",19,5.,100.,120,0.,12.);
2316 
2317 
2318  fh1MCMultiplicityPrimary = new TH1F("fh1MCMultiplicityPrimary", "MC Primary Particles;NPrimary;Count", 201, -0.5, 200.5);
2319  fh1MCMultiplicityTracks = new TH1F("h1MCMultiplicityTracks", "MC Tracks;Ntracks;Count", 201, -0.5, 200.5);
2320 
2321 
2322  Int_t binsFeedDownLa[3] = {19, 200, 120};
2323  Double_t xminFeedDownLa[3] = {5.,1.05, 0.};
2324  Double_t xmaxFeedDownLa[3] = {100.,1.25, 12.};
2325  fhnFeedDownLa = new THnSparseF("fhnFeedDownLa","#Lambda stemming from feeddown from Xi(0/-)",3,binsFeedDownLa,xminFeedDownLa,xmaxFeedDownLa);
2326 
2327  Int_t binsFeedDownALa[3] = {19, 200, 120};
2328  Double_t xminFeedDownALa[3] = {5.,1.05, 0.};
2329  Double_t xmaxFeedDownALa[3] = {100.,1.25, 12.};
2330  fhnFeedDownALa = new THnSparseF("fhnFeedDownALa","#bar#Lambda stemming from feeddown from Xibar(0/+)",3,binsFeedDownALa,xminFeedDownALa,xmaxFeedDownALa);
2331 
2332  Int_t binsFeedDownLaCone[3] = {19, 200, 120};
2333  Double_t xminFeedDownLaCone[3] = {5.,1.05, 0.};
2334  Double_t xmaxFeedDownLaCone[3] = {100.,1.25, 12.};
2335  fhnFeedDownLaCone = new THnSparseF("fhnFeedDownLaCone","#Lambda stemming from feeddown from Xi(0/-) in jet cone",3,binsFeedDownLaCone,xminFeedDownLaCone,xmaxFeedDownLaCone);
2336 
2337  Int_t binsFeedDownALaCone[3] = {19, 200, 120};
2338  Double_t xminFeedDownALaCone[3] = {5.,1.05, 0.};
2339  Double_t xmaxFeedDownALaCone[3] = {100.,1.25, 12.};
2340  fhnFeedDownALaCone = new THnSparseF("fhnFeedDownALaCone","#bar#Lambda stemming from feeddown from Xibar(0/+) in jet cone",3,binsFeedDownALaCone,xminFeedDownALaCone,xmaxFeedDownALaCone);
2341 
2342  fh2FeedDownXiLa = new TH2F("fh2FeedDownXiLa","MC gen. #Xi #it{p}_{T}; MC gen. #Lambda #it{p}_{T}",120,0.,12.,120,0.,12.);
2343 
2344  fh2FeedDownXiALa = new TH2F("fh2FeedDownXiALa","MC gen. #bar{#Xi} #it{p}_{T}; MC gen.#bar{#Lambda} #it{p}_{T}",120,0.,12.,120,0.,12.);
2345 
2346  fh1MCProdRadiusK0s = new TH1F("fh1MCProdRadiusK0s","MC gen. MC K0s prod radius",100,0.,100.);
2347  fh1MCProdRadiusLambda = new TH1F("fh1MCProdRadiusLambda","MC gen. MC La prod radius",100,0.,100.);
2348  fh1MCProdRadiusAntiLambda = new TH1F("fh1MCProdRadiusAntiLambda","MC gen. MC ALa prod radius",100,0.,100.);
2349 
2350  // Pt and inv mass distributions
2351 
2352  fh1MCPtV0s = new TH1F("fh1MCPtV0s", "MC gen. V^{0} in rap range;#it{p}_{T} (GeV/#it{c})",120,0,12.);// 0.1 GeV/c steps
2353  fh1MCPtK0s = new TH1F("fh1MCPtK0s", "MC gen. K^{0}_{s} in eta range;#it{p}_{T} (GeV/#it{c})",120,0.,12.);
2354  fh1MCPtLambda = new TH1F("fh1MCPtLambda", "MC gen. #Lambda in rap range;#it{p}_{T} (GeV/#it{c})",120,0.,12.);
2355  fh1MCPtAntiLambda = new TH1F("fh1MCPtAntiLambda", "MC gen. #AntiLambda in rap range;#it{p}_{T} (GeV/#it{c})",120,0.,12.);
2356  fh1MCXiPt = new TH1F("fh1MCXiPt", "MC gen. #Xi^{-/o};#it{p}_{T} (GeV/#it{c})",120,0.,12.);
2357  fh1MCXibarPt = new TH1F("fh1MCXibarPt", "MC gen. #bar{#Xi}^{+/o};#it{p}_{T} (GeV/#it{c})",120,0.,12.);
2358  fh2MCEtaVsPtK0s = new TH2F("fh2MCEtaVsPtK0s","MC gen. K^{0}_{s} #eta; #it{p}_{T}",120,0.,12.,200,-1.,1.);
2359  fh2MCEtaVsPtLa = new TH2F("fh2MCEtaVsPtLa","MC gen. #Lambda #eta; #it{p}_{T}",120,0.,12.,200,-1.,1.);
2360  fh2MCEtaVsPtALa = new TH2F("fh2MCEtaVsPtALa","MC gen. #bar{#Lambda} #eta; #it{p}_{T}",120,0.,12.,200,-1.,1.);
2361 
2362  // Rapidity
2363  //fh1MCRapK0s = new TH1F("fh1MCRapK0s", "MC gen. K0s;rap with cut",200,-10,10);
2364  //fh1MCRapLambda = new TH1F("fh1MCRapLambda", "MC gen. #Lambda;rap",200,-10,10);
2365  //fh1MCRapAntiLambda = new TH1F("fh1MCRapAntiLambda", "MC gen. #bar{#Lambda};rap",200,-10,10);
2366  fh1MCEtaAllK0s = new TH1F("fh1MCEtaAllK0s", "MC gen. K0s;#eta",200,-1.,1.);
2367  fh1MCEtaK0s = new TH1F("fh1MCEtaK0s", "MC gen. K0s;#eta with cut",200,-1.,1.);
2368  fh1MCEtaLambda = new TH1F("fh1MCEtaLambda", "MC gen. #Lambda;#eta",200,-1.,1.);
2369  fh1MCEtaAntiLambda = new TH1F("fh1MCEtaAntiLambda", "MC gen. #bar{#Lambda};#eta",200,-1.,1.);
2370 
2371  fV0QAK0->DefineHistos();
2372  fFFHistosRecCuts->DefineHistos();
2373  fFFHistosRecCutsK0Evt->DefineHistos();
2374  fFFHistosGen->DefineHistos();
2375 
2376  /* fFFHistosIMK0AllEvt->DefineHistos();
2377  fFFHistosIMK0Jet->DefineHistos();
2378  fFFHistosIMK0Cone->DefineHistos();
2379  fFFHistosIMLaAllEvt->DefineHistos();
2380  fFFHistosIMLaJet->DefineHistos();
2381  fFFHistosIMLaCone->DefineHistos();
2382  fFFHistosIMALaAllEvt->DefineHistos();
2383  fFFHistosIMALaJet->DefineHistos();
2384  fFFHistosIMALaCone->DefineHistos();
2385  */
2386 
2387  const Int_t saveLevel = 5;
2388  if(saveLevel>0){
2389 
2390  fCommonHistList->Add(fh1EvtAllCent);
2391  fCommonHistList->Add(fh1Evt);
2392  if(fEPAnalysis == kTRUE){
2393  fCommonHistList->Add(fh1EP2);
2394  fCommonHistList->Add(fh1EP3);
2395  }
2396  fCommonHistList->Add(fh1EvtSelection);
2397  fCommonHistList->Add(fh1EvtCent);
2398  fCommonHistList->Add(fh1VertexNContributors);
2399  fCommonHistList->Add(fh1VertexZ);
2400  fCommonHistList->Add(fh1Xsec);
2401  fCommonHistList->Add(fh1Trials);
2402  fCommonHistList->Add(fh1PtHard);
2403  fCommonHistList->Add(fh1PtHardTrials);
2404  fCommonHistList->Add(fh1nRecJetsCuts);
2405  fCommonHistList->Add(fh1EvtMult);
2406  fCommonHistList->Add(fh1K0Mult);
2407  fCommonHistList->Add(fh1dPhiJetK0);
2408  fCommonHistList->Add(fh1LaMult);
2409  fCommonHistList->Add(fh1dPhiJetLa);
2410  fCommonHistList->Add(fh1ALaMult);
2411  fCommonHistList->Add(fh1dPhiJetALa);
2412  fCommonHistList->Add(fh1JetEta);
2413  fCommonHistList->Add(fh1JetPhi);
2414  fCommonHistList->Add(fh2JetEtaPhi);
2415 
2416  if(fBranchEmbeddedJets.Length()){
2417  fCommonHistList->Add(fh1nEmbeddedJets);
2418  fCommonHistList->Add(fh1IndexEmbedded);
2419  if(fEPAnalysis == kTRUE){
2420  fCommonHistList->Add(fh1EmbeddedJetPhiDelta);
2421  }
2422  //fCommonHistList->Add(fh1PtEmbExtraOnly);
2423  fCommonHistList->Add(fh1PtEmbBeforeMatch);
2424  fCommonHistList->Add(fh1PtEmbReject);
2425  fCommonHistList->Add(fh2PtEtaEmbReject);
2426  fCommonHistList->Add(fh1PtEmbAfterMatch);
2427  fCommonHistList->Add(fh1FractionPtEmbedded);
2428  fCommonHistList->Add(fh1DeltaREmbedded);
2429 
2430  if(fBranchGenJets.Length()&&(fMatchMode == 2)){
2431  fCommonHistList->Add(fh1IndexEmbeddedMC);
2432  fCommonHistList->Add(fh1FractionPtEmbeddedMC);
2433  fCommonHistList->Add(fh2FractionPtVsEmbeddedJetPtMC);
2434  fCommonHistList->Add(fh1DeltaREmbeddedMC);
2435  fCommonHistList->Add(fh1JetPtEmbGenAfterMatch);
2436  }
2437  }
2438 
2439  fCommonHistList->Add(fh2TracksPerpCone);
2440  fCommonHistList->Add(fh1PerpCone);
2441  //fCommonHistList->Add(fh1V0JetPt);
2442  fCommonHistList->Add(fh1V0PtCandidate);
2443  fCommonHistList->Add(fh1IMK0Cone);
2444  fCommonHistList->Add(fh1IMLaCone);
2445  fCommonHistList->Add(fh1IMALaCone);
2446  fCommonHistList->Add(fh1IMK0EmbCone);
2447  fCommonHistList->Add(fh1IMLaEmbCone);
2448  fCommonHistList->Add(fh1IMALaEmbCone);
2449  fCommonHistList->Add(fh2FFJetTrackEta);
2450  // fCommonHistList->Add(fh1trackPosNCls);
2451  //fCommonHistList->Add(fh1trackNegNCls);
2452  fCommonHistList->Add(fh1trackPosEta);
2453  fCommonHistList->Add(fh1trackNegEta);
2454  fCommonHistList->Add(fh1V0Eta);
2455  // fCommonHistList->Add(fh1V0totMom);
2456  fCommonHistList->Add(fh1CosPointAngle);
2457  fCommonHistList->Add(fh1DecayLengthV0);
2458  fCommonHistList->Add(fh2ProperLifetimeK0sVsPtBeforeCut);
2459  fCommonHistList->Add(fh2ProperLifetimeK0sVsPtAfterCut);
2460  fCommonHistList->Add(fh1V0Radius);
2461  fCommonHistList->Add(fh1DcaV0Daughters);
2462  fCommonHistList->Add(fh1DcaPosToPrimVertex);
2463  fCommonHistList->Add(fh1DcaNegToPrimVertex);
2464  fCommonHistList->Add(fh2ArmenterosBeforeCuts);
2465  fCommonHistList->Add(fh2ArmenterosAfterCuts);
2466  fCommonHistList->Add(fh2BBLaPos);
2467  fCommonHistList->Add(fh2BBLaNeg);
2468  fCommonHistList->Add(fh1PosDaughterCharge);
2469  fCommonHistList->Add(fh1NegDaughterCharge);
2470  fCommonHistList->Add(fh1PtMCK0s);
2471  fCommonHistList->Add(fh1PtMCLa);
2472  fCommonHistList->Add(fh1PtMCALa);
2473  fCommonHistList->Add(fh1EtaK0s);
2474  fCommonHistList->Add(fh1EtaLa);
2475  fCommonHistList->Add(fh1EtaALa);
2476  fCommonHistList->Add(fh1RC);
2477  fCommonHistList->Add(fh1RCBiasK0);
2478  fCommonHistList->Add(fh1RCBiasLa);
2479  fCommonHistList->Add(fh1RCBiasALa);
2480  fCommonHistList->Add(fh1MCC);
2481  fCommonHistList->Add(fh1OC);
2482  fCommonHistList->Add(fh1NJ);
2483  fCommonHistList->Add(fh1NJEmbEvt);
2484  fCommonHistList->Add(fh1BckgJets);
2485  fCommonHistList->Add(fh1BckgJetsPtBias);
2486  fCommonHistList->Add(fhnInvMassEtaTrackPtK0s);
2487  fCommonHistList->Add(fhnInvMassEtaTrackPtLa);
2488  fCommonHistList->Add(fhnInvMassEtaTrackPtALa);
2489  fCommonHistList->Add(fh1TrackMultCone);
2490  fCommonHistList->Add(fh2TrackMultCone);
2491  fCommonHistList->Add(fhnNJK0);
2492  fCommonHistList->Add(fhnNJLa);
2493  fCommonHistList->Add(fhnNJALa);
2494  //fCommonHistList->Add(fh2ChTracksNJ);
2495  //fCommonHistList->Add(fh2ChTracksRC);
2496  // fCommonHistList->Add(fh2ChTracksOC);
2497  //fCommonHistList->Add(fh2ChTracksMCC);
2498  //fCommonHistList->Add(fh2ChTracksPC);
2499  fCommonHistList->Add(fhnMCgenK0Cone);
2500  fCommonHistList->Add(fhnMCgenLaCone);
2501  //fCommonHistList->Add(fh2MCgenALaCone);
2502  //fCommonHistList->Add(fh2MCEtagenK0Cone);
2503  //fCommonHistList->Add(fh2MCEtagenLaCone);
2504  //fCommonHistList->Add(fh2MCEtagenALaCone);
2505  /* fCommonHistList->Add(fh2CorrHijingLaProton);
2506  fCommonHistList->Add(fh2CorrInjectLaProton);
2507  fCommonHistList->Add(fh2CorrHijingALaAProton);
2508  fCommonHistList->Add(fh2CorrInjectALaAProton);
2509  fCommonHistList->Add(fh2MCEtaVsPtHijingLa);
2510  fCommonHistList->Add(fh2MCEtaVsPtInjectLa);
2511  fCommonHistList->Add(fh2MCEtaVsPtHijingALa);
2512  fCommonHistList->Add(fh2MCEtaVsPtInjectALa);
2513  */
2514  fCommonHistList->Add(fh1IMK0ConeSmear);
2515  fCommonHistList->Add(fh1IMLaConeSmear);
2516  fCommonHistList->Add(fh1IMALaConeSmear);
2517  fCommonHistList->Add(fh2MC2K0Cone);
2518  fCommonHistList->Add(fh2MC2LaCone);
2519  fCommonHistList->Add(fh2MC2ALaCone);
2520  /* fCommonHistList->Add(fhnrecMCHijingLaIncl);
2521  fCommonHistList->Add(fhnrecMCHijingLaCone);
2522  fCommonHistList->Add(fhnrecMCHijingALaIncl);
2523  fCommonHistList->Add(fhnrecMCHijingALaCone);
2524  fCommonHistList->Add(fhnrecMCInjectLaIncl);
2525  fCommonHistList->Add(fhnrecMCInjectLaCone);
2526  fCommonHistList->Add(fhnrecMCInjectALaIncl);
2527  fCommonHistList->Add(fhnrecMCInjectALaCone);*/
2528  /*fCommonHistList->Add(fhnMCrecK0Cone);
2529  fCommonHistList->Add(fhnMCrecLaCone);
2530  fCommonHistList->Add(fhnMCrecALaCone);
2531  fCommonHistList->Add(fhnMCrecK0ConeSmear);
2532  fCommonHistList->Add(fhnMCrecLaConeSmear);
2533  fCommonHistList->Add(fhnMCrecALaConeSmear); */
2534  /* fCommonHistList->Add(fhnK0sSecContinCone);
2535  fCommonHistList->Add(fhnLaSecContinCone);
2536  fCommonHistList->Add(fhnALaSecContinCone);*/
2537  fCommonHistList->Add(fhnK0sIncl);
2538  fCommonHistList->Add(fhnK0sCone);
2539  fCommonHistList->Add(fhnK0sEmbCone);
2540 
2541  if(fBranchEmbeddedJets.Length()){
2542  if(fUseExtraTracks)fCommonHistList->Add(fhnK0sEmbConeRef);
2543  if((fUseExtraTracks == 1) && (fUseStandard == kTRUE)){fCommonHistList->Add(fhnK0sEmbConeStandard);}
2544  }
2545 
2546  fCommonHistList->Add(fhnLaIncl);
2547  fCommonHistList->Add(fhnLaCone);
2548  fCommonHistList->Add(fhnLaEmbCone);
2549 
2550  if(fBranchEmbeddedJets.Length()){
2551  if(fUseExtraTracks)fCommonHistList->Add(fhnLaEmbConeRef);
2552  if((fUseExtraTracks == 1) && (fUseStandard == kTRUE)){fCommonHistList->Add(fhnLaEmbConeStandard);}
2553  }
2554 
2555  fCommonHistList->Add(fhnALaIncl);
2556  fCommonHistList->Add(fhnALaCone);
2557  fCommonHistList->Add(fhnALaEmbCone);
2558 
2559  if(fBranchEmbeddedJets.Length()){
2560  if(fUseExtraTracks)fCommonHistList->Add(fhnALaEmbConeRef);
2561  if((fUseExtraTracks == 1) && (fUseStandard == kTRUE)){fCommonHistList->Add(fhnALaEmbConeStandard);}
2562  }
2563  if((fUseExtraTracks == 1) && (fMatchMode == 2)){
2564  fCommonHistList->Add(fh2MCEmbK0sJetPt);
2565  fCommonHistList->Add(fh2MCEmbLaJetPt);
2566  fCommonHistList->Add(fh2MCEmbALaJetPt);
2567  }
2568  fCommonHistList->Add(fhnK0sPC);
2569  fCommonHistList->Add(fhnK0sEmbPC);
2570  fCommonHistList->Add(fhnLaPC);
2571  fCommonHistList->Add(fhnLaEmbPC);
2572  fCommonHistList->Add(fhnALaPC);
2573  fCommonHistList->Add(fhnALaEmbPC);
2574  fCommonHistList->Add(fhnK0sMCC);
2575  fCommonHistList->Add(fhnLaMCC);
2576  fCommonHistList->Add(fhnALaMCC);
2577  fCommonHistList->Add(fhnK0sRC);
2578  fCommonHistList->Add(fhnLaRC);
2579  fCommonHistList->Add(fhnALaRC);
2580  fCommonHistList->Add(fhnK0sRCBias);
2581  fCommonHistList->Add(fhnLaRCBias);
2582  fCommonHistList->Add(fhnALaRCBias);
2583  fCommonHistList->Add(fhnK0sOC);
2584  fCommonHistList->Add(fhnLaOC);
2585  fCommonHistList->Add(fhnALaOC);
2586  fCommonHistList->Add(fh1AreaExcluded);
2587  fCommonHistList->Add(fh1MedianEta);
2588  fCommonHistList->Add(fh1JetPtMedian);
2589  fCommonHistList->Add(fh1MCMultiplicityPrimary);
2590  fCommonHistList->Add(fh1MCMultiplicityTracks);
2591  fCommonHistList->Add(fhnFeedDownLa);
2592  fCommonHistList->Add(fhnFeedDownALa);
2593  fCommonHistList->Add(fhnFeedDownLaCone);
2594  fCommonHistList->Add(fhnFeedDownALaCone);
2595  fCommonHistList->Add(fh2FeedDownXiLa);
2596  fCommonHistList->Add(fh2FeedDownXiALa);
2597  fCommonHistList->Add(fh1MCProdRadiusK0s);
2598  fCommonHistList->Add(fh1MCProdRadiusLambda);
2599  fCommonHistList->Add(fh1MCProdRadiusAntiLambda);
2600  fCommonHistList->Add(fh1MCPtV0s);
2601  fCommonHistList->Add(fh1MCPtK0s);
2602  fCommonHistList->Add(fh1MCPtLambda);
2603  fCommonHistList->Add(fh1MCPtAntiLambda);
2604  fCommonHistList->Add(fh1MCXiPt);
2605  fCommonHistList->Add(fh1MCXibarPt);
2606  fCommonHistList->Add(fh2MCEtaVsPtK0s);
2607  fCommonHistList->Add(fh2MCEtaVsPtLa);
2608  fCommonHistList->Add(fh2MCEtaVsPtALa);
2609  //fCommonHistList->Add(fh1MCRapK0s);
2610  //fCommonHistList->Add(fh1MCRapLambda);
2611  //fCommonHistList->Add(fh1MCRapAntiLambda);
2612  fCommonHistList->Add(fh1MCEtaAllK0s);
2613  fCommonHistList->Add(fh1MCEtaK0s);
2614  fCommonHistList->Add(fh1MCEtaLambda);
2615  fCommonHistList->Add(fh1MCEtaAntiLambda);
2616  fCommonHistList->Add(fh1nGenJets);
2617 
2618  fV0QAK0->AddToOutput(fCommonHistList);
2619  fFFHistosRecCuts->AddToOutput(fCommonHistList);
2620  fFFHistosRecCutsK0Evt->AddToOutput(fCommonHistList);
2621 
2622  if(fBranchGenJets.Length() && (fMatchMode == 2)){
2623  fFFHistosGen->AddToOutput(fCommonHistList);
2624  }
2625 
2626  // fFFHistosIMK0AllEvt->AddToOutput(fCommonHistList);
2627  // fFFHistosIMK0Jet->AddToOutput(fCommonHistList);
2628  // fFFHistosIMK0Cone->AddToOutput(fCommonHistList);
2629  // fFFHistosIMLaAllEvt->AddToOutput(fCommonHistList);
2630  // fFFHistosIMLaJet->AddToOutput(fCommonHistList);
2631  // fFFHistosIMLaCone->AddToOutput(fCommonHistList);
2632  // fFFHistosIMALaAllEvt->AddToOutput(fCommonHistList);
2633  // fFFHistosIMALaJet->AddToOutput(fCommonHistList);
2634  // fFFHistosIMALaCone->AddToOutput(fCommonHistList);
2635 
2636 
2637  }
2638 
2639  // =========== Switch on Sumw2 for all histos ===========
2640  for (Int_t i=0; i<fCommonHistList->GetEntries(); ++i){
2641 
2642  TH1 *h1 = dynamic_cast<TH1*>(fCommonHistList->At(i));
2643 
2644  if (h1) h1->Sumw2();//The error per bin will be computed as sqrt(sum of squares of weight) for each bin
2645  else{
2646  THnSparse *hnSparse = dynamic_cast<THnSparse*>(fCommonHistList->At(i));
2647  if(hnSparse) hnSparse->Sumw2();
2648  }
2649 
2650  }
2651  TH1::AddDirectory(oldStatus);
2652  PostData(1, fCommonHistList);
2653 }
2654 
2655 //_______________________________________________
2657 {
2658  // Main loop
2659  // Called for each event
2660 
2661  if(fDebug > 1) Printf("AliAnalysisTaskJetChem::UserExec()");
2662 
2663  if(fDebug > 1) Printf("Analysis event #%5d", (Int_t) fEntry);
2664 
2665  // Trigger selection
2666  AliInputEventHandler* inputHandler = (AliInputEventHandler*)
2667  ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
2668 
2669  if((fDebug > 1)&&(!inputHandler)){std::cout<<"AliAnalysisTaskJetChem::AliInputEventHandler does not exist!! "<<std::endl;}
2670 
2671  //for AliPIDResponse:
2672  fPIDResponse = inputHandler->GetPIDResponse();
2673 
2674  if (!fPIDResponse){if(fDebug > 1) Printf("AliAnalysisTaskJetChem::UserExec(): fPIDResponse does not exist!"); return;}
2675 
2676  if(fDebug > 1){std::cout<<"inputHandler->IsEventSelected(): "<<inputHandler->IsEventSelected()<<std::endl;}
2677  if(fDebug > 1){std::cout<<"fEvtSelectionMask: "<<fEvtSelectionMask<<std::endl;}
2678 
2679  if(!(inputHandler->IsEventSelected() & fEvtSelectionMask)){
2680  //std::cout<<"########event rejected!!############"<<std::endl;
2681  fh1EvtSelection->Fill(1.);
2682  if (fDebug > 1 ) Printf(" Trigger Selection: event REJECTED ... ");
2683  PostData(1, fCommonHistList);
2684  return;
2685  }
2686 
2687  fESD = dynamic_cast<AliESDEvent*>(InputEvent());//casting of pointers for inherited class, only for ESDs
2688  if(!fESD){
2689  if(fDebug>3) Printf("%s:%d ESDEvent not found in the input", (char*)__FILE__,__LINE__);
2690  }
2691 
2692  fMCEvent = MCEvent();
2693  if(!fMCEvent){
2694  if(fDebug>3) Printf("%s:%d MCEvent not found in the input", (char*)__FILE__,__LINE__);
2695  }
2696 
2697  // get AOD event from input/output
2698  TObject* handler = AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler();
2699  if( handler && handler->InheritsFrom("AliAODInputHandler") ) {
2700  fAOD = ((AliAODInputHandler*)handler)->GetEvent();
2701  if(fUseAODInputJets) fAODJets = fAOD;
2702  if (fDebug > 1) Printf("%s:%d AOD event from input", (char*)__FILE__,__LINE__);
2703  }
2704  else {
2705  handler = AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler();
2706  if( handler && handler->InheritsFrom("AliAODHandler") ) {
2707  fAOD = ((AliAODHandler*)handler)->GetAOD();
2708  fAODJets = fAOD;
2709  if (fDebug > 1) Printf("%s:%d AOD event from output", (char*)__FILE__,__LINE__);
2710  }
2711  }
2712 
2713  if(!fAODJets && !fUseAODInputJets){ // case we have AOD in input & output and want jets from output
2714  TObject* outHandler = AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler();
2715  if( outHandler && outHandler->InheritsFrom("AliAODHandler") ){
2716  fAODJets = ((AliAODHandler*)outHandler)->GetAOD();
2717  if (fDebug > 1) Printf("%s:%d jets from output AOD", (char*)__FILE__,__LINE__);
2718  }
2719  }
2720 
2721  if(fNonStdFile.Length()!=0){
2722  // case we have an AOD extension - fetch the jets from the extended output
2723 
2724  AliAODHandler *aodH = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler());
2725  fAODExtension = (aodH?aodH->GetExtension(fNonStdFile.Data()):0);
2726  if(!fAODExtension){
2727  if(fDebug>1)Printf("AODExtension not found for %s",fNonStdFile.Data());
2728  }
2729  }
2730 
2731  if(!fAOD){
2732  Printf("%s:%d AODEvent not found", (char*)__FILE__,__LINE__);
2733  return;
2734  }
2735  if(!fAODJets){
2736  Printf("%s:%d AODEvent with jet branch not found", (char*)__FILE__,__LINE__);
2737  return;
2738  }
2739 
2740  //primary vertex position:
2741  AliAODVertex *myPrimaryVertex = NULL;
2742  myPrimaryVertex = (AliAODVertex*)fAOD->GetPrimaryVertex();
2743  if (!myPrimaryVertex) return;
2744  fh1Evt->Fill(1.);//fill in every event that was accessed with InputHandler
2745 
2746  // event selection *****************************************
2747 
2748  // *** vertex cut ***
2749  AliAODVertex* primVtx = fAOD->GetPrimaryVertex();
2750  Int_t nTracksPrim = primVtx->GetNContributors();
2751  fh1VertexNContributors->Fill(nTracksPrim);
2752 
2753  if (fDebug > 1) Printf("%s:%d primary vertex selection: %d", (char*)__FILE__,__LINE__,nTracksPrim);
2754  //if(!nTracksPrim){
2755  if(nTracksPrim <= 2){
2756  if (fDebug > 1) Printf("%s:%d primary vertex selection: event REJECTED...",(char*)__FILE__,__LINE__);
2757  fh1EvtSelection->Fill(3.);
2758  PostData(1, fCommonHistList);
2759  return;
2760  }
2761 
2762  fh1VertexZ->Fill(primVtx->GetZ());
2763 
2764  if(TMath::Abs(primVtx->GetZ())>fMaxVertexZ){
2765  if (fDebug > 1) Printf("%s:%d primary vertex z = %f: event REJECTED...",(char*)__FILE__,__LINE__,primVtx->GetZ());
2766  fh1EvtSelection->Fill(4.);
2767  PostData(1, fCommonHistList);
2768  return;
2769  }
2770 
2771  // accepts only events that have same "primary" and SPD vertex, special issue of LHC11h PbPb data
2772 
2773  //fAOD: pointer to global primary vertex
2774 
2775  const AliAODVertex* spdVtx = fAOD->GetPrimaryVertexSPD();
2776 
2777  if (TMath::Abs(spdVtx->GetZ() - primVtx->GetZ())>fDeltaVertexZ) { if (fDebug > 1) Printf("deltaZVertex: event REJECTED..."); return;}
2778 
2779 
2780  //check for vertex radius to be smaller than 1 cm, (that was first applied by Vit Kucera in his analysis)
2781 
2782  Double_t vtxX = primVtx->GetX();
2783  Double_t vtxY = primVtx->GetY();
2784 
2785  if(TMath::Sqrt(vtxX*vtxX + vtxY*vtxY)>=1){
2786  if (fDebug > 1) Printf("%s:%d primary vertex r = %f: event REJECTED...",(char*)__FILE__,__LINE__,TMath::Sqrt(vtxX*vtxX + vtxY*vtxY));
2787  return;
2788  }
2789 
2790 
2791  TString primVtxName(primVtx->GetName());
2792 
2793  if(primVtxName.CompareTo("TPCVertex",TString::kIgnoreCase) == 1){
2794  if (fDebug > 1) Printf("%s:%d primary vertex selection: TPC vertex, event REJECTED...",(char*)__FILE__,__LINE__);
2795  fh1EvtSelection->Fill(5.);
2796  PostData(1, fCommonHistList);
2797  return;
2798  }
2799 
2800  Bool_t selectedHelper = AliAnalysisHelperJetTasks::Selected();
2801  if(!selectedHelper){
2802  fh1EvtSelection->Fill(6.);
2803  PostData(1, fCommonHistList);
2804  return;
2805  }
2806 
2807  // event selection *****************************************
2808  //remark: for centrality binning 0-10, 10-30, 30-50, 50-80
2809 
2810 
2811  Double_t centPercent = -1;
2812  Int_t cl = 0;
2813 
2814  if(fEventClass>0){// in case of PbPb, for pp cl = 0
2815 
2816  if(handler && handler->InheritsFrom("AliAODInputHandler")){
2817 
2818  centPercent = dynamic_cast<AliAODHeader*>(fAOD->GetHeader())->GetCentrality();
2819  cl = 1;
2820 
2821  fh1EvtAllCent->Fill(centPercent);
2822 
2823  //fEventClass set externally
2824  if(fEventClass >= 11){//to analyse also 5% central events (PWG-LF choice)
2825 
2826  if(centPercent < 0) cl = -1;
2827  if(centPercent >= 0) cl = 11;//exception for analysis of 5% event centrality (PWG-LF choice)
2828  if(centPercent > 5) cl = 12;
2829  if(centPercent > 10) cl = 13;
2830  if(centPercent > 20) cl = 14;
2831  if(centPercent > 40) cl = 15;
2832  if(centPercent > 60) cl = 16;
2833  if(centPercent > 80) cl = 17;
2834  if(centPercent > 90) cl = 18;
2835 
2836  }
2837 
2838  if(fEventClass < 11){//standard centrality estimator used in PWGJE analyses
2839 
2840  if(centPercent < 0) cl = -1;
2841  if(centPercent >= 0) cl = 1;
2842  if(centPercent > 10) cl = 2;
2843  if(centPercent > 30) cl = 3;
2844  if(centPercent > 50) cl = 4;
2845  if(centPercent > 80) cl = 5; //takes centralities higher than my upper edge of 80%, not to be used
2846 
2847  }
2848  }//end of AliAOD header
2849 
2850  else {//in case of ESDs in Input
2851 
2853 
2854  if(fESD) centPercent = fESD->GetCentrality()->GetCentralityPercentile("V0M"); //ESD JetServices Task has the centrality binning 0-10,10-30,30-50,50-80
2855  fh1EvtAllCent->Fill(centPercent);
2856 
2857 
2858  if(fEventClass >= 11){//to analyse also 5% central events (PWG-LF choice)
2859 
2860  if(centPercent < 0) cl = -1;
2861  if(centPercent >= 0) cl = 11;//exception for analysis of 5% event centrality (PWG-LF choice)
2862  if(centPercent > 5) cl = 12;
2863  if(centPercent > 10) cl = 13;
2864  if(centPercent > 20) cl = 14;
2865  if(centPercent > 40) cl = 15;
2866  if(centPercent > 60) cl = 16;
2867  if(centPercent > 80) cl = 17;
2868  if(centPercent > 90) cl = 18;
2869 
2870  }
2871 
2872  if(fEventClass < 11){//standard centrality estimator used in PWGJE analyses
2873 
2874  if(centPercent < 0) cl = -1;
2875  if(centPercent >= 0) cl = 1;
2876  if(centPercent > 10) cl = 2;
2877  if(centPercent > 30) cl = 3;
2878  if(centPercent > 50) cl = 4;
2879  if(centPercent > 80) cl = 5; //takes centralities higher than my upper edge of 80%, not to be used
2880 
2881  }
2882 
2883  }
2884 
2885  if(cl!=fEventClass){ // event not in selected event class, reject event#########################################
2886 
2887  if (fDebug > 1) Printf("%s:%d event not in selected event class: event REJECTED ...",(char*)__FILE__,__LINE__);
2888  fh1EvtSelection->Fill(2.);
2889  PostData(1, fCommonHistList);
2890  return;
2891  }
2892  }//end if fEventClass > 0
2893 
2894 
2895  if (fDebug > 1) Printf("%s:%d event ACCEPTED ...",(char*)__FILE__,__LINE__);
2896 
2897  //test test
2898  //Printf("Analysis event #%5d", (Int_t) fEntry);
2899 
2900  //std::cout<<"Hallo 1!"<<std::endl;
2901 
2902  fh1EvtSelection->Fill(0.);
2903  fh1EvtCent->Fill(centPercent);
2904 
2905  Double_t event_plane_2 = -999.;
2906  Double_t event_plane_3 = -999.;
2907 
2908  if(fEPAnalysis == kTRUE){
2909  //Get event plane
2910 
2911  Double_t qx2(0), qy2(0), qx3(0), qy3(0);
2912 
2913  // get the q-vectors from AliEventPlane
2914 
2915  if(fAOD){//for AOD Input event
2916  event_plane_2 = fAOD->GetEventplane()->CalculateVZEROEventPlane(fAOD, 10, 2, qx2, qy2); // returns V0 2nd order EP (EP phi)
2917  event_plane_3 = fAOD->GetEventplane()->CalculateVZEROEventPlane(fAOD, 10, 3, qx3, qy3); // return V0 3rd order EP (EP phi)
2918 
2919  if(fDebug>3) std::cout<<"2nd order harmonic EP - qx2: "<<qx2<<" , qy2: "<<qy2<<std::endl;
2920  if(fDebug>3) std::cout<<"3rd order harmonic EP - qx3: "<<qx3<<" , qy3: "<<qy3<<std::endl;
2921  if(fDebug>3) std::cout<<"event_plane_2: "<<event_plane_2<<" , event_plane_3: "<<event_plane_3<<std::endl;
2922  }
2923 
2924  if(fESD){//for ESD Input event
2925  event_plane_2 = fESD->GetEventplane()->CalculateVZEROEventPlane(fESD, 10, 2, qx2, qy2); // returns V0 2nd order EP (EP phi)
2926  event_plane_3 = fESD->GetEventplane()->CalculateVZEROEventPlane(fESD, 10, 3, qx3, qy3); // return V0 3rd order EP (EP phi)
2927 
2928  if(fDebug>3) std::cout<<"2nd order harmonic EP - qx2: "<<qx2<<" , qy2: "<<qy2<<std::endl;
2929  if(fDebug>3) std::cout<<"3rd order harmonic EP - qx3: "<<qx3<<" , qy3: "<<qy3<<std::endl;
2930  if(fDebug>3) std::cout<<"event_plane_2: "<<event_plane_2<<" , event_plane_3: "<<event_plane_3<<std::endl;
2931  }
2932 
2933  //std::cout<<"PbPb vertex z coordinate: "<<primVertex->GetZ()<<std::endl;
2934 
2935  fh1EP2->Fill(event_plane_2);
2936  fh1EP3->Fill(event_plane_3);
2937  }//end if fEPAnalysis
2938 
2939  //___ get MC information __________________________________________________________________
2940 
2941 
2942  Double_t ptHard = 0.; //parton energy bins -> energy of particle
2943  Double_t nTrials = 1; // trials for MC trigger weight for real data
2944 
2945  if(fMCEvent){
2946  AliGenEventHeader* genHeader = fMCEvent->GenEventHeader();
2947  AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader);//check usage of Pythia (pp) or Hijing (PbPb)
2948  AliGenHijingEventHeader* hijingGenHeader = 0x0;
2949 
2950  if(pythiaGenHeader){
2951  if(fDebug>3) Printf("%s:%d pythiaGenHeader found", (char*)__FILE__,__LINE__);
2952  nTrials = pythiaGenHeader->Trials();
2953  ptHard = pythiaGenHeader->GetPtHard();
2954 
2955  fh1PtHard->Fill(ptHard);
2956  fh1PtHardTrials->Fill(ptHard,nTrials);
2957 
2958 
2959  } else { // no pythia, hijing?
2960 
2961  if(fDebug>3) Printf("%s:%d no pythiaGenHeader found", (char*)__FILE__,__LINE__);
2962 
2963  hijingGenHeader = dynamic_cast<AliGenHijingEventHeader*>(genHeader);
2964  if(!hijingGenHeader){
2965  if(fDebug>3) Printf("%s:%d no pythiaGenHeader or hjingGenHeader found", (char*)__FILE__,__LINE__);
2966  } else {
2967  if(fDebug>3) Printf("%s:%d hijingGenHeader found", (char*)__FILE__,__LINE__);
2968  }
2969  }
2970 
2971  fh1Trials->Fill("#sum{ntrials}",fAvgTrials);
2972  }
2973 
2974  //____ fetch jets _______________________________________________________________
2975 
2976  Int_t nJCuts = GetListOfJets(fJetsRecCuts, kJetsRecAcceptance);//fetch list with jets that survived all jet cuts: fJetsRecCuts, still missing is leading constituent cut
2977 
2978  if(fDebug>2)std::cout<<" nJCuts: "<<nJCuts<<std::endl;
2979 
2980  if(fDebug>2)std::cout<<" fBranchRecJets: "<<fBranchRecJets<<std::endl;
2981 
2982  Int_t nRecJetsCuts = 0; //number of reconstructed jets after jet cuts
2983  if(nJCuts>=0) nRecJetsCuts = fJetsRecCuts->GetEntries();
2984  if(fDebug>2)Printf("%s:%d Selected Rec jets after cuts (noJetPtBias): %d %d",(char*)__FILE__,__LINE__,nJCuts,nRecJetsCuts);
2985  if(nRecJetsCuts != nJCuts) Printf("%s:%d Mismatch selected Rec jets after cuts: %d %d",(char*)__FILE__,__LINE__,nJCuts,nRecJetsCuts);
2986  fh1nRecJetsCuts->Fill(nRecJetsCuts);
2987 
2988 
2989  Int_t nGenJets = 0;
2990 
2991  Int_t nEmbeddedJets = 0;
2992  Int_t nJGen = 0;
2993  TArrayI iEmbeddedMatchIndex;
2994  TArrayI iRecMatchIndex;
2995  TArrayF fRecMatchPtFraction;
2996 
2997  TArrayI iEmbeddedMatchIndexMC;
2998  TArrayI iGenMatchIndex;
2999  TArrayF fGenMatchPtFraction;
3000 
3001  //fetch all jets used for embedding mode
3002  if(!(fUseExtraTracks == 0)){
3003 
3004  if(fMatchMode == 2){
3005  nJGen = GetListOfJets(fJetsGen, kJetsGenAcceptance);//fill list of embedded jets, generator level
3006 
3007  if(nJGen>=0) nGenJets = fJetsGen->GetEntries();
3008  if(fDebug>2)Printf("%s:%d Selected Gen jets: %d %d",(char*)__FILE__,__LINE__,nJGen,nGenJets);
3009 
3010  if(nJGen != nGenJets) Printf("%s:%d Mismatch selected Gen jets: %d %d",(char*)__FILE__,__LINE__,nJGen,nGenJets);
3011  fh1nGenJets->Fill(nGenJets);
3012 
3013  }
3014 
3015  if(fDebug>2)std::cout<<"fBranchEmbeddedJets for matching: "<<fBranchEmbeddedJets<<std::endl;
3016 
3017 
3018  if(fBranchEmbeddedJets.Length()){
3019 
3020  Int_t nJEmbedded = GetListOfJets(fJetsEmbedded, kJetsEmbedded);//fill list of embedded jets, detector level
3021  if(nJEmbedded>=0) nEmbeddedJets = fJetsEmbedded->GetEntries();
3022  if(fDebug>2)Printf("%s:%d Selected Embedded jets: %d %d",(char*)__FILE__,__LINE__,nJEmbedded,nEmbeddedJets);
3023  if(nJEmbedded != nEmbeddedJets) Printf("%s:%d Mismatch Selected Embedded Jets: %d %d",(char*)__FILE__,__LINE__,nJEmbedded,nEmbeddedJets);
3024  fh1nEmbeddedJets->Fill(nEmbeddedJets);
3025 
3026  //loop over embedded jets, as crosscheck for in-plane or out-of-plane Embedding
3027  if(fEPAnalysis == kTRUE){
3028  if(nEmbeddedJets > 0){
3029  for(Int_t ij=0; ij<nEmbeddedJets; ++ij){
3030  AliAODJet *jet = dynamic_cast<AliAODJet*>(fJetsEmbedded->At(ij));
3031  if(!jet) continue;
3032  Double_t jetPhi = jet->Phi();
3033  Double_t phiEP = TMath::Pi()*0.5 - event_plane_2;//change phi EP angle to (0,pi) range, instead of (-pi/2, pi/2)
3034 
3035  Double_t jetPhiDelta = TMath::Abs(jetPhi-phiEP);//absolute difference of event plane and PYTHIA jet phi
3036  if(fDebug>3)std::cout<<"JetPhiDelta: "<<jetPhiDelta<<std::endl;
3037 
3038  fh1EmbeddedJetPhiDelta->Fill(jetPhiDelta);
3039  }
3040  }else{fh1EmbeddedJetPhiDelta->Fill(-99.);}
3041  }//end if fEPAnalysis
3042 
3043  Float_t maxDist = 0.3;//starting value, later the real DeltaR cut will be applied
3044 
3045  iEmbeddedMatchIndex.Set(nEmbeddedJets);
3046  iRecMatchIndex.Set(nRecJetsCuts);
3047  fRecMatchPtFraction.Set(nRecJetsCuts);
3048 
3049  iEmbeddedMatchIndex.Reset(-1);
3050  iRecMatchIndex.Reset(-1);
3051  fRecMatchPtFraction.Reset(0);
3052 
3053  //get closest jets between embedded detector level jets and reconstructed detector level in extra tracks branch
3054 
3055  if(fDebug>2)std::cout<<"GetClosestJets(): "<<std::endl;
3056  if(fDebug>2)std::cout<<"nRecJetsCuts: "<<nRecJetsCuts<<std::endl;
3057  if(fDebug>2)std::cout<<"nEmbeddedJets: "<<nEmbeddedJets<<std::endl;
3058 
3059 
3060  //loop over embedded jets, fetch jet phi and difference to 2nd order harmonic event plane
3061 
3062 
3063  AliAnalysisHelperJetTasks::GetClosestJets(fJetsEmbedded, nEmbeddedJets,
3064  fJetsRecCuts, nRecJetsCuts,
3065  iRecMatchIndex,iEmbeddedMatchIndex,
3066  0,maxDist);
3067 
3068 
3069  //std::cout<<"Hallo!"<<std::endl;
3070 
3071 
3072  // embedded pt fraction
3073  for(Int_t i=0; i<nRecJetsCuts; i++){
3074  AliAODJet* recJet = (AliAODJet*) fJetsRecCuts->At(i);
3075  if(!recJet) continue;
3076 
3077  Int_t indexEmbedded = iRecMatchIndex[i];
3078 
3079  if(indexEmbedded>-1){
3080  AliAODJet* embeddedJet = (AliAODJet*) fJetsEmbedded->At(indexEmbedded);
3081  fRecMatchPtFraction[i] = AliAnalysisHelperJetTasks::GetFractionOfJet(recJet, embeddedJet, 1); // mode 1 / 2nd arg is denominator of fraction
3082 
3083  //std::cout<<"fRecMatchPtFraction["<<i<<"]: "<<fRecMatchPtFraction[i]<<std::endl;
3084 
3085 
3086  }
3087  }
3088 
3089  // match embedded rec. level and particle level jets
3090  if(nGenJets > 0){
3091 
3092  iEmbeddedMatchIndexMC.Set(nEmbeddedJets);
3093  iGenMatchIndex.Set(nGenJets);
3094  fGenMatchPtFraction.Set(nGenJets);
3095 
3096  iEmbeddedMatchIndexMC.Reset(-1);
3097  iGenMatchIndex.Reset(-1);
3098  fGenMatchPtFraction.Reset(0);
3099 
3100  if(fDebug > 2)std::cout<<" nGenJets "<<nGenJets<<" nEmbeddedJets "<<nEmbeddedJets<<std::endl;
3101 
3102  //get closest jets between embedded detector level and particle level PYTHIA jets
3103 
3104  AliAnalysisHelperJetTasks::GetClosestJets(fJetsEmbedded, nEmbeddedJets,
3105  fJetsGen, nGenJets,
3106  iGenMatchIndex,iEmbeddedMatchIndexMC,
3107  0,maxDist);
3108 
3109  // embedded pt fraction
3110  for(Int_t i=0; i<nGenJets; i++){
3111  AliAODJet* genJet = (AliAODJet*) fJetsGen->At(i);
3112  if(!genJet) continue;
3113  Int_t indexEmbedded = iGenMatchIndex[i];
3114  if(indexEmbedded>-1){
3115  AliAODJet* embeddedJet = (AliAODJet*) fJetsEmbedded->At(indexEmbedded);
3116  fGenMatchPtFraction[i] = AliAnalysisHelperJetTasks::GetFractionOfJet(genJet, embeddedJet, 2); // mode 1 / 2nd arg is denominator of fraction
3117  }
3118  }
3119  }
3120  }
3121 
3122  }//end if embedding mode
3123 
3124  //--------------------------------------
3125  //____ fetch background clusters ___________(for data analysis these are the kt04 background clusters, for Embedding study these are the standard antikt jets of the data event (in which the PYTHIA jets are embedded into))___________
3126 
3127  if(fBranchRecBckgClusters.Length() != 0){
3128 
3129  Int_t nBJ = GetListOfBckgJets(fBckgJetsRec, kJetsRecAcceptance);
3130 
3131  if(fDebug>2)std::cout<<" fBranchRecBckgClusters: "<<fBranchRecBckgClusters<<std::endl;
3132 
3133  Int_t nRecBckgJets = 0;
3134  if(nBJ>=0) nRecBckgJets = fBckgJetsRec->GetEntries();
3135  if(fDebug>2)Printf("%s:%d Selected Rec background jets: %d %d",(char*)__FILE__,__LINE__,nBJ,nRecBckgJets);
3136  if(nBJ != nRecBckgJets) Printf("%s:%d Mismatch Selected Rec background jets before cuts: %d %d",(char*)__FILE__,__LINE__,nBJ,nRecBckgJets);
3137 
3138 
3139 
3140  //++++++++++++++
3141 
3142 
3143  if(!(fUseExtraTracks == 0)){//for Embedding study only
3144 
3145  fTracksRecBckgCuts->Clear();
3146  Int_t nTBckgCuts = GetListOfTracks(fTracksRecBckgCuts, kTrackAODCuts);//all standard tracks of data event, no embedded tracks
3147 
3148  if(fDebug>2)Printf("%s:%d selected reconstructed standard Bckg tracks after cuts: %d %d",(char*)__FILE__,__LINE__,nTBckgCuts,fTracksRecBckgCuts->GetEntries());
3149 
3150  fIsNJEventEmb = kFALSE;//initialize boolean flag
3151 
3152  if(nRecBckgJets == 0)fh1NJEmbEvt->Fill(1.);
3153 
3154  //loop Bckg Jets
3155 
3156  Int_t nRemainingBckgJets = nRecBckgJets; //init value for NJ events for embedding study
3157 
3158  for(Int_t ij=0; ij<nRecBckgJets; ++ij){ // loop over all jets in event
3159 
3160  AliAODJet* jetBckg = (AliAODJet*) (fBckgJetsRec->At(ij));
3161  if(!jetBckg)continue;
3162 
3163  jettracklist->Clear();
3164 
3165  Double_t sumBckgPt = 0.;
3166  Bool_t isBadBckgJet = kFALSE;//flag for testing leading constituent bias
3167  Bool_t isBadJet = kFALSE;//flag for area and jet pt cut
3168 
3169  //apply some further jet cuts since they are not carried out in GetListOfBckgJets()
3170  if( jetBckg->Pt() < fJetPtCut ) {isBadJet=kTRUE;}
3171  if( jetBckg->EffectiveAreaCharged() < fJetMinArea ) {isBadJet=kTRUE;}
3172 
3173  Double_t jetBckgPt = jetBckg->Pt();
3174  if(isBadJet == kFALSE)fh1BckgJets->Fill(jetBckgPt);//all cuts on jets except LeadingTrackPt cut are applied here
3175 
3176 
3177  if((GetFFRadius()<=0)&&(isBadJet == kFALSE)){
3178  GetJetTracksTrackrefs(jettracklist, jetBckg, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadBckgJet);
3179  if(isBadBckgJet == kTRUE)isBadJet = kTRUE;// list of jet tracks from trackrefs, normally not used here
3180  } else {
3181  if(isBadJet == kFALSE){GetJetTracksPointing(fTracksRecBckgCuts, jettracklist, jetBckg, GetFFRadius(), sumBckgPt, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadBckgJet); // fill list of tracks in cone around jet axis with cone Radius (= 0.4 standard)
3182  if(isBadBckgJet == kTRUE)isBadJet = kTRUE;
3183  }
3184  }
3185 
3186  //APPLICATION OF REMAINING JET CUTS (leading track pt bias etc..):
3187  if(isBadJet == kTRUE){
3188  nRemainingBckgJets = nRemainingBckgJets-1;//remove one jet from nRemainingJets (was initialized with nRecJetsCuts) continue;//all bad jets are rejected
3189 
3190  if(nRemainingBckgJets == 0){fIsNJEventEmb = kTRUE;fh1NJEmbEvt->Fill(1.);}//set switch for Embedding into NJ events
3191  }
3192 
3193  if((fDebug>3)&&(isBadJet==kFALSE)){std::cout<<"Embedding BckgJet - jetPt:"<<jetBckg->Pt()<<"- jetEta: "<<jetBckg->Eta()<<" - jetAreaCharged: "<<jetBckg->EffectiveAreaCharged()<<std::endl;
3194  std::cout<<"nRecBckgJets: "<<nRecBckgJets<<std::endl;
3195  std::cout<<" "<<std::endl;}
3196 
3197  if(isBadJet == kFALSE)fh1BckgJetsPtBias->Fill(jetBckgPt);//good jets are filled here
3198  //if(fDebug>3)std::cout<<"isBadJet: "<<isBadJet<<std::endl;
3199 
3200  jettracklist->Clear();
3201 
3202  }
3203 
3204  fTracksRecBckgCuts->Clear();//all tracks in the event from standard track branch
3205  }
3206 
3207  }
3208  //------------------------------------
3209  //____ fetch reconstructed particles __________________________________________________________
3210 
3211  Int_t nTCuts;
3212 
3213  if(fUseExtraTracks == 1) nTCuts = GetListOfTracks(fTracksRecCuts, kTrackAODExtraCuts);//all tracks in PYTHIA embedded events
3214 
3215 
3216  else if(fUseExtraTracks == -1) nTCuts = GetListOfTracks(fTracksRecCuts, kTrackAODExtraonlyCuts);// only tracks from PYTHIA embedding
3217  else nTCuts = GetListOfTracks(fTracksRecCuts, kTrackAODCuts);//all standard tracks of event, no embedded tracks
3218 
3219 
3220  if(fDebug>2)Printf("%s:%d selected reconstructed tracks after cuts: %d %d",(char*)__FILE__,__LINE__,nTCuts,fTracksRecCuts->GetEntries());
3221  if(fTracksRecCuts->GetEntries() != nTCuts)
3222  Printf("%s:%d Mismatch selected reconstructed tracks after cuts: %d %d",(char*)__FILE__,__LINE__,nTCuts,fTracksRecCuts->GetEntries());
3223 
3224  if(nTCuts>=0) fh1EvtMult->Fill(fTracksRecCuts->GetEntries());
3225 
3226  Int_t nGenPart = 0;
3227  Int_t nTGen = 0;
3228 
3229  if(fMatchMode == 2){
3230  fTracksGen->Clear();
3231  nTGen = GetListOfTracks(fTracksGen,kTrackAODMCExtraonlyChargedCuts);
3232  if(nTGen>=0) nGenPart = fTracksGen->GetEntries();
3233  if(fDebug>2)Printf("%s:%d Selected Gen tracks: %d %d",(char*)__FILE__,__LINE__,nTGen,nGenPart);
3234  if(nGenPart != nTGen) Printf("%s:%d Mismatch selected Gen tracks: %d %d",(char*)__FILE__,__LINE__,nTGen,nGenPart);
3235  }
3236 
3237  //fetch V0 candidates
3238 
3239  Int_t nK0s = 0;
3240  Int_t nK0sMC = 0;
3241  Int_t nK0sStandard = 0;
3242 
3243 
3244  if(fUseExtraTracks == 1) { nK0s = GetListOfV0s(fListK0s,fK0Type,kK0,kTrackAODExtraCuts,myPrimaryVertex,fAOD);//all V0s in event with K0s assumption, all V0 cuts are applied int his function
3245  if(fUseStandard){nK0sStandard = GetListOfV0s(fListK0sStandard,fK0Type,kK0,kTrackAODCuts,myPrimaryVertex,fAOD);}//fill standard tracks for UE V0 subtraction with PYTHIA Embedding
3246  if(fMatchMode == 2){nK0sMC= GetListOfV0s(fListK0sMC,fK0Type,kK0,kV0AODMCExtraonlyCuts,myPrimaryVertex,fAOD);}//fill MC K0s in PYTHIA Embedding
3247  }
3248 
3249  if(fUseExtraTracks == -1) nK0s = GetListOfV0s(fListK0s,fK0Type,kK0,kTrackAODExtraonlyCuts,myPrimaryVertex,fAOD);// only v0s from PYTHIA embedding
3250  if(fUseExtraTracks == 0) nK0s = GetListOfV0s(fListK0s,fK0Type,kK0,kTrackAODCuts,myPrimaryVertex,fAOD);//all standard v0s of event, no embedded tracks
3251 
3252  if(fDebug>5){std::cout<<"fK0Type: "<<fK0Type<<" kK0: "<<kK0<<" myPrimaryVertex: "<<myPrimaryVertex<<" fAOD: "<<fAOD<<std::endl;}
3253 
3254  /*
3255  if(fUseExtraTracks == 1) std::cout<< "extra nK0s: "<<nK0s<<std::endl;
3256  if(fUseExtraTracks == -1) std::cout<< "extraonly nK0s: "<<nK0s<<std::endl;
3257  if(fUseExtraTracks == 0) std::cout<< "standard nK0s: "<<nK0s<<std::endl;
3258  */
3259 
3260  if(fDebug>2)Printf("%s:%d Selected Rec K0s candidates after cuts: %d %d",(char*)__FILE__,__LINE__,nK0s,fListK0s->GetEntries());
3261  if(nK0s != fListK0s->GetEntries()) Printf("%s:%d Mismatch selected K0s: %d %d",(char*)__FILE__,__LINE__,nK0s,fListK0s->GetEntries());
3262  if(fMatchMode == 2){
3263  if(fDebug>2)Printf("%s:%d Selected PYTHIA MC gen K0s candidates after cuts: %d %d",(char*)__FILE__,__LINE__,nK0sMC,fListK0sMC->GetEntries());
3264  }
3265  fh1K0Mult->Fill(fListK0s->GetEntries());
3266 
3267 
3268  Int_t nLa = 0;
3269  Int_t nLaMC = 0;
3270  Int_t nLaStandard = 0;
3271 
3272  if(fUseExtraTracks == 1) { nLa = GetListOfV0s(fListLa,fLaType,kLambda,kTrackAODExtraCuts,myPrimaryVertex,fAOD);//all V0s in event with K0s assumption
3273  if(fUseStandard == kTRUE){nLaStandard = GetListOfV0s(fListLaStandard,fLaType,kLambda,kTrackAODCuts,myPrimaryVertex,fAOD);}
3274  if(fMatchMode == 2){nLaMC= GetListOfV0s(fListLaMC,fLaType,kLambda,kV0AODMCExtraonlyCuts,myPrimaryVertex,fAOD);}
3275  }
3276 
3277  if(fUseExtraTracks == -1) nLa = GetListOfV0s(fListLa,fLaType,kLambda,kTrackAODExtraonlyCuts,myPrimaryVertex,fAOD);// only v0s from PYTHIA embedding
3278  if(fUseExtraTracks == 0) nLa = GetListOfV0s(fListLa,fLaType,kLambda,kTrackAODCuts,myPrimaryVertex,fAOD);//all standard tracks of event, no embedded tracks
3279 
3280  if(fDebug>2)Printf("%s:%d Selected Rec La candidates after cuts: %d %d",(char*)__FILE__,__LINE__,nLa,fListLa->GetEntries());
3281  if(nLa != fListLa->GetEntries()) Printf("%s:%d Mismatch selected La: %d %d",(char*)__FILE__,__LINE__,nLa,fListLa->GetEntries());
3282  fh1LaMult->Fill(fListLa->GetEntries());
3283  if(fMatchMode == 2){
3284  if(fDebug>2)Printf("%s:%d Selected PYTHIA MC gen La candidates after cuts: %d %d",(char*)__FILE__,__LINE__,nLaMC,fListLaMC->GetEntries());
3285  }
3286  Int_t nALa = 0;
3287  Int_t nALaMC = 0;
3288  Int_t nALaStandard = 0;
3289 
3290  if(fUseExtraTracks == 1) { nALa = GetListOfV0s(fListALa,fALaType,kAntiLambda,kTrackAODExtraCuts,myPrimaryVertex,fAOD);//all V0s in event with K0s assumption
3291  if(fUseStandard == kTRUE){nALaStandard = GetListOfV0s(fListALaStandard,fALaType,kAntiLambda,kTrackAODCuts,myPrimaryVertex,fAOD);}
3292  if(fMatchMode == 2){nALaMC= GetListOfV0s(fListALaMC,fALaType,kAntiLambda,kV0AODMCExtraonlyCuts,myPrimaryVertex,fAOD);}
3293  }
3294  if(fUseExtraTracks == -1) nALa = GetListOfV0s(fListALa,fALaType,kAntiLambda,kTrackAODExtraonlyCuts,myPrimaryVertex,fAOD);// only v0s from PYTHIA embedding
3295  if(fUseExtraTracks == 0) nALa = GetListOfV0s(fListALa,fALaType,kAntiLambda,kTrackAODCuts,myPrimaryVertex,fAOD);//all standard tracks of event, no embedded tracks
3296 
3297  if(fDebug>2)Printf("%s:%d Selected Rec ALa candidates after cuts: %d %d",(char*)__FILE__,__LINE__,nALa,fListALa->GetEntries());
3298  if(nALa != fListALa->GetEntries()) Printf("%s:%d Mismatch selected ALa: %d %d",(char*)__FILE__,__LINE__,nALa,fListALa->GetEntries());
3299  if(fMatchMode == 2){
3300  if(fDebug>2)Printf("%s:%d Selected PYTHIA MC gen ALa candidates after cuts: %d %d",(char*)__FILE__,__LINE__,nALaMC,fListALaMC->GetEntries());
3301  }
3302  fh1ALaMult->Fill(fListALa->GetEntries());
3303 
3304 
3305 
3306  //fetch MC gen particles_______________________________________________________
3307 
3308  if(fAnalysisMC){ // here
3309 
3310  //fill feeddown histo for associated particles
3311 
3312  // Access MC generated particles, fill TLists and histograms :
3313 
3314  Int_t nMCgenK0s = GetListOfMCParticles(fListMCgenK0s,kK0,fAOD); //fill TList with MC generated primary true K0s (list to fill, particletype, mc aod event)
3315  if(nMCgenK0s != fListMCgenK0s->GetEntries()) Printf("%s:%d Mismatch selected MCgenK0s: %d %d",(char*)__FILE__,__LINE__,nMCgenK0s,fListMCgenK0s->GetEntries());
3316 
3317 
3318  for(Int_t it=0; it<fListMCgenK0s->GetSize(); ++it){ // loop MC generated K0s, filling histograms
3319 
3320  AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenK0s->At(it));
3321  if(!mcp0) continue;
3322 
3323  //MC gen K0s
3324 
3325  //Double_t fRapCurrentPart = MyRapidity(mcp0->E(),mcp0->Pz());
3326  Double_t fEtaCurrentPart = mcp0->Eta();
3327  Double_t fPtCurrentPart = mcp0->Pt();
3328 
3329  fh1MCEtaK0s->Fill(fEtaCurrentPart);
3330  //fh1MCRapK0s->Fill(fRapCurrentPart);
3331  fh1MCPtK0s->Fill(fPtCurrentPart);
3332 
3333  fh2MCEtaVsPtK0s->Fill(fPtCurrentPart,fEtaCurrentPart); //eta cut, physical primary selection and decay mode considered
3334 
3335  }//end of the loop
3336 
3337  Int_t nMCgenLa = GetListOfMCParticles(fListMCgenLa,kLambda,fAOD); //fill TList with MC generated primary true Lambdas (list to fill, particletype, mc aod event)
3338  if(nMCgenLa != fListMCgenLa->GetEntries()) Printf("%s:%d Mismatch selected MCgenLa: %d %d",(char*)__FILE__,__LINE__,nMCgenLa,fListMCgenLa->GetEntries());
3339 
3340  TList *mclist = fAOD->GetList();
3341  TClonesArray *stackMC = 0x0;
3342  stackMC = (TClonesArray*)mclist->FindObject(AliAODMCParticle::StdBranchName());
3343  if (!stackMC) {
3344  Printf("ERROR: AliAnalysisTaskJetChem.cxx: loop over MC gen. particles: stackMC not available!");
3345  }
3346 
3347  AliAODMCHeader *mcHdr=(AliAODMCHeader*)mclist->FindObject(AliAODMCHeader::StdBranchName());
3348  if(!mcHdr)Printf("ERROR: AliAnalysisTaskJetChem.cxx: loop over MC gen. particles: mcHdr not available!");
3349 
3350  for(Int_t it=0; it<fListMCgenLa->GetSize(); ++it){ // loop MC generated La, filling histograms
3351 
3352  AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenLa->At(it));
3353  if(!mcp0) continue;
3354 
3355  //MC gen Lambdas
3356 
3357  //Double_t fRapCurrentPart = MyRapidity(mcp0->E(),mcp0->Pz());
3358  Double_t fEtaCurrentPart = mcp0->Eta();
3359  Double_t fPtCurrentPart = mcp0->Pt();
3360  TString generatorName;
3361 
3362  fh1MCEtaLambda->Fill(fEtaCurrentPart);
3363  //fh1MCRapLambda->Fill(fRapCurrentPart);
3364  fh1MCPtLambda->Fill(fPtCurrentPart);
3365  fh2MCEtaVsPtLa->Fill(fPtCurrentPart,fEtaCurrentPart); //eta cut, physical primary selection and decay mode considered
3366 
3367  //Int_t mcp0label = mcp0->GetLabel();
3368  // Bool_t istrackInject = IsTrackInjected(mcp0label, mcHdr, stackMC, generatorName);
3369 
3370  //std::cout<<"generatorName: "<<generatorName<<std::endl;
3371 
3372  /*
3373  if(generatorName == "Hijing"){
3374  fh2MCEtaVsPtHijingLa->Fill(fPtCurrentPart,fEtaCurrentPart);
3375  }
3376 
3377  if(istrackInject == kTRUE){
3378  fh2MCEtaVsPtInjectLa->Fill(fPtCurrentPart,fEtaCurrentPart);
3379  } */
3380 
3381  }//end of the loop
3382 
3383 
3384  Int_t nMCgenALa = GetListOfMCParticles(fListMCgenALa,kAntiLambda,fAOD); //fill TList with MC generated primary true Antilambdas (list to fill, particletype, mc aod event)
3385  if(nMCgenALa != fListMCgenALa->GetEntries()) Printf("%s:%d Mismatch selected MCgenALa: %d %d",(char*)__FILE__,__LINE__,nMCgenALa,fListMCgenALa->GetEntries());
3386 
3387 
3388  for(Int_t it=0; it<fListMCgenALa->GetSize(); ++it){ // loop MC generated ALa, filling histograms
3389 
3390  AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenALa->At(it));
3391  if(!mcp0) continue;
3392 
3393  //MC gen Antilambdas
3394 
3395  // Double_t fRapCurrentPart = MyRapidity(mcp0->E(),mcp0->Pz());
3396  Double_t fEtaCurrentPart = mcp0->Eta();
3397  Double_t fPtCurrentPart = mcp0->Pt();
3398  TString generatorName;
3399 
3400  fh1MCEtaAntiLambda->Fill(fEtaCurrentPart);
3401  //fh1MCRapAntiLambda->Fill(fRapCurrentPart);
3402  fh1MCPtAntiLambda->Fill(fPtCurrentPart);
3403  fh2MCEtaVsPtALa->Fill(fPtCurrentPart,fEtaCurrentPart); //eta cut, physical primary selection and decay mode considered
3404 
3405 
3406  // Int_t mcp0label = mcp0->GetLabel();
3407  // Bool_t istrackInject = IsTrackInjected(mcp0label, mcHdr, stackMC, generatorName);
3408 
3409  //std::cout<<"generatorName: "<<generatorName<<std::endl;
3410 
3411  /*
3412  if(generatorName == "Hijing"){
3413  fh2MCEtaVsPtHijingALa->Fill(fPtCurrentPart,fEtaCurrentPart);
3414  }
3415 
3416  if(istrackInject == kTRUE){
3417  fh2MCEtaVsPtInjectALa->Fill(fPtCurrentPart,fEtaCurrentPart);
3418  } */
3419 
3420 
3421  }//end of the loop
3422 
3423 
3424 
3425  //loop over MC feeddown candidates in TList
3426 
3427  //....
3428 
3429 
3430  } //end MCAnalysis part for gen particles
3431 
3432 
3433  // ___ V0 QA + K0s + La + ALa pt spectra all events _______________________________________________
3434 
3435  Double_t lPrimaryVtxPosition[3];
3436  Double_t lV0Position[3];
3437  lPrimaryVtxPosition[0] = primVtx->GetX();
3438  lPrimaryVtxPosition[1] = primVtx->GetY();
3439  lPrimaryVtxPosition[2] = primVtx->GetZ();
3440  Double_t dRadiusExcludeCone = 2*GetFFRadius(); //2 times jet radius
3441 
3442  //##########################################
3443  //------------------------------------------
3444  for(Int_t it=0; it<fListK0s->GetSize(); ++it){ //loop over all K0s candidates in PbPb event
3445 
3446  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListK0s->At(it));
3447  if(!v0) continue;
3448 
3449  // VO's main characteristics to check the reconstruction cuts
3450 
3451  //Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
3452  Double_t invMK0s=0;
3453  Double_t trackPt=0;
3454  Double_t fV0Radius = -999;
3455  Double_t fDcaV0Daughters = v0->DcaV0Daughters();
3456  Double_t fDcaPosToPrimVertex = v0->DcaPosToPrimVertex();//IP of positive charged daughter
3457  Double_t fDcaNegToPrimVertex = v0->DcaNegToPrimVertex();//IP of negative charged daughter
3458  Int_t negDaughterpdg = 0;
3459  Int_t posDaughterpdg = 0;
3460  Int_t motherType = 0;
3461  Int_t v0Label = -1;
3462  Double_t MCPt = 0;
3463  Bool_t fPhysicalPrimary = kFALSE;//don't use IsPhysicalPrimary() anymore for MC analysis, use instead 2D distance from primary to secondary vertex
3464  Int_t MCv0PdgCode = 0;
3465 
3466  AliAODTrack *trackPos = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(0));
3467  AliAODTrack *trackNeg = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(1));
3468 
3469  Double_t PosEta = trackPos->AliAODTrack::Eta();//daughter track charge is sometimes wrong here, account for that!!!
3470  Double_t NegEta = trackNeg->AliAODTrack::Eta();
3471 
3472  //Double_t trackPosNcls = trackPos->GetTPCNcls();//Get number of clusters for positive charged tracks
3473  //Double_t trackNegNcls = trackNeg->GetTPCNcls();//Get number of clusters for negative charged tracks
3474 
3475  CalculateInvMass(v0, kK0, invMK0s, trackPt); //function to calculate invMass with TLorentzVector class
3476 
3477 
3478  //OUTSIDE CONES:########
3479 
3480  //V0 particles
3481 
3482  Double_t fEta = v0->PseudoRapV0();
3483  Bool_t bIsInCone = kFALSE;//init boolean, is not in any cone (OC)
3484  Int_t nRemainingJets = nRecJetsCuts; //init value Int_t nRemainingJets = nRecJetsCuts; //init value
3485 
3486  for(Int_t ij=0; ij<nRecJetsCuts; ++ij){ // loop over all jets in event
3487 
3488  AliAODJet* jet = (AliAODJet*) (fJetsRecCuts->At(ij));
3489  jettracklist->Clear();
3490 
3491  Double_t sumPt = 0.;
3492  Bool_t isBadJet = kFALSE;
3493 
3494  if(GetFFRadius()<=0){
3495  GetJetTracksTrackrefs(jettracklist, jet, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet);// list of jet tracks from trackrefs
3496  } else {
3497  GetJetTracksPointing(fTracksRecCuts, jettracklist, jet, GetFFRadius(), sumPt, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet); // fill list of tracks in cone around jet axis with cone Radius (= 0.4 standard)
3498  }
3499 
3500  //leading track pt bias on jets inside this small jet loop
3501  //APPLICATION OF REMAINING JET CUTS (leading track pt bias etc..):
3502  if(isBadJet){
3503  nRemainingJets = nRemainingJets-1;//remove one jet from nRemainingJets (was initialized with nRecJetsCuts) //all bad jets are rejected
3504  continue;
3505  }
3506 
3507  //if jet is selected, then check whether V0 is part of the jet cone:
3508  if(IsParticleInCone(jet, v0, dRadiusExcludeCone) == kTRUE) {bIsInCone = kTRUE;}//is v0 of PbPb event part of the (selected) jet cone?
3509 
3510  jettracklist->Clear();
3511  }
3512 
3513  //################OCs##########################################standard method#####################################
3514  if(fUseExtraTracks == 0){//standard PbPb analysis
3515  if((bIsInCone==kFALSE)&&(nRemainingJets > 0)){//K0s is not part of any selected jet in event, but its a jet event
3516  Double_t vK0sOC[3] = {invMK0s,trackPt,fEta};
3517  fhnK0sOC->Fill(vK0sOC);
3518  }
3519  }
3520 
3521 
3522 
3523  //#################################################################################################################
3524 
3525  //end of outside cone K0s
3526 
3527  Double_t fV0cosPointAngle = v0->CosPointingAngle(lPrimaryVtxPosition);
3528 
3529  lV0Position[0]= v0->DecayVertexV0X();
3530  lV0Position[1]= v0->DecayVertexV0Y();
3531  lV0Position[2]= v0->DecayVertexV0Z();
3532 
3533  Double_t fV0DecayLength = v0->DecayLengthV0(lPrimaryVtxPosition);
3534  fV0Radius = TMath::Sqrt(lV0Position[0]*lV0Position[0]+lV0Position[1]*lV0Position[1]);
3535 
3536 
3537  fV0QAK0->FillTrackQA(v0->Eta(), TVector2::Phi_0_2pi(v0->Phi()), v0->Pt());
3538  //fFFHistosIMK0AllEvt->FillFF(trackPt, invMK0s, jetPt, incrementJetPt);
3539  //fh1trackPosNCls->Fill(trackPosNcls);
3540  //fh1trackNegNCls->Fill(trackNegNcls);
3541  fh1EtaK0s->Fill(fEta);
3542 
3543  Double_t vK0sIncl[3] = {invMK0s,trackPt,fEta}; //fill all K0s in event into THnSparse of 3 dimensions
3544  fhnK0sIncl->Fill(vK0sIncl);
3545 
3546 
3547  if(fAnalysisMC){
3548  TString generatorName;
3549  Bool_t isinjected;
3550  TList *listmc = fAOD->GetList();
3551  Bool_t mclabelcheck = MCLabelCheck(v0, kK0, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode, generatorName, isinjected);
3552  //if(fPhysicalPrimary == kFALSE)continue;
3553  //std::cout<<"mclabelcheck: "<<mclabelcheck<<std::endl;
3554  //std::cout<<"IsPhysicalPrimary: "<<fPhysicalPrimary<<std::endl;
3555 
3556  if(mclabelcheck == kFALSE)continue;
3557 
3558  Double_t vInvMassEtaTrackPtK0s[3] = {fEta,invMK0s,trackPt};
3559  fhnInvMassEtaTrackPtK0s->Fill(vInvMassEtaTrackPtK0s);//includes also feeddown particles, mainly phi particles whose decay products are considered here as primary
3560 
3561 
3562  fh1PtMCK0s->Fill(MCPt);
3563  }
3564 
3565 
3566  fh1V0Eta->Fill(fEta);
3567  //fh1V0totMom->Fill(fV0TotalMomentum);
3568  fh1CosPointAngle->Fill(fV0cosPointAngle);
3569  fh1DecayLengthV0->Fill(fV0DecayLength);
3570  fh1V0Radius->Fill(fV0Radius);
3571  fh1DcaV0Daughters->Fill(fDcaV0Daughters);
3572  fh1DcaPosToPrimVertex->Fill(fDcaPosToPrimVertex);
3573  fh1DcaNegToPrimVertex->Fill(fDcaNegToPrimVertex);
3574  fh1trackPosEta->Fill(PosEta);
3575  fh1trackNegEta->Fill(NegEta);
3576  }
3577 
3578 
3579  // __La pt spectra all events _______________________________________________
3580 
3581 
3582  for(Int_t it=0; it<fListLa->GetSize(); ++it){ // loop all La
3583 
3584  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListLa->At(it));
3585  if(!v0) continue;
3586 
3587  // VO's main characteristics to check the reconstruction cuts
3588  // Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
3589  Double_t invMLa =0;
3590  Double_t trackPt=0;
3591  Double_t fV0Radius = -999;
3592  Double_t fDcaV0Daughters = v0->DcaV0Daughters();
3593  Double_t fDcaPosToPrimVertex = v0->DcaPosToPrimVertex();//IP of positive charged daughter
3594  Double_t fDcaNegToPrimVertex = v0->DcaNegToPrimVertex();//IP of negative charged daughter
3595  Int_t negDaughterpdg = 0;
3596  Int_t posDaughterpdg = 0;
3597  Int_t motherType = 0;
3598  Int_t v0Label = -1;
3599  Double_t MCPt = 0;
3600  Bool_t fPhysicalPrimary = kFALSE;
3601  Int_t MCv0PdgCode = 0;
3602  AliAODTrack *trackPos = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(0));
3603  AliAODTrack *trackNeg = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(1));
3604 
3605  //Double_t trackPosNcls = trackPos->GetTPCNcls();//Get number of clusters for positive charged tracks
3606  //Double_t trackNegNcls = trackNeg->GetTPCNcls();//Get number of clusters for negative charged tracks
3607 
3608  Double_t PosEta = trackPos->AliAODTrack::Eta();//daughter track charge is sometimes wrong here, account for that!!!
3609  Double_t NegEta = trackNeg->AliAODTrack::Eta();
3610 
3611  Double_t fEta = v0->PseudoRapV0();
3612  Bool_t bIsInCone = kFALSE;//init boolean, is not in any cone (OC)
3613  Int_t nRemainingJets = nRecJetsCuts; //init value
3614 
3615  CalculateInvMass(v0, kLambda, invMLa, trackPt);//function to calculate invMass with TLorentzVector class
3616 
3617 
3618  for(Int_t ij=0; ij<nRecJetsCuts; ++ij){ // loop over all jets in event
3619 
3620  AliAODJet* jet = (AliAODJet*) (fJetsRecCuts->At(ij));
3621  jettracklist->Clear();
3622  Double_t sumPt = 0.;
3623  Bool_t isBadJet = kFALSE;
3624 
3625  if(GetFFRadius()<=0){
3626  GetJetTracksTrackrefs(jettracklist, jet, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet);// list of jet tracks from trackrefs
3627  } else {
3628  GetJetTracksPointing(fTracksRecCuts, jettracklist, jet, GetFFRadius(), sumPt, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet); // fill list of tracks in cone around jet axis with cone Radius (= 0.4 standard) + Check of leading constituent condition (= minPtL) carried out by method implemented in class AliAnalysisTaskFragmentationFunction
3629  }
3630 
3631 
3632  //leading track pt bias on jets inside this small jet loop
3633 
3634  if(isBadJet){
3635  nRemainingJets = nRemainingJets-1;//remove one jet from nRemainingJets (was initialized with nRecJetsCuts) continue;//all bad jets are rejected
3636  continue;
3637  }
3638 
3639  if(IsParticleInCone(jet, v0, dRadiusExcludeCone) == kTRUE) {bIsInCone = kTRUE;}
3640 
3641  jettracklist->Clear();
3642  } //end jet loop
3643 
3644 //at this point, the v0 candidate received a flag (bIsInCone) whether it belongs to any selected jet in event
3645 
3646  //standard OCs method:
3647 
3648  if(fUseExtraTracks == 0){//standard tracks
3649 
3650  if((bIsInCone == kFALSE)&&(nRemainingJets > 0)){//success! Lambda doesn't belong to any selected jet in event
3651  Double_t vLaOC[3] = {invMLa, trackPt,fEta};
3652  fhnLaOC->Fill(vLaOC);
3653  }
3654  }
3655 
3656 
3657  Double_t fV0DecayLength = v0->DecayLengthV0(lPrimaryVtxPosition);
3658  Double_t fV0cosPointAngle = v0->CosPointingAngle(lPrimaryVtxPosition);
3659  lV0Position[0]= v0->DecayVertexV0X();
3660  lV0Position[1]= v0->DecayVertexV0Y();
3661  lV0Position[2]= v0->DecayVertexV0Z();
3662 
3663  fV0Radius = TMath::Sqrt(lV0Position[0]*lV0Position[0]+lV0Position[1]*lV0Position[1]);
3664 
3665  //fFFHistosIMLaAllEvt->FillFF(trackPt, invMLa, jetPt, incrementJetPt);
3666  //fh1trackPosNCls->Fill(trackPosNcls);
3667  //fh1trackNegNCls->Fill(trackNegNcls);
3668  fh1EtaLa->Fill(fEta);
3669 
3670  Double_t vLaIncl[3] = {invMLa,trackPt,fEta};
3671  fhnLaIncl->Fill(vLaIncl);
3672 
3673  if(fAnalysisMC){
3674 
3675  TString generatorName;
3676  Bool_t isinjected;
3677  TList* listmc = fAOD->GetList();
3678  Bool_t mclabelcheck = MCLabelCheck(v0, kLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode, generatorName, isinjected);
3679  if(mclabelcheck == kFALSE)continue;
3680  //if(fPhysicalPrimary == kFALSE)continue;
3681  /*
3682  if(generatorName == "Hijing"){
3683  Double_t vrecMCHijingLaIncl[3] = {invMLa,trackPt,fEta};
3684  fhnrecMCHijingLaIncl->Fill(vrecMCHijingLaIncl);
3685 
3686  Double_t protonPt = trackPos->Pt();
3687  fh2CorrHijingLaProton->Fill(trackPt,protonPt);
3688  }
3689 
3690  if(isinjected == kTRUE){
3691  Double_t vrecMCInjectLaIncl[3] = {invMLa,trackPt,fEta};
3692  fhnrecMCInjectLaIncl->Fill(vrecMCInjectLaIncl);
3693 
3694  Double_t protonPt = trackPos->Pt();
3695  fh2CorrInjectLaProton->Fill(trackPt,protonPt);
3696  }*/
3697 
3698  Double_t vInvMassEtaTrackPtLa[3] = {fEta,invMLa,trackPt};
3699  fhnInvMassEtaTrackPtLa->Fill(vInvMassEtaTrackPtLa);//includes also feed-down particles
3700  fh1PtMCLa->Fill(MCPt);
3701 
3702 
3703  fh1PtMCLa->Fill(MCPt);
3704 
3705 
3706  }
3707  fh1V0Eta->Fill(fEta);
3708  //fh1V0totMom->Fill(fV0TotalMomentum);
3709  fh1CosPointAngle->Fill(fV0cosPointAngle);
3710  fh1DecayLengthV0->Fill(fV0DecayLength);
3711  fh1V0Radius->Fill(fV0Radius);
3712  fh1DcaV0Daughters->Fill(fDcaV0Daughters);
3713  fh1DcaPosToPrimVertex->Fill(fDcaPosToPrimVertex);
3714  fh1DcaNegToPrimVertex->Fill(fDcaNegToPrimVertex);
3715  fh1trackPosEta->Fill(PosEta);
3716  fh1trackNegEta->Fill(NegEta);
3717  }
3718 
3719  // __ALa pt spectra all events _______________________________________________
3720 
3721  for(Int_t it=0; it<fListALa->GetSize(); ++it){ // loop all ALa
3722 
3723  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListALa->At(it));
3724  if(!v0) continue;
3725 
3726 
3727  //VO's main characteristics to check the reconstruction cuts
3728  Double_t invMALa =0;
3729  Double_t trackPt=0;
3730  Double_t fV0Radius = -999;
3731  Double_t fDcaV0Daughters = v0->DcaV0Daughters();
3732  Double_t fDcaPosToPrimVertex = v0->DcaPosToPrimVertex();//IP of positive charged daughter
3733  Double_t fDcaNegToPrimVertex = v0->DcaNegToPrimVertex();//IP of negative charged daughter
3734  Int_t negDaughterpdg = 0;
3735  Int_t posDaughterpdg = 0;
3736  Int_t motherType = 0;
3737  Int_t v0Label = -1;
3738  Double_t MCPt = 0;
3739  Bool_t fPhysicalPrimary = kFALSE;
3740  Int_t MCv0PdgCode = 0;
3741 
3742  AliAODTrack *trackPos = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(0));
3743  AliAODTrack *trackNeg = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(1));
3744 
3745  Double_t PosEta = trackPos->AliAODTrack::Eta();//daughter track charge is sometimes wrong here, account for that!!!
3746  Double_t NegEta = trackNeg->AliAODTrack::Eta();
3747 
3748  Double_t fEta = v0->PseudoRapV0();
3749  Bool_t bIsInCone = kFALSE;//init boolean for OC
3750  Int_t nRemainingJets = nRecJetsCuts; //init value
3751 
3752 
3753  CalculateInvMass(v0, kAntiLambda, invMALa, trackPt); //function to calculate invMass with TLorentzVector class
3754 
3755  for(Int_t ij=0; ij<nRecJetsCuts; ++ij){ // loop over all jets in event
3756 
3757  AliAODJet* jet = (AliAODJet*) (fJetsRecCuts->At(ij));
3758  jettracklist->Clear();
3759  Double_t sumPt = 0.;
3760  Bool_t isBadJet = kFALSE;
3761 
3762 
3763  if(GetFFRadius()<=0){
3764  GetJetTracksTrackrefs(jettracklist, jet, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet);// list of jet tracks from trackrefs
3765  } else {
3766  GetJetTracksPointing(fTracksRecCuts, jettracklist, jet, GetFFRadius(), sumPt, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet); // fill list of tracks in cone around jet axis with cone Radius (= 0.4 standard)
3767  }
3768 
3769  //leading track pt bias on jets inside this small jet loop
3770 
3771  if(isBadJet){
3772  nRemainingJets = nRemainingJets-1;//remove one jet from nRemainingJets (was initialized with nRecJetsCuts) continue;//all bad jets are rejected
3773  continue;
3774  }
3775 
3776 
3777  if(IsParticleInCone(jet, v0, dRadiusExcludeCone) == kTRUE){
3778  bIsInCone = kTRUE;
3779  }
3780 
3781  jettracklist->Clear();
3782  }
3783 
3784 
3785  if(fUseExtraTracks == 0){//standard PbPb analysis
3786  if((bIsInCone == kFALSE)&&(nRemainingJets > 0)){//success!
3787  Double_t vALaOC[3] = {invMALa, trackPt,fEta};
3788  fhnALaOC->Fill(vALaOC);
3789  }
3790  }
3791 
3792 
3793  Double_t fV0cosPointAngle = v0->CosPointingAngle(lPrimaryVtxPosition);
3794  lV0Position[0]= v0->DecayVertexV0X();
3795  lV0Position[1]= v0->DecayVertexV0Y();
3796  lV0Position[2]= v0->DecayVertexV0Z();
3797  Double_t fV0DecayLength = v0->DecayLengthV0(lPrimaryVtxPosition);
3798  fV0Radius = TMath::Sqrt(lV0Position[0]*lV0Position[0]+lV0Position[1]*lV0Position[1]);
3799 
3800  //fFFHistosIMALaAllEvt->FillFF(trackPt, invMALa, jetPt, incrementJetPt);
3801  //fh1trackPosNCls->Fill(trackPosNcls);
3802  //fh1trackNegNCls->Fill(trackNegNcls);
3803  fh1EtaALa->Fill(fEta);
3804 
3805  Double_t vALaIncl[3] = {invMALa,trackPt,fEta};
3806  fhnALaIncl->Fill(vALaIncl);
3807 
3808  if(fAnalysisMC){
3809  TString generatorName;
3810  Bool_t isinjected;
3811  TList* listmc = fAOD->GetList();
3812  Bool_t mclabelcheck = MCLabelCheck(v0, kAntiLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PdgCode, generatorName, isinjected);
3813  if(mclabelcheck == kFALSE)continue;
3814  //if(fPhysicalPrimary == kFALSE)continue;//take also feeddown particles into account
3815  /*
3816  if(generatorName == "Hijing"){
3817  Double_t vrecMCHijingALaIncl[3] = {invMALa,trackPt,fEta};
3818  fhnrecMCHijingALaIncl->Fill(vrecMCHijingALaIncl);
3819 
3820  Double_t aprotonPt = trackNeg->Pt();
3821  fh2CorrHijingALaAProton->Fill(trackPt,aprotonPt);
3822  }
3823 
3824 
3825  if(isinjected == kTRUE){
3826  Double_t vrecMCInjectALaIncl[3] = {invMALa,trackPt,fEta};
3827  fhnrecMCInjectALaIncl->Fill(vrecMCInjectALaIncl);
3828 
3829  Double_t aprotonPt = trackNeg->Pt();
3830  fh2CorrInjectALaAProton->Fill(trackPt,aprotonPt);
3831 
3832  }*/
3833 
3834 
3835  Double_t vInvMassEtaTrackPtALa[3] = {fEta,invMALa,trackPt};
3836  fhnInvMassEtaTrackPtALa->Fill(vInvMassEtaTrackPtALa);
3837  fh1PtMCALa->Fill(MCPt);
3838 
3839  }
3840  fh1V0Eta->Fill(fEta);
3841  //fh1V0totMom->Fill(fV0TotalMomentum);
3842  fh1CosPointAngle->Fill(fV0cosPointAngle);
3843  fh1DecayLengthV0->Fill(fV0DecayLength);
3844  fh1V0Radius->Fill(fV0Radius);
3845  fh1DcaV0Daughters->Fill(fDcaV0Daughters);
3846  fh1DcaPosToPrimVertex->Fill(fDcaPosToPrimVertex);
3847  fh1DcaNegToPrimVertex->Fill(fDcaNegToPrimVertex);
3848  fh1trackPosEta->Fill(PosEta);
3849  fh1trackNegEta->Fill(NegEta);
3850  }
3851 
3852  //_____no jets events______________________________________________________________________________________________________________________________________
3853 
3854  if(nRecJetsCuts == 0){//no jet events, before the remaining jet cuts are applied, the second part for the non-jet events comes inside the jet loop
3855 
3856  fh1NJ->Fill(1.);//for normalisation by number of NJ events for events in which no rec. jets are found right from the beginning and before even the leading track bias is applied
3857 
3858  if(fDebug>6) { std::cout<<"################## nRecJetsCuts == 0 ###################"<<std::endl;
3859  //std::cout<<"fListK0s->GetSize() in NJ event: "<<fListK0s->GetSize()<<std::endl;
3860  }
3861 
3862  for(Int_t it=0; it<fListK0s->GetSize(); ++it){ // loop all K0s
3863 
3864  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListK0s->At(it));
3865  if(!v0) continue;
3866 
3867  Double_t invMK0s =0;
3868  Double_t trackPt=0;
3869  CalculateInvMass(v0, kK0, invMK0s, trackPt);
3870  Double_t fEta = v0->Eta();
3871 
3872  Double_t vNJK0[3] = {invMK0s,trackPt,fEta}; //fill all K0s in events wo selected jets
3873  fhnNJK0->Fill(vNJK0);
3874 
3875  }
3876 
3877  for(Int_t it=0; it<fListLa->GetSize(); ++it){ // loop all La
3878 
3879  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListLa->At(it));
3880  if(!v0) continue;
3881 
3882  Double_t invMLa =0;
3883  Double_t trackPt=0;
3884  CalculateInvMass(v0, kLambda, invMLa, trackPt);
3885  Double_t fEta = v0->Eta();
3886 
3887  Double_t vNJLa[3] = {invMLa,trackPt,fEta}; //fill all K0s in events wo selected jets
3888  fhnNJLa->Fill(vNJLa);
3889 
3890  }
3891 
3892  for(Int_t it=0; it<fListALa->GetSize(); ++it){ // loop all ALa
3893 
3894  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListALa->At(it));
3895  if(!v0) continue;
3896 
3897  Double_t invMALa =0;
3898  Double_t trackPt=0;
3899  CalculateInvMass(v0, kAntiLambda, invMALa, trackPt);
3900 
3901  Double_t fEta = v0->Eta();
3902 
3903  Double_t vNJALa[3] = {invMALa,trackPt,fEta}; //fill all K0s in events wo selected jets
3904  fhnNJALa->Fill(vNJALa);
3905 
3906 
3907  }
3908 
3909  }//no jet events
3910 
3911  //____ fill all jet related histos ________________________________________________________________________________________________________________________
3912  //##########################################################################################################################################################
3913  //##########################JET LOOP########################################################################################################################
3914  //##########################################################################################################################################################
3915  //##########################################################################################################################################################
3916 
3917  Int_t nSelJets = nRecJetsCuts; //init value
3918  Bool_t IsOCEvt = kFALSE; //init for this outside cones normalisation histo (total number of OC events)
3919  Bool_t IsRCEvt = kFALSE; //init for that the random cone is placed only once per event
3920  Bool_t IsMCCEvt = kFALSE; //init for that the median cluster cone is placed only once per event
3921 
3922  //fill jet histos in general
3923  for(Int_t ij=0; ij<nRecJetsCuts; ++ij){ // ij is an index running over the list of the reconstructed jets after most of the cuts, but not yet the leading track bias, all jets in event are looped
3924 
3925  AliAODJet* jet = (AliAODJet*) (fJetsRecCuts->At(ij));
3926 
3927  Double_t jetPt = jet->Pt();
3928  Double_t jetEta = jet->Eta();
3929  Double_t jetPhi = jet->Phi();
3930 
3931  //if(ij==0){ // loop over leading jets for ij = 0, for ij>= 0 look into all jets
3932 
3933  if(ij>=0){//all jets in event
3934 
3935  jettracklist->Clear();
3936  Double_t sumPt = 0.;
3937  Bool_t isBadJet = kFALSE;
3938  Int_t njetTracks = 0;
3939 
3940  if(GetFFRadius()<=0){
3941  GetJetTracksTrackrefs(jettracklist, jet, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet);// list of jet tracks from trackrefs
3942  } else {
3943  GetJetTracksPointing(fTracksRecCuts, jettracklist, jet, GetFFRadius(), sumPt, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJet); // fill list of charged hybrid tracks in cone around jet axis with cone Radius (= 0.4 standard), check of leading track bias condition
3944  }
3945 
3946  //not applied at the moment:
3947  if((GetFFMinNTracks()>0) && (jettracklist->GetSize() <= GetFFMinNTracks())) isBadJet = kTRUE; // reject jets with less tracks than fFFMinNTracks
3948 
3949  //APPLICATION OF REMAINING JET CUTS (leading track pt bias etc..) + NJ events
3950  if((!isBadJet)&&(fDebug > 3)) {
3951  std::cout<<"Reconstructed Jet - jetPt:"<<jet->Pt()<<"- jetEta: "<<jet->Eta()<<" - jetAreaCharged: "<<jet->EffectiveAreaCharged()<<std::endl;
3952  std::cout<<"nRecJetsCuts: "<<nRecJetsCuts<<std::endl;
3953  std::cout<<" "<<std::endl;
3954  }
3955 
3956  if(isBadJet) {
3957 
3958  nSelJets = nSelJets-1;//remove one jet from nSelJets (was initialized with nRecJetsCuts)
3959 
3960  if(nSelJets == 0){//case that event doesn't contain no selected jets at all and there are no jets remaining to be looped over
3961 
3962  fh1NJ->Fill(1.);//for normalisation by number of NJ events
3963 
3964  for(Int_t it=0; it<fListK0s->GetSize(); ++it){ // loop all K0s
3965 
3966  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListK0s->At(it));
3967  if(!v0) continue;
3968 
3969  Double_t invMK0s =0;
3970  Double_t trackPt=0;
3971  CalculateInvMass(v0, kK0, invMK0s, trackPt);
3972  Double_t fEta = v0->Eta();
3973 
3974  Double_t vNJK0[3] = {invMK0s,trackPt,fEta}; //fill all K0s in events wo selected jets
3975  fhnNJK0->Fill(vNJK0);
3976 
3977  }
3978 
3979  for(Int_t it=0; it<fListLa->GetSize(); ++it){ // loop all La
3980 
3981  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListLa->At(it));
3982  if(!v0) continue;
3983 
3984  Double_t invMLa =0;
3985  Double_t trackPt=0;
3986  CalculateInvMass(v0, kLambda, invMLa, trackPt);
3987  Double_t fEta = v0->Eta();
3988 
3989  Double_t vNJLa[3] = {invMLa,trackPt,fEta}; //fill all K0s in events wo selected jets
3990  fhnNJLa->Fill(vNJLa);
3991 
3992  }
3993 
3994  for(Int_t it=0; it<fListALa->GetSize(); ++it){ // loop all ALa
3995 
3996  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListALa->At(it));
3997  if(!v0) continue;
3998 
3999  Double_t invMALa =0;
4000  Double_t trackPt=0;
4001  CalculateInvMass(v0, kAntiLambda, invMALa, trackPt);
4002 
4003  Double_t fEta = v0->Eta();
4004 
4005  Double_t vNJALa[3] = {invMALa,trackPt,fEta}; //fill all K0s in events wo selected jets
4006  fhnNJALa->Fill(vNJALa);
4007 
4008 
4009  }
4010 
4011  //Analysing charged tracks in non-jet events: for estimation of syst. uncertainty of UE subtraction methods
4012  /*
4013  for(Int_t in=0; in<fTracksRecCuts->GetEntries(); ++in){
4014 
4015  AliVParticle* track = dynamic_cast<AliVParticle*>(fTracksRecCuts->At(in)); //inputlist is fListK0s, all reconstructed K0s in event
4016  if(!track){std::cout<<"AliAnalysisTaskJetChem(): In NJ event, charged track not found!!!"<<std::endl; continue;}
4017 
4018  Double_t trackPt = track->Pt();
4019  Double_t trackEta = track->Eta();
4020  if(TMath::Abs(trackEta) <= fCutEta){
4021  fh2ChTracksNJ->Fill(trackPt,trackEta);
4022  }
4023  }*/
4024 
4025  }
4026 
4027 
4028  continue;//rejection of current jet
4029  } // rejects jets in which no track has a track pt higher than 5 GeV/c (see AddTask macro)
4030 
4031  if(IsOCEvt == kFALSE){IsOCEvt = kTRUE;fh1OC->Fill(1.);}//the first found jet triggers an OC event and is filled only once into normalisation histo
4032  //Float_t fJetAreaMin = 0.6*TMath::Pi()*GetFFRadius()*GetFFRadius(); // minimum jet area cut, already applied in JetListOfJets() in FF Task
4033 
4034  //if(fDebug > 2) {if (jet->EffectiveAreaCharged() < fJetAreaMin) {std::cout<<" fCutjetArea cut removed a jet!!!!! Should not have to be done again!!"<<std::endl;}}// cut on jet area, already done by jet selection in FF task
4035 
4036  Double_t dAreaExcluded = TMath::Pi()*dRadiusExcludeCone*dRadiusExcludeCone; // area of the cone
4037  dAreaExcluded -= AreaCircSegment(dRadiusExcludeCone,fCutjetEta-jet->Eta()); // positive eta overhang
4038  dAreaExcluded -= AreaCircSegment(dRadiusExcludeCone,fCutjetEta+jet->Eta()); // negative eta overhang
4039  fh1AreaExcluded->Fill(dAreaExcluded);//histo contains all areas that are jet related and have to be excluded concerning OC UE pt spectrum normalisation by area
4040 
4041  fh1JetEta->Fill(jetEta);
4042  fh1JetPhi->Fill(jetPhi);
4043  fh2JetEtaPhi->Fill(jetEta,jetPhi);
4044 
4045  // printf("pT = %f, eta = %f, phi = %f, leadtr pt = %f\n, ",jetPt,jetEta,jetphi,leadtrack);
4046 
4047 
4048  //###################PYTHIA JET EMBEDDING#####################################################################################################
4049  //############################################################################################################################################
4050  //############################################################################################################################################
4051  //############################################################################################################################################
4052  //############################################################################################################################################
4053 
4054 
4055  if(fUseNJEvents == kFALSE){fIsNJEventEmb = kTRUE;}//in case Embedding should be done into all events, select flag fIsNJEventEmb as always true
4056 
4057  if(!(fUseExtraTracks == 0)&&(fIsNJEventEmb == kTRUE)){//this following big block is used only for Embedding study
4058 
4059 
4060  TList* mclist = fAOD->GetList();
4061  if (!mclist){std::cout<<"mclist does not exist for Embedding study: "<<std::endl; continue;}
4062 
4063  Double_t ptFractionEmbedded = 0;
4064  Double_t deltaREmbedded = 0;
4065  AliAODJet* embeddedJet = 0;
4066 
4067  if(fDebug>2)std::cout<<"fBranchEmbeddedJets before index embedded: "<<fBranchEmbeddedJets<<std::endl;
4068 
4069  if(fBranchEmbeddedJets.Length()){ // find embedded jet
4070 
4071  Int_t indexEmbedded = iRecMatchIndex[ij];
4072  ptFractionEmbedded = fRecMatchPtFraction[ij];
4073 
4074  if(fDebug>2)std::cout<<"index embedded: "<<indexEmbedded<<std::endl;
4075  if(fDebug>2)std::cout<<"ptFractionEmbedded: "<<ptFractionEmbedded<<std::endl;
4076 
4077 
4078  fh1IndexEmbedded->Fill(indexEmbedded);
4079  fh1FractionPtEmbedded->Fill(ptFractionEmbedded);
4080 
4081  if(indexEmbedded>-1){
4082 
4083  embeddedJet = dynamic_cast<AliAODJet*>(fJetsEmbedded->At(indexEmbedded));//fetch embedded jet
4084  if(!embeddedJet) continue;
4085 
4086  //std::cout<<"pointer to embeddedJet: "<<embeddedJet<<std::endl;
4087 
4088  deltaREmbedded = jet->DeltaR((AliVParticle*) (embeddedJet));
4089  if(fDebug>2)std::cout<<"deltaREmbedded: "<<deltaREmbedded<<std::endl;
4090 
4091  fh1DeltaREmbedded->Fill(deltaREmbedded);
4092 
4093  }
4094  }
4095 
4096 
4097  if(!embeddedJet)continue;
4098 
4099 
4100  Double_t JetPtEmb = embeddedJet->Pt();
4101  fh1PtEmbBeforeMatch->Fill(JetPtEmb);
4102 
4103 
4104  if((ptFractionEmbedded < fCutFractionPtEmbedded) || (deltaREmbedded > fCutDeltaREmbedded)){
4105  Double_t JetPtRej = embeddedJet->Pt();
4106  Double_t JetEtaRej = embeddedJet->Eta();
4107 
4108  fh1PtEmbReject->Fill(JetPtRej);
4109  fh2PtEtaEmbReject->Fill(JetPtRej,JetEtaRej);
4110  }
4111 
4112 
4113  if(ptFractionEmbedded >= fCutFractionPtEmbedded && deltaREmbedded <= fCutDeltaREmbedded) // end: cut embedded ratio
4114  {
4115  if(fMatchMode == 1){
4116  FillEmbeddedHistos(embeddedJet, jet, nK0s, nLa, nALa, jettracklist);//fetch V0s for matched jets and fill embedding histos, 'jet' is matched jet here
4117  }
4118  }
4119  //################################end V0 embedding part
4120  //################################
4121 
4122  }//end of fTracksExtra != 0 check, end of embedding part
4123 
4124 
4125  //#####################End of embedding study in MatchMode 1################################################################################
4126 
4127 
4128  //############################################################################################################################################
4129  //############################################################################################################################################
4130  //############################################################################################################################################
4131  //############################################################################################################################################
4132  //############################################################################################################################################
4133 
4134  //std::cout<<"fUseExtraTracks: "<<fUseExtraTracks<<std::endl;
4135 
4136  if(fUseExtraTracks == 0){//no embedded jets are used, normally the case
4137 
4138 
4139  for(Int_t it=0; it<jettracklist->GetSize(); ++it){//loop over all charged tracks in jet
4140 
4141  AliVParticle* trackVP = dynamic_cast<AliVParticle*>(jettracklist->At(it));//all tracks in jet cone
4142  if(!trackVP)continue;
4143 
4144  Float_t trackPt = trackVP->Pt();//transversal momentum of jet particle
4145  Float_t trackEta = trackVP->Eta();
4146 
4147  Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
4148 
4149  fFFHistosRecCuts->FillFF(trackPt, jetPt, incrementJetPt);//histo with tracks/jets after cut selection, for all events
4150  if(nK0s>0) fFFHistosRecCutsK0Evt->FillFF(trackPt, jetPt, incrementJetPt);//only for K0s events
4151  fh2FFJetTrackEta->Fill(trackEta,jetPt);
4152 
4153  }
4154  }
4155 
4156 
4157  njetTracks = jettracklist->GetSize();
4158 
4159  fh1TrackMultCone->Fill(njetTracks);
4160  fh2TrackMultCone->Fill(njetTracks,jetPt);
4161 
4162  // ---- K0s ----
4163 
4164  // fQAJetHistosRecCutsLeading->FillJetQA( jet->Eta(), TVector2::Phi_0_2pi(jet->Phi()), jet->Pt() );
4165 
4166  for(Int_t it=0; it<fListK0s->GetSize(); ++it){ // loop all K0s
4167 
4168  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListK0s->At(it));
4169  if(!v0) continue;//rejection of events with no V0 vertex
4170 
4171  Double_t v0Mom[3];
4172  v0->PxPyPz(v0Mom);
4173  TVector3 v0MomVect(v0Mom);
4174 
4175  Double_t dPhiJetK0 = (jet->MomentumVector()->Vect()).DeltaPhi(v0MomVect);
4176  // Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
4177 
4178  // if(incrementJetPt){fh1V0JetPt->Fill(jetPt);}
4179 
4180  Double_t invMK0s =0;
4181  Double_t trackPt=0;
4182  CalculateInvMass(v0, kK0, invMK0s, trackPt); //function to calculate invMass with TLorentzVector class
4183 
4184  // fFFHistosIMK0Jet->FillFF(trackPt, invMK0s, jetPt, incrementJetPt);
4185 
4186 
4187  if(dPhiJetK0<fh1dPhiJetK0->GetXaxis()->GetXmin()) dPhiJetK0 += 2*TMath::Pi();
4188  fh1dPhiJetK0->Fill(dPhiJetK0);
4189 
4190  }
4191 
4192  // if(fListK0s->GetSize() == 0){ // no K0: increment jet pt spectrum
4193 
4194  // Bool_t incrementJetPt = kTRUE;
4195  // fFFHistosIMK0Jet->FillFF(-1, -1, jetPt, incrementJetPt);
4196  // }
4197 
4198  //____fetch reconstructed K0s in cone around jet axis:_______________________________________________________________________________
4199 
4200  jetConeK0list->Clear();
4201 
4202  Double_t sumPtK0 = 0.;
4203 
4204  Bool_t isBadJetK0 = kFALSE; // dummy, do not use
4205 
4206  GetTracksInCone(fListK0s, jetConeK0list, jet, GetFFRadius(), sumPtK0, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetK0); //reconstructed K0s in cone around jet axis
4207 
4208  if(fDebug>2)Printf("%s:%d nK0s total: %d, in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nK0s,jetConeK0list->GetEntries(),GetFFRadius());
4209 
4210 
4211  for(Int_t it=0; it<jetConeK0list->GetSize(); ++it){ // loop for K0s in jet cone
4212 
4213  AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetConeK0list->At(it));
4214  if(!v0) continue;
4215 
4216  Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
4217  Double_t invMK0s =0;
4218  Double_t trackPt=0;
4219  Double_t fEta=0;
4220  fEta = v0->Eta();
4221 
4222  CalculateInvMass(v0, kK0, invMK0s, trackPt); //function to calculate invMass with TLorentzVector class
4223 
4224 
4225  if(fAnalysisMC){
4226  Double_t jetPtSmear = -1;
4227  SmearJetPt(jetPt,jetPtSmear);
4228 
4229  fh2MC2K0Cone->Fill(jetPtSmear, trackPt); //fill MC truth for jet pt smearing
4230 
4231  if(incrementJetPt == kTRUE){fh1IMK0ConeSmear->Fill(jetPtSmear);} //fill TH1F for normalization purposes
4232 
4233  }
4234 
4235  if(incrementJetPt==kTRUE){
4236  fh1IMK0Cone->Fill(jetPt);}//normalisation by number of selected jets
4237 
4238  //fFFHistosIMK0Cone->FillFF(trackPt, invMK0s, jetPt, incrementJetPt);
4239 
4240  Double_t vK0sCone[4] = {jetPt, invMK0s,trackPt,fEta};
4241  fhnK0sCone->Fill(vK0sCone);
4242  }
4243 
4244 
4245  if(jetConeK0list->GetSize() == 0){ // no K0: increment jet pt spectrum
4246 
4247 
4248  Bool_t incrementJetPt = kTRUE;//jets without K0s will be only filled in TH1F only once, so no increment needed
4249  //fFFHistosIMK0Cone->FillFF(-1, -1, jetPt, incrementJetPt);
4250  Double_t vK0sCone[4] = {jetPt, -1, -1, -1};
4251  fhnK0sCone->Fill(vK0sCone);
4252 
4253  if(incrementJetPt==kTRUE){
4254  fh1IMK0Cone->Fill(jetPt);}//normalisation by number of selected jets
4255 
4256  if(fAnalysisMC){
4257  Double_t jetPtSmear = -1;
4258  SmearJetPt(jetPt,jetPtSmear);
4259  if(incrementJetPt == kTRUE){fh1IMK0ConeSmear->Fill(jetPtSmear);} //fill TH1F for normalization purposes
4260  }
4261  }
4262 
4263  //Random cones________________________________________________________________________
4264 
4265 
4266  if(IsRCEvt == kFALSE){//fetch random cone V0s only once per event
4267 
4268 
4269  IsRCEvt = kTRUE;//set boolean to kTRUE once a random cone is placed per event
4270 
4271  AliAODJet* jetRC = 0;
4272  jetRC = GetRandomCone(fJetsRecCuts, fCutjetEta, 2*GetFFRadius());//fetch one random cone for each event
4273 
4274  fListK0sRC->Clear();//list for K0s in random cone (RC), one RC per event
4275  fListLaRC->Clear();
4276  fListALaRC->Clear();
4277  fTracksRecCutsRC->Clear();
4278 
4279 
4280  Double_t sumPtK0sRC = 0;
4281  Double_t sumPtLaRC = 0;
4282  Double_t sumPtALaRC = 0;
4283  Double_t sumPtRecCutsRC = 0;
4284  Bool_t isBadJetK0sRC = kFALSE;
4285  Bool_t isBadJetLaRC = kFALSE;
4286  Bool_t isBadJetALaRC = kFALSE;
4287  Bool_t isBadJetRecCutsRC = kFALSE;
4288 
4289  if(jetRC != 0) {//if random cone was selected properly and fullfilling all the requirements
4290 
4291  //fetch V0s in RC:
4292  fh1RC->Fill(1.);//for normalisation purposes
4293 
4294  GetTracksInCone(fListK0s, fListK0sRC, jetRC, GetFFRadius(), sumPtK0sRC, 0, 0, isBadJetK0sRC);
4295 
4296  //________________fill RC with all V0s__________________
4297  for(Int_t it=0; it<fListK0sRC->GetSize(); ++it){ // loop for K0s in random cone
4298 
4299  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListK0sRC->At(it));
4300  if(!v0) continue;
4301 
4302  Double_t invMK0s =0;
4303  Double_t trackPt=0;
4304  Double_t fEta=0;
4305  fEta = v0->Eta();
4306 
4307  CalculateInvMass(v0, kK0, invMK0s, trackPt); //function to calculate invMass with TLorentzVector class
4308 
4309  Double_t vK0sRC[3] = {invMK0s,trackPt,fEta};
4310  fhnK0sRC->Fill(vK0sRC);
4311  }
4312 
4313 
4314 
4315  GetTracksInCone(fListLa, fListLaRC, jetRC, GetFFRadius(), sumPtLaRC, 0, 0, isBadJetLaRC);
4316 
4317  for(Int_t it=0; it<fListLaRC->GetSize(); ++it){ // loop for Lambdas in random cone
4318 
4319  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListLaRC->At(it));
4320  if(!v0) continue;
4321 
4322  Double_t invMLa =0;
4323  Double_t trackPt=0;
4324  Double_t fEta=0;
4325  fEta = v0->Eta();
4326 
4327  CalculateInvMass(v0, kLambda, invMLa, trackPt); //function to calculate invMass with TLorentzVector class
4328 
4329  Double_t vLaRC[3] = {invMLa,trackPt,fEta};
4330  fhnLaRC->Fill(vLaRC);
4331  }
4332 
4333 
4334 
4335  GetTracksInCone(fListALa, fListALaRC, jetRC, GetFFRadius(), sumPtALaRC, 0, 0, isBadJetALaRC);
4336 
4337  for(Int_t it=0; it<fListALaRC->GetSize(); ++it){ // loop for Lambdas in random cone
4338 
4339  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListALaRC->At(it));
4340  if(!v0) continue;
4341 
4342  Double_t invMALa =0;
4343  Double_t trackPt=0;
4344  Double_t fEta=0;
4345  fEta = v0->Eta();
4346 
4347  CalculateInvMass(v0, kAntiLambda, invMALa, trackPt); //function to calculate invMass with TLorentzVector class
4348 
4349  Double_t vALaRC[3] = {invMALa,trackPt,fEta};
4350  fhnALaRC->Fill(vALaRC);
4351  }
4352 
4353 
4354  if(isBadJetK0sRC == kFALSE){ //in case RC contains at least one K0s with minimum pT
4355  fh1RCBiasK0->Fill(1.);//for normalisation purposes
4356 
4357  //________________fill RC (with trigger particle bias)_____________
4358  for(Int_t it=0; it<fListK0sRC->GetSize(); ++it){ // loop for K0s in random cone
4359 
4360  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListK0sRC->At(it));
4361  if(!v0) continue;
4362 
4363  Double_t invMK0s =0;
4364  Double_t trackPt=0;
4365  Double_t fEta=0;
4366  fEta = v0->Eta();
4367 
4368  CalculateInvMass(v0, kK0, invMK0s, trackPt); //function to calculate invMass with TLorentzVector class
4369 
4370  //Double_t vK0sRC[3] = {invMK0s,trackPt,fEta};
4371  //fhnK0sRCBias->Fill(vK0sRC);
4372  }
4373  }
4374 
4375 
4376  if(isBadJetLaRC == kFALSE){ //in case RC contains at least one Lambda with minimum pT
4377  fh1RCBiasLa->Fill(1.);//for normalisation purposes
4378  for(Int_t it=0; it<fListLaRC->GetSize(); ++it){ // loop for Lambdas in random cone
4379 
4380  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListLaRC->At(it));
4381  if(!v0) continue;
4382 
4383  Double_t invMLa =0;
4384  Double_t trackPt=0;
4385  Double_t fEta=0;
4386  fEta = v0->Eta();
4387 
4388  CalculateInvMass(v0, kLambda, invMLa, trackPt); //function to calculate invMass with TLorentzVector class
4389 
4390  //Double_t vLaRC[3] = {invMLa,trackPt,fEta};
4391  //fhnLaRCBias->Fill(vLaRC);
4392  }
4393  }
4394 
4395 
4396 
4397  if(isBadJetALaRC == kFALSE){ //in case RC contains at least one Antilambda with minimum pT
4398  fh1RCBiasALa->Fill(1.);//for normalisation purposes
4399  for(Int_t it=0; it<fListALaRC->GetSize(); ++it){ // loop for Lambdas in random cone
4400 
4401  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListALaRC->At(it));
4402  if(!v0) continue;
4403 
4404  Double_t invMALa =0;
4405  Double_t trackPt=0;
4406  Double_t fEta=0;
4407  fEta = v0->Eta();
4408 
4409  CalculateInvMass(v0, kAntiLambda, invMALa, trackPt); //function to calculate invMass with TLorentzVector class
4410 
4411  //Double_t vALaRC[3] = {invMALa,trackPt,fEta};
4412  //fhnALaRCBias->Fill(vALaRC);
4413  }
4414 
4415  }
4416 
4417 
4418  GetTracksInCone(fTracksRecCuts, fTracksRecCutsRC, jetRC, GetFFRadius(), sumPtRecCutsRC, 0, 0, isBadJetRecCutsRC);
4419 
4420  /*for(Int_t in=0; in<fTracksRecCutsRC->GetEntries(); ++in){
4421 
4422  AliVParticle* track = dynamic_cast<AliVParticle*>(fTracksRecCutsRC->At(in)); //inputlist is fListK0s, all reconstructed K0s in event
4423  if(!track){std::cout<<"AliAnalysisTaskJetChem(): In random cones, charged track not found!!!"<<std::endl; continue;}
4424 
4425  Double_t trackPt = track->Pt();
4426  Double_t trackEta = track->Eta();
4427  if(TMath::Abs(trackEta) <= fCutEta){
4428  fh2ChTracksRC->Fill(trackPt,trackEta);
4429  }
4430  }*/
4431 
4432  }
4433 
4434  fListK0sRC->Clear();
4435  fListLaRC->Clear();
4436  fListALaRC->Clear();
4437  fTracksRecCutsRC->Clear();
4438 
4439  }
4440 
4441 
4442  //fetch particles in perpendicular cone to estimate UE event contribution to particle spectrum
4443  //these perpendicular cone particle spectra serve to subtract the particles in jet cones, that are stemming from the Underlying event, on a statistical basis
4444  //for normalization the common jet pT spectrum is used: fh1IMK0Cone, fh1IMLaCone and fh1IMALaCone
4445 
4446  //____fetch reconstructed K0s in cone perpendicular to jet axis:_______________________________________________________________________________
4447 
4448 
4449  jetPerpConeK0list->Clear();
4450  jetPerpRecCutslist->Clear();
4451 
4452  Double_t sumPerpPtK0 = 0.;
4453  Double_t sumPerpPtRecCuts = 0.;
4454 
4455  GetTracksInPerpCone(fListK0s, jetPerpConeK0list, jet, GetFFRadius(), sumPerpPtK0); //reconstructed K0s in cone around jet axis
4456 
4457  GetTracksInPerpCone(fTracksRecCuts, jetPerpRecCutslist, jet, GetFFRadius(), sumPerpPtRecCuts); //charged tracks in perpendicular cone, used for sytematic uncertainty calculation of UE subtraction
4458 
4459  /* for(Int_t in=0; in<jetPerpRecCutslist->GetEntries(); ++in){
4460 
4461  AliVParticle* track = dynamic_cast<AliVParticle*>(jetPerpRecCutslist->At(in)); //inputlist is fListK0s, all reconstructed K0s in event
4462  if(!track){std::cout<<"AliAnalysisTaskJetChem(): In perpendicular cone, charged track not found!!!"<<std::endl; continue;}
4463 
4464  Double_t trackPt = track->Pt();
4465  Double_t trackEta = track->Eta();
4466  fh2ChTracksPC->Fill(trackPt,trackEta);
4467  }*/
4468 
4469 
4470  if(fDebug>2)Printf("%s:%d nK0s total: %d, in perp jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nK0s,jetPerpConeK0list->GetEntries(),GetFFRadius());
4471 
4472  for(Int_t it=0; it<jetPerpConeK0list->GetSize(); ++it){ // loop for K0s in perpendicular cone
4473 
4474  AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetPerpConeK0list->At(it));
4475  if(!v0) continue;
4476 
4477  Double_t invMPerpK0s =0;
4478  Double_t trackPt=0;
4479  Double_t fEta=0;
4480 
4481  fEta = v0->Eta();
4482  CalculateInvMass(v0, kK0, invMPerpK0s, trackPt); //function to calculate invMass with TLorentzVector class
4483  Double_t vK0sPC[4] = {jetPt, invMPerpK0s,trackPt,fEta};
4484 
4485  fhnK0sPC->Fill(vK0sPC); //(x,y,z) //pay attention, this histogram contains the V0 content of both (+/- 90 degrees) perp. cones!!
4486 
4487  }
4488 
4489 
4490  if(jetPerpConeK0list->GetSize() == 0){ // no K0s in jet cone
4491 
4492  Double_t vK0sPC[4] = {jetPt, -1, -1 , -999};//default values for case: no K0s is found in PC
4493  fhnK0sPC->Fill(vK0sPC);
4494 
4495  }
4496 
4497 
4498  if(IsMCCEvt == kFALSE){//median cluster only once for event
4499 
4500  IsMCCEvt = kTRUE;
4501 
4502  // if(ij==0){
4503 
4504  AliAODJet* medianCluster = GetMedianCluster();
4505 
4506  if(medianCluster){
4507  // ____ rec K0s in median cluster___________________________________________________________________________________________________________
4508 
4509 
4510  jetMedianConeK0list->Clear();
4511  jetMedianConeLalist->Clear();
4512  jetMedianConeALalist->Clear();
4513  jetMedianRecCutslist->Clear();//charged jet tracks
4514 
4515  Double_t medianEta = medianCluster->Eta();
4516 
4517  if(TMath::Abs(medianEta)<=fCutjetEta){
4518 
4519  fh1MedianEta->Fill(medianEta);
4520  fh1JetPtMedian->Fill(jetPt);
4521  fh1MCC->Fill(1.);//for normalisation by total number of median cluster jets
4522  Double_t sumMedianPtK0 = 0.;
4523  Double_t sumPtRecCuts = 0.;
4524 
4525  Bool_t isBadJetK0Median = kFALSE; // dummy, do not use
4526  Bool_t isBadJetRecCutsMedian = kFALSE; // dummy, do not use
4527 
4528  GetTracksInCone(fListK0s, jetMedianConeK0list, medianCluster, GetFFRadius(), sumMedianPtK0, 0., 0., isBadJetK0Median); //reconstructed K0s in median cone around jet axis
4529 
4530  GetTracksInCone(fTracksRecCuts, jetMedianRecCutslist, medianCluster, GetFFRadius(), sumPtRecCuts, 0., 0., isBadJetRecCutsMedian); //charged tracks in median cluster cone, used for sytematic uncertainty calculation of UE subtraction
4531 
4532  //cut parameters from Fragmentation Function task:
4533  //Float_t fFFMinLTrackPt; // reject jets with leading track with pt smaller than this value, use GetFFMinLTrackPt()
4534  //Float_t fFFMaxTrackPt; // reject jetscontaining any track with pt larger than this value, use GetFFMaxTrackPt()
4535 
4536 
4537  /*for(Int_t in=0; in<jetMedianRecCutslist->GetEntries(); ++in){
4538 
4539  AliVParticle* track = dynamic_cast<AliVParticle*>(jetMedianRecCutslist->At(in)); //inputlist is fListK0s, all reconstructed K0s in event
4540  if(!track){std::cout<<"AliAnalysisTaskJetChem(): In median cluster cones, charged track not found!!!"<<std::endl; continue;}
4541 
4542  Double_t trackPt = track->Pt();
4543  Double_t trackEta = track->Eta();
4544  if(TMath::Abs(trackEta)<=fCutEta){
4545  fh2ChTracksMCC->Fill(trackPt,trackEta);
4546  }
4547  }*/
4548 
4549 
4550 
4551  for(Int_t it=0; it<jetMedianConeK0list->GetSize(); ++it){ // loop for K0s in median cone
4552 
4553  AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetMedianConeK0list->At(it));
4554  if(!v0) continue;
4555 
4556  Double_t invMMedianK0s =0;
4557  Double_t trackPt=0;
4558  Double_t fEta=0;
4559 
4560  fEta = v0->Eta();
4561  CalculateInvMass(v0, kK0, invMMedianK0s, trackPt); //function to calculate invMass with TLorentzVector class
4562  Double_t vK0sMCC[3] = {invMMedianK0s,trackPt,fEta};
4563  fhnK0sMCC->Fill(vK0sMCC);
4564 
4565  }
4566 
4567  if(jetMedianConeK0list->GetSize() == 0){ // no K0s in median cluster cone
4568 
4569  Double_t vK0sMCC[3] = {-1, -1, -999};
4570  fhnK0sMCC->Fill(vK0sMCC);
4571 
4572  }
4573 
4574  //__________________________________________________________________________________________________________________________________________
4575  // ____ rec Lambdas in median cluster___________________________________________________________________________________________________________
4576 
4577  Double_t sumMedianPtLa = 0.;
4578  Bool_t isBadJetLaMedian = kFALSE; // dummy, do not use
4579 
4580  GetTracksInCone(fListLa, jetMedianConeLalist, medianCluster, GetFFRadius(), sumMedianPtLa, 0, 0, isBadJetLaMedian); //reconstructed Lambdas in median cone around jet axis
4581 
4582  //cut parameters from Fragmentation Function task:
4583  //Float_t fFFMinLTrackPt; // reject jets with leading track with pt smaller than this value, use GetFFMinLTrackPt()
4584  //Float_t fFFMaxTrackPt; // reject jets containing any track with pt larger than this value, use GetFFMaxTrackPt()
4585 
4586  for(Int_t it=0; it<jetMedianConeLalist->GetSize(); ++it){ // loop for Lambdas in perpendicular cone
4587 
4588  AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetMedianConeLalist->At(it));
4589  if(!v0) continue;
4590 
4591  Double_t invMMedianLa =0;
4592  Double_t trackPt=0;
4593  Double_t fEta=0;
4594  fEta = v0->Eta();
4595 
4596  CalculateInvMass(v0, kLambda, invMMedianLa, trackPt); //function to calculate invMass with TLorentzVector class
4597 
4598  Double_t vLaMCC[3] = {invMMedianLa,trackPt,fEta};
4599  fhnLaMCC->Fill(vLaMCC);
4600  }
4601 
4602  if(jetMedianConeLalist->GetSize() == 0){ // no Lambdas in median cluster cone
4603 
4604  Double_t vLaMCC[4] = {jetPt, -1, -1, -999};
4605  fhnLaMCC->Fill(vLaMCC);
4606 
4607  }
4608 
4609 
4610  // ____ rec Antilambdas in median cluster___________________________________________________________________________________________________________
4611 
4612 
4613  Double_t sumMedianPtALa = 0.;
4614 
4615  Bool_t isBadJetALaMedian = kFALSE; // dummy, do not use
4616 
4617  GetTracksInCone(fListALa, jetMedianConeALalist, medianCluster, GetFFRadius(), sumMedianPtALa, 0, 0, isBadJetALaMedian); //reconstructed Antilambdas in median cone around jet axis
4618 
4619 
4620  //cut parameters from Fragmentation Function task:
4621  //Float_t fFFMinLTrackPt; // reject jets with leading track with pt smaller than this value, use GetFFMinLTrackPt()
4622  //Float_t fFFMaxTrackPt; // reject jets containing any track with pt larger than this value, use GetFFMaxTrackPt()
4623 
4624  for(Int_t it=0; it<jetMedianConeALalist->GetSize(); ++it){ // loop for Antilambdas in median cluster cone
4625 
4626  AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetMedianConeALalist->At(it));
4627  if(!v0) continue;
4628 
4629  Double_t invMMedianALa =0;
4630  Double_t trackPt=0;
4631  Double_t fEta=0;
4632 
4633  fEta = v0->Eta();
4634 
4635  CalculateInvMass(v0, kAntiLambda, invMMedianALa, trackPt); //function to calculate invMass with TLorentzVector class
4636  Double_t vALaMCC[3] = {invMMedianALa,trackPt,fEta};
4637  fhnALaMCC->Fill(vALaMCC);
4638 
4639  }
4640 
4641  if(jetMedianConeALalist->GetSize() == 0){ // no Antilambdas in median cluster cone
4642 
4643  Double_t vALaMCC[4] = {jetPt, -1, -1, -999};
4644  fhnALaMCC->Fill(vALaMCC);
4645 
4646  }
4647  }//median cluster eta cut
4648 
4649  jetMedianConeK0list->Clear();
4650  jetMedianConeLalist->Clear();
4651  jetMedianConeALalist->Clear();
4652  jetMedianRecCutslist->Clear();
4653  }//if mediancluster is existing
4654  }//end (IsMCCEvt == kFALSE)
4655  //_________________________________________________________________________________________________________________________________________
4656 
4657  //____fetch reconstructed Lambdas in cone perpendicular to jet axis:__________________________________________________________________________
4658 
4659  jetPerpConeLalist->Clear();
4660  Double_t sumPerpPtLa = 0.;
4661 
4662  GetTracksInPerpCone(fListLa, jetPerpConeLalist, jet, GetFFRadius(), sumPerpPtLa); //reconstructed Lambdas in cone around jet axis //pay attention, this histogram contains the V0 content of both (+/- 90 degrees) perp. cones!!
4663 
4664  if(fDebug>2)Printf("%s:%d nLa total: %d, in perp jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nLa,jetPerpConeLalist->GetEntries(),GetFFRadius());
4665 
4666  for(Int_t it=0; it<jetPerpConeLalist->GetSize(); ++it){ // loop for Lambdas in perpendicular cone
4667 
4668  AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetPerpConeLalist->At(it));
4669  if(!v0) continue;
4670 
4671  Double_t invMPerpLa =0;
4672  Double_t trackPt=0;
4673  Double_t fEta=0;
4674  fEta = v0->Eta();
4675 
4676  CalculateInvMass(v0, kLambda, invMPerpLa, trackPt); //function to calculate invMass with TLorentzVector class
4677  Double_t vLaPC[4] = {jetPt, invMPerpLa,trackPt,fEta};
4678  fhnLaPC->Fill(vLaPC); //(x,y,z) //pay attention, this histogram contains the V0 content of both (+/- 90 degrees) perp. cones!!
4679 
4680  }
4681 
4682 
4683  if(jetPerpConeLalist->GetSize() == 0){ // no Lambdas in jet
4684 
4685  Double_t vLaPC[4] = {jetPt, -1, -1 , -999};//default values for case: no K0s is found in PC
4686  fhnLaPC->Fill(vLaPC);
4687 
4688 
4689  }
4690 
4691 
4692  //____fetch reconstructed Antilambdas in cone perpendicular to jet axis:___________________________________________________________________
4693 
4694  jetPerpConeALalist->Clear();
4695  Double_t sumPerpPtALa = 0.;
4696 
4697  GetTracksInPerpCone(fListALa, jetPerpConeALalist, jet, GetFFRadius(), sumPerpPtALa); //reconstructed Antilambdas in cone around jet axis //pay attention, this histogram contains the V0 content of both (+/- 90 degrees) perp. cones!!
4698 
4699  if(fDebug>2)Printf("%s:%d nALa total: %d, in perp jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nALa,jetPerpConeALalist->GetEntries(),GetFFRadius());
4700 
4701  for(Int_t it=0; it<jetPerpConeALalist->GetSize(); ++it){ // loop for ALa in perpendicular cone
4702 
4703  AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetPerpConeALalist->At(it));
4704  if(!v0) continue;
4705 
4706  Double_t invMPerpALa =0;
4707  Double_t trackPt=0;
4708  Double_t fEta=0;
4709  fEta = v0->Eta();
4710 
4711  CalculateInvMass(v0, kAntiLambda, invMPerpALa, trackPt); //function to calculate invMass with TLorentzVector class
4712  Double_t vALaPC[4] = {jetPt, invMPerpALa,trackPt,fEta};
4713  fhnALaPC->Fill(vALaPC);
4714 
4715  }
4716 
4717 
4718  if(jetPerpConeALalist->GetSize() == 0){ // no Antilambda
4719 
4720  Double_t vALaPC[4] = {jetPt, -1, -1, -999};
4721  fhnALaPC->Fill(vALaPC);
4722 
4723  }
4724 
4725 
4726 
4727  //###########################################################################################################
4728  //MC Analysis
4729  //__________________________________________________________________________________________________________________________________________
4730 
4731  if(fAnalysisMC){
4732 
4733  //fill feeddown candidates from TList
4734  //std::cout<<"fListFeeddownLaCand entries: "<<fListFeeddownLaCand->GetSize()<<std::endl;
4735 
4736  Double_t sumPtFDLa = 0.;
4737  Bool_t isBadJetFDLa = kFALSE; // dummy, do not use
4738 
4739  GetTracksInCone(fListFeeddownLaCand, jetConeFDLalist, jet, GetFFRadius(), sumPtFDLa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetFDLa);
4740 
4741  Double_t sumPtFDALa = 0.;
4742  Bool_t isBadJetFDALa = kFALSE; // dummy, do not use
4743 
4744  GetTracksInCone(fListFeeddownALaCand, jetConeFDALalist, jet, GetFFRadius(), sumPtFDALa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetFDALa);
4745 
4746  //_________________________________________________________________
4747  for(Int_t it=0; it<fListFeeddownLaCand->GetSize(); ++it){
4748 
4749  AliAODv0* mcfd = dynamic_cast<AliAODv0*>(fListFeeddownLaCand->At(it));
4750  if(!mcfd) continue;
4751 
4752  Double_t invMLaFDcand = 0;
4753  Double_t trackPt = 0;//pt of ass. particle, not used for the histos
4754 
4755  CalculateInvMass(mcfd, kLambda, invMLaFDcand, trackPt);
4756 
4757  //Get MC gen. Lambda transverse momentum
4758  TClonesArray *st = 0x0;
4759 
4760  if(!fAOD)continue;
4761  TList *lt = fAOD->GetList();
4762  if(!lt)continue;
4763 
4764  st = (TClonesArray*)lt->FindObject(AliAODMCParticle::StdBranchName()); //get MCAOD branch in data
4765  if (!st)continue;
4766 
4767  AliAODTrack *daughtertrack = (AliAODTrack *) (mcfd->GetSecondaryVtx()->GetDaughter(0));//fetch the first of the two daughter tracks
4768  Int_t AssLabel = TMath::Abs(daughtertrack->GetLabel());
4769 
4770  AliAODMCParticle *mcDaughterPart =(AliAODMCParticle*)st->UncheckedAt(AssLabel);
4771 
4772  Int_t v0lab = mcDaughterPart->GetMother();//get v0 particle label
4773 
4774  // Int_t v0lab= TMath::Abs(mcfd->GetLabel());//GetLabel doesn't work for AliAODv0 class!!! Only for AliAODtrack
4775 
4776  if((!v0lab) || (v0lab<0) || (v0lab > st->GetEntriesFast()))continue;//validity checks
4777 
4778  AliAODMCParticle *mcp=(AliAODMCParticle*)st->UncheckedAt(v0lab);
4779 
4780  Int_t motherlab = mcp->GetMother(); //get mother particle label of v0 particle
4781 
4782  if(motherlab >= 0 && v0lab < st->GetEntriesFast()){ //do safety check for mother label
4783 
4784 
4785 
4786  Double_t genLaPt = mcp->Pt();
4787 
4788  Int_t iMother = -1;
4789 
4790  iMother = mcp->GetMother(); //Motherparticle of V0 candidate (e.g. phi particle,..)
4791 
4792  if((!iMother) || (iMother<0) || (iMother > st->GetEntriesFast()))continue;//validity checks
4793 
4794 
4795  if(iMother >= 0){
4796 
4797 
4798  AliAODMCParticle *partMother = (AliAODMCParticle*)st->UncheckedAt(iMother);
4799  Int_t codeMother = -1;
4800  if(!partMother) continue;
4801 
4802 
4803  if(partMother) codeMother = TMath::Abs(partMother->GetPdgCode());
4804 
4805  // 3312 Xi- -3312 Xibar+
4806  // 3322 Xi0 -3322 Xibar0
4807 
4808  if((codeMother == 3312)||(codeMother == 3322)){// feeddown for Lambda coming from Xi- and Xi0
4809 
4810  Double_t XiPt = partMother->Pt();//MC gen. pt
4811 
4812  Double_t vFeedDownLa[3] = {5., invMLaFDcand, genLaPt};
4813  fhnFeedDownLa->Fill(vFeedDownLa);
4814  fh2FeedDownXiLa->Fill(XiPt,genLaPt);
4815  }
4816  }
4817  }
4818  }//end loop over feeddown candidates for Lambda particles in jet cone
4819  //fetch MC truth in jet cones, denominator of rec. efficiency in jet cones
4820  //_________________________________________________________________
4821  for(Int_t it=0; it<jetConeFDLalist->GetSize(); ++it){
4822 
4823  AliAODv0* mcfd = dynamic_cast<AliAODv0*>(jetConeFDLalist->At(it));
4824  if(!mcfd) continue;
4825 
4826  //std::cout<<"Cone, recLaPt:"<<mcfd->Pt()<<std::endl;
4827 
4828  Double_t invMLaFDcand = 0;
4829  Double_t trackPt = mcfd->Pt();//pt of ass. particle, not used for the histos
4830 
4831  CalculateInvMass(mcfd, kLambda, invMLaFDcand, trackPt);
4832 
4833  //Get MC gen. Lambda transverse momentum
4834  TClonesArray *st = 0x0;
4835 
4836  TList *lt = fAOD->GetList();
4837  if(!lt)continue;
4838 
4839  st = (TClonesArray*)lt->FindObject(AliAODMCParticle::StdBranchName());
4840 
4841  AliAODTrack *daughtertrack = (AliAODTrack *) (mcfd->GetSecondaryVtx()->GetDaughter(0));//fetch the first of the two daughter tracks
4842  Int_t AssLabel = TMath::Abs(daughtertrack->GetLabel());
4843 
4844  AliAODMCParticle *mcDaughterPart =(AliAODMCParticle*)st->UncheckedAt(AssLabel);
4845 
4846  Int_t v0lab = mcDaughterPart->GetMother();
4847 
4848  //std::cout<<"v0lab: "<<v0lab<<std::endl;
4849 
4850  if((!v0lab) || (v0lab<0) || (v0lab > st->GetEntriesFast()))continue;//validity checks
4851 
4852  AliAODMCParticle *mcp=(AliAODMCParticle*)st->UncheckedAt(v0lab);
4853 
4854  Double_t genLaPt = mcp->Pt();
4855 
4856 
4857  //std::cout<<"Cone FD, genLaPt:"<<genLaPt<<std::endl;
4858 
4859  Double_t vFeedDownLaCone[3] = {jetPt, invMLaFDcand, genLaPt};
4860  fhnFeedDownLaCone->Fill(vFeedDownLaCone);
4861 
4862 
4863  }//end loop over feeddown candidates for Lambda particles in jet cone
4864 
4865  //_________________________________________________________________
4866  for(Int_t it=0; it<fListFeeddownALaCand->GetSize(); ++it){
4867 
4868  AliAODv0* mcfd = dynamic_cast<AliAODv0*>(fListFeeddownALaCand->At(it));
4869  if(!mcfd) continue;
4870 
4871  Double_t invMALaFDcand = 0;
4872  Double_t trackPt = 0;//pt of ass. particle, not used for the histos
4873 
4874  CalculateInvMass(mcfd, kAntiLambda, invMALaFDcand, trackPt);
4875 
4876  //Get MC gen. Antilambda transverse momentum
4877  TClonesArray *st = 0x0;
4878 
4879  TList *lt = fAOD->GetList();
4880  if(!lt)continue;
4881 
4882  st = (TClonesArray*)lt->FindObject(AliAODMCParticle::StdBranchName());
4883 
4884  AliAODTrack *daughtertrack = (AliAODTrack *) (mcfd->GetSecondaryVtx()->GetDaughter(0));//fetch the first of the two daughter tracks
4885  Int_t AssLabel = TMath::Abs(daughtertrack->GetLabel());
4886 
4887  AliAODMCParticle *mcDaughterPart =(AliAODMCParticle*)st->UncheckedAt(AssLabel);
4888 
4889  Int_t v0lab = mcDaughterPart->GetMother();
4890 
4891  if((!v0lab) || (v0lab<0) || (v0lab > st->GetEntriesFast()))continue;//validity checks
4892 
4893  AliAODMCParticle *mcp=(AliAODMCParticle*)st->UncheckedAt(v0lab);
4894 
4895  Int_t motherlab = mcp->GetMother(); //get mother particle label of v0 particle
4896 
4897  if(motherlab >= 0 && v0lab < st->GetEntriesFast()){ //do safety check for mother label
4898 
4899 
4900  Double_t genALaPt = mcp->Pt();
4901 
4902  Int_t iMother = -1;
4903 
4904  iMother = mcp->GetMother(); //Motherparticle of V0 candidate (e.g. phi particle,..)
4905 
4906 
4907  if((!iMother) || (iMother<0) || (iMother > st->GetEntriesFast()))continue;//validity checks
4908 
4909  if(iMother >= 0){
4910 
4911  AliAODMCParticle *partMother = (AliAODMCParticle*)st->UncheckedAt(iMother);
4912  Int_t codeMother = -1;
4913  if(!partMother) continue;
4914 
4915  if(partMother) codeMother = TMath::Abs(partMother->GetPdgCode());
4916 
4917  // 3312 Xi- -3312 Xibar+
4918  // 3322 Xi0 -3322 Xibar0
4919 
4920  if((codeMother == -3312)||(codeMother == -3322)){// feeddown for Antilambda coming from Xibar+ and Xibar0
4921 
4922  Double_t XiPt = partMother->Pt();//MC gen. pt
4923 
4924  Double_t vFeedDownALa[3] = {5., invMALaFDcand, genALaPt};
4925  fhnFeedDownALa->Fill(vFeedDownALa);
4926  fh2FeedDownXiALa->Fill(XiPt,genALaPt);
4927  }
4928  }
4929  }
4930 
4931  }//end loop over feeddown candidates for Antilambda particles
4932 
4933 
4934  //_________________________________________________________________
4935  //feeddown for Antilambdas from Xi(bar)+ and Xi(bar)0 in jet cone:
4936 
4937  for(Int_t it=0; it<jetConeFDALalist->GetSize(); ++it){
4938 
4939  AliAODv0* mcfd = dynamic_cast<AliAODv0*>(jetConeFDALalist->At(it));
4940  if(!mcfd) continue;
4941 
4942  Double_t invMALaFDcand = 0;
4943  Double_t trackPt = 0;//pt of ass. particle, not used for the histos
4944 
4945  CalculateInvMass(mcfd, kAntiLambda, invMALaFDcand, trackPt);
4946 
4947  //Get MC gen. Antilambda transverse momentum
4948  TClonesArray *st = 0x0;
4949 
4950  TList *lt = fAOD->GetList();
4951  if(!lt)continue;
4952 
4953  st = (TClonesArray*)lt->FindObject(AliAODMCParticle::StdBranchName());
4954 
4955  AliAODTrack *daughtertrack = (AliAODTrack *) (mcfd->GetSecondaryVtx()->GetDaughter(0));//fetch the first of the two daughter tracks
4956  Int_t AssLabel = TMath::Abs(daughtertrack->GetLabel());
4957 
4958  AliAODMCParticle *mcDaughterPart =(AliAODMCParticle*)st->UncheckedAt(AssLabel);
4959 
4960  Int_t v0lab = mcDaughterPart->GetMother();
4961 
4962  if((!v0lab) || (v0lab<0) || (v0lab > st->GetEntriesFast()))continue;//validity checks
4963 
4964  AliAODMCParticle *mcp=(AliAODMCParticle*)st->UncheckedAt(v0lab);
4965 
4966  Double_t genALaPt = mcp->Pt();
4967 
4968  Double_t vFeedDownALaCone[3] = {jetPt, invMALaFDcand, genALaPt};
4969  fhnFeedDownALaCone->Fill(vFeedDownALaCone);
4970 
4971 
4972  }//end loop over feeddown candidates for Antilambda particles in jet cone
4973 
4974 
4975 
4976  //____fetch MC generated K0s in cone around jet axis__(note: particles can stem from fragmentation but also from underlying event)________
4977 
4978  Double_t sumPtMCgenK0s = 0.;
4979  Bool_t isBadJetMCgenK0s = kFALSE; // dummy, do not use
4980 
4981 
4982  fListMCgenK0sCone->Clear(); //MC generated K0s in (only geometrical) jet cone (these are MC gen K0s falling geometrically into jet cone (R = 0.4) around jet axis, that was found by anti-kt jet finder, particles can stem from fragmentation but also from underlying event!!)
4983 
4984  //first: sampling MC gen K0s
4985 
4986  GetTracksInCone(fListMCgenK0s, fListMCgenK0sCone, jet, GetFFRadius(), sumPtMCgenK0s, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetMCgenK0s); //MC generated K0s in cone around jet axis
4987 
4988  if(fDebug>2)Printf("%s:%d nMCgenK0s in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,fListMCgenK0sCone->GetEntries(),GetFFRadius());
4989 
4990 
4991  for(Int_t it=0; it<fListMCgenK0sCone->GetSize(); ++it){ // loop MC generated K0s in cone around jet axis
4992 
4993  AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenK0sCone->At(it));
4994  if(!mcp0) continue;
4995 
4996  //Double_t fRapMCgenK0s = MyRapidity(mcp0->E(),mcp0->Pz());//get rec. particle in cone information
4997  Double_t fEtaMCgenK0s = mcp0->Eta();
4998  Double_t fPtMCgenK0s = mcp0->Pt();
4999 
5000  Double_t vMCgenK0Cone[3] = {jetPt,fPtMCgenK0s,fEtaMCgenK0s};
5001 
5002  fhnMCgenK0Cone->Fill(vMCgenK0Cone);
5003  //fhnMCEtagenK0Cone->Fill(jetPt,fEtaMCgenK0s);
5004 
5005  }
5006 
5007  //check whether the reconstructed K0s in jet cone are stemming from MC gen K0s (on MCgenK0s list):__________________________________________________
5008  /*
5009  for(Int_t ic=0; ic<jetConeK0list->GetSize(); ++ic){ //loop over all reconstructed K0s in jet cone
5010 
5011  Int_t negDaughterpdg;
5012  Int_t posDaughterpdg;
5013  Int_t motherType;
5014  Int_t v0Label;
5015  Double_t fPtMCrecK0Match;
5016  Double_t invMK0Match;
5017  Double_t MCPt;
5018  Int_t nnum =-1;
5019  Int_t pnum =-1;
5020  Bool_t fPhysicalPrimary = -1;
5021  Int_t MCv0PDGCode =0;
5022  Double_t jetPtSmear = -1;
5023 
5024  AliAODv0* v0c = dynamic_cast<AliAODv0*>(jetConeK0list->At(ic));//pointer to reconstructed K0s inside jet cone (cone is placed around reconstructed jet axis)
5025 
5026  if(!v0c) continue;
5027 
5028  Bool_t daughtercheck = DaughterTrackCheck(v0c, nnum, pnum);//check daughter tracks have proper sign
5029  if(daughtercheck == kFALSE)continue;
5030 
5031  const AliAODTrack *trackMCNeg=(AliAODTrack *)(v0c->GetDaughter(nnum));
5032  const AliAODTrack *trackMCPos=(AliAODTrack *)(v0c->GetDaughter(pnum));
5033  Bool_t isinjected;
5034  TString generatorName;
5035  TList *listmc = fAOD->GetList();
5036 
5037  Bool_t mclabelcheck = MCLabelCheck(v0c, kK0, trackMCNeg, trackMCPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PDGCode, generatorName, isinjected);
5038 
5039  if(mclabelcheck == kFALSE)continue;
5040  if(fPhysicalPrimary == kFALSE)continue; //requirements for rec. V0 associated to MC true primary particle
5041 
5042  for(Int_t it=0; it<fListMCgenK0s->GetSize(); ++it){ // loop over MC generated K0s in event, check whether associated MC particle is part of it
5043 
5044  //Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
5045  //AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenK0sCone->At(it));
5046  AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenK0s->At(it));
5047  if(!mcp0) continue;
5048 
5049  Bool_t particleMatching = IsParticleMatching(mcp0, v0Label);
5050 
5051  if(particleMatching == kFALSE)continue; //if reconstructed V0 particle doesn't match to the associated MC particle go to next stack entry
5052  CalculateInvMass(v0c, kK0, invMK0Match, fPtMCrecK0Match);
5053  Double_t fEta = v0c->Eta();
5054  Double_t fPtMCgenK0s = mcp0->Pt();//pt has to be always MC truth value!
5055 
5056  Double_t vMCrecK0Cone[4] = {jetPt, invMK0Match,fPtMCgenK0s,fEta};
5057  fhnMCrecK0Cone->Fill(vMCrecK0Cone); //fill matching rec. K0s in 3D histogram
5058 
5059  //SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear); //jetPt, cent, jetRadius, ptmintrack, &jetPtSmear
5060 
5061  //Double_t vMCrecK0ConeSmear[4] = {jetPtSmear, invMK0Match,fPtMCgenK0s,fEta};
5062  //fhnMCrecK0ConeSmear->Fill(vMCrecK0ConeSmear);
5063 
5064  //fill matching rec. K0s in 3D histogram, jet pT smeared according to deltaptjet distribution width
5065 
5066 
5067  } // end MCgenK0s / MCgenK0sCone loop
5068 
5069  //___________
5070  //check the K0s daughters contamination of the jet tracks:
5071 
5072  //TClonesArray *stackMC = 0x0;
5073 
5074  for(Int_t it=0; it<jettracklist->GetSize(); ++it){//loop over all particles in the jet
5075 
5076  AliVParticle* trackVP = dynamic_cast<AliVParticle*>(jettracklist->At(it));//all tracks in jet cone
5077  if(!trackVP)continue;
5078  AliAODTrack *tr = dynamic_cast<AliAODTrack*> (trackVP); //fetch one jet track from the TList
5079  if(!tr)continue;
5080 
5081  //get MC label information
5082  TList *mclist = fAOD->GetList(); //fetch the MC stack
5083  if(!mclist)continue;
5084 
5085  stackMC = (TClonesArray*)mclist->FindObject(AliAODMCParticle::StdBranchName()); //get MCAOD branch in data
5086  if (!stackMC) {Printf("ERROR: stack not available");}
5087  else {
5088 
5089  Int_t particleLabel = TMath::Abs(tr->GetLabel()); //fetch jet track label in MC stack
5090  if(!tr)continue;
5091  //v0c is pointer to K0s candidate, is fetched already above, here it is just checked again whether daughters are properly ordered by their charge
5092 
5093  Bool_t daughterchecks = DaughterTrackCheck(v0c, nnum, pnum);
5094 
5095  if(daughterchecks == kFALSE)continue; //make sure that daughters are properly ordered
5096 
5097  const AliAODTrack *trackNeg=(AliAODTrack *)(v0c->GetDaughter(nnum)); //fetch v0 daughters of reconstructed K0s
5098  const AliAODTrack *trackPos=(AliAODTrack *)(v0c->GetDaughter(pnum));
5099 
5100  if(!trackNeg)continue;
5101  if(!trackPos)continue;
5102 
5103  Int_t negAssLabel = TMath::Abs(trackNeg->GetLabel()); //negative (reconstructed) charged track label in MC stack
5104  Int_t posAssLabel = TMath::Abs(trackPos->GetLabel()); //positive (reconstructed) charged track label in MC stack
5105 
5106 
5107  if(particleLabel == posAssLabel){ //check whether jet track and each of the rec. K0s daughters have same MC stack label -> are identical
5108  AliAODMCParticle* mctrackPos = dynamic_cast<AliAODMCParticle*>(stackMC->At(posAssLabel));
5109  if(!mctrackPos) continue;
5110  Double_t trackPosPt = mctrackPos->Pt();
5111  Double_t trackPosEta = mctrackPos->Eta();
5112 
5113  Double_t vK0sSecContinCone[3] = {jetPt, trackPosPt, trackPosEta};
5114  fhnK0sSecContinCone->Fill(vK0sSecContinCone);} //if it's the case, fill jet pt, daughter track pt and track eta in histo
5115 
5116  if(particleLabel == negAssLabel){
5117  AliAODMCParticle* mctrackNeg = dynamic_cast<AliAODMCParticle*>(stackMC->At(negAssLabel));
5118  if(!mctrackNeg) continue;
5119  Double_t trackNegPt = mctrackNeg->Pt();
5120  Double_t trackNegEta = mctrackNeg->Eta();
5121 
5122  Double_t vK0sSecContinCone[3] = {jetPt, trackNegPt, trackNegEta};
5123  fhnK0sSecContinCone->Fill(vK0sSecContinCone);} //if it's the case, fill jet pt, daughter track pt and track eta in histo
5124  }
5125  }
5126 
5127 
5128  //_______________
5129 
5130 
5131  } //end rec-K0-in-cone loop*/
5132 
5133  //________________________________________________________________________________________________________________________________________________________
5134 
5135  fListMCgenK0sCone->Clear();
5136 
5137 
5138  }//end fAnalysisMC
5139 
5140  jetConeK0list->Clear();
5141 
5142  jetPerpConeK0list->Clear();
5143  jetPerpConeLalist->Clear();
5144  jetPerpConeALalist->Clear();
5145 
5146 
5147  //---------------La--------------------------------------------------------------------------------------------------------------------------------------------
5148 
5149  // fQAJetHistosRecCutsLeading->FillJetQA( jet->Eta(), TVector2::Phi_0_2pi(jet->Phi()), jet->Pt() );
5150 
5151  for(Int_t it=0; it<fListLa->GetSize(); ++it){ // loop all La
5152 
5153  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListLa->At(it));
5154  if(!v0) continue;
5155 
5156  Double_t v0Mom[3];
5157  v0->PxPyPz(v0Mom);
5158  TVector3 v0MomVect(v0Mom);
5159 
5160  Double_t dPhiJetLa = (jet->MomentumVector()->Vect()).DeltaPhi(v0MomVect);
5161 
5162  Double_t invMLa =0;
5163  Double_t trackPt=0;
5164 
5165  CalculateInvMass(v0, kLambda, invMLa, trackPt); //function to calculate invMass with TLorentzVector class
5166  // Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
5167 
5168  //if(incrementJetPt){fh1V0JetPt->Fill(jetPt);}
5169 
5170  //fFFHistosIMLaJet->FillFF(trackPt, invMLa, jetPt, incrementJetPt);
5171 
5172  if(dPhiJetLa<fh1dPhiJetLa->GetXaxis()->GetXmin()) dPhiJetLa += 2*TMath::Pi();
5173  fh1dPhiJetLa->Fill(dPhiJetLa);
5174  }
5175 
5176  /* if(fListLa->GetSize() == 0){ // no La: increment jet pt spectrum
5177 
5178  Bool_t incrementJetPt = kTRUE;
5179  fFFHistosIMLaJet->FillFF(-1, -1, jetPt, incrementJetPt);
5180  }*/
5181 
5182 
5183  // ____fetch rec. Lambdas in cone around jet axis_______________________________________________________________________________________
5184 
5185  jetConeLalist->Clear();
5186  Double_t sumPtLa = 0.;
5187  Bool_t isBadJetLa = kFALSE; // dummy, do not use
5188 
5189  GetTracksInCone(fListLa, jetConeLalist, jet, GetFFRadius(), sumPtLa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetLa);//method inherited from FF
5190 
5191  if(fDebug>2)Printf("%s:%d nLa total: %d, in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nLa,jetConeLalist->GetEntries(),GetFFRadius());
5192 
5193  for(Int_t it=0; it<jetConeLalist->GetSize(); ++it){ // loop La in jet cone
5194 
5195  AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetConeLalist->At(it));
5196  if(!v0) continue;
5197 
5198  Int_t nnum;
5199  Int_t pnum;
5200 
5201  Bool_t daughtercheck = DaughterTrackCheck(v0, nnum, pnum);
5202  if(daughtercheck == kFALSE)continue;
5203  Double_t invMLa =0;
5204  Double_t trackPt=0;
5205  Double_t fEta = 0;
5206 
5207  fEta = v0->Eta();
5208 
5209  CalculateInvMass(v0, kLambda, invMLa, trackPt); //function to calculate invMass with TLorentzVector class
5210 
5211  Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;//needed for all histos, which serve for normalisation
5212 
5213  if(fAnalysisMC){
5214 
5215  //Int_t negDaughterpdg;
5216  //Int_t posDaughterpdg;
5217  //Int_t motherType;
5218  //Int_t v0Label;
5219  Double_t jetPtSmear = -1;
5220  //Double_t MCPt;
5221  //Bool_t fPhysicalPrimary = -1;
5222  //Int_t MCv0PDGCode =0;
5223  //TString generatorName;
5224 
5225  SmearJetPt(jetPt,jetPtSmear);
5226 
5227  fh2MC2LaCone->Fill(jetPtSmear,trackPt);
5228 
5229  if(incrementJetPt == kTRUE){fh1IMLaConeSmear->Fill(jetPtSmear);
5230 
5231 
5232  /*
5233  const AliAODTrack *trackNeg=(AliAODTrack *)(v0->GetDaughter(nnum));
5234  const AliAODTrack *trackPos=(AliAODTrack *)(v0->GetDaughter(pnum));
5235 
5236  TList *listmc = fAOD->GetList();
5237  Bool_t isinjected;
5238  Bool_t mclabelcheck = MCLabelCheck(v0, kLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PDGCode, generatorName, isinjected);
5239  if(mclabelcheck == kFALSE)continue;
5240 
5241  //std::cout<<"generatorName: "<<generatorName<<std::endl;
5242 
5243  if(generatorName == "Hijing"){
5244  Double_t vrecMCHijingLaCone[4] = {jetPt, invMLa,trackPt,fEta};
5245  fhnrecMCHijingLaCone->Fill(vrecMCHijingLaCone);
5246  }
5247 
5248  if(isinjected == kTRUE){
5249  Double_t vrecMCInjectLaCone[4] = {jetPt, invMLa,trackPt,fEta};
5250  fhnrecMCInjectLaCone->Fill(vrecMCInjectLaCone);
5251  }
5252  */
5253 
5254  }//fill TH1F for normalization purposes
5255  }//end MC analysis part
5256 
5257 
5258  if(incrementJetPt==kTRUE){
5259  fh1IMLaCone->Fill(jetPt);}//normalisation by number of selected jets
5260 
5261  //fFFHistosIMLaCone->FillFF(trackPt, invMLa, jetPt, incrementJetPt);
5262  Double_t vLaCone[4] = {jetPt, invMLa,trackPt,fEta};
5263  fhnLaCone->Fill(vLaCone);
5264  }
5265 
5266  if(jetConeLalist->GetSize() == 0){ // no La: increment jet pt spectrum
5267 
5268  Bool_t incrementJetPt = kTRUE;
5269  // fFFHistosIMLaCone->FillFF(-1, -1, jetPt, incrementJetPt);
5270  Double_t vLaCone[4] = {jetPt, -1, -1, -1};
5271  fhnLaCone->Fill(vLaCone);
5272 
5273  if(incrementJetPt==kTRUE){
5274  fh1IMLaCone->Fill(jetPt);}//normalisation by number of selected jets
5275 
5276  if(fAnalysisMC){
5277  Double_t jetPtSmear;
5278  SmearJetPt(jetPt,jetPtSmear);
5279  if(incrementJetPt == kTRUE){
5280  fh1IMLaConeSmear->Fill(jetPtSmear);
5281 
5282  }
5283  }
5284 
5285  }
5286 
5287  if(fAnalysisMC){
5288 
5289  //____fetch MC generated Lambdas in cone around jet axis__(particles can stem from fragmentation but also from underlying event)_____________
5290 
5291  Double_t sumPtMCgenLa = 0.;
5292  Bool_t isBadJetMCgenLa = kFALSE; // dummy, do not use
5293 
5294  //sampling MC gen. Lambdas in cone around reconstructed jet axis
5295 
5296  fListMCgenLaCone->Clear();
5297  GetTracksInCone(fListMCgenLa, fListMCgenLaCone, jet, GetFFRadius(), sumPtMCgenLa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetMCgenLa);//fetch MC generated Lambdas in cone of resolution parameter R around jet axis
5298 
5299  if(fDebug>2)Printf("%s:%d nMCgenLa in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,fListMCgenLaCone->GetEntries(),GetFFRadius());
5300 
5301  for(Int_t it=0; it<fListMCgenLaCone->GetSize(); ++it){ // loop MC generated La in cone around jet axis
5302 
5303  AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenLaCone->At(it));
5304  if(!mcp0) continue;
5305 
5306  //Double_t fRapMCgenLa = MyRapidity(mcp0->E(),mcp0->Pz());
5307  Double_t fEtaMCgenLa = mcp0->Eta();
5308  Double_t fPtMCgenLa = mcp0->Pt();
5309 
5310  Double_t vMCgenLaCone[3] = {jetPt,fPtMCgenLa,fEtaMCgenLa};
5311 
5312  fhnMCgenLaCone->Fill(vMCgenLaCone);
5313 
5314  //fh2MCgenLaCone->Fill(jetPt,fPtMCgenLa);
5315  //fh2MCEtagenLaCone->Fill(jetPt,fEtaMCgenLa);
5316  }
5317 
5318  /*
5319  //check whether the reconstructed La are stemming from MC gen La on fListMCgenLa List:__________________________________________________
5320 
5321  for(Int_t ic=0; ic<jetConeLalist->GetSize(); ++ic){//loop over all reconstructed La within jet cone, new definition
5322 
5323  Int_t negDaughterpdg;
5324  Int_t posDaughterpdg;
5325  Int_t motherType;
5326  Int_t v0Label;
5327  Double_t fPtMCrecLaMatch;
5328  Double_t invMLaMatch;
5329  Double_t MCPt;
5330  Int_t nnum;
5331  Int_t pnum;
5332  Bool_t fPhysicalPrimary = -1;
5333  Int_t MCv0PDGCode =0;
5334  Double_t jetPtSmear = -1;
5335  TString generatorName;
5336 
5337  AliAODv0* v0c = dynamic_cast<AliAODv0*>(jetConeLalist->At(ic));//new definition
5338 
5339 
5340  if(!v0c) continue;
5341 
5342  Bool_t daughtercheck = DaughterTrackCheck(v0c, nnum, pnum);
5343  if(daughtercheck == kFALSE)continue;
5344 
5345  const AliAODTrack *trackMCNeg=(AliAODTrack *)(v0c->GetDaughter(nnum));
5346  const AliAODTrack *trackMCPos=(AliAODTrack *)(v0c->GetDaughter(pnum));
5347 
5348  TList *listmc = fAOD->GetList();
5349  Bool_t isinjected;
5350  Bool_t mclabelcheck = MCLabelCheck(v0c, kLambda, trackMCNeg, trackMCPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PDGCode, generatorName, isinjected);
5351 
5352  if(mclabelcheck == kFALSE)continue;
5353  if(fPhysicalPrimary == kFALSE)continue;
5354 
5355  for(Int_t it=0; it<fListMCgenLa->GetSize(); ++it){//new definition // loop over MC generated K0s in cone around jet axis
5356 
5357 
5358  //Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
5359 
5360  AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenLa->At(it));//new definition
5361  //AliAODMCParticle* mcp0 = dynamic_cast<AliAODMCParticle*>(fListMCgenLaCone->At(it));//old definition
5362 
5363  if(!mcp0) continue;
5364 
5365  Bool_t particleMatching = IsParticleMatching(mcp0, v0Label);
5366 
5367 
5368  if(particleMatching == kFALSE)continue; //particle doesn't match on any associated MC gen particle in cone around rec jet axis
5369 
5370  CalculateInvMass(v0c, kLambda, invMLaMatch, fPtMCrecLaMatch);
5371 
5372  Double_t fPtMCgenLa = mcp0->Pt();
5373  Double_t fEta = v0c->Eta();//rec. MC particle
5374  Double_t vMCrecLaCone[4] = {jetPt, invMLaMatch,fPtMCgenLa,fEta};
5375  fhnMCrecLaCone->Fill(vMCrecLaCone);
5376 
5377  SmearJetPt(jetPt,cl,GetFFRadius(),GetFFMinLTrackPt(),jetPtSmear);
5378 
5379  Double_t vMCrecLaConeSmear[4] = {jetPtSmear, invMLaMatch,fPtMCgenLa,fEta};
5380  fhnMCrecLaConeSmear->Fill(vMCrecLaConeSmear); //fill matching rec. Lambdas in 3D histogram, jet pT smeared according to deltaptjet distribution width
5381 
5382 
5383  } // end MCgenLa loop
5384 
5385  //check the Lambda daughters contamination of the jet tracks://///////////////////////////////////////////////////////////////////////////////////////////
5386 
5387  // TClonesArray *stackMC = 0x0;
5388 
5389  for(Int_t it=0; it<jettracklist->GetSize(); ++it){//loop over all particles in the jet
5390 
5391  AliVParticle* trackVP = dynamic_cast<AliVParticle*>(jettracklist->At(it));//all tracks in jet cone
5392  if(!trackVP)continue;
5393  AliAODTrack *tr = dynamic_cast<AliAODTrack*> (trackVP); //fetch one jet track from the TList
5394  if(!tr)continue;
5395 
5396  //get MC label information
5397  TList *mclist = fAOD->GetList(); //fetch the MC stack
5398 
5399  stackMC = (TClonesArray*)mclist->FindObject(AliAODMCParticle::StdBranchName()); //get MCAOD branch in data
5400  if (!stackMC) {Printf("ERROR: stack not available");}
5401  else {
5402 
5403  Int_t particleLabel = TMath::Abs(tr->GetLabel()); //fetch jet track label in MC stack
5404 
5405  Bool_t daughterchecks = DaughterTrackCheck(v0c, nnum, pnum);
5406 
5407  if(daughterchecks == kFALSE)continue; //make sure that daughters are properly ordered
5408 
5409  const AliAODTrack *trackNeg=(AliAODTrack *)(v0c->GetDaughter(nnum)); //fetch v0 daughters of reconstructed K0s
5410  const AliAODTrack *trackPos=(AliAODTrack *)(v0c->GetDaughter(pnum));
5411 
5412  Int_t negAssLabel = TMath::Abs(trackNeg->GetLabel()); //negative (reconstructed) charged track label in MC stack
5413  Int_t posAssLabel = TMath::Abs(trackPos->GetLabel()); //positive (reconstructed) charged track label in MC stack
5414 
5415 
5416  if(particleLabel == posAssLabel){ //check whether jet track and each of the rec. K0s daughters have same MC stack label -> are identical
5417 
5418  AliAODMCParticle* mctrackPos = dynamic_cast<AliAODMCParticle*>(stackMC->At(posAssLabel));
5419  if(!mctrackPos) continue;
5420 
5421  Double_t trackPosPt = trackPos->Pt();
5422  Double_t trackPosEta = trackPos->Eta();
5423  Double_t vLaSecContinCone[3] = {jetPt, trackPosPt, trackPosEta};
5424  fhnLaSecContinCone->Fill(vLaSecContinCone);
5425 
5426  } //if it's the case, fill jet pt, daughter track pt and track eta in histo
5427 
5428 
5429  if(particleLabel == negAssLabel){
5430 
5431  AliAODMCParticle* mctrackNeg = dynamic_cast<AliAODMCParticle*>(stackMC->At(negAssLabel));
5432  if(!mctrackNeg) continue;
5433 
5434  Double_t trackNegPt = trackNeg->Pt();
5435  Double_t trackNegEta = trackNeg->Eta();
5436 
5437  Double_t vLaSecContinCone[3] = {jetPt, trackNegPt, trackNegEta};
5438  fhnLaSecContinCone->Fill(vLaSecContinCone);
5439 
5440 
5441  } //if it's the case, fill jet pt, daughter track pt and track eta in histo
5442  }
5443  }
5444 
5445 
5446  } //end rec-La-in-cone loop
5447  */
5448  //________________________________________________________________________________________________________________________________________________________
5449 
5450  fListMCgenLaCone->Clear();
5451 
5452  }//end fAnalysisMC
5453 
5454  jetConeLalist->Clear();
5455 
5456 
5457 
5458  //---------------ALa-----------
5459 
5460 
5461  // fQAJetHistosRecCutsLeading->FillJetQA( jet->Eta(), TVector2::Phi_0_2pi(jet->Phi()), jet->Pt() );
5462 
5463  for(Int_t it=0; it<fListALa->GetSize(); ++it){ // loop all ALa
5464 
5465  AliAODv0* v0 = dynamic_cast<AliAODv0*>(fListALa->At(it));
5466  if(!v0) continue;
5467 
5468  Double_t v0Mom[3];
5469  v0->PxPyPz(v0Mom);
5470  TVector3 v0MomVect(v0Mom);
5471 
5472  Double_t dPhiJetALa = (jet->MomentumVector()->Vect()).DeltaPhi(v0MomVect);
5473 
5474  Double_t invMALa =0;
5475  Double_t trackPt=0;
5476 
5477  CalculateInvMass(v0, kAntiLambda, invMALa, trackPt); //function to calculate invMass with TLorentzVector class
5478  //Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
5479 
5480  //if(incrementJetPt){fh1V0JetPt->Fill(jetPt);}
5481 
5482  //fFFHistosIMALaJet->FillFF(trackPt, invMALa, jetPt, incrementJetPt);
5483 
5484  if(dPhiJetALa<fh1dPhiJetALa->GetXaxis()->GetXmin()) dPhiJetALa += 2*TMath::Pi();
5485  fh1dPhiJetALa->Fill(dPhiJetALa);
5486  }
5487 
5488  // if(fListALa->GetSize() == 0){ // no ALa: increment jet pt spectrum
5489 
5490  // Bool_t incrementJetPt = kTRUE;
5491  //fFFHistosIMALaJet->FillFF(-1, -1, jetPt, incrementJetPt);
5492  //}
5493 
5494 
5495  // ____fetch rec. Antilambdas in cone around jet axis_______________________________________________________________________________________
5496 
5497  jetConeALalist->Clear();
5498  Double_t sumPtALa = 0.;
5499  Bool_t isBadJetALa = kFALSE; // dummy, do not use
5500 
5501  GetTracksInCone(fListALa, jetConeALalist, jet, GetFFRadius(), sumPtALa, GetFFMinLTrackPt(), GetFFMaxTrackPt(), isBadJetALa);//method inherited from FF
5502 
5503  if(fDebug>2)Printf("%s:%d nALa total: %d, in jet cone: %d,FFRadius %f ",(char*)__FILE__,__LINE__,nALa,jetConeALalist->GetEntries(),GetFFRadius());
5504 
5505  for(Int_t it=0; it<jetConeALalist->GetSize(); ++it){ // loop ALa in jet cone
5506 
5507  AliAODv0* v0 = dynamic_cast<AliAODv0*>(jetConeALalist->At(it));
5508  if(!v0) continue;
5509 
5510 
5511  Int_t nnum;
5512  Int_t pnum;
5513 
5514  Bool_t daughtercheck = DaughterTrackCheck(v0, nnum, pnum);
5515  if(daughtercheck == kFALSE)continue;
5516 
5517 
5518  Double_t invMALa =0;
5519  Double_t trackPt=0;
5520  Double_t fEta = 0;
5521 
5522  fEta = v0->Eta();
5523 
5524  CalculateInvMass(v0, kAntiLambda, invMALa, trackPt); //function to calculate invMass with TLorentzVector class
5525 
5526  Bool_t incrementJetPt = (it==0) ? kTRUE : kFALSE;
5527 
5528  if(fAnalysisMC){ //jet pt smearing study for Antilambdas
5529  /*
5530  Int_t negDaughterpdg;
5531  Int_t posDaughterpdg;
5532  Int_t motherType;
5533  Int_t v0Label;
5534  Double_t MCPt;
5535  Bool_t fPhysicalPrimary = -1;
5536  Int_t MCv0PDGCode =0;
5537  TString generatorName;
5538  */
5539  Double_t jetPtSmear = -1;
5540 
5541  SmearJetPt(jetPt,jetPtSmear);
5542  fh2MC2ALaCone->Fill(jetPtSmear, trackPt);//fill MC true particles for jet pt smearing reference
5543 
5544  /*
5545  const AliAODTrack *trackNeg=(AliAODTrack *)(v0->GetDaughter(nnum));
5546  const AliAODTrack *trackPos=(AliAODTrack *)(v0->GetDaughter(pnum));
5547 
5548  TList *listmc = fAOD->GetList();
5549  Bool_t isinjected;
5550  Bool_t mclabelcheck = MCLabelCheck(v0, kAntiLambda, trackNeg, trackPos, listmc, negDaughterpdg, posDaughterpdg, motherType, v0Label, MCPt, fPhysicalPrimary, MCv0PDGCode, generatorName, isinjected);
5551  if(mclabelcheck == kFALSE)continue;
5552 
5553  //std::cout<<"generatorName: "<<generatorName<<std::endl;
5554 
5555  if(generatorName == "Hijing"){
5556  Double_t vrecMCHijingALaCone[4] = {jetPt, invMALa,trackPt,fEta};
5557  fhnrecMCHijingALaCone->Fill(vrecMCHijingALaCone);
5558  }
5559 
5560  if(isinjected == kTRUE){
5561  Double_t vrecMCInjectALaCone[4] = {jetPt, invMALa,trackPt,fEta};
5562  fhnrecMCInjectALaCone->Fill(vrecMCInjectALaCone);
5563  }*/
5564 
5565  if(incrementJetPt == kTRUE){fh1IMALaConeSmear->Fill(jetPtSmear);} //fill TH1F for normalization purposes
5566  }//end fAnalysisMC
5567 
5568 
5569  if(incrementJetPt==kTRUE){
5570  fh1IMALaCone->Fill(jetPt);}//normalisation by number of selected jets
5571 
5572  //fFFHistosIMALaCone->FillFF(trackPt, invMALa, jetPt, incrementJetPt);
5573  Double_t vALaCone[4] = {jetPt, invMALa,trackPt,fEta};
5574  fhnALaCone->Fill(vALaCone);
5575  }
5576 
5577  if(jetConeALalist->GetSize() == 0){ // no ALa: increment jet pt spectrum
5578 
5579  Bool_t incrementJetPt = kTRUE;
5580 
5581  if(incrementJetPt==kTRUE){
5582