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