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