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