AliPhysics  27da6ee (27da6ee)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskSELc2eleLambdafromAODtracks.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appeuear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 /* $Id$ */
17 
18 //
19 //
20 // Lc->e Lambda analysis code
21 //
22 // Input: AOD
23 // Output: TTree and/or THnSparse (mass vs pT vs Centrality)
24 //
25 // Cuts:
26 // TTree: SingleCuts on V0 and electron
27 // THnSparse: In addition to that, IsSelected(obj, kCandidate) applied
28 //
29 //-------------------------------------------------------------------------
30 //
31 // Authors: Y.S Watanabe(a)
32 // (a) CNS, the University of Tokyo
33 // Contatcs: wyosuke@cns.s.u-tokyo.ac.jp
34 //-------------------------------------------------------------------------
35 
36 #include <TSystem.h>
37 #include <TParticle.h>
38 #include <TParticlePDG.h>
39 #include <TH1F.h>
40 #include <TH1F.h>
41 #include <TH2F.h>
42 #include <THnSparse.h>
43 #include <TLorentzVector.h>
44 #include <TTree.h>
45 #include "TROOT.h"
46 #include <TDatabasePDG.h>
47 #include <AliAnalysisDataSlot.h>
48 #include <AliAnalysisDataContainer.h>
49 #include "AliStack.h"
50 #include "AliMCEvent.h"
51 #include "AliAnalysisManager.h"
52 #include "AliAODMCHeader.h"
53 #include "AliAODHandler.h"
54 #include "AliLog.h"
55 #include "AliExternalTrackParam.h"
56 #include "AliAODVertex.h"
57 #include "AliESDVertex.h"
58 #include "AliAODRecoDecay.h"
59 #include "AliAODRecoDecayHF.h"
60 #include "AliAODRecoCascadeHF.h"
61 #include "AliESDtrack.h"
62 #include "AliAODTrack.h"
63 #include "AliAODv0.h"
64 #include "AliAODcascade.h"
65 #include "AliAODMCParticle.h"
66 #include "AliAnalysisTaskSE.h"
68 #include "AliPIDResponse.h"
69 #include "AliPIDCombined.h"
70 #include "AliTOFPIDResponse.h"
71 #include "AliAODPidHF.h"
72 #include "AliInputEventHandler.h"
73 #include "AliESDtrackCuts.h"
74 #include "AliNeutralTrackParam.h"
75 #include "AliKFParticle.h"
76 #include "AliKFVertex.h"
77 #include "AliExternalTrackParam.h"
78 #include "AliESDtrack.h"
79 #include "AliCentrality.h"
80 #include "AliVertexerTracks.h"
81 #include "AliEventPoolManager.h"
83 #include "AliVertexingHFUtils.h"
84 
85 using std::cout;
86 using std::endl;
87 
91 
92 //__________________________________________________________________________
94  AliAnalysisTaskSE(),
95  fUseMCInfo(kFALSE),
96  fOutput(0),
97  fOutputAll(0),
98  fListCuts(0),
99  fCEvents(0),
100  fHTrigger(0),
101  fHCentrality(0),
102  fHEventPlane(0),
103  fHNTrackletvsZ(0),
104  fHNTrackletCorrvsZ(0),
105  fAnalCuts(0),
106  fIsEventSelected(kFALSE),
107  fWriteVariableTree(kFALSE),
108  fWriteEachVariableTree(kFALSE),
109  fWriteMCVariableTree(kFALSE),
110  fVariablesTree(0),
111  fEleVariablesTree(0),
112  fV0VariablesTree(0),
113  fSingleVariablesTree(0),
114  fMCVariablesTree(0),
115  fMCEleVariablesTree(0),
116  fMCV0VariablesTree(0),
117  fMCGenPairVariablesTree(0),
118  fCorrelationVariablesTree(0),
119  fReconstructPrimVert(kFALSE),
120  fIsMB(kFALSE),
121  fIsSemi(kFALSE),
122  fIsCent(kFALSE),
123  fIsINT7(kFALSE),
124  fIsEMC7(kFALSE),
125  fCandidateVariables(),
126  fCandidateEleVariables(),
127  fCandidateV0Variables(),
128  fCandidateSingleVariables(),
129  fCandidateMCVariables(),
130  fCandidateMCEleVariables(),
131  fCandidateMCV0Variables(),
132  fCandidateMCGenPairVariables(),
133  fCorrelationVariables(),
134  fVtx1(0),
135  fV1(0),
136  fVtxZ(0),
137  fEventPlane(0),
138  fBzkG(0),
139  fCentrality(0),
140  fRunNumber(0),
141  fTriggerCheck(0),
142  fUseCentralityV0M(kFALSE),
143  fUseCentralitySPDTracklet(kFALSE),
144  fUseEventPlane(kFALSE),
145  fEvNumberCounter(0),
146  fMCEventType(-9999),
147  fMCDoPairAnalysis(kFALSE),
148  fHistoEleLambdaMass(0),
149  fHistoEleLambdaMassRS(0),
150  fHistoEleLambdaMassRS1(0),
151  fHistoEleLambdaMassRS2(0),
152  fHistoEleLambdaMassWS(0),
153  fHistoEleLambdaMassWS1(0),
154  fHistoEleLambdaMassWS2(0),
155  fHistoEleLambdaMassRSMix(0),
156  fHistoEleLambdaMassRSMix1(0),
157  fHistoEleLambdaMassRSMix2(0),
158  fHistoEleLambdaMassWSMix(0),
159  fHistoEleLambdaMassWSMix1(0),
160  fHistoEleLambdaMassWSMix2(0),
161  fHistoEleLambdaMassRSSide(0),
162  fHistoEleLambdaMassRSSide1(0),
163  fHistoEleLambdaMassRSSide2(0),
164  fHistoEleLambdaMassWSSide(0),
165  fHistoEleLambdaMassWSSide1(0),
166  fHistoEleLambdaMassWSSide2(0),
167  fHistoEleLambdaMassRSAway(0),
168  fHistoEleLambdaMassRS1Away(0),
169  fHistoEleLambdaMassRS2Away(0),
170  fHistoEleLambdaMassWSAway(0),
171  fHistoEleLambdaMassWS1Away(0),
172  fHistoEleLambdaMassWS2Away(0),
173  fHistoEleLambdaMassRSMixAway(0),
174  fHistoEleLambdaMassRSMix1Away(0),
175  fHistoEleLambdaMassRSMix2Away(0),
176  fHistoEleLambdaMassWSMixAway(0),
177  fHistoEleLambdaMassWSMix1Away(0),
178  fHistoEleLambdaMassWSMix2Away(0),
179  fHistoEleLambdaMassRSSideAway(0),
180  fHistoEleLambdaMassRSSide1Away(0),
181  fHistoEleLambdaMassRSSide2Away(0),
182  fHistoEleLambdaMassWSSideAway(0),
183  fHistoEleLambdaMassWSSide1Away(0),
184  fHistoEleLambdaMassWSSide2Away(0),
185  fHistoEleLambdaMassvsElePtRS(0),
186  fHistoEleLambdaMassvsElePtWS(0),
187  fHistoEleLambdaMassvsElePtRSMix(0),
188  fHistoEleLambdaMassvsElePtWSMix(0),
189  fHistoEleLambdaMassvsElePtRSSide(0),
190  fHistoEleLambdaMassvsElePtWSSide(0),
191  fHistoEleLambdaMassvsElePtRS1(0),
192  fHistoEleLambdaMassvsElePtWS1(0),
193  fHistoEleLambdaMassvsElePtRSMix1(0),
194  fHistoEleLambdaMassvsElePtWSMix1(0),
195  fHistoEleLambdaMassvsElePtRSSide1(0),
196  fHistoEleLambdaMassvsElePtWSSide1(0),
197  fHistoEleLambdaMassvsElePtRS2(0),
198  fHistoEleLambdaMassvsElePtWS2(0),
199  fHistoEleLambdaMassvsElePtRSMix2(0),
200  fHistoEleLambdaMassvsElePtWSMix2(0),
201  fHistoEleLambdaMassvsElePtRSSide2(0),
202  fHistoEleLambdaMassvsElePtWSSide2(0),
203  fHistoElePtRS(0),
204  fHistoElePtWS(0),
205  fHistoElePtRSMix(0),
206  fHistoElePtWSMix(0),
207  fHistoEleLambdaMassMCS(0),
208  fHistoEleLambdaMassLambdabMCS(0),
209  fHistoEleLambdaMassXibMCS(0),
210  fHistoEleLambdaMassMCGen(0),
211  fHistoEleLambdaMassvsElePtMCS(0),
212  fHistoEleLambdaMassvsElePtMCGen(0),
213  fHistoEleLambdaMassvsElePtMCS1(0),
214  fHistoEleLambdaMassvsElePtMCGen1(0),
215  fHistoEleLambdaMassvsElePtMCS2(0),
216  fHistoEleLambdaMassvsElePtMCGen2(0),
217  fHistoElePtMCS(0),
218  fHistoElePtMCGen(0),
219  fHistoElePtvsEtaRS(0),
220  fHistoElePtvsEtaWS(0),
221  fHistoElePtvsEtaRSMix(0),
222  fHistoElePtvsEtaWSMix(0),
223  fHistoElePtvsEtaMCS(0),
224  fHistoElePtvsEtaMCGen(0),
225  fHistoElePtvsLambdaPtRS(0),
226  fHistoElePtvsLambdaPtWS(0),
227  fHistoElePtvsLambdaPtRSMix(0),
228  fHistoElePtvsLambdaPtWSMix(0),
229  fHistoElePtvsLambdaPtMCS(0),
230  fHistoElePtvsLambdaPtvsLcPtMCS(0),
231  fHistoElePtvsLambdaPtMCGen(0),
232  fHistoElePtvsLambdaPtvsLcPtMCGen(0),
233  fHistoElePtvsLambdaPtMCLcGen(0),
234  fHistoElePtvsd0RS(0),
235  fHistoElePtvsd0WS(0),
236  fHistoElePtvsd0RSMix(0),
237  fHistoElePtvsd0WSMix(0),
238  fHistoElePtvsd0MCS(0),
239  fHistoElePtvsd0PromptMCS(0),
240  fHistoElePtvsd0BFeeddownMCS(0),
241  fHistoEleLambdaMassFeeddownXic0MCS(0),
242  fHistoEleLambdaMassFeeddownXic0MCGen(0),
243  fHistoEleLambdaMassvsElePtFeeddownXic0MCS(0),
244  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen(0),
245  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1(0),
246  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1(0),
247  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2(0),
248  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2(0),
249  fHistoElePtFeeddownXic0MCS(0),
250  fHistoElePtFeeddownXic0MCGen(0),
251  fHistoElePtvsEtaFeeddownXic0MCS(0),
252  fHistoElePtvsEtaFeeddownXic0MCGen(0),
253  fHistoElePtvsLambdaPtFeeddownXic0MCS(0),
254  fHistoElePtvsLambdaPtFeeddownXic0MCGen(0),
255  fHistoEleLambdaMassFeeddownXicPlusMCS(0),
256  fHistoEleLambdaMassFeeddownXicPlusMCGen(0),
257  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS(0),
258  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen(0),
259  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1(0),
260  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1(0),
261  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2(0),
262  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2(0),
263  fHistoElePtFeeddownXicPlusMCS(0),
264  fHistoElePtFeeddownXicPlusMCGen(0),
265  fHistoElePtvsEtaFeeddownXicPlusMCS(0),
266  fHistoElePtvsEtaFeeddownXicPlusMCGen(0),
267  fHistoElePtvsLambdaPtFeeddownXicPlusMCS(0),
268  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen(0),
269  fHistoBachPt(0),
270  fHistoBachPtMCS(0),
271  fHistoBachPtMCGen(0),
272  fHistod0Bach(0),
273  fHistoLambdaMassvsPt(0),
274  fHistoLambdaMassvsPtMCS(0),
275  fHistoLambdaMassvsPtMCGen(0),
276  fHistoLambdaPtvsEta(0),
277  fHistoLambdaPtvsEtaMCS(0),
278  fHistoLambdaPtvsEtaMCGen(0),
279  fHistoLambdaArmenteros(0),
280  fHistoLambdaArmenterosMCS(0),
281  fHistoLambdaPtvsDl(0),
282  fHistoLambdaPtvsDlSide(0),
283  fHistoLambdaPtvsDlMCS(0),
284  fHistoLambdaPtvsDlFeeddownXi0MCS(0),
285  fHistoLambdaPtvsDlFeeddownXiMinusMCS(0),
286  fHistoLambdaPtvsDlFeeddownOmegaMCS(0),
287  fHistoK0sMassvsPt(0),
288  fHistoElectronTPCPID(0),
289  fHistoElectronTOFPID(0),
290  fHistoElectronTPCSelPID(0),
291  fHistoElectronTOFSelPID(0),
292  fHistoElectronTPCPIDSelTOF(0),
293  fHistoElectronTPCPIDSelTOFSmallEta(0),
294  fHistoElectronTPCPIDSelTOFLargeEta(0),
295  fHistoMassConversionsMin(0),
296  fHistoMassConversionsSameSignMin(0),
297  fHistoElectronQovPtvsPhi(0),
298  fHistoLambdaQovPtvsPhi(0),
299  fHistoLcMCGen(0),
300  fHistoLcMCGen1(0),
301  fHistoLcMCGen2(0),
302  fHistoLbMCGen(0),
303  fHistoLbMCGen1(0),
304  fHistoLbMCGen2(0),
305  fHistoLcMCGenWithEleA(0),
306  fHistoLcMCGenWithEleB(0),
307  fHistoLbMCGenWithEleA(0),
308  fHistoLbMCGenWithEleB(0),
309  fHistoLbMCGenWithLambdac(0),
310  fHistoLcMCS(0),
311  fHistoLcMCS1(0),
312  fHistoLcMCS2(0),
313  fHistoLbMCS(0),
314  fHistoLbMCS1(0),
315  fHistoLbMCS2(0),
316  fHistoFeedDownXic0MCGen(0),
317  fHistoFeedDownXic0MCGen1(0),
318  fHistoFeedDownXic0MCGen2(0),
319  fHistoFeedDownXic0MCS(0),
320  fHistoFeedDownXic0MCS1(0),
321  fHistoFeedDownXic0MCS2(0),
322  fHistoFeedDownXicPlusMCGen(0),
323  fHistoFeedDownXicPlusMCGen1(0),
324  fHistoFeedDownXicPlusMCGen2(0),
325  fHistoFeedDownXicPlusMCS(0),
326  fHistoFeedDownXicPlusMCS1(0),
327  fHistoFeedDownXicPlusMCS2(0),
328  fHistoFeedDownSigmaMCGen(0),
329  fHistoFeedDownSigmaMCGen1(0),
330  fHistoFeedDownSigmaMCGen2(0),
331  fHistoFeedDownSigmaMCS(0),
332  fHistoFeedDownSigmaMCS1(0),
333  fHistoFeedDownSigmaMCS2(0),
334  fHistoLcElectronMCGen(0),
335  fHistoLcElectronMCGen1(0),
336  fHistoLcElectronMCGen2(0),
337  fHistoLcElectronMCS(0),
338  fHistoLcElectronMCS1(0),
339  fHistoLcElectronMCS2(0),
340  fHistoLbElectronMCGen(0),
341  fHistoLbElectronMCGen1(0),
342  fHistoLbElectronMCGen2(0),
343  fHistoLbElectronMCS(0),
344  fHistoLbElectronMCS1(0),
345  fHistoLbElectronMCS2(0),
346  fHistoElectronFeedDownXic0MCGen(0),
347  fHistoElectronFeedDownXic0MCGen1(0),
348  fHistoElectronFeedDownXic0MCGen2(0),
349  fHistoElectronFeedDownXic0MCS(0),
350  fHistoElectronFeedDownXic0MCS1(0),
351  fHistoElectronFeedDownXic0MCS2(0),
352  fHistoElectronFeedDownXicPlusMCGen(0),
353  fHistoElectronFeedDownXicPlusMCGen1(0),
354  fHistoElectronFeedDownXicPlusMCGen2(0),
355  fHistoElectronFeedDownXicPlusMCS(0),
356  fHistoElectronFeedDownXicPlusMCS1(0),
357  fHistoElectronFeedDownXicPlusMCS2(0),
358  fHistoElectronFeedDownXibMCGen(0),
359  fHistoElectronFeedDownXibMCGen1(0),
360  fHistoElectronFeedDownXibMCGen2(0),
361  fHistoElectronFeedDownXibMCS(0),
362  fHistoElectronFeedDownXibMCS1(0),
363  fHistoElectronFeedDownXibMCS2(0),
364  fHistoElectronMCGen(0),
365  fHistoBottomElectronMCGen(0),
366  fHistoCharmElectronMCGen(0),
367  fHistoLambdaMCGen(0),
368  fHistoElePtvsV0dlRS(0),
369  fHistoElePtvsV0dlRS1(0),
370  fHistoElePtvsV0dlRS2(0),
371  fHistoElePtvsV0dlRSSide(0),
372  fHistoElePtvsV0dlRSSide1(0),
373  fHistoElePtvsV0dlRSSide2(0),
374  fHistoElePtvsV0dlRSMix(0),
375  fHistoElePtvsV0dlRSMix1(0),
376  fHistoElePtvsV0dlRSMix2(0),
377  fHistoElePtvsV0dlWS(0),
378  fHistoElePtvsV0dlWS1(0),
379  fHistoElePtvsV0dlWS2(0),
380  fHistoElePtvsV0dlWSSide(0),
381  fHistoElePtvsV0dlWSSide1(0),
382  fHistoElePtvsV0dlWSSide2(0),
383  fHistoElePtvsV0dlWSMix(0),
384  fHistoElePtvsV0dlWSMix1(0),
385  fHistoElePtvsV0dlWSMix2(0),
386  fHistoElePtvsV0dlMCS(0),
387  fHistoElePtvsV0dlMCS1(0),
388  fHistoElePtvsV0dlMCS2(0),
389  fHistoElePtvsV0dlFeedDownXic0MCS(0),
390  fHistoElePtvsV0dlFeedDownXic0MCS1(0),
391  fHistoElePtvsV0dlFeedDownXic0MCS2(0),
392  fHistoElePtvsV0dlFeedDownXicPlusMCS(0),
393  fHistoElePtvsV0dlFeedDownXicPlusMCS1(0),
394  fHistoElePtvsV0dlFeedDownXicPlusMCS2(0),
395  fHistoElePtvsV0dcaRS(0),
396  fHistoElePtvsV0dcaRS1(0),
397  fHistoElePtvsV0dcaRS2(0),
398  fHistoElePtvsV0dcaRSSide(0),
399  fHistoElePtvsV0dcaRSSide1(0),
400  fHistoElePtvsV0dcaRSSide2(0),
401  fHistoElePtvsV0dcaRSMix(0),
402  fHistoElePtvsV0dcaRSMix1(0),
403  fHistoElePtvsV0dcaRSMix2(0),
404  fHistoElePtvsV0dcaWS(0),
405  fHistoElePtvsV0dcaWS1(0),
406  fHistoElePtvsV0dcaWS2(0),
407  fHistoElePtvsV0dcaWSSide(0),
408  fHistoElePtvsV0dcaWSSide1(0),
409  fHistoElePtvsV0dcaWSSide2(0),
410  fHistoElePtvsV0dcaWSMix(0),
411  fHistoElePtvsV0dcaWSMix1(0),
412  fHistoElePtvsV0dcaWSMix2(0),
413  fHistoElePtvsV0dcaMCS(0),
414  fHistoElePtvsV0dcaMCS1(0),
415  fHistoElePtvsV0dcaMCS2(0),
416  fHistoElePtvsV0dcaFeedDownXic0MCS(0),
417  fHistoElePtvsV0dcaFeedDownXic0MCS1(0),
418  fHistoElePtvsV0dcaFeedDownXic0MCS2(0),
419  fHistoElePtvsV0dcaFeedDownXicPlusMCS(0),
420  fHistoElePtvsV0dcaFeedDownXicPlusMCS1(0),
421  fHistoElePtvsV0dcaFeedDownXicPlusMCS2(0),
422  fHistoEleLambdaPtvsV0dlRS(0),
423  fHistoEleLambdaPtvsV0dlRS1(0),
424  fHistoEleLambdaPtvsV0dlRS2(0),
425  fHistoEleLambdaPtvsV0dlRSSide(0),
426  fHistoEleLambdaPtvsV0dlRSSide1(0),
427  fHistoEleLambdaPtvsV0dlRSSide2(0),
428  fHistoEleLambdaPtvsV0dlRSMix(0),
429  fHistoEleLambdaPtvsV0dlRSMix1(0),
430  fHistoEleLambdaPtvsV0dlRSMix2(0),
431  fHistoEleLambdaPtvsV0dlWS(0),
432  fHistoEleLambdaPtvsV0dlWS1(0),
433  fHistoEleLambdaPtvsV0dlWS2(0),
434  fHistoEleLambdaPtvsV0dlWSSide(0),
435  fHistoEleLambdaPtvsV0dlWSSide1(0),
436  fHistoEleLambdaPtvsV0dlWSSide2(0),
437  fHistoEleLambdaPtvsV0dlWSMix(0),
438  fHistoEleLambdaPtvsV0dlWSMix1(0),
439  fHistoEleLambdaPtvsV0dlWSMix2(0),
440  fHistoEleLambdaPtvsV0dlMCS(0),
441  fHistoEleLambdaPtvsV0dlMCS1(0),
442  fHistoEleLambdaPtvsV0dlMCS2(0),
443  fHistoEleLambdaPtvsV0dlPromptMCS(0),
444  fHistoEleLambdaPtvsV0dlPromptMCS1(0),
445  fHistoEleLambdaPtvsV0dlPromptMCS2(0),
446  fHistoEleLambdaPtvsV0dlBFeeddownMCS(0),
447  fHistoEleLambdaPtvsV0dlBFeeddownMCS1(0),
448  fHistoEleLambdaPtvsV0dlBFeeddownMCS2(0),
449  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS(0),
450  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1(0),
451  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2(0),
452  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS(0),
453  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS1(0),
454  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS2(0),
455  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS(0),
456  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS1(0),
457  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS2(0),
458  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS(0),
459  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1(0),
460  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2(0),
461  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS(0),
462  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS1(0),
463  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS2(0),
464  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS(0),
465  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS1(0),
466  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS2(0),
467  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS(0),
468  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS1(0),
469  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS2(0),
470  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS(0),
471  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS1(0),
472  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS2(0),
473  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS(0),
474  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS1(0),
475  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS2(0),
476  fHistoEleLambdaPtvsV0dlLambdabMCS(0),
477  fHistoEleLambdaPtvsV0dlLambdabMCS1(0),
478  fHistoEleLambdaPtvsV0dlLambdabMCS2(0),
479  fHistoEleLambdaPtvsV0dlXibMCS(0),
480  fHistoEleLambdaPtvsV0dlXibMCS1(0),
481  fHistoEleLambdaPtvsV0dlXibMCS2(0),
482  fHistoEleLambdaPtvsV0dlRSAway(0),
483  fHistoEleLambdaPtvsV0dlRS1Away(0),
484  fHistoEleLambdaPtvsV0dlRS2Away(0),
485  fHistoEleLambdaPtvsV0dlRSSideAway(0),
486  fHistoEleLambdaPtvsV0dlRSSide1Away(0),
487  fHistoEleLambdaPtvsV0dlRSSide2Away(0),
488  fHistoEleLambdaPtvsV0dlRSMixAway(0),
489  fHistoEleLambdaPtvsV0dlRSMix1Away(0),
490  fHistoEleLambdaPtvsV0dlRSMix2Away(0),
491  fHistoEleLambdaPtvsV0dlWSAway(0),
492  fHistoEleLambdaPtvsV0dlWS1Away(0),
493  fHistoEleLambdaPtvsV0dlWS2Away(0),
494  fHistoEleLambdaPtvsV0dlWSSideAway(0),
495  fHistoEleLambdaPtvsV0dlWSSide1Away(0),
496  fHistoEleLambdaPtvsV0dlWSSide2Away(0),
497  fHistoEleLambdaPtvsV0dlWSMixAway(0),
498  fHistoEleLambdaPtvsV0dlWSMix1Away(0),
499  fHistoEleLambdaPtvsV0dlWSMix2Away(0),
500  fHistoCorrelationVariablesvsEleLambdaPt(0),
501  fHistoCorrelationVariablesvsEleLambdaPtMix(0),
502  fHistoCorrelationVariablesvsEleLambdaPtMC(0),
503  fHistoCorrelationVariablesvsElePt(0),
504  fHistoCorrelationVariablesvsElePtMix(0),
505  fHistoCorrelationVariablesvsElePtMC(0),
506  fHistoCorrelationVariablesvsLambdaPt(0),
507  fHistoCorrelationVariablesvsLambdaPtMix(0),
508  fHistoCorrelationVariablesvsLambdaPtMC(0),
509  fHistoMassVariablesvsEleLambdaPt(0),
510  fHistoMassVariablesvsEleLambdaPtMix(0),
511  fHistoMassVariablesvsEleLambdaPtMC(0),
512  fHistoMassVariablesvsElePt(0),
513  fHistoMassVariablesvsElePtMix(0),
514  fHistoMassVariablesvsElePtMC(0),
515  fHistoMassVariablesvsLambdaPt(0),
516  fHistoMassVariablesvsLambdaPtMix(0),
517  fHistoMassVariablesvsLambdaPtMC(0),
518  fHistoResponseElePt(0),
519  fHistoResponseElePt1(0),
520  fHistoResponseElePt2(0),
521  fHistoResponseEleLambdaPt(0),
522  fHistoResponseEleLambdaPt1(0),
523  fHistoResponseEleLambdaPt2(0),
524  fHistoResponseEleLambdaPtFeeddownXic0(0),
525  fHistoResponseEleLambdaPtFeeddownXic01(0),
526  fHistoResponseEleLambdaPtFeeddownXic02(0),
527  fHistoResponseEleLambdaPtFeeddownXicPlus(0),
528  fHistoResponseEleLambdaPtFeeddownXicPlus1(0),
529  fHistoResponseEleLambdaPtFeeddownXicPlus2(0),
530  fHistoResponseEleLambdaPtFeeddownSigma(0),
531  fHistoResponseEleLambdaPtFeeddownSigma1(0),
532  fHistoResponseEleLambdaPtFeeddownSigma2(0),
533  fHistoResponseEleLambdaPtLambdab(0),
534  fHistoResponseElePtLambdab(0),
535  fHistoResponseLambdaPtLambdab(0),
536  fHistoResponseLambdaPt(0),
537  fHistoResponseLambdaPtFeeddownXic0(0),
538  fHistoResponseLambdaPtFeeddownXicPlus(0),
539  fHistoResponseLambdaPtFeeddownSigma(0),
540  fHistoResponseLambdaPtvsEleLambdaPt(0),
541  fHistoResponseLambdaPtvsEleLambdaPtLambdab(0),
542  fHistoResponseMcGenLambdabPtvsLambdacPt(0),
543  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt(0),
544  fHistoEleLambdaPtvsRapidityRS(0),
545  fHistoEleLambdaPtvsRapidityWS(0),
546  fHistoEleLambdaPtvsRapidityMCS(0),
547  fHistoPi0MCGen(0),
548  fHistoElectronPi0Total(0),
549  fHistoElectronPi0Tag(0),
550  fHistoEtaMCGen(0),
551  fHistoElectronEtaTotal(0),
552  fHistoElectronEtaTag(0),
553  fCounter(0),
554  fHistonEvtvsRunNumber(0),
555  fHistonElevsRunNumber(0),
556  fHistonLambdavsRunNumber(0),
557  fHistoMCEventType(0),
558  fHistoMCDeltaPhiccbar(0),
559  fRefMult(9.26),
560  fGTI(0),fGTIndex(0), fTrackBuffSize(19000),
561  fHistodPhiSdEtaSElectronProtonR125RS(0),
562  fHistodPhiSdEtaSElectronProtonR125WS(0),
563  fHistodPhiSdEtaSElectronProtonR125RSMix(0),
564  fHistodPhiSdEtaSElectronProtonR125WSMix(0),
565  fHistodPhiSdEtaSElectronPionR125RS(0),
566  fHistodPhiSdEtaSElectronPionR125WS(0),
567  fHistodPhiSdEtaSElectronPionR125RSMix(0),
568  fHistodPhiSdEtaSElectronPionR125WSMix(0),
569  fDoEventMixing(0),
570  fMixWithoutConversionFlag(kFALSE),
571  fNumberOfEventsForMixing (5),
572  fNzVtxBins (0),
573  fNCentBins (0),
574  fNOfPools(1),
575  fPoolIndex(-9999),
576  nextResVec(),
577  reservoirsReady(),
578  m_ReservoirE(),
579  m_ReservoirL1(),
580  m_ReservoirL2(),
581  m_ReservoirVarsE(),
582  m_ReservoirVarsL1(),
583  m_ReservoirVarsL2()
584 {
585  //
587  //
588  for(Int_t i=0;i<17;i++){
589  fHistoElePtvsCutVarsRS[i] = 0;
590  fHistoElePtvsCutVarsWS[i] = 0;
592  }
593  for(Int_t i=0;i<8;i++){
595  }
596  for(Int_t i=0; i<4; i++) fMultEstimatorAvg[i]=0;
597 }
598 
599 //___________________________________________________________________________
602  Bool_t writeVariableTree) :
603  AliAnalysisTaskSE(name),
604  fUseMCInfo(kFALSE),
605  fOutput(0),
606  fOutputAll(0),
607  fListCuts(0),
608  fCEvents(0),
609  fHTrigger(0),
610  fHCentrality(0),
611  fHEventPlane(0),
612  fHNTrackletvsZ(0),
613  fHNTrackletCorrvsZ(0),
614  fAnalCuts(analCuts),
615  fIsEventSelected(kFALSE),
616  fWriteVariableTree(writeVariableTree),
617  fWriteEachVariableTree(kFALSE),
618  fWriteMCVariableTree(kFALSE),
619  fVariablesTree(0),
620  fEleVariablesTree(0),
621  fV0VariablesTree(0),
622  fSingleVariablesTree(0),
623  fMCVariablesTree(0),
624  fMCEleVariablesTree(0),
625  fMCV0VariablesTree(0),
626  fMCGenPairVariablesTree(0),
627  fCorrelationVariablesTree(0),
628  fReconstructPrimVert(kFALSE),
629  fIsMB(kFALSE),
630  fIsSemi(kFALSE),
631  fIsCent(kFALSE),
632  fIsINT7(kFALSE),
633  fIsEMC7(kFALSE),
634  fCandidateVariables(),
635  fCandidateEleVariables(),
636  fCandidateV0Variables(),
637  fCandidateSingleVariables(),
638  fCandidateMCVariables(),
639  fCandidateMCEleVariables(),
640  fCandidateMCV0Variables(),
641  fCandidateMCGenPairVariables(),
642  fCorrelationVariables(),
643  fVtx1(0),
644  fV1(0),
645  fVtxZ(0),
646  fEventPlane(0),
647  fBzkG(0),
648  fCentrality(0),
649  fRunNumber(0),
650  fTriggerCheck(0),
651  fUseCentralityV0M(kFALSE),
652  fUseCentralitySPDTracklet(kFALSE),
653  fUseEventPlane(kFALSE),
654  fEvNumberCounter(0),
655  fMCEventType(-9999),
656  fMCDoPairAnalysis(kFALSE),
657  fHistoEleLambdaMass(0),
658  fHistoEleLambdaMassRS(0),
659  fHistoEleLambdaMassRS1(0),
660  fHistoEleLambdaMassRS2(0),
661  fHistoEleLambdaMassWS(0),
662  fHistoEleLambdaMassWS1(0),
663  fHistoEleLambdaMassWS2(0),
664  fHistoEleLambdaMassRSMix(0),
665  fHistoEleLambdaMassRSMix1(0),
666  fHistoEleLambdaMassRSMix2(0),
667  fHistoEleLambdaMassWSMix(0),
668  fHistoEleLambdaMassWSMix1(0),
669  fHistoEleLambdaMassWSMix2(0),
670  fHistoEleLambdaMassRSSide(0),
671  fHistoEleLambdaMassRSSide1(0),
672  fHistoEleLambdaMassRSSide2(0),
673  fHistoEleLambdaMassWSSide(0),
674  fHistoEleLambdaMassWSSide1(0),
675  fHistoEleLambdaMassWSSide2(0),
676  fHistoEleLambdaMassRSAway(0),
677  fHistoEleLambdaMassRS1Away(0),
678  fHistoEleLambdaMassRS2Away(0),
679  fHistoEleLambdaMassWSAway(0),
680  fHistoEleLambdaMassWS1Away(0),
681  fHistoEleLambdaMassWS2Away(0),
682  fHistoEleLambdaMassRSMixAway(0),
683  fHistoEleLambdaMassRSMix1Away(0),
684  fHistoEleLambdaMassRSMix2Away(0),
685  fHistoEleLambdaMassWSMixAway(0),
686  fHistoEleLambdaMassWSMix1Away(0),
687  fHistoEleLambdaMassWSMix2Away(0),
688  fHistoEleLambdaMassRSSideAway(0),
689  fHistoEleLambdaMassRSSide1Away(0),
690  fHistoEleLambdaMassRSSide2Away(0),
691  fHistoEleLambdaMassWSSideAway(0),
692  fHistoEleLambdaMassWSSide1Away(0),
693  fHistoEleLambdaMassWSSide2Away(0),
694  fHistoEleLambdaMassvsElePtRS(0),
695  fHistoEleLambdaMassvsElePtWS(0),
696  fHistoEleLambdaMassvsElePtRSMix(0),
697  fHistoEleLambdaMassvsElePtWSMix(0),
698  fHistoEleLambdaMassvsElePtRSSide(0),
699  fHistoEleLambdaMassvsElePtWSSide(0),
700  fHistoEleLambdaMassvsElePtRS1(0),
701  fHistoEleLambdaMassvsElePtWS1(0),
702  fHistoEleLambdaMassvsElePtRSMix1(0),
703  fHistoEleLambdaMassvsElePtWSMix1(0),
704  fHistoEleLambdaMassvsElePtRSSide1(0),
705  fHistoEleLambdaMassvsElePtWSSide1(0),
706  fHistoEleLambdaMassvsElePtRS2(0),
707  fHistoEleLambdaMassvsElePtWS2(0),
708  fHistoEleLambdaMassvsElePtRSMix2(0),
709  fHistoEleLambdaMassvsElePtWSMix2(0),
710  fHistoEleLambdaMassvsElePtRSSide2(0),
711  fHistoEleLambdaMassvsElePtWSSide2(0),
712  fHistoElePtRS(0),
713  fHistoElePtWS(0),
714  fHistoElePtRSMix(0),
715  fHistoElePtWSMix(0),
716  fHistoEleLambdaMassMCS(0),
717  fHistoEleLambdaMassLambdabMCS(0),
718  fHistoEleLambdaMassXibMCS(0),
719  fHistoEleLambdaMassMCGen(0),
720  fHistoEleLambdaMassvsElePtMCS(0),
721  fHistoEleLambdaMassvsElePtMCGen(0),
722  fHistoEleLambdaMassvsElePtMCS1(0),
723  fHistoEleLambdaMassvsElePtMCGen1(0),
724  fHistoEleLambdaMassvsElePtMCS2(0),
725  fHistoEleLambdaMassvsElePtMCGen2(0),
726  fHistoElePtMCS(0),
727  fHistoElePtMCGen(0),
728  fHistoElePtvsEtaRS(0),
729  fHistoElePtvsEtaWS(0),
730  fHistoElePtvsEtaRSMix(0),
731  fHistoElePtvsEtaWSMix(0),
732  fHistoElePtvsEtaMCS(0),
733  fHistoElePtvsEtaMCGen(0),
734  fHistoElePtvsLambdaPtRS(0),
735  fHistoElePtvsLambdaPtWS(0),
736  fHistoElePtvsLambdaPtRSMix(0),
737  fHistoElePtvsLambdaPtWSMix(0),
738  fHistoElePtvsLambdaPtMCS(0),
739  fHistoElePtvsLambdaPtvsLcPtMCS(0),
740  fHistoElePtvsLambdaPtMCGen(0),
741  fHistoElePtvsLambdaPtvsLcPtMCGen(0),
742  fHistoElePtvsLambdaPtMCLcGen(0),
743  fHistoElePtvsd0RS(0),
744  fHistoElePtvsd0WS(0),
745  fHistoElePtvsd0RSMix(0),
746  fHistoElePtvsd0WSMix(0),
747  fHistoElePtvsd0MCS(0),
748  fHistoElePtvsd0PromptMCS(0),
749  fHistoElePtvsd0BFeeddownMCS(0),
750  fHistoEleLambdaMassFeeddownXic0MCS(0),
751  fHistoEleLambdaMassFeeddownXic0MCGen(0),
752  fHistoEleLambdaMassvsElePtFeeddownXic0MCS(0),
753  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen(0),
754  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1(0),
755  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1(0),
756  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2(0),
757  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2(0),
758  fHistoElePtFeeddownXic0MCS(0),
759  fHistoElePtFeeddownXic0MCGen(0),
760  fHistoElePtvsEtaFeeddownXic0MCS(0),
761  fHistoElePtvsEtaFeeddownXic0MCGen(0),
762  fHistoElePtvsLambdaPtFeeddownXic0MCS(0),
763  fHistoElePtvsLambdaPtFeeddownXic0MCGen(0),
764  fHistoEleLambdaMassFeeddownXicPlusMCS(0),
765  fHistoEleLambdaMassFeeddownXicPlusMCGen(0),
766  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS(0),
767  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen(0),
768  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1(0),
769  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1(0),
770  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2(0),
771  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2(0),
772  fHistoElePtFeeddownXicPlusMCS(0),
773  fHistoElePtFeeddownXicPlusMCGen(0),
774  fHistoElePtvsEtaFeeddownXicPlusMCS(0),
775  fHistoElePtvsEtaFeeddownXicPlusMCGen(0),
776  fHistoElePtvsLambdaPtFeeddownXicPlusMCS(0),
777  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen(0),
778  fHistoBachPt(0),
779  fHistoBachPtMCS(0),
780  fHistoBachPtMCGen(0),
781  fHistod0Bach(0),
782  fHistoLambdaMassvsPt(0),
783  fHistoLambdaMassvsPtMCS(0),
784  fHistoLambdaMassvsPtMCGen(0),
785  fHistoLambdaPtvsEta(0),
786  fHistoLambdaPtvsEtaMCS(0),
787  fHistoLambdaPtvsEtaMCGen(0),
788  fHistoLambdaArmenteros(0),
789  fHistoLambdaArmenterosMCS(0),
790  fHistoLambdaPtvsDl(0),
791  fHistoLambdaPtvsDlSide(0),
792  fHistoLambdaPtvsDlMCS(0),
793  fHistoLambdaPtvsDlFeeddownXi0MCS(0),
794  fHistoLambdaPtvsDlFeeddownXiMinusMCS(0),
795  fHistoLambdaPtvsDlFeeddownOmegaMCS(0),
796  fHistoK0sMassvsPt(0),
797  fHistoElectronTPCPID(0),
798  fHistoElectronTOFPID(0),
799  fHistoElectronTPCSelPID(0),
800  fHistoElectronTOFSelPID(0),
801  fHistoElectronTPCPIDSelTOF(0),
802  fHistoElectronTPCPIDSelTOFSmallEta(0),
803  fHistoElectronTPCPIDSelTOFLargeEta(0),
804  fHistoMassConversionsMin(0),
805  fHistoMassConversionsSameSignMin(0),
806  fHistoElectronQovPtvsPhi(0),
807  fHistoLambdaQovPtvsPhi(0),
808  fHistoLcMCGen(0),
809  fHistoLcMCGen1(0),
810  fHistoLcMCGen2(0),
811  fHistoLbMCGen(0),
812  fHistoLbMCGen1(0),
813  fHistoLbMCGen2(0),
814  fHistoLcMCGenWithEleA(0),
815  fHistoLcMCGenWithEleB(0),
816  fHistoLbMCGenWithEleA(0),
817  fHistoLbMCGenWithEleB(0),
818  fHistoLbMCGenWithLambdac(0),
819  fHistoLcMCS(0),
820  fHistoLcMCS1(0),
821  fHistoLcMCS2(0),
822  fHistoLbMCS(0),
823  fHistoLbMCS1(0),
824  fHistoLbMCS2(0),
825  fHistoFeedDownXic0MCGen(0),
826  fHistoFeedDownXic0MCGen1(0),
827  fHistoFeedDownXic0MCGen2(0),
828  fHistoFeedDownXic0MCS(0),
829  fHistoFeedDownXic0MCS1(0),
830  fHistoFeedDownXic0MCS2(0),
831  fHistoFeedDownXicPlusMCGen(0),
832  fHistoFeedDownXicPlusMCGen1(0),
833  fHistoFeedDownXicPlusMCGen2(0),
834  fHistoFeedDownXicPlusMCS(0),
835  fHistoFeedDownXicPlusMCS1(0),
836  fHistoFeedDownXicPlusMCS2(0),
837  fHistoFeedDownSigmaMCGen(0),
838  fHistoFeedDownSigmaMCGen1(0),
839  fHistoFeedDownSigmaMCGen2(0),
840  fHistoFeedDownSigmaMCS(0),
841  fHistoFeedDownSigmaMCS1(0),
842  fHistoFeedDownSigmaMCS2(0),
843  fHistoLcElectronMCGen(0),
844  fHistoLcElectronMCGen1(0),
845  fHistoLcElectronMCGen2(0),
846  fHistoLcElectronMCS(0),
847  fHistoLcElectronMCS1(0),
848  fHistoLcElectronMCS2(0),
849  fHistoLbElectronMCGen(0),
850  fHistoLbElectronMCGen1(0),
851  fHistoLbElectronMCGen2(0),
852  fHistoLbElectronMCS(0),
853  fHistoLbElectronMCS1(0),
854  fHistoLbElectronMCS2(0),
855  fHistoElectronFeedDownXic0MCGen(0),
856  fHistoElectronFeedDownXic0MCGen1(0),
857  fHistoElectronFeedDownXic0MCGen2(0),
858  fHistoElectronFeedDownXic0MCS(0),
859  fHistoElectronFeedDownXic0MCS1(0),
860  fHistoElectronFeedDownXic0MCS2(0),
861  fHistoElectronFeedDownXicPlusMCGen(0),
862  fHistoElectronFeedDownXicPlusMCGen1(0),
863  fHistoElectronFeedDownXicPlusMCGen2(0),
864  fHistoElectronFeedDownXicPlusMCS(0),
865  fHistoElectronFeedDownXicPlusMCS1(0),
866  fHistoElectronFeedDownXicPlusMCS2(0),
867  fHistoElectronFeedDownXibMCGen(0),
868  fHistoElectronFeedDownXibMCGen1(0),
869  fHistoElectronFeedDownXibMCGen2(0),
870  fHistoElectronFeedDownXibMCS(0),
871  fHistoElectronFeedDownXibMCS1(0),
872  fHistoElectronFeedDownXibMCS2(0),
873  fHistoElectronMCGen(0),
874  fHistoBottomElectronMCGen(0),
875  fHistoCharmElectronMCGen(0),
876  fHistoLambdaMCGen(0),
877  fHistoElePtvsV0dlRS(0),
878  fHistoElePtvsV0dlRS1(0),
879  fHistoElePtvsV0dlRS2(0),
880  fHistoElePtvsV0dlRSSide(0),
881  fHistoElePtvsV0dlRSSide1(0),
882  fHistoElePtvsV0dlRSSide2(0),
883  fHistoElePtvsV0dlRSMix(0),
884  fHistoElePtvsV0dlRSMix1(0),
885  fHistoElePtvsV0dlRSMix2(0),
886  fHistoElePtvsV0dlWS(0),
887  fHistoElePtvsV0dlWS1(0),
888  fHistoElePtvsV0dlWS2(0),
889  fHistoElePtvsV0dlWSSide(0),
890  fHistoElePtvsV0dlWSSide1(0),
891  fHistoElePtvsV0dlWSSide2(0),
892  fHistoElePtvsV0dlWSMix(0),
893  fHistoElePtvsV0dlWSMix1(0),
894  fHistoElePtvsV0dlWSMix2(0),
895  fHistoElePtvsV0dlMCS(0),
896  fHistoElePtvsV0dlMCS1(0),
897  fHistoElePtvsV0dlMCS2(0),
898  fHistoElePtvsV0dlFeedDownXic0MCS(0),
899  fHistoElePtvsV0dlFeedDownXic0MCS1(0),
900  fHistoElePtvsV0dlFeedDownXic0MCS2(0),
901  fHistoElePtvsV0dlFeedDownXicPlusMCS(0),
902  fHistoElePtvsV0dlFeedDownXicPlusMCS1(0),
903  fHistoElePtvsV0dlFeedDownXicPlusMCS2(0),
904  fHistoElePtvsV0dcaRS(0),
905  fHistoElePtvsV0dcaRS1(0),
906  fHistoElePtvsV0dcaRS2(0),
907  fHistoElePtvsV0dcaRSSide(0),
908  fHistoElePtvsV0dcaRSSide1(0),
909  fHistoElePtvsV0dcaRSSide2(0),
910  fHistoElePtvsV0dcaRSMix(0),
911  fHistoElePtvsV0dcaRSMix1(0),
912  fHistoElePtvsV0dcaRSMix2(0),
913  fHistoElePtvsV0dcaWS(0),
914  fHistoElePtvsV0dcaWS1(0),
915  fHistoElePtvsV0dcaWS2(0),
916  fHistoElePtvsV0dcaWSSide(0),
917  fHistoElePtvsV0dcaWSSide1(0),
918  fHistoElePtvsV0dcaWSSide2(0),
919  fHistoElePtvsV0dcaWSMix(0),
920  fHistoElePtvsV0dcaWSMix1(0),
921  fHistoElePtvsV0dcaWSMix2(0),
922  fHistoElePtvsV0dcaMCS(0),
923  fHistoElePtvsV0dcaMCS1(0),
924  fHistoElePtvsV0dcaMCS2(0),
925  fHistoElePtvsV0dcaFeedDownXic0MCS(0),
926  fHistoElePtvsV0dcaFeedDownXic0MCS1(0),
927  fHistoElePtvsV0dcaFeedDownXic0MCS2(0),
928  fHistoElePtvsV0dcaFeedDownXicPlusMCS(0),
929  fHistoElePtvsV0dcaFeedDownXicPlusMCS1(0),
930  fHistoElePtvsV0dcaFeedDownXicPlusMCS2(0),
931  fHistoEleLambdaPtvsV0dlRS(0),
932  fHistoEleLambdaPtvsV0dlRS1(0),
933  fHistoEleLambdaPtvsV0dlRS2(0),
934  fHistoEleLambdaPtvsV0dlRSSide(0),
935  fHistoEleLambdaPtvsV0dlRSSide1(0),
936  fHistoEleLambdaPtvsV0dlRSSide2(0),
937  fHistoEleLambdaPtvsV0dlRSMix(0),
938  fHistoEleLambdaPtvsV0dlRSMix1(0),
939  fHistoEleLambdaPtvsV0dlRSMix2(0),
940  fHistoEleLambdaPtvsV0dlWS(0),
941  fHistoEleLambdaPtvsV0dlWS1(0),
942  fHistoEleLambdaPtvsV0dlWS2(0),
943  fHistoEleLambdaPtvsV0dlWSSide(0),
944  fHistoEleLambdaPtvsV0dlWSSide1(0),
945  fHistoEleLambdaPtvsV0dlWSSide2(0),
946  fHistoEleLambdaPtvsV0dlWSMix(0),
947  fHistoEleLambdaPtvsV0dlWSMix1(0),
948  fHistoEleLambdaPtvsV0dlWSMix2(0),
949  fHistoEleLambdaPtvsV0dlMCS(0),
950  fHistoEleLambdaPtvsV0dlMCS1(0),
951  fHistoEleLambdaPtvsV0dlMCS2(0),
952  fHistoEleLambdaPtvsV0dlPromptMCS(0),
953  fHistoEleLambdaPtvsV0dlPromptMCS1(0),
954  fHistoEleLambdaPtvsV0dlPromptMCS2(0),
955  fHistoEleLambdaPtvsV0dlBFeeddownMCS(0),
956  fHistoEleLambdaPtvsV0dlBFeeddownMCS1(0),
957  fHistoEleLambdaPtvsV0dlBFeeddownMCS2(0),
958  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS(0),
959  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1(0),
960  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2(0),
961  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS(0),
962  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS1(0),
963  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS2(0),
964  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS(0),
965  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS1(0),
966  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS2(0),
967  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS(0),
968  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1(0),
969  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2(0),
970  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS(0),
971  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS1(0),
972  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS2(0),
973  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS(0),
974  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS1(0),
975  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS2(0),
976  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS(0),
977  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS1(0),
978  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS2(0),
979  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS(0),
980  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS1(0),
981  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS2(0),
982  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS(0),
983  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS1(0),
984  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS2(0),
985  fHistoEleLambdaPtvsV0dlLambdabMCS(0),
986  fHistoEleLambdaPtvsV0dlLambdabMCS1(0),
987  fHistoEleLambdaPtvsV0dlLambdabMCS2(0),
988  fHistoEleLambdaPtvsV0dlXibMCS(0),
989  fHistoEleLambdaPtvsV0dlXibMCS1(0),
990  fHistoEleLambdaPtvsV0dlXibMCS2(0),
991  fHistoEleLambdaPtvsV0dlRSAway(0),
992  fHistoEleLambdaPtvsV0dlRS1Away(0),
993  fHistoEleLambdaPtvsV0dlRS2Away(0),
994  fHistoEleLambdaPtvsV0dlRSSideAway(0),
995  fHistoEleLambdaPtvsV0dlRSSide1Away(0),
996  fHistoEleLambdaPtvsV0dlRSSide2Away(0),
997  fHistoEleLambdaPtvsV0dlRSMixAway(0),
998  fHistoEleLambdaPtvsV0dlRSMix1Away(0),
999  fHistoEleLambdaPtvsV0dlRSMix2Away(0),
1000  fHistoEleLambdaPtvsV0dlWSAway(0),
1001  fHistoEleLambdaPtvsV0dlWS1Away(0),
1002  fHistoEleLambdaPtvsV0dlWS2Away(0),
1003  fHistoEleLambdaPtvsV0dlWSSideAway(0),
1004  fHistoEleLambdaPtvsV0dlWSSide1Away(0),
1005  fHistoEleLambdaPtvsV0dlWSSide2Away(0),
1006  fHistoEleLambdaPtvsV0dlWSMixAway(0),
1007  fHistoEleLambdaPtvsV0dlWSMix1Away(0),
1008  fHistoEleLambdaPtvsV0dlWSMix2Away(0),
1009  fHistoCorrelationVariablesvsEleLambdaPt(0),
1010  fHistoCorrelationVariablesvsEleLambdaPtMix(0),
1011  fHistoCorrelationVariablesvsEleLambdaPtMC(0),
1012  fHistoCorrelationVariablesvsElePt(0),
1013  fHistoCorrelationVariablesvsElePtMix(0),
1014  fHistoCorrelationVariablesvsElePtMC(0),
1015  fHistoCorrelationVariablesvsLambdaPt(0),
1016  fHistoCorrelationVariablesvsLambdaPtMix(0),
1017  fHistoCorrelationVariablesvsLambdaPtMC(0),
1018  fHistoMassVariablesvsEleLambdaPt(0),
1019  fHistoMassVariablesvsEleLambdaPtMix(0),
1020  fHistoMassVariablesvsEleLambdaPtMC(0),
1021  fHistoMassVariablesvsElePt(0),
1022  fHistoMassVariablesvsElePtMix(0),
1023  fHistoMassVariablesvsElePtMC(0),
1024  fHistoMassVariablesvsLambdaPt(0),
1025  fHistoMassVariablesvsLambdaPtMix(0),
1026  fHistoMassVariablesvsLambdaPtMC(0),
1027  fHistoResponseElePt(0),
1028  fHistoResponseElePt1(0),
1029  fHistoResponseElePt2(0),
1030  fHistoResponseEleLambdaPt(0),
1031  fHistoResponseEleLambdaPt1(0),
1032  fHistoResponseEleLambdaPt2(0),
1033  fHistoResponseEleLambdaPtFeeddownXic0(0),
1034  fHistoResponseEleLambdaPtFeeddownXic01(0),
1035  fHistoResponseEleLambdaPtFeeddownXic02(0),
1036  fHistoResponseEleLambdaPtFeeddownXicPlus(0),
1037  fHistoResponseEleLambdaPtFeeddownXicPlus1(0),
1038  fHistoResponseEleLambdaPtFeeddownXicPlus2(0),
1039  fHistoResponseEleLambdaPtFeeddownSigma(0),
1040  fHistoResponseEleLambdaPtFeeddownSigma1(0),
1041  fHistoResponseEleLambdaPtFeeddownSigma2(0),
1042  fHistoResponseEleLambdaPtLambdab(0),
1043  fHistoResponseElePtLambdab(0),
1044  fHistoResponseLambdaPtLambdab(0),
1045  fHistoResponseLambdaPt(0),
1046  fHistoResponseLambdaPtFeeddownXic0(0),
1047  fHistoResponseLambdaPtFeeddownXicPlus(0),
1048  fHistoResponseLambdaPtFeeddownSigma(0),
1049  fHistoResponseLambdaPtvsEleLambdaPt(0),
1050  fHistoResponseLambdaPtvsEleLambdaPtLambdab(0),
1051  fHistoResponseMcGenLambdabPtvsLambdacPt(0),
1052  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt(0),
1053  fHistoEleLambdaPtvsRapidityRS(0),
1054  fHistoEleLambdaPtvsRapidityWS(0),
1055  fHistoEleLambdaPtvsRapidityMCS(0),
1056  fHistoPi0MCGen(0),
1057  fHistoElectronPi0Total(0),
1058  fHistoElectronPi0Tag(0),
1059  fHistoEtaMCGen(0),
1060  fHistoElectronEtaTotal(0),
1061  fHistoElectronEtaTag(0),
1062  fCounter(0),
1063  fHistonEvtvsRunNumber(0),
1064  fHistonElevsRunNumber(0),
1065  fHistonLambdavsRunNumber(0),
1066  fHistoMCEventType(0),
1067  fHistoMCDeltaPhiccbar(0),
1068  fRefMult(9.26),
1069  fGTI(0),fGTIndex(0), fTrackBuffSize(19000),
1070  fHistodPhiSdEtaSElectronProtonR125RS(0),
1071  fHistodPhiSdEtaSElectronProtonR125WS(0),
1072  fHistodPhiSdEtaSElectronProtonR125RSMix(0),
1073  fHistodPhiSdEtaSElectronProtonR125WSMix(0),
1074  fHistodPhiSdEtaSElectronPionR125RS(0),
1075  fHistodPhiSdEtaSElectronPionR125WS(0),
1076  fHistodPhiSdEtaSElectronPionR125RSMix(0),
1077  fHistodPhiSdEtaSElectronPionR125WSMix(0),
1078  fDoEventMixing(0),
1079  fMixWithoutConversionFlag(kFALSE),
1080  fNumberOfEventsForMixing (5),
1081  fNzVtxBins (0),
1082  fNCentBins (0),
1083  fNOfPools(1),
1084  fPoolIndex(-9999),
1085  nextResVec(),
1086  reservoirsReady(),
1087  m_ReservoirE(),
1088  m_ReservoirL1(),
1089  m_ReservoirL2(),
1090  m_ReservoirVarsE(),
1091  m_ReservoirVarsL1(),
1092  m_ReservoirVarsL2()
1093 {
1094  //
1096  //
1097  Info("AliAnalysisTaskSELc2eleLambdafromAODtracks","Calling Constructor");
1098 
1099  for(Int_t i=0;i<17;i++){
1100  fHistoElePtvsCutVarsRS[i] = 0;
1101  fHistoElePtvsCutVarsWS[i] = 0;
1102  fHistoElePtvsCutVarsMCS[i] = 0;
1103  }
1104  for(Int_t i=0;i<8;i++){
1106  }
1107  for(Int_t i=0; i<4; i++) fMultEstimatorAvg[i]=0;
1108 
1109  DefineOutput(1,TList::Class()); //conters
1110  DefineOutput(2,TList::Class());
1111  DefineOutput(3,TList::Class()); //conters
1112  DefineOutput(4,TTree::Class()); //My private output
1113  DefineOutput(5,TTree::Class()); //My private output
1114  DefineOutput(6,TTree::Class()); //My private output
1115  DefineOutput(7,TTree::Class()); //My private output
1116  DefineOutput(8,AliNormalizationCounter::Class());
1117  DefineOutput(9,TTree::Class()); //My private output
1118  DefineOutput(10,TTree::Class()); //My private output
1119  DefineOutput(11,TTree::Class()); //My private output
1120  DefineOutput(12,TTree::Class()); //My private output
1121 }
1122 
1123 //___________________________________________________________________________
1125  //
1127  //
1128  Info("~AliAnalysisTaskSELc2eleLambdafromAODtracks","Calling Destructor");
1129 
1130  if (fOutput) {
1131  delete fOutput;
1132  fOutput = 0;
1133  }
1134 
1135  if (fOutputAll) {
1136  delete fOutputAll;
1137  fOutputAll = 0;
1138  }
1139 
1140  if (fListCuts) {
1141  delete fListCuts;
1142  fListCuts = 0;
1143  }
1144 
1145 
1146  if (fAnalCuts) {
1147  delete fAnalCuts;
1148  fAnalCuts = 0;
1149  }
1150 
1151  if (fVariablesTree) {
1152  delete fVariablesTree;
1153  fVariablesTree = 0;
1154  }
1155  if (fEleVariablesTree) {
1156  delete fEleVariablesTree;
1157  fEleVariablesTree = 0;
1158  }
1159  if (fV0VariablesTree) {
1160  delete fV0VariablesTree;
1161  fV0VariablesTree = 0;
1162  }
1163  if (fSingleVariablesTree) {
1164  delete fSingleVariablesTree;
1166  }
1167  if (fMCVariablesTree) {
1168  delete fMCVariablesTree;
1169  fMCVariablesTree = 0;
1170  }
1171  if (fMCEleVariablesTree) {
1172  delete fMCEleVariablesTree;
1173  fMCEleVariablesTree = 0;
1174  }
1175  if (fMCV0VariablesTree) {
1176  delete fMCV0VariablesTree;
1177  fMCV0VariablesTree = 0;
1178  }
1180  delete fMCGenPairVariablesTree;
1182  }
1186  }
1187  if(fCounter){
1188  delete fCounter;
1189  fCounter = 0;
1190  }
1191 
1192  for(int i = 0;i<fNOfPools;i++){
1193  for(unsigned int j=0;j<fNumberOfEventsForMixing;j++){
1194  while(!m_ReservoirE[i][j].empty()){
1195  delete m_ReservoirE[i][j].back();
1196  m_ReservoirE[i][j].pop_back();
1197  }
1198  while(!m_ReservoirL1[i][j].empty()){
1199  delete m_ReservoirL1[i][j].back();
1200  m_ReservoirL1[i][j].pop_back();
1201  }
1202  while(!m_ReservoirL2[i][j].empty()){
1203  delete m_ReservoirL2[i][j].back();
1204  m_ReservoirL2[i][j].pop_back();
1205  }
1206  while(!m_ReservoirVarsE[i][j].empty()){
1207  delete m_ReservoirVarsE[i][j].back();
1208  m_ReservoirVarsE[i][j].pop_back();
1209  }
1210  while(!m_ReservoirVarsL1[i][j].empty()){
1211  delete m_ReservoirVarsL1[i][j].back();
1212  m_ReservoirVarsL1[i][j].pop_back();
1213  }
1214  while(!m_ReservoirVarsL2[i][j].empty()){
1215  delete m_ReservoirVarsL2[i][j].back();
1216  m_ReservoirVarsL2[i][j].pop_back();
1217  }
1218  }
1219  }
1220 
1221  if (fGTI)
1222  delete[] fGTI;
1223  fGTI=0;
1224  if (fGTIndex)
1225  delete[] fGTIndex;
1226  fGTIndex=0;
1227 }
1228 
1229 //_________________________________________________
1231  //
1233  //
1234  //
1235 
1236  fIsEventSelected=kFALSE;
1237 
1238  if (fDebug > 1) AliInfo("Init");
1239 
1240  fListCuts = new TList();
1241  fListCuts->SetOwner();
1242  fListCuts->SetName("ListCuts");
1244  PostData(2,fListCuts);
1245 
1246  return;
1247 }
1248 
1249 //_________________________________________________
1251 {
1252  //
1254  //
1255 
1256  if (!fInputEvent) {
1257  AliError("NO EVENT FOUND!");
1258  return;
1259  }
1260  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
1261  fCEvents->Fill(1);
1262  fEvNumberCounter++;
1263 
1264  //------------------------------------------------
1265  // First check if the event has proper B
1266  //------------------------------------------------
1267 
1268  fBzkG = (Double_t)aodEvent->GetMagneticField();
1269  AliKFParticle::SetField(fBzkG);
1270  if (TMath::Abs(fBzkG)<0.001) {
1271  return;
1272  }
1273  fCEvents->Fill(2);
1274 
1275  Int_t countTr=0;
1276  Double_t countCorr=0;
1278  {
1279  AliAODTracklets* tracklets=aodEvent->GetTracklets();
1280  Int_t nTr=tracklets->GetNumberOfTracklets();
1281  for(Int_t iTr=0; iTr<nTr; iTr++){
1282  Double_t theta=tracklets->GetTheta(iTr);
1283  Double_t eta=-TMath::Log(TMath::Tan(theta/2.));
1284  if(eta>-1.0 && eta<1.0) countTr++;
1285  }
1286  AliAODVertex *vtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
1287  Bool_t isVtxOk=kFALSE;
1288  if(vtx1){
1289  if(vtx1->GetNContributors()>0){
1290  fCEvents->Fill(8);
1291  isVtxOk=kTRUE;
1292  }
1293  }
1294 
1295  countCorr=countTr;
1296  if(isVtxOk){
1297  TProfile* estimatorAvg = GetEstimatorHistogram(aodEvent);
1298  countCorr=static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,countTr,vtx1->GetZ(),fRefMult));
1299  }
1300  }
1301 
1302 
1304  fCounter->StoreEvent(aodEvent,fAnalCuts,fUseMCInfo,countCorr);
1305  }else{
1307  }
1309 
1310  //------------------------------------------------
1311  // MC analysis setting
1312  //------------------------------------------------
1313  TClonesArray *mcArray = 0;
1314  AliAODMCHeader *mcHeader=0;
1315  if (fUseMCInfo) {
1316  // MC array need for maching
1317  mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
1318  if (!mcArray) {
1319  AliError("Could not find Monte-Carlo in AOD");
1320  return;
1321  }
1322  fCEvents->Fill(6); // in case of MC events
1323 
1324  // load MC header
1325  mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1326  if (!mcHeader) {
1327  AliError("AliAnalysisTaskSELc2eleLambdafromAODtracks::UserExec: MC header branch not found!\n");
1328  return;
1329  }
1330  fCEvents->Fill(7); // in case of MC events
1331 
1332  Double_t zMCVertex = mcHeader->GetVtxZ();
1333  if (TMath::Abs(zMCVertex) > fAnalCuts->GetMaxVtxZ()) {
1334  AliDebug(2,Form("Event rejected: abs(zVtxMC)=%f > fAnalCuts->GetMaxVtxZ()=%f",zMCVertex,fAnalCuts->GetMaxVtxZ()));
1335  return;
1336  } else {
1337  fCEvents->Fill(17); // in case of MC events
1338  }
1339  if ((TMath::Abs(zMCVertex) < fAnalCuts->GetMaxVtxZ()) && (!fAnalCuts->IsEventRejectedDuePhysicsSelection()) && (!fAnalCuts->IsEventRejectedDueToTrigger())) {
1340  Bool_t selevt = MakeMCAnalysis(mcArray);
1341  if(!selevt) return;
1342  }
1343  }
1344 
1345  //------------------------------------------------
1346  // Event selection
1347  //------------------------------------------------
1348  fVtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
1349  if (!fVtx1) return;
1350 
1351  Double_t pos[3],cov[6];
1352  fVtx1->GetXYZ(pos);
1353  fVtx1->GetCovarianceMatrix(cov);
1354  fV1 = new AliESDVertex(pos,cov,100.,100,fVtx1->GetName());
1355  fVtxZ = pos[2];
1356 
1357  Bool_t fIsTriggerNotOK = fAnalCuts->IsEventRejectedDueToTrigger();
1358  if(!fIsTriggerNotOK) fCEvents->Fill(3);
1359  if(!fIsEventSelected) {
1360  delete fV1;
1361  return;
1362  }
1363  fCEvents->Fill(4);
1364 
1365  fHNTrackletvsZ->Fill(fVtxZ,countTr);
1366  fHNTrackletCorrvsZ->Fill(fVtxZ,countCorr);
1367 
1368  fIsMB=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kMB)==(AliVEvent::kMB);
1369  fIsSemi=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kSemiCentral)==(AliVEvent::kSemiCentral);
1370  fIsCent=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kCentral)==(AliVEvent::kCentral);
1371  fIsINT7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kINT7)==(AliVEvent::kINT7);
1372  fIsEMC7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kEMC7)==(AliVEvent::kEMC7);
1374  if(fIsMB) fHTrigger->Fill(1);
1375  if(fIsSemi) fHTrigger->Fill(2);
1376  if(fIsCent) fHTrigger->Fill(3);
1377  if(fIsINT7) fHTrigger->Fill(4);
1378  if(fIsEMC7) fHTrigger->Fill(5);
1379  if(fIsMB|fIsSemi|fIsCent) fHTrigger->Fill(7);
1380  if(fIsINT7|fIsEMC7) fHTrigger->Fill(8);
1381  if(fIsMB&fIsSemi) fHTrigger->Fill(10);
1382  if(fIsMB&fIsCent) fHTrigger->Fill(11);
1383  if(fIsINT7&fIsEMC7) fHTrigger->Fill(12);
1384 
1385  if(fUseCentralityV0M){
1386  AliCentrality *cent = aodEvent->GetCentrality();
1387  fCentrality = cent->GetCentralityPercentile("V0M");
1388  }else if(fUseCentralitySPDTracklet){
1389  if(countCorr>=0 && countCorr<=0) fCentrality = 5.;
1390  else if(countCorr>=1 && countCorr<=8) fCentrality = 15.;
1391  else if(countCorr>= 9 && countCorr<=13) fCentrality = 25.;
1392  else if(countCorr>=14 && countCorr<=19) fCentrality = 35.;
1393  else if(countCorr>=20 && countCorr<=30) fCentrality = 45.;
1394  else if(countCorr>=31 && countCorr<=49) fCentrality = 55.;
1395  else fCentrality = 65.;
1396  }else{
1397  fCentrality = 1.;
1398  }
1399  if(fCentrality<0.||fCentrality>100.-0.0000001) {
1400  delete fV1;
1401  return;
1402  }
1403  fHCentrality->Fill(fCentrality);
1404 
1405  if(fUseEventPlane){
1406  AliEventplane *pl=aodEvent->GetEventplane();
1407  if(!pl){
1408  AliError("AliAnalysisTaskSELc2eleLambdafromAODtracks::UserExec:no eventplane! v2 analysis without eventplane not possible!\n");
1409  fCEvents->Fill(18);
1410  return;
1411  }
1412  fEventPlane = pl->GetEventplane("V0",aodEvent,2);
1413  }
1414 
1415  fHEventPlane->Fill(fEventPlane);
1416  fRunNumber = aodEvent->GetRunNumber();
1417 
1418  Int_t runnumber_offset = 0;
1419  Int_t runnumber = aodEvent->GetRunNumber();
1420  if(runnumber<=131000&&runnumber>=114000){
1421  runnumber_offset = 114000;//lhc10bcde
1422  }else if(runnumber<=196000&&runnumber>=195000){
1423  runnumber_offset = 195000;//lhc13bc
1424  }else if(runnumber<=170593&&runnumber>=167902){
1425  runnumber_offset = 167902;//lhc11h
1426  }
1427  fHistonEvtvsRunNumber->Fill(runnumber-runnumber_offset,1.);
1428 
1429  //------------------------------------------------
1430  // Check if the event has v0 candidate
1431  //------------------------------------------------
1432  //Int_t nv0 = aodEvent->GetNumberOfV0s();
1433  fCEvents->Fill(5);
1434 
1435 
1436  //------------------------------------------------
1437  // Main analysis done in this function
1438  //------------------------------------------------
1441  MakeAnalysis(aodEvent,mcArray);
1442 
1443 
1444  PostData(1,fOutput);
1445  PostData(3,fOutputAll);
1446  PostData(4,fVariablesTree);
1447  PostData(5,fEleVariablesTree);
1448  PostData(6,fV0VariablesTree);
1449  PostData(7,fMCVariablesTree);
1450  PostData(8,fCounter);
1451  PostData(9,fMCEleVariablesTree);
1452  PostData(10,fMCV0VariablesTree);
1453  //PostData(11,fMCGenPairVariablesTree);
1454  PostData(11,fSingleVariablesTree);
1455  PostData(12,fCorrelationVariablesTree);
1456 
1457  fIsEventSelected=kFALSE;
1458 
1459  delete fV1;
1460  return;
1461 }
1462 
1463 //________________________________________ terminate ___________________________
1465 {
1469 
1470  //AliInfo("Terminate","");
1471  AliAnalysisTaskSE::Terminate();
1472 
1473 
1474  fOutput = dynamic_cast<TList*> (GetOutputData(1));
1475  if (!fOutput) {
1476  AliError("fOutput not available");
1477  return;
1478  }
1479 
1480  fOutputAll = dynamic_cast<TList*> (GetOutputData(3));
1481  if (!fOutputAll) {
1482  AliError("fOutputAll not available");
1483  return;
1484  }
1485 
1486  return;
1487 }
1488 
1489 //___________________________________________________________________________
1491 {
1495  //AliInfo(Form("CreateOutputObjects of task %s\n", GetName()));
1496 
1497  //------------------------------------------------
1498  // output object setting
1499  //------------------------------------------------
1500  fOutput = new TList();
1501  fOutput->SetOwner();
1502  fOutput->SetName("chist0");
1503  DefineGeneralHistograms(); // define general histograms
1504  PostData(1,fOutput);
1505 
1506  fOutputAll = new TList();
1507  fOutputAll->SetOwner();
1508  fOutputAll->SetName("anahisto");
1509  DefineAnalysisHistograms(); // define general histograms
1510  PostData(3,fOutputAll);
1511 
1513  PostData(4,fVariablesTree);
1514 
1516  PostData(5,fEleVariablesTree);
1517 
1519  PostData(6,fV0VariablesTree);
1520 
1522  PostData(7,fMCVariablesTree);
1523 
1525  PostData(9,fMCEleVariablesTree);
1526 
1528  PostData(10,fMCV0VariablesTree);
1529 
1530  //DefineMCGenPairTreeVariables();
1531  //PostData(11,fMCGenPairVariablesTree);
1533  PostData(11,fSingleVariablesTree);
1534 
1536  PostData(12,fCorrelationVariablesTree);
1537 
1538  //Counter for Normalization
1539  TString normName="NormalizationCounter";
1540  AliAnalysisDataContainer *cont = GetOutputSlot(8)->GetContainer();
1541  if(cont)normName=(TString)cont->GetName();
1542  fCounter = new AliNormalizationCounter(normName.Data());
1544  fCounter->SetStudyMultiplicity(kTRUE,1.);
1545  }
1546  fCounter->Init();
1547  PostData(8,fCounter);
1548 
1549  if(fDoEventMixing){
1551  m_ReservoirE.resize(fNOfPools,std::vector<std::vector<TLorentzVector *> > (fNumberOfEventsForMixing));
1552  m_ReservoirL1.resize(fNOfPools,std::vector<std::vector<TLorentzVector *> > (fNumberOfEventsForMixing));
1553  m_ReservoirL2.resize(fNOfPools,std::vector<std::vector<TLorentzVector *> > (fNumberOfEventsForMixing));
1554  m_ReservoirVarsE.resize(fNOfPools,std::vector<std::vector<TVector *> > (fNumberOfEventsForMixing));
1555  m_ReservoirVarsL1.resize(fNOfPools,std::vector<std::vector<TVector *> > (fNumberOfEventsForMixing));
1556  m_ReservoirVarsL2.resize(fNOfPools,std::vector<std::vector<TVector *> > (fNumberOfEventsForMixing));
1557  nextResVec.resize(fNOfPools,0);
1558  reservoirsReady.resize(fNOfPools,kFALSE);
1559 
1560  for(Int_t s=0; s<fNOfPools; s++) {
1561  for(Int_t k=0;k<fNumberOfEventsForMixing;k++){
1562  m_ReservoirE[s][k].clear();
1563  m_ReservoirL1[s][k].clear();
1564  m_ReservoirL2[s][k].clear();
1565  m_ReservoirVarsE[s][k].clear();
1566  m_ReservoirVarsL1[s][k].clear();
1567  m_ReservoirVarsL2[s][k].clear();
1568  }
1569  }
1570  }
1571 
1572  fGTI = new AliAODTrack *[fTrackBuffSize]; // Array of pointers
1573  fGTIndex = new Int_t [fTrackBuffSize]; // Array of index
1574 
1575  return;
1576 }
1577 
1578 //-------------------------------------------------------------------------------
1581  AliAODEvent *aodEvent, TClonesArray *mcArray
1582  )
1583 {
1584  //
1586  //
1587  if(fDoEventMixing){
1588  fPoolIndex=GetPoolIndex(fVtxZ,fCentrality);
1589  Int_t nextRes( nextResVec[fPoolIndex] );
1590  while(!m_ReservoirE[fPoolIndex][nextRes].empty()){
1591  delete m_ReservoirE[fPoolIndex][nextRes].back();
1592  m_ReservoirE[fPoolIndex][nextRes].pop_back();
1593  }
1594  while(!m_ReservoirL1[fPoolIndex][nextRes].empty()){
1595  delete m_ReservoirL1[fPoolIndex][nextRes].back();
1596  m_ReservoirL1[fPoolIndex][nextRes].pop_back();
1597  }
1598  while(!m_ReservoirL2[fPoolIndex][nextRes].empty()){
1599  delete m_ReservoirL2[fPoolIndex][nextRes].back();
1600  m_ReservoirL2[fPoolIndex][nextRes].pop_back();
1601  }
1602  while(!m_ReservoirVarsE[fPoolIndex][nextRes].empty()){
1603  delete m_ReservoirVarsE[fPoolIndex][nextRes].back();
1604  m_ReservoirVarsE[fPoolIndex][nextRes].pop_back();
1605  }
1606  while(!m_ReservoirVarsL1[fPoolIndex][nextRes].empty()){
1607  delete m_ReservoirVarsL1[fPoolIndex][nextRes].back();
1608  m_ReservoirVarsL1[fPoolIndex][nextRes].pop_back();
1609  }
1610  while(!m_ReservoirVarsL2[fPoolIndex][nextRes].empty()){
1611  delete m_ReservoirVarsL2[fPoolIndex][nextRes].back();
1612  m_ReservoirVarsL2[fPoolIndex][nextRes].pop_back();
1613  }
1614  }
1615 
1616 
1617  ResetGlobalTrackReference();
1618  // ..and set it
1619  for (Int_t iTrack=0;iTrack<aodEvent->GetNumberOfTracks();iTrack++){
1620  // cast needed since the event now returns AliVTrack instead of AliAODTrack
1621  AliAODTrack *track = dynamic_cast<AliAODTrack *>(aodEvent->GetTrack(iTrack));
1622  if (!track) continue;
1623 
1624  // Store the reference of the global tracks
1625  StoreGlobalTrackReference(track,iTrack);
1626  }
1627 
1628  //------------------------------------------------
1629  // Select good track before hand to save time
1630  //------------------------------------------------
1631 
1632  Int_t nV0s= aodEvent->GetNumberOfV0s();
1633  Int_t nTracks= aodEvent->GetNumberOfTracks();
1634 
1635  Bool_t seleTrkFlags[nTracks];
1636  Int_t nSeleTrks=0;
1637  SelectTrack(aodEvent,nTracks,nSeleTrks,seleTrkFlags,mcArray);
1638 
1639  Bool_t seleV0Flags[nV0s];
1640  Int_t nSeleV0=0;
1641  SelectV0(aodEvent,nV0s,nSeleV0,seleV0Flags,mcArray);
1642 
1643  Int_t runnumber_offset = 0;
1644  Int_t runnumber = aodEvent->GetRunNumber();
1645  if(runnumber<=131000&&runnumber>=114000){
1646  runnumber_offset = 114000;//lhc10bcde
1647  }else if(runnumber<=196000&&runnumber>=195000){
1648  runnumber_offset = 195000;//lhc13bc
1649  }else if(runnumber<=170593&&runnumber>=167902){
1650  runnumber_offset = 167902;//lhc11h
1651  }
1652  fHistonElevsRunNumber->Fill(runnumber-runnumber_offset,nSeleTrks);
1653  fHistonLambdavsRunNumber->Fill(runnumber-runnumber_offset,nSeleV0);
1654 
1655  if(fWriteEachVariableTree)
1656  return;
1657 
1658  //------------------------------------------------
1659  // V0 loop
1660  //------------------------------------------------
1661  for (Int_t iv0 = 0; iv0<nV0s; iv0++) {
1662  if(!seleV0Flags[iv0]) continue;
1663  AliAODv0 *v0 = aodEvent->GetV0(iv0);
1664  if(!v0) continue;
1665 
1666  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
1667  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
1668 
1669  //------------------------------------------------
1670  // track loop
1671  //------------------------------------------------
1672  for (Int_t itrk = 0; itrk<nTracks; itrk++) {
1673  if(!seleTrkFlags[itrk]) continue;
1674  AliAODTrack *trk = (AliAODTrack*)aodEvent->GetTrack(itrk);
1675  //if(trk->GetID()<0) continue;
1676 
1677  //if(!fAnalCuts->SelectWithRoughCuts(v0,trk)) continue;
1678 
1679  //TPC only track (BIT 7) does not have PID information
1680  //In addition to that, TPC only tracks does not have good DCA resolution
1681  //(according to femtoscopy code)
1682  AliAODTrack *trkpid = 0;
1683  if(fAnalCuts->GetProdAODFilterBit()==7){
1684  trkpid = fGTI[-trk->GetID()-1];
1685  }else{
1686  trkpid = trk;
1687  }
1688 
1689  Int_t cpid = cptrack->GetID();
1690  Int_t cnid = cntrack->GetID();
1691  Int_t lpid = trkpid->GetID();
1692  if((cpid==lpid)||(cnid==lpid)) continue;
1693 
1694  AliAODVertex *secVert = ReconstructSecondaryVertex(v0,trk,aodEvent);//Fake, prim vertex is just used as secondary vertex. place holder for future
1695  if(!secVert) continue;
1696 
1697  AliAODRecoCascadeHF *elobj = MakeCascadeHF(v0,trk,trkpid,aodEvent,secVert);
1698  if(!elobj) {
1699  continue;
1700  }
1701 
1702  FillROOTObjects(elobj,v0,trk,trkpid,aodEvent,mcArray);
1703 
1704  elobj->GetSecondaryVtx()->RemoveDaughters();
1705  elobj->UnsetOwnPrimaryVtx();
1706  delete elobj;elobj=NULL;
1707  delete secVert;
1708  }
1709  }
1710 
1711  if(fDoEventMixing){
1712  DoEventMixingWithPools(fPoolIndex);
1713 
1714  Int_t nextRes( nextResVec[fPoolIndex] );
1715  nextRes++;
1716  if( nextRes>=fNumberOfEventsForMixing ){
1717  nextRes = 0;
1718  reservoirsReady[fPoolIndex] = kTRUE;
1719  }
1720  nextResVec[fPoolIndex] = nextRes;
1721  }
1722 }
1725 {
1729 
1730  const char* nameoutput = GetOutputSlot(4)->GetContainer()->GetName();
1731  fVariablesTree = new TTree(nameoutput,"Candidates variables tree");
1732  Int_t nVar = 94;
1733  fCandidateVariables = new Float_t [nVar];
1734  TString * fCandidateVariableNames = new TString[nVar];
1735 
1736  fCandidateVariableNames[ 0]="Centrality";
1737  fCandidateVariableNames[ 1]="InvMassEleLambda";
1738  fCandidateVariableNames[ 2]="EleLambdaPt";
1739  fCandidateVariableNames[ 3]="EleLambdaPx";
1740  fCandidateVariableNames[ 4]="EleLambdaPy";
1741  fCandidateVariableNames[ 5]="EleLambdaPz";
1742  fCandidateVariableNames[ 6]="ElePx";
1743  fCandidateVariableNames[ 7]="ElePy";
1744  fCandidateVariableNames[ 8]="ElePz";
1745  fCandidateVariableNames[ 9]="V0Px";
1746  fCandidateVariableNames[10]="V0Py";
1747  fCandidateVariableNames[11]="V0Pz";
1748  fCandidateVariableNames[12]="AntiLambdaFlag";
1749  fCandidateVariableNames[13]="MassLambda";
1750  fCandidateVariableNames[14]="MassAntiLambda";
1751  fCandidateVariableNames[15]="Eled0";
1752  fCandidateVariableNames[16]="V0d0";
1753  fCandidateVariableNames[17]="nSigmaTPCele";
1754  fCandidateVariableNames[18]="nSigmaTOFele";
1755  fCandidateVariableNames[19]="nSigmaTPCv0pr";
1756  fCandidateVariableNames[20]="nSigmaTOFv0pr";
1757  fCandidateVariableNames[21]="EleCharge";
1758  fCandidateVariableNames[22]="ProtonPx";
1759  fCandidateVariableNames[23]="ProtonPy";
1760  fCandidateVariableNames[24]="ProtonPz";
1761  fCandidateVariableNames[25]="PiPx";
1762  fCandidateVariableNames[26]="PiPy";
1763  fCandidateVariableNames[27]="PiPz";
1764  fCandidateVariableNames[28]="mcpdglc";
1765  fCandidateVariableNames[29]="mclablc";
1766  fCandidateVariableNames[30]="mcpdgmomele";
1767  fCandidateVariableNames[31]="mcpdgmomv0";
1768  fCandidateVariableNames[32]="Mixing";
1769  fCandidateVariableNames[33]="mcpdgele";
1770  fCandidateVariableNames[34]="nSigmaTPCpr_etrk";
1771  fCandidateVariableNames[35]="nSigmaTOFpr_etrk";
1772  fCandidateVariableNames[36]="nSigmaTPCka_etrk";
1773  fCandidateVariableNames[37]="nSigmaTOFka_etrk";
1774  fCandidateVariableNames[38]="MassK0Short";
1775  fCandidateVariableNames[39]="mcpdggrmomele";
1776  fCandidateVariableNames[40]="mcpdggrmomv0";
1777  fCandidateVariableNames[41]="mcngenele";
1778  fCandidateVariableNames[42]="mcngenv0";
1779  fCandidateVariableNames[43]="mclcpx";
1780  fCandidateVariableNames[44]="mclcpy";
1781  fCandidateVariableNames[45]="mclcpz";
1782  fCandidateVariableNames[46]="mcelepx";
1783  fCandidateVariableNames[47]="mcelepy";
1784  fCandidateVariableNames[48]="mcelepz";
1785  fCandidateVariableNames[49]="mcv0px";
1786  fCandidateVariableNames[50]="mcv0py";
1787  fCandidateVariableNames[51]="mcv0pz";
1788  fCandidateVariableNames[52]="nSigmaTPCpi_etrk";
1789  fCandidateVariableNames[53]="nSigmaTOFpi_etrk";
1790  fCandidateVariableNames[54]="PrimVertx";
1791  fCandidateVariableNames[55]="PrimVerty";
1792  fCandidateVariableNames[56]="PrimVertz";
1793  fCandidateVariableNames[57]="V0Vertx";
1794  fCandidateVariableNames[58]="V0Verty";
1795  fCandidateVariableNames[59]="V0Vertz";
1796 
1797  fCandidateVariableNames[60]="DcaV0PrToPrimVertex";
1798  fCandidateVariableNames[61]="DcaV0PiToPrimVertex";
1799  fCandidateVariableNames[62]="DcaV0daughters";
1800  fCandidateVariableNames[63]="V0CosPointingAngle";
1801  fCandidateVariableNames[64]="V0ProperDecayLength";
1802  fCandidateVariableNames[65]="MassK0Short2";
1803 
1804  fCandidateVariableNames[66]="nSigmaTPCv0pi";
1805  fCandidateVariableNames[67]="nSigmaTOFv0pi";
1806 
1807  fCandidateVariableNames[68]= "EleITSMatch";
1808  fCandidateVariableNames[69]= "V0PosITSMatch";
1809  fCandidateVariableNames[70]= "V0NegITSMatch";
1810  fCandidateVariableNames[71]= "IsV0PeakRegion";
1811  fCandidateVariableNames[72]= "mcpdgv0";
1812 
1813  fCandidateVariableNames[73]= "mcv0pospx";
1814  fCandidateVariableNames[74]= "mcv0pospy";
1815  fCandidateVariableNames[75]= "mcv0pospz";
1816  fCandidateVariableNames[76]= "mcpdgv0pos";
1817  fCandidateVariableNames[77]= "mcv0negpx";
1818  fCandidateVariableNames[78]= "mcv0negpy";
1819  fCandidateVariableNames[79]= "mcv0negpz";
1820  fCandidateVariableNames[80]= "mcpdgv0neg";
1821 
1822  fCandidateVariableNames[81]= "ProtonPxPV";
1823  fCandidateVariableNames[82]= "ProtonPyPV";
1824  fCandidateVariableNames[83]= "ProtonPzPV";
1825  fCandidateVariableNames[84]= "PiPxPV";
1826  fCandidateVariableNames[85]= "PiPyPV";
1827  fCandidateVariableNames[86]= "PiPzPV";
1828 
1829  fCandidateVariableNames[87]= "mcv0vertx";
1830  fCandidateVariableNames[88]= "mcv0verty";
1831  fCandidateVariableNames[89]= "mcv0vertz";
1832 
1833  fCandidateVariableNames[90]="OnFlyStatus";
1834  fCandidateVariableNames[91]="MagneticField";
1835  fCandidateVariableNames[92]="EvNumber";
1836  fCandidateVariableNames[93]="RunNumber";
1837 
1838 
1839  for (Int_t ivar=0; ivar<nVar; ivar++) {
1840  fVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1841  }
1842 
1843  return;
1844 }
1845 
1847 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillROOTObjects(AliAODRecoCascadeHF *elobj, AliAODv0 *v0, AliAODTrack *trk, AliAODTrack *trkpid, AliAODEvent *event, TClonesArray *mcArray)
1848 {
1852  if(!trk) return;
1853  if(!trkpid) return;
1854  if(!v0) return;
1855 
1856  for(Int_t i=0;i<94;i++)
1857  {
1858  fCandidateVariables[i] = -9999.;
1859  }
1860 
1861  Bool_t anti_lambda_flag = kFALSE;
1862  if(fabs(v0->MassAntiLambda()-1.115683)<fAnalCuts->GetProdV0MassTolLambdaRough()) anti_lambda_flag = kTRUE;
1863 
1864  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
1865  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
1866 // if(cptrack->Charge()<0 && cntrack->Charge()>0){
1867 // cptrack = (AliAODTrack*)(v0->GetDaughter(1));
1868 // cntrack = (AliAODTrack*)(v0->GetDaughter(0));
1869 // }
1870 
1871  Double_t v0px = elobj->PxProng(1);
1872  Double_t v0py = elobj->PyProng(1);
1873  Double_t v0pz = elobj->PzProng(1);
1874  Double_t momv0 = sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz);
1875  Double_t Ev0 = sqrt(momv0*momv0+1.115683*1.115683);
1876  Double_t epx = elobj->PxProng(0);
1877  Double_t epy = elobj->PyProng(0);
1878  Double_t epz = elobj->PzProng(0);
1879  Double_t mome = sqrt(epx*epx+epy*epy+epz*epz);
1880  Double_t Ee = sqrt(mome*mome+0.000510998928*0.000510998928);
1881  Double_t cosoa = (v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz);
1882  Double_t Esum = Ee + Ev0;
1883 
1884  Double_t uxe = epx/mome;
1885  Double_t uye = epy/mome;
1886  Double_t uze = epz/mome;
1887  Double_t lf = -2.*(v0px*uxe+v0py*uye+v0pz*uze);
1888  Double_t pxv_flip = v0px + lf * uxe;
1889  Double_t pyv_flip = v0py + lf * uye;
1890  Double_t pzv_flip = v0pz + lf * uze;
1891  Double_t pxsum_flip = epx + pxv_flip;
1892  Double_t pysum_flip = epy + pyv_flip;
1893  Double_t pzsum_flip = epz + pzv_flip;
1894  Double_t melam_flip = sqrt(Esum*Esum-pxsum_flip*pxsum_flip-pysum_flip*pysum_flip-pzsum_flip*pzsum_flip);
1895  Double_t ptelam_flip = sqrt(pxsum_flip*pxsum_flip+pysum_flip*pysum_flip);
1896 
1897  Double_t minmass_ee = 9999.;
1898  Bool_t isconv = fAnalCuts->TagConversions(trk,fGTIndex,(AliAODEvent*)event,event->GetNumberOfTracks(),minmass_ee);
1899  Double_t minmasslike_ee = 9999.;
1900  Bool_t isconv_like = fAnalCuts->TagConversionsSameSign(trk,fGTIndex,(AliAODEvent*)event,event->GetNumberOfTracks(),minmasslike_ee);
1901 
1903  UInt_t pdgdg[2]={11,3122};
1904  fCandidateVariables[ 1] = elobj->InvMass(2,pdgdg);
1905  fCandidateVariables[ 2] = elobj->Pt();
1906  fCandidateVariables[ 3] = elobj->Px();
1907  fCandidateVariables[ 4] = elobj->Py();
1908  fCandidateVariables[ 5] = elobj->Pz();
1909  fCandidateVariables[ 6] = elobj->PxProng(0);
1910  fCandidateVariables[ 7] = elobj->PyProng(0);
1911  fCandidateVariables[ 8] = elobj->PzProng(0);
1912  fCandidateVariables[ 9] = elobj->PxProng(1);
1913  fCandidateVariables[10] = elobj->PyProng(1);
1914  fCandidateVariables[11] = elobj->PzProng(1);
1915  fCandidateVariables[12] = anti_lambda_flag;
1916  fCandidateVariables[13] = v0->MassLambda();
1917  fCandidateVariables[14] = v0->MassAntiLambda();
1918  fCandidateVariables[15] = elobj->Getd0Prong(0);
1919  fCandidateVariables[16] = elobj->Getd0Prong(1);
1920 
1921  Double_t nSigmaTPCele=-9999.;
1922  Double_t nSigmaTOFele=-9999.;
1923  Double_t nSigmaTPCv0pr=-9999.;
1924  Double_t nSigmaTOFv0pr=-9999.;
1925  Double_t nSigmaTPCv0pi=-9999.;
1926  Double_t nSigmaTOFv0pi=-9999.;
1927  if(fAnalCuts->GetIsUsePID())
1928  {
1929  nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kElectron);
1930  nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kElectron);
1931  fCandidateVariables[17] = nSigmaTPCele;
1932  fCandidateVariables[18] = nSigmaTOFele;
1933  }
1934 
1935  if(fAnalCuts->GetUseLambdaPID())
1936  {
1937  if(anti_lambda_flag){
1938  nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
1939  nSigmaTOFv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kProton);
1940  nSigmaTPCv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
1941  nSigmaTOFv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kPion);
1942  }else{
1943  nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
1944  nSigmaTOFv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kProton);
1945  nSigmaTPCv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
1946  nSigmaTOFv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kPion);
1947  }
1948  fCandidateVariables[19] = nSigmaTPCv0pr;
1949  fCandidateVariables[20] = nSigmaTOFv0pr;
1950  fCandidateVariables[66] = nSigmaTPCv0pi;
1951  fCandidateVariables[67] = nSigmaTOFv0pi;
1952  }
1953  fCandidateVariables[21] = trk->Charge();
1954 
1955  if(anti_lambda_flag){
1956  fCandidateVariables[22] = v0->MomNegX(); //cntrack->Px();
1957  fCandidateVariables[23] = v0->MomNegY(); //cntrack->Py();
1958  fCandidateVariables[24] = v0->MomNegZ(); //cntrack->Pz();
1959  fCandidateVariables[25] = v0->MomPosX(); //cptrack->Px();
1960  fCandidateVariables[26] = v0->MomPosY(); //cptrack->Py();
1961  fCandidateVariables[27] = v0->MomPosZ(); //cptrack->Pz();
1962  }else{
1963  fCandidateVariables[22] = v0->MomPosX(); //cptrack->Px();
1964  fCandidateVariables[23] = v0->MomPosY(); //cptrack->Py();
1965  fCandidateVariables[24] = v0->MomPosZ(); //cptrack->Pz();
1966  fCandidateVariables[25] = v0->MomNegX(); //cntrack->Px();
1967  fCandidateVariables[26] = v0->MomNegY(); //cntrack->Py();
1968  fCandidateVariables[27] = v0->MomNegZ(); //cntrack->Pz();
1969  }
1970 
1971  AliAODMCParticle *mclc = 0;
1972  AliAODMCParticle *mcele = 0;
1973  AliAODMCParticle *mcv0 = 0;
1974  Int_t mclablc = 0;
1975  Int_t mcpdgele_array[100];
1976  Int_t mcpdgv0_array[100];
1977  Int_t mclabelele_array[100];
1978  Int_t mclabelv0_array[100];
1979  Int_t mcngen_ele=-9999;
1980  Int_t mcngen_v0=-9999;
1981 
1982  if(fUseMCInfo && mcArray){
1983  mclablc = MatchToMC(elobj,mcArray,mcpdgele_array, mcpdgv0_array,mclabelele_array,mclabelv0_array,mcngen_ele,mcngen_v0);
1984  if(mclabelele_array[0]>=0){
1985  mcele = (AliAODMCParticle*) mcArray->At(mclabelele_array[0]);
1986  if(mcele){
1987  fCandidateVariables[46] = mcele->Px();
1988  fCandidateVariables[47] = mcele->Py();
1989  fCandidateVariables[48] = mcele->Pz();
1990  }
1991  }
1992  if(mclabelv0_array[0]>=0){
1993  mcv0 = (AliAODMCParticle*) mcArray->At(mclabelv0_array[0]);
1994  if(mcv0){
1995  fCandidateVariables[49] = mcv0->Px();
1996  fCandidateVariables[50] = mcv0->Py();
1997  fCandidateVariables[51] = mcv0->Pz();
1998  fCandidateVariables[72] = mcv0->GetPdgCode();
1999  }
2000  }else{
2001  Int_t pdgdgv0[2]={211,211};
2002  Int_t labV0 = v0->MatchToMC(310,mcArray,2,pdgdgv0); // the V0
2003  if(labV0>=0){
2004  mcv0 = (AliAODMCParticle*) mcArray->At(labV0);
2005  if(mcv0){
2006  fCandidateVariables[49] = mcv0->Px();
2007  fCandidateVariables[50] = mcv0->Py();
2008  fCandidateVariables[51] = mcv0->Pz();
2009  fCandidateVariables[72] = mcv0->GetPdgCode();
2010  }
2011  }
2012  }
2013 
2014  Int_t labPos = cptrack->GetLabel();
2015  if(labPos>=0){
2016  AliAODMCParticle *mcv0pos = (AliAODMCParticle*)mcArray->At(labPos);
2017  fCandidateVariables[73] = mcv0pos->Px();
2018  fCandidateVariables[74] = mcv0pos->Py();
2019  fCandidateVariables[75] = mcv0pos->Pz();
2020  fCandidateVariables[76] = mcv0pos->GetPdgCode();
2021  fCandidateVariables[87] = mcv0pos->Xv();
2022  fCandidateVariables[88] = mcv0pos->Yv();
2023  fCandidateVariables[89] = mcv0pos->Zv();
2024  }
2025  Int_t labNeg = cntrack->GetLabel();
2026  if(labNeg>=0){
2027  AliAODMCParticle *mcv0neg = (AliAODMCParticle*)mcArray->At(labNeg);
2028  fCandidateVariables[77] = mcv0neg->Px();
2029  fCandidateVariables[78] = mcv0neg->Py();
2030  fCandidateVariables[79] = mcv0neg->Pz();
2031  fCandidateVariables[80] = mcv0neg->GetPdgCode();
2032  }
2033 
2034  if(mclablc>-1){
2035  mclc = (AliAODMCParticle*) mcArray->At(mclablc);
2036  if(mclc){
2037  fCandidateVariables[28] = mclc->GetPdgCode();
2038  fCandidateVariables[29] = mclc->Label();
2039  fCandidateVariables[43] = mclc->Px();
2040  fCandidateVariables[44] = mclc->Py();
2041  fCandidateVariables[45] = mclc->Pz();
2042  }
2043  }
2044  fCandidateVariables[30] = mcpdgele_array[1];
2045  fCandidateVariables[31] = mcpdgv0_array[1];
2046  fCandidateVariables[33] = mcpdgele_array[0];
2047  fCandidateVariables[39] = mcpdgele_array[2];
2048  fCandidateVariables[40] = mcpdgv0_array[2];
2049  fCandidateVariables[41] = mcngen_ele;
2050  fCandidateVariables[42] = mcngen_v0;
2051  }
2052  fCandidateVariables[32] = 0;
2053 
2054  if(fAnalCuts->GetIsUsePID())
2055  {
2056  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kProton);
2057  Double_t nSigmaTOFpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kProton);
2058  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kKaon);
2059  Double_t nSigmaTOFka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kKaon);
2060  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kPion);
2061  Double_t nSigmaTOFpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kPion);
2062  fCandidateVariables[34] = nSigmaTPCpr_etrk;
2063  fCandidateVariables[35] = nSigmaTOFpr_etrk;
2064  fCandidateVariables[36] = nSigmaTPCka_etrk;
2065  fCandidateVariables[37] = nSigmaTOFka_etrk;
2066  fCandidateVariables[52] = nSigmaTPCpi_etrk;
2067  fCandidateVariables[53] = nSigmaTOFpi_etrk;
2068  }
2069  fCandidateVariables[38] = v0->MassK0Short();
2070 
2071  fCandidateVariables[54] = fVtx1->GetX();
2072  fCandidateVariables[55] = fVtx1->GetY();
2073  fCandidateVariables[56] = fVtx1->GetZ();
2074  fCandidateVariables[57] = v0->DecayVertexV0X();
2075  fCandidateVariables[58] = v0->DecayVertexV0Y();
2076  fCandidateVariables[59] = v0->DecayVertexV0Z();
2077 
2078  Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
2079  Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
2080  if(!anti_lambda_flag){
2081  fCandidateVariables[60] = lDcaPosToPrimVertex;
2082  fCandidateVariables[61] = lDcaNegToPrimVertex;
2083  }else{
2084  fCandidateVariables[60] = lDcaNegToPrimVertex;
2085  fCandidateVariables[61] = lDcaPosToPrimVertex;
2086  }
2087  fCandidateVariables[62] = v0->DcaV0Daughters();
2088  Double_t posVtx[3] = {0.,0.,0.};
2089  fVtx1->GetXYZ(posVtx);
2090  fCandidateVariables[63] = v0->CosPointingAngle(posVtx);
2091  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
2092  fCandidateVariables[64] = v0->DecayLengthV0(posVtx)*1.1157/ptotlam;
2093  fCandidateVariables[65] = v0->MassK0Short();
2094 
2095  if(trk) fCandidateVariables[68] = trk->GetITSClusterMap();
2096  if(cptrack) fCandidateVariables[69] = cptrack->GetITSClusterMap();
2097  if(cntrack) fCandidateVariables[70] = cntrack->GetITSClusterMap();
2098 
2100 
2101  if(!anti_lambda_flag){
2102  fCandidateVariables[81] = cptrack->Px();
2103  fCandidateVariables[82] = cptrack->Py();
2104  fCandidateVariables[83] = cptrack->Pz();
2105  fCandidateVariables[84] = cntrack->Px();
2106  fCandidateVariables[85] = cntrack->Py();
2107  fCandidateVariables[86] = cntrack->Pz();
2108  }else{
2109  fCandidateVariables[81] = cntrack->Px();
2110  fCandidateVariables[82] = cntrack->Py();
2111  fCandidateVariables[83] = cntrack->Pz();
2112  fCandidateVariables[84] = cptrack->Px();
2113  fCandidateVariables[85] = cptrack->Py();
2114  fCandidateVariables[86] = cptrack->Pz();
2115  }
2116  fCandidateVariables[90] = v0->GetOnFlyStatus();
2117 
2118  fCandidateVariables[91] = fBzkG;
2121 
2122 
2123 // if(fWriteVariableTree)
2124 // fVariablesTree->Fill();
2125 
2126  Double_t dphis_ele_pr, detas_ele_pr,dphis_ele_pi, detas_ele_pi;
2127  dphis_ele_pr = 9999.;detas_ele_pr = 9999.;dphis_ele_pi = 9999.;detas_ele_pi = 9999.;
2128  //fAnalCuts->GetdPhiSdEtaSR125(trk,cptrack,cntrack,fBzkG,posVtx, dphis_ele_pr,detas_ele_pr,dphis_ele_pi,detas_ele_pi);
2129 
2130  Double_t cont[3];
2131  cont[0] = elobj->InvMass(2,pdgdg);
2132  cont[1] = elobj->Pt();
2133  cont[2] = fCentrality;
2134  fHistoEleLambdaMass->Fill(cont);
2135 
2136  Double_t cont_flip[3];
2137  cont_flip[0] = melam_flip;
2138  cont_flip[1] = ptelam_flip;
2139  cont_flip[2] = fCentrality;
2140 
2141  Double_t cont2[3];
2142  cont2[0] = elobj->InvMass(2,pdgdg);
2143  cont2[1] = trk->Pt();
2144  cont2[2] = fCentrality;
2145  Double_t cont_eleptvseta[3];
2146  cont_eleptvseta[0] = trk->Pt();
2147  cont_eleptvseta[1] = trk->Eta();
2148  cont_eleptvseta[2] = fCentrality;
2149 
2150  Double_t cont_eleptvslambdapt[3];
2151  cont_eleptvslambdapt[0] = trk->Pt();
2152  cont_eleptvslambdapt[1] = v0->Pt();
2153  cont_eleptvslambdapt[2] = fCentrality;
2154 
2155  Double_t cont_eleptvsd0[3];
2156  cont_eleptvsd0[0] = trk->Pt();
2157  cont_eleptvsd0[1] = elobj->Getd0Prong(0)*trk->Charge();
2158  cont_eleptvsd0[2] = fCentrality;
2159 
2160  Double_t cont_eleptvsv0dl[3];
2161  cont_eleptvsv0dl[0] = trk->Pt();
2162  cont_eleptvsv0dl[1] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;
2163  cont_eleptvsv0dl[2] = fCentrality;
2164 
2165  Double_t cont_elelamptvsv0dl[4];
2166  cont_elelamptvsv0dl[0] = elobj->Pt();
2167  cont_elelamptvsv0dl[1] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;
2168  cont_elelamptvsv0dl[2] = elobj->Getd0Prong(0)*trk->Charge();
2169  cont_elelamptvsv0dl[3] = fCentrality;
2170 
2171  Double_t cont_elelamptvsv0dl_flip[4];
2172  cont_elelamptvsv0dl_flip[0] = ptelam_flip;
2173  cont_elelamptvsv0dl_flip[1] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;
2174  cont_elelamptvsv0dl_flip[2] = 0.0;
2175  cont_elelamptvsv0dl_flip[3] = fCentrality;
2176 
2177 
2178  Double_t cont_eleptvsv0dca[3];
2179  cont_eleptvsv0dca[0] = trk->Pt();
2180  cont_eleptvsv0dca[1] = v0->DcaV0ToPrimVertex();
2181  cont_eleptvsv0dca[2] = fCentrality;
2182 
2183  Double_t elobj_mass = elobj->InvMass(2,pdgdg);
2184  Double_t elobj_px = elobj->Px();
2185  Double_t elobj_py = elobj->Py();
2186  Double_t elobj_pz = elobj->Pz();
2187  Double_t elobj_E = sqrt(elobj_mass*elobj_mass+elobj_px*elobj_px+elobj_py*elobj_py+elobj_pz*elobj_pz);
2188  Double_t elobj_rap = 0.5*log((elobj_E+elobj_pz)/(elobj_E-elobj_pz));
2189 
2190  //
2191  // Old strategy only look at mass and pairpt
2192  //
2194  {
2195  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
2196  fHistoEleLambdaMassRS->Fill(cont);
2197  if(trk->Charge()>0) fHistoEleLambdaMassRS1->Fill(cont);
2198  else fHistoEleLambdaMassRS2->Fill(cont);
2199 
2200  fHistoEleLambdaMassvsElePtRS->Fill(cont2);
2201  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtRS1->Fill(cont2);
2202  else fHistoEleLambdaMassvsElePtRS2->Fill(cont2);
2203  if(cont[0]<2.3){
2204  fHistoEleLambdaPtvsRapidityRS->Fill(elobj->Pt(),elobj_rap);
2205  fHistoElePtRS->Fill(trk->Pt(),fCentrality);
2206  fHistoElePtvsEtaRS->Fill(cont_eleptvseta);
2207  fHistoElePtvsLambdaPtRS->Fill(cont_eleptvslambdapt);
2208  fHistoElePtvsd0RS->Fill(cont_eleptvsd0);
2209 
2210  fHistoElePtvsV0dlRS->Fill(cont_eleptvsv0dl);
2211  if(trk->Charge()>0) fHistoElePtvsV0dlRS1->Fill(cont_eleptvsv0dl);
2212  else fHistoElePtvsV0dlRS2->Fill(cont_eleptvsv0dl);
2213 
2214  fHistoEleLambdaPtvsV0dlRS->Fill(cont_elelamptvsv0dl);
2215  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRS1->Fill(cont_elelamptvsv0dl);
2216  else fHistoEleLambdaPtvsV0dlRS2->Fill(cont_elelamptvsv0dl);
2217 
2218  fHistoElePtvsV0dcaRS->Fill(cont_eleptvsv0dca);
2219  if(trk->Charge()>0) fHistoElePtvsV0dcaRS1->Fill(cont_eleptvsv0dca);
2220  else fHistoElePtvsV0dcaRS2->Fill(cont_eleptvsv0dca);
2221 
2222  for(Int_t ih=0;ih<17;ih++){
2223  Double_t cont_eleptvscutvars[3];
2224  cont_eleptvscutvars[0] = elobj->Pt();
2225  cont_eleptvscutvars[2] = fCentrality;
2226 
2227  if(ih==0){
2228  cont_eleptvscutvars[1] = trk->GetTPCNcls();
2229  }else if(ih==1){
2230  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
2231  }else if(ih==2){
2232  cont_eleptvscutvars[1] = nSigmaTPCele;
2233  }else if(ih==3){
2234  cont_eleptvscutvars[1] = nSigmaTOFele;
2235  }else if(ih==4){
2236  cont_eleptvscutvars[1] = trk->Eta();
2237  }else if(ih==5){
2238  cont_eleptvscutvars[1] = trk->GetITSNcls();
2239  }else if(ih==6){
2240  if(!anti_lambda_flag)
2241  cont_eleptvscutvars[1] = v0->MassLambda();
2242  else
2243  cont_eleptvscutvars[1] = v0->MassAntiLambda();
2244  }else if(ih==7){
2245  Double_t lPosV0[3];
2246  lPosV0[0] = v0->DecayVertexV0X();
2247  lPosV0[1] = v0->DecayVertexV0Y();
2248  lPosV0[2] = v0->DecayVertexV0Z();
2249  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
2250  }else if(ih==8){
2251  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
2252  }else if(ih==9){
2253  if(!anti_lambda_flag)
2254  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2255  else
2256  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2257  }else if(ih==10){
2258  if(!anti_lambda_flag)
2259  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2260  else
2261  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2262  }else if(ih==11){
2263  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
2264  }else if(ih==12){
2265  cont_eleptvscutvars[1] = v0->MassK0Short();
2266  }else if(ih==13){
2267  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
2268  }else if(ih==14){
2269  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
2270  }else if(ih==15){
2271  cont_eleptvscutvars[1] = v0->Eta();
2272  }else if(ih==16){
2273  Double_t v0px = elobj->PxProng(1);
2274  Double_t v0py = elobj->PyProng(1);
2275  Double_t v0pz = elobj->PzProng(1);
2276  Double_t epx = elobj->PxProng(0);
2277  Double_t epy = elobj->PyProng(0);
2278  Double_t epz = elobj->PzProng(0);
2279  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
2280  }else{
2281  cont_eleptvscutvars[1] = -9999.;
2282  }
2283 
2284  fHistoElePtvsCutVarsRS[ih]->Fill(cont_eleptvscutvars);
2285  }
2286  }
2287  if(fUseMCInfo){
2288  if(mclc){
2289  Int_t pdgcode = mclc->GetPdgCode();
2290  Double_t cont_mclc[3];
2291  cont_mclc[0] = mclc->Pt();
2292  cont_mclc[1] = mclc->Y();
2293  cont_mclc[2] = fCentrality;
2294  Double_t cont_mcele[3];
2295  cont_mcele[0] = mcele->Pt();
2296  cont_mcele[1] = mcele->Eta();
2297  cont_mcele[2] = fCentrality;
2298 
2299  Int_t labmotherlc = mclc->GetMother();
2300  Bool_t isbottomfd = kFALSE;
2301  if(labmotherlc>=0){
2302  AliAODMCParticle *motherlc = (AliAODMCParticle*)mcArray->At(labmotherlc);
2303  Int_t pdgmotherlc = motherlc->GetPdgCode();
2304  if(TMath::Abs(pdgmotherlc)==511||TMath::Abs(pdgmotherlc)==521||TMath::Abs(pdgmotherlc)==5122||TMath::Abs(pdgmotherlc)==5132||TMath::Abs(pdgmotherlc)==5232||TMath::Abs(pdgmotherlc)==5332){
2305  isbottomfd = kTRUE;
2306  }
2307  }
2308  cont2[1] = mcele->Pt();
2309 
2310  if(abs(pdgcode)==4122 && abs(mcpdgele_array[1])==4122 && abs(mcpdgv0_array[1])==4122){
2311  fHistoEleLambdaMassMCS->Fill(cont);
2312  fHistoEleLambdaMassvsElePtMCS->Fill(cont2);
2313  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtMCS1->Fill(cont2);
2314  else fHistoEleLambdaMassvsElePtMCS2->Fill(cont2);
2315  if(cont[0]<2.3){
2316  fHistoEleLambdaPtvsRapidityMCS->Fill(elobj->Pt(),elobj_rap);
2317  fHistoElePtMCS->Fill(trk->Pt(),fCentrality);
2318  fHistoElePtvsEtaMCS->Fill(cont_eleptvseta);
2319  fHistoElePtvsLambdaPtMCS->Fill(cont_eleptvslambdapt);
2320  fHistoElePtvsd0MCS->Fill(cont_eleptvsd0);
2321 
2322  fHistoElePtvsV0dlMCS->Fill(cont_eleptvsv0dl);
2323  if(trk->Charge()>0) fHistoElePtvsV0dlMCS1->Fill(cont_eleptvsv0dl);
2324  else fHistoElePtvsV0dlMCS2->Fill(cont_eleptvsv0dl);
2325 
2326  fHistoElePtvsV0dcaMCS->Fill(cont_eleptvsv0dca);
2327  if(trk->Charge()>0) fHistoElePtvsV0dcaMCS1->Fill(cont_eleptvsv0dca);
2328  else fHistoElePtvsV0dcaMCS2->Fill(cont_eleptvsv0dca);
2329 
2330  fHistoEleLambdaPtvsV0dlMCS->Fill(cont_elelamptvsv0dl);
2331  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlMCS1->Fill(cont_elelamptvsv0dl);
2332  else fHistoEleLambdaPtvsV0dlMCS2->Fill(cont_elelamptvsv0dl);
2333 
2334  if(isbottomfd){
2335  fHistoEleLambdaPtvsV0dlBFeeddownMCS->Fill(cont_elelamptvsv0dl);
2336  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlBFeeddownMCS1->Fill(cont_elelamptvsv0dl);
2337  else fHistoEleLambdaPtvsV0dlBFeeddownMCS2->Fill(cont_elelamptvsv0dl);
2338  }else{
2339  fHistoEleLambdaPtvsV0dlPromptMCS->Fill(cont_elelamptvsv0dl);
2340  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlPromptMCS1->Fill(cont_elelamptvsv0dl);
2341  else fHistoEleLambdaPtvsV0dlPromptMCS2->Fill(cont_elelamptvsv0dl);
2342  }
2343 
2344  fHistoLcMCS->Fill(cont_mclc);
2345  if(trk->Charge()>0) fHistoLcMCS1->Fill(cont_mclc);
2346  else fHistoLcMCS2->Fill(cont_mclc);
2347 
2348  fHistoLcElectronMCS->Fill(cont_mcele);
2349  if(trk->Charge()>0) fHistoLcElectronMCS1->Fill(cont_mcele);
2350  else fHistoLcElectronMCS2->Fill(cont_mcele);
2351 
2352  fHistoResponseElePt->Fill(mclc->Pt(),trk->Pt());
2353  if(trk->Charge()>0) fHistoResponseElePt1->Fill(mclc->Pt(),trk->Pt());
2354  else fHistoResponseElePt2->Fill(mclc->Pt(),trk->Pt());
2355  fHistoResponseEleLambdaPt->Fill(mclc->Pt(),elobj->Pt());
2356  if(trk->Charge()>0) fHistoResponseEleLambdaPt1->Fill(mclc->Pt(),trk->Pt());
2357  else fHistoResponseEleLambdaPt2->Fill(mclc->Pt(),trk->Pt());
2358 
2359  fHistoResponseLambdaPt->Fill(mclc->Pt(),v0->Pt());
2360  fHistoResponseLambdaPtvsEleLambdaPt->Fill(elobj->Pt(),v0->Pt());
2361 
2362  Double_t cont_eleptvslambdaptvslcpt[4];
2363  cont_eleptvslambdaptvslcpt[0] = cont_eleptvslambdapt[0];
2364  cont_eleptvslambdaptvslcpt[1] = cont_eleptvslambdapt[1];
2365  cont_eleptvslambdaptvslcpt[2] = mclc->Pt();
2366  cont_eleptvslambdaptvslcpt[3] = cont_eleptvslambdapt[2];
2367  fHistoElePtvsLambdaPtvsLcPtMCS->Fill(cont_eleptvslambdaptvslcpt);
2368 
2369  Double_t cont_allpt[4];
2370  cont_allpt[0] = mclc->Pt();
2371  cont_allpt[1] = elobj->Pt();
2372  cont_allpt[2] = trk->Pt();
2373  cont_allpt[3] = v0->Pt();
2374  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt->Fill(cont_allpt);
2375 
2376  if(isbottomfd){
2377  fHistoElePtvsd0BFeeddownMCS->Fill(cont_eleptvsd0);
2378  }else{
2379  fHistoElePtvsd0PromptMCS->Fill(cont_eleptvsd0);
2380  }
2381 
2382  for(Int_t ih=0;ih<17;ih++){
2383  Double_t cont_eleptvscutvars[3];
2384  cont_eleptvscutvars[0] = elobj->Pt();
2385  cont_eleptvscutvars[2] = fCentrality;
2386 
2387  if(ih==0){
2388  cont_eleptvscutvars[1] = trk->GetTPCNcls();
2389  }else if(ih==1){
2390  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
2391  }else if(ih==2){
2392  cont_eleptvscutvars[1] = nSigmaTPCele;
2393  }else if(ih==3){
2394  cont_eleptvscutvars[1] = nSigmaTOFele;
2395  }else if(ih==4){
2396  cont_eleptvscutvars[1] = trk->Eta();
2397  }else if(ih==5){
2398  cont_eleptvscutvars[1] = trk->GetITSNcls();
2399  }else if(ih==6){
2400  if(!anti_lambda_flag)
2401  cont_eleptvscutvars[1] = v0->MassLambda();
2402  else
2403  cont_eleptvscutvars[1] = v0->MassAntiLambda();
2404  }else if(ih==7){
2405  Double_t lPosV0[3];
2406  lPosV0[0] = v0->DecayVertexV0X();
2407  lPosV0[1] = v0->DecayVertexV0Y();
2408  lPosV0[2] = v0->DecayVertexV0Z();
2409  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
2410  }else if(ih==8){
2411  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
2412  }else if(ih==9){
2413  if(!anti_lambda_flag)
2414  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2415  else
2416  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2417  }else if(ih==10){
2418  if(!anti_lambda_flag)
2419  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2420  else
2421  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2422  }else if(ih==11){
2423  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
2424  }else if(ih==12){
2425  cont_eleptvscutvars[1] = v0->MassK0Short();
2426  }else if(ih==13){
2427  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
2428  }else if(ih==14){
2429  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
2430  }else if(ih==15){
2431  cont_eleptvscutvars[1] = v0->Eta();
2432  }else if(ih==16){
2433  Double_t v0px = elobj->PxProng(1);
2434  Double_t v0py = elobj->PyProng(1);
2435  Double_t v0pz = elobj->PzProng(1);
2436  Double_t epx = elobj->PxProng(0);
2437  Double_t epy = elobj->PyProng(0);
2438  Double_t epz = elobj->PzProng(0);
2439  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
2440  }else{
2441  cont_eleptvscutvars[1] = -9999.;
2442  }
2443 
2444  fHistoElePtvsCutVarsMCS[ih]->Fill(cont_eleptvscutvars);
2445  }
2446  }
2447  }
2448  if(abs(pdgcode)==4132 && abs(mcpdgele_array[1])==4132 && abs(mcpdgv0_array[1])==3312){
2451  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtFeeddownXic0MCS1->Fill(cont2);
2453  if(cont[0]<2.3){
2454  fHistoFeedDownXic0MCS->Fill(cont_mclc);
2455  if(trk->Charge()>0) fHistoFeedDownXic0MCS1->Fill(cont_mclc);
2456  else fHistoFeedDownXic0MCS2->Fill(cont_mclc);
2457 
2458  fHistoElectronFeedDownXic0MCS->Fill(cont_mcele);
2459  if(trk->Charge()>0) fHistoElectronFeedDownXic0MCS1->Fill(cont_mcele);
2460  else fHistoElectronFeedDownXic0MCS2->Fill(cont_mcele);
2461 
2462  fHistoElePtvsV0dlFeedDownXic0MCS->Fill(cont_eleptvsv0dl);
2463  if(trk->Charge()>0) fHistoElePtvsV0dlFeedDownXic0MCS1->Fill(cont_eleptvsv0dl);
2464  else fHistoElePtvsV0dlFeedDownXic0MCS2->Fill(cont_eleptvsv0dl);
2465 
2466  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS->Fill(cont_elelamptvsv0dl);
2467  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1->Fill(cont_elelamptvsv0dl);
2468  else fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2->Fill(cont_elelamptvsv0dl);
2469 
2470  if(isbottomfd){
2471  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS->Fill(cont_elelamptvsv0dl);
2472  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS1->Fill(cont_elelamptvsv0dl);
2473  else fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS2->Fill(cont_elelamptvsv0dl);
2474  }else{
2475  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS->Fill(cont_elelamptvsv0dl);
2476  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS1->Fill(cont_elelamptvsv0dl);
2477  else fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS2->Fill(cont_elelamptvsv0dl);
2478  }
2479 
2480  fHistoElePtvsV0dcaFeedDownXic0MCS->Fill(cont_eleptvsv0dca);
2481  if(trk->Charge()>0) fHistoElePtvsV0dcaFeedDownXic0MCS->Fill(cont_eleptvsv0dca);
2482  else fHistoElePtvsV0dcaFeedDownXic0MCS->Fill(cont_eleptvsv0dca);
2483 
2484  fHistoResponseEleLambdaPtFeeddownXic0->Fill(mclc->Pt(),elobj->Pt());
2485  if(trk->Charge()>0) fHistoResponseEleLambdaPtFeeddownXic01->Fill(mclc->Pt(),trk->Pt());
2486  else fHistoResponseEleLambdaPtFeeddownXic02->Fill(mclc->Pt(),trk->Pt());
2487 
2488  fHistoResponseLambdaPtFeeddownXic0->Fill(mclc->Pt(),v0->Pt());
2489 
2490  fHistoElePtFeeddownXic0MCS->Fill(trk->Pt(),fCentrality);
2491  fHistoElePtvsEtaFeeddownXic0MCS->Fill(cont_eleptvseta);
2492  fHistoElePtvsLambdaPtFeeddownXic0MCS->Fill(cont_eleptvslambdapt);
2493  }
2494  }
2495  if(abs(pdgcode)==4232 && abs(mcpdgele_array[1])==4232 && abs(mcpdgv0_array[1])==3322){
2498  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1->Fill(cont2);
2500  if(cont[0]<2.3){
2501  fHistoFeedDownXicPlusMCS->Fill(cont_mclc);
2502  if(trk->Charge()>0) fHistoFeedDownXicPlusMCS1->Fill(cont_mclc);
2503  else fHistoFeedDownXicPlusMCS2->Fill(cont_mclc);
2504 
2505  fHistoElectronFeedDownXicPlusMCS->Fill(cont_mcele);
2506  if(trk->Charge()>0) fHistoElectronFeedDownXicPlusMCS1->Fill(cont_mcele);
2507  else fHistoElectronFeedDownXicPlusMCS2->Fill(cont_mcele);
2508 
2509  fHistoElePtvsV0dlFeedDownXicPlusMCS->Fill(cont_eleptvsv0dl);
2510  if(trk->Charge()>0) fHistoElePtvsV0dlFeedDownXicPlusMCS1->Fill(cont_eleptvsv0dl);
2511  else fHistoElePtvsV0dlFeedDownXicPlusMCS2->Fill(cont_eleptvsv0dl);
2512 
2513  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS->Fill(cont_elelamptvsv0dl);
2514  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1->Fill(cont_elelamptvsv0dl);
2515  else fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2->Fill(cont_elelamptvsv0dl);
2516 
2517  if(isbottomfd){
2518  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS->Fill(cont_elelamptvsv0dl);
2519  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS1->Fill(cont_elelamptvsv0dl);
2520  else fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS2->Fill(cont_elelamptvsv0dl);
2521  }else{
2522  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS->Fill(cont_elelamptvsv0dl);
2523  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS1->Fill(cont_elelamptvsv0dl);
2524  else fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS2->Fill(cont_elelamptvsv0dl);
2525  }
2526 
2527  fHistoElePtvsV0dcaFeedDownXicPlusMCS->Fill(cont_eleptvsv0dca);
2528  if(trk->Charge()>0) fHistoElePtvsV0dcaFeedDownXicPlusMCS->Fill(cont_eleptvsv0dca);
2529  else fHistoElePtvsV0dcaFeedDownXicPlusMCS->Fill(cont_eleptvsv0dca);
2530 
2531  fHistoResponseEleLambdaPtFeeddownXicPlus->Fill(mclc->Pt(),elobj->Pt());
2532  if(trk->Charge()>0) fHistoResponseEleLambdaPtFeeddownXicPlus1->Fill(mclc->Pt(),trk->Pt());
2533  else fHistoResponseEleLambdaPtFeeddownXicPlus2->Fill(mclc->Pt(),trk->Pt());
2534 
2535  fHistoResponseLambdaPtFeeddownXicPlus->Fill(mclc->Pt(),v0->Pt());
2536 
2537  fHistoElePtFeeddownXicPlusMCS->Fill(trk->Pt(),fCentrality);
2538  fHistoElePtvsEtaFeeddownXicPlusMCS->Fill(cont_eleptvseta);
2539  fHistoElePtvsLambdaPtFeeddownXicPlusMCS->Fill(cont_eleptvslambdapt);
2540  }
2541  }
2542  if(abs(pdgcode)==4122 && abs(mcpdgele_array[1])==4122 && ( abs(mcpdgv0_array[1])==3212 || abs(mcpdgv0_array[1])==3214 || abs(mcpdgv0_array[1])==3224) ){
2543  if(cont[0]<2.3){
2544  fHistoFeedDownSigmaMCS->Fill(cont_mclc);
2545  if(trk->Charge()>0) fHistoFeedDownSigmaMCS1->Fill(cont_mclc);
2546  else fHistoFeedDownSigmaMCS2->Fill(cont_mclc);
2547 
2548  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS->Fill(cont_elelamptvsv0dl);
2549  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS1->Fill(cont_elelamptvsv0dl);
2550  else fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS2->Fill(cont_elelamptvsv0dl);
2551 
2552  if(isbottomfd){
2553  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS->Fill(cont_elelamptvsv0dl);
2554  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS1->Fill(cont_elelamptvsv0dl);
2555  else fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS2->Fill(cont_elelamptvsv0dl);
2556  }else{
2557  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS->Fill(cont_elelamptvsv0dl);
2558  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS1->Fill(cont_elelamptvsv0dl);
2559  else fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS2->Fill(cont_elelamptvsv0dl);
2560  }
2561  fHistoResponseEleLambdaPtFeeddownSigma->Fill(mclc->Pt(),elobj->Pt());
2562  if(trk->Charge()>0) fHistoResponseEleLambdaPtFeeddownSigma1->Fill(mclc->Pt(),trk->Pt());
2563  else fHistoResponseEleLambdaPtFeeddownSigma2->Fill(mclc->Pt(),trk->Pt());
2564 
2565  fHistoResponseLambdaPtFeeddownSigma->Fill(mclc->Pt(),v0->Pt());
2566  }
2567  }
2568  }
2569  }
2570  fHistodPhiSdEtaSElectronProtonR125RS->Fill(dphis_ele_pr,detas_ele_pr);
2571  fHistodPhiSdEtaSElectronPionR125RS->Fill(dphis_ele_pi,detas_ele_pi);
2572  }else if((trk->Charge()<0 && !anti_lambda_flag) || (trk->Charge()>0 && anti_lambda_flag)){
2573  fHistoEleLambdaMassWS->Fill(cont);
2574  if(trk->Charge()>0) fHistoEleLambdaMassWS1->Fill(cont);
2575  else fHistoEleLambdaMassWS2->Fill(cont);
2576 
2577  fHistoEleLambdaMassvsElePtWS->Fill(cont2);
2578  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtWS1->Fill(cont2);
2579  else fHistoEleLambdaMassvsElePtWS2->Fill(cont2);
2580  if(cont[0]<2.3){
2581  fHistoEleLambdaPtvsRapidityWS->Fill(elobj->Pt(),elobj_rap);
2582  fHistoElePtWS->Fill(trk->Pt(),fCentrality);
2583  fHistoElePtvsEtaWS->Fill(cont_eleptvseta);
2584  fHistoElePtvsLambdaPtWS->Fill(cont_eleptvslambdapt);
2585  fHistoElePtvsd0WS->Fill(cont_eleptvsd0);
2586 
2587  fHistoElePtvsV0dlWS->Fill(cont_eleptvsv0dl);
2588  if(trk->Charge()>0) fHistoElePtvsV0dlWS1->Fill(cont_eleptvsv0dl);
2589  else fHistoElePtvsV0dlWS2->Fill(cont_eleptvsv0dl);
2590 
2591  fHistoEleLambdaPtvsV0dlWS->Fill(cont_elelamptvsv0dl);
2592  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWS1->Fill(cont_elelamptvsv0dl);
2593  else fHistoEleLambdaPtvsV0dlWS2->Fill(cont_elelamptvsv0dl);
2594 
2595  fHistoElePtvsV0dcaWS->Fill(cont_eleptvsv0dca);
2596  if(trk->Charge()>0) fHistoElePtvsV0dcaWS1->Fill(cont_eleptvsv0dca);
2597  else fHistoElePtvsV0dcaWS2->Fill(cont_eleptvsv0dca);
2598 
2599  for(Int_t ih=0;ih<17;ih++){
2600  Double_t cont_eleptvscutvars[3];
2601  cont_eleptvscutvars[0] = elobj->Pt();
2602  cont_eleptvscutvars[2] = fCentrality;
2603 
2604  if(ih==0){
2605  cont_eleptvscutvars[1] = trk->GetTPCNcls();
2606  }else if(ih==1){
2607  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
2608  }else if(ih==2){
2609  cont_eleptvscutvars[1] = nSigmaTPCele;
2610  }else if(ih==3){
2611  cont_eleptvscutvars[1] = nSigmaTOFele;
2612  }else if(ih==4){
2613  cont_eleptvscutvars[1] = trk->Eta();
2614  }else if(ih==5){
2615  cont_eleptvscutvars[1] = trk->GetITSNcls();
2616  }else if(ih==6){
2617  if(!anti_lambda_flag)
2618  cont_eleptvscutvars[1] = v0->MassLambda();
2619  else
2620  cont_eleptvscutvars[1] = v0->MassAntiLambda();
2621  }else if(ih==7){
2622  Double_t lPosV0[3];
2623  lPosV0[0] = v0->DecayVertexV0X();
2624  lPosV0[1] = v0->DecayVertexV0Y();
2625  lPosV0[2] = v0->DecayVertexV0Z();
2626  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
2627  }else if(ih==8){
2628  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
2629  }else if(ih==9){
2630  if(!anti_lambda_flag)
2631  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2632  else
2633  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2634  }else if(ih==10){
2635  if(!anti_lambda_flag)
2636  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2637  else
2638  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2639  }else if(ih==11){
2640  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
2641  }else if(ih==12){
2642  cont_eleptvscutvars[1] = v0->MassK0Short();
2643  }else if(ih==13){
2644  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
2645  }else if(ih==14){
2646  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
2647  }else if(ih==15){
2648  cont_eleptvscutvars[1] = v0->Eta();
2649  }else if(ih==16){
2650  Double_t v0px = elobj->PxProng(1);
2651  Double_t v0py = elobj->PyProng(1);
2652  Double_t v0pz = elobj->PzProng(1);
2653  Double_t epx = elobj->PxProng(0);
2654  Double_t epy = elobj->PyProng(0);
2655  Double_t epz = elobj->PzProng(0);
2656  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
2657  }else{
2658  cont_eleptvscutvars[1] = -9999.;
2659  }
2660 
2661  fHistoElePtvsCutVarsWS[ih]->Fill(cont_eleptvscutvars);
2662  }
2663  }
2664  if(fUseMCInfo){
2665  if(mclc){
2666  Int_t pdgcode = mclc->GetPdgCode();
2667  Double_t cont_mclb[3];
2668  cont_mclb[0] = mclc->Pt();
2669  cont_mclb[1] = mclc->Y();
2670  cont_mclb[2] = fCentrality;
2671  Double_t cont_mcele[3];
2672  cont_mcele[0] = mcele->Pt();
2673  cont_mcele[1] = mcele->Eta();
2674  cont_mcele[2] = fCentrality;
2675 
2676  if(abs(pdgcode)==5122 && abs(mcpdgele_array[1])==5122 && abs(mcpdgv0_array[1])==4122 && abs(mcpdgv0_array[2])==5122){
2677  fHistoEleLambdaMassLambdabMCS->Fill(cont);
2678  if(cont[0]<2.3){
2679  fHistoResponseEleLambdaPtLambdab->Fill(mclc->Pt(),elobj->Pt());
2680  fHistoResponseElePtLambdab->Fill(mclc->Pt(),trk->Pt());
2681  fHistoResponseLambdaPtLambdab->Fill(mclc->Pt(),v0->Pt());
2682  fHistoResponseLambdaPtvsEleLambdaPtLambdab->Fill(elobj->Pt(),v0->Pt());
2683 
2684  fHistoLbMCS->Fill(cont_mclb);
2685  if(trk->Charge()>0) fHistoLbMCS1->Fill(cont_mclb);
2686  else fHistoLbMCS2->Fill(cont_mclb);
2687 
2688  fHistoEleLambdaPtvsV0dlLambdabMCS->Fill(cont_elelamptvsv0dl);
2689  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlLambdabMCS1->Fill(cont_elelamptvsv0dl);
2690  else fHistoEleLambdaPtvsV0dlLambdabMCS2->Fill(cont_elelamptvsv0dl);
2691 
2692  fHistoLbElectronMCS->Fill(cont_mcele);
2693  if(trk->Charge()>0) fHistoLbElectronMCS1->Fill(cont_mcele);
2694  else fHistoLbElectronMCS2->Fill(cont_mcele);
2695  }
2696  }
2697  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgv0_array[1])==4132 && abs(mcpdgv0_array[2])==5132){
2698  fHistoEleLambdaMassXibMCS->Fill(cont);
2699  if(cont[0]<2.3){
2700  fHistoEleLambdaPtvsV0dlXibMCS->Fill(cont_elelamptvsv0dl);
2701  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlXibMCS1->Fill(cont_elelamptvsv0dl);
2702  else fHistoEleLambdaPtvsV0dlXibMCS2->Fill(cont_elelamptvsv0dl);
2703 
2704  fHistoElectronFeedDownXibMCS->Fill(cont_mcele);
2705  if(trk->Charge()>0) fHistoElectronFeedDownXibMCS1->Fill(cont_mcele);
2706  else fHistoElectronFeedDownXibMCS2->Fill(cont_mcele);
2707  }
2708  }
2709  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgv0_array[1])==4232 && abs(mcpdgv0_array[2])==5132){
2710  fHistoEleLambdaMassXibMCS->Fill(cont);
2711  if(cont[0]<2.3){
2712  fHistoEleLambdaPtvsV0dlXibMCS->Fill(cont_elelamptvsv0dl);
2713  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlXibMCS1->Fill(cont_elelamptvsv0dl);
2714  else fHistoEleLambdaPtvsV0dlXibMCS2->Fill(cont_elelamptvsv0dl);
2715 
2716  fHistoElectronFeedDownXibMCS->Fill(cont_mcele);
2717  if(trk->Charge()>0) fHistoElectronFeedDownXibMCS1->Fill(cont_mcele);
2718  else fHistoElectronFeedDownXibMCS2->Fill(cont_mcele);
2719  }
2720  }
2721  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgv0_array[1])==4132 && abs(mcpdgv0_array[2])==5232){
2722  fHistoEleLambdaMassXibMCS->Fill(cont);
2723  if(cont[0]<2.3){
2724  fHistoEleLambdaPtvsV0dlXibMCS->Fill(cont_elelamptvsv0dl);
2725  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlXibMCS1->Fill(cont_elelamptvsv0dl);
2726  else fHistoEleLambdaPtvsV0dlXibMCS2->Fill(cont_elelamptvsv0dl);
2727 
2728  fHistoElectronFeedDownXibMCS->Fill(cont_mcele);
2729  if(trk->Charge()>0) fHistoElectronFeedDownXibMCS1->Fill(cont_mcele);
2730  else fHistoElectronFeedDownXibMCS2->Fill(cont_mcele);
2731  }
2732  }
2733  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgv0_array[1])==4232 && abs(mcpdgv0_array[2])==5232){
2734  fHistoEleLambdaMassXibMCS->Fill(cont);
2735  if(cont[0]<2.3){
2736  fHistoEleLambdaPtvsV0dlXibMCS->Fill(cont_elelamptvsv0dl);
2737  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlXibMCS1->Fill(cont_elelamptvsv0dl);
2738  else fHistoEleLambdaPtvsV0dlXibMCS2->Fill(cont_elelamptvsv0dl);
2739 
2740  fHistoElectronFeedDownXibMCS->Fill(cont_mcele);
2741  if(trk->Charge()>0) fHistoElectronFeedDownXibMCS1->Fill(cont_mcele);
2742  else fHistoElectronFeedDownXibMCS2->Fill(cont_mcele);
2743  }
2744  }
2745  }
2746  }
2747  fHistodPhiSdEtaSElectronProtonR125WS->Fill(dphis_ele_pr,detas_ele_pr);
2748  fHistodPhiSdEtaSElectronPionR125WS->Fill(dphis_ele_pi,detas_ele_pi);
2749  }
2750  }
2751 
2752  //if( elobj->InvMass(2,pdgdg) < 10. && cosoa < 0. && fAnalCuts->IsPeakRegion(v0))
2753  if( melam_flip < 10. && cosoa < 0. && fAnalCuts->IsPeakRegion(v0))
2754  {
2755  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
2756  fHistoEleLambdaMassRSAway->Fill(cont_flip);
2757  if(trk->Charge()>0) fHistoEleLambdaMassRS1Away->Fill(cont_flip);
2758  else fHistoEleLambdaMassRS2Away->Fill(cont_flip);
2759  if(cont_flip[0]<2.3){
2760  fHistoEleLambdaPtvsV0dlRSAway->Fill(cont_elelamptvsv0dl_flip);
2761  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRS1Away->Fill(cont_elelamptvsv0dl_flip);
2762  else fHistoEleLambdaPtvsV0dlRS2Away->Fill(cont_elelamptvsv0dl_flip);
2763  }
2764  }else{
2765  fHistoEleLambdaMassWSAway->Fill(cont_flip);
2766  if(trk->Charge()>0) fHistoEleLambdaMassWS1Away->Fill(cont_flip);
2767  else fHistoEleLambdaMassWS2Away->Fill(cont_flip);
2768  if(cont_flip[0]<2.3){
2769  fHistoEleLambdaPtvsV0dlWSAway->Fill(cont_elelamptvsv0dl_flip);
2770  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWS1Away->Fill(cont_elelamptvsv0dl_flip);
2771  else fHistoEleLambdaPtvsV0dlWS2Away->Fill(cont_elelamptvsv0dl_flip);
2772  }
2773  }
2774  }
2775 
2777  {
2778  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
2779  fHistoEleLambdaMassRSSide->Fill(cont);
2780  if(trk->Charge()>0) fHistoEleLambdaMassRSSide1->Fill(cont);
2781  else fHistoEleLambdaMassRSSide2->Fill(cont);
2782 
2783  fHistoEleLambdaMassvsElePtRSSide->Fill(cont2);
2784  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtRSSide1->Fill(cont2);
2785  else fHistoEleLambdaMassvsElePtRSSide2->Fill(cont2);
2786 
2787  fHistoElePtvsV0dlRSSide->Fill(cont_eleptvsv0dl);
2788  if(trk->Charge()>0) fHistoElePtvsV0dlRSSide1->Fill(cont_eleptvsv0dl);
2789  else fHistoElePtvsV0dlRSSide2->Fill(cont_eleptvsv0dl);
2790 
2791  fHistoEleLambdaPtvsV0dlRSSide->Fill(cont_elelamptvsv0dl);
2792  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRSSide1->Fill(cont_elelamptvsv0dl);
2793  else fHistoEleLambdaPtvsV0dlRSSide2->Fill(cont_elelamptvsv0dl);
2794 
2795  fHistoElePtvsV0dcaRSSide->Fill(cont_eleptvsv0dca);
2796  if(trk->Charge()>0) fHistoElePtvsV0dcaRSSide1->Fill(cont_eleptvsv0dca);
2797  else fHistoElePtvsV0dcaRSSide2->Fill(cont_eleptvsv0dca);
2798 
2799  }else if((trk->Charge()<0 && !anti_lambda_flag) || (trk->Charge()>0 && anti_lambda_flag)){
2800  fHistoEleLambdaMassWSSide->Fill(cont);
2801  if(trk->Charge()>0) fHistoEleLambdaMassWSSide1->Fill(cont);
2802  else fHistoEleLambdaMassWSSide2->Fill(cont);
2803 
2804  fHistoEleLambdaMassvsElePtWSSide->Fill(cont2);
2805  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtWSSide1->Fill(cont2);
2806  else fHistoEleLambdaMassvsElePtWSSide2->Fill(cont2);
2807 
2808  fHistoElePtvsV0dlWSSide->Fill(cont_eleptvsv0dl);
2809  if(trk->Charge()>0) fHistoElePtvsV0dlWSSide1->Fill(cont_eleptvsv0dl);
2810  else fHistoElePtvsV0dlWSSide2->Fill(cont_eleptvsv0dl);
2811 
2812  fHistoEleLambdaPtvsV0dlWSSide->Fill(cont_elelamptvsv0dl);
2813  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWSSide1->Fill(cont_elelamptvsv0dl);
2814  else fHistoEleLambdaPtvsV0dlWSSide2->Fill(cont_elelamptvsv0dl);
2815 
2816  fHistoElePtvsV0dcaWSSide->Fill(cont_eleptvsv0dca);
2817  if(trk->Charge()>0) fHistoElePtvsV0dcaWSSide1->Fill(cont_eleptvsv0dca);
2818  else fHistoElePtvsV0dcaWSSide2->Fill(cont_eleptvsv0dca);
2819  }
2820  }
2821 
2822  //if( elobj->InvMass(2,pdgdg) < 10. && cosoa < 0. && fAnalCuts->IsSideBand(v0))
2823  if( melam_flip < 10. && cosoa < 0. && fAnalCuts->IsSideBand(v0))
2824  {
2825  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
2826  fHistoEleLambdaMassRSSideAway->Fill(cont_flip);
2827  if(trk->Charge()>0) fHistoEleLambdaMassRSSide1Away->Fill(cont_flip);
2828  else fHistoEleLambdaMassRSSide2Away->Fill(cont_flip);
2829  if(cont_flip[0]<2.3){
2830  fHistoEleLambdaPtvsV0dlRSSideAway->Fill(cont_elelamptvsv0dl_flip);
2831  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRSSide1Away->Fill(cont_elelamptvsv0dl_flip);
2832  else fHistoEleLambdaPtvsV0dlRSSide2Away->Fill(cont_elelamptvsv0dl_flip);
2833  }
2834  }else{
2835  fHistoEleLambdaMassWSSideAway->Fill(cont_flip);
2836  if(trk->Charge()>0) fHistoEleLambdaMassWSSide1Away->Fill(cont_flip);
2837  else fHistoEleLambdaMassWSSide2Away->Fill(cont_flip);
2838  if(cont_flip[0]<2.3){
2839  fHistoEleLambdaPtvsV0dlWSSideAway->Fill(cont_elelamptvsv0dl_flip);
2840  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWSSide1Away->Fill(cont_elelamptvsv0dl_flip);
2841  else fHistoEleLambdaPtvsV0dlWSSide2Away->Fill(cont_elelamptvsv0dl_flip);
2842  }
2843  }
2844  }
2845 
2846  //
2847  // New strategy: Fully analyze correlation
2848  //
2849  for(Int_t iv=0;iv<13;iv++){
2850  fCorrelationVariables[iv] = -9999.;
2851  }
2852 
2853  Double_t cont_cor_nd[7];
2854  for(Int_t iv=0;iv<7;iv++){
2855  cont_cor_nd[iv] = -9999.;
2856  }
2857  Double_t cont_mass_nd[8];
2858  for(Int_t iv=0;iv<8;iv++){
2859  cont_mass_nd[iv] = -9999.;
2860  }
2861 
2862  fCorrelationVariables[0] = v0->Pt();
2863  fCorrelationVariables[1] = trk->Pt();
2866  fCorrelationVariables[4] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;;
2867  fCorrelationVariables[5] = elobj->Getd0Prong(0);
2868  if(!fUseMCInfo) fCorrelationVariables[6] = 0;
2869  else fCorrelationVariables[6] = 1;
2870  if(trk->Charge()>0){
2871  if(!anti_lambda_flag) fCorrelationVariables[7] = 0;
2872  else fCorrelationVariables[7] = 2;
2873  }else if(trk->Charge()<0){
2874  if(!anti_lambda_flag) fCorrelationVariables[7] = 1;
2875  else fCorrelationVariables[7] = 3;
2876  }
2877  fCorrelationVariables[8] = (Int_t)isconv + 2 * (Int_t)isconv_like;
2879  fCorrelationVariables[11] = elobj->Pt();
2880  fCorrelationVariables[12] = elobj->InvMass(2,pdgdg);
2881 
2882  cont_cor_nd[0] = elobj->Pt();
2883  cont_cor_nd[1] = fAnalCuts->DeltaPhi(v0,trk);
2884  cont_cor_nd[2] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;;
2885  if(trk->Charge()>0){
2886  if(!anti_lambda_flag) cont_cor_nd[3] = 0;
2887  else cont_cor_nd[3] = 2;
2888  }else if(trk->Charge()<0){
2889  if(!anti_lambda_flag) cont_cor_nd[3] = 3;
2890  else cont_cor_nd[3] = 1;
2891  }
2892  cont_cor_nd[4] = fCorrelationVariables[8];
2893  cont_cor_nd[5] = 0;
2894  cont_cor_nd[6] = fCentrality;
2895 
2896  if(fUseMCInfo && FromSemileptonicDecays(mcpdgele_array)>0){
2897  if(mclc){
2898  Int_t pdgcode = mclc->GetPdgCode();
2899  if(abs(pdgcode)==4122 && abs(mcpdgele_array[1])==4122 && abs(mcpdgv0_array[1])==4122){
2900  fCorrelationVariables[9] = 1;
2901  cont_cor_nd[5] = 1;
2902  }
2903  if(abs(pdgcode)==4122 && abs(mcpdgele_array[1])==4122 && ( abs(mcpdgv0_array[1])==3212 || abs(mcpdgv0_array[1])==3214 || abs(mcpdgv0_array[1])==3224) ){
2904  fCorrelationVariables[9] = 2;
2905  cont_cor_nd[5] = 2;
2906  }
2907  if(abs(pdgcode)==4132 && abs(mcpdgele_array[1])==4132 && abs(mcpdgv0_array[1])==3312){
2908  fCorrelationVariables[9] = 3;
2909  cont_cor_nd[5] = 3;
2910  }
2911  if(abs(pdgcode)==4232 && abs(mcpdgele_array[1])==4232 && abs(mcpdgv0_array[1])==3322){
2912  fCorrelationVariables[9] = 4;
2913  cont_cor_nd[5] = 4;
2914  }
2915  if(abs(pdgcode)==5122 && abs(mcpdgele_array[1])==5122 && abs(mcpdgv0_array[1])==4122 && abs(mcpdgv0_array[2])==5122){
2916  fCorrelationVariables[9] = 11;
2917  cont_cor_nd[5] = 5;
2918  }
2919  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgv0_array[1])==4132 && abs(mcpdgv0_array[2])==5132){
2920  fCorrelationVariables[9] = 12;
2921  cont_cor_nd[5] = 6;
2922  }
2923  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgv0_array[1])==4232 && abs(mcpdgv0_array[2])==5132){
2924  fCorrelationVariables[9] = 13;
2925  cont_cor_nd[5] = 6;
2926  }
2927  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgv0_array[1])==4132 && abs(mcpdgv0_array[2])==5232){
2928  fCorrelationVariables[9] = 14;
2929  cont_cor_nd[5] = 6;
2930  }
2931  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgv0_array[1])==4232 && abs(mcpdgv0_array[2])==5232){
2932  fCorrelationVariables[9] = 15;
2933  cont_cor_nd[5] = 6;
2934  }
2935  }
2936  if(fCorrelationVariables[9]<0){
2937  Bool_t lam_from_bottom = HaveBottomInHistory(mcpdgv0_array);
2938  Bool_t lam_from_charm = HaveCharmInHistory(mcpdgv0_array);
2939  if(FromSemileptonicDecays(mcpdgele_array)==1){
2940  if(lam_from_bottom) fCorrelationVariables[9] = 1011;
2941  else if(lam_from_charm) fCorrelationVariables[9] = 1012;
2942  else fCorrelationVariables[9] = 1013;
2943 
2944  cont_cor_nd[5] = 7;
2945  }
2946  if(FromSemileptonicDecays(mcpdgele_array)==2){
2947  if(lam_from_bottom) fCorrelationVariables[9] = 1014;
2948  else if(lam_from_charm) fCorrelationVariables[9] = 1015;
2949  else fCorrelationVariables[9] = 1016;
2950 
2951  cont_cor_nd[5] = 8;
2952  }
2953  if(FromSemileptonicDecays(mcpdgele_array)==1 && HaveBottomInHistory(mcpdgele_array)){
2954  if(lam_from_bottom) fCorrelationVariables[9] = 1017;
2955  else if(lam_from_charm) fCorrelationVariables[9] = 1018;
2956  else fCorrelationVariables[9] = 1019;
2957 
2958  cont_cor_nd[5] = 9;
2959  }
2960  }
2961  }
2962 
2964  {
2965  if(fWriteVariableTree)
2966  fCorrelationVariablesTree->Fill();
2967 
2968  if(fUseMCInfo){
2969  if(elobj->InvMass(2,pdgdg)<2.3)
2970  fHistoCorrelationVariablesvsEleLambdaPtMC->Fill(cont_cor_nd);
2971  cont_cor_nd[0] = trk->Pt();
2972  fHistoCorrelationVariablesvsElePtMC->Fill(cont_cor_nd);
2973  cont_cor_nd[0] = v0->Pt();
2974  fHistoCorrelationVariablesvsLambdaPtMC->Fill(cont_cor_nd);
2975  }else{
2976  if(elobj->InvMass(2,pdgdg)<2.3)
2977  fHistoCorrelationVariablesvsEleLambdaPt->Fill(cont_cor_nd);
2978  cont_cor_nd[0] = trk->Pt();
2979  fHistoCorrelationVariablesvsElePt->Fill(cont_cor_nd);
2980  cont_cor_nd[0] = v0->Pt();
2981  fHistoCorrelationVariablesvsLambdaPt->Fill(cont_cor_nd);
2982  }
2983  }
2984 
2985  cont_mass_nd[0] = elobj->InvMass(2,pdgdg);
2986  cont_mass_nd[1] = cont_cor_nd[0];
2987  cont_mass_nd[4] = cont_cor_nd[3];
2988  cont_mass_nd[5] = cont_cor_nd[4];
2989  cont_mass_nd[6] = cont_cor_nd[5];
2990  cont_mass_nd[7] = cont_cor_nd[6];
2991 
2992  if(fAnalCuts->IsPeakRegion(v0)) cont_mass_nd[3] = 1;
2993  if(fAnalCuts->IsSideBand(v0)) cont_mass_nd[3] = 0;
2994  if(fAnalCuts->IsSelected(elobj,AliRDHFCuts::kCandidate)) cont_mass_nd[2]=1;
2995  if(melam_flip < 10.&& cosoa < 0.) cont_mass_nd[2]=0;
2996  if(fUseMCInfo){
2997  fHistoMassVariablesvsEleLambdaPtMC->Fill(cont_mass_nd);
2998  cont_mass_nd[1] = trk->Pt();
2999  fHistoMassVariablesvsElePtMC->Fill(cont_mass_nd);
3000  cont_mass_nd[1] = v0->Pt();
3001  fHistoMassVariablesvsLambdaPtMC->Fill(cont_mass_nd);
3002  }else{
3003  fHistoMassVariablesvsEleLambdaPt->Fill(cont_mass_nd);
3004  cont_mass_nd[1] = trk->Pt();
3005  fHistoMassVariablesvsElePt->Fill(cont_mass_nd);
3006  cont_mass_nd[1] = v0->Pt();
3007  fHistoMassVariablesvsLambdaPt->Fill(cont_mass_nd);
3008  }
3009 
3010  return;
3011 }
3012 
3014 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMixROOTObjects(TLorentzVector *trke, TLorentzVector *v0, TVector *elevars, TVector *v0vars, Int_t chargepr)
3015 {
3019  if(!trke) return;
3020  if(!v0) return;
3021 
3022  for(Int_t i=0;i<94;i++)
3023  {
3024  fCandidateVariables[i] = -9999.;
3025  }
3026 
3027 
3028  Double_t pxe = trke->Px();
3029  Double_t pye = trke->Py();
3030  Double_t pze = trke->Pz();
3031  Double_t mome = sqrt(pxe*pxe+pye*pye+pze*pze);
3032  Double_t Ee = sqrt(mome*mome+0.000510998928*0.000510998928);
3033 
3034  Double_t pxv = v0->Px();
3035  Double_t pyv = v0->Py();
3036  Double_t pzv = v0->Pz();
3037  Double_t momv = sqrt(pxv*pxv+pyv*pyv+pzv*pzv);
3038  Double_t Ev = sqrt(momv*momv+1.115683*1.115683);
3039 
3040  Double_t cosoa = (pxe*pxv+pye*pyv+pze*pzv)/mome/momv;
3041 
3042  Double_t pxsum = pxe + pxv;
3043  Double_t pysum = pye + pyv;
3044  Double_t pzsum = pze + pzv;
3045  Double_t Esum = Ee + Ev;
3046  Double_t mel = sqrt(Esum*Esum-pxsum*pxsum-pysum*pysum-pzsum*pzsum);
3047 
3048  Double_t uxe = pxe/mome;
3049  Double_t uye = pye/mome;
3050  Double_t uze = pze/mome;
3051  Double_t lf = -2.*(pxv*uxe+pyv*uye+pzv*uze);
3052  Double_t pxv_flip = pxv + lf * uxe;
3053  Double_t pyv_flip = pyv + lf * uye;
3054  Double_t pzv_flip = pzv + lf * uze;
3055  Double_t pxsum_flip = pxe + pxv_flip;
3056  Double_t pysum_flip = pye + pyv_flip;
3057  Double_t pzsum_flip = pze + pzv_flip;
3058  Double_t mel_flip = sqrt(Esum*Esum-pxsum_flip*pxsum_flip-pysum_flip*pysum_flip-pzsum_flip*pzsum_flip);
3059  Double_t ptel_flip = sqrt(pxsum_flip*pxsum_flip+pysum_flip*pysum_flip);
3060 
3062  UInt_t pdgdg[2]={11,3122};
3063  fCandidateVariables[ 1] = mel;
3064  fCandidateVariables[ 2] = sqrt(pxsum*pxsum+pysum*pysum);
3065  fCandidateVariables[ 3] = pxsum;
3066  fCandidateVariables[ 4] = pysum;
3067  fCandidateVariables[ 5] = pzsum;
3068  fCandidateVariables[ 6] = pxe;
3069  fCandidateVariables[ 7] = pye;
3070  fCandidateVariables[ 8] = pze;
3071  fCandidateVariables[ 9] = pxv;
3072  fCandidateVariables[10] = pyv;
3073  fCandidateVariables[11] = pzv;
3074  if(chargepr>0){
3075  fCandidateVariables[12] = 0;
3076  fCandidateVariables[13] = v0->M();
3077  fCandidateVariables[14] = 0.;
3078  }else{
3079  fCandidateVariables[12] = 1;
3080  fCandidateVariables[13] = 0;
3081  fCandidateVariables[14] = v0->M();
3082  }
3083 
3084  fCandidateVariables[17] = (*elevars)[3];
3085  fCandidateVariables[18] = (*elevars)[4];
3086 
3087  fCandidateVariables[21] = trke->T();
3088  fCandidateVariables[22] = (*v0vars)[9];
3089  fCandidateVariables[23] = (*v0vars)[10];
3090  fCandidateVariables[24] = (*v0vars)[11];
3091  fCandidateVariables[25] = (*v0vars)[12];
3092  fCandidateVariables[26] = (*v0vars)[13];
3093  fCandidateVariables[27] = (*v0vars)[14];
3094 
3095  fCandidateVariables[32] = 1;
3096 
3097  fCandidateVariables[54] = fVtx1->GetX();
3098  fCandidateVariables[55] = fVtx1->GetY();
3099  fCandidateVariables[56] = fVtx1->GetZ();
3100  fCandidateVariables[57] = (*v0vars)[6];
3101  fCandidateVariables[58] = (*v0vars)[7];
3102  fCandidateVariables[59] = (*v0vars)[8];
3103  fCandidateVariables[64] = (*v0vars)[15];
3104 
3105  fCandidateVariables[91] = fBzkG;
3108 
3109 
3110 // if(fWriteVariableTree)
3111 // fVariablesTree->Fill();
3112 
3113  Double_t cont[3];
3114  cont[0] = mel;
3115  cont[1] = sqrt(pxsum*pxsum+pysum*pysum);
3116  cont[2] = fCentrality;
3117  fHistoEleLambdaMass->Fill(cont);
3118 
3119  Double_t cont_flip[3];
3120  cont_flip[0] = mel_flip;
3121  cont_flip[1] = ptel_flip;
3122  cont_flip[2] = fCentrality;
3123 
3124  Double_t cont2[3];
3125  cont2[0] = mel;
3126  cont2[1] = sqrt(pxe*pxe+pye*pye);
3127  cont2[2] = fCentrality;
3128  Double_t cont_eleptvseta[3];
3129  cont_eleptvseta[0] = trke->Pt();
3130  cont_eleptvseta[1] = trke->Eta();
3131  cont_eleptvseta[2] = fCentrality;
3132 
3133  Double_t cont_eleptvslambdapt[3];
3134  cont_eleptvslambdapt[0] = trke->Pt();
3135  cont_eleptvslambdapt[1] = v0->Pt();
3136  cont_eleptvslambdapt[2] = fCentrality;
3137 
3138  Double_t cont_eleptvsd0[3];
3139  cont_eleptvsd0[0] = trke->Pt();
3140  cont_eleptvsd0[1] = 0.;
3141  cont_eleptvsd0[2] = fCentrality;
3142 
3143  Double_t cont_eleptvsv0dl[3];
3144  cont_eleptvsv0dl[0] = trke->Pt();
3145  cont_eleptvsv0dl[1] = (*v0vars)[15];
3146  cont_eleptvsv0dl[2] = fCentrality;
3147 
3148  Double_t cont_eleptvsv0dca[3];
3149  cont_eleptvsv0dca[0] = trke->Pt();
3150  cont_eleptvsv0dca[1] = (*v0vars)[16];
3151  cont_eleptvsv0dca[2] = fCentrality;
3152 
3153  Double_t cont_elelamptvsv0dl[4];
3154  cont_elelamptvsv0dl[0] = sqrt(pxsum*pxsum+pysum*pysum);
3155  cont_elelamptvsv0dl[1] = (*v0vars)[15];
3156  cont_elelamptvsv0dl[2] = 0.0;
3157  cont_elelamptvsv0dl[3] = fCentrality;
3158 
3159  Double_t cont_elelamptvsv0dl_flip[4];
3160  cont_elelamptvsv0dl_flip[0] = ptel_flip;
3161  cont_elelamptvsv0dl_flip[1] = (*v0vars)[15];
3162  cont_elelamptvsv0dl_flip[2] = 0.0;
3163  cont_elelamptvsv0dl_flip[3] = fCentrality;
3164 
3165  Double_t xyzR125_ele[3], xyzR125_pr[3], xyzR125_pi[3];
3166  xyzR125_ele[0] = (*elevars)[0];
3167  xyzR125_ele[1] = (*elevars)[1];
3168  xyzR125_ele[2] = (*elevars)[2];
3169  xyzR125_pr[0] = (*v0vars)[0];
3170  xyzR125_pr[1] = (*v0vars)[1];
3171  xyzR125_pr[2] = (*v0vars)[2];
3172  xyzR125_pi[0] = (*v0vars)[3];
3173  xyzR125_pi[1] = (*v0vars)[4];
3174  xyzR125_pi[2] = (*v0vars)[5];
3175 
3176  Double_t rdhfcutvars[9];
3177  rdhfcutvars[0] = xyzR125_ele[0];
3178  rdhfcutvars[1] = xyzR125_ele[1];
3179  rdhfcutvars[2] = xyzR125_ele[2];
3180  rdhfcutvars[3] = xyzR125_pr[0];
3181  rdhfcutvars[4] = xyzR125_pr[1];
3182  rdhfcutvars[5] = xyzR125_pr[2];
3183  rdhfcutvars[6] = xyzR125_pi[0];
3184  rdhfcutvars[7] = xyzR125_pi[1];
3185  rdhfcutvars[8] = xyzR125_pi[2];
3186 
3187  Double_t dphis_ele_pr = fAnalCuts->dPhiSR125(xyzR125_ele,xyzR125_pr);
3188  Double_t detas_ele_pr = fAnalCuts->dEtaSR125(xyzR125_ele,xyzR125_pr);
3189  Double_t dphis_ele_pi = fAnalCuts->dPhiSR125(xyzR125_ele,xyzR125_pi);
3190  Double_t detas_ele_pi = fAnalCuts->dEtaSR125(xyzR125_ele,xyzR125_pi);
3191 
3192  //if(mel < 10. && cosoa>0. && fAnalCuts->IsPeakRegion(v0))
3193  if(fAnalCuts->IsSelected(trke,v0,rdhfcutvars,AliRDHFCuts::kCandidate) && fAnalCuts->IsPeakRegion(v0))
3194  {
3195 
3196  if(((int)trke->T())*chargepr>0){
3197  fHistoEleLambdaMassRSMix->Fill(cont);
3198  if(trke->T()>0) fHistoEleLambdaMassRSMix1->Fill(cont);
3199  else fHistoEleLambdaMassRSMix2->Fill(cont);
3200 
3201  fHistoEleLambdaMassvsElePtRSMix->Fill(cont2);
3202  if(trke->T()>0) fHistoEleLambdaMassvsElePtRSMix1->Fill(cont2);
3203  else fHistoEleLambdaMassvsElePtRSMix2->Fill(cont2);
3204  if(cont[0]<2.3){
3205  fHistoElePtRSMix->Fill(trke->Pt(),fCentrality);
3206  fHistoElePtvsEtaRSMix->Fill(cont_eleptvseta);
3207  fHistoElePtvsLambdaPtRSMix->Fill(cont_eleptvslambdapt);
3208  fHistoElePtvsd0RSMix->Fill(cont_eleptvsd0);
3209 
3210  fHistoElePtvsV0dlRSMix->Fill(cont_eleptvsv0dl);
3211  if(trke->T()>0) fHistoElePtvsV0dlRSMix1->Fill(cont_eleptvsv0dl);
3212  else fHistoElePtvsV0dlRSMix2->Fill(cont_eleptvsv0dl);
3213 
3214  fHistoEleLambdaPtvsV0dlRSMix->Fill(cont_elelamptvsv0dl);
3215  if(trke->T()>0) fHistoEleLambdaPtvsV0dlRSMix1->Fill(cont_elelamptvsv0dl);
3216  else fHistoEleLambdaPtvsV0dlRSMix2->Fill(cont_elelamptvsv0dl);
3217 
3218  fHistoElePtvsV0dcaRSMix->Fill(cont_eleptvsv0dca);
3219  if(trke->T()>0) fHistoElePtvsV0dcaRSMix1->Fill(cont_eleptvsv0dca);
3220  else fHistoElePtvsV0dcaRSMix2->Fill(cont_eleptvsv0dca);
3221  }
3222  fHistodPhiSdEtaSElectronProtonR125RSMix->Fill(dphis_ele_pr,detas_ele_pr);
3223  fHistodPhiSdEtaSElectronPionR125RSMix->Fill(dphis_ele_pi,detas_ele_pi);
3224  }else{
3225  fHistoEleLambdaMassWSMix->Fill(cont);
3226  if(trke->T()>0) fHistoEleLambdaMassWSMix1->Fill(cont);
3227  else fHistoEleLambdaMassWSMix2->Fill(cont);
3228 
3229  fHistoEleLambdaMassvsElePtWSMix->Fill(cont2);
3230  if(trke->T()>0) fHistoEleLambdaMassvsElePtWSMix1->Fill(cont2);
3231  else fHistoEleLambdaMassvsElePtWSMix2->Fill(cont2);
3232  if(cont[0]<2.3){
3233  fHistoElePtWSMix->Fill(trke->Pt(),fCentrality);
3234  fHistoElePtvsEtaWSMix->Fill(cont_eleptvseta);
3235  fHistoElePtvsLambdaPtWSMix->Fill(cont_eleptvslambdapt);
3236  fHistoElePtvsd0WSMix->Fill(cont_eleptvsd0);
3237 
3238  fHistoElePtvsV0dlWSMix->Fill(cont_eleptvsv0dl);
3239  if(trke->T()>0) fHistoElePtvsV0dlWSMix1->Fill(cont_eleptvsv0dl);
3240  else fHistoElePtvsV0dlWSMix2->Fill(cont_eleptvsv0dl);
3241 
3242  fHistoEleLambdaPtvsV0dlWSMix->Fill(cont_elelamptvsv0dl);
3243  if(trke->T()>0) fHistoEleLambdaPtvsV0dlWSMix1->Fill(cont_elelamptvsv0dl);
3244  else fHistoEleLambdaPtvsV0dlWSMix2->Fill(cont_elelamptvsv0dl);
3245 
3246  fHistoElePtvsV0dcaWSMix->Fill(cont_eleptvsv0dca);
3247  if(trke->T()>0) fHistoElePtvsV0dcaWSMix1->Fill(cont_eleptvsv0dca);
3248  else fHistoElePtvsV0dcaWSMix2->Fill(cont_eleptvsv0dca);
3249  }
3250  fHistodPhiSdEtaSElectronProtonR125WSMix->Fill(dphis_ele_pr,detas_ele_pr);
3251  fHistodPhiSdEtaSElectronPionR125WSMix->Fill(dphis_ele_pi,detas_ele_pi);
3252  }
3253  }
3254 
3255  //if(mel < 10. && cosoa<0. && fAnalCuts->IsPeakRegion(v0))
3256  if(mel_flip < 10. && cosoa<0. && fAnalCuts->IsPeakRegion(v0))
3257  {
3258  if(((int)trke->T())*chargepr>0){
3259  fHistoEleLambdaMassRSMixAway->Fill(cont_flip);
3260  if(trke->T()>0) fHistoEleLambdaMassRSMix1Away->Fill(cont_flip);
3261  else fHistoEleLambdaMassRSMix2Away->Fill(cont_flip);
3262  if(cont_flip[0]<2.3){
3263  fHistoEleLambdaPtvsV0dlRSMixAway->Fill(cont_elelamptvsv0dl_flip);
3264  if(trke->T()>0) fHistoEleLambdaPtvsV0dlRSMix1Away->Fill(cont_elelamptvsv0dl_flip);
3265  else fHistoEleLambdaPtvsV0dlRSMix2Away->Fill(cont_elelamptvsv0dl_flip);
3266  }
3267  }else{
3268  fHistoEleLambdaMassWSMixAway->Fill(cont_flip);
3269  if(trke->T()>0) fHistoEleLambdaMassWSMix1Away->Fill(cont_flip);
3270  else fHistoEleLambdaMassWSMix2Away->Fill(cont_flip);
3271  if(cont_flip[0]<2.3){
3272  fHistoEleLambdaPtvsV0dlWSMixAway->Fill(cont_elelamptvsv0dl_flip);
3273  if(trke->T()>0) fHistoEleLambdaPtvsV0dlWSMix1Away->Fill(cont_elelamptvsv0dl_flip);
3274  else fHistoEleLambdaPtvsV0dlWSMix2Away->Fill(cont_elelamptvsv0dl_flip);
3275  }
3276  }
3277  }
3278 
3279  //
3280  // New strategy: Fully analyze correlation
3281  //
3282  for(Int_t iv=0;iv<13;iv++){
3283  fCorrelationVariables[iv] = -9999.;
3284  }
3285 
3286  Double_t cont_cor_nd[7];
3287  for(Int_t iv=0;iv<7;iv++){
3288  cont_cor_nd[iv] = -9999.;
3289  }
3290  Double_t cont_mass_nd[8];
3291  for(Int_t iv=0;iv<8;iv++){
3292  cont_mass_nd[iv] = -9999.;
3293  }
3294 
3295  fCorrelationVariables[0] = v0->Pt();
3296  fCorrelationVariables[1] = trke->Pt();
3297  fCorrelationVariables[2] = TVector2::Phi_mpi_pi(v0->Phi()-trke->Phi());
3298  fCorrelationVariables[3] = v0->Eta()-trke->Eta();
3299  fCorrelationVariables[4] = (*v0vars)[15];
3300  fCorrelationVariables[5] = (*elevars)[5];
3301  fCorrelationVariables[6] = 2;
3302  if(trke->T()>0){
3303  if(chargepr>0) fCorrelationVariables[7] = 0;
3304  else fCorrelationVariables[7] = 2;
3305  }else if(trke->T()<0){
3306  if(chargepr>0) fCorrelationVariables[7] = 1;
3307  else fCorrelationVariables[7] = 3;
3308  }
3309  fCorrelationVariables[8] = (*elevars)[6];
3310  fCorrelationVariables[9] = (*elevars)[7];
3311  fCorrelationVariables[10] = fCentrality;
3312  fCorrelationVariables[11] = sqrt(pxsum*pxsum+pysum*pysum);
3313  fCorrelationVariables[12] = mel;
3314 
3315  cont_cor_nd[0] = sqrt(pxsum*pxsum+pysum*pysum);
3316  cont_cor_nd[1] = TVector2::Phi_mpi_pi(v0->Phi()-trke->Phi());
3317  cont_cor_nd[2] = (*v0vars)[15];
3318  if(trke->T()>0){
3319  if(chargepr>0) cont_cor_nd[3] = 0;
3320  else cont_cor_nd[3] = 2;
3321  }else if(trke->T()<0){
3322  if(chargepr>0) cont_cor_nd[3] = 3;
3323  else cont_cor_nd[3] = 1;
3324  }
3325  cont_cor_nd[4] = fCorrelationVariables[8];
3326  cont_cor_nd[5] = 0;
3327  if(fabs(fCorrelationVariables[9]-1013)<0.001) cont_cor_nd[5] = 7;
3328  if(fabs(fCorrelationVariables[9]-1016)<0.001) cont_cor_nd[5] = 8;
3329  if(fabs(fCorrelationVariables[9]-1019)<0.001) cont_cor_nd[5] = 9;
3330  cont_cor_nd[6] = fCentrality;
3331 
3332  if(fAnalCuts->IsSelected(trke,v0,rdhfcutvars,AliRDHFCuts::kCandidate) && fAnalCuts->IsPeakRegion(v0))
3333  {
3334  if(fWriteVariableTree)
3335  fCorrelationVariablesTree->Fill();
3336 
3337  if(mel<2.3)
3338  fHistoCorrelationVariablesvsEleLambdaPtMix->Fill(cont_cor_nd);
3339  cont_cor_nd[0] = trke->Pt();
3340  fHistoCorrelationVariablesvsElePtMix->Fill(cont_cor_nd);
3341  cont_cor_nd[0] = v0->Pt();
3342  fHistoCorrelationVariablesvsLambdaPtMix->Fill(cont_cor_nd);
3343  }
3344 
3345  cont_mass_nd[0] = mel;
3346  cont_mass_nd[1] = cont_cor_nd[0];
3347  cont_mass_nd[4] = cont_cor_nd[3];
3348  cont_mass_nd[5] = cont_cor_nd[4];
3349  cont_mass_nd[6] = cont_cor_nd[5];
3350  cont_mass_nd[7] = cont_cor_nd[6];
3351 
3352  if(fAnalCuts->IsPeakRegion(v0)) cont_mass_nd[3] = 1;
3353  if(fAnalCuts->IsSideBand(v0)) cont_mass_nd[3] = 0;
3354  if(fAnalCuts->IsSelected(trke,v0,rdhfcutvars,AliRDHFCuts::kCandidate)) cont_mass_nd[2]=1;
3355  if(mel_flip < 10.&& cosoa < 0.) cont_mass_nd[2]=0;
3356  fHistoMassVariablesvsEleLambdaPtMix->Fill(cont_mass_nd);
3357  cont_mass_nd[0] = trke->Pt();
3358  fHistoMassVariablesvsElePtMix->Fill(cont_mass_nd);
3359  cont_mass_nd[0] = v0->Pt();
3360  fHistoMassVariablesvsLambdaPtMix->Fill(cont_mass_nd);
3361 
3362  return;
3363 }
3366 {
3367  //
3369  //
3370 
3371  const char* nameoutput = GetOutputSlot(11)->GetContainer()->GetName();
3372  fSingleVariablesTree = new TTree(nameoutput,"single variables tree");
3373  Int_t nVar = 18;
3374  fCandidateSingleVariables = new Float_t [nVar];
3375  TString * fCandidateVariableNames = new TString[nVar];
3376 
3377  fCandidateVariableNames[ 0]="Px";
3378  fCandidateVariableNames[ 1]="Py";
3379  fCandidateVariableNames[ 2]="Pz";
3380  fCandidateVariableNames[ 3]="Charge";
3381  fCandidateVariableNames[ 4]="LambdaMass";
3382  fCandidateVariableNames[ 5]="Bz";
3383  fCandidateVariableNames[ 6]="Centrality";
3384  fCandidateVariableNames[ 7]="PrimVertZ";
3385  fCandidateVariableNames[ 8]="EvNumber";
3386  fCandidateVariableNames[ 9]="RunNumber";
3387  fCandidateVariableNames[10]="PdgMother";
3388  fCandidateVariableNames[11]="Vars0";//e: dca, L: proper dl
3389  fCandidateVariableNames[12]="Vars1";//e: trk ID, L: trk ID (pos)
3390  fCandidateVariableNames[13]="Vars2";//e: nSigma TPC, L: trk ID (neg)
3391  fCandidateVariableNames[14]="LabMother";
3392  fCandidateVariableNames[15]="PdgGrMother";
3393  fCandidateVariableNames[16]="LabGrMother";
3394  fCandidateVariableNames[17]="EventPlane";
3395 
3396  for (Int_t ivar=0; ivar<nVar; ivar++) {
3397  fSingleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateSingleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
3398  }
3399 
3400  return;
3401 }
3404 {
3405  //
3407  //
3408 
3409  const char* nameoutput = GetOutputSlot(5)->GetContainer()->GetName();
3410  fEleVariablesTree = new TTree(nameoutput,"electron variables tree");
3411  Int_t nVar = 26;
3412  fCandidateEleVariables = new Float_t [nVar];
3413  TString * fCandidateVariableNames = new TString[nVar];
3414 
3415  fCandidateVariableNames[ 0]="ElePx";
3416  fCandidateVariableNames[ 1]="ElePy";
3417  fCandidateVariableNames[ 2]="ElePz";
3418  fCandidateVariableNames[ 3]="TPCChi2overNDF";
3419  fCandidateVariableNames[ 4]="ITSNcls";
3420  fCandidateVariableNames[ 5]="TPCNcls";
3421  fCandidateVariableNames[ 6]="TPCNclsPID";
3422  fCandidateVariableNames[ 7]="TPCNclsRatio";
3423  fCandidateVariableNames[ 8]="d0R";
3424  fCandidateVariableNames[ 9]="d0Z";
3425  fCandidateVariableNames[10]="ITSClusterMap";
3426  fCandidateVariableNames[11]="nSigmaTPCele";
3427  fCandidateVariableNames[12]="nSigmaTOFele";
3428  fCandidateVariableNames[13]="nSigmaTPCpi";
3429  fCandidateVariableNames[14]="nSigmaTPCka";
3430  fCandidateVariableNames[15]="nSigmaTPCpr";
3431  fCandidateVariableNames[16]="EvNumber";
3432  fCandidateVariableNames[17]="EleCharge";
3433  fCandidateVariableNames[18]="ElePdgCode";
3434  fCandidateVariableNames[19]="EleMotherPdgCode";
3435  fCandidateVariableNames[20]="mcelepx";
3436  fCandidateVariableNames[21]="mcelepy";
3437  fCandidateVariableNames[22]="mcelepz";
3438  fCandidateVariableNames[23]="Centrality";
3439  fCandidateVariableNames[24]="PrimVertZ";
3440  fCandidateVariableNames[25]="RunNumber";
3441 
3442  for (Int_t ivar=0; ivar<nVar; ivar++) {
3443  fEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
3444  }
3445 
3446  return;
3447 }
3449 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillElectronROOTObjects(AliAODTrack *trk, AliAODTrack *trkpid, Int_t convtype, Int_t mcetype, AliAODEvent *event, TClonesArray *mcArray)
3450 {
3451  //
3453  //
3454 
3455  if(!trk) return;
3456 
3457  fHistoBachPt->Fill(trk->Pt());
3458  fHistoElectronQovPtvsPhi->Fill(trk->Phi(),(Double_t)trk->Charge()/trk->Pt());
3459 
3460  Double_t d0z0[2],covd0z0[3];
3461  trk->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);
3462 
3463  if(fDoEventMixing){
3464  Double_t pv[3];
3465  pv[0] = fVtx1->GetX();
3466  pv[1] = fVtx1->GetY();
3467  pv[2] = fVtx1->GetZ();
3468  Double_t xyzR125[3]={9999.,9999.,9999.};
3469  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(trk,fBzkG,pv,xyzR125);
3470  TVector *varvec = new TVector(8);
3471  (*varvec)[0] = xyzR125[0];
3472  (*varvec)[1] = xyzR125[1];
3473  (*varvec)[2] = xyzR125[2];
3474  (*varvec)[3] = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kElectron);
3475  (*varvec)[4] = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kElectron);
3476  (*varvec)[5] = d0z0[0];
3477  (*varvec)[6] = convtype;
3478  (*varvec)[7] = mcetype;
3479 
3480  Int_t nextRes( nextResVec[fPoolIndex] );
3481  m_ReservoirE[fPoolIndex][nextRes].push_back(new TLorentzVector(trk->Px(),trk->Py(),trk->Pz(),trk->Charge()));
3482  m_ReservoirVarsE[fPoolIndex][nextRes].push_back(varvec);
3483  }
3484 
3485  if(!fWriteEachVariableTree) return;
3486 
3487  Int_t pdgEle = -9999;
3488  Int_t pdgEleMother = -9999;
3489  Float_t mcelepx = -9999;
3490  Float_t mcelepy = -9999;
3491  Float_t mcelepz = -9999;
3492  Int_t pdgarray_ele[100], labelarray_ele[100], ngen_ele;//for write eavh variables tree
3493  if(fUseMCInfo)
3494  {
3495  Int_t labEle = trk->GetLabel();
3496  if(labEle<0) return;
3497  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
3498  if(!mcetrk) return;
3499  pdgEle = mcetrk->GetPdgCode();
3500  mcelepx = mcetrk->Px();
3501  mcelepy = mcetrk->Py();
3502  mcelepz = mcetrk->Pz();
3503 
3504  Int_t labEleMother = mcetrk->GetMother();
3505  if(labEleMother>-1){
3506  AliAODMCParticle *mcemothertrk = (AliAODMCParticle*)mcArray->At(labEle);
3507  if(mcemothertrk){
3508  pdgEleMother = mcemothertrk->GetPdgCode();
3509  }
3510  }
3511 
3512  if(abs(pdgEle)==11){
3513  GetMCDecayHistory(mcetrk,mcArray,pdgarray_ele,labelarray_ele,ngen_ele);
3514  }else{
3515  for(Int_t i=0;i<100;i++){
3516  pdgarray_ele[i]=-9999;
3517  labelarray_ele[i]=-9999;
3518  }
3519  ngen_ele=-9999;
3520  }
3521  }
3522 
3523  //test propagation
3524 // cout<<"B: "<<fBzkG<<endl;
3525 // cout<<"trk: "<<trk->Charge()<<" "<<trk->Px()<<" "<<trk->Py()<<" "<<trk->Pz()<<endl;
3526 // AliExternalTrackParam etp;
3527 // etp.CopyFromVTrack(trk);
3528 // Double_t xyz_test[3]={-9999.,-9999.,-9999.};
3529 // etp.GetXYZ(xyz_test);
3530 // cout<<"Before: "<<xyz_test[0]<<" "<<xyz_test[1]<<" "<<xyz_test[2]<<endl;
3531 // etp.PropagateTo(80.,(Float_t)fBzkG);
3532 // etp.GetXYZ(xyz_test); // GetXYZ returns global coordinates
3533 // cout<<"After: "<<xyz_test[0]<<" "<<xyz_test[1]<<" "<<xyz_test[2]<<endl;
3534 
3535  for(Int_t i=0;i<26;i++){
3536  fCandidateEleVariables[i] = -9999.;
3537  }
3538  for(Int_t i=0;i<18;i++){
3539  fCandidateSingleVariables[i] = -9999.;
3540  }
3541  fCandidateSingleVariables[ 0] = trk->Px();
3542  fCandidateSingleVariables[ 1] = trk->Py();
3543  fCandidateSingleVariables[ 2] = trk->Pz();
3544  fCandidateSingleVariables[ 3] = trk->Charge();
3545  fCandidateSingleVariables[ 4] = -9999.;//not lambda
3551  fCandidateSingleVariables[11] = d0z0[0];
3552  fCandidateSingleVariables[12] = trk->GetID();
3553  if(fAnalCuts->GetIsUsePID())
3554  {
3555  Double_t nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
3556  Double_t nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
3557  fCandidateSingleVariables[13] = nSigmaTPCele;
3558  }
3559  if(fUseMCInfo){
3560  fCandidateSingleVariables[10] = pdgarray_ele[0];
3561  fCandidateSingleVariables[14] = labelarray_ele[0];
3562  fCandidateSingleVariables[15] = pdgarray_ele[1];
3563  fCandidateSingleVariables[16] = labelarray_ele[1];
3564  }
3566 
3567  fSingleVariablesTree->Fill();
3568 
3569 // fCandidateEleVariables[ 0] = trk->Px();
3570 // fCandidateEleVariables[ 1] = trk->Py();
3571 // fCandidateEleVariables[ 2] = trk->Pz();
3572 // fCandidateEleVariables[ 3] = trk->Chi2perNDF();
3573 // fCandidateEleVariables[ 4] = trk->GetITSNcls();
3574 // fCandidateEleVariables[ 5] = trk->GetTPCncls();
3575 // fCandidateEleVariables[ 6] = trk->GetTPCsignalN();
3576 // if(trk->GetTPCNclsF()>0)
3577 // fCandidateEleVariables[ 7] = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
3578 //
3579 // fCandidateEleVariables[ 8] = d0z0[0];
3580 // fCandidateEleVariables[ 9] = d0z0[1];
3581 // Int_t itsmap = trk->GetITSClusterMap();
3582 // Int_t bit1 = 1;
3583 // Int_t bit2 = 2;
3584 // Bool_t spdfirst = (itsmap & bit1) == bit1;
3585 // Bool_t spdsecond = (itsmap & bit2) == bit2;
3586 // fCandidateEleVariables[10] = ((Int_t)spdfirst) + 2 * ((Int_t)spdsecond);
3587 //
3588 // if(fAnalCuts->GetIsUsePID())
3589 // {
3590 // Double_t nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
3591 // Double_t nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
3592 // Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
3593 // Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
3594 // Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
3595 // fCandidateEleVariables[11] = nSigmaTPCele;
3596 // fCandidateEleVariables[12] = nSigmaTOFele;
3597 // fCandidateEleVariables[13] = nSigmaTPCpi_etrk;
3598 // fCandidateEleVariables[14] = nSigmaTPCka_etrk;
3599 // fCandidateEleVariables[15] = nSigmaTPCpr_etrk;
3600 // }
3601 // fCandidateEleVariables[16] = fEvNumberCounter;
3602 // fCandidateEleVariables[17] = trk->Charge();
3603 // fCandidateEleVariables[18] = pdgEle;
3604 // fCandidateEleVariables[19] = pdgEleMother;
3605 // fCandidateEleVariables[20] = mcelepx;
3606 // fCandidateEleVariables[21] = mcelepy;
3607 // fCandidateEleVariables[22] = mcelepz;
3608 // fCandidateEleVariables[23] = fCentrality;
3609 // fCandidateEleVariables[24] = fVtxZ;
3610 // fCandidateEleVariables[25] = fRunNumber;
3611 //
3612 // fHistod0Bach->Fill(d0z0[0]);
3613 //
3614 // fEleVariablesTree->Fill();
3615 }
3618 {
3619  //
3621  //
3622 
3623  const char* nameoutput = GetOutputSlot(6)->GetContainer()->GetName();
3624  fV0VariablesTree = new TTree(nameoutput,"v0 variables tree");
3625  Int_t nVar = 36;
3626  fCandidateV0Variables = new Float_t [nVar];
3627  TString * fCandidateVariableNames = new TString[nVar];
3628 
3629  fCandidateVariableNames[ 0]="V0Px";
3630  fCandidateVariableNames[ 1]="V0Py";
3631  fCandidateVariableNames[ 2]="V0Pz";
3632  fCandidateVariableNames[ 3]="MassLambda";
3633  fCandidateVariableNames[ 4]="MassAntiLambda";
3634  fCandidateVariableNames[ 5]="ProtonPx";
3635  fCandidateVariableNames[ 6]="ProtonPy";
3636  fCandidateVariableNames[ 7]="ProtonPz";
3637  fCandidateVariableNames[ 8]="PionPx";
3638  fCandidateVariableNames[ 9]="PionPy";
3639  fCandidateVariableNames[10]="PionPz";
3640  fCandidateVariableNames[11]="RfidV0";
3641  fCandidateVariableNames[12]="DcaV0PrToPrimVertex";
3642  fCandidateVariableNames[13]="DcaV0PiToPrimVertex";
3643  fCandidateVariableNames[14]="DcaV0daughters";
3644  fCandidateVariableNames[15]="V0CosPointingAngle";
3645  fCandidateVariableNames[16]="V0ProperDecayLength";
3646  fCandidateVariableNames[17]="MassK0Short";
3647  fCandidateVariableNames[18]="nSigmaTPCpr";
3648  fCandidateVariableNames[19]="nSigmaTPCpi";
3649  fCandidateVariableNames[20]="TPCNCrossV0Pr";
3650  fCandidateVariableNames[21]="TPCNCrossV0Pi";
3651  fCandidateVariableNames[22]="TPCNCrossRatioV0Pr";
3652  fCandidateVariableNames[23]="TPCNCrossRatioV0Pi";
3653  fCandidateVariableNames[24]="V0PdgCode";
3654  fCandidateVariableNames[25]="V0MotherPdgCode";
3655  fCandidateVariableNames[26]="mcv0px";
3656  fCandidateVariableNames[27]="mcv0py";
3657  fCandidateVariableNames[28]="mcv0pz";
3658  fCandidateVariableNames[29]="mcv0vertx";
3659  fCandidateVariableNames[30]="mcv0verty";
3660  fCandidateVariableNames[31]="mcv0vertz";
3661  fCandidateVariableNames[32]="EvNumber";
3662  fCandidateVariableNames[33]="Centrality";
3663  fCandidateVariableNames[34]="PrimVertZ";
3664  fCandidateVariableNames[35]="RunNumber";
3665 
3666  for (Int_t ivar=0; ivar<nVar; ivar++) {
3667  fV0VariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateV0Variables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
3668  }
3669 
3670  return;
3671 }
3672 
3674 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillV0ROOTObjects(AliAODv0 *v0, TClonesArray *mcArray)
3675 {
3676  //
3678  //
3679  if(!v0) return;
3680  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
3681  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
3682  if(!cptrack) return;
3683  if(!cntrack) return;
3684 // if(cptrack->Charge()<0 && cntrack->Charge()>0){
3685 // cptrack = (AliAODTrack*)(v0->GetDaughter(1));
3686 // cntrack = (AliAODTrack*)(v0->GetDaughter(0));
3687 // }
3688  //test propagation
3689 // cout<<"B: "<<fBzkG<<endl;
3690 // cout<<"trk: "<<cptrack->Charge()<<" "<<v0->MomPosX()<<" "<<v0->MomPosY()<<" "<<v0->MomPosZ()<<endl;
3691 // cout<<"vert: "<<v0->DecayVertexV0X()<<" "<<v0->DecayVertexV0Y()<<" "<<v0->DecayVertexV0Z()<<endl;
3692 // AliExternalTrackParam etp;
3693 // etp.CopyFromVTrack(cptrack);
3694 // Double_t xyz_test[3]={-9999.,-9999.,-9999.};
3695 // etp.PropagateTo(10.,(Float_t)fBzkG);
3696 // etp.GetXYZ(xyz_test); // GetXYZ returns global coordinates
3697 // cout<<"10: "<<xyz_test[0]<<" "<<xyz_test[1]<<" "<<xyz_test[2]<<endl;
3698 // etp.PropagateTo(120.,(Float_t)fBzkG);
3699 // etp.GetXYZ(xyz_test); // GetXYZ returns global coordinates
3700 // cout<<"120: "<<xyz_test[0]<<" "<<xyz_test[1]<<" "<<xyz_test[2]<<endl;
3701 
3702  Double_t mlamPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
3703  Double_t posVtx[3] = {0.,0.,0.};
3704  fVtx1->GetXYZ(posVtx);
3705  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
3706  Double_t v0propdl = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
3707  Double_t cont_arm[3];
3708  cont_arm[0] = v0->Pt();
3709  cont_arm[1] = v0->PtArmV0();
3710  cont_arm[2] = v0->AlphaV0();
3711 
3712  if(TMath::Abs(v0->MassLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
3713  fHistoLambdaMassvsPt->Fill(v0->MassLambda(),v0->Pt());
3714  }
3715  if(TMath::Abs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
3716  fHistoLambdaMassvsPt->Fill(v0->MassAntiLambda(),v0->Pt());
3717  }
3718  fHistoK0sMassvsPt->Fill(v0->MassK0Short(),v0->Pt());
3719 
3720  if(fAnalCuts->IsPeakRegion(v0)){
3721  fHistoLambdaPtvsDl->Fill(v0->Pt(),v0propdl);
3722  fHistoLambdaPtvsEta->Fill(v0->Pt(),v0->Eta());
3723  fHistoLambdaArmenteros->Fill(cont_arm);
3724  }
3725  if(fAnalCuts->IsSideBand(v0)){
3726  fHistoLambdaPtvsDlSide->Fill(v0->Pt(),v0propdl);
3727  }
3728 
3729  Double_t momv0x = v0->MomV0X();
3730  Double_t momv0y = v0->MomV0Y();
3731  Double_t phi_alice = atan2(momv0y,momv0x);
3732  if(phi_alice<0.) phi_alice += 2 * M_PI;
3733  fHistoLambdaQovPtvsPhi->Fill(phi_alice,1./sqrt(momv0x*momv0x+momv0y*momv0y));
3734 
3735  if(fDoEventMixing){
3736  Int_t nextRes( nextResVec[fPoolIndex] );
3737  Double_t posVtx[3] = {0.,0.,0.};
3738  fVtx1->GetXYZ(posVtx);
3739  TLorentzVector *lv = new TLorentzVector();
3740  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
3741  Double_t xyzR125pr[3] = {9999.,9999.,9999.};
3742  Double_t xyzR125pi[3] = {9999.,9999.,9999.};
3743  if(TMath::Abs(v0->MassLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
3744  lv->SetXYZM(v0->Px(),v0->Py(),v0->Pz(),v0->MassLambda());
3745  m_ReservoirL1[fPoolIndex][nextRes].push_back(lv);
3746  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(cptrack,fBzkG,posVtx,xyzR125pr);
3747  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(cntrack,fBzkG,posVtx,xyzR125pi);
3748  TVector *varvec = new TVector(17);
3749  (*varvec)[0] = xyzR125pr[0];
3750  (*varvec)[1] = xyzR125pr[1];
3751  (*varvec)[2] = xyzR125pr[2];
3752  (*varvec)[3] = xyzR125pi[0];
3753  (*varvec)[4] = xyzR125pi[1];
3754  (*varvec)[5] = xyzR125pi[2];
3755  (*varvec)[6] = v0->DecayVertexV0X();
3756  (*varvec)[7] = v0->DecayVertexV0Y();
3757  (*varvec)[8] = v0->DecayVertexV0Z();
3758  (*varvec)[9] = v0->MomPosX();
3759  (*varvec)[10] = v0->MomPosY();
3760  (*varvec)[11] = v0->MomPosZ();
3761  (*varvec)[12] = v0->MomNegX();
3762  (*varvec)[13] = v0->MomNegY();
3763  (*varvec)[14] = v0->MomNegZ();
3764  (*varvec)[15] = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
3765  (*varvec)[16] = v0->DcaV0ToPrimVertex();
3766  m_ReservoirVarsL1[fPoolIndex][nextRes].push_back(varvec);
3767  }else{
3768  lv->SetXYZM(v0->Px(),v0->Py(),v0->Pz(),v0->MassAntiLambda());
3769  m_ReservoirL2[fPoolIndex][nextRes].push_back(lv);
3770  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(cntrack,fBzkG,posVtx,xyzR125pr);
3771  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(cptrack,fBzkG,posVtx,xyzR125pi);
3772  TVector *varvec = new TVector(17);
3773  (*varvec)[0] = xyzR125pr[0];
3774  (*varvec)[1] = xyzR125pr[1];
3775  (*varvec)[2] = xyzR125pr[2];
3776  (*varvec)[3] = xyzR125pi[0];
3777  (*varvec)[4] = xyzR125pi[1];
3778  (*varvec)[5] = xyzR125pi[2];
3779  (*varvec)[6] = v0->DecayVertexV0X();
3780  (*varvec)[7] = v0->DecayVertexV0Y();
3781  (*varvec)[8] = v0->DecayVertexV0Z();
3782  (*varvec)[9] = v0->MomNegX();
3783  (*varvec)[10] = v0->MomNegY();
3784  (*varvec)[11] = v0->MomNegZ();
3785  (*varvec)[12] = v0->MomPosX();
3786  (*varvec)[13] = v0->MomPosY();
3787  (*varvec)[14] = v0->MomPosZ();
3788  (*varvec)[15] = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
3789  (*varvec)[16] = v0->DcaV0ToPrimVertex();
3790  m_ReservoirVarsL2[fPoolIndex][nextRes].push_back(varvec);
3791  }
3792  }
3793 
3794  if(!fWriteEachVariableTree) return;
3795 
3796  Int_t v0pdgcode = -9999;
3797  Int_t v0motherpdgcode = -9999;
3798  Float_t mcv0px = -9999;
3799  Float_t mcv0py = -9999;
3800  Float_t mcv0pz = -9999;
3801  Float_t mcv0vertx = -9999;
3802  Float_t mcv0verty = -9999;
3803  Float_t mcv0vertz = -9999;
3804  Int_t pdgarray_v0[100], labelarray_v0[100], ngen_v0;//for write eavh variables tree
3805  if(fUseMCInfo)
3806  {
3807  Int_t pdgdgv0[2]={2212,211};
3808  Int_t labV0 = v0->MatchToMC(3122,mcArray,2,pdgdgv0); // the V0
3809  if(labV0>=0){
3810  if(TMath::Abs(v0->MassLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
3811  fHistoLambdaMassvsPtMCS->Fill(v0->MassLambda(),v0->Pt());
3812  }
3813  if(TMath::Abs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
3814  fHistoLambdaMassvsPtMCS->Fill(v0->MassAntiLambda(),v0->Pt());
3815  }
3816  if(fAnalCuts->IsPeakRegion(v0)){
3817  fHistoLambdaPtvsEtaMCS->Fill(v0->Pt(),v0->Eta());
3818  fHistoLambdaArmenterosMCS->Fill(cont_arm);
3819  }
3820  }
3821  if(labV0<0) return;
3822  AliAODMCParticle *mcv0trk = (AliAODMCParticle*)mcArray->At(labV0);
3823  if(!mcv0trk) return;
3824 
3825  if(mcv0trk){
3826  GetMCDecayHistory(mcv0trk,mcArray,pdgarray_v0,labelarray_v0,ngen_v0);
3827  }else{
3828  for(Int_t i=0;i<100;i++){
3829  pdgarray_v0[i] = -9999;
3830  labelarray_v0[i] = -9999;
3831  }
3832  ngen_v0 = -9999;
3833  }
3834 
3835  Bool_t hfv0_flag = kFALSE;
3836  Bool_t promptv0_flag = kFALSE;
3837  v0pdgcode = mcv0trk->GetPdgCode();
3838  Int_t labv0mother = mcv0trk->GetMother();
3839  if(labv0mother>=0){
3840  AliAODMCParticle *motherv0 = (AliAODMCParticle*)mcArray->At(labv0mother);
3841  if(motherv0){
3842  v0motherpdgcode = motherv0->GetPdgCode();
3843  if(abs(v0motherpdgcode)>4000&&abs(v0motherpdgcode)<4400){
3844  hfv0_flag = kTRUE;
3845  }
3846  if(abs(v0motherpdgcode)==3322){
3847  fHistoLambdaPtvsDlFeeddownXi0MCS->Fill(v0->Pt(),v0propdl);
3848  }else if(abs(v0motherpdgcode)==3312){
3849  fHistoLambdaPtvsDlFeeddownXiMinusMCS->Fill(v0->Pt(),v0propdl);
3850  }else if(abs(v0motherpdgcode)==3334){
3851  fHistoLambdaPtvsDlFeeddownOmegaMCS->Fill(v0->Pt(),v0propdl);
3852  }else{
3853  fHistoLambdaPtvsDlMCS->Fill(v0->Pt(),v0propdl);
3854  promptv0_flag = kTRUE;
3855  }
3856  }
3857  }
3858  //if(!hfv0_flag) return;
3859  //if(!promptv0_flag) return;
3860 
3861  mcv0px = mcv0trk->Px();
3862  mcv0py = mcv0trk->Py();
3863  mcv0pz = mcv0trk->Pz();
3864 
3865  Int_t labptrk = cptrack->GetLabel();
3866  if(labptrk>=0){
3867  AliAODMCParticle *mcv0ptrk = (AliAODMCParticle*)mcArray->At(labptrk);
3868  if(mcv0ptrk){
3869  mcv0vertx = mcv0ptrk->Xv();
3870  mcv0verty = mcv0ptrk->Yv();
3871  mcv0vertz = mcv0ptrk->Zv();
3872  }
3873  }
3874  }
3875 
3876  for(Int_t i=0;i<36;i++){
3877  fCandidateV0Variables[i] = -9999.;
3878  }
3879 
3880  for(Int_t i=0;i<18;i++){
3881  fCandidateSingleVariables[i] = -9999.;
3882  }
3883 
3884  Bool_t isparticle = kFALSE;
3885  if(TMath::Abs(v0->MassLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
3886  isparticle = kTRUE;
3887  }
3888 
3889  fCandidateSingleVariables[ 0] = v0->Px();
3890  fCandidateSingleVariables[ 1] = v0->Py();
3891  fCandidateSingleVariables[ 2] = v0->Pz();
3892  if(isparticle){
3893  fCandidateSingleVariables[ 3] = 1.;
3894  fCandidateSingleVariables[ 4] = v0->MassLambda();
3895  }else{
3896  fCandidateSingleVariables[ 3] = -1.;
3897  fCandidateSingleVariables[ 4] = v0->MassAntiLambda();
3898  }
3904  //fCandidateSingleVariables[10] = v0motherpdgcode;
3905  fCandidateSingleVariables[11] = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
3906  fCandidateSingleVariables[12] = cptrack->GetID();
3907  fCandidateSingleVariables[13] = cntrack->GetID();
3908  if(fUseMCInfo){
3909  fCandidateSingleVariables[10] = pdgarray_v0[0];
3910  fCandidateSingleVariables[14] = labelarray_v0[0];
3911  fCandidateSingleVariables[15] = pdgarray_v0[1];
3912  fCandidateSingleVariables[16] = labelarray_v0[1];
3913  }
3915 
3916  fSingleVariablesTree->Fill();
3917 // fCandidateV0Variables[ 0] = v0->Px();
3918 // fCandidateV0Variables[ 1] = v0->Py();
3919 // fCandidateV0Variables[ 2] = v0->Pz();
3920 // fCandidateV0Variables[ 3] = v0->MassLambda();
3921 // fCandidateV0Variables[ 4] = v0->MassAntiLambda();
3922 //
3923 // Bool_t isparticle = kTRUE;
3924 // if(fabs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()) isparticle=kFALSE;
3925 //
3926 // if(isparticle){
3927 // fCandidateV0Variables[ 5] = v0->MomPosX(); //cptrack->Px();
3928 // fCandidateV0Variables[ 6] = v0->MomPosY(); //cptrack->Py();
3929 // fCandidateV0Variables[ 7] = v0->MomPosZ(); //cptrack->Pz();
3930 // fCandidateV0Variables[ 8] = v0->MomNegX(); //cntrack->Px();
3931 // fCandidateV0Variables[ 9] = v0->MomNegY(); //cntrack->Py();
3932 // fCandidateV0Variables[10] = v0->MomNegZ(); //cntrack->Pz();
3933 // }else{
3934 // fCandidateV0Variables[ 5] = v0->MomNegX(); //cntrack->Px();
3935 // fCandidateV0Variables[ 6] = v0->MomNegY(); //cntrack->Py();
3936 // fCandidateV0Variables[ 7] = v0->MomNegZ(); //cntrack->Pz();
3937 // fCandidateV0Variables[ 8] = v0->MomPosX(); //cptrack->Px();
3938 // fCandidateV0Variables[ 9] = v0->MomPosY(); //cptrack->Py();
3939 // fCandidateV0Variables[10] = v0->MomPosZ(); //cptrack->Pz();
3940 // }
3941 //
3942 // Double_t lPosV0[3];
3943 // lPosV0[0] = v0->DecayVertexV0X();
3944 // lPosV0[1] = v0->DecayVertexV0Y();
3945 // lPosV0[2] = v0->DecayVertexV0Z();
3946 // Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
3947 // fCandidateV0Variables[11] = decayvertV0;
3948 //
3949 // Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
3950 // Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
3951 // if(isparticle){
3952 // fCandidateV0Variables[12] = lDcaPosToPrimVertex;
3953 // fCandidateV0Variables[13] = lDcaNegToPrimVertex;
3954 // }else{
3955 // fCandidateV0Variables[12] = lDcaNegToPrimVertex;
3956 // fCandidateV0Variables[13] = lDcaPosToPrimVertex;
3957 // }
3958 // fCandidateV0Variables[14] = v0->DcaV0Daughters();
3959 // fCandidateV0Variables[15] = v0->CosPointingAngle(posVtx);
3960 // fCandidateV0Variables[16] = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
3961 // fCandidateV0Variables[17] = v0->MassK0Short();
3962 //
3963 // if(fAnalCuts->GetUseLambdaPID())
3964 // {
3965 // if(isparticle){
3966 // Double_t nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
3967 // Double_t nSigmaTPCv0pi = fAnalCuts->GetPidPion()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
3968 // fCandidateV0Variables[18] = nSigmaTPCv0pr;
3969 // fCandidateV0Variables[19] = nSigmaTPCv0pi;
3970 // }else{
3971 // Double_t nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
3972 // Double_t nSigmaTPCv0pi = fAnalCuts->GetPidPion()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
3973 // fCandidateV0Variables[18] = nSigmaTPCv0pr;
3974 // fCandidateV0Variables[19] = nSigmaTPCv0pi;
3975 // }
3976 // }
3977 // if(isparticle){
3978 // fCandidateV0Variables[20] = cptrack->GetTPCClusterInfo(2,1);
3979 // fCandidateV0Variables[21] = cntrack->GetTPCClusterInfo(2,1);
3980 // if(cptrack->GetTPCNclsF()>0)
3981 // fCandidateV0Variables[22] = (Float_t) cptrack->GetTPCClusterInfo(2,1)/(Float_t)cptrack->GetTPCNclsF();
3982 // if(cntrack->GetTPCNclsF()>0)
3983 // fCandidateV0Variables[23] =(Float_t) cntrack->GetTPCClusterInfo(2,1)/(Float_t)cntrack->GetTPCNclsF();
3984 // }else{
3985 // fCandidateV0Variables[20] = cntrack->GetTPCClusterInfo(2,1);
3986 // fCandidateV0Variables[21] = cptrack->GetTPCClusterInfo(2,1);
3987 // if(cntrack->GetTPCNclsF()>0)
3988 // fCandidateV0Variables[22] = (Float_t) cntrack->GetTPCClusterInfo(2,1)/(Float_t)cntrack->GetTPCNclsF();
3989 // if(cptrack->GetTPCNclsF()>0)
3990 // fCandidateV0Variables[23] = (Float_t) cptrack->GetTPCClusterInfo(2,1)/(Float_t)cptrack->GetTPCNclsF();
3991 // }
3992 // fCandidateV0Variables[24] = v0pdgcode;
3993 // fCandidateV0Variables[25] = v0motherpdgcode;
3994 // fCandidateV0Variables[26] = mcv0px;
3995 // fCandidateV0Variables[27] = mcv0py;
3996 // fCandidateV0Variables[28] = mcv0pz;
3997 // fCandidateV0Variables[29] = mcv0vertx;
3998 // fCandidateV0Variables[30] = mcv0verty;
3999 // fCandidateV0Variables[31] = mcv0vertz;
4000 // fCandidateV0Variables[32] = fEvNumberCounter;
4001 // fCandidateV0Variables[33] = fCentrality;
4002 // fCandidateV0Variables[34] = fVtxZ;
4003 // fCandidateV0Variables[35] = fRunNumber;
4004 //
4005 //
4006 // fV0VariablesTree->Fill();
4007 }
4010 {
4014 
4015  const char* nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
4016  fMCVariablesTree = new TTree(nameoutput,"MC variables tree");
4017  Int_t nVar = 11;
4018  fCandidateMCVariables = new Float_t [nVar];
4019  TString * fCandidateVariableNames = new TString[nVar];
4020 
4021  fCandidateVariableNames[ 0]="Centrality";
4022  fCandidateVariableNames[ 1]="DecayType";
4023  fCandidateVariableNames[ 2]="LcPx";
4024  fCandidateVariableNames[ 3]="LcPy";
4025  fCandidateVariableNames[ 4]="LcPz";
4026  fCandidateVariableNames[ 5]="ElePx";
4027  fCandidateVariableNames[ 6]="ElePy";
4028  fCandidateVariableNames[ 7]="ElePz";
4029  fCandidateVariableNames[ 8]="V0Px";
4030  fCandidateVariableNames[ 9]="V0Py";
4031  fCandidateVariableNames[10]="V0Pz";
4032 
4033  for (Int_t ivar=0; ivar<nVar; ivar++) {
4034  fMCVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
4035  }
4036  return;
4037 }
4039 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCROOTObjects(AliAODMCParticle *mcpart, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype)
4040 {
4041  //
4043  //
4044  if(!mcpart) return;
4045  if(!mcepart) return;
4046  if(!mcv0part) return;
4047 
4048  for(Int_t i=0;i<11;i++){
4049  fCandidateMCVariables[i] = -9999.;
4050  }
4051 
4053  fCandidateMCVariables[ 1] = (Float_t) decaytype;
4054  fCandidateMCVariables[ 2] = mcpart->Px();
4055  fCandidateMCVariables[ 3] = mcpart->Py();
4056  fCandidateMCVariables[ 4] = mcpart->Pz();
4057  fCandidateMCVariables[ 5] = mcepart->Px();
4058  fCandidateMCVariables[ 6] = mcepart->Py();
4059  fCandidateMCVariables[ 7] = mcepart->Pz();
4060  fCandidateMCVariables[ 8] = mcv0part->Px();
4061  fCandidateMCVariables[ 9] = mcv0part->Py();
4062  fCandidateMCVariables[10] = mcv0part->Pz();
4063 
4064  Double_t epx = mcepart->Px();
4065  Double_t epy = mcepart->Py();
4066  Double_t epz = mcepart->Pz();
4067  Double_t eE = sqrt(epx*epx+epy*epy+epz*epz+0.000511*0.000511);
4068  Double_t v0px = mcv0part->Px();
4069  Double_t v0py = mcv0part->Py();
4070  Double_t v0pz = mcv0part->Pz();
4071  Double_t v0E = sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz+1.1157*1.1157);
4072 
4073  Double_t InvMassEleLambda = sqrt(pow(eE+v0E,2)-pow(epx+v0px,2)-pow(epy+v0py,2)-pow(epz+v0pz,2));
4074 
4075  Double_t cont[3];
4076  cont[0] = InvMassEleLambda;
4077  cont[1] = mcpart->Pt();
4078  cont[2] = fCentrality;
4079  Double_t cont2[3];
4080  cont2[0] = InvMassEleLambda;
4081  cont2[1] = mcepart->Pt();
4082  cont2[2] = fCentrality;
4083  Double_t cont_eleptvseta[3];
4084  cont_eleptvseta[0] = mcepart->Pt();
4085  cont_eleptvseta[1] = mcepart->Eta();
4086  cont_eleptvseta[2] = fCentrality;
4087  Double_t cont_eleptvslambdapt[3];
4088  cont_eleptvslambdapt[0] = mcepart->Pt();
4089  cont_eleptvslambdapt[1] = mcv0part->Pt();
4090  cont_eleptvslambdapt[2] = fCentrality;
4091  Double_t cont_eleptvslambdaptvslcpt[4];
4092  cont_eleptvslambdaptvslcpt[0] = mcepart->Pt();
4093  cont_eleptvslambdaptvslcpt[1] = mcv0part->Pt();
4094  cont_eleptvslambdaptvslcpt[2] = mcpart->Pt();
4095  cont_eleptvslambdaptvslcpt[3] = fCentrality;
4096  Double_t contmc[3];
4097  contmc[0] = mcpart->Pt();
4098  contmc[1] = mcpart->Y();
4099  contmc[2] = fCentrality;
4100  Double_t contmcele[3];
4101  contmcele[0] = mcepart->Pt();
4102  contmcele[1] = mcepart->Eta();
4103  contmcele[2] = fCentrality;
4104  Double_t contmc_withele[3];
4105  contmc_withele[0] = mcpart->Pt();
4106  contmc_withele[1] = mcpart->Y();
4107  contmc_withele[2] = mcepart->Y();
4108 
4109  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
4110  Float_t etamin, etamax;
4111  esdcuts->GetEtaRange(etamin,etamax);
4112 
4113  if(decaytype==0){
4114  fHistoLcMCGen->Fill(contmc);
4115  if(mcpart->GetPdgCode()>0) fHistoLcMCGen1->Fill(contmc);
4116  if(mcpart->GetPdgCode()<0) fHistoLcMCGen2->Fill(contmc);
4117  fHistoLcMCGenWithEleA->Fill(contmc_withele);
4118  if(fabs(mcepart->Eta())<0.8){
4119  fHistoLcMCGenWithEleB->Fill(mcpart->Pt(),mcepart->Pt());
4120  }
4121  fHistoLcElectronMCGen->Fill(contmcele);
4122  if(mcepart->GetPdgCode()<0) fHistoLcElectronMCGen1->Fill(contmcele);
4123  if(mcepart->GetPdgCode()>0) fHistoLcElectronMCGen2->Fill(contmcele);
4124  fHistoEleLambdaMassMCGen->Fill(cont);
4125  if(fabs(mcepart->Eta())<etamax){
4126  fHistoEleLambdaMassvsElePtMCGen->Fill(cont2);
4127  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtMCGen1->Fill(cont2);
4128  else fHistoEleLambdaMassvsElePtMCGen2->Fill(cont2);
4129  if(InvMassEleLambda<2.3){
4130  fHistoElePtMCGen->Fill(mcepart->Pt(),fCentrality);
4131  fHistoElePtvsEtaMCGen->Fill(cont_eleptvseta);
4132  fHistoElePtvsLambdaPtMCGen->Fill(cont_eleptvslambdapt);
4133  }
4134  }
4135  if(fabs(mcpart->Y())<0.7){
4136  if(InvMassEleLambda<2.3){
4137  fHistoElePtvsLambdaPtMCLcGen->Fill(cont_eleptvslambdapt);
4138  fHistoElePtvsLambdaPtvsLcPtMCGen->Fill(cont_eleptvslambdaptvslcpt);
4139  }
4140  }
4141  }else if(decaytype==1){
4142  fHistoFeedDownXic0MCGen->Fill(contmc);
4143  if(mcpart->GetPdgCode()>0) fHistoFeedDownXic0MCGen1->Fill(contmc);
4144  if(mcpart->GetPdgCode()<0) fHistoFeedDownXic0MCGen2->Fill(contmc);
4146  fHistoElectronFeedDownXic0MCGen->Fill(contmcele);
4147  if(mcepart->GetPdgCode()<0) fHistoElectronFeedDownXic0MCGen1->Fill(contmcele);
4148  if(mcepart->GetPdgCode()>0) fHistoElectronFeedDownXic0MCGen2->Fill(contmcele);
4149  if(fabs(mcepart->Eta())<etamax){
4151  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1->Fill(cont2);
4153  if(InvMassEleLambda<2.3){
4154  fHistoElePtFeeddownXic0MCGen->Fill(mcepart->Pt(),fCentrality);
4155  fHistoElePtvsEtaFeeddownXic0MCGen->Fill(cont_eleptvseta);
4156  fHistoElePtvsLambdaPtFeeddownXic0MCGen->Fill(cont_eleptvslambdapt);
4157  }
4158  }
4159  }else if(decaytype==2){
4160  fHistoFeedDownXicPlusMCGen->Fill(contmc);
4161  if(mcpart->GetPdgCode()>0) fHistoFeedDownXicPlusMCGen1->Fill(contmc);
4162  if(mcpart->GetPdgCode()<0) fHistoFeedDownXicPlusMCGen2->Fill(contmc);
4164  fHistoElectronFeedDownXicPlusMCGen->Fill(contmcele);
4165  if(mcepart->GetPdgCode()<0) fHistoElectronFeedDownXicPlusMCGen1->Fill(contmcele);
4166  if(mcepart->GetPdgCode()>0) fHistoElectronFeedDownXicPlusMCGen2->Fill(contmcele);
4167  if(fabs(mcepart->Eta())<etamax){
4169  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1->Fill(cont2);
4171  if(InvMassEleLambda<2.3){
4172  fHistoElePtFeeddownXicPlusMCGen->Fill(mcepart->Pt(),fCentrality);
4173  fHistoElePtvsEtaFeeddownXicPlusMCGen->Fill(cont_eleptvseta);
4174  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen->Fill(cont_eleptvslambdapt);
4175  }
4176  }
4177  }else if(decaytype==3){
4178  fHistoFeedDownSigmaMCGen->Fill(contmc);
4179  if(mcpart->GetPdgCode()>0) fHistoFeedDownSigmaMCGen1->Fill(contmc);
4180  if(mcpart->GetPdgCode()<0) fHistoFeedDownSigmaMCGen2->Fill(contmc);
4181  }else if(decaytype==10){
4182  fHistoLbElectronMCGen->Fill(contmcele);
4183  if(mcepart->GetPdgCode()<0) fHistoLbElectronMCGen1->Fill(contmcele);
4184  if(mcepart->GetPdgCode()>0) fHistoLbElectronMCGen2->Fill(contmcele);
4185  fHistoLbMCGen->Fill(contmc);
4186  if(mcpart->GetPdgCode()>0) fHistoLbMCGen1->Fill(contmc);
4187  if(mcpart->GetPdgCode()<0) fHistoLbMCGen2->Fill(contmc);
4188 
4189  fHistoLcMCGenWithEleA->Fill(contmc_withele);
4190  if(fabs(mcepart->Eta())<0.8){
4191  fHistoLcMCGenWithEleB->Fill(mcpart->Pt(),mcepart->Pt());
4192  }
4193  }else if(decaytype==11){
4194  fHistoElectronFeedDownXibMCGen->Fill(contmcele);
4195  if(mcepart->GetPdgCode()<0) fHistoElectronFeedDownXibMCGen1->Fill(contmcele);
4196  if(mcepart->GetPdgCode()>0) fHistoElectronFeedDownXibMCGen2->Fill(contmcele);
4197  }
4198 
4200  fMCVariablesTree->Fill();
4201 }
4204 {
4205  //
4206  // Define electron tree variables
4207  //
4208 
4209  const char* nameoutput = GetOutputSlot(9)->GetContainer()->GetName();
4210  fMCEleVariablesTree = new TTree(nameoutput,"MC Ele variables tree");
4211  Int_t nVar = 8;
4212  fCandidateMCEleVariables = new Float_t [nVar];
4213  TString * fCandidateVariableNames = new TString[nVar];
4214 
4215  fCandidateVariableNames[ 0]="Centrality";
4216  fCandidateVariableNames[ 1]="ElePx";
4217  fCandidateVariableNames[ 2]="ElePy";
4218  fCandidateVariableNames[ 3]="ElePz";
4219  fCandidateVariableNames[ 4]="ElePdgCode";
4220  fCandidateVariableNames[ 5]="EleMotherPdgCode";
4221  fCandidateVariableNames[ 6]="RunNumber";
4222  fCandidateVariableNames[ 7]="EvNumber";
4223 
4224  for (Int_t ivar=0; ivar<nVar; ivar++) {
4225  fMCEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
4226  }
4227  return;
4228 }
4230 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
4231 {
4232  //
4233  // Fill tree depending on fWriteMCVariableTree
4234  //
4235  if(!mcepart) return;
4236 
4237  Int_t pdgarray_ele[100], labelarray_ele[100], ngen_ele;
4238  GetMCDecayHistory(mcepart,mcArray,pdgarray_ele,labelarray_ele,ngen_ele);
4239  Bool_t ele_from_bottom = HaveBottomInHistory(pdgarray_ele);
4240  Bool_t ele_from_charm = HaveCharmInHistory(pdgarray_ele);
4241  //Int_t semi_flag = FromSemileptonicDecays(pdgarray_ele);
4242  Int_t semi_flag = 0;
4243  if(pdgarray_ele[0]>400&&pdgarray_ele[0]<450) semi_flag = 1;
4244  if(pdgarray_ele[0]>4000&&pdgarray_ele[0]<4500) semi_flag = 1;
4245  if(pdgarray_ele[0]>500&&pdgarray_ele[0]<550) semi_flag = 2;
4246  if(pdgarray_ele[0]>5000&&pdgarray_ele[0]<5500) semi_flag = 2;
4247 
4248  Double_t contmc[3];
4249  contmc[0] = mcepart->Pt();
4250  contmc[1] = mcepart->Eta();
4251  contmc[2] = fCentrality;
4252 
4253  if(semi_flag==1 && !ele_from_bottom){
4254  fHistoCharmElectronMCGen->Fill(contmc);
4255  }
4256  if(semi_flag==1 && ele_from_bottom){
4257  fHistoBottomElectronMCGen->Fill(contmc);
4258  }
4259  if(semi_flag==2 ){
4260  fHistoBottomElectronMCGen->Fill(contmc);
4261  }
4262 
4263  Bool_t hfe_flag = kFALSE;
4264  Int_t labemother = mcepart->GetMother();
4265  Int_t pdgmotherele = -9999;
4266  if(labemother>=0){
4267  AliAODMCParticle *motherele = (AliAODMCParticle*)mcArray->At(labemother);
4268  pdgmotherele = motherele->GetPdgCode();
4269  if(abs(pdgmotherele)>4000&&abs(pdgmotherele)<4400){
4270  hfe_flag = kTRUE;
4271  }
4272  }
4273 
4274  if(!hfe_flag) return;
4275 
4276  fHistoElectronMCGen->Fill(contmc);
4277 
4278  for(Int_t i=0;i<8;i++){
4279  fCandidateMCEleVariables[i] = -9999.;
4280  }
4281 
4283  fCandidateMCEleVariables[ 1] = mcepart->Px();
4284  fCandidateMCEleVariables[ 2] = mcepart->Py();
4285  fCandidateMCEleVariables[ 3] = mcepart->Pz();
4286  fCandidateMCEleVariables[ 4] = mcepart->GetPdgCode();
4287  fCandidateMCEleVariables[ 5] = pdgmotherele;
4290 
4291 // if(fWriteMCVariableTree && fWriteEachVariableTree && mcepart->Pt()>0.4 && fabs(mcepart->Eta())<1.0 )
4292 // fMCEleVariablesTree->Fill();
4293 
4294 }
4297 {
4298  //
4299  // Define Mc v0 tree variables
4300  //
4301 
4302  const char* nameoutput = GetOutputSlot(10)->GetContainer()->GetName();
4303  fMCV0VariablesTree = new TTree(nameoutput,"MC v0 variables tree");
4304  Int_t nVar = 8;
4305  fCandidateMCV0Variables = new Float_t [nVar];
4306  TString * fCandidateVariableNames = new TString[nVar];
4307 
4308  fCandidateVariableNames[ 0]="Centrality";
4309  fCandidateVariableNames[ 1]="V0Px";
4310  fCandidateVariableNames[ 2]="V0Py";
4311  fCandidateVariableNames[ 3]="V0Pz";
4312  fCandidateVariableNames[ 4]="V0PdgCode";
4313  fCandidateVariableNames[ 5]="V0MotherPdgCode";
4314  fCandidateVariableNames[ 6]="RunNumber";
4315  fCandidateVariableNames[ 7]="EvNumber";
4316 
4317  for (Int_t ivar=0; ivar<nVar; ivar++) {
4318  fMCV0VariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCV0Variables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
4319  }
4320  return;
4321 }
4323 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCV0ROOTObjects(AliAODMCParticle *mcv0part, TClonesArray *mcArray)
4324 {
4325  //
4326  // Fill histograms or tree depending on fWriteMCVariableTree
4327  //
4328  if(!mcv0part) return;
4329 
4330  for(Int_t i=0;i<8;i++){
4331  fCandidateMCV0Variables[i] = -9999.;
4332  }
4333 
4334  Bool_t hfv0_flag = kFALSE;
4335  Int_t labv0mother = mcv0part->GetMother();
4336  Int_t pdgmotherv0 = -9999;
4337  if(labv0mother>=0){
4338  AliAODMCParticle *motherv0 = (AliAODMCParticle*)mcArray->At(labv0mother);
4339  if(motherv0){
4340  pdgmotherv0 = motherv0->GetPdgCode();
4341  if(abs(pdgmotherv0)>4000&&abs(pdgmotherv0)<4400){
4342  hfv0_flag = kTRUE;
4343  }
4344  }
4345  }
4346  if(!hfv0_flag) return;
4347 
4348  Double_t contmc[3];
4349  contmc[0] = mcv0part->Pt();
4350  contmc[1] = mcv0part->Eta();
4351  contmc[2] = fCentrality;
4352  fHistoLambdaMCGen->Fill(contmc);
4353 
4355  fCandidateMCV0Variables[ 1] = mcv0part->Px();
4356  fCandidateMCV0Variables[ 2] = mcv0part->Py();
4357  fCandidateMCV0Variables[ 3] = mcv0part->Pz();
4358  fCandidateMCV0Variables[ 4] = mcv0part->GetPdgCode();
4359  fCandidateMCV0Variables[ 5] = pdgmotherv0;
4362 
4363  if(fWriteMCVariableTree && fWriteEachVariableTree && mcv0part->Pt()>0.4 && fabs(mcv0part->Eta())<1.0 )
4364  fMCV0VariablesTree->Fill();
4365 }
4366 
4367 
4370  //
4372  //
4373 
4374  fCEvents = new TH1F("fCEvents","conter",19,-0.5,18.5);
4375  fCEvents->SetStats(kTRUE);
4376  fCEvents->GetXaxis()->SetBinLabel(1,"X1");
4377  fCEvents->GetXaxis()->SetBinLabel(2,"Analyzed events");
4378  fCEvents->GetXaxis()->SetBinLabel(3,"AliAODVertex exists");
4379  fCEvents->GetXaxis()->SetBinLabel(4,"TriggerOK");
4380  fCEvents->GetXaxis()->SetBinLabel(5,"IsEventSelected");
4381  fCEvents->GetXaxis()->SetBinLabel(6,"CascadesHF exists");
4382  fCEvents->GetXaxis()->SetBinLabel(7,"MCarray exists");
4383  fCEvents->GetXaxis()->SetBinLabel(8,"MCheader exists");
4384  fCEvents->GetXaxis()->SetBinLabel(9,"triggerClass!=CINT1");
4385  fCEvents->GetXaxis()->SetBinLabel(10,"triggerMask!=kAnyINT");
4386  fCEvents->GetXaxis()->SetBinLabel(11,"triggerMask!=kAny");
4387  fCEvents->GetXaxis()->SetBinLabel(12,"vtxTitle.Contains(Z)");
4388  fCEvents->GetXaxis()->SetBinLabel(13,"vtxTitle.Contains(3D)");
4389  fCEvents->GetXaxis()->SetBinLabel(14,"vtxTitle.Doesn'tContain(Z-3D)");
4390  fCEvents->GetXaxis()->SetBinLabel(15,Form("zVtx<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
4391  fCEvents->GetXaxis()->SetBinLabel(16,"!IsEventSelected");
4392  fCEvents->GetXaxis()->SetBinLabel(17,"triggerMask!=kAnyINT || triggerClass!=CINT1");
4393  fCEvents->GetXaxis()->SetBinLabel(18,Form("zVtxMC<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
4394  fCEvents->GetXaxis()->SetBinLabel(19,"No RP");
4395  //fCEvents->GetXaxis()->SetTitle("");
4396  fCEvents->GetYaxis()->SetTitle("counts");
4397 
4398  fHTrigger = new TH1F("fHTrigger","counter",18,-0.5,17.5);
4399  fHTrigger->SetStats(kTRUE);
4400  fHTrigger->GetXaxis()->SetBinLabel(1,"X1");
4401  fHTrigger->GetXaxis()->SetBinLabel(2,"kMB");
4402  fHTrigger->GetXaxis()->SetBinLabel(3,"kSemiCentral");
4403  fHTrigger->GetXaxis()->SetBinLabel(4,"kCentral");
4404  fHTrigger->GetXaxis()->SetBinLabel(5,"kINT7");
4405  fHTrigger->GetXaxis()->SetBinLabel(6,"kEMC7");
4406  //fHTrigger->GetXaxis()->SetBinLabel(7,"Space");
4407  fHTrigger->GetXaxis()->SetBinLabel(8,"kMB|kSemiCentral|kCentral");
4408  fHTrigger->GetXaxis()->SetBinLabel(9,"kINT7|kEMC7");
4409  fHTrigger->GetXaxis()->SetBinLabel(11,"kMB&kSemiCentral");
4410  fHTrigger->GetXaxis()->SetBinLabel(12,"kMB&kCentral");
4411  fHTrigger->GetXaxis()->SetBinLabel(13,"kINT7&kEMC7");
4412 
4413  fHCentrality = new TH1F("fHCentrality","conter",100,0.,100.);
4414  fHEventPlane = new TH1F("fHEventPlane","conter",100,-3.14,3.14);
4415  fHNTrackletvsZ = new TH2F("fHNTrackletvsZ","N_{tracklet} vs z",30,-15.,15.,120,-0.5,119.5);
4416  fHNTrackletCorrvsZ = new TH2F("fHNTrackletCorrvsZ","N_{tracklet} vs z",30,-15.,15.,120,-0.5,119.5);
4417 
4418  fOutput->Add(fCEvents);
4419  fOutput->Add(fHTrigger);
4420  fOutput->Add(fHCentrality);
4421  fOutput->Add(fHEventPlane);
4422  fOutput->Add(fHNTrackletvsZ);
4424 
4425  return;
4426 }
4427 //__________________________________________________________________________
4429 {
4430  //
4432  //
4433 
4434  //------------------------------------------------
4435  // Basic histogram
4436  //------------------------------------------------
4437  Int_t bins_base[3]= {23,100 ,10};
4438  Double_t xmin_base[3]={1.1,0 ,0.00};
4439  Double_t xmax_base[3]={5.7,20. ,100};
4440  fHistoEleLambdaMass = new THnSparseF("fHistoEleLambdaMass","",3,bins_base,xmin_base,xmax_base);
4442  fHistoEleLambdaMassRS = new THnSparseF("fHistoEleLambdaMassRS","",3,bins_base,xmin_base,xmax_base);
4444  fHistoEleLambdaMassRS1 = new THnSparseF("fHistoEleLambdaMassRS1","",3,bins_base,xmin_base,xmax_base);
4446  fHistoEleLambdaMassRS2 = new THnSparseF("fHistoEleLambdaMassRS2","",3,bins_base,xmin_base,xmax_base);
4448  fHistoEleLambdaMassWS = new THnSparseF("fHistoEleLambdaMassWS","",3,bins_base,xmin_base,xmax_base);
4450  fHistoEleLambdaMassWS1 = new THnSparseF("fHistoEleLambdaMassWS1","",3,bins_base,xmin_base,xmax_base);
4452  fHistoEleLambdaMassWS2 = new THnSparseF("fHistoEleLambdaMassWS2","",3,bins_base,xmin_base,xmax_base);
4454  fHistoEleLambdaMassRSMix = new THnSparseF("fHistoEleLambdaMassRSMix","",3,bins_base,xmin_base,xmax_base);
4456  fHistoEleLambdaMassRSMix1 = new THnSparseF("fHistoEleLambdaMassRSMix1","",3,bins_base,xmin_base,xmax_base);
4458  fHistoEleLambdaMassRSMix2 = new THnSparseF("fHistoEleLambdaMassRSMix2","",3,bins_base,xmin_base,xmax_base);
4460  fHistoEleLambdaMassWSMix = new THnSparseF("fHistoEleLambdaMassWSMix","",3,bins_base,xmin_base,xmax_base);
4462  fHistoEleLambdaMassWSMix1 = new THnSparseF("fHistoEleLambdaMassWSMix1","",3,bins_base,xmin_base,xmax_base);
4464  fHistoEleLambdaMassWSMix2 = new THnSparseF("fHistoEleLambdaMassWSMix2","",3,bins_base,xmin_base,xmax_base);
4466  fHistoEleLambdaMassRSSide = new THnSparseF("fHistoEleLambdaMassRSSide","",3,bins_base,xmin_base,xmax_base);
4468  fHistoEleLambdaMassRSSide1 = new THnSparseF("fHistoEleLambdaMassRSSide1","",3,bins_base,xmin_base,xmax_base);
4470  fHistoEleLambdaMassRSSide2 = new THnSparseF("fHistoEleLambdaMassRSSide2","",3,bins_base,xmin_base,xmax_base);
4472  fHistoEleLambdaMassWSSide = new THnSparseF("fHistoEleLambdaMassWSSide","",3,bins_base,xmin_base,xmax_base);
4474  fHistoEleLambdaMassWSSide1 = new THnSparseF("fHistoEleLambdaMassWSSide1","",3,bins_base,xmin_base,xmax_base);
4476  fHistoEleLambdaMassWSSide2 = new THnSparseF("fHistoEleLambdaMassWSSide2","",3,bins_base,xmin_base,xmax_base);
4478 
4479  fHistoEleLambdaMassRSAway = new THnSparseF("fHistoEleLambdaMassRSAway","",3,bins_base,xmin_base,xmax_base);
4481  fHistoEleLambdaMassRS1Away = new THnSparseF("fHistoEleLambdaMassRS1Away","",3,bins_base,xmin_base,xmax_base);
4483  fHistoEleLambdaMassRS2Away = new THnSparseF("fHistoEleLambdaMassRS2Away","",3,bins_base,xmin_base,xmax_base);
4485  fHistoEleLambdaMassWSAway = new THnSparseF("fHistoEleLambdaMassWSAway","",3,bins_base,xmin_base,xmax_base);
4487  fHistoEleLambdaMassWS1Away = new THnSparseF("fHistoEleLambdaMassWS1Away","",3,bins_base,xmin_base,xmax_base);
4489  fHistoEleLambdaMassWS2Away = new THnSparseF("fHistoEleLambdaMassWS2Away","",3,bins_base,xmin_base,xmax_base);
4491  fHistoEleLambdaMassRSMixAway = new THnSparseF("fHistoEleLambdaMassRSMixAway","",3,bins_base,xmin_base,xmax_base);
4493  fHistoEleLambdaMassRSMix1Away = new THnSparseF("fHistoEleLambdaMassRSMix1Away","",3,bins_base,xmin_base,xmax_base);
4495  fHistoEleLambdaMassRSMix2Away = new THnSparseF("fHistoEleLambdaMassRSMix2Away","",3,bins_base,xmin_base,xmax_base);
4497  fHistoEleLambdaMassWSMixAway = new THnSparseF("fHistoEleLambdaMassWSMixAway","",3,bins_base,xmin_base,xmax_base);
4499  fHistoEleLambdaMassWSMix1Away = new THnSparseF("fHistoEleLambdaMassWSMix1Away","",3,bins_base,xmin_base,xmax_base);
4501  fHistoEleLambdaMassWSMix2Away = new THnSparseF("fHistoEleLambdaMassWSMix2Away","",3,bins_base,xmin_base,xmax_base);
4503  fHistoEleLambdaMassRSSideAway = new THnSparseF("fHistoEleLambdaMassRSSideAway","",3,bins_base,xmin_base,xmax_base);
4505  fHistoEleLambdaMassRSSide1Away = new THnSparseF("fHistoEleLambdaMassRSSide1Away","",3,bins_base,xmin_base,xmax_base);
4507  fHistoEleLambdaMassRSSide2Away = new THnSparseF("fHistoEleLambdaMassRSSide2Away","",3,bins_base,xmin_base,xmax_base);
4509  fHistoEleLambdaMassWSSideAway = new THnSparseF("fHistoEleLambdaMassWSSideAway","",3,bins_base,xmin_base,xmax_base);
4511  fHistoEleLambdaMassWSSide1Away = new THnSparseF("fHistoEleLambdaMassWSSide1Away","",3,bins_base,xmin_base,xmax_base);
4513  fHistoEleLambdaMassWSSide2Away = new THnSparseF("fHistoEleLambdaMassWSSide2Away","",3,bins_base,xmin_base,xmax_base);
4515 
4516  Int_t bins_base_elept[3]= {10,100 ,10};
4517  Double_t xmin_base_elept[3]={1.1,0 ,0.00};
4518  Double_t xmax_base_elept[3]={3.1,10. ,100};
4519  fHistoEleLambdaMassvsElePtRS = new THnSparseF("fHistoEleLambdaMassvsElePtRS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4521  fHistoEleLambdaMassvsElePtWS = new THnSparseF("fHistoEleLambdaMassvsElePtWS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4523  fHistoEleLambdaMassvsElePtRSMix = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4525  fHistoEleLambdaMassvsElePtWSMix = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4527  fHistoEleLambdaMassvsElePtRSSide = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4529  fHistoEleLambdaMassvsElePtWSSide = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4531  fHistoEleLambdaMassvsElePtRS1 = new THnSparseF("fHistoEleLambdaMassvsElePtRS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4533  fHistoEleLambdaMassvsElePtWS1 = new THnSparseF("fHistoEleLambdaMassvsElePtWS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4535  fHistoEleLambdaMassvsElePtRSMix1 = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4537  fHistoEleLambdaMassvsElePtWSMix1 = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4539  fHistoEleLambdaMassvsElePtRSSide1 = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4541  fHistoEleLambdaMassvsElePtWSSide1 = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4543  fHistoEleLambdaMassvsElePtRS2 = new THnSparseF("fHistoEleLambdaMassvsElePtRS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4545  fHistoEleLambdaMassvsElePtWS2 = new THnSparseF("fHistoEleLambdaMassvsElePtWS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4547  fHistoEleLambdaMassvsElePtRSMix2 = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4549  fHistoEleLambdaMassvsElePtWSMix2 = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4551  fHistoEleLambdaMassvsElePtRSSide2 = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4553  fHistoEleLambdaMassvsElePtWSSide2 = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4555 
4556  fHistoEleLambdaMassMCS = new THnSparseF("fHistoEleLambdaMassMCS","",3,bins_base,xmin_base,xmax_base);
4558  fHistoEleLambdaMassLambdabMCS = new THnSparseF("fHistoEleLambdaMassLambdabMCS","",3,bins_base,xmin_base,xmax_base);
4560  fHistoEleLambdaMassXibMCS = new THnSparseF("fHistoEleLambdaMassXibMCS","",3,bins_base,xmin_base,xmax_base);
4562  fHistoEleLambdaMassMCGen = new THnSparseF("fHistoEleLambdaMassMCGen","",3,bins_base,xmin_base,xmax_base);
4564  fHistoEleLambdaMassvsElePtMCS = new THnSparseF("fHistoEleLambdaMassvsElePtMCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4566  fHistoEleLambdaMassvsElePtMCGen = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4568  fHistoEleLambdaMassvsElePtMCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtMCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4570  fHistoEleLambdaMassvsElePtMCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4572  fHistoEleLambdaMassvsElePtMCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtMCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4574  fHistoEleLambdaMassvsElePtMCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4576 
4577  fHistoElePtRS = new TH2F("fHistoElePtRS","",100,0,10,10,0,100);
4578  fOutputAll->Add(fHistoElePtRS);
4579  fHistoElePtWS = new TH2F("fHistoElePtWS","",100,0.,10.,10,0,100);
4580  fOutputAll->Add(fHistoElePtWS);
4581  fHistoElePtRSMix = new TH2F("fHistoElePtRSMix","",100,0.,10.,10,0,100);
4583  fHistoElePtWSMix = new TH2F("fHistoElePtWSMix","",100,0.,10.,10,0,100);
4585  fHistoElePtMCS = new TH2F("fHistoElePtMCS","",100,0,10,10,0,100);
4586  fOutputAll->Add(fHistoElePtMCS);
4587  fHistoElePtMCGen = new TH2F("fHistoElePtMCGen","",100,0,10,10,0,100);
4589 
4590  Int_t bins_eleptvseta[3]= {10,10 ,10};
4591  Double_t xmin_eleptvseta[3]={0.,-1. ,0.0};
4592  Double_t xmax_eleptvseta[3]={5.,1. ,100};
4593 
4594  fHistoElePtvsEtaRS = new THnSparseF("fHistoElePtvsEtaRS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4596  fHistoElePtvsEtaWS = new THnSparseF("fHistoElePtvsEtaWS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4598  fHistoElePtvsEtaRSMix = new THnSparseF("fHistoElePtvsEtaRSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4600  fHistoElePtvsEtaWSMix = new THnSparseF("fHistoElePtvsEtaWSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4602  fHistoElePtvsEtaMCS = new THnSparseF("fHistoElePtvsEtaMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4604  fHistoElePtvsEtaMCGen = new THnSparseF("fHistoElePtvsEtaMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4606 
4607  Int_t bins_eleptvslambdapt[3]= {10,10 ,10};
4608  Double_t xmin_eleptvslambdapt[3]={0.,0. ,0.0};
4609  Double_t xmax_eleptvslambdapt[3]={5.,5. ,100};
4610 
4611  fHistoElePtvsLambdaPtRS = new THnSparseF("fHistoElePtvsLambdaPtRS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4613  fHistoElePtvsLambdaPtWS = new THnSparseF("fHistoElePtvsLambdaPtWS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4615  fHistoElePtvsLambdaPtRSMix = new THnSparseF("fHistoElePtvsLambdaPtRSMix","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4617  fHistoElePtvsLambdaPtWSMix = new THnSparseF("fHistoElePtvsLambdaPtWSMix","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4619  fHistoElePtvsLambdaPtMCS = new THnSparseF("fHistoElePtvsLambdaPtMCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4621  fHistoElePtvsLambdaPtMCGen = new THnSparseF("fHistoElePtvsLambdaPtMCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4623  fHistoElePtvsLambdaPtMCLcGen = new THnSparseF("fHistoElePtvsLambdaPtMCLcGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4625 
4626  Int_t bins_eleptvslambdaptvslcpt[4]= {10,10,10,10};
4627  Double_t xmin_eleptvslambdaptvslcpt[4]={0.,0.,0.,0.0};
4628  Double_t xmax_eleptvslambdaptvslcpt[4]={5.,5.,10.,100};
4629  fHistoElePtvsLambdaPtvsLcPtMCS = new THnSparseF("fHistoElePtvsLambdaPtvsLcPtMCS","",4,bins_eleptvslambdaptvslcpt,xmin_eleptvslambdaptvslcpt,xmax_eleptvslambdaptvslcpt);
4631  fHistoElePtvsLambdaPtvsLcPtMCGen = new THnSparseF("fHistoElePtvsLambdaPtvsLcPtMCGen","",4,bins_eleptvslambdaptvslcpt,xmin_eleptvslambdaptvslcpt,xmax_eleptvslambdaptvslcpt);
4633 
4634  Int_t bins_allpt[4]= {10,10,20,20};
4635  Double_t xmin_allpt[4]={0.,0.,0.,0.0};
4636  Double_t xmax_allpt[4]={20.,20.,10.,10};
4637  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt = new THnSparseF("fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt","",4,bins_allpt,xmin_allpt,xmax_allpt);
4639 
4640  fHistoEleLambdaPtvsRapidityRS=new TH2F("fHistoEleLambdaPtvsRapidityRS","EleLambda pt vs rap",20,0.,20.,40,-2.,2.);
4642  fHistoEleLambdaPtvsRapidityWS=new TH2F("fHistoEleLambdaPtvsRapidityWS","EleLambda pt vs rap",20,0.,20.,40,-2.,2.);
4644  fHistoEleLambdaPtvsRapidityMCS=new TH2F("fHistoEleLambdaPtvsRapidityMCS","EleLambda pt vs rap",20,0.,20.,40,-2.,2.);
4646 
4647  Int_t bins_eleptvsd0[3]= {10 ,10 ,10};
4648  Double_t xmin_eleptvsd0[3]={0.,-0.2 ,0.0};
4649  Double_t xmax_eleptvsd0[3]={5.,0.2 ,100};
4650 
4651  fHistoElePtvsd0RS = new THnSparseF("fHistoElePtvsd0RS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
4653  fHistoElePtvsd0WS = new THnSparseF("fHistoElePtvsd0WS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
4655  fHistoElePtvsd0RSMix = new THnSparseF("fHistoElePtvsd0RSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
4657  fHistoElePtvsd0WSMix = new THnSparseF("fHistoElePtvsd0WSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
4659  fHistoElePtvsd0MCS = new THnSparseF("fHistoElePtvsd0MCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
4661  fHistoElePtvsd0PromptMCS = new THnSparseF("fHistoElePtvsd0PromptMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
4663  fHistoElePtvsd0BFeeddownMCS = new THnSparseF("fHistoElePtvsd0BFeeddownMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
4665 
4666 
4667  //Feeddown from Xic0
4668  fHistoEleLambdaMassFeeddownXic0MCS = new THnSparseF("fHistoEleLambdaMassFeeddownXic0MCS","",3,bins_base,xmin_base,xmax_base);
4670  fHistoEleLambdaMassFeeddownXic0MCGen = new THnSparseF("fHistoEleLambdaMassFeeddownXic0MCGen","",3,bins_base,xmin_base,xmax_base);
4672  fHistoEleLambdaMassvsElePtFeeddownXic0MCS = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4674  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4676  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4678  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4680  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4682  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4684  fHistoElePtFeeddownXic0MCS = new TH2F("fHistoElePtFeeddownXic0MCS","",100,0,10,10,0,100);
4686  fHistoElePtFeeddownXic0MCGen = new TH2F("fHistoElePtFeeddownXic0MCGen","",100,0,10,10,0,100);
4688  fHistoElePtvsEtaFeeddownXic0MCS = new THnSparseF("fHistoElePtvsEtaFeeddownXic0MCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4690  fHistoElePtvsEtaFeeddownXic0MCGen = new THnSparseF("fHistoElePtvsEtaFeeddownXic0MCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4692  fHistoElePtvsLambdaPtFeeddownXic0MCS = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXic0MCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4694  fHistoElePtvsLambdaPtFeeddownXic0MCGen = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXic0MCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4696 
4697  //Feeddown from XicPlus
4698  fHistoEleLambdaMassFeeddownXicPlusMCS = new THnSparseF("fHistoEleLambdaMassFeeddownXicPlusMCS","",3,bins_base,xmin_base,xmax_base);
4700  fHistoEleLambdaMassFeeddownXicPlusMCGen = new THnSparseF("fHistoEleLambdaMassFeeddownXicPlusMCGen","",3,bins_base,xmin_base,xmax_base);
4702  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4704  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4706  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4708  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4710  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4712  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4714  fHistoElePtFeeddownXicPlusMCS = new TH2F("fHistoElePtFeeddownXicPlusMCS","",100,0,10,10,0,100);
4716  fHistoElePtFeeddownXicPlusMCGen = new TH2F("fHistoElePtFeeddownXicPlusMCGen","",100,0,10,10,0,100);
4718  fHistoElePtvsEtaFeeddownXicPlusMCS = new THnSparseF("fHistoElePtvsEtaFeeddownXicPlusMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4720  fHistoElePtvsEtaFeeddownXicPlusMCGen = new THnSparseF("fHistoElePtvsEtaFeeddownXicPlusMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4722  fHistoElePtvsLambdaPtFeeddownXicPlusMCS = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXicPlusMCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4724  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXicPlusMCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4726 
4727  fHistoBachPt = new TH1F("fHistoBachPt","Bachelor p_{T}",100,0.0,5.0);
4728  fOutputAll->Add(fHistoBachPt);
4729 
4730  //------------------------------------------------
4731  // checking histograms
4732  //------------------------------------------------
4733  fHistoBachPt = new TH1F("fHistoBachPt","Bachelor p_{T}",100,0.0,5.0);
4734  fOutputAll->Add(fHistoBachPt);
4735  fHistoBachPtMCS = new TH1F("fHistoBachPtMCS","Bachelor p_{T}",100,0.0,5.0);
4737  fHistoBachPtMCGen = new TH1F("fHistoBachPtMCGen","Bachelor p_{T}",100,0.0,5.0);
4739  fHistod0Bach = new TH1F("fHistod0Bach","Bachelor d_{0}",100,-0.5,0.5);
4740  fOutputAll->Add(fHistod0Bach);
4741  fHistoLambdaMassvsPt=new TH2F("fHistoLambdaMassvsPt","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
4743  fHistoLambdaMassvsPtMCS=new TH2F("fHistoLambdaMassvsPtMCS","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
4745  fHistoLambdaMassvsPtMCGen=new TH2F("fHistoLambdaMassvsPtMCGen","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
4747  fHistoLambdaPtvsEta=new TH2F("fHistoLambdaPtvsEta","Lambda mass",20,0.,10.,20,-1.,1.);
4749  fHistoLambdaPtvsEtaMCS=new TH2F("fHistoLambdaPtvsEtaMCS","Lambda mass",20,0.,10.,20,-1.,1.);
4751  fHistoLambdaPtvsEtaMCGen=new TH2F("fHistoLambdaPtvsEtaMCGen","Lambda mass",20,0.,10.,20,-1.,1.);
4753  fHistoK0sMassvsPt=new TH2F("fHistoK0sMassvsPt","K0s mass",100,0.497-0.05,0.497+0.05,20,0.,10.);
4755  fHistoLambdaPtvsDl=new TH2F("fHistoLambdaPtvsDl","Lambda pt vs dl",20,0.,10.,20,0.,40.);
4757  fHistoLambdaPtvsDlSide=new TH2F("fHistoLambdaPtvsDlSide","Lambda pt vs dl",20,0.,10.,20,0.,40.);
4759  fHistoLambdaPtvsDlMCS=new TH2F("fHistoLambdaPtvsDlMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
4761  fHistoLambdaPtvsDlFeeddownXi0MCS=new TH2F("fHistoLambdaPtvsDlFeeddownXi0MCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
4763  fHistoLambdaPtvsDlFeeddownXiMinusMCS=new TH2F("fHistoLambdaPtvsDlFeeddownXiMinusMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
4765  fHistoLambdaPtvsDlFeeddownOmegaMCS=new TH2F("fHistoLambdaPtvsDlFeeddownOmegaMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
4767 
4768  Int_t bins_armenteros[3]= {20 ,100 ,200};
4769  Double_t xmin_armenteros[3]={0.,0. ,-1.};
4770  Double_t xmax_armenteros[3]={20.,1. ,1.};
4771  fHistoLambdaArmenteros = new THnSparseF("fHistoLambdaArmenteros","",3,bins_armenteros,xmin_armenteros,xmax_armenteros);
4773  fHistoLambdaArmenterosMCS = new THnSparseF("fHistoLambdaArmenterosMCS","",3,bins_armenteros,xmin_armenteros,xmax_armenteros);
4775 
4776  fHistoElectronTPCPID=new TH2F("fHistoElectronTPCPID","",50,0.,5.,50,-20.,20.);
4778  fHistoElectronTOFPID=new TH2F("fHistoElectronTOFPID","",50,0.,5.,50,-20.,20.);
4780  fHistoElectronTPCSelPID=new TH2F("fHistoElectronTPCSelPID","",50,0.,5.,50,-20.,20.);
4782  fHistoElectronTOFSelPID=new TH2F("fHistoElectronTOFSelPID","",50,0.,5.,50,-20.,20.);
4784  fHistoElectronTPCPIDSelTOF=new TH2F("fHistoElectronTPCPIDSelTOF","",10,0.,5.,500,-10.,10.);
4786  fHistoElectronTPCPIDSelTOFSmallEta=new TH2F("fHistoElectronTPCPIDSelTOFSmallEta","",10,0.,5.,500,-10.,10.);
4788  fHistoElectronTPCPIDSelTOFLargeEta=new TH2F("fHistoElectronTPCPIDSelTOFLargeEta","",10,0.,5.,500,-10.,10.);
4790  fHistoMassConversionsMin=new TH1F("fHistoMassConversionsMin","",500,0,0.5);
4792  fHistoMassConversionsSameSignMin=new TH1F("fHistoMassConversionsSameSignMin","",500,0,0.5);
4794 
4795  for(Int_t i=0;i<8;i++){
4796  fHistoElectronTPCPIDSelTOFEtaDep[i]=new TH2F(Form("fHistoElectronTPCPIDSelTOFEtaDep[%d]",i),"",10,0.,5.,500,-10.,10.);
4798  }
4799  fHistoElectronQovPtvsPhi=new TH2F("fHistoElectronQovPtvsPhi","",70,0.,7.,50,-2.,2.);
4801  fHistoLambdaQovPtvsPhi=new TH2F("fHistoLambdaQovPtvsPhi","",70,0.,7.,50,-2.,2.);
4803 
4804  Int_t bins_lcmcgen_withelea[3]= {20 ,100 ,100};
4805  Double_t xmin_lcmcgen_withelea[3]={0.,-5.,-5.};
4806  Double_t xmax_lcmcgen_withelea[3]={20.,5.,5.};
4807  fHistoLcMCGenWithEleA = new THnSparseF("fHistoLcMCGenWithEleA","",3,bins_lcmcgen_withelea,xmin_lcmcgen_withelea,xmax_lcmcgen_withelea);
4809  fHistoLcMCGenWithEleB = new TH2D("fHistoLcMCGenWithEleB","",100,0.,20.,100,0.,10.);
4811 
4812  fHistoLbMCGenWithEleA = new THnSparseF("fHistoLbMCGenWithEleA","",3,bins_lcmcgen_withelea,xmin_lcmcgen_withelea,xmax_lcmcgen_withelea);
4814  fHistoLbMCGenWithEleB = new TH2D("fHistoLbMCGenWithEleB","",100,0.,20.,100,0.,10.);
4816 
4817  Int_t bins_lbmcgen_withlc[3]= {50 ,100 ,100};
4818  Double_t xmin_lbmcgen_withlc[3]={0.,-5.,-5.};
4819  Double_t xmax_lbmcgen_withlc[3]={50.,5.,5.};
4820  fHistoLbMCGenWithLambdac = new THnSparseF("fHistoLbMCGenWithLambdac","",3,bins_lbmcgen_withlc,xmin_lbmcgen_withlc,xmax_lbmcgen_withlc);
4822 
4823  Int_t bins_lcmcgen[3]= {100 ,20 ,10};
4824  Double_t xmin_lcmcgen[3]={0.,-1.0 ,0.0};
4825  Double_t xmax_lcmcgen[3]={20.,1.0 ,100};
4826  Int_t bins_lbmcgen[3]= {100 ,20 ,10};
4827  Double_t xmin_lbmcgen[3]={0.,-1.0 ,0.0};
4828  Double_t xmax_lbmcgen[3]={50.,1.0 ,100};
4829  fHistoLcMCGen = new THnSparseF("fHistoLcMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4830  fOutputAll->Add(fHistoLcMCGen);
4831  fHistoLcMCGen1 = new THnSparseF("fHistoLcMCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4832  fOutputAll->Add(fHistoLcMCGen1);
4833  fHistoLcMCGen2 = new THnSparseF("fHistoLcMCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4834  fOutputAll->Add(fHistoLcMCGen2);
4835  fHistoLbMCGen = new THnSparseF("fHistoLbMCGen","",3,bins_lbmcgen,xmin_lbmcgen,xmax_lbmcgen);
4836  fOutputAll->Add(fHistoLbMCGen);
4837  fHistoLbMCGen1 = new THnSparseF("fHistoLbMCGen1","",3,bins_lbmcgen,xmin_lbmcgen,xmax_lbmcgen);
4838  fOutputAll->Add(fHistoLbMCGen1);
4839  fHistoLbMCGen2 = new THnSparseF("fHistoLbMCGen2","",3,bins_lbmcgen,xmin_lbmcgen,xmax_lbmcgen);
4840  fOutputAll->Add(fHistoLbMCGen2);
4841  fHistoFeedDownXic0MCGen = new THnSparseF("fHistoFeedDownXic0MCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4843  fHistoFeedDownXic0MCGen1 = new THnSparseF("fHistoFeedDownXic0MCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4845  fHistoFeedDownXic0MCGen2 = new THnSparseF("fHistoFeedDownXic0MCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4847  fHistoFeedDownXicPlusMCGen = new THnSparseF("fHistoFeedDownXicPlusMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4849  fHistoFeedDownXicPlusMCGen1 = new THnSparseF("fHistoFeedDownXicPlusMCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4851  fHistoFeedDownXicPlusMCGen2 = new THnSparseF("fHistoFeedDownXicPlusMCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4853  fHistoFeedDownSigmaMCGen = new THnSparseF("fHistoFeedDownSigmaMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4855  fHistoFeedDownSigmaMCGen1 = new THnSparseF("fHistoFeedDownSigmaMCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4857  fHistoFeedDownSigmaMCGen2 = new THnSparseF("fHistoFeedDownSigmaMCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4859 
4860  fHistoLcMCS = new THnSparseF("fHistoLcMCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4861  fOutputAll->Add(fHistoLcMCS);
4862  fHistoLcMCS1 = new THnSparseF("fHistoLcMCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4863  fOutputAll->Add(fHistoLcMCS1);
4864  fHistoLcMCS2 = new THnSparseF("fHistoLcMCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4865  fOutputAll->Add(fHistoLcMCS2);
4866  fHistoLbMCS = new THnSparseF("fHistoLbMCS","",3,bins_lbmcgen,xmin_lbmcgen,xmax_lbmcgen);
4867  fOutputAll->Add(fHistoLbMCS);
4868  fHistoLbMCS1 = new THnSparseF("fHistoLbMCS1","",3,bins_lbmcgen,xmin_lbmcgen,xmax_lbmcgen);
4869  fOutputAll->Add(fHistoLbMCS1);
4870  fHistoLbMCS2 = new THnSparseF("fHistoLbMCS2","",3,bins_lbmcgen,xmin_lbmcgen,xmax_lbmcgen);
4871  fOutputAll->Add(fHistoLbMCS2);
4872  fHistoFeedDownXic0MCS = new THnSparseF("fHistoFeedDownXic0MCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4874  fHistoFeedDownXic0MCS1 = new THnSparseF("fHistoFeedDownXic0MCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4876  fHistoFeedDownXic0MCS2 = new THnSparseF("fHistoFeedDownXic0MCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4878  fHistoFeedDownXicPlusMCS = new THnSparseF("fHistoFeedDownXicPlusMCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4880  fHistoFeedDownXicPlusMCS1 = new THnSparseF("fHistoFeedDownXicPlusMCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4882  fHistoFeedDownXicPlusMCS2 = new THnSparseF("fHistoFeedDownXicPlusMCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4884  fHistoFeedDownSigmaMCS = new THnSparseF("fHistoFeedDownSigmaMCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4886  fHistoFeedDownSigmaMCS1 = new THnSparseF("fHistoFeedDownSigmaMCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4888  fHistoFeedDownSigmaMCS2 = new THnSparseF("fHistoFeedDownSigmaMCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4890 
4891  Int_t bins_elemcgen[3]= {100 ,20 ,10};
4892  Double_t xmin_elemcgen[3]={0.,-1.0 ,0.0};
4893  Double_t xmax_elemcgen[3]={10.,1.0 ,100};
4894  fHistoElectronMCGen = new THnSparseF("fHistoElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4896  fHistoBottomElectronMCGen = new THnSparseF("fHistoBottomElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4898  fHistoCharmElectronMCGen = new THnSparseF("fHistoCharmElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4900  fHistoLcElectronMCGen = new THnSparseF("fHistoLcElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4902  fHistoLcElectronMCGen1 = new THnSparseF("fHistoLcElectronMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4904  fHistoLcElectronMCGen2 = new THnSparseF("fHistoLcElectronMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4906  fHistoLbElectronMCGen = new THnSparseF("fHistoLbElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4908  fHistoLbElectronMCGen1 = new THnSparseF("fHistoLbElectronMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4910  fHistoLbElectronMCGen2 = new THnSparseF("fHistoLbElectronMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4912  fHistoElectronFeedDownXic0MCGen = new THnSparseF("fHistoElectronFeedDownXic0MCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4914  fHistoElectronFeedDownXic0MCGen1 = new THnSparseF("fHistoElectronFeedDownXic0MCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4916  fHistoElectronFeedDownXic0MCGen2 = new THnSparseF("fHistoElectronFeedDownXic0MCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4918  fHistoElectronFeedDownXicPlusMCGen = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4920  fHistoElectronFeedDownXicPlusMCGen1 = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4922  fHistoElectronFeedDownXicPlusMCGen2 = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4924  fHistoElectronFeedDownXibMCGen = new THnSparseF("fHistoElectronFeedDownXibMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4926  fHistoElectronFeedDownXibMCGen1 = new THnSparseF("fHistoElectronFeedDownXibMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4928  fHistoElectronFeedDownXibMCGen2 = new THnSparseF("fHistoElectronFeedDownXibMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4930  fHistoLcElectronMCS = new THnSparseF("fHistoLcElectronMCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4932  fHistoLcElectronMCS1 = new THnSparseF("fHistoLcElectronMCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4934  fHistoLcElectronMCS2 = new THnSparseF("fHistoLcElectronMCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4936  fHistoLbElectronMCS = new THnSparseF("fHistoLbElectronMCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4938  fHistoLbElectronMCS1 = new THnSparseF("fHistoLbElectronMCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4940  fHistoLbElectronMCS2 = new THnSparseF("fHistoLbElectronMCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4942  fHistoElectronFeedDownXic0MCS = new THnSparseF("fHistoElectronFeedDownXic0MCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4944  fHistoElectronFeedDownXic0MCS1 = new THnSparseF("fHistoElectronFeedDownXic0MCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4946  fHistoElectronFeedDownXic0MCS2 = new THnSparseF("fHistoElectronFeedDownXic0MCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4948  fHistoElectronFeedDownXicPlusMCS = new THnSparseF("fHistoElectronFeedDownXicPlusMCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4950  fHistoElectronFeedDownXicPlusMCS1 = new THnSparseF("fHistoElectronFeedDownXicPlusMCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4952  fHistoElectronFeedDownXicPlusMCS2 = new THnSparseF("fHistoElectronFeedDownXicPlusMCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4954  fHistoElectronFeedDownXibMCS = new THnSparseF("fHistoElectronFeedDownXibMCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4956  fHistoElectronFeedDownXibMCS1 = new THnSparseF("fHistoElectronFeedDownXibMCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4958  fHistoElectronFeedDownXibMCS2 = new THnSparseF("fHistoElectronFeedDownXibMCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4960 
4961  Int_t bins_lambdamcgen[3]= {50 ,20 ,10};
4962  Double_t xmin_lambdamcgen[3]={0.,-1.0 ,0.0};
4963  Double_t xmax_lambdamcgen[3]={10.,1.0 ,100};
4964  fHistoLambdaMCGen = new THnSparseF("fHistoLambdaMCGen","",3,bins_lambdamcgen,xmin_lambdamcgen,xmax_lambdamcgen);
4966 
4967  Int_t bins_eleptvsv0dl[3]= {100 ,20 ,10};
4968  Double_t xmin_eleptvsv0dl[3]={0.,0. ,0.0};
4969  Double_t xmax_eleptvsv0dl[3]={10.,40. ,100};
4970  fHistoElePtvsV0dlRS = new THnSparseF("fHistoElePtvsV0dlRS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4972  fHistoElePtvsV0dlRS1 = new THnSparseF("fHistoElePtvsV0dlRS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4974  fHistoElePtvsV0dlRS2 = new THnSparseF("fHistoElePtvsV0dlRS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4976  fHistoElePtvsV0dlRSSide = new THnSparseF("fHistoElePtvsV0dlRSSide","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4978  fHistoElePtvsV0dlRSSide1 = new THnSparseF("fHistoElePtvsV0dlRSSide1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4980  fHistoElePtvsV0dlRSSide2 = new THnSparseF("fHistoElePtvsV0dlRSSide2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4982  fHistoElePtvsV0dlRSMix = new THnSparseF("fHistoElePtvsV0dlRSMix","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4984  fHistoElePtvsV0dlRSMix1 = new THnSparseF("fHistoElePtvsV0dlRSMix1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4986  fHistoElePtvsV0dlRSMix2 = new THnSparseF("fHistoElePtvsV0dlRSMix2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4988  fHistoElePtvsV0dlWS = new THnSparseF("fHistoElePtvsV0dlWS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4990  fHistoElePtvsV0dlWS1 = new THnSparseF("fHistoElePtvsV0dlWS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4992  fHistoElePtvsV0dlWS2 = new THnSparseF("fHistoElePtvsV0dlWS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4994  fHistoElePtvsV0dlWSSide = new THnSparseF("fHistoElePtvsV0dlWSSide","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4996  fHistoElePtvsV0dlWSSide1 = new THnSparseF("fHistoElePtvsV0dlWSSide1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4998  fHistoElePtvsV0dlWSSide2 = new THnSparseF("fHistoElePtvsV0dlWSSide2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
5000  fHistoElePtvsV0dlWSMix = new THnSparseF("fHistoElePtvsV0dlWSMix","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
5002  fHistoElePtvsV0dlWSMix1 = new THnSparseF("fHistoElePtvsV0dlWSMix1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
5004  fHistoElePtvsV0dlWSMix2 = new THnSparseF("fHistoElePtvsV0dlWSMix2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
5006  fHistoElePtvsV0dlMCS = new THnSparseF("fHistoElePtvsV0dlMCS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
5008  fHistoElePtvsV0dlMCS1 = new THnSparseF("fHistoElePtvsV0dlMCS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
5010  fHistoElePtvsV0dlMCS2 = new THnSparseF("fHistoElePtvsV0dlMCS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
5012  fHistoElePtvsV0dlFeedDownXic0MCS = new THnSparseF("fHistoElePtvsV0dlFeedDownXic0MCS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
5014  fHistoElePtvsV0dlFeedDownXic0MCS1 = new THnSparseF("fHistoElePtvsV0dlFeedDownXic0MCS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
5016  fHistoElePtvsV0dlFeedDownXic0MCS2 = new THnSparseF("fHistoElePtvsV0dlFeedDownXic0MCS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
5018  fHistoElePtvsV0dlFeedDownXicPlusMCS = new THnSparseF("fHistoElePtvsV0dlFeedDownXicPlusMCS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
5020  fHistoElePtvsV0dlFeedDownXicPlusMCS1 = new THnSparseF("fHistoElePtvsV0dlFeedDownXicPlusMCS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
5022  fHistoElePtvsV0dlFeedDownXicPlusMCS2 = new THnSparseF("fHistoElePtvsV0dlFeedDownXicPlusMCS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
5024 
5025  Int_t bins_eleptvsv0dca[3]= {100 ,20 ,10};
5026  Double_t xmin_eleptvsv0dca[3]={0.,0. ,0.0};
5027  Double_t xmax_eleptvsv0dca[3]={10.,1. ,100};
5028  fHistoElePtvsV0dcaRS = new THnSparseF("fHistoElePtvsV0dcaRS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5030  fHistoElePtvsV0dcaRS1 = new THnSparseF("fHistoElePtvsV0dcaRS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5032  fHistoElePtvsV0dcaRS2 = new THnSparseF("fHistoElePtvsV0dcaRS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5034  fHistoElePtvsV0dcaRSSide = new THnSparseF("fHistoElePtvsV0dcaRSSide","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5036  fHistoElePtvsV0dcaRSSide1 = new THnSparseF("fHistoElePtvsV0dcaRSSide1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5038  fHistoElePtvsV0dcaRSSide2 = new THnSparseF("fHistoElePtvsV0dcaRSSide2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5040  fHistoElePtvsV0dcaRSMix = new THnSparseF("fHistoElePtvsV0dcaRSMix","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5042  fHistoElePtvsV0dcaRSMix1 = new THnSparseF("fHistoElePtvsV0dcaRSMix1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5044  fHistoElePtvsV0dcaRSMix2 = new THnSparseF("fHistoElePtvsV0dcaRSMix2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5046  fHistoElePtvsV0dcaWS = new THnSparseF("fHistoElePtvsV0dcaWS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5048  fHistoElePtvsV0dcaWS1 = new THnSparseF("fHistoElePtvsV0dcaWS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5050  fHistoElePtvsV0dcaWS2 = new THnSparseF("fHistoElePtvsV0dcaWS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5052  fHistoElePtvsV0dcaWSSide = new THnSparseF("fHistoElePtvsV0dcaWSSide","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5054  fHistoElePtvsV0dcaWSSide1 = new THnSparseF("fHistoElePtvsV0dcaWSSide1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5056  fHistoElePtvsV0dcaWSSide2 = new THnSparseF("fHistoElePtvsV0dcaWSSide2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5058  fHistoElePtvsV0dcaWSMix = new THnSparseF("fHistoElePtvsV0dcaWSMix","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5060  fHistoElePtvsV0dcaWSMix1 = new THnSparseF("fHistoElePtvsV0dcaWSMix1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5062  fHistoElePtvsV0dcaWSMix2 = new THnSparseF("fHistoElePtvsV0dcaWSMix2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5064  fHistoElePtvsV0dcaMCS = new THnSparseF("fHistoElePtvsV0dcaMCS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5066  fHistoElePtvsV0dcaMCS1 = new THnSparseF("fHistoElePtvsV0dcaMCS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5068  fHistoElePtvsV0dcaMCS2 = new THnSparseF("fHistoElePtvsV0dcaMCS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5070  fHistoElePtvsV0dcaFeedDownXic0MCS = new THnSparseF("fHistoElePtvsV0dcaFeedDownXic0MCS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5072  fHistoElePtvsV0dcaFeedDownXic0MCS1 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXic0MCS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5074  fHistoElePtvsV0dcaFeedDownXic0MCS2 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXic0MCS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5076  fHistoElePtvsV0dcaFeedDownXicPlusMCS = new THnSparseF("fHistoElePtvsV0dcaFeedDownXicPlusMCS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5078  fHistoElePtvsV0dcaFeedDownXicPlusMCS1 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXicPlusMCS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5080  fHistoElePtvsV0dcaFeedDownXicPlusMCS2 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXicPlusMCS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5082 
5083  Int_t bins_elelamptvsv0dl[4]= {100 ,20 ,100, 10};
5084  Double_t xmin_elelamptvsv0dl[4]={0.,0. ,-0.5, 0.0};
5085  Double_t xmax_elelamptvsv0dl[4]={20.,40.,0.5 ,100};
5086  fHistoEleLambdaPtvsV0dlRS = new THnSparseF("fHistoEleLambdaPtvsV0dlRS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5088  fHistoEleLambdaPtvsV0dlRS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlRS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5090  fHistoEleLambdaPtvsV0dlRS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlRS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5092  fHistoEleLambdaPtvsV0dlRSSide = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5094  fHistoEleLambdaPtvsV0dlRSSide1 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5096  fHistoEleLambdaPtvsV0dlRSSide2 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5098  fHistoEleLambdaPtvsV0dlRSMix = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5100  fHistoEleLambdaPtvsV0dlRSMix1 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5102  fHistoEleLambdaPtvsV0dlRSMix2 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5104  fHistoEleLambdaPtvsV0dlWS = new THnSparseF("fHistoEleLambdaPtvsV0dlWS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5106  fHistoEleLambdaPtvsV0dlWS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlWS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5108  fHistoEleLambdaPtvsV0dlWS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlWS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5110  fHistoEleLambdaPtvsV0dlWSSide = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5112  fHistoEleLambdaPtvsV0dlWSSide1 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5114  fHistoEleLambdaPtvsV0dlWSSide2 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5116  fHistoEleLambdaPtvsV0dlWSMix = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5118  fHistoEleLambdaPtvsV0dlWSMix1 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5120  fHistoEleLambdaPtvsV0dlWSMix2 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5122  fHistoEleLambdaPtvsV0dlMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5124  fHistoEleLambdaPtvsV0dlMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5126  fHistoEleLambdaPtvsV0dlMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);