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