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