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