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