AliPhysics  a0db429 (a0db429)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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  fReconstructPrimVert(kFALSE),
114  fIsMB(kFALSE),
115  fIsSemi(kFALSE),
116  fIsCent(kFALSE),
117  fIsINT7(kFALSE),
118  fIsEMC7(kFALSE),
119  fCandidateVariables(),
120  fCandidateEleVariables(),
121  fCandidateV0Variables(),
122  fCandidateMCVariables(),
123  fCandidateMCEleVariables(),
124  fCandidateMCV0Variables(),
125  fCandidateMCGenPairVariables(),
126  fVtx1(0),
127  fV1(0),
128  fVtxZ(0),
129  fBzkG(0),
130  fCentrality(0),
131  fRunNumber(0),
132  fTriggerCheck(0),
133  fUseCentralityV0M(kFALSE),
134  fEvNumberCounter(0),
135  fMCEventType(-9999),
136  fMCDoPairAnalysis(kFALSE),
137  fHistoEleLambdaMass(0),
138  fHistoEleLambdaMassRS(0),
139  fHistoEleLambdaMassRS1(0),
140  fHistoEleLambdaMassRS2(0),
141  fHistoEleLambdaMassWS(0),
142  fHistoEleLambdaMassWS1(0),
143  fHistoEleLambdaMassWS2(0),
144  fHistoEleLambdaMassRSMix(0),
145  fHistoEleLambdaMassRSMix1(0),
146  fHistoEleLambdaMassRSMix2(0),
147  fHistoEleLambdaMassWSMix(0),
148  fHistoEleLambdaMassWSMix1(0),
149  fHistoEleLambdaMassWSMix2(0),
150  fHistoEleLambdaMassRSSide(0),
151  fHistoEleLambdaMassRSSide1(0),
152  fHistoEleLambdaMassRSSide2(0),
153  fHistoEleLambdaMassWSSide(0),
154  fHistoEleLambdaMassWSSide1(0),
155  fHistoEleLambdaMassWSSide2(0),
156  fHistoEleLambdaMassRSAway(0),
157  fHistoEleLambdaMassRS1Away(0),
158  fHistoEleLambdaMassRS2Away(0),
159  fHistoEleLambdaMassWSAway(0),
160  fHistoEleLambdaMassWS1Away(0),
161  fHistoEleLambdaMassWS2Away(0),
162  fHistoEleLambdaMassRSMixAway(0),
163  fHistoEleLambdaMassRSMix1Away(0),
164  fHistoEleLambdaMassRSMix2Away(0),
165  fHistoEleLambdaMassWSMixAway(0),
166  fHistoEleLambdaMassWSMix1Away(0),
167  fHistoEleLambdaMassWSMix2Away(0),
168  fHistoEleLambdaMassRSSideAway(0),
169  fHistoEleLambdaMassRSSide1Away(0),
170  fHistoEleLambdaMassRSSide2Away(0),
171  fHistoEleLambdaMassWSSideAway(0),
172  fHistoEleLambdaMassWSSide1Away(0),
173  fHistoEleLambdaMassWSSide2Away(0),
174  fHistoEleLambdaMassvsElePtRS(0),
175  fHistoEleLambdaMassvsElePtWS(0),
176  fHistoEleLambdaMassvsElePtRSMix(0),
177  fHistoEleLambdaMassvsElePtWSMix(0),
178  fHistoEleLambdaMassvsElePtRSSide(0),
179  fHistoEleLambdaMassvsElePtWSSide(0),
180  fHistoEleLambdaMassvsElePtRS1(0),
181  fHistoEleLambdaMassvsElePtWS1(0),
182  fHistoEleLambdaMassvsElePtRSMix1(0),
183  fHistoEleLambdaMassvsElePtWSMix1(0),
184  fHistoEleLambdaMassvsElePtRSSide1(0),
185  fHistoEleLambdaMassvsElePtWSSide1(0),
186  fHistoEleLambdaMassvsElePtRS2(0),
187  fHistoEleLambdaMassvsElePtWS2(0),
188  fHistoEleLambdaMassvsElePtRSMix2(0),
189  fHistoEleLambdaMassvsElePtWSMix2(0),
190  fHistoEleLambdaMassvsElePtRSSide2(0),
191  fHistoEleLambdaMassvsElePtWSSide2(0),
192  fHistoElePtRS(0),
193  fHistoElePtWS(0),
194  fHistoElePtRSMix(0),
195  fHistoElePtWSMix(0),
196  fHistoEleLambdaMassMCS(0),
197  fHistoEleLambdaMassMCGen(0),
198  fHistoEleLambdaMassvsElePtMCS(0),
199  fHistoEleLambdaMassvsElePtMCGen(0),
200  fHistoEleLambdaMassvsElePtMCS1(0),
201  fHistoEleLambdaMassvsElePtMCGen1(0),
202  fHistoEleLambdaMassvsElePtMCS2(0),
203  fHistoEleLambdaMassvsElePtMCGen2(0),
204  fHistoElePtMCS(0),
205  fHistoElePtMCGen(0),
206  fHistoElePtvsEtaRS(0),
207  fHistoElePtvsEtaWS(0),
208  fHistoElePtvsEtaRSMix(0),
209  fHistoElePtvsEtaWSMix(0),
210  fHistoElePtvsEtaMCS(0),
211  fHistoElePtvsEtaMCGen(0),
212  fHistoElePtvsLambdaPtRS(0),
213  fHistoElePtvsLambdaPtWS(0),
214  fHistoElePtvsLambdaPtRSMix(0),
215  fHistoElePtvsLambdaPtWSMix(0),
216  fHistoElePtvsLambdaPtMCS(0),
217  fHistoElePtvsLambdaPtvsLcPtMCS(0),
218  fHistoElePtvsLambdaPtMCGen(0),
219  fHistoElePtvsLambdaPtvsLcPtMCGen(0),
220  fHistoElePtvsLambdaPtMCLcGen(0),
221  fHistoElePtvsd0RS(0),
222  fHistoElePtvsd0WS(0),
223  fHistoElePtvsd0RSMix(0),
224  fHistoElePtvsd0WSMix(0),
225  fHistoElePtvsd0MCS(0),
226  fHistoElePtvsd0PromptMCS(0),
227  fHistoElePtvsd0BFeeddownMCS(0),
228  fHistoEleLambdaMassFeeddownXic0MCS(0),
229  fHistoEleLambdaMassFeeddownXic0MCGen(0),
230  fHistoEleLambdaMassvsElePtFeeddownXic0MCS(0),
231  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen(0),
232  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1(0),
233  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1(0),
234  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2(0),
235  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2(0),
236  fHistoElePtFeeddownXic0MCS(0),
237  fHistoElePtFeeddownXic0MCGen(0),
238  fHistoElePtvsEtaFeeddownXic0MCS(0),
239  fHistoElePtvsEtaFeeddownXic0MCGen(0),
240  fHistoElePtvsLambdaPtFeeddownXic0MCS(0),
241  fHistoElePtvsLambdaPtFeeddownXic0MCGen(0),
242  fHistoEleLambdaMassFeeddownXicPlusMCS(0),
243  fHistoEleLambdaMassFeeddownXicPlusMCGen(0),
244  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS(0),
245  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen(0),
246  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1(0),
247  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1(0),
248  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2(0),
249  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2(0),
250  fHistoElePtFeeddownXicPlusMCS(0),
251  fHistoElePtFeeddownXicPlusMCGen(0),
252  fHistoElePtvsEtaFeeddownXicPlusMCS(0),
253  fHistoElePtvsEtaFeeddownXicPlusMCGen(0),
254  fHistoElePtvsLambdaPtFeeddownXicPlusMCS(0),
255  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen(0),
256  fHistoBachPt(0),
257  fHistoBachPtMCS(0),
258  fHistoBachPtMCGen(0),
259  fHistod0Bach(0),
260  fHistoLambdaMassvsPt(0),
261  fHistoLambdaMassvsPtMCS(0),
262  fHistoLambdaMassvsPtMCGen(0),
263  fHistoLambdaPtvsDl(0),
264  fHistoLambdaPtvsDlSide(0),
265  fHistoLambdaPtvsDlMCS(0),
266  fHistoLambdaPtvsDlFeeddownXi0MCS(0),
267  fHistoLambdaPtvsDlFeeddownXiMinusMCS(0),
268  fHistoLambdaPtvsDlFeeddownOmegaMCS(0),
269  fHistoK0sMassvsPt(0),
270  fHistoElectronTPCPID(0),
271  fHistoElectronTOFPID(0),
272  fHistoElectronTPCSelPID(0),
273  fHistoElectronTOFSelPID(0),
274  fHistoElectronTPCPIDSelTOF(0),
275  fHistoElectronTPCPIDSelTOFSmallEta(0),
276  fHistoElectronTPCPIDSelTOFLargeEta(0),
277  fHistoMassConversionsMin(0),
278  fHistoMassConversionsSameSignMin(0),
279  fHistoElectronQovPtvsPhi(0),
280  fHistoLambdaQovPtvsPhi(0),
281  fHistoLcMCGen(0),
282  fHistoLcMCGen1(0),
283  fHistoLcMCGen2(0),
284  fHistoLcMCS(0),
285  fHistoLcMCS1(0),
286  fHistoLcMCS2(0),
287  fHistoFeedDownXic0MCGen(0),
288  fHistoFeedDownXic0MCGen1(0),
289  fHistoFeedDownXic0MCGen2(0),
290  fHistoFeedDownXic0MCS(0),
291  fHistoFeedDownXic0MCS1(0),
292  fHistoFeedDownXic0MCS2(0),
293  fHistoFeedDownXicPlusMCGen(0),
294  fHistoFeedDownXicPlusMCGen1(0),
295  fHistoFeedDownXicPlusMCGen2(0),
296  fHistoFeedDownXicPlusMCS(0),
297  fHistoFeedDownXicPlusMCS1(0),
298  fHistoFeedDownXicPlusMCS2(0),
299  fHistoFeedDownSigmaMCGen(0),
300  fHistoFeedDownSigmaMCGen1(0),
301  fHistoFeedDownSigmaMCGen2(0),
302  fHistoFeedDownSigmaMCS(0),
303  fHistoFeedDownSigmaMCS1(0),
304  fHistoFeedDownSigmaMCS2(0),
305  fHistoLcElectronMCGen(0),
306  fHistoLcElectronMCGen1(0),
307  fHistoLcElectronMCGen2(0),
308  fHistoLcElectronMCS(0),
309  fHistoLcElectronMCS1(0),
310  fHistoLcElectronMCS2(0),
311  fHistoElectronFeedDownXic0MCGen(0),
312  fHistoElectronFeedDownXic0MCGen1(0),
313  fHistoElectronFeedDownXic0MCGen2(0),
314  fHistoElectronFeedDownXic0MCS(0),
315  fHistoElectronFeedDownXic0MCS1(0),
316  fHistoElectronFeedDownXic0MCS2(0),
317  fHistoElectronFeedDownXicPlusMCGen(0),
318  fHistoElectronFeedDownXicPlusMCGen1(0),
319  fHistoElectronFeedDownXicPlusMCGen2(0),
320  fHistoElectronFeedDownXicPlusMCS(0),
321  fHistoElectronFeedDownXicPlusMCS1(0),
322  fHistoElectronFeedDownXicPlusMCS2(0),
323  fHistoElectronMCGen(0),
324  fHistoLambdaMCGen(0),
325  fHistoElePtvsV0dlRS(0),
326  fHistoElePtvsV0dlRS1(0),
327  fHistoElePtvsV0dlRS2(0),
328  fHistoElePtvsV0dlRSSide(0),
329  fHistoElePtvsV0dlRSSide1(0),
330  fHistoElePtvsV0dlRSSide2(0),
331  fHistoElePtvsV0dlRSMix(0),
332  fHistoElePtvsV0dlRSMix1(0),
333  fHistoElePtvsV0dlRSMix2(0),
334  fHistoElePtvsV0dlWS(0),
335  fHistoElePtvsV0dlWS1(0),
336  fHistoElePtvsV0dlWS2(0),
337  fHistoElePtvsV0dlWSSide(0),
338  fHistoElePtvsV0dlWSSide1(0),
339  fHistoElePtvsV0dlWSSide2(0),
340  fHistoElePtvsV0dlWSMix(0),
341  fHistoElePtvsV0dlWSMix1(0),
342  fHistoElePtvsV0dlWSMix2(0),
343  fHistoElePtvsV0dlMCS(0),
344  fHistoElePtvsV0dlMCS1(0),
345  fHistoElePtvsV0dlMCS2(0),
346  fHistoElePtvsV0dlFeedDownXic0MCS(0),
347  fHistoElePtvsV0dlFeedDownXic0MCS1(0),
348  fHistoElePtvsV0dlFeedDownXic0MCS2(0),
349  fHistoElePtvsV0dlFeedDownXicPlusMCS(0),
350  fHistoElePtvsV0dlFeedDownXicPlusMCS1(0),
351  fHistoElePtvsV0dlFeedDownXicPlusMCS2(0),
352  fHistoElePtvsV0dcaRS(0),
353  fHistoElePtvsV0dcaRS1(0),
354  fHistoElePtvsV0dcaRS2(0),
355  fHistoElePtvsV0dcaRSSide(0),
356  fHistoElePtvsV0dcaRSSide1(0),
357  fHistoElePtvsV0dcaRSSide2(0),
358  fHistoElePtvsV0dcaRSMix(0),
359  fHistoElePtvsV0dcaRSMix1(0),
360  fHistoElePtvsV0dcaRSMix2(0),
361  fHistoElePtvsV0dcaWS(0),
362  fHistoElePtvsV0dcaWS1(0),
363  fHistoElePtvsV0dcaWS2(0),
364  fHistoElePtvsV0dcaWSSide(0),
365  fHistoElePtvsV0dcaWSSide1(0),
366  fHistoElePtvsV0dcaWSSide2(0),
367  fHistoElePtvsV0dcaWSMix(0),
368  fHistoElePtvsV0dcaWSMix1(0),
369  fHistoElePtvsV0dcaWSMix2(0),
370  fHistoElePtvsV0dcaMCS(0),
371  fHistoElePtvsV0dcaMCS1(0),
372  fHistoElePtvsV0dcaMCS2(0),
373  fHistoElePtvsV0dcaFeedDownXic0MCS(0),
374  fHistoElePtvsV0dcaFeedDownXic0MCS1(0),
375  fHistoElePtvsV0dcaFeedDownXic0MCS2(0),
376  fHistoElePtvsV0dcaFeedDownXicPlusMCS(0),
377  fHistoElePtvsV0dcaFeedDownXicPlusMCS1(0),
378  fHistoElePtvsV0dcaFeedDownXicPlusMCS2(0),
379  fHistoEleLambdaPtvsV0dlRS(0),
380  fHistoEleLambdaPtvsV0dlRS1(0),
381  fHistoEleLambdaPtvsV0dlRS2(0),
382  fHistoEleLambdaPtvsV0dlRSSide(0),
383  fHistoEleLambdaPtvsV0dlRSSide1(0),
384  fHistoEleLambdaPtvsV0dlRSSide2(0),
385  fHistoEleLambdaPtvsV0dlRSMix(0),
386  fHistoEleLambdaPtvsV0dlRSMix1(0),
387  fHistoEleLambdaPtvsV0dlRSMix2(0),
388  fHistoEleLambdaPtvsV0dlWS(0),
389  fHistoEleLambdaPtvsV0dlWS1(0),
390  fHistoEleLambdaPtvsV0dlWS2(0),
391  fHistoEleLambdaPtvsV0dlWSSide(0),
392  fHistoEleLambdaPtvsV0dlWSSide1(0),
393  fHistoEleLambdaPtvsV0dlWSSide2(0),
394  fHistoEleLambdaPtvsV0dlWSMix(0),
395  fHistoEleLambdaPtvsV0dlWSMix1(0),
396  fHistoEleLambdaPtvsV0dlWSMix2(0),
397  fHistoEleLambdaPtvsV0dlMCS(0),
398  fHistoEleLambdaPtvsV0dlMCS1(0),
399  fHistoEleLambdaPtvsV0dlMCS2(0),
400  fHistoEleLambdaPtvsV0dlPromptMCS(0),
401  fHistoEleLambdaPtvsV0dlPromptMCS1(0),
402  fHistoEleLambdaPtvsV0dlPromptMCS2(0),
403  fHistoEleLambdaPtvsV0dlBFeeddownMCS(0),
404  fHistoEleLambdaPtvsV0dlBFeeddownMCS1(0),
405  fHistoEleLambdaPtvsV0dlBFeeddownMCS2(0),
406  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS(0),
407  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1(0),
408  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2(0),
409  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS(0),
410  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS1(0),
411  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS2(0),
412  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS(0),
413  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS1(0),
414  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS2(0),
415  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS(0),
416  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1(0),
417  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2(0),
418  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS(0),
419  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS1(0),
420  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS2(0),
421  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS(0),
422  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS1(0),
423  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS2(0),
424  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS(0),
425  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS1(0),
426  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS2(0),
427  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS(0),
428  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS1(0),
429  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS2(0),
430  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS(0),
431  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS1(0),
432  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS2(0),
433  fHistoEleLambdaPtvsV0dlRSAway(0),
434  fHistoEleLambdaPtvsV0dlRS1Away(0),
435  fHistoEleLambdaPtvsV0dlRS2Away(0),
436  fHistoEleLambdaPtvsV0dlRSSideAway(0),
437  fHistoEleLambdaPtvsV0dlRSSide1Away(0),
438  fHistoEleLambdaPtvsV0dlRSSide2Away(0),
439  fHistoEleLambdaPtvsV0dlRSMixAway(0),
440  fHistoEleLambdaPtvsV0dlRSMix1Away(0),
441  fHistoEleLambdaPtvsV0dlRSMix2Away(0),
442  fHistoEleLambdaPtvsV0dlWSAway(0),
443  fHistoEleLambdaPtvsV0dlWS1Away(0),
444  fHistoEleLambdaPtvsV0dlWS2Away(0),
445  fHistoEleLambdaPtvsV0dlWSSideAway(0),
446  fHistoEleLambdaPtvsV0dlWSSide1Away(0),
447  fHistoEleLambdaPtvsV0dlWSSide2Away(0),
448  fHistoEleLambdaPtvsV0dlWSMixAway(0),
449  fHistoEleLambdaPtvsV0dlWSMix1Away(0),
450  fHistoEleLambdaPtvsV0dlWSMix2Away(0),
451  fHistoResponseElePt(0),
452  fHistoResponseElePt1(0),
453  fHistoResponseElePt2(0),
454  fHistoResponseEleLambdaPt(0),
455  fHistoResponseEleLambdaPt1(0),
456  fHistoResponseEleLambdaPt2(0),
457  fHistoResponseEleLambdaPtFeeddownXic0(0),
458  fHistoResponseEleLambdaPtFeeddownXic01(0),
459  fHistoResponseEleLambdaPtFeeddownXic02(0),
460  fHistoResponseEleLambdaPtFeeddownXicPlus(0),
461  fHistoResponseEleLambdaPtFeeddownXicPlus1(0),
462  fHistoResponseEleLambdaPtFeeddownXicPlus2(0),
463  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt(0),
464  fHistoEleLambdaPtvsRapidityRS(0),
465  fHistoEleLambdaPtvsRapidityWS(0),
466  fHistoEleLambdaPtvsRapidityMCS(0),
467  fCounter(0),
468  fHistonEvtvsRunNumber(0),
469  fHistonElevsRunNumber(0),
470  fHistonLambdavsRunNumber(0),
471  fHistoMCEventType(0),
472  fHistoMCDeltaPhiccbar(0),
473  fDoEventMixing(0),
474  fNumberOfEventsForMixing (5),
475  fNzVtxBins (0),
476  fNCentBins (0),
477  fNOfPools(1),
478  fEventBuffer(0x0),
479  fEventInfo(0x0),
480  fElectronTracks(0x0),
481  fV0Tracks1(0x0),
482  fV0Tracks2(0x0),
483  fV0dlArray1(0x0),
484  fV0dlArray2(0x0),
485  fV0dcaArray1(0x0),
486  fV0dcaArray2(0x0)
487 {
488  //
490  //
491  for(Int_t i=0;i<17;i++){
492  fHistoElePtvsCutVarsRS[i] = 0;
493  fHistoElePtvsCutVarsWS[i] = 0;
495  }
496  for(Int_t i=0;i<8;i++){
498  }
499 }
500 
501 //___________________________________________________________________________
504  Bool_t writeVariableTree) :
505  AliAnalysisTaskSE(name),
506  fUseMCInfo(kFALSE),
507  fOutput(0),
508  fOutputAll(0),
509  fListCuts(0),
510  fCEvents(0),
511  fHTrigger(0),
512  fHCentrality(0),
513  fAnalCuts(analCuts),
514  fIsEventSelected(kFALSE),
515  fWriteVariableTree(writeVariableTree),
516  fWriteEachVariableTree(kFALSE),
517  fWriteMCVariableTree(kFALSE),
518  fVariablesTree(0),
519  fEleVariablesTree(0),
520  fV0VariablesTree(0),
521  fMCVariablesTree(0),
522  fMCEleVariablesTree(0),
523  fMCV0VariablesTree(0),
524  fMCGenPairVariablesTree(0),
525  fReconstructPrimVert(kFALSE),
526  fIsMB(kFALSE),
527  fIsSemi(kFALSE),
528  fIsCent(kFALSE),
529  fIsINT7(kFALSE),
530  fIsEMC7(kFALSE),
531  fCandidateVariables(),
532  fCandidateEleVariables(),
533  fCandidateV0Variables(),
534  fCandidateMCVariables(),
535  fCandidateMCEleVariables(),
536  fCandidateMCV0Variables(),
537  fCandidateMCGenPairVariables(),
538  fVtx1(0),
539  fV1(0),
540  fVtxZ(0),
541  fBzkG(0),
542  fCentrality(0),
543  fRunNumber(0),
544  fTriggerCheck(0),
545  fUseCentralityV0M(kFALSE),
546  fEvNumberCounter(0),
547  fMCEventType(-9999),
548  fMCDoPairAnalysis(kFALSE),
549  fHistoEleLambdaMass(0),
550  fHistoEleLambdaMassRS(0),
551  fHistoEleLambdaMassRS1(0),
552  fHistoEleLambdaMassRS2(0),
553  fHistoEleLambdaMassWS(0),
554  fHistoEleLambdaMassWS1(0),
555  fHistoEleLambdaMassWS2(0),
556  fHistoEleLambdaMassRSMix(0),
557  fHistoEleLambdaMassRSMix1(0),
558  fHistoEleLambdaMassRSMix2(0),
559  fHistoEleLambdaMassWSMix(0),
560  fHistoEleLambdaMassWSMix1(0),
561  fHistoEleLambdaMassWSMix2(0),
562  fHistoEleLambdaMassRSSide(0),
563  fHistoEleLambdaMassRSSide1(0),
564  fHistoEleLambdaMassRSSide2(0),
565  fHistoEleLambdaMassWSSide(0),
566  fHistoEleLambdaMassWSSide1(0),
567  fHistoEleLambdaMassWSSide2(0),
568  fHistoEleLambdaMassRSAway(0),
569  fHistoEleLambdaMassRS1Away(0),
570  fHistoEleLambdaMassRS2Away(0),
571  fHistoEleLambdaMassWSAway(0),
572  fHistoEleLambdaMassWS1Away(0),
573  fHistoEleLambdaMassWS2Away(0),
574  fHistoEleLambdaMassRSMixAway(0),
575  fHistoEleLambdaMassRSMix1Away(0),
576  fHistoEleLambdaMassRSMix2Away(0),
577  fHistoEleLambdaMassWSMixAway(0),
578  fHistoEleLambdaMassWSMix1Away(0),
579  fHistoEleLambdaMassWSMix2Away(0),
580  fHistoEleLambdaMassRSSideAway(0),
581  fHistoEleLambdaMassRSSide1Away(0),
582  fHistoEleLambdaMassRSSide2Away(0),
583  fHistoEleLambdaMassWSSideAway(0),
584  fHistoEleLambdaMassWSSide1Away(0),
585  fHistoEleLambdaMassWSSide2Away(0),
586  fHistoEleLambdaMassvsElePtRS(0),
587  fHistoEleLambdaMassvsElePtWS(0),
588  fHistoEleLambdaMassvsElePtRSMix(0),
589  fHistoEleLambdaMassvsElePtWSMix(0),
590  fHistoEleLambdaMassvsElePtRSSide(0),
591  fHistoEleLambdaMassvsElePtWSSide(0),
592  fHistoEleLambdaMassvsElePtRS1(0),
593  fHistoEleLambdaMassvsElePtWS1(0),
594  fHistoEleLambdaMassvsElePtRSMix1(0),
595  fHistoEleLambdaMassvsElePtWSMix1(0),
596  fHistoEleLambdaMassvsElePtRSSide1(0),
597  fHistoEleLambdaMassvsElePtWSSide1(0),
598  fHistoEleLambdaMassvsElePtRS2(0),
599  fHistoEleLambdaMassvsElePtWS2(0),
600  fHistoEleLambdaMassvsElePtRSMix2(0),
601  fHistoEleLambdaMassvsElePtWSMix2(0),
602  fHistoEleLambdaMassvsElePtRSSide2(0),
603  fHistoEleLambdaMassvsElePtWSSide2(0),
604  fHistoElePtRS(0),
605  fHistoElePtWS(0),
606  fHistoElePtRSMix(0),
607  fHistoElePtWSMix(0),
608  fHistoEleLambdaMassMCS(0),
609  fHistoEleLambdaMassMCGen(0),
610  fHistoEleLambdaMassvsElePtMCS(0),
611  fHistoEleLambdaMassvsElePtMCGen(0),
612  fHistoEleLambdaMassvsElePtMCS1(0),
613  fHistoEleLambdaMassvsElePtMCGen1(0),
614  fHistoEleLambdaMassvsElePtMCS2(0),
615  fHistoEleLambdaMassvsElePtMCGen2(0),
616  fHistoElePtMCS(0),
617  fHistoElePtMCGen(0),
618  fHistoElePtvsEtaRS(0),
619  fHistoElePtvsEtaWS(0),
620  fHistoElePtvsEtaRSMix(0),
621  fHistoElePtvsEtaWSMix(0),
622  fHistoElePtvsEtaMCS(0),
623  fHistoElePtvsEtaMCGen(0),
624  fHistoElePtvsLambdaPtRS(0),
625  fHistoElePtvsLambdaPtWS(0),
626  fHistoElePtvsLambdaPtRSMix(0),
627  fHistoElePtvsLambdaPtWSMix(0),
628  fHistoElePtvsLambdaPtMCS(0),
629  fHistoElePtvsLambdaPtvsLcPtMCS(0),
630  fHistoElePtvsLambdaPtMCGen(0),
631  fHistoElePtvsLambdaPtvsLcPtMCGen(0),
632  fHistoElePtvsLambdaPtMCLcGen(0),
633  fHistoElePtvsd0RS(0),
634  fHistoElePtvsd0WS(0),
635  fHistoElePtvsd0RSMix(0),
636  fHistoElePtvsd0WSMix(0),
637  fHistoElePtvsd0MCS(0),
638  fHistoElePtvsd0PromptMCS(0),
639  fHistoElePtvsd0BFeeddownMCS(0),
640  fHistoEleLambdaMassFeeddownXic0MCS(0),
641  fHistoEleLambdaMassFeeddownXic0MCGen(0),
642  fHistoEleLambdaMassvsElePtFeeddownXic0MCS(0),
643  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen(0),
644  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1(0),
645  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1(0),
646  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2(0),
647  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2(0),
648  fHistoElePtFeeddownXic0MCS(0),
649  fHistoElePtFeeddownXic0MCGen(0),
650  fHistoElePtvsEtaFeeddownXic0MCS(0),
651  fHistoElePtvsEtaFeeddownXic0MCGen(0),
652  fHistoElePtvsLambdaPtFeeddownXic0MCS(0),
653  fHistoElePtvsLambdaPtFeeddownXic0MCGen(0),
654  fHistoEleLambdaMassFeeddownXicPlusMCS(0),
655  fHistoEleLambdaMassFeeddownXicPlusMCGen(0),
656  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS(0),
657  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen(0),
658  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1(0),
659  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1(0),
660  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2(0),
661  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2(0),
662  fHistoElePtFeeddownXicPlusMCS(0),
663  fHistoElePtFeeddownXicPlusMCGen(0),
664  fHistoElePtvsEtaFeeddownXicPlusMCS(0),
665  fHistoElePtvsEtaFeeddownXicPlusMCGen(0),
666  fHistoElePtvsLambdaPtFeeddownXicPlusMCS(0),
667  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen(0),
668  fHistoBachPt(0),
669  fHistoBachPtMCS(0),
670  fHistoBachPtMCGen(0),
671  fHistod0Bach(0),
672  fHistoLambdaMassvsPt(0),
673  fHistoLambdaMassvsPtMCS(0),
674  fHistoLambdaMassvsPtMCGen(0),
675  fHistoLambdaPtvsDl(0),
676  fHistoLambdaPtvsDlSide(0),
677  fHistoLambdaPtvsDlMCS(0),
678  fHistoLambdaPtvsDlFeeddownXi0MCS(0),
679  fHistoLambdaPtvsDlFeeddownXiMinusMCS(0),
680  fHistoLambdaPtvsDlFeeddownOmegaMCS(0),
681  fHistoK0sMassvsPt(0),
682  fHistoElectronTPCPID(0),
683  fHistoElectronTOFPID(0),
684  fHistoElectronTPCSelPID(0),
685  fHistoElectronTOFSelPID(0),
686  fHistoElectronTPCPIDSelTOF(0),
687  fHistoElectronTPCPIDSelTOFSmallEta(0),
688  fHistoElectronTPCPIDSelTOFLargeEta(0),
689  fHistoMassConversionsMin(0),
690  fHistoMassConversionsSameSignMin(0),
691  fHistoElectronQovPtvsPhi(0),
692  fHistoLambdaQovPtvsPhi(0),
693  fHistoLcMCGen(0),
694  fHistoLcMCGen1(0),
695  fHistoLcMCGen2(0),
696  fHistoLcMCS(0),
697  fHistoLcMCS1(0),
698  fHistoLcMCS2(0),
699  fHistoFeedDownXic0MCGen(0),
700  fHistoFeedDownXic0MCGen1(0),
701  fHistoFeedDownXic0MCGen2(0),
702  fHistoFeedDownXic0MCS(0),
703  fHistoFeedDownXic0MCS1(0),
704  fHistoFeedDownXic0MCS2(0),
705  fHistoFeedDownXicPlusMCGen(0),
706  fHistoFeedDownXicPlusMCGen1(0),
707  fHistoFeedDownXicPlusMCGen2(0),
708  fHistoFeedDownXicPlusMCS(0),
709  fHistoFeedDownXicPlusMCS1(0),
710  fHistoFeedDownXicPlusMCS2(0),
711  fHistoFeedDownSigmaMCGen(0),
712  fHistoFeedDownSigmaMCGen1(0),
713  fHistoFeedDownSigmaMCGen2(0),
714  fHistoFeedDownSigmaMCS(0),
715  fHistoFeedDownSigmaMCS1(0),
716  fHistoFeedDownSigmaMCS2(0),
717  fHistoLcElectronMCGen(0),
718  fHistoLcElectronMCGen1(0),
719  fHistoLcElectronMCGen2(0),
720  fHistoLcElectronMCS(0),
721  fHistoLcElectronMCS1(0),
722  fHistoLcElectronMCS2(0),
723  fHistoElectronFeedDownXic0MCGen(0),
724  fHistoElectronFeedDownXic0MCGen1(0),
725  fHistoElectronFeedDownXic0MCGen2(0),
726  fHistoElectronFeedDownXic0MCS(0),
727  fHistoElectronFeedDownXic0MCS1(0),
728  fHistoElectronFeedDownXic0MCS2(0),
729  fHistoElectronFeedDownXicPlusMCGen(0),
730  fHistoElectronFeedDownXicPlusMCGen1(0),
731  fHistoElectronFeedDownXicPlusMCGen2(0),
732  fHistoElectronFeedDownXicPlusMCS(0),
733  fHistoElectronFeedDownXicPlusMCS1(0),
734  fHistoElectronFeedDownXicPlusMCS2(0),
735  fHistoElectronMCGen(0),
736  fHistoLambdaMCGen(0),
737  fHistoElePtvsV0dlRS(0),
738  fHistoElePtvsV0dlRS1(0),
739  fHistoElePtvsV0dlRS2(0),
740  fHistoElePtvsV0dlRSSide(0),
741  fHistoElePtvsV0dlRSSide1(0),
742  fHistoElePtvsV0dlRSSide2(0),
743  fHistoElePtvsV0dlRSMix(0),
744  fHistoElePtvsV0dlRSMix1(0),
745  fHistoElePtvsV0dlRSMix2(0),
746  fHistoElePtvsV0dlWS(0),
747  fHistoElePtvsV0dlWS1(0),
748  fHistoElePtvsV0dlWS2(0),
749  fHistoElePtvsV0dlWSSide(0),
750  fHistoElePtvsV0dlWSSide1(0),
751  fHistoElePtvsV0dlWSSide2(0),
752  fHistoElePtvsV0dlWSMix(0),
753  fHistoElePtvsV0dlWSMix1(0),
754  fHistoElePtvsV0dlWSMix2(0),
755  fHistoElePtvsV0dlMCS(0),
756  fHistoElePtvsV0dlMCS1(0),
757  fHistoElePtvsV0dlMCS2(0),
758  fHistoElePtvsV0dlFeedDownXic0MCS(0),
759  fHistoElePtvsV0dlFeedDownXic0MCS1(0),
760  fHistoElePtvsV0dlFeedDownXic0MCS2(0),
761  fHistoElePtvsV0dlFeedDownXicPlusMCS(0),
762  fHistoElePtvsV0dlFeedDownXicPlusMCS1(0),
763  fHistoElePtvsV0dlFeedDownXicPlusMCS2(0),
764  fHistoElePtvsV0dcaRS(0),
765  fHistoElePtvsV0dcaRS1(0),
766  fHistoElePtvsV0dcaRS2(0),
767  fHistoElePtvsV0dcaRSSide(0),
768  fHistoElePtvsV0dcaRSSide1(0),
769  fHistoElePtvsV0dcaRSSide2(0),
770  fHistoElePtvsV0dcaRSMix(0),
771  fHistoElePtvsV0dcaRSMix1(0),
772  fHistoElePtvsV0dcaRSMix2(0),
773  fHistoElePtvsV0dcaWS(0),
774  fHistoElePtvsV0dcaWS1(0),
775  fHistoElePtvsV0dcaWS2(0),
776  fHistoElePtvsV0dcaWSSide(0),
777  fHistoElePtvsV0dcaWSSide1(0),
778  fHistoElePtvsV0dcaWSSide2(0),
779  fHistoElePtvsV0dcaWSMix(0),
780  fHistoElePtvsV0dcaWSMix1(0),
781  fHistoElePtvsV0dcaWSMix2(0),
782  fHistoElePtvsV0dcaMCS(0),
783  fHistoElePtvsV0dcaMCS1(0),
784  fHistoElePtvsV0dcaMCS2(0),
785  fHistoElePtvsV0dcaFeedDownXic0MCS(0),
786  fHistoElePtvsV0dcaFeedDownXic0MCS1(0),
787  fHistoElePtvsV0dcaFeedDownXic0MCS2(0),
788  fHistoElePtvsV0dcaFeedDownXicPlusMCS(0),
789  fHistoElePtvsV0dcaFeedDownXicPlusMCS1(0),
790  fHistoElePtvsV0dcaFeedDownXicPlusMCS2(0),
791  fHistoEleLambdaPtvsV0dlRS(0),
792  fHistoEleLambdaPtvsV0dlRS1(0),
793  fHistoEleLambdaPtvsV0dlRS2(0),
794  fHistoEleLambdaPtvsV0dlRSSide(0),
795  fHistoEleLambdaPtvsV0dlRSSide1(0),
796  fHistoEleLambdaPtvsV0dlRSSide2(0),
797  fHistoEleLambdaPtvsV0dlRSMix(0),
798  fHistoEleLambdaPtvsV0dlRSMix1(0),
799  fHistoEleLambdaPtvsV0dlRSMix2(0),
800  fHistoEleLambdaPtvsV0dlWS(0),
801  fHistoEleLambdaPtvsV0dlWS1(0),
802  fHistoEleLambdaPtvsV0dlWS2(0),
803  fHistoEleLambdaPtvsV0dlWSSide(0),
804  fHistoEleLambdaPtvsV0dlWSSide1(0),
805  fHistoEleLambdaPtvsV0dlWSSide2(0),
806  fHistoEleLambdaPtvsV0dlWSMix(0),
807  fHistoEleLambdaPtvsV0dlWSMix1(0),
808  fHistoEleLambdaPtvsV0dlWSMix2(0),
809  fHistoEleLambdaPtvsV0dlMCS(0),
810  fHistoEleLambdaPtvsV0dlMCS1(0),
811  fHistoEleLambdaPtvsV0dlMCS2(0),
812  fHistoEleLambdaPtvsV0dlPromptMCS(0),
813  fHistoEleLambdaPtvsV0dlPromptMCS1(0),
814  fHistoEleLambdaPtvsV0dlPromptMCS2(0),
815  fHistoEleLambdaPtvsV0dlBFeeddownMCS(0),
816  fHistoEleLambdaPtvsV0dlBFeeddownMCS1(0),
817  fHistoEleLambdaPtvsV0dlBFeeddownMCS2(0),
818  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS(0),
819  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1(0),
820  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2(0),
821  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS(0),
822  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS1(0),
823  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS2(0),
824  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS(0),
825  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS1(0),
826  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS2(0),
827  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS(0),
828  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1(0),
829  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2(0),
830  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS(0),
831  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS1(0),
832  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS2(0),
833  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS(0),
834  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS1(0),
835  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS2(0),
836  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS(0),
837  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS1(0),
838  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS2(0),
839  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS(0),
840  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS1(0),
841  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS2(0),
842  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS(0),
843  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS1(0),
844  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS2(0),
845  fHistoEleLambdaPtvsV0dlRSAway(0),
846  fHistoEleLambdaPtvsV0dlRS1Away(0),
847  fHistoEleLambdaPtvsV0dlRS2Away(0),
848  fHistoEleLambdaPtvsV0dlRSSideAway(0),
849  fHistoEleLambdaPtvsV0dlRSSide1Away(0),
850  fHistoEleLambdaPtvsV0dlRSSide2Away(0),
851  fHistoEleLambdaPtvsV0dlRSMixAway(0),
852  fHistoEleLambdaPtvsV0dlRSMix1Away(0),
853  fHistoEleLambdaPtvsV0dlRSMix2Away(0),
854  fHistoEleLambdaPtvsV0dlWSAway(0),
855  fHistoEleLambdaPtvsV0dlWS1Away(0),
856  fHistoEleLambdaPtvsV0dlWS2Away(0),
857  fHistoEleLambdaPtvsV0dlWSSideAway(0),
858  fHistoEleLambdaPtvsV0dlWSSide1Away(0),
859  fHistoEleLambdaPtvsV0dlWSSide2Away(0),
860  fHistoEleLambdaPtvsV0dlWSMixAway(0),
861  fHistoEleLambdaPtvsV0dlWSMix1Away(0),
862  fHistoEleLambdaPtvsV0dlWSMix2Away(0),
863  fHistoResponseElePt(0),
864  fHistoResponseElePt1(0),
865  fHistoResponseElePt2(0),
866  fHistoResponseEleLambdaPt(0),
867  fHistoResponseEleLambdaPt1(0),
868  fHistoResponseEleLambdaPt2(0),
869  fHistoResponseEleLambdaPtFeeddownXic0(0),
870  fHistoResponseEleLambdaPtFeeddownXic01(0),
871  fHistoResponseEleLambdaPtFeeddownXic02(0),
872  fHistoResponseEleLambdaPtFeeddownXicPlus(0),
873  fHistoResponseEleLambdaPtFeeddownXicPlus1(0),
874  fHistoResponseEleLambdaPtFeeddownXicPlus2(0),
875  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt(0),
876  fHistoEleLambdaPtvsRapidityRS(0),
877  fHistoEleLambdaPtvsRapidityWS(0),
878  fHistoEleLambdaPtvsRapidityMCS(0),
879  fCounter(0),
880  fHistonEvtvsRunNumber(0),
881  fHistonElevsRunNumber(0),
882  fHistonLambdavsRunNumber(0),
883  fHistoMCEventType(0),
884  fHistoMCDeltaPhiccbar(0),
885  fDoEventMixing(0),
886  fNumberOfEventsForMixing (5),
887  fNzVtxBins (0),
888  fNCentBins (0),
889  fNOfPools(1),
890  fEventBuffer(0x0),
891  fEventInfo(0x0),
892  fElectronTracks(0x0),
893  fV0Tracks1(0x0),
894  fV0Tracks2(0x0),
895  fV0dlArray1(0x0),
896  fV0dlArray2(0x0),
897  fV0dcaArray1(0x0),
898  fV0dcaArray2(0x0)
899 {
900  //
902  //
903  Info("AliAnalysisTaskSELc2eleLambdafromAODtracks","Calling Constructor");
904 
905  for(Int_t i=0;i<17;i++){
906  fHistoElePtvsCutVarsRS[i] = 0;
907  fHistoElePtvsCutVarsWS[i] = 0;
909  }
910  for(Int_t i=0;i<8;i++){
912  }
913 
914  DefineOutput(1,TList::Class()); //conters
915  DefineOutput(2,TList::Class());
916  DefineOutput(3,TList::Class()); //conters
917  DefineOutput(4,TTree::Class()); //My private output
918  DefineOutput(5,TTree::Class()); //My private output
919  DefineOutput(6,TTree::Class()); //My private output
920  DefineOutput(7,TTree::Class()); //My private output
921  DefineOutput(8,AliNormalizationCounter::Class());
922  DefineOutput(9,TTree::Class()); //My private output
923  DefineOutput(10,TTree::Class()); //My private output
924  DefineOutput(11,TTree::Class()); //My private output
925 }
926 
927 //___________________________________________________________________________
929  //
931  //
932  Info("~AliAnalysisTaskSELc2eleLambdafromAODtracks","Calling Destructor");
933 
934  if (fOutput) {
935  delete fOutput;
936  fOutput = 0;
937  }
938 
939  if (fOutputAll) {
940  delete fOutputAll;
941  fOutputAll = 0;
942  }
943 
944  if (fListCuts) {
945  delete fListCuts;
946  fListCuts = 0;
947  }
948 
949 
950  if (fAnalCuts) {
951  delete fAnalCuts;
952  fAnalCuts = 0;
953  }
954 
955  if (fVariablesTree) {
956  delete fVariablesTree;
957  fVariablesTree = 0;
958  }
959  if (fEleVariablesTree) {
960  delete fEleVariablesTree;
961  fEleVariablesTree = 0;
962  }
963  if (fV0VariablesTree) {
964  delete fV0VariablesTree;
965  fV0VariablesTree = 0;
966  }
967  if (fMCVariablesTree) {
968  delete fMCVariablesTree;
969  fMCVariablesTree = 0;
970  }
971  if (fMCEleVariablesTree) {
972  delete fMCEleVariablesTree;
974  }
975  if (fMCV0VariablesTree) {
976  delete fMCV0VariablesTree;
977  fMCV0VariablesTree = 0;
978  }
982  }
983  if(fCounter){
984  delete fCounter;
985  fCounter = 0;
986  }
987 
988  if(fElectronTracks) fElectronTracks->Delete();
989  delete fElectronTracks;
990  if(fV0Tracks1) fV0Tracks1->Delete();
991  delete fV0Tracks1;
992  if(fV0Tracks2) fV0Tracks2->Delete();
993  delete fV0Tracks2;
994  if(fEventBuffer){
995  for(Int_t i=0; i<fNOfPools; i++) delete fEventBuffer[i];
996  delete fEventBuffer;
997  }
998  delete fEventInfo;
999 }
1000 
1001 //_________________________________________________
1003  //
1005  //
1006  //
1007 
1008  fIsEventSelected=kFALSE;
1009 
1010  if (fDebug > 1) AliInfo("Init");
1011 
1012  fListCuts = new TList();
1013  fListCuts->SetOwner();
1014  fListCuts->SetName("ListCuts");
1016  PostData(2,fListCuts);
1017 
1018  return;
1019 }
1020 
1021 //_________________________________________________
1023 {
1024  //
1026  //
1027 
1028  if (!fInputEvent) {
1029  AliError("NO EVENT FOUND!");
1030  return;
1031  }
1032  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
1033  fCEvents->Fill(1);
1034  fEvNumberCounter++;
1035 
1036  //------------------------------------------------
1037  // First check if the event has proper B
1038  //------------------------------------------------
1039 
1040  fBzkG = (Double_t)aodEvent->GetMagneticField();
1041  AliKFParticle::SetField(fBzkG);
1042  if (TMath::Abs(fBzkG)<0.001) {
1043  return;
1044  }
1045  fCEvents->Fill(2);
1046 
1049 
1050  //------------------------------------------------
1051  // MC analysis setting
1052  //------------------------------------------------
1053  TClonesArray *mcArray = 0;
1054  AliAODMCHeader *mcHeader=0;
1055  if (fUseMCInfo) {
1056  // MC array need for maching
1057  mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
1058  if (!mcArray) {
1059  AliError("Could not find Monte-Carlo in AOD");
1060  return;
1061  }
1062  fCEvents->Fill(6); // in case of MC events
1063 
1064  // load MC header
1065  mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1066  if (!mcHeader) {
1067  AliError("AliAnalysisTaskSELc2eleLambdafromAODtracks::UserExec: MC header branch not found!\n");
1068  return;
1069  }
1070  fCEvents->Fill(7); // in case of MC events
1071 
1072  Double_t zMCVertex = mcHeader->GetVtxZ();
1073  if (TMath::Abs(zMCVertex) > fAnalCuts->GetMaxVtxZ()) {
1074  AliDebug(2,Form("Event rejected: abs(zVtxMC)=%f > fAnalCuts->GetMaxVtxZ()=%f",zMCVertex,fAnalCuts->GetMaxVtxZ()));
1075  return;
1076  } else {
1077  fCEvents->Fill(17); // in case of MC events
1078  }
1079  if ((TMath::Abs(zMCVertex) < fAnalCuts->GetMaxVtxZ()) && (!fAnalCuts->IsEventRejectedDuePhysicsSelection()) && (!fAnalCuts->IsEventRejectedDueToTrigger())) {
1080  Bool_t selevt = MakeMCAnalysis(mcArray);
1081  if(!selevt) return;
1082  }
1083  }
1084 
1085  //------------------------------------------------
1086  // Event selection
1087  //------------------------------------------------
1088  fVtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
1089  if (!fVtx1) return;
1090 
1091  Double_t pos[3],cov[6];
1092  fVtx1->GetXYZ(pos);
1093  fVtx1->GetCovarianceMatrix(cov);
1094  fV1 = new AliESDVertex(pos,cov,100.,100,fVtx1->GetName());
1095  fVtxZ = pos[2];
1096 
1097  Bool_t fIsTriggerNotOK = fAnalCuts->IsEventRejectedDueToTrigger();
1098  if(!fIsTriggerNotOK) fCEvents->Fill(3);
1099  if(!fIsEventSelected) {
1100  delete fV1;
1101  return;
1102  }
1103  fCEvents->Fill(4);
1104 
1105  fIsMB=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kMB)==(AliVEvent::kMB);
1106  fIsSemi=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kSemiCentral)==(AliVEvent::kSemiCentral);
1107  fIsCent=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kCentral)==(AliVEvent::kCentral);
1108  fIsINT7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kINT7)==(AliVEvent::kINT7);
1109  fIsEMC7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kEMC7)==(AliVEvent::kEMC7);
1111  if(fIsMB) fHTrigger->Fill(1);
1112  if(fIsSemi) fHTrigger->Fill(2);
1113  if(fIsCent) fHTrigger->Fill(3);
1114  if(fIsINT7) fHTrigger->Fill(4);
1115  if(fIsEMC7) fHTrigger->Fill(5);
1116  if(fIsMB|fIsSemi|fIsCent) fHTrigger->Fill(7);
1117  if(fIsINT7|fIsEMC7) fHTrigger->Fill(8);
1118  if(fIsMB&fIsSemi) fHTrigger->Fill(10);
1119  if(fIsMB&fIsCent) fHTrigger->Fill(11);
1120  if(fIsINT7&fIsEMC7) fHTrigger->Fill(12);
1121 
1122  if(fUseCentralityV0M){
1123  AliCentrality *cent = aodEvent->GetCentrality();
1124  fCentrality = cent->GetCentralityPercentile("V0M");
1125  }else{
1126  fCentrality = 1.;
1127  }
1128  if(fCentrality<0.||fCentrality>100.-0.0000001) {
1129  delete fV1;
1130  return;
1131  }
1132  fHCentrality->Fill(fCentrality);
1133  fRunNumber = aodEvent->GetRunNumber();
1134 
1135  Int_t runnumber_offset = 0;
1136  Int_t runnumber = aodEvent->GetRunNumber();
1137  if(runnumber<=131000&&runnumber>=114000){
1138  runnumber_offset = 114000;//lhc10bcde
1139  }else if(runnumber<=196000&&runnumber>=195000){
1140  runnumber_offset = 195000;//lhc13bc
1141  }else if(runnumber<=170593&&runnumber>=167902){
1142  runnumber_offset = 167902;//lhc11h
1143  }
1144  fHistonEvtvsRunNumber->Fill(runnumber-runnumber_offset,1.);
1145 
1146  //------------------------------------------------
1147  // Check if the event has v0 candidate
1148  //------------------------------------------------
1149  //Int_t nv0 = aodEvent->GetNumberOfV0s();
1150  fCEvents->Fill(5);
1151 
1152 
1153  //------------------------------------------------
1154  // Main analysis done in this function
1155  //------------------------------------------------
1156  MakeAnalysis(aodEvent,mcArray);
1157 
1158 
1159  PostData(1,fOutput);
1160  PostData(3,fOutputAll);
1161  PostData(4,fVariablesTree);
1162  PostData(5,fEleVariablesTree);
1163  PostData(6,fV0VariablesTree);
1164  PostData(7,fMCVariablesTree);
1165  PostData(8,fCounter);
1166  PostData(9,fMCEleVariablesTree);
1167  PostData(10,fMCV0VariablesTree);
1168  PostData(11,fMCGenPairVariablesTree);
1169 
1170  fIsEventSelected=kFALSE;
1171 
1172  delete fV1;
1173  return;
1174 }
1175 
1176 //________________________________________ terminate ___________________________
1178 {
1182 
1183  //AliInfo("Terminate","");
1184  AliAnalysisTaskSE::Terminate();
1185 
1186  fOutput = dynamic_cast<TList*> (GetOutputData(1));
1187  if (!fOutput) {
1188  AliError("fOutput not available");
1189  return;
1190  }
1191 
1192  fOutputAll = dynamic_cast<TList*> (GetOutputData(3));
1193  if (!fOutputAll) {
1194  AliError("fOutputAll not available");
1195  return;
1196  }
1197 
1198  return;
1199 }
1200 
1201 //___________________________________________________________________________
1203 {
1207  //AliInfo(Form("CreateOutputObjects of task %s\n", GetName()));
1208 
1209  //------------------------------------------------
1210  // output object setting
1211  //------------------------------------------------
1212  fOutput = new TList();
1213  fOutput->SetOwner();
1214  fOutput->SetName("chist0");
1215  DefineGeneralHistograms(); // define general histograms
1216  PostData(1,fOutput);
1217 
1218  fOutputAll = new TList();
1219  fOutputAll->SetOwner();
1220  fOutputAll->SetName("anahisto");
1221  DefineAnalysisHistograms(); // define general histograms
1222  PostData(3,fOutputAll);
1223 
1225  PostData(4,fVariablesTree);
1226 
1228  PostData(5,fEleVariablesTree);
1229 
1231  PostData(6,fV0VariablesTree);
1232 
1234  PostData(7,fMCVariablesTree);
1235 
1237  PostData(9,fMCEleVariablesTree);
1238 
1240  PostData(10,fMCV0VariablesTree);
1241 
1243  PostData(11,fMCGenPairVariablesTree);
1244 
1245  //Counter for Normalization
1246  TString normName="NormalizationCounter";
1247  AliAnalysisDataContainer *cont = GetOutputSlot(8)->GetContainer();
1248  if(cont)normName=(TString)cont->GetName();
1249  fCounter = new AliNormalizationCounter(normName.Data());
1250  fCounter->Init();
1251  PostData(8,fCounter);
1252 
1253  if(fDoEventMixing){
1254  fElectronTracks = new TObjArray();
1255  fElectronTracks->SetOwner();
1256  fV0Tracks1 = new TObjArray();
1257  fV0Tracks1->SetOwner();
1258  fV0Tracks2 = new TObjArray();
1259  fV0Tracks2->SetOwner();
1260 
1262  fEventBuffer = new TTree*[fNOfPools];
1263  for(Int_t i=0; i<fNOfPools; i++){
1264  fEventBuffer[i]=new TTree(Form("EventBuffer_%d",i), "Temporary buffer for event mixing");
1265  fEventBuffer[i]->Branch("zVertex", &fVtxZ);
1266  fEventBuffer[i]->Branch("centrality", &fCentrality);
1267  fEventBuffer[i]->Branch("eventInfo", "TObjString",&fEventInfo);
1268  fEventBuffer[i]->Branch("v1array", "TObjArray", &fV0Tracks1);
1269  fEventBuffer[i]->Branch("v2array", "TObjArray", &fV0Tracks2);
1270  fEventBuffer[i]->Branch("vdl1array", &fV0dlArray1);
1271  fEventBuffer[i]->Branch("vdl2array", &fV0dlArray2);
1272  fEventBuffer[i]->Branch("vdca1array", &fV0dcaArray1);
1273  fEventBuffer[i]->Branch("vdca2array", &fV0dcaArray2);
1274  }
1275  }
1276 
1277 
1278  return;
1279 }
1280 
1281 //-------------------------------------------------------------------------------
1284  AliAODEvent *aodEvent, TClonesArray *mcArray
1285  )
1286 {
1287  //
1289  //
1290  if(fDoEventMixing){
1291  if(fElectronTracks) fElectronTracks->Delete();
1292  if(fV0Tracks1) fV0Tracks1->Delete();
1293  if(fV0Tracks2) fV0Tracks2->Delete();
1294  fV0dlArray1.clear();
1295  fV0dlArray2.clear();
1296  fV0dcaArray1.clear();
1297  fV0dcaArray2.clear();
1298  }
1299 
1300  //------------------------------------------------
1301  // Select good track before hand to save time
1302  //------------------------------------------------
1303 
1304  Int_t nV0s= aodEvent->GetNumberOfV0s();
1305  Int_t nTracks= aodEvent->GetNumberOfTracks();
1306 
1307  Bool_t seleTrkFlags[nTracks];
1308  Int_t nSeleTrks=0;
1309  SelectTrack(aodEvent,nTracks,nSeleTrks,seleTrkFlags,mcArray);
1310 
1311  Bool_t seleV0Flags[nV0s];
1312  Int_t nSeleV0=0;
1313  SelectV0(aodEvent,nV0s,nSeleV0,seleV0Flags,mcArray);
1314 
1315  Int_t runnumber_offset = 0;
1316  Int_t runnumber = aodEvent->GetRunNumber();
1317  if(runnumber<=131000&&runnumber>=114000){
1318  runnumber_offset = 114000;//lhc10bcde
1319  }else if(runnumber<=196000&&runnumber>=195000){
1320  runnumber_offset = 195000;//lhc13bc
1321  }else if(runnumber<=170593&&runnumber>=167902){
1322  runnumber_offset = 167902;//lhc11h
1323  }
1324  fHistonElevsRunNumber->Fill(runnumber-runnumber_offset,nSeleTrks);
1325  fHistonLambdavsRunNumber->Fill(runnumber-runnumber_offset,nSeleV0);
1326 
1327  //------------------------------------------------
1328  // V0 loop
1329  //------------------------------------------------
1330  for (Int_t iv0 = 0; iv0<nV0s; iv0++) {
1331  if(!seleV0Flags[iv0]) continue;
1332  AliAODv0 *v0 = aodEvent->GetV0(iv0);
1333  if(!v0) continue;
1334 
1335  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
1336  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
1337 
1338  //------------------------------------------------
1339  // track loop
1340  //------------------------------------------------
1341  for (Int_t itrk = 0; itrk<nTracks; itrk++) {
1342  if(!seleTrkFlags[itrk]) continue;
1343  AliAODTrack *trk = (AliAODTrack*)aodEvent->GetTrack(itrk);
1344  if(trk->GetID()<0) continue;
1345 
1346  Int_t cpid = cptrack->GetID();
1347  Int_t cnid = cntrack->GetID();
1348  Int_t lpid = trk->GetID();
1349  if((cpid==lpid)||(cnid==lpid)) continue;
1350 
1351  //if(!fAnalCuts->SelectWithRoughCuts(v0,trk)) continue;
1352 
1353  AliAODVertex *secVert = ReconstructSecondaryVertex(v0,trk,aodEvent);//Fake, prim vertex is just used as secondary vertex. place holder for future
1354  if(!secVert) continue;
1355 
1356  AliAODRecoCascadeHF *elobj = MakeCascadeHF(v0,trk,aodEvent,secVert);
1357  if(!elobj) {
1358  continue;
1359  }
1360 
1361  FillROOTObjects(elobj, v0,trk,mcArray);
1362 
1363  elobj->GetSecondaryVtx()->RemoveDaughters();
1364  elobj->UnsetOwnPrimaryVtx();
1365  delete elobj;elobj=NULL;
1366  delete secVert;
1367  }
1368  }
1369 
1370  if(fDoEventMixing){
1371  fEventInfo->SetString(Form("Ev%d_esd%d_E%d_V%d",AliAnalysisManager::GetAnalysisManager()->GetNcalls(),((AliAODHeader*)aodEvent->GetHeader())->GetEventNumberESDFile(),fElectronTracks->GetEntries(),fV0Tracks1->GetEntries()+fV0Tracks2->GetEntries()));
1372  Int_t ind=GetPoolIndex(fVtxZ,fCentrality);
1373  if(ind>=0 && ind<fNOfPools){
1374  if(fEventBuffer[ind]->GetEntries() >= fNumberOfEventsForMixing){
1375  DoEventMixingWithPools(ind);
1376  if(fEventBuffer[ind]->GetEntries() >= 20*fNumberOfEventsForMixing){
1377  ResetPool(ind);
1378  }
1379  }
1380  fEventBuffer[ind]->Fill();
1381  }
1382  }
1383 }
1386 {
1390 
1391  const char* nameoutput = GetOutputSlot(4)->GetContainer()->GetName();
1392  fVariablesTree = new TTree(nameoutput,"Candidates variables tree");
1393  Int_t nVar = 75;
1394  fCandidateVariables = new Float_t [nVar];
1395  TString * fCandidateVariableNames = new TString[nVar];
1396 
1397  fCandidateVariableNames[ 0]="Centrality";
1398  fCandidateVariableNames[ 1]="InvMassEleLambda";
1399  fCandidateVariableNames[ 2]="EleLambdaPt";
1400  fCandidateVariableNames[ 3]="EleLambdaPx";
1401  fCandidateVariableNames[ 4]="EleLambdaPy";
1402  fCandidateVariableNames[ 5]="EleLambdaPz";
1403  fCandidateVariableNames[ 6]="ElePx";
1404  fCandidateVariableNames[ 7]="ElePy";
1405  fCandidateVariableNames[ 8]="ElePz";
1406  fCandidateVariableNames[ 9]="V0Px";
1407  fCandidateVariableNames[10]="V0Py";
1408  fCandidateVariableNames[11]="V0Pz";
1409  fCandidateVariableNames[12]="AntiLambdaFlag";
1410  fCandidateVariableNames[13]="MassLambda";
1411  fCandidateVariableNames[14]="MassAntiLambda";
1412  fCandidateVariableNames[15]="Eled0";
1413  fCandidateVariableNames[16]="V0d0";
1414  fCandidateVariableNames[17]="nSigmaTPCele";
1415  fCandidateVariableNames[18]="nSigmaTOFele";
1416  fCandidateVariableNames[19]="nSigmaTPCv0pr";
1417  fCandidateVariableNames[20]="nSigmaTOFv0pr";
1418  fCandidateVariableNames[21]="EleCharge";
1419  fCandidateVariableNames[22]="ProtonPx";
1420  fCandidateVariableNames[23]="ProtonPy";
1421  fCandidateVariableNames[24]="ProtonPz";
1422  fCandidateVariableNames[25]="PiPx";
1423  fCandidateVariableNames[26]="PiPy";
1424  fCandidateVariableNames[27]="PiPz";
1425  fCandidateVariableNames[28]="mcpdglc";
1426  fCandidateVariableNames[29]="mclablc";
1427  fCandidateVariableNames[30]="mcpdgmomele";
1428  fCandidateVariableNames[31]="mcpdgmomv0";
1429  fCandidateVariableNames[32]="Mixing";
1430  fCandidateVariableNames[33]="mcpdgele";
1431  fCandidateVariableNames[34]="nSigmaTPCpr_etrk";
1432  fCandidateVariableNames[35]="nSigmaTOFpr_etrk";
1433  fCandidateVariableNames[36]="nSigmaTPCka_etrk";
1434  fCandidateVariableNames[37]="nSigmaTOFka_etrk";
1435  fCandidateVariableNames[38]="MassK0Short";
1436  fCandidateVariableNames[39]="mcpdggrmomele";
1437  fCandidateVariableNames[40]="mcpdggrmomv0";
1438  fCandidateVariableNames[41]="mcngenele";
1439  fCandidateVariableNames[42]="mcngenv0";
1440  fCandidateVariableNames[43]="mclcpx";
1441  fCandidateVariableNames[44]="mclcpy";
1442  fCandidateVariableNames[45]="mclcpz";
1443  fCandidateVariableNames[46]="mcelepx";
1444  fCandidateVariableNames[47]="mcelepy";
1445  fCandidateVariableNames[48]="mcelepz";
1446  fCandidateVariableNames[49]="mcv0px";
1447  fCandidateVariableNames[50]="mcv0py";
1448  fCandidateVariableNames[51]="mcv0pz";
1449  fCandidateVariableNames[52]="nSigmaTPCpi_etrk";
1450  fCandidateVariableNames[53]="nSigmaTOFpi_etrk";
1451  fCandidateVariableNames[54]="PrimVertx";
1452  fCandidateVariableNames[55]="PrimVerty";
1453  fCandidateVariableNames[56]="PrimVertz";
1454  fCandidateVariableNames[57]="V0Vertx";
1455  fCandidateVariableNames[58]="V0Verty";
1456  fCandidateVariableNames[59]="V0Vertz";
1457 
1458  fCandidateVariableNames[60]="DcaV0PrToPrimVertex";
1459  fCandidateVariableNames[61]="DcaV0PiToPrimVertex";
1460  fCandidateVariableNames[62]="DcaV0daughters";
1461  fCandidateVariableNames[63]="V0CosPointingAngle";
1462  fCandidateVariableNames[64]="V0ProperDecayLength";
1463  fCandidateVariableNames[65]="MassK0Short2";
1464 
1465  fCandidateVariableNames[66]="nSigmaTPCv0pi";
1466  fCandidateVariableNames[67]="nSigmaTOFv0pi";
1467 
1468  fCandidateVariableNames[68]= "EleITSMatch";
1469  fCandidateVariableNames[69]= "V0PosITSMatch";
1470  fCandidateVariableNames[70]= "V0NegITSMatch";
1471  fCandidateVariableNames[71]= "IsV0PeakRegion";
1472  fCandidateVariableNames[72]= "mcpdgv0";
1473 
1474  fCandidateVariableNames[73]="EvNumber";
1475  fCandidateVariableNames[74]="RunNumber";
1476 
1477  for (Int_t ivar=0; ivar<nVar; ivar++) {
1478  fVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1479  }
1480 
1481  return;
1482 }
1483 
1485 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillROOTObjects(AliAODRecoCascadeHF *elobj, AliAODv0 *v0, AliAODTrack *trk, TClonesArray *mcArray)
1486 {
1490  if(!trk) return;
1491  if(!v0) return;
1492 
1493  for(Int_t i=0;i<75;i++){
1494  fCandidateVariables[i] = -9999.;
1495  }
1496 
1497  Bool_t anti_lambda_flag = kFALSE;
1498  if(fabs(v0->MassAntiLambda()-1.115683)<fAnalCuts->GetProdV0MassTolLambdaRough()) anti_lambda_flag = kTRUE;
1499 
1500  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
1501  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
1502  if(cptrack->Charge()<0 && cntrack->Charge()>0){
1503  cptrack = (AliAODTrack*)(v0->GetDaughter(1));
1504  cntrack = (AliAODTrack*)(v0->GetDaughter(0));
1505  }
1506 
1507  Double_t v0px = elobj->PxProng(1);
1508  Double_t v0py = elobj->PyProng(1);
1509  Double_t v0pz = elobj->PzProng(1);
1510  Double_t momv0 = sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz);
1511  Double_t Ev0 = sqrt(momv0*momv0+1.115683*1.115683);
1512  Double_t epx = elobj->PxProng(0);
1513  Double_t epy = elobj->PyProng(0);
1514  Double_t epz = elobj->PzProng(0);
1515  Double_t mome = sqrt(epx*epx+epy*epy+epz*epz);
1516  Double_t Ee = sqrt(mome*mome+0.000510998928*0.000510998928);
1517  Double_t cosoa = (v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz);
1518  Double_t Esum = Ee + Ev0;
1519 
1520  Double_t uxe = epx/mome;
1521  Double_t uye = epy/mome;
1522  Double_t uze = epz/mome;
1523  Double_t lf = -2.*(v0px*uxe+v0py*uye+v0pz*uze);
1524  Double_t pxv_flip = v0px + lf * uxe;
1525  Double_t pyv_flip = v0py + lf * uye;
1526  Double_t pzv_flip = v0pz + lf * uze;
1527  Double_t pxsum_flip = epx + pxv_flip;
1528  Double_t pysum_flip = epy + pyv_flip;
1529  Double_t pzsum_flip = epz + pzv_flip;
1530  Double_t melam_flip = sqrt(Esum*Esum-pxsum_flip*pxsum_flip-pysum_flip*pysum_flip-pzsum_flip*pzsum_flip);
1531  Double_t ptelam_flip = sqrt(pxsum_flip*pxsum_flip+pysum_flip*pysum_flip);
1532 
1534  UInt_t pdgdg[2]={11,3122};
1535  fCandidateVariables[ 1] = elobj->InvMass(2,pdgdg);
1536  fCandidateVariables[ 2] = elobj->Pt();
1537  fCandidateVariables[ 3] = elobj->Px();
1538  fCandidateVariables[ 4] = elobj->Py();
1539  fCandidateVariables[ 5] = elobj->Pz();
1540  fCandidateVariables[ 6] = elobj->PxProng(0);
1541  fCandidateVariables[ 7] = elobj->PyProng(0);
1542  fCandidateVariables[ 8] = elobj->PzProng(0);
1543  fCandidateVariables[ 9] = elobj->PxProng(1);
1544  fCandidateVariables[10] = elobj->PyProng(1);
1545  fCandidateVariables[11] = elobj->PzProng(1);
1546  fCandidateVariables[12] = anti_lambda_flag;
1547  fCandidateVariables[13] = v0->MassLambda();
1548  fCandidateVariables[14] = v0->MassAntiLambda();
1549  fCandidateVariables[15] = elobj->Getd0Prong(0);
1550  fCandidateVariables[16] = elobj->Getd0Prong(1);
1551 
1552  Double_t nSigmaTPCele=-9999.;
1553  Double_t nSigmaTOFele=-9999.;
1554  Double_t nSigmaTPCv0pr=-9999.;
1555  Double_t nSigmaTOFv0pr=-9999.;
1556  Double_t nSigmaTPCv0pi=-9999.;
1557  Double_t nSigmaTOFv0pi=-9999.;
1558  if(fAnalCuts->GetIsUsePID())
1559  {
1560  nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
1561  nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
1562  fCandidateVariables[17] = nSigmaTPCele;
1563  fCandidateVariables[18] = nSigmaTOFele;
1564  }
1565 
1566  if(fAnalCuts->GetUseLambdaPID())
1567  {
1568  if(anti_lambda_flag){
1569  nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
1570  nSigmaTOFv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kProton);
1571  nSigmaTPCv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
1572  nSigmaTOFv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kPion);
1573  }else{
1574  nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
1575  nSigmaTOFv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kProton);
1576  nSigmaTPCv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
1577  nSigmaTOFv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kPion);
1578  }
1579  fCandidateVariables[19] = nSigmaTPCv0pr;
1580  fCandidateVariables[20] = nSigmaTOFv0pr;
1581  fCandidateVariables[66] = nSigmaTPCv0pi;
1582  fCandidateVariables[67] = nSigmaTOFv0pi;
1583  }
1584  fCandidateVariables[21] = trk->Charge();
1585 
1586  if(anti_lambda_flag){
1587  fCandidateVariables[22] = cntrack->Px();
1588  fCandidateVariables[23] = cntrack->Py();
1589  fCandidateVariables[24] = cntrack->Pz();
1590  fCandidateVariables[25] = cptrack->Px();
1591  fCandidateVariables[26] = cptrack->Py();
1592  fCandidateVariables[27] = cptrack->Pz();
1593  }else{
1594  fCandidateVariables[22] = cptrack->Px();
1595  fCandidateVariables[23] = cptrack->Py();
1596  fCandidateVariables[24] = cptrack->Pz();
1597  fCandidateVariables[25] = cntrack->Px();
1598  fCandidateVariables[26] = cntrack->Py();
1599  fCandidateVariables[27] = cntrack->Pz();
1600  }
1601 
1602  AliAODMCParticle *mclc = 0;
1603  AliAODMCParticle *mcele = 0;
1604  AliAODMCParticle *mcv0 = 0;
1605  Int_t mclablc = 0;
1606  Int_t mcpdgele_array[100];
1607  Int_t mcpdgv0_array[100];
1608  Int_t mclabelele_array[100];
1609  Int_t mclabelv0_array[100];
1610  Int_t mcngen_ele=-9999;
1611  Int_t mcngen_v0=-9999;
1612 
1613  if(fUseMCInfo && mcArray){
1614 
1615  mclablc = MatchToMC(elobj,mcArray,mcpdgele_array, mcpdgv0_array,mclabelele_array,mclabelv0_array,mcngen_ele,mcngen_v0);
1616 
1617  if(mclablc>-1){
1618  mclc = (AliAODMCParticle*) mcArray->At(mclablc);
1619  if(mclabelele_array[0]>=0)
1620  mcele = (AliAODMCParticle*) mcArray->At(mclabelele_array[0]);
1621  if(mclabelv0_array[0]>=0)
1622  mcv0 = (AliAODMCParticle*) mcArray->At(mclabelv0_array[0]);
1623  if(mclc){
1624  fCandidateVariables[28] = mclc->GetPdgCode();
1625  fCandidateVariables[29] = mclc->Label();
1626  fCandidateVariables[43] = mclc->Px();
1627  fCandidateVariables[44] = mclc->Py();
1628  fCandidateVariables[45] = mclc->Pz();
1629  }
1630  if(mcele){
1631  fCandidateVariables[46] = mcele->Px();
1632  fCandidateVariables[47] = mcele->Py();
1633  fCandidateVariables[48] = mcele->Pz();
1634  }
1635  if(mcv0){
1636  fCandidateVariables[49] = mcv0->Px();
1637  fCandidateVariables[50] = mcv0->Py();
1638  fCandidateVariables[51] = mcv0->Pz();
1639  }
1640  }
1641  fCandidateVariables[30] = mcpdgele_array[1];
1642  fCandidateVariables[31] = mcpdgv0_array[1];
1643  fCandidateVariables[33] = mcpdgele_array[0];
1644  fCandidateVariables[39] = mcpdgele_array[2];
1645  fCandidateVariables[40] = mcpdgv0_array[2];
1646  fCandidateVariables[41] = mcngen_ele;
1647  fCandidateVariables[42] = mcngen_v0;
1648  }
1649  fCandidateVariables[32] = 0;
1650 
1651  if(fAnalCuts->GetIsUsePID())
1652  {
1653  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
1654  Double_t nSigmaTOFpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kProton);
1655  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
1656  Double_t nSigmaTOFka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kKaon);
1657  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
1658  Double_t nSigmaTOFpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kPion);
1659  fCandidateVariables[34] = nSigmaTPCpr_etrk;
1660  fCandidateVariables[35] = nSigmaTOFpr_etrk;
1661  fCandidateVariables[36] = nSigmaTPCka_etrk;
1662  fCandidateVariables[37] = nSigmaTOFka_etrk;
1663  fCandidateVariables[52] = nSigmaTPCpi_etrk;
1664  fCandidateVariables[53] = nSigmaTOFpi_etrk;
1665  }
1666  fCandidateVariables[38] = v0->MassK0Short();
1667 
1668  fCandidateVariables[54] = fVtx1->GetX();
1669  fCandidateVariables[55] = fVtx1->GetY();
1670  fCandidateVariables[56] = fVtx1->GetZ();
1671  fCandidateVariables[57] = v0->DecayVertexV0X();
1672  fCandidateVariables[58] = v0->DecayVertexV0Y();
1673  fCandidateVariables[59] = v0->DecayVertexV0Z();
1674 
1675  Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
1676  Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
1677  if(!anti_lambda_flag){
1678  fCandidateVariables[60] = lDcaPosToPrimVertex;
1679  fCandidateVariables[61] = lDcaNegToPrimVertex;
1680  }else{
1681  fCandidateVariables[60] = lDcaNegToPrimVertex;
1682  fCandidateVariables[61] = lDcaPosToPrimVertex;
1683  }
1684  fCandidateVariables[62] = v0->DcaV0Daughters();
1685  Double_t posVtx[3] = {0.,0.,0.};
1686  fVtx1->GetXYZ(posVtx);
1687  fCandidateVariables[63] = v0->CosPointingAngle(posVtx);
1688  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
1689  fCandidateVariables[64] = v0->DecayLengthV0(posVtx)*1.1157/ptotlam;
1690  fCandidateVariables[65] = v0->MassK0Short();
1691 
1692  if(trk) fCandidateVariables[68] = trk->GetITSClusterMap();
1693  if(cptrack) fCandidateVariables[69] = cptrack->GetITSClusterMap();
1694  if(cntrack) fCandidateVariables[70] = cntrack->GetITSClusterMap();
1695 
1697  fCandidateVariables[72] = mcpdgv0_array[0];
1700 
1701 
1702  if(fWriteVariableTree)
1703  fVariablesTree->Fill();
1704 
1705  Double_t cont[3];
1706  cont[0] = elobj->InvMass(2,pdgdg);
1707  cont[1] = elobj->Pt();
1708  cont[2] = fCentrality;
1709  fHistoEleLambdaMass->Fill(cont);
1710 
1711  Double_t cont_flip[3];
1712  cont_flip[0] = melam_flip;
1713  cont_flip[1] = ptelam_flip;
1714  cont_flip[2] = fCentrality;
1715 
1716  Double_t cont2[3];
1717  cont2[0] = elobj->InvMass(2,pdgdg);
1718  cont2[1] = trk->Pt();
1719  cont2[2] = fCentrality;
1720  Double_t cont_eleptvseta[3];
1721  cont_eleptvseta[0] = trk->Pt();
1722  cont_eleptvseta[1] = trk->Eta();
1723  cont_eleptvseta[2] = fCentrality;
1724 
1725  Double_t cont_eleptvslambdapt[3];
1726  cont_eleptvslambdapt[0] = trk->Pt();
1727  cont_eleptvslambdapt[1] = v0->Pt();
1728  cont_eleptvslambdapt[2] = fCentrality;
1729 
1730  Double_t cont_eleptvsd0[3];
1731  cont_eleptvsd0[0] = trk->Pt();
1732  cont_eleptvsd0[1] = elobj->Getd0Prong(0)*trk->Charge();
1733  cont_eleptvsd0[2] = fCentrality;
1734 
1735  Double_t cont_eleptvsv0dl[3];
1736  cont_eleptvsv0dl[0] = trk->Pt();
1737  cont_eleptvsv0dl[1] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;
1738  cont_eleptvsv0dl[2] = fCentrality;
1739 
1740  Double_t cont_elelamptvsv0dl[4];
1741  cont_elelamptvsv0dl[0] = elobj->Pt();
1742  cont_elelamptvsv0dl[1] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;
1743  cont_elelamptvsv0dl[2] = elobj->Getd0Prong(0)*trk->Charge();
1744  cont_elelamptvsv0dl[3] = fCentrality;
1745 
1746  Double_t cont_elelamptvsv0dl_flip[4];
1747  cont_elelamptvsv0dl_flip[0] = ptelam_flip;
1748  cont_elelamptvsv0dl_flip[1] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;
1749  cont_elelamptvsv0dl_flip[2] = 0.0;
1750  cont_elelamptvsv0dl_flip[3] = fCentrality;
1751 
1752 
1753  Double_t cont_eleptvsv0dca[3];
1754  cont_eleptvsv0dca[0] = trk->Pt();
1755  cont_eleptvsv0dca[1] = v0->DcaV0ToPrimVertex();
1756  cont_eleptvsv0dca[2] = fCentrality;
1757 
1758  Double_t elobj_mass = elobj->InvMass(2,pdgdg);
1759  Double_t elobj_px = elobj->Px();
1760  Double_t elobj_py = elobj->Py();
1761  Double_t elobj_pz = elobj->Pz();
1762  Double_t elobj_E = sqrt(elobj_mass*elobj_mass+elobj_px*elobj_px+elobj_py*elobj_py+elobj_pz*elobj_pz);
1763  Double_t elobj_rap = 0.5*log((elobj_E+elobj_pz)/(elobj_E-elobj_pz));
1764 
1766  {
1767  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
1768  fHistoEleLambdaMassRS->Fill(cont);
1769  if(trk->Charge()>0) fHistoEleLambdaMassRS1->Fill(cont);
1770  else fHistoEleLambdaMassRS2->Fill(cont);
1771 
1772  fHistoEleLambdaMassvsElePtRS->Fill(cont2);
1773  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtRS1->Fill(cont2);
1774  else fHistoEleLambdaMassvsElePtRS2->Fill(cont2);
1775  if(cont[0]<2.3){
1776  fHistoEleLambdaPtvsRapidityRS->Fill(elobj->Pt(),elobj_rap);
1777  fHistoElePtRS->Fill(trk->Pt(),fCentrality);
1778  fHistoElePtvsEtaRS->Fill(cont_eleptvseta);
1779  fHistoElePtvsLambdaPtRS->Fill(cont_eleptvslambdapt);
1780  fHistoElePtvsd0RS->Fill(cont_eleptvsd0);
1781 
1782  fHistoElePtvsV0dlRS->Fill(cont_eleptvsv0dl);
1783  if(trk->Charge()>0) fHistoElePtvsV0dlRS1->Fill(cont_eleptvsv0dl);
1784  else fHistoElePtvsV0dlRS2->Fill(cont_eleptvsv0dl);
1785 
1786  fHistoEleLambdaPtvsV0dlRS->Fill(cont_elelamptvsv0dl);
1787  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRS1->Fill(cont_elelamptvsv0dl);
1788  else fHistoEleLambdaPtvsV0dlRS2->Fill(cont_elelamptvsv0dl);
1789 
1790  fHistoElePtvsV0dcaRS->Fill(cont_eleptvsv0dca);
1791  if(trk->Charge()>0) fHistoElePtvsV0dcaRS1->Fill(cont_eleptvsv0dca);
1792  else fHistoElePtvsV0dcaRS2->Fill(cont_eleptvsv0dca);
1793 
1794  for(Int_t ih=0;ih<17;ih++){
1795  Double_t cont_eleptvscutvars[3];
1796  cont_eleptvscutvars[0] = elobj->Pt();
1797  cont_eleptvscutvars[2] = fCentrality;
1798 
1799  if(ih==0){
1800  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1801  }else if(ih==1){
1802  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1803  }else if(ih==2){
1804  cont_eleptvscutvars[1] = nSigmaTPCele;
1805  }else if(ih==3){
1806  cont_eleptvscutvars[1] = nSigmaTOFele;
1807  }else if(ih==4){
1808  cont_eleptvscutvars[1] = trk->Eta();
1809  }else if(ih==5){
1810  cont_eleptvscutvars[1] = trk->GetITSNcls();
1811  }else if(ih==6){
1812  if(!anti_lambda_flag)
1813  cont_eleptvscutvars[1] = v0->MassLambda();
1814  else
1815  cont_eleptvscutvars[1] = v0->MassAntiLambda();
1816  }else if(ih==7){
1817  Double_t lPosV0[3];
1818  lPosV0[0] = v0->DecayVertexV0X();
1819  lPosV0[1] = v0->DecayVertexV0Y();
1820  lPosV0[2] = v0->DecayVertexV0Z();
1821  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1822  }else if(ih==8){
1823  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
1824  }else if(ih==9){
1825  if(!anti_lambda_flag)
1826  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1827  else
1828  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1829  }else if(ih==10){
1830  if(!anti_lambda_flag)
1831  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1832  else
1833  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1834  }else if(ih==11){
1835  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
1836  }else if(ih==12){
1837  cont_eleptvscutvars[1] = v0->MassK0Short();
1838  }else if(ih==13){
1839  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1840  }else if(ih==14){
1841  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1842  }else if(ih==15){
1843  cont_eleptvscutvars[1] = v0->Eta();
1844  }else if(ih==16){
1845  Double_t v0px = elobj->PxProng(1);
1846  Double_t v0py = elobj->PyProng(1);
1847  Double_t v0pz = elobj->PzProng(1);
1848  Double_t epx = elobj->PxProng(0);
1849  Double_t epy = elobj->PyProng(0);
1850  Double_t epz = elobj->PzProng(0);
1851  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
1852  }else{
1853  cont_eleptvscutvars[1] = -9999.;
1854  }
1855 
1856  fHistoElePtvsCutVarsRS[ih]->Fill(cont_eleptvscutvars);
1857  }
1858  }
1859  if(fUseMCInfo){
1860  if(mclc){
1861  Int_t pdgcode = mclc->GetPdgCode();
1862  Double_t cont_mclc[3];
1863  cont_mclc[0] = mclc->Pt();
1864  cont_mclc[1] = mclc->Y();
1865  cont_mclc[2] = fCentrality;
1866  Double_t cont_mcele[3];
1867  cont_mcele[0] = mcele->Pt();
1868  cont_mcele[1] = mcele->Eta();
1869  cont_mcele[2] = fCentrality;
1870 
1871  Int_t labmotherlc = mclc->GetMother();
1872  Bool_t isbottomfd = kFALSE;
1873  if(labmotherlc>=0){
1874  AliAODMCParticle *motherlc = (AliAODMCParticle*)mcArray->At(labmotherlc);
1875  Int_t pdgmotherlc = motherlc->GetPdgCode();
1876  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){
1877  isbottomfd = kTRUE;
1878  }
1879  }
1880  cont2[1] = mcele->Pt();
1881 
1882  if(abs(pdgcode)==4122 && abs(mcpdgele_array[1])==4122 && abs(mcpdgv0_array[1])==4122){
1883  fHistoEleLambdaMassMCS->Fill(cont);
1884  fHistoEleLambdaMassvsElePtMCS->Fill(cont2);
1885  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtMCS1->Fill(cont2);
1886  else fHistoEleLambdaMassvsElePtMCS2->Fill(cont2);
1887  if(cont[0]<2.3){
1888  fHistoEleLambdaPtvsRapidityMCS->Fill(elobj->Pt(),elobj_rap);
1889  fHistoElePtMCS->Fill(trk->Pt(),fCentrality);
1890  fHistoElePtvsEtaMCS->Fill(cont_eleptvseta);
1891  fHistoElePtvsLambdaPtMCS->Fill(cont_eleptvslambdapt);
1892  fHistoElePtvsd0MCS->Fill(cont_eleptvsd0);
1893 
1894  fHistoElePtvsV0dlMCS->Fill(cont_eleptvsv0dl);
1895  if(trk->Charge()>0) fHistoElePtvsV0dlMCS1->Fill(cont_eleptvsv0dl);
1896  else fHistoElePtvsV0dlMCS2->Fill(cont_eleptvsv0dl);
1897 
1898  fHistoElePtvsV0dcaMCS->Fill(cont_eleptvsv0dca);
1899  if(trk->Charge()>0) fHistoElePtvsV0dcaMCS1->Fill(cont_eleptvsv0dca);
1900  else fHistoElePtvsV0dcaMCS2->Fill(cont_eleptvsv0dca);
1901 
1902  fHistoEleLambdaPtvsV0dlMCS->Fill(cont_elelamptvsv0dl);
1903  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlMCS1->Fill(cont_elelamptvsv0dl);
1904  else fHistoEleLambdaPtvsV0dlMCS2->Fill(cont_elelamptvsv0dl);
1905 
1906  if(isbottomfd){
1907  fHistoEleLambdaPtvsV0dlBFeeddownMCS->Fill(cont_elelamptvsv0dl);
1908  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlBFeeddownMCS1->Fill(cont_elelamptvsv0dl);
1909  else fHistoEleLambdaPtvsV0dlBFeeddownMCS2->Fill(cont_elelamptvsv0dl);
1910  }else{
1911  fHistoEleLambdaPtvsV0dlPromptMCS->Fill(cont_elelamptvsv0dl);
1912  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlPromptMCS1->Fill(cont_elelamptvsv0dl);
1913  else fHistoEleLambdaPtvsV0dlPromptMCS2->Fill(cont_elelamptvsv0dl);
1914  }
1915 
1916  fHistoLcMCS->Fill(cont_mclc);
1917  if(trk->Charge()>0) fHistoLcMCS1->Fill(cont_mclc);
1918  else fHistoLcMCS2->Fill(cont_mclc);
1919 
1920  fHistoLcElectronMCS->Fill(cont_mcele);
1921  if(trk->Charge()>0) fHistoLcElectronMCS1->Fill(cont_mcele);
1922  else fHistoLcElectronMCS2->Fill(cont_mcele);
1923 
1924  fHistoResponseElePt->Fill(mcele->Pt(),trk->Pt());
1925  if(trk->Charge()>0) fHistoResponseElePt1->Fill(mcele->Pt(),trk->Pt());
1926  else fHistoResponseElePt2->Fill(mcele->Pt(),trk->Pt());
1927  fHistoResponseEleLambdaPt->Fill(mclc->Pt(),elobj->Pt());
1928  if(trk->Charge()>0) fHistoResponseEleLambdaPt1->Fill(mclc->Pt(),trk->Pt());
1929  else fHistoResponseEleLambdaPt2->Fill(mclc->Pt(),trk->Pt());
1930 
1931  Double_t cont_eleptvslambdaptvslcpt[4];
1932  cont_eleptvslambdaptvslcpt[0] = cont_eleptvslambdapt[0];
1933  cont_eleptvslambdaptvslcpt[1] = cont_eleptvslambdapt[1];
1934  cont_eleptvslambdaptvslcpt[2] = mclc->Pt();
1935  cont_eleptvslambdaptvslcpt[3] = cont_eleptvslambdapt[2];
1936  fHistoElePtvsLambdaPtvsLcPtMCS->Fill(cont_eleptvslambdaptvslcpt);
1937 
1938  Double_t cont_allpt[4];
1939  cont_allpt[0] = mclc->Pt();
1940  cont_allpt[1] = elobj->Pt();
1941  cont_allpt[2] = trk->Pt();
1942  cont_allpt[3] = v0->Pt();
1943  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt->Fill(cont_allpt);
1944 
1945  if(isbottomfd){
1946  fHistoElePtvsd0BFeeddownMCS->Fill(cont_eleptvsd0);
1947  }else{
1948  fHistoElePtvsd0PromptMCS->Fill(cont_eleptvsd0);
1949  }
1950 
1951  for(Int_t ih=0;ih<17;ih++){
1952  Double_t cont_eleptvscutvars[3];
1953  cont_eleptvscutvars[0] = elobj->Pt();
1954  cont_eleptvscutvars[2] = fCentrality;
1955 
1956  if(ih==0){
1957  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1958  }else if(ih==1){
1959  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1960  }else if(ih==2){
1961  cont_eleptvscutvars[1] = nSigmaTPCele;
1962  }else if(ih==3){
1963  cont_eleptvscutvars[1] = nSigmaTOFele;
1964  }else if(ih==4){
1965  cont_eleptvscutvars[1] = trk->Eta();
1966  }else if(ih==5){
1967  cont_eleptvscutvars[1] = trk->GetITSNcls();
1968  }else if(ih==6){
1969  if(!anti_lambda_flag)
1970  cont_eleptvscutvars[1] = v0->MassLambda();
1971  else
1972  cont_eleptvscutvars[1] = v0->MassAntiLambda();
1973  }else if(ih==7){
1974  Double_t lPosV0[3];
1975  lPosV0[0] = v0->DecayVertexV0X();
1976  lPosV0[1] = v0->DecayVertexV0Y();
1977  lPosV0[2] = v0->DecayVertexV0Z();
1978  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1979  }else if(ih==8){
1980  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
1981  }else if(ih==9){
1982  if(!anti_lambda_flag)
1983  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1984  else
1985  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1986  }else if(ih==10){
1987  if(!anti_lambda_flag)
1988  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1989  else
1990  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1991  }else if(ih==11){
1992  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
1993  }else if(ih==12){
1994  cont_eleptvscutvars[1] = v0->MassK0Short();
1995  }else if(ih==13){
1996  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1997  }else if(ih==14){
1998  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1999  }else if(ih==15){
2000  cont_eleptvscutvars[1] = v0->Eta();
2001  }else if(ih==16){
2002  Double_t v0px = elobj->PxProng(1);
2003  Double_t v0py = elobj->PyProng(1);
2004  Double_t v0pz = elobj->PzProng(1);
2005  Double_t epx = elobj->PxProng(0);
2006  Double_t epy = elobj->PyProng(0);
2007  Double_t epz = elobj->PzProng(0);
2008  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
2009  }else{
2010  cont_eleptvscutvars[1] = -9999.;
2011  }
2012 
2013  fHistoElePtvsCutVarsMCS[ih]->Fill(cont_eleptvscutvars);
2014  }
2015  }
2016  }
2017  if(abs(pdgcode)==4132 && abs(mcpdgele_array[1])==4132 && abs(mcpdgv0_array[1])==3312){
2020  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtFeeddownXic0MCS1->Fill(cont2);
2022  if(cont[0]<2.3){
2023  fHistoFeedDownXic0MCS->Fill(cont_mclc);
2024  if(trk->Charge()>0) fHistoFeedDownXic0MCS1->Fill(cont_mclc);
2025  else fHistoFeedDownXic0MCS2->Fill(cont_mclc);
2026 
2027  fHistoElectronFeedDownXic0MCS1->Fill(cont_mcele);
2028  if(trk->Charge()>0) fHistoElectronFeedDownXic0MCS1->Fill(cont_mcele);
2029  else fHistoElectronFeedDownXic0MCS2->Fill(cont_mcele);
2030 
2031  fHistoElePtvsV0dlFeedDownXic0MCS->Fill(cont_eleptvsv0dl);
2032  if(trk->Charge()>0) fHistoElePtvsV0dlFeedDownXic0MCS1->Fill(cont_eleptvsv0dl);
2033  else fHistoElePtvsV0dlFeedDownXic0MCS2->Fill(cont_eleptvsv0dl);
2034 
2035  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS->Fill(cont_elelamptvsv0dl);
2036  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1->Fill(cont_elelamptvsv0dl);
2037  else fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2->Fill(cont_elelamptvsv0dl);
2038 
2039  if(isbottomfd){
2040  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS->Fill(cont_elelamptvsv0dl);
2041  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS1->Fill(cont_elelamptvsv0dl);
2042  else fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS2->Fill(cont_elelamptvsv0dl);
2043  }else{
2044  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS->Fill(cont_elelamptvsv0dl);
2045  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS1->Fill(cont_elelamptvsv0dl);
2046  else fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS2->Fill(cont_elelamptvsv0dl);
2047  }
2048 
2049  fHistoElePtvsV0dcaFeedDownXic0MCS->Fill(cont_eleptvsv0dca);
2050  if(trk->Charge()>0) fHistoElePtvsV0dcaFeedDownXic0MCS->Fill(cont_eleptvsv0dca);
2051  else fHistoElePtvsV0dcaFeedDownXic0MCS->Fill(cont_eleptvsv0dca);
2052 
2053  fHistoResponseEleLambdaPtFeeddownXic0->Fill(mclc->Pt(),elobj->Pt());
2054  if(trk->Charge()>0) fHistoResponseEleLambdaPtFeeddownXic01->Fill(mclc->Pt(),trk->Pt());
2055  else fHistoResponseEleLambdaPtFeeddownXic02->Fill(mclc->Pt(),trk->Pt());
2056 
2057  fHistoElePtFeeddownXic0MCS->Fill(trk->Pt(),fCentrality);
2058  fHistoElePtvsEtaFeeddownXic0MCS->Fill(cont_eleptvseta);
2059  fHistoElePtvsLambdaPtFeeddownXic0MCS->Fill(cont_eleptvslambdapt);
2060  }
2061  }
2062  if(abs(pdgcode)==4232 && abs(mcpdgele_array[1])==4232 && abs(mcpdgv0_array[1])==3322){
2065  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1->Fill(cont2);
2067  if(cont[0]<2.3){
2068  fHistoFeedDownXicPlusMCS->Fill(cont_mclc);
2069  if(trk->Charge()>0) fHistoFeedDownXicPlusMCS1->Fill(cont_mclc);
2070  else fHistoFeedDownXicPlusMCS2->Fill(cont_mclc);
2071 
2072  fHistoElectronFeedDownXicPlusMCS1->Fill(cont_mcele);
2073  if(trk->Charge()>0) fHistoElectronFeedDownXicPlusMCS1->Fill(cont_mcele);
2074  else fHistoElectronFeedDownXicPlusMCS2->Fill(cont_mcele);
2075 
2076  fHistoElePtvsV0dlFeedDownXicPlusMCS->Fill(cont_eleptvsv0dl);
2077  if(trk->Charge()>0) fHistoElePtvsV0dlFeedDownXicPlusMCS1->Fill(cont_eleptvsv0dl);
2078  else fHistoElePtvsV0dlFeedDownXicPlusMCS2->Fill(cont_eleptvsv0dl);
2079 
2080  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS->Fill(cont_elelamptvsv0dl);
2081  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1->Fill(cont_elelamptvsv0dl);
2082  else fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2->Fill(cont_elelamptvsv0dl);
2083 
2084  if(isbottomfd){
2085  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS->Fill(cont_elelamptvsv0dl);
2086  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS1->Fill(cont_elelamptvsv0dl);
2087  else fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS2->Fill(cont_elelamptvsv0dl);
2088  }else{
2089  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS->Fill(cont_elelamptvsv0dl);
2090  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS1->Fill(cont_elelamptvsv0dl);
2091  else fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS2->Fill(cont_elelamptvsv0dl);
2092  }
2093 
2094  fHistoElePtvsV0dcaFeedDownXicPlusMCS->Fill(cont_eleptvsv0dca);
2095  if(trk->Charge()>0) fHistoElePtvsV0dcaFeedDownXicPlusMCS->Fill(cont_eleptvsv0dca);
2096  else fHistoElePtvsV0dcaFeedDownXicPlusMCS->Fill(cont_eleptvsv0dca);
2097 
2098  fHistoResponseEleLambdaPtFeeddownXicPlus->Fill(mclc->Pt(),elobj->Pt());
2099  if(trk->Charge()>0) fHistoResponseEleLambdaPtFeeddownXicPlus1->Fill(mclc->Pt(),trk->Pt());
2100  else fHistoResponseEleLambdaPtFeeddownXicPlus2->Fill(mclc->Pt(),trk->Pt());
2101 
2102  fHistoElePtFeeddownXicPlusMCS->Fill(trk->Pt(),fCentrality);
2103  fHistoElePtvsEtaFeeddownXicPlusMCS->Fill(cont_eleptvseta);
2104  fHistoElePtvsLambdaPtFeeddownXicPlusMCS->Fill(cont_eleptvslambdapt);
2105  }
2106  }
2107  if(abs(pdgcode)==4122 && abs(mcpdgele_array[1])==4122 && ( abs(mcpdgv0_array[1])==3212 || abs(mcpdgv0_array[1])==3214 || abs(mcpdgv0_array[1])==3224) ){
2108  if(cont[0]<2.3){
2109  fHistoFeedDownSigmaMCS->Fill(cont_mclc);
2110  if(trk->Charge()>0) fHistoFeedDownSigmaMCS1->Fill(cont_mclc);
2111  else fHistoFeedDownSigmaMCS2->Fill(cont_mclc);
2112 
2113  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS->Fill(cont_elelamptvsv0dl);
2114  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS1->Fill(cont_elelamptvsv0dl);
2115  else fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS2->Fill(cont_elelamptvsv0dl);
2116 
2117  if(isbottomfd){
2118  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS->Fill(cont_elelamptvsv0dl);
2119  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS1->Fill(cont_elelamptvsv0dl);
2120  else fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS2->Fill(cont_elelamptvsv0dl);
2121  }else{
2122  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS->Fill(cont_elelamptvsv0dl);
2123  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS1->Fill(cont_elelamptvsv0dl);
2124  else fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS2->Fill(cont_elelamptvsv0dl);
2125  }
2126  }
2127  }
2128  }
2129  }
2130  }else if((trk->Charge()<0 && !anti_lambda_flag) || (trk->Charge()>0 && anti_lambda_flag)){
2131  fHistoEleLambdaMassWS->Fill(cont);
2132  if(trk->Charge()>0) fHistoEleLambdaMassWS1->Fill(cont);
2133  else fHistoEleLambdaMassWS2->Fill(cont);
2134 
2135  fHistoEleLambdaMassvsElePtWS->Fill(cont2);
2136  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtWS1->Fill(cont2);
2137  else fHistoEleLambdaMassvsElePtWS2->Fill(cont2);
2138  if(cont[0]<2.3){
2139  fHistoEleLambdaPtvsRapidityWS->Fill(elobj->Pt(),elobj_rap);
2140  fHistoElePtWS->Fill(trk->Pt(),fCentrality);
2141  fHistoElePtvsEtaWS->Fill(cont_eleptvseta);
2142  fHistoElePtvsLambdaPtWS->Fill(cont_eleptvslambdapt);
2143  fHistoElePtvsd0WS->Fill(cont_eleptvsd0);
2144 
2145  fHistoElePtvsV0dlWS->Fill(cont_eleptvsv0dl);
2146  if(trk->Charge()>0) fHistoElePtvsV0dlWS1->Fill(cont_eleptvsv0dl);
2147  else fHistoElePtvsV0dlWS2->Fill(cont_eleptvsv0dl);
2148 
2149  fHistoEleLambdaPtvsV0dlWS->Fill(cont_elelamptvsv0dl);
2150  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWS1->Fill(cont_elelamptvsv0dl);
2151  else fHistoEleLambdaPtvsV0dlWS2->Fill(cont_elelamptvsv0dl);
2152 
2153  fHistoElePtvsV0dcaWS->Fill(cont_eleptvsv0dca);
2154  if(trk->Charge()>0) fHistoElePtvsV0dcaWS1->Fill(cont_eleptvsv0dca);
2155  else fHistoElePtvsV0dcaWS2->Fill(cont_eleptvsv0dca);
2156 
2157  for(Int_t ih=0;ih<17;ih++){
2158  Double_t cont_eleptvscutvars[3];
2159  cont_eleptvscutvars[0] = elobj->Pt();
2160  cont_eleptvscutvars[2] = fCentrality;
2161 
2162  if(ih==0){
2163  cont_eleptvscutvars[1] = trk->GetTPCNcls();
2164  }else if(ih==1){
2165  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
2166  }else if(ih==2){
2167  cont_eleptvscutvars[1] = nSigmaTPCele;
2168  }else if(ih==3){
2169  cont_eleptvscutvars[1] = nSigmaTOFele;
2170  }else if(ih==4){
2171  cont_eleptvscutvars[1] = trk->Eta();
2172  }else if(ih==5){
2173  cont_eleptvscutvars[1] = trk->GetITSNcls();
2174  }else if(ih==6){
2175  if(!anti_lambda_flag)
2176  cont_eleptvscutvars[1] = v0->MassLambda();
2177  else
2178  cont_eleptvscutvars[1] = v0->MassAntiLambda();
2179  }else if(ih==7){
2180  Double_t lPosV0[3];
2181  lPosV0[0] = v0->DecayVertexV0X();
2182  lPosV0[1] = v0->DecayVertexV0Y();
2183  lPosV0[2] = v0->DecayVertexV0Z();
2184  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
2185  }else if(ih==8){
2186  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
2187  }else if(ih==9){
2188  if(!anti_lambda_flag)
2189  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2190  else
2191  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2192  }else if(ih==10){
2193  if(!anti_lambda_flag)
2194  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2195  else
2196  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2197  }else if(ih==11){
2198  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
2199  }else if(ih==12){
2200  cont_eleptvscutvars[1] = v0->MassK0Short();
2201  }else if(ih==13){
2202  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
2203  }else if(ih==14){
2204  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
2205  }else if(ih==15){
2206  cont_eleptvscutvars[1] = v0->Eta();
2207  }else if(ih==16){
2208  Double_t v0px = elobj->PxProng(1);
2209  Double_t v0py = elobj->PyProng(1);
2210  Double_t v0pz = elobj->PzProng(1);
2211  Double_t epx = elobj->PxProng(0);
2212  Double_t epy = elobj->PyProng(0);
2213  Double_t epz = elobj->PzProng(0);
2214  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
2215  }else{
2216  cont_eleptvscutvars[1] = -9999.;
2217  }
2218 
2219  fHistoElePtvsCutVarsWS[ih]->Fill(cont_eleptvscutvars);
2220  }
2221  }
2222  }
2223  }
2224 
2225  //if( elobj->InvMass(2,pdgdg) < 10. && cosoa < 0. && fAnalCuts->IsPeakRegion(v0))
2226  if( melam_flip < 10. && cosoa < 0. && fAnalCuts->IsPeakRegion(v0))
2227  {
2228  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
2229  fHistoEleLambdaMassRSAway->Fill(cont_flip);
2230  if(trk->Charge()>0) fHistoEleLambdaMassRS1Away->Fill(cont_flip);
2231  else fHistoEleLambdaMassRS2Away->Fill(cont_flip);
2232  if(cont_flip[0]<2.3){
2233  fHistoEleLambdaPtvsV0dlRSAway->Fill(cont_elelamptvsv0dl_flip);
2234  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRS1Away->Fill(cont_elelamptvsv0dl_flip);
2235  else fHistoEleLambdaPtvsV0dlRS2Away->Fill(cont_elelamptvsv0dl_flip);
2236  }
2237  }else{
2238  fHistoEleLambdaMassWSAway->Fill(cont_flip);
2239  if(trk->Charge()>0) fHistoEleLambdaMassWS1Away->Fill(cont_flip);
2240  else fHistoEleLambdaMassWS2Away->Fill(cont_flip);
2241  if(cont_flip[0]<2.3){
2242  fHistoEleLambdaPtvsV0dlWSAway->Fill(cont_elelamptvsv0dl_flip);
2243  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWS1Away->Fill(cont_elelamptvsv0dl_flip);
2244  else fHistoEleLambdaPtvsV0dlWS2Away->Fill(cont_elelamptvsv0dl_flip);
2245  }
2246  }
2247  }
2248 
2250  {
2251  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
2252  fHistoEleLambdaMassRSSide->Fill(cont);
2253  if(trk->Charge()>0) fHistoEleLambdaMassRSSide1->Fill(cont);
2254  else fHistoEleLambdaMassRSSide2->Fill(cont);
2255 
2256  fHistoEleLambdaMassvsElePtRSSide->Fill(cont2);
2257  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtRSSide1->Fill(cont2);
2258  else fHistoEleLambdaMassvsElePtRSSide2->Fill(cont2);
2259 
2260  fHistoElePtvsV0dlRSSide->Fill(cont_eleptvsv0dl);
2261  if(trk->Charge()>0) fHistoElePtvsV0dlRSSide1->Fill(cont_eleptvsv0dl);
2262  else fHistoElePtvsV0dlRSSide2->Fill(cont_eleptvsv0dl);
2263 
2264  fHistoEleLambdaPtvsV0dlRSSide->Fill(cont_elelamptvsv0dl);
2265  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRSSide1->Fill(cont_elelamptvsv0dl);
2266  else fHistoEleLambdaPtvsV0dlRSSide2->Fill(cont_elelamptvsv0dl);
2267 
2268  fHistoElePtvsV0dcaRSSide->Fill(cont_eleptvsv0dca);
2269  if(trk->Charge()>0) fHistoElePtvsV0dcaRSSide1->Fill(cont_eleptvsv0dca);
2270  else fHistoElePtvsV0dcaRSSide2->Fill(cont_eleptvsv0dca);
2271 
2272  }else if((trk->Charge()<0 && !anti_lambda_flag) || (trk->Charge()>0 && anti_lambda_flag)){
2273  fHistoEleLambdaMassWSSide->Fill(cont);
2274  if(trk->Charge()>0) fHistoEleLambdaMassWSSide1->Fill(cont);
2275  else fHistoEleLambdaMassWSSide2->Fill(cont);
2276 
2277  fHistoEleLambdaMassvsElePtWSSide->Fill(cont2);
2278  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtWSSide1->Fill(cont2);
2279  else fHistoEleLambdaMassvsElePtWSSide2->Fill(cont2);
2280 
2281  fHistoElePtvsV0dlWSSide->Fill(cont_eleptvsv0dl);
2282  if(trk->Charge()>0) fHistoElePtvsV0dlWSSide1->Fill(cont_eleptvsv0dl);
2283  else fHistoElePtvsV0dlWSSide2->Fill(cont_eleptvsv0dl);
2284 
2285  fHistoEleLambdaPtvsV0dlWSSide->Fill(cont_elelamptvsv0dl);
2286  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWSSide1->Fill(cont_elelamptvsv0dl);
2287  else fHistoEleLambdaPtvsV0dlWSSide2->Fill(cont_elelamptvsv0dl);
2288 
2289  fHistoElePtvsV0dcaWSSide->Fill(cont_eleptvsv0dca);
2290  if(trk->Charge()>0) fHistoElePtvsV0dcaWSSide1->Fill(cont_eleptvsv0dca);
2291  else fHistoElePtvsV0dcaWSSide2->Fill(cont_eleptvsv0dca);
2292  }
2293  }
2294 
2295  //if( elobj->InvMass(2,pdgdg) < 10. && cosoa < 0. && fAnalCuts->IsSideBand(v0))
2296  if( melam_flip < 10. && cosoa < 0. && fAnalCuts->IsSideBand(v0))
2297  {
2298  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
2299  fHistoEleLambdaMassRSSideAway->Fill(cont_flip);
2300  if(trk->Charge()>0) fHistoEleLambdaMassRSSide1Away->Fill(cont_flip);
2301  else fHistoEleLambdaMassRSSide2Away->Fill(cont_flip);
2302  if(cont_flip[0]<2.3){
2303  fHistoEleLambdaPtvsV0dlRSSideAway->Fill(cont_elelamptvsv0dl_flip);
2304  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRSSide1Away->Fill(cont_elelamptvsv0dl_flip);
2305  else fHistoEleLambdaPtvsV0dlRSSide2Away->Fill(cont_elelamptvsv0dl_flip);
2306  }
2307  }else{
2308  fHistoEleLambdaMassWSSideAway->Fill(cont_flip);
2309  if(trk->Charge()>0) fHistoEleLambdaMassWSSide1Away->Fill(cont_flip);
2310  else fHistoEleLambdaMassWSSide2Away->Fill(cont_flip);
2311  if(cont_flip[0]<2.3){
2312  fHistoEleLambdaPtvsV0dlWSSideAway->Fill(cont_elelamptvsv0dl_flip);
2313  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWSSide1Away->Fill(cont_elelamptvsv0dl_flip);
2314  else fHistoEleLambdaPtvsV0dlWSSide2Away->Fill(cont_elelamptvsv0dl_flip);
2315  }
2316  }
2317  }
2318 
2319  return;
2320 }
2321 
2323 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMixROOTObjects(TLorentzVector *trke, TLorentzVector *v0, Double_t *v0info, Int_t chargepr)
2324 {
2328  if(!trke) return;
2329  if(!v0) return;
2330 
2331  for(Int_t i=0;i<75;i++){
2332  fCandidateVariables[i] = -9999.;
2333  }
2334 
2335 
2336  Double_t pxe = trke->Px();
2337  Double_t pye = trke->Py();
2338  Double_t pze = trke->Pz();
2339  Double_t mome = sqrt(pxe*pxe+pye*pye+pze*pze);
2340  Double_t Ee = sqrt(mome*mome+0.000510998928*0.000510998928);
2341 
2342  Double_t pxv = v0->Px();
2343  Double_t pyv = v0->Py();
2344  Double_t pzv = v0->Pz();
2345  Double_t momv = sqrt(pxv*pxv+pyv*pyv+pzv*pzv);
2346  Double_t Ev = sqrt(momv*momv+1.115683*1.115683);
2347 
2348  Double_t cosoa = (pxe*pxv+pye*pyv+pze*pzv)/mome/momv;
2349 
2350  Double_t pxsum = pxe + pxv;
2351  Double_t pysum = pye + pyv;
2352  Double_t pzsum = pze + pzv;
2353  Double_t Esum = Ee + Ev;
2354  Double_t mel = sqrt(Esum*Esum-pxsum*pxsum-pysum*pysum-pzsum*pzsum);
2355 
2356  Double_t uxe = pxe/mome;
2357  Double_t uye = pye/mome;
2358  Double_t uze = pze/mome;
2359  Double_t lf = -2.*(pxv*uxe+pyv*uye+pzv*uze);
2360  Double_t pxv_flip = pxv + lf * uxe;
2361  Double_t pyv_flip = pyv + lf * uye;
2362  Double_t pzv_flip = pzv + lf * uze;
2363  Double_t pxsum_flip = pxe + pxv_flip;
2364  Double_t pysum_flip = pye + pyv_flip;
2365  Double_t pzsum_flip = pze + pzv_flip;
2366  Double_t mel_flip = sqrt(Esum*Esum-pxsum_flip*pxsum_flip-pysum_flip*pysum_flip-pzsum_flip*pzsum_flip);
2367  Double_t ptel_flip = sqrt(pxsum_flip*pxsum_flip+pysum_flip*pysum_flip);
2368 
2370  UInt_t pdgdg[2]={11,3122};
2371  fCandidateVariables[ 1] = mel;
2372  fCandidateVariables[ 2] = sqrt(pxsum*pxsum+pysum*pysum);
2373  fCandidateVariables[ 3] = pxsum;
2374  fCandidateVariables[ 4] = pysum;
2375  fCandidateVariables[ 5] = pzsum;
2376  fCandidateVariables[ 6] = pxe;
2377  fCandidateVariables[ 7] = pye;
2378  fCandidateVariables[ 8] = pze;
2379  fCandidateVariables[ 9] = pxv;
2380  fCandidateVariables[10] = pyv;
2381  fCandidateVariables[11] = pzv;
2382  if(chargepr>0){
2383  fCandidateVariables[12] = 0;
2384  fCandidateVariables[13] = v0->M();
2385  fCandidateVariables[14] = 0.;
2386  }else{
2387  fCandidateVariables[12] = 1;
2388  fCandidateVariables[13] = 0;
2389  fCandidateVariables[14] = v0->M();
2390  }
2391 
2392  fCandidateVariables[21] = trke->T();
2393 
2394  fCandidateVariables[32] = 1;
2395 
2396  fCandidateVariables[54] = fVtx1->GetX();
2397  fCandidateVariables[55] = fVtx1->GetY();
2398  fCandidateVariables[56] = fVtx1->GetZ();
2399  fCandidateVariables[64] = v0info[0];
2400 
2403 
2404 
2405  if(fWriteVariableTree)
2406  fVariablesTree->Fill();
2407 
2408  Double_t cont[3];
2409  cont[0] = mel;
2410  cont[1] = sqrt(pxsum*pxsum+pysum*pysum);
2411  cont[2] = fCentrality;
2412  fHistoEleLambdaMass->Fill(cont);
2413 
2414  Double_t cont_flip[3];
2415  cont_flip[0] = mel_flip;
2416  cont_flip[1] = ptel_flip;
2417  cont_flip[2] = fCentrality;
2418 
2419  Double_t cont2[3];
2420  cont2[0] = mel;
2421  cont2[1] = sqrt(pxe*pxe+pye*pye);
2422  cont2[2] = fCentrality;
2423  Double_t cont_eleptvseta[3];
2424  cont_eleptvseta[0] = trke->Pt();
2425  cont_eleptvseta[1] = trke->Eta();
2426  cont_eleptvseta[2] = fCentrality;
2427 
2428  Double_t cont_eleptvslambdapt[3];
2429  cont_eleptvslambdapt[0] = trke->Pt();
2430  cont_eleptvslambdapt[1] = v0->Pt();
2431  cont_eleptvslambdapt[2] = fCentrality;
2432 
2433  Double_t cont_eleptvsd0[3];
2434  cont_eleptvsd0[0] = trke->Pt();
2435  cont_eleptvsd0[1] = 0.;
2436  cont_eleptvsd0[2] = fCentrality;
2437 
2438  Double_t cont_eleptvsv0dl[3];
2439  cont_eleptvsv0dl[0] = trke->Pt();
2440  cont_eleptvsv0dl[1] = v0info[0];
2441  cont_eleptvsv0dl[2] = fCentrality;
2442 
2443  Double_t cont_eleptvsv0dca[3];
2444  cont_eleptvsv0dca[0] = trke->Pt();
2445  cont_eleptvsv0dca[1] = v0info[1];
2446  cont_eleptvsv0dca[2] = fCentrality;
2447 
2448  Double_t cont_elelamptvsv0dl[4];
2449  cont_elelamptvsv0dl[0] = sqrt(pxsum*pxsum+pysum*pysum);
2450  cont_elelamptvsv0dl[1] = v0info[0];
2451  cont_elelamptvsv0dl[2] = 0.0;
2452  cont_elelamptvsv0dl[3] = fCentrality;
2453 
2454  Double_t cont_elelamptvsv0dl_flip[4];
2455  cont_elelamptvsv0dl_flip[0] = ptel_flip;
2456  cont_elelamptvsv0dl_flip[1] = v0info[0];
2457  cont_elelamptvsv0dl_flip[2] = 0.0;
2458  cont_elelamptvsv0dl_flip[3] = fCentrality;
2459 
2460  if(mel < 10. && cosoa>0. && fAnalCuts->IsPeakRegion(v0))
2461  {
2462 
2463  if(((int)trke->T())*chargepr>0){
2464  fHistoEleLambdaMassRSMix->Fill(cont);
2465  if(trke->T()>0) fHistoEleLambdaMassRSMix1->Fill(cont);
2466  else fHistoEleLambdaMassRSMix2->Fill(cont);
2467 
2468  fHistoEleLambdaMassvsElePtRSMix->Fill(cont2);
2469  if(trke->T()>0) fHistoEleLambdaMassvsElePtRSMix1->Fill(cont2);
2470  else fHistoEleLambdaMassvsElePtRSMix2->Fill(cont2);
2471  if(cont[0]<2.3){
2472  fHistoElePtRSMix->Fill(trke->Pt(),fCentrality);
2473  fHistoElePtvsEtaRSMix->Fill(cont_eleptvseta);
2474  fHistoElePtvsLambdaPtRSMix->Fill(cont_eleptvslambdapt);
2475  fHistoElePtvsd0RSMix->Fill(cont_eleptvsd0);
2476 
2477  fHistoElePtvsV0dlRSMix->Fill(cont_eleptvsv0dl);
2478  if(trke->T()>0) fHistoElePtvsV0dlRSMix1->Fill(cont_eleptvsv0dl);
2479  else fHistoElePtvsV0dlRSMix2->Fill(cont_eleptvsv0dl);
2480 
2481  fHistoEleLambdaPtvsV0dlRSMix->Fill(cont_elelamptvsv0dl);
2482  if(trke->T()>0) fHistoEleLambdaPtvsV0dlRSMix1->Fill(cont_elelamptvsv0dl);
2483  else fHistoEleLambdaPtvsV0dlRSMix2->Fill(cont_elelamptvsv0dl);
2484 
2485  fHistoElePtvsV0dcaRSMix->Fill(cont_eleptvsv0dca);
2486  if(trke->T()>0) fHistoElePtvsV0dcaRSMix1->Fill(cont_eleptvsv0dca);
2487  else fHistoElePtvsV0dcaRSMix2->Fill(cont_eleptvsv0dca);
2488  }
2489  }else{
2490  fHistoEleLambdaMassWSMix->Fill(cont);
2491  if(trke->T()>0) fHistoEleLambdaMassWSMix1->Fill(cont);
2492  else fHistoEleLambdaMassWSMix2->Fill(cont);
2493 
2494  fHistoEleLambdaMassvsElePtWSMix->Fill(cont2);
2495  if(trke->T()>0) fHistoEleLambdaMassvsElePtWSMix1->Fill(cont2);
2496  else fHistoEleLambdaMassvsElePtWSMix2->Fill(cont2);
2497  if(cont[0]<2.3){
2498  fHistoElePtWSMix->Fill(trke->Pt(),fCentrality);
2499  fHistoElePtvsEtaWSMix->Fill(cont_eleptvseta);
2500  fHistoElePtvsLambdaPtWSMix->Fill(cont_eleptvslambdapt);
2501  fHistoElePtvsd0WSMix->Fill(cont_eleptvsd0);
2502 
2503  fHistoElePtvsV0dlWSMix->Fill(cont_eleptvsv0dl);
2504  if(trke->T()>0) fHistoElePtvsV0dlWSMix1->Fill(cont_eleptvsv0dl);
2505  else fHistoElePtvsV0dlWSMix2->Fill(cont_eleptvsv0dl);
2506 
2507  fHistoEleLambdaPtvsV0dlWSMix->Fill(cont_elelamptvsv0dl);
2508  if(trke->T()>0) fHistoEleLambdaPtvsV0dlWSMix1->Fill(cont_elelamptvsv0dl);
2509  else fHistoEleLambdaPtvsV0dlWSMix2->Fill(cont_elelamptvsv0dl);
2510 
2511  fHistoElePtvsV0dcaWSMix->Fill(cont_eleptvsv0dca);
2512  if(trke->T()>0) fHistoElePtvsV0dcaWSMix1->Fill(cont_eleptvsv0dca);
2513  else fHistoElePtvsV0dcaWSMix2->Fill(cont_eleptvsv0dca);
2514  }
2515  }
2516  }
2517 
2518  //if(mel < 10. && cosoa<0. && fAnalCuts->IsPeakRegion(v0))
2519  if(mel_flip < 10. && cosoa<0. && fAnalCuts->IsPeakRegion(v0))
2520  {
2521  if(((int)trke->T())*chargepr>0){
2522  fHistoEleLambdaMassRSMixAway->Fill(cont_flip);
2523  if(trke->T()>0) fHistoEleLambdaMassRSMix1Away->Fill(cont_flip);
2524  else fHistoEleLambdaMassRSMix2Away->Fill(cont_flip);
2525  if(cont_flip[0]<2.3){
2526  fHistoEleLambdaPtvsV0dlRSMixAway->Fill(cont_elelamptvsv0dl_flip);
2527  if(trke->T()>0) fHistoEleLambdaPtvsV0dlRSMix1Away->Fill(cont_elelamptvsv0dl_flip);
2528  else fHistoEleLambdaPtvsV0dlRSMix2Away->Fill(cont_elelamptvsv0dl_flip);
2529  }
2530  }else{
2531  fHistoEleLambdaMassWSMixAway->Fill(cont_flip);
2532  if(trke->T()>0) fHistoEleLambdaMassWSMix1Away->Fill(cont_flip);
2533  else fHistoEleLambdaMassWSMix2Away->Fill(cont_flip);
2534  if(cont_flip[0]<2.3){
2535  fHistoEleLambdaPtvsV0dlWSMixAway->Fill(cont_elelamptvsv0dl_flip);
2536  if(trke->T()>0) fHistoEleLambdaPtvsV0dlWSMix1Away->Fill(cont_elelamptvsv0dl_flip);
2537  else fHistoEleLambdaPtvsV0dlWSMix2Away->Fill(cont_elelamptvsv0dl_flip);
2538  }
2539  }
2540  }
2541 
2542  return;
2543 }
2546 {
2547  //
2549  //
2550 
2551  const char* nameoutput = GetOutputSlot(5)->GetContainer()->GetName();
2552  fEleVariablesTree = new TTree(nameoutput,"electron variables tree");
2553  Int_t nVar = 26;
2554  fCandidateEleVariables = new Float_t [nVar];
2555  TString * fCandidateVariableNames = new TString[nVar];
2556 
2557  fCandidateVariableNames[ 0]="ElePx";
2558  fCandidateVariableNames[ 1]="ElePy";
2559  fCandidateVariableNames[ 2]="ElePz";
2560  fCandidateVariableNames[ 3]="TPCChi2overNDF";
2561  fCandidateVariableNames[ 4]="ITSNcls";
2562  fCandidateVariableNames[ 5]="TPCNcls";
2563  fCandidateVariableNames[ 6]="TPCNclsPID";
2564  fCandidateVariableNames[ 7]="TPCNclsRatio";
2565  fCandidateVariableNames[ 8]="d0R";
2566  fCandidateVariableNames[ 9]="d0Z";
2567  fCandidateVariableNames[10]="ITSClusterMap";
2568  fCandidateVariableNames[11]="nSigmaTPCele";
2569  fCandidateVariableNames[12]="nSigmaTOFele";
2570  fCandidateVariableNames[13]="nSigmaTPCpi";
2571  fCandidateVariableNames[14]="nSigmaTPCka";
2572  fCandidateVariableNames[15]="nSigmaTPCpr";
2573  fCandidateVariableNames[16]="EvNumber";
2574  fCandidateVariableNames[17]="EleCharge";
2575  fCandidateVariableNames[18]="ElePdgCode";
2576  fCandidateVariableNames[19]="EleMotherPdgCode";
2577  fCandidateVariableNames[20]="mcelepx";
2578  fCandidateVariableNames[21]="mcelepy";
2579  fCandidateVariableNames[22]="mcelepz";
2580  fCandidateVariableNames[23]="Centrality";
2581  fCandidateVariableNames[24]="PrimVertZ";
2582  fCandidateVariableNames[25]="RunNumber";
2583 
2584  for (Int_t ivar=0; ivar<nVar; ivar++) {
2585  fEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2586  }
2587 
2588  return;
2589 }
2591 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillElectronROOTObjects(AliAODTrack *trk, TClonesArray *mcArray)
2592 {
2593  //
2595  //
2596 
2597  if(!trk) return;
2598 
2599  fHistoBachPt->Fill(trk->Pt());
2600  fHistoElectronQovPtvsPhi->Fill(trk->Phi(),(Double_t)trk->Charge()/trk->Pt());
2601 
2602  if(fDoEventMixing){
2603  fElectronTracks->AddLast(new TLorentzVector(trk->Px(),trk->Py(),trk->Pz(),trk->Charge()));
2604  }
2605 
2606  Int_t pdgEle = -9999;
2607  Int_t pdgEleMother = -9999;
2608  Float_t mcelepx = -9999;
2609  Float_t mcelepy = -9999;
2610  Float_t mcelepz = -9999;
2611  if(fUseMCInfo)
2612  {
2613  Int_t labEle = trk->GetLabel();
2614  if(labEle<0) return;
2615  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
2616  if(!mcetrk) return;
2617  pdgEle = mcetrk->GetPdgCode();
2618  if(abs(pdgEle)!=11) return;
2619 
2620  Bool_t hfe_flag = kFALSE;
2621  Bool_t gamma_flag = kFALSE;
2622  Int_t labemother = mcetrk->GetMother();
2623  if(labemother>=0){
2624  AliAODMCParticle *motherele = (AliAODMCParticle*)mcArray->At(labemother);
2625  pdgEleMother = motherele->GetPdgCode();
2626  if(abs(pdgEleMother)>4000&&abs(pdgEleMother)<4400){
2627  hfe_flag = kTRUE;
2628  }
2629  if(abs(pdgEleMother)==22){
2630  gamma_flag = kTRUE;
2631  }
2632  }
2633  if(!gamma_flag){
2634  fHistoBachPtMCS->Fill(trk->Pt());
2635  }
2636 
2637  if(!hfe_flag) return;
2638  mcelepx = mcetrk->Px();
2639  mcelepy = mcetrk->Py();
2640  mcelepz = mcetrk->Pz();
2641  }
2642 
2643  if(!fWriteEachVariableTree) return;
2644 
2645  for(Int_t i=0;i<26;i++){
2646  fCandidateEleVariables[i] = -9999.;
2647  }
2648 
2649  fCandidateEleVariables[ 0] = trk->Px();
2650  fCandidateEleVariables[ 1] = trk->Py();
2651  fCandidateEleVariables[ 2] = trk->Pz();
2652  fCandidateEleVariables[ 3] = trk->Chi2perNDF();
2653  fCandidateEleVariables[ 4] = trk->GetITSNcls();
2654  fCandidateEleVariables[ 5] = trk->GetTPCncls();
2655  fCandidateEleVariables[ 6] = trk->GetTPCsignalN();
2656  if(trk->GetTPCNclsF()>0)
2657  fCandidateEleVariables[ 7] = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
2658 
2659  Double_t d0z0[2],covd0z0[3];
2660  trk->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);
2661 
2662  fCandidateEleVariables[ 8] = d0z0[0];
2663  fCandidateEleVariables[ 9] = d0z0[1];
2664  Int_t itsmap = trk->GetITSClusterMap();
2665  Int_t bit1 = 1;
2666  Int_t bit2 = 2;
2667  Bool_t spdfirst = (itsmap & bit1) == bit1;
2668  Bool_t spdsecond = (itsmap & bit2) == bit2;
2669  fCandidateEleVariables[10] = ((Int_t)spdfirst) + 2 * ((Int_t)spdsecond);
2670 
2671  if(fAnalCuts->GetIsUsePID())
2672  {
2673  Double_t nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
2674  Double_t nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
2675  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
2676  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
2677  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
2678  fCandidateEleVariables[11] = nSigmaTPCele;
2679  fCandidateEleVariables[12] = nSigmaTOFele;
2680  fCandidateEleVariables[13] = nSigmaTPCpi_etrk;
2681  fCandidateEleVariables[14] = nSigmaTPCka_etrk;
2682  fCandidateEleVariables[15] = nSigmaTPCpr_etrk;
2683  }
2685  fCandidateEleVariables[17] = trk->Charge();
2686  fCandidateEleVariables[18] = pdgEle;
2687  fCandidateEleVariables[19] = pdgEleMother;
2688  fCandidateEleVariables[20] = mcelepx;
2689  fCandidateEleVariables[21] = mcelepy;
2690  fCandidateEleVariables[22] = mcelepz;
2694 
2695  fHistod0Bach->Fill(d0z0[0]);
2696 
2697  fEleVariablesTree->Fill();
2698 }
2701 {
2702  //
2704  //
2705 
2706  const char* nameoutput = GetOutputSlot(6)->GetContainer()->GetName();
2707  fV0VariablesTree = new TTree(nameoutput,"v0 variables tree");
2708  Int_t nVar = 33;
2709  fCandidateV0Variables = new Float_t [nVar];
2710  TString * fCandidateVariableNames = new TString[nVar];
2711 
2712  fCandidateVariableNames[ 0]="V0Px";
2713  fCandidateVariableNames[ 1]="V0Py";
2714  fCandidateVariableNames[ 2]="V0Pz";
2715  fCandidateVariableNames[ 3]="MassLambda";
2716  fCandidateVariableNames[ 4]="MassAntiLambda";
2717  fCandidateVariableNames[ 5]="ProtonPx";
2718  fCandidateVariableNames[ 6]="ProtonPy";
2719  fCandidateVariableNames[ 7]="ProtonPz";
2720  fCandidateVariableNames[ 8]="PionPx";
2721  fCandidateVariableNames[ 9]="PionPy";
2722  fCandidateVariableNames[10]="PionPz";
2723  fCandidateVariableNames[11]="RfidV0";
2724  fCandidateVariableNames[12]="DcaV0PrToPrimVertex";
2725  fCandidateVariableNames[13]="DcaV0PiToPrimVertex";
2726  fCandidateVariableNames[14]="DcaV0daughters";
2727  fCandidateVariableNames[15]="V0CosPointingAngle";
2728  fCandidateVariableNames[16]="V0ProperDecayLength";
2729  fCandidateVariableNames[17]="MassK0Short";
2730  fCandidateVariableNames[18]="nSigmaTPCpr";
2731  fCandidateVariableNames[19]="nSigmaTPCpi";
2732  fCandidateVariableNames[20]="TPCNCrossV0Pr";
2733  fCandidateVariableNames[21]="TPCNCrossV0Pi";
2734  fCandidateVariableNames[22]="TPCNCrossRatioV0Pr";
2735  fCandidateVariableNames[23]="TPCNCrossRatioV0Pi";
2736  fCandidateVariableNames[24]="V0PdgCode";
2737  fCandidateVariableNames[25]="V0MotherPdgCode";
2738  fCandidateVariableNames[26]="mcv0px";
2739  fCandidateVariableNames[27]="mcv0py";
2740  fCandidateVariableNames[28]="mcv0pz";
2741  fCandidateVariableNames[29]="EvNumber";
2742  fCandidateVariableNames[30]="Centrality";
2743  fCandidateVariableNames[31]="PrimVertZ";
2744  fCandidateVariableNames[32]="RunNumber";
2745 
2746  for (Int_t ivar=0; ivar<nVar; ivar++) {
2747  fV0VariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateV0Variables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2748  }
2749 
2750  return;
2751 }
2752 
2754 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillV0ROOTObjects(AliAODv0 *v0, TClonesArray *mcArray)
2755 {
2756  //
2758  //
2759  if(!v0) return;
2760 
2761  Double_t mlamPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
2762  Double_t posVtx[3] = {0.,0.,0.};
2763  fVtx1->GetXYZ(posVtx);
2764  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
2765  Double_t v0propdl = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
2766 
2767  if(TMath::Abs(v0->MassLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
2768  fHistoLambdaMassvsPt->Fill(v0->MassLambda(),v0->Pt());
2769  }
2770  if(TMath::Abs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
2771  fHistoLambdaMassvsPt->Fill(v0->MassAntiLambda(),v0->Pt());
2772  }
2773  fHistoK0sMassvsPt->Fill(v0->MassK0Short(),v0->Pt());
2774 
2775  if(fAnalCuts->IsPeakRegion(v0)){
2776  fHistoLambdaPtvsDl->Fill(v0->Pt(),v0propdl);
2777  }
2778  if(fAnalCuts->IsSideBand(v0)){
2779  fHistoLambdaPtvsDlSide->Fill(v0->Pt(),v0propdl);
2780  }
2781 
2782  Double_t momv0x = v0->MomV0X();
2783  Double_t momv0y = v0->MomV0Y();
2784  Double_t phi_alice = atan2(momv0y,momv0x);
2785  if(phi_alice<0.) phi_alice += 2 * M_PI;
2786  fHistoLambdaQovPtvsPhi->Fill(phi_alice,1./sqrt(momv0x*momv0x+momv0y*momv0y));
2787 
2788  Int_t v0pdgcode = -9999;
2789  Int_t v0motherpdgcode = -9999;
2790  Float_t mcv0px = -9999;
2791  Float_t mcv0py = -9999;
2792  Float_t mcv0pz = -9999;
2793  if(fUseMCInfo)
2794  {
2795  Int_t pdgdgv0[2]={2212,211};
2796  Int_t labV0 = v0->MatchToMC(3122,mcArray,2,pdgdgv0); // the V0
2797  if(labV0>=0){
2798  if(TMath::Abs(v0->MassLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
2799  fHistoLambdaMassvsPtMCS->Fill(v0->MassLambda(),v0->Pt());
2800  }
2801  if(TMath::Abs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
2802  fHistoLambdaMassvsPtMCS->Fill(v0->MassAntiLambda(),v0->Pt());
2803  }
2804  }
2805  if(labV0<0) return;
2806  AliAODMCParticle *mcv0trk = (AliAODMCParticle*)mcArray->At(labV0);
2807  if(!mcv0trk) return;
2808 
2809  Bool_t hfv0_flag = kFALSE;
2810  v0pdgcode = mcv0trk->GetPdgCode();
2811  Int_t labv0mother = mcv0trk->GetMother();
2812  if(labv0mother>=0){
2813  AliAODMCParticle *motherv0 = (AliAODMCParticle*)mcArray->At(labv0mother);
2814  if(motherv0){
2815  v0motherpdgcode = motherv0->GetPdgCode();
2816  if(abs(v0motherpdgcode)>4000&&abs(v0motherpdgcode)<4400){
2817  hfv0_flag = kTRUE;
2818  }
2819  if(abs(v0motherpdgcode)==3322){
2820  fHistoLambdaPtvsDlFeeddownXi0MCS->Fill(v0->Pt(),v0propdl);
2821  }else if(abs(v0motherpdgcode)==3312){
2822  fHistoLambdaPtvsDlFeeddownXiMinusMCS->Fill(v0->Pt(),v0propdl);
2823  }else if(abs(v0motherpdgcode)==3334){
2824  fHistoLambdaPtvsDlFeeddownOmegaMCS->Fill(v0->Pt(),v0propdl);
2825  }else{
2826  fHistoLambdaPtvsDlMCS->Fill(v0->Pt(),v0propdl);
2827  }
2828  }
2829  }
2830  if(!hfv0_flag) return;
2831  mcv0px = mcv0trk->Px();
2832  mcv0py = mcv0trk->Py();
2833  mcv0pz = mcv0trk->Pz();
2834  }
2835 
2836  if(fDoEventMixing){
2837  Double_t posVtx[3] = {0.,0.,0.};
2838  fVtx1->GetXYZ(posVtx);
2839  TLorentzVector *lv = new TLorentzVector();
2840  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
2841  if(TMath::Abs(v0->MassLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
2842  lv->SetXYZM(v0->Px(),v0->Py(),v0->Pz(),v0->MassLambda());
2843  fV0Tracks1->AddLast(lv);
2844  fV0dlArray1.push_back(v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam);
2845  fV0dcaArray1.push_back(v0->DcaV0ToPrimVertex());
2846  }else{
2847  lv->SetXYZM(v0->Px(),v0->Py(),v0->Pz(),v0->MassAntiLambda());
2848  fV0Tracks2->AddLast(lv);
2849  fV0dlArray2.push_back(v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam);
2850  fV0dcaArray2.push_back(v0->DcaV0ToPrimVertex());
2851  }
2852  }
2853 
2854 
2855  if(!fWriteEachVariableTree) return;
2856 
2857  for(Int_t i=0;i<32;i++){
2858  fCandidateV0Variables[i] = -9999.;
2859  }
2860 
2861  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
2862  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
2863  if(!cptrack) return;
2864  if(!cntrack) return;
2865  if(cptrack->Charge()<0 && cntrack->Charge()>0){
2866  cptrack = (AliAODTrack*)(v0->GetDaughter(1));
2867  cntrack = (AliAODTrack*)(v0->GetDaughter(0));
2868  }
2869 
2870  fCandidateV0Variables[ 0] = v0->Px();
2871  fCandidateV0Variables[ 1] = v0->Py();
2872  fCandidateV0Variables[ 2] = v0->Pz();
2873  fCandidateV0Variables[ 3] = v0->MassLambda();
2874  fCandidateV0Variables[ 4] = v0->MassAntiLambda();
2875 
2876  Bool_t isparticle = kTRUE;
2877  if(fabs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()) isparticle=kFALSE;
2878 
2879  if(isparticle){
2880  fCandidateV0Variables[ 5] = cptrack->Px();
2881  fCandidateV0Variables[ 6] = cptrack->Py();
2882  fCandidateV0Variables[ 7] = cptrack->Pz();
2883  fCandidateV0Variables[ 8] = cntrack->Px();
2884  fCandidateV0Variables[ 9] = cntrack->Py();
2885  fCandidateV0Variables[10] = cntrack->Pz();
2886  }else{
2887  fCandidateV0Variables[ 5] = cntrack->Px();
2888  fCandidateV0Variables[ 6] = cntrack->Py();
2889  fCandidateV0Variables[ 7] = cntrack->Pz();
2890  fCandidateV0Variables[ 8] = cptrack->Px();
2891  fCandidateV0Variables[ 9] = cptrack->Py();
2892  fCandidateV0Variables[10] = cptrack->Pz();
2893  }
2894 
2895  Double_t lPosV0[3];
2896  lPosV0[0] = v0->DecayVertexV0X();
2897  lPosV0[1] = v0->DecayVertexV0Y();
2898  lPosV0[2] = v0->DecayVertexV0Z();
2899  Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
2900  fCandidateV0Variables[11] = decayvertV0;
2901 
2902  Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
2903  Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
2904  if(isparticle){
2905  fCandidateV0Variables[12] = lDcaPosToPrimVertex;
2906  fCandidateV0Variables[13] = lDcaNegToPrimVertex;
2907  }else{
2908  fCandidateV0Variables[12] = lDcaNegToPrimVertex;
2909  fCandidateV0Variables[13] = lDcaPosToPrimVertex;
2910  }
2911  fCandidateV0Variables[14] = v0->DcaV0Daughters();
2912  fCandidateV0Variables[15] = v0->CosPointingAngle(posVtx);
2913  fCandidateV0Variables[16] = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
2914  fCandidateV0Variables[17] = v0->MassK0Short();
2915 
2916  if(fAnalCuts->GetUseLambdaPID())
2917  {
2918  if(isparticle){
2919  Double_t nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
2920  Double_t nSigmaTPCv0pi = fAnalCuts->GetPidPion()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
2921  fCandidateV0Variables[18] = nSigmaTPCv0pr;
2922  fCandidateV0Variables[19] = nSigmaTPCv0pi;
2923  }else{
2924  Double_t nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
2925  Double_t nSigmaTPCv0pi = fAnalCuts->GetPidPion()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
2926  fCandidateV0Variables[18] = nSigmaTPCv0pr;
2927  fCandidateV0Variables[19] = nSigmaTPCv0pi;
2928  }
2929  }
2930  if(isparticle){
2931  fCandidateV0Variables[20] = cptrack->GetTPCClusterInfo(2,1);
2932  fCandidateV0Variables[21] = cntrack->GetTPCClusterInfo(2,1);
2933  if(cptrack->GetTPCNclsF()>0)
2934  fCandidateV0Variables[22] = (Float_t) cptrack->GetTPCClusterInfo(2,1)/(Float_t)cptrack->GetTPCNclsF();
2935  if(cntrack->GetTPCNclsF()>0)
2936  fCandidateV0Variables[23] =(Float_t) cntrack->GetTPCClusterInfo(2,1)/(Float_t)cntrack->GetTPCNclsF();
2937  }else{
2938  fCandidateV0Variables[20] = cntrack->GetTPCClusterInfo(2,1);
2939  fCandidateV0Variables[21] = cptrack->GetTPCClusterInfo(2,1);
2940  if(cntrack->GetTPCNclsF()>0)
2941  fCandidateV0Variables[22] = (Float_t) cntrack->GetTPCClusterInfo(2,1)/(Float_t)cntrack->GetTPCNclsF();
2942  if(cptrack->GetTPCNclsF()>0)
2943  fCandidateV0Variables[23] = (Float_t) cptrack->GetTPCClusterInfo(2,1)/(Float_t)cptrack->GetTPCNclsF();
2944  }
2945  fCandidateV0Variables[24] = v0pdgcode;
2946  fCandidateV0Variables[25] = v0motherpdgcode;
2947  fCandidateV0Variables[26] = mcv0px;
2948  fCandidateV0Variables[27] = mcv0py;
2949  fCandidateV0Variables[28] = mcv0pz;
2954 
2955 
2956  fV0VariablesTree->Fill();
2957 }
2960 {
2964 
2965  const char* nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
2966  fMCVariablesTree = new TTree(nameoutput,"MC variables tree");
2967  Int_t nVar = 11;
2968  fCandidateMCVariables = new Float_t [nVar];
2969  TString * fCandidateVariableNames = new TString[nVar];
2970 
2971  fCandidateVariableNames[ 0]="Centrality";
2972  fCandidateVariableNames[ 1]="DecayType";
2973  fCandidateVariableNames[ 2]="LcPx";
2974  fCandidateVariableNames[ 3]="LcPy";
2975  fCandidateVariableNames[ 4]="LcPz";
2976  fCandidateVariableNames[ 5]="ElePx";
2977  fCandidateVariableNames[ 6]="ElePy";
2978  fCandidateVariableNames[ 7]="ElePz";
2979  fCandidateVariableNames[ 8]="V0Px";
2980  fCandidateVariableNames[ 9]="V0Py";
2981  fCandidateVariableNames[10]="V0Pz";
2982 
2983  for (Int_t ivar=0; ivar<nVar; ivar++) {
2984  fMCVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2985  }
2986  return;
2987 }
2989 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCROOTObjects(AliAODMCParticle *mcpart, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype)
2990 {
2991  //
2993  //
2994  if(!mcpart) return;
2995  if(!mcepart) return;
2996  if(!mcv0part) return;
2997 
2998  for(Int_t i=0;i<11;i++){
2999  fCandidateMCVariables[i] = -9999.;
3000  }
3001 
3003  fCandidateMCVariables[ 1] = (Float_t) decaytype;
3004  fCandidateMCVariables[ 2] = mcpart->Px();
3005  fCandidateMCVariables[ 3] = mcpart->Py();
3006  fCandidateMCVariables[ 4] = mcpart->Pz();
3007  fCandidateMCVariables[ 5] = mcepart->Px();
3008  fCandidateMCVariables[ 6] = mcepart->Py();
3009  fCandidateMCVariables[ 7] = mcepart->Pz();
3010  fCandidateMCVariables[ 8] = mcv0part->Px();
3011  fCandidateMCVariables[ 9] = mcv0part->Py();
3012  fCandidateMCVariables[10] = mcv0part->Pz();
3013 
3014  Double_t epx = mcepart->Px();
3015  Double_t epy = mcepart->Py();
3016  Double_t epz = mcepart->Pz();
3017  Double_t eE = sqrt(epx*epx+epy*epy+epz*epz+0.000511*0.000511);
3018  Double_t v0px = mcv0part->Px();
3019  Double_t v0py = mcv0part->Py();
3020  Double_t v0pz = mcv0part->Pz();
3021  Double_t v0E = sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz+1.1157*1.1157);
3022 
3023  Double_t InvMassEleLambda = sqrt(pow(eE+v0E,2)-pow(epx+v0px,2)-pow(epy+v0py,2)-pow(epz+v0pz,2));
3024 
3025  Double_t cont[3];
3026  cont[0] = InvMassEleLambda;
3027  cont[1] = mcpart->Pt();
3028  cont[2] = fCentrality;
3029  Double_t cont2[3];
3030  cont2[0] = InvMassEleLambda;
3031  cont2[1] = mcepart->Pt();
3032  cont2[2] = fCentrality;
3033  Double_t cont_eleptvseta[3];
3034  cont_eleptvseta[0] = mcepart->Pt();
3035  cont_eleptvseta[1] = mcepart->Eta();
3036  cont_eleptvseta[2] = fCentrality;
3037  Double_t cont_eleptvslambdapt[3];
3038  cont_eleptvslambdapt[0] = mcepart->Pt();
3039  cont_eleptvslambdapt[1] = mcv0part->Pt();
3040  cont_eleptvslambdapt[2] = fCentrality;
3041  Double_t cont_eleptvslambdaptvslcpt[4];
3042  cont_eleptvslambdaptvslcpt[0] = mcepart->Pt();
3043  cont_eleptvslambdaptvslcpt[1] = mcv0part->Pt();
3044  cont_eleptvslambdaptvslcpt[2] = mcpart->Pt();
3045  cont_eleptvslambdaptvslcpt[3] = fCentrality;
3046  Double_t contmc[3];
3047  contmc[0] = mcpart->Pt();
3048  contmc[1] = mcpart->Y();
3049  contmc[2] = fCentrality;
3050  Double_t contmcele[3];
3051  contmcele[0] = mcepart->Pt();
3052  contmcele[1] = mcepart->Eta();
3053  contmcele[2] = fCentrality;
3054 
3055  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
3056  Float_t etamin, etamax;
3057  esdcuts->GetEtaRange(etamin,etamax);
3058 
3059  if(decaytype==0){
3060  fHistoLcMCGen->Fill(contmc);
3061  if(mcpart->GetPdgCode()>0) fHistoLcMCGen1->Fill(contmc);
3062  if(mcpart->GetPdgCode()<0) fHistoLcMCGen2->Fill(contmc);
3063  fHistoLcElectronMCGen->Fill(contmcele);
3064  if(mcepart->GetPdgCode()<0) fHistoLcElectronMCGen1->Fill(contmcele);
3065  if(mcepart->GetPdgCode()>0) fHistoLcElectronMCGen2->Fill(contmcele);
3066  fHistoEleLambdaMassMCGen->Fill(cont);
3067  if(fabs(mcepart->Eta())<etamax){
3068  fHistoEleLambdaMassvsElePtMCGen->Fill(cont2);
3069  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtMCGen1->Fill(cont2);
3070  else fHistoEleLambdaMassvsElePtMCGen2->Fill(cont2);
3071  if(InvMassEleLambda<2.3){
3072  fHistoElePtMCGen->Fill(mcepart->Pt(),fCentrality);
3073  fHistoElePtvsEtaMCGen->Fill(cont_eleptvseta);
3074  fHistoElePtvsLambdaPtMCGen->Fill(cont_eleptvslambdapt);
3075  }
3076  }
3077  if(fabs(mcpart->Y())<0.7){
3078  if(InvMassEleLambda<2.3){
3079  fHistoElePtvsLambdaPtMCLcGen->Fill(cont_eleptvslambdapt);
3080  fHistoElePtvsLambdaPtvsLcPtMCGen->Fill(cont_eleptvslambdaptvslcpt);
3081  }
3082  }
3083  }else if(decaytype==1){
3084  fHistoFeedDownXic0MCGen->Fill(contmc);
3085  if(mcpart->GetPdgCode()>0) fHistoFeedDownXic0MCGen1->Fill(contmc);
3086  if(mcpart->GetPdgCode()<0) fHistoFeedDownXic0MCGen2->Fill(contmc);
3088  fHistoElectronFeedDownXic0MCGen->Fill(contmcele);
3089  if(mcepart->GetPdgCode()<0) fHistoElectronFeedDownXic0MCGen1->Fill(contmcele);
3090  if(mcepart->GetPdgCode()>0) fHistoElectronFeedDownXic0MCGen2->Fill(contmcele);
3091  if(fabs(mcepart->Eta())<etamax){
3093  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1->Fill(cont2);
3095  if(InvMassEleLambda<2.3){
3096  fHistoElePtFeeddownXic0MCGen->Fill(mcepart->Pt(),fCentrality);
3097  fHistoElePtvsEtaFeeddownXic0MCGen->Fill(cont_eleptvseta);
3098  fHistoElePtvsLambdaPtFeeddownXic0MCGen->Fill(cont_eleptvslambdapt);
3099  }
3100  }
3101  }else if(decaytype==2){
3102  fHistoFeedDownXicPlusMCGen->Fill(contmc);
3103  if(mcpart->GetPdgCode()>0) fHistoFeedDownXicPlusMCGen1->Fill(contmc);
3104  if(mcpart->GetPdgCode()<0) fHistoFeedDownXicPlusMCGen2->Fill(contmc);
3106  fHistoElectronFeedDownXicPlusMCGen->Fill(contmcele);
3107  if(mcepart->GetPdgCode()<0) fHistoElectronFeedDownXicPlusMCGen1->Fill(contmcele);
3108  if(mcepart->GetPdgCode()>0) fHistoElectronFeedDownXicPlusMCGen2->Fill(contmcele);
3109  if(fabs(mcepart->Eta())<etamax){
3111  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1->Fill(cont2);
3113  if(InvMassEleLambda<2.3){
3114  fHistoElePtFeeddownXicPlusMCGen->Fill(mcepart->Pt(),fCentrality);
3115  fHistoElePtvsEtaFeeddownXicPlusMCGen->Fill(cont_eleptvseta);
3116  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen->Fill(cont_eleptvslambdapt);
3117  }
3118  }
3119  }else if(decaytype==3){
3120  fHistoFeedDownSigmaMCGen->Fill(contmc);
3121  if(mcpart->GetPdgCode()>0) fHistoFeedDownSigmaMCGen1->Fill(contmc);
3122  if(mcpart->GetPdgCode()<0) fHistoFeedDownSigmaMCGen2->Fill(contmc);
3123  }
3124 
3126  fMCVariablesTree->Fill();
3127 }
3130 {
3131  //
3132  // Define electron tree variables
3133  //
3134 
3135  const char* nameoutput = GetOutputSlot(9)->GetContainer()->GetName();
3136  fMCEleVariablesTree = new TTree(nameoutput,"MC Ele variables tree");
3137  Int_t nVar = 8;
3138  fCandidateMCEleVariables = new Float_t [nVar];
3139  TString * fCandidateVariableNames = new TString[nVar];
3140 
3141  fCandidateVariableNames[ 0]="Centrality";
3142  fCandidateVariableNames[ 1]="ElePx";
3143  fCandidateVariableNames[ 2]="ElePy";
3144  fCandidateVariableNames[ 3]="ElePz";
3145  fCandidateVariableNames[ 4]="ElePdgCode";
3146  fCandidateVariableNames[ 5]="EleMotherPdgCode";
3147  fCandidateVariableNames[ 6]="RunNumber";
3148  fCandidateVariableNames[ 7]="EvNumber";
3149 
3150  for (Int_t ivar=0; ivar<nVar; ivar++) {
3151  fMCEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
3152  }
3153  return;
3154 }
3156 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
3157 {
3158  //
3159  // Fill tree depending on fWriteMCVariableTree
3160  //
3161  if(!mcepart) return;
3162 
3163  Bool_t hfe_flag = kFALSE;
3164  Int_t labemother = mcepart->GetMother();
3165  Int_t pdgmotherele = -9999;
3166  if(labemother>=0){
3167  AliAODMCParticle *motherele = (AliAODMCParticle*)mcArray->At(labemother);
3168  pdgmotherele = motherele->GetPdgCode();
3169  if(abs(pdgmotherele)>4000&&abs(pdgmotherele)<4400){
3170  hfe_flag = kTRUE;
3171  }
3172  }
3173  if(!hfe_flag) return;
3174 
3175  Double_t contmc[3];
3176  contmc[0] = mcepart->Pt();
3177  contmc[1] = mcepart->Eta();
3178  contmc[2] = fCentrality;
3179  fHistoElectronMCGen->Fill(contmc);
3180 
3181  for(Int_t i=0;i<8;i++){
3182  fCandidateMCEleVariables[i] = -9999.;
3183  }
3184 
3186  fCandidateMCEleVariables[ 1] = mcepart->Px();
3187  fCandidateMCEleVariables[ 2] = mcepart->Py();
3188  fCandidateMCEleVariables[ 3] = mcepart->Pz();
3189  fCandidateMCEleVariables[ 4] = mcepart->GetPdgCode();
3190  fCandidateMCEleVariables[ 5] = pdgmotherele;
3193 
3194 // if(fWriteMCVariableTree && fWriteEachVariableTree && mcepart->Pt()>0.4 && fabs(mcepart->Eta())<1.0 )
3195 // fMCEleVariablesTree->Fill();
3196 
3197 }
3200 {
3201  //
3202  // Define Mc v0 tree variables
3203  //
3204 
3205  const char* nameoutput = GetOutputSlot(10)->GetContainer()->GetName();
3206  fMCV0VariablesTree = new TTree(nameoutput,"MC v0 variables tree");
3207  Int_t nVar = 8;
3208  fCandidateMCV0Variables = new Float_t [nVar];
3209  TString * fCandidateVariableNames = new TString[nVar];
3210 
3211  fCandidateVariableNames[ 0]="Centrality";
3212  fCandidateVariableNames[ 1]="V0Px";
3213  fCandidateVariableNames[ 2]="V0Py";
3214  fCandidateVariableNames[ 3]="V0Pz";
3215  fCandidateVariableNames[ 4]="V0PdgCode";
3216  fCandidateVariableNames[ 5]="V0MotherPdgCode";
3217  fCandidateVariableNames[ 6]="RunNumber";
3218  fCandidateVariableNames[ 7]="EvNumber";
3219 
3220  for (Int_t ivar=0; ivar<nVar; ivar++) {
3221  fMCV0VariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCV0Variables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
3222  }
3223  return;
3224 }
3226 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCV0ROOTObjects(AliAODMCParticle *mcv0part, TClonesArray *mcArray)
3227 {
3228  //
3229  // Fill histograms or tree depending on fWriteMCVariableTree
3230  //
3231  if(!mcv0part) return;
3232 
3233  for(Int_t i=0;i<8;i++){
3234  fCandidateMCV0Variables[i] = -9999.;
3235  }
3236 
3237  Bool_t hfv0_flag = kFALSE;
3238  Int_t labv0mother = mcv0part->GetMother();
3239  Int_t pdgmotherv0 = -9999;
3240  if(labv0mother>=0){
3241  AliAODMCParticle *motherv0 = (AliAODMCParticle*)mcArray->At(labv0mother);
3242  if(motherv0){
3243  pdgmotherv0 = motherv0->GetPdgCode();
3244  if(abs(pdgmotherv0)>4000&&abs(pdgmotherv0)<4400){
3245  hfv0_flag = kTRUE;
3246  }
3247  }
3248  }
3249  if(!hfv0_flag) return;
3250 
3251  Double_t contmc[3];
3252  contmc[0] = mcv0part->Pt();
3253  contmc[1] = mcv0part->Eta();
3254  contmc[2] = fCentrality;
3255  fHistoLambdaMCGen->Fill(contmc);
3256 
3258  fCandidateMCV0Variables[ 1] = mcv0part->Px();
3259  fCandidateMCV0Variables[ 2] = mcv0part->Py();
3260  fCandidateMCV0Variables[ 3] = mcv0part->Pz();
3261  fCandidateMCV0Variables[ 4] = mcv0part->GetPdgCode();
3262  fCandidateMCV0Variables[ 5] = pdgmotherv0;
3265 
3266  if(fWriteMCVariableTree && fWriteEachVariableTree && mcv0part->Pt()>0.4 && fabs(mcv0part->Eta())<1.0 )
3267  fMCV0VariablesTree->Fill();
3268 }
3269 
3270 
3273  //
3275  //
3276 
3277  fCEvents = new TH1F("fCEvents","conter",18,-0.5,17.5);
3278  fCEvents->SetStats(kTRUE);
3279  fCEvents->GetXaxis()->SetBinLabel(1,"X1");
3280  fCEvents->GetXaxis()->SetBinLabel(2,"Analyzed events");
3281  fCEvents->GetXaxis()->SetBinLabel(3,"AliAODVertex exists");
3282  fCEvents->GetXaxis()->SetBinLabel(4,"TriggerOK");
3283  fCEvents->GetXaxis()->SetBinLabel(5,"IsEventSelected");
3284  fCEvents->GetXaxis()->SetBinLabel(6,"CascadesHF exists");
3285  fCEvents->GetXaxis()->SetBinLabel(7,"MCarray exists");
3286  fCEvents->GetXaxis()->SetBinLabel(8,"MCheader exists");
3287  fCEvents->GetXaxis()->SetBinLabel(9,"triggerClass!=CINT1");
3288  fCEvents->GetXaxis()->SetBinLabel(10,"triggerMask!=kAnyINT");
3289  fCEvents->GetXaxis()->SetBinLabel(11,"triggerMask!=kAny");
3290  fCEvents->GetXaxis()->SetBinLabel(12,"vtxTitle.Contains(Z)");
3291  fCEvents->GetXaxis()->SetBinLabel(13,"vtxTitle.Contains(3D)");
3292  fCEvents->GetXaxis()->SetBinLabel(14,"vtxTitle.Doesn'tContain(Z-3D)");
3293  fCEvents->GetXaxis()->SetBinLabel(15,Form("zVtx<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
3294  fCEvents->GetXaxis()->SetBinLabel(16,"!IsEventSelected");
3295  fCEvents->GetXaxis()->SetBinLabel(17,"triggerMask!=kAnyINT || triggerClass!=CINT1");
3296  fCEvents->GetXaxis()->SetBinLabel(18,Form("zVtxMC<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
3297  //fCEvents->GetXaxis()->SetTitle("");
3298  fCEvents->GetYaxis()->SetTitle("counts");
3299 
3300  fHTrigger = new TH1F("fHTrigger","counter",18,-0.5,17.5);
3301  fHTrigger->SetStats(kTRUE);
3302  fHTrigger->GetXaxis()->SetBinLabel(1,"X1");
3303  fHTrigger->GetXaxis()->SetBinLabel(2,"kMB");
3304  fHTrigger->GetXaxis()->SetBinLabel(3,"kSemiCentral");
3305  fHTrigger->GetXaxis()->SetBinLabel(4,"kCentral");
3306  fHTrigger->GetXaxis()->SetBinLabel(5,"kINT7");
3307  fHTrigger->GetXaxis()->SetBinLabel(6,"kEMC7");
3308  //fHTrigger->GetXaxis()->SetBinLabel(7,"Space");
3309  fHTrigger->GetXaxis()->SetBinLabel(8,"kMB|kSemiCentral|kCentral");
3310  fHTrigger->GetXaxis()->SetBinLabel(9,"kINT7|kEMC7");
3311  fHTrigger->GetXaxis()->SetBinLabel(11,"kMB&kSemiCentral");
3312  fHTrigger->GetXaxis()->SetBinLabel(12,"kMB&kCentral");
3313  fHTrigger->GetXaxis()->SetBinLabel(13,"kINT7&kEMC7");
3314 
3315  fHCentrality = new TH1F("fHCentrality","conter",100,0.,100.);
3316 
3317 
3318  fOutput->Add(fCEvents);
3319  fOutput->Add(fHTrigger);
3320  fOutput->Add(fHCentrality);
3321 
3322  return;
3323 }
3324 //__________________________________________________________________________
3326 {
3327  //
3329  //
3330 
3331  //------------------------------------------------
3332  // Basic histogram
3333  //------------------------------------------------
3334  Int_t bins_base[3]= {10,100 ,10};
3335  Double_t xmin_base[3]={1.1,0 ,0.00};
3336  Double_t xmax_base[3]={3.1,20. ,100};
3337  fHistoEleLambdaMass = new THnSparseF("fHistoEleLambdaMass","",3,bins_base,xmin_base,xmax_base);
3339  fHistoEleLambdaMassRS = new THnSparseF("fHistoEleLambdaMassRS","",3,bins_base,xmin_base,xmax_base);
3341  fHistoEleLambdaMassRS1 = new THnSparseF("fHistoEleLambdaMassRS1","",3,bins_base,xmin_base,xmax_base);
3343  fHistoEleLambdaMassRS2 = new THnSparseF("fHistoEleLambdaMassRS2","",3,bins_base,xmin_base,xmax_base);
3345  fHistoEleLambdaMassWS = new THnSparseF("fHistoEleLambdaMassWS","",3,bins_base,xmin_base,xmax_base);
3347  fHistoEleLambdaMassWS1 = new THnSparseF("fHistoEleLambdaMassWS1","",3,bins_base,xmin_base,xmax_base);
3349  fHistoEleLambdaMassWS2 = new THnSparseF("fHistoEleLambdaMassWS2","",3,bins_base,xmin_base,xmax_base);
3351  fHistoEleLambdaMassRSMix = new THnSparseF("fHistoEleLambdaMassRSMix","",3,bins_base,xmin_base,xmax_base);
3353  fHistoEleLambdaMassRSMix1 = new THnSparseF("fHistoEleLambdaMassRSMix1","",3,bins_base,xmin_base,xmax_base);
3355  fHistoEleLambdaMassRSMix2 = new THnSparseF("fHistoEleLambdaMassRSMix2","",3,bins_base,xmin_base,xmax_base);
3357  fHistoEleLambdaMassWSMix = new THnSparseF("fHistoEleLambdaMassWSMix","",3,bins_base,xmin_base,xmax_base);
3359  fHistoEleLambdaMassWSMix1 = new THnSparseF("fHistoEleLambdaMassWSMix1","",3,bins_base,xmin_base,xmax_base);
3361  fHistoEleLambdaMassWSMix2 = new THnSparseF("fHistoEleLambdaMassWSMix2","",3,bins_base,xmin_base,xmax_base);
3363  fHistoEleLambdaMassRSSide = new THnSparseF("fHistoEleLambdaMassRSSide","",3,bins_base,xmin_base,xmax_base);
3365  fHistoEleLambdaMassRSSide1 = new THnSparseF("fHistoEleLambdaMassRSSide1","",3,bins_base,xmin_base,xmax_base);
3367  fHistoEleLambdaMassRSSide2 = new THnSparseF("fHistoEleLambdaMassRSSide2","",3,bins_base,xmin_base,xmax_base);
3369  fHistoEleLambdaMassWSSide = new THnSparseF("fHistoEleLambdaMassWSSide","",3,bins_base,xmin_base,xmax_base);
3371  fHistoEleLambdaMassWSSide1 = new THnSparseF("fHistoEleLambdaMassWSSide1","",3,bins_base,xmin_base,xmax_base);
3373  fHistoEleLambdaMassWSSide2 = new THnSparseF("fHistoEleLambdaMassWSSide2","",3,bins_base,xmin_base,xmax_base);
3375 
3376  fHistoEleLambdaMassRSAway = new THnSparseF("fHistoEleLambdaMassRSAway","",3,bins_base,xmin_base,xmax_base);
3378  fHistoEleLambdaMassRS1Away = new THnSparseF("fHistoEleLambdaMassRS1Away","",3,bins_base,xmin_base,xmax_base);
3380  fHistoEleLambdaMassRS2Away = new THnSparseF("fHistoEleLambdaMassRS2Away","",3,bins_base,xmin_base,xmax_base);
3382  fHistoEleLambdaMassWSAway = new THnSparseF("fHistoEleLambdaMassWSAway","",3,bins_base,xmin_base,xmax_base);
3384  fHistoEleLambdaMassWS1Away = new THnSparseF("fHistoEleLambdaMassWS1Away","",3,bins_base,xmin_base,xmax_base);
3386  fHistoEleLambdaMassWS2Away = new THnSparseF("fHistoEleLambdaMassWS2Away","",3,bins_base,xmin_base,xmax_base);
3388  fHistoEleLambdaMassRSMixAway = new THnSparseF("fHistoEleLambdaMassRSMixAway","",3,bins_base,xmin_base,xmax_base);
3390  fHistoEleLambdaMassRSMix1Away = new THnSparseF("fHistoEleLambdaMassRSMix1Away","",3,bins_base,xmin_base,xmax_base);
3392  fHistoEleLambdaMassRSMix2Away = new THnSparseF("fHistoEleLambdaMassRSMix2Away","",3,bins_base,xmin_base,xmax_base);
3394  fHistoEleLambdaMassWSMixAway = new THnSparseF("fHistoEleLambdaMassWSMixAway","",3,bins_base,xmin_base,xmax_base);
3396  fHistoEleLambdaMassWSMix1Away = new THnSparseF("fHistoEleLambdaMassWSMix1Away","",3,bins_base,xmin_base,xmax_base);
3398  fHistoEleLambdaMassWSMix2Away = new THnSparseF("fHistoEleLambdaMassWSMix2Away","",3,bins_base,xmin_base,xmax_base);
3400  fHistoEleLambdaMassRSSideAway = new THnSparseF("fHistoEleLambdaMassRSSideAway","",3,bins_base,xmin_base,xmax_base);
3402  fHistoEleLambdaMassRSSide1Away = new THnSparseF("fHistoEleLambdaMassRSSide1Away","",3,bins_base,xmin_base,xmax_base);
3404  fHistoEleLambdaMassRSSide2Away = new THnSparseF("fHistoEleLambdaMassRSSide2Away","",3,bins_base,xmin_base,xmax_base);
3406  fHistoEleLambdaMassWSSideAway = new THnSparseF("fHistoEleLambdaMassWSSideAway","",3,bins_base,xmin_base,xmax_base);
3408  fHistoEleLambdaMassWSSide1Away = new THnSparseF("fHistoEleLambdaMassWSSide1Away","",3,bins_base,xmin_base,xmax_base);
3410  fHistoEleLambdaMassWSSide2Away = new THnSparseF("fHistoEleLambdaMassWSSide2Away","",3,bins_base,xmin_base,xmax_base);
3412 
3413  Int_t bins_base_elept[3]= {10,100 ,10};
3414  Double_t xmin_base_elept[3]={1.1,0 ,0.00};
3415  Double_t xmax_base_elept[3]={3.1,10. ,100};
3416  fHistoEleLambdaMassvsElePtRS = new THnSparseF("fHistoEleLambdaMassvsElePtRS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3418  fHistoEleLambdaMassvsElePtWS = new THnSparseF("fHistoEleLambdaMassvsElePtWS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3420  fHistoEleLambdaMassvsElePtRSMix = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3422  fHistoEleLambdaMassvsElePtWSMix = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3424  fHistoEleLambdaMassvsElePtRSSide = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3426  fHistoEleLambdaMassvsElePtWSSide = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3428  fHistoEleLambdaMassvsElePtRS1 = new THnSparseF("fHistoEleLambdaMassvsElePtRS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3430  fHistoEleLambdaMassvsElePtWS1 = new THnSparseF("fHistoEleLambdaMassvsElePtWS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3432  fHistoEleLambdaMassvsElePtRSMix1 = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3434  fHistoEleLambdaMassvsElePtWSMix1 = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3436  fHistoEleLambdaMassvsElePtRSSide1 = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3438  fHistoEleLambdaMassvsElePtWSSide1 = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3440  fHistoEleLambdaMassvsElePtRS2 = new THnSparseF("fHistoEleLambdaMassvsElePtRS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3442  fHistoEleLambdaMassvsElePtWS2 = new THnSparseF("fHistoEleLambdaMassvsElePtWS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3444  fHistoEleLambdaMassvsElePtRSMix2 = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3446  fHistoEleLambdaMassvsElePtWSMix2 = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3448  fHistoEleLambdaMassvsElePtRSSide2 = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3450  fHistoEleLambdaMassvsElePtWSSide2 = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3452 
3453  fHistoEleLambdaMassMCS = new THnSparseF("fHistoEleLambdaMassMCS","",3,bins_base,xmin_base,xmax_base);
3455  fHistoEleLambdaMassMCGen = new THnSparseF("fHistoEleLambdaMassMCGen","",3,bins_base,xmin_base,xmax_base);
3457  fHistoEleLambdaMassvsElePtMCS = new THnSparseF("fHistoEleLambdaMassvsElePtMCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3459  fHistoEleLambdaMassvsElePtMCGen = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3461  fHistoEleLambdaMassvsElePtMCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtMCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3463  fHistoEleLambdaMassvsElePtMCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3465  fHistoEleLambdaMassvsElePtMCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtMCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3467  fHistoEleLambdaMassvsElePtMCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3469 
3470  fHistoElePtRS = new TH2F("fHistoElePtRS","",100,0,10,10,0,100);
3471  fOutputAll->Add(fHistoElePtRS);
3472  fHistoElePtWS = new TH2F("fHistoElePtWS","",100,0.,10.,10,0,100);
3473  fOutputAll->Add(fHistoElePtWS);
3474  fHistoElePtRSMix = new TH2F("fHistoElePtRSMix","",100,0.,10.,10,0,100);
3476  fHistoElePtWSMix = new TH2F("fHistoElePtWSMix","",100,0.,10.,10,0,100);
3478  fHistoElePtMCS = new TH2F("fHistoElePtMCS","",100,0,10,10,0,100);
3479  fOutputAll->Add(fHistoElePtMCS);
3480  fHistoElePtMCGen = new TH2F("fHistoElePtMCGen","",100,0,10,10,0,100);
3482 
3483  Int_t bins_eleptvseta[3]= {10,10 ,10};
3484  Double_t xmin_eleptvseta[3]={0.,-1. ,0.0};
3485  Double_t xmax_eleptvseta[3]={5.,1. ,100};
3486 
3487  fHistoElePtvsEtaRS = new THnSparseF("fHistoElePtvsEtaRS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3489  fHistoElePtvsEtaWS = new THnSparseF("fHistoElePtvsEtaWS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3491  fHistoElePtvsEtaRSMix = new THnSparseF("fHistoElePtvsEtaRSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3493  fHistoElePtvsEtaWSMix = new THnSparseF("fHistoElePtvsEtaWSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3495  fHistoElePtvsEtaMCS = new THnSparseF("fHistoElePtvsEtaMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3497  fHistoElePtvsEtaMCGen = new THnSparseF("fHistoElePtvsEtaMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3499 
3500  Int_t bins_eleptvslambdapt[3]= {10,10 ,10};
3501  Double_t xmin_eleptvslambdapt[3]={0.,0. ,0.0};
3502  Double_t xmax_eleptvslambdapt[3]={5.,5. ,100};
3503 
3504  fHistoElePtvsLambdaPtRS = new THnSparseF("fHistoElePtvsLambdaPtRS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3506  fHistoElePtvsLambdaPtWS = new THnSparseF("fHistoElePtvsLambdaPtWS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3508  fHistoElePtvsLambdaPtRSMix = new THnSparseF("fHistoElePtvsLambdaPtRSMix","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3510  fHistoElePtvsLambdaPtWSMix = new THnSparseF("fHistoElePtvsLambdaPtWSMix","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3512  fHistoElePtvsLambdaPtMCS = new THnSparseF("fHistoElePtvsLambdaPtMCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3514  fHistoElePtvsLambdaPtMCGen = new THnSparseF("fHistoElePtvsLambdaPtMCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3516  fHistoElePtvsLambdaPtMCLcGen = new THnSparseF("fHistoElePtvsLambdaPtMCLcGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3518 
3519  Int_t bins_eleptvslambdaptvslcpt[4]= {10,10,10,10};
3520  Double_t xmin_eleptvslambdaptvslcpt[4]={0.,0.,0.,0.0};
3521  Double_t xmax_eleptvslambdaptvslcpt[4]={5.,5.,10.,100};
3522  fHistoElePtvsLambdaPtvsLcPtMCS = new THnSparseF("fHistoElePtvsLambdaPtvsLcPtMCS","",4,bins_eleptvslambdaptvslcpt,xmin_eleptvslambdaptvslcpt,xmax_eleptvslambdaptvslcpt);
3524  fHistoElePtvsLambdaPtvsLcPtMCGen = new THnSparseF("fHistoElePtvsLambdaPtvsLcPtMCGen","",4,bins_eleptvslambdaptvslcpt,xmin_eleptvslambdaptvslcpt,xmax_eleptvslambdaptvslcpt);
3526 
3527  Int_t bins_allpt[4]= {10,10,20,20};
3528  Double_t xmin_allpt[4]={0.,0.,0.,0.0};
3529  Double_t xmax_allpt[4]={20.,20.,10.,10};
3530  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt = new THnSparseF("fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt","",4,bins_allpt,xmin_allpt,xmax_allpt);
3532 
3533  fHistoEleLambdaPtvsRapidityRS=new TH2F("fHistoEleLambdaPtvsRapidityRS","EleLambda pt vs rap",20,0.,20.,40,-2.,2.);
3535  fHistoEleLambdaPtvsRapidityWS=new TH2F("fHistoEleLambdaPtvsRapidityWS","EleLambda pt vs rap",20,0.,20.,40,-2.,2.);
3537  fHistoEleLambdaPtvsRapidityMCS=new TH2F("fHistoEleLambdaPtvsRapidityMCS","EleLambda pt vs rap",20,0.,20.,40,-2.,2.);
3539 
3540  Int_t bins_eleptvsd0[3]= {10 ,10 ,10};
3541  Double_t xmin_eleptvsd0[3]={0.,-0.2 ,0.0};
3542  Double_t xmax_eleptvsd0[3]={5.,0.2 ,100};
3543 
3544  fHistoElePtvsd0RS = new THnSparseF("fHistoElePtvsd0RS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3546  fHistoElePtvsd0WS = new THnSparseF("fHistoElePtvsd0WS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3548  fHistoElePtvsd0RSMix = new THnSparseF("fHistoElePtvsd0RSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3550  fHistoElePtvsd0WSMix = new THnSparseF("fHistoElePtvsd0WSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3552  fHistoElePtvsd0MCS = new THnSparseF("fHistoElePtvsd0MCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3554  fHistoElePtvsd0PromptMCS = new THnSparseF("fHistoElePtvsd0PromptMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3556  fHistoElePtvsd0BFeeddownMCS = new THnSparseF("fHistoElePtvsd0BFeeddownMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3558 
3559 
3560  //Feeddown from Xic0
3561  fHistoEleLambdaMassFeeddownXic0MCS = new THnSparseF("fHistoEleLambdaMassFeeddownXic0MCS","",3,bins_base,xmin_base,xmax_base);
3563  fHistoEleLambdaMassFeeddownXic0MCGen = new THnSparseF("fHistoEleLambdaMassFeeddownXic0MCGen","",3,bins_base,xmin_base,xmax_base);
3565  fHistoEleLambdaMassvsElePtFeeddownXic0MCS = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3567  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3569  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3571  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3573  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3575  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3577  fHistoElePtFeeddownXic0MCS = new TH2F("fHistoElePtFeeddownXic0MCS","",100,0,10,10,0,100);
3579  fHistoElePtFeeddownXic0MCGen = new TH2F("fHistoElePtFeeddownXic0MCGen","",100,0,10,10,0,100);
3581  fHistoElePtvsEtaFeeddownXic0MCS = new THnSparseF("fHistoElePtvsEtaFeeddownXic0MCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3583  fHistoElePtvsEtaFeeddownXic0MCGen = new THnSparseF("fHistoElePtvsEtaFeeddownXic0MCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3585  fHistoElePtvsLambdaPtFeeddownXic0MCS = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXic0MCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3587  fHistoElePtvsLambdaPtFeeddownXic0MCGen = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXic0MCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3589 
3590  //Feeddown from XicPlus
3591  fHistoEleLambdaMassFeeddownXicPlusMCS = new THnSparseF("fHistoEleLambdaMassFeeddownXicPlusMCS","",3,bins_base,xmin_base,xmax_base);
3593  fHistoEleLambdaMassFeeddownXicPlusMCGen = new THnSparseF("fHistoEleLambdaMassFeeddownXicPlusMCGen","",3,bins_base,xmin_base,xmax_base);
3595  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3597  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3599  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3601  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3603  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3605  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3607  fHistoElePtFeeddownXicPlusMCS = new TH2F("fHistoElePtFeeddownXicPlusMCS","",100,0,10,10,0,100);
3609  fHistoElePtFeeddownXicPlusMCGen = new TH2F("fHistoElePtFeeddownXicPlusMCGen","",100,0,10,10,0,100);
3611  fHistoElePtvsEtaFeeddownXicPlusMCS = new THnSparseF("fHistoElePtvsEtaFeeddownXicPlusMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3613  fHistoElePtvsEtaFeeddownXicPlusMCGen = new THnSparseF("fHistoElePtvsEtaFeeddownXicPlusMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3615  fHistoElePtvsLambdaPtFeeddownXicPlusMCS = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXicPlusMCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3617  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXicPlusMCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3619 
3620  //------------------------------------------------
3621  // checking histograms
3622  //------------------------------------------------
3623  fHistoBachPt = new TH1F("fHistoBachPt","Bachelor p_{T}",100,0.0,5.0);
3624  fOutputAll->Add(fHistoBachPt);
3625  fHistoBachPtMCS = new TH1F("fHistoBachPtMCS","Bachelor p_{T}",100,0.0,5.0);
3627  fHistoBachPtMCGen = new TH1F("fHistoBachPtMCGen","Bachelor p_{T}",100,0.0,5.0);
3629  fHistod0Bach = new TH1F("fHistod0Bach","Bachelor d_{0}",100,-0.5,0.5);
3630  fOutputAll->Add(fHistod0Bach);
3631  fHistoLambdaMassvsPt=new TH2F("fHistoLambdaMassvsPt","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
3633  fHistoLambdaMassvsPtMCS=new TH2F("fHistoLambdaMassvsPtMCS","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
3635  fHistoLambdaMassvsPtMCGen=new TH2F("fHistoLambdaMassvsPtMCGen","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
3637  fHistoK0sMassvsPt=new TH2F("fHistoK0sMassvsPt","K0s mass",100,0.497-0.05,0.497+0.05,20,0.,10.);
3639  fHistoLambdaPtvsDl=new TH2F("fHistoLambdaPtvsDl","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3641  fHistoLambdaPtvsDlSide=new TH2F("fHistoLambdaPtvsDlSide","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3643  fHistoLambdaPtvsDlMCS=new TH2F("fHistoLambdaPtvsDlMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3645  fHistoLambdaPtvsDlFeeddownXi0MCS=new TH2F("fHistoLambdaPtvsDlFeeddownXi0MCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3647  fHistoLambdaPtvsDlFeeddownXiMinusMCS=new TH2F("fHistoLambdaPtvsDlFeeddownXiMinusMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3649  fHistoLambdaPtvsDlFeeddownOmegaMCS=new TH2F("fHistoLambdaPtvsDlFeeddownOmegaMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3651 
3652  fHistoElectronTPCPID=new TH2F("fHistoElectronTPCPID","",50,0.,5.,50,-20.,20.);
3654  fHistoElectronTOFPID=new TH2F("fHistoElectronTOFPID","",50,0.,5.,50,-20.,20.);
3656  fHistoElectronTPCSelPID=new TH2F("fHistoElectronTPCSelPID","",50,0.,5.,50,-20.,20.);
3658  fHistoElectronTOFSelPID=new TH2F("fHistoElectronTOFSelPID","",50,0.,5.,50,-20.,20.);
3660  fHistoElectronTPCPIDSelTOF=new TH2F("fHistoElectronTPCPIDSelTOF","",10,0.,5.,500,-10.,10.);
3662  fHistoElectronTPCPIDSelTOFSmallEta=new TH2F("fHistoElectronTPCPIDSelTOFSmallEta","",10,0.,5.,500,-10.,10.);
3664  fHistoElectronTPCPIDSelTOFLargeEta=new TH2F("fHistoElectronTPCPIDSelTOFLargeEta","",10,0.,5.,500,-10.,10.);
3666  fHistoMassConversionsMin=new TH1F("fHistoMassConversionsMin","",500,0,0.5);
3668  fHistoMassConversionsSameSignMin=new TH1F("fHistoMassConversionsSameSignMin","",500,0,0.5);
3670 
3671  for(Int_t i=0;i<8;i++){
3672  fHistoElectronTPCPIDSelTOFEtaDep[i]=new TH2F(Form("fHistoElectronTPCPIDSelTOFEtaDep[%d]",i),"",10,0.,5.,500,-10.,10.);
3674  }
3675  fHistoElectronQovPtvsPhi=new TH2F("fHistoElectronQovPtvsPhi","",70,0.,7.,50,-2.,2.);
3677  fHistoLambdaQovPtvsPhi=new TH2F("fHistoLambdaQovPtvsPhi","",70,0.,7.,50,-2.,2.);
3679 
3680  Int_t bins_lcmcgen[3]= {100 ,20 ,10};
3681  Double_t xmin_lcmcgen[3]={0.,-1.0 ,0.0};
3682  Double_t xmax_lcmcgen[3]={20.,1.0 ,100};
3683  fHistoLcMCGen = new THnSparseF("fHistoLcMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3684  fOutputAll->Add(fHistoLcMCGen);
3685  fHistoLcMCGen1 = new THnSparseF("fHistoLcMCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3686  fOutputAll->Add(fHistoLcMCGen1);
3687  fHistoLcMCGen2 = new THnSparseF("fHistoLcMCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3688  fOutputAll->Add(fHistoLcMCGen2);
3689  fHistoFeedDownXic0MCGen = new THnSparseF("fHistoFeedDownXic0MCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3691  fHistoFeedDownXic0MCGen1 = new THnSparseF("fHistoFeedDownXic0MCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3693  fHistoFeedDownXic0MCGen2 = new THnSparseF("fHistoFeedDownXic0MCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3695  fHistoFeedDownXicPlusMCGen = new THnSparseF("fHistoFeedDownXicPlusMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3697  fHistoFeedDownXicPlusMCGen1 = new THnSparseF("fHistoFeedDownXicPlusMCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3699  fHistoFeedDownXicPlusMCGen2 = new THnSparseF("fHistoFeedDownXicPlusMCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3701  fHistoFeedDownSigmaMCGen = new THnSparseF("fHistoFeedDownSigmaMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3703  fHistoFeedDownSigmaMCGen1 = new THnSparseF("fHistoFeedDownSigmaMCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3705  fHistoFeedDownSigmaMCGen2 = new THnSparseF("fHistoFeedDownSigmaMCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3707 
3708  fHistoLcMCS = new THnSparseF("fHistoLcMCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3709  fOutputAll->Add(fHistoLcMCS);
3710  fHistoLcMCS1 = new THnSparseF("fHistoLcMCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3711  fOutputAll->Add(fHistoLcMCS1);
3712  fHistoLcMCS2 = new THnSparseF("fHistoLcMCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3713  fOutputAll->Add(fHistoLcMCS2);
3714  fHistoFeedDownXic0MCS = new THnSparseF("fHistoFeedDownXic0MCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3716  fHistoFeedDownXic0MCS1 = new THnSparseF("fHistoFeedDownXic0MCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3718  fHistoFeedDownXic0MCS2 = new THnSparseF("fHistoFeedDownXic0MCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3720  fHistoFeedDownXicPlusMCS = new THnSparseF("fHistoFeedDownXicPlusMCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3722  fHistoFeedDownXicPlusMCS1 = new THnSparseF("fHistoFeedDownXicPlusMCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3724  fHistoFeedDownXicPlusMCS2 = new THnSparseF("fHistoFeedDownXicPlusMCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3726  fHistoFeedDownSigmaMCS = new THnSparseF("fHistoFeedDownSigmaMCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3728  fHistoFeedDownSigmaMCS1 = new THnSparseF("fHistoFeedDownSigmaMCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3730  fHistoFeedDownSigmaMCS2 = new THnSparseF("fHistoFeedDownSigmaMCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3732 
3733  Int_t bins_elemcgen[3]= {100 ,20 ,10};
3734  Double_t xmin_elemcgen[3]={0.,-1.0 ,0.0};
3735  Double_t xmax_elemcgen[3]={10.,1.0 ,100};
3736  fHistoElectronMCGen = new THnSparseF("fHistoElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3738  fHistoLcElectronMCGen = new THnSparseF("fHistoLcElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3740  fHistoLcElectronMCGen1 = new THnSparseF("fHistoLcElectronMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3742  fHistoLcElectronMCGen2 = new THnSparseF("fHistoLcElectronMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3744  fHistoElectronFeedDownXic0MCGen = new THnSparseF("fHistoElectronFeedDownXic0MCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3746  fHistoElectronFeedDownXic0MCGen1 = new THnSparseF("fHistoElectronFeedDownXic0MCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3748  fHistoElectronFeedDownXic0MCGen2 = new THnSparseF("fHistoElectronFeedDownXic0MCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3750  fHistoElectronFeedDownXicPlusMCGen = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3752  fHistoElectronFeedDownXicPlusMCGen1 = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3754  fHistoElectronFeedDownXicPlusMCGen2 = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3756  fHistoLcElectronMCS = new THnSparseF("fHistoLcElectronMCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3758  fHistoLcElectronMCS1 = new THnSparseF("fHistoLcElectronMCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3760  fHistoLcElectronMCS2 = new THnSparseF("fHistoLcElectronMCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3762  fHistoElectronFeedDownXic0MCS = new THnSparseF("fHistoElectronFeedDownXic0MCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3764  fHistoElectronFeedDownXic0MCS1 = new THnSparseF("fHistoElectronFeedDownXic0MCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3766  fHistoElectronFeedDownXic0MCS2 = new THnSparseF("fHistoElectronFeedDownXic0MCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3768  fHistoElectronFeedDownXicPlusMCS = new THnSparseF("fHistoElectronFeedDownXicPlusMCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3770  fHistoElectronFeedDownXicPlusMCS1 = new THnSparseF("fHistoElectronFeedDownXicPlusMCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3772  fHistoElectronFeedDownXicPlusMCS2 = new THnSparseF("fHistoElectronFeedDownXicPlusMCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3774 
3775  Int_t bins_lambdamcgen[3]= {50 ,20 ,10};
3776  Double_t xmin_lambdamcgen[3]={0.,-1.0 ,0.0};
3777  Double_t xmax_lambdamcgen[3]={10.,1.0 ,100};
3778  fHistoLambdaMCGen = new THnSparseF("fHistoLambdaMCGen","",3,bins_lambdamcgen,xmin_lambdamcgen,xmax_lambdamcgen);
3780 
3781  Int_t bins_eleptvsv0dl[3]= {100 ,20 ,10};
3782  Double_t xmin_eleptvsv0dl[3]={0.,0. ,0.0};
3783  Double_t xmax_eleptvsv0dl[3]={10.,40. ,100};
3784  fHistoElePtvsV0dlRS = new THnSparseF("fHistoElePtvsV0dlRS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3786  fHistoElePtvsV0dlRS1 = new THnSparseF("fHistoElePtvsV0dlRS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3788  fHistoElePtvsV0dlRS2 = new THnSparseF("fHistoElePtvsV0dlRS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3790  fHistoElePtvsV0dlRSSide = new THnSparseF("fHistoElePtvsV0dlRSSide","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3792  fHistoElePtvsV0dlRSSide1 = new THnSparseF("fHistoElePtvsV0dlRSSide1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3794  fHistoElePtvsV0dlRSSide2 = new THnSparseF("fHistoElePtvsV0dlRSSide2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3796  fHistoElePtvsV0dlRSMix = new THnSparseF("fHistoElePtvsV0dlRSMix","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3798  fHistoElePtvsV0dlRSMix1 = new THnSparseF("fHistoElePtvsV0dlRSMix1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3800  fHistoElePtvsV0dlRSMix2 = new THnSparseF("fHistoElePtvsV0dlRSMix2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3802  fHistoElePtvsV0dlWS = new THnSparseF("fHistoElePtvsV0dlWS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3804  fHistoElePtvsV0dlWS1 = new THnSparseF("fHistoElePtvsV0dlWS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3806  fHistoElePtvsV0dlWS2 = new THnSparseF("fHistoElePtvsV0dlWS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3808  fHistoElePtvsV0dlWSSide = new THnSparseF("fHistoElePtvsV0dlWSSide","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3810  fHistoElePtvsV0dlWSSide1 = new THnSparseF("fHistoElePtvsV0dlWSSide1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3812  fHistoElePtvsV0dlWSSide2 = new THnSparseF("fHistoElePtvsV0dlWSSide2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3814  fHistoElePtvsV0dlWSMix = new THnSparseF("fHistoElePtvsV0dlWSMix","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3816  fHistoElePtvsV0dlWSMix1 = new THnSparseF("fHistoElePtvsV0dlWSMix1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3818  fHistoElePtvsV0dlWSMix2 = new THnSparseF("fHistoElePtvsV0dlWSMix2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3820  fHistoElePtvsV0dlMCS = new THnSparseF("fHistoElePtvsV0dlMCS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3822  fHistoElePtvsV0dlMCS1 = new THnSparseF("fHistoElePtvsV0dlMCS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3824  fHistoElePtvsV0dlMCS2 = new THnSparseF("fHistoElePtvsV0dlMCS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3826  fHistoElePtvsV0dlFeedDownXic0MCS = new THnSparseF("fHistoElePtvsV0dlFeedDownXic0MCS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3828  fHistoElePtvsV0dlFeedDownXic0MCS1 = new THnSparseF("fHistoElePtvsV0dlFeedDownXic0MCS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3830  fHistoElePtvsV0dlFeedDownXic0MCS2 = new THnSparseF("fHistoElePtvsV0dlFeedDownXic0MCS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3832  fHistoElePtvsV0dlFeedDownXicPlusMCS = new THnSparseF("fHistoElePtvsV0dlFeedDownXicPlusMCS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3834  fHistoElePtvsV0dlFeedDownXicPlusMCS1 = new THnSparseF("fHistoElePtvsV0dlFeedDownXicPlusMCS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3836  fHistoElePtvsV0dlFeedDownXicPlusMCS2 = new THnSparseF("fHistoElePtvsV0dlFeedDownXicPlusMCS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3838 
3839  Int_t bins_eleptvsv0dca[3]= {100 ,20 ,10};
3840  Double_t xmin_eleptvsv0dca[3]={0.,0. ,0.0};
3841  Double_t xmax_eleptvsv0dca[3]={10.,1. ,100};
3842  fHistoElePtvsV0dcaRS = new THnSparseF("fHistoElePtvsV0dcaRS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3844  fHistoElePtvsV0dcaRS1 = new THnSparseF("fHistoElePtvsV0dcaRS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3846  fHistoElePtvsV0dcaRS2 = new THnSparseF("fHistoElePtvsV0dcaRS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3848  fHistoElePtvsV0dcaRSSide = new THnSparseF("fHistoElePtvsV0dcaRSSide","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3850  fHistoElePtvsV0dcaRSSide1 = new THnSparseF("fHistoElePtvsV0dcaRSSide1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3852  fHistoElePtvsV0dcaRSSide2 = new THnSparseF("fHistoElePtvsV0dcaRSSide2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3854  fHistoElePtvsV0dcaRSMix = new THnSparseF("fHistoElePtvsV0dcaRSMix","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3856  fHistoElePtvsV0dcaRSMix1 = new THnSparseF("fHistoElePtvsV0dcaRSMix1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3858  fHistoElePtvsV0dcaRSMix2 = new THnSparseF("fHistoElePtvsV0dcaRSMix2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3860  fHistoElePtvsV0dcaWS = new THnSparseF("fHistoElePtvsV0dcaWS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3862  fHistoElePtvsV0dcaWS1 = new THnSparseF("fHistoElePtvsV0dcaWS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3864  fHistoElePtvsV0dcaWS2 = new THnSparseF("fHistoElePtvsV0dcaWS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3866  fHistoElePtvsV0dcaWSSide = new THnSparseF("fHistoElePtvsV0dcaWSSide","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3868  fHistoElePtvsV0dcaWSSide1 = new THnSparseF("fHistoElePtvsV0dcaWSSide1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3870  fHistoElePtvsV0dcaWSSide2 = new THnSparseF("fHistoElePtvsV0dcaWSSide2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3872  fHistoElePtvsV0dcaWSMix = new THnSparseF("fHistoElePtvsV0dcaWSMix","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3874  fHistoElePtvsV0dcaWSMix1 = new THnSparseF("fHistoElePtvsV0dcaWSMix1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3876  fHistoElePtvsV0dcaWSMix2 = new THnSparseF("fHistoElePtvsV0dcaWSMix2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3878  fHistoElePtvsV0dcaMCS = new THnSparseF("fHistoElePtvsV0dcaMCS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3880  fHistoElePtvsV0dcaMCS1 = new THnSparseF("fHistoElePtvsV0dcaMCS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3882  fHistoElePtvsV0dcaMCS2 = new THnSparseF("fHistoElePtvsV0dcaMCS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3884  fHistoElePtvsV0dcaFeedDownXic0MCS = new THnSparseF("fHistoElePtvsV0dcaFeedDownXic0MCS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3886  fHistoElePtvsV0dcaFeedDownXic0MCS1 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXic0MCS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3888  fHistoElePtvsV0dcaFeedDownXic0MCS2 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXic0MCS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3890  fHistoElePtvsV0dcaFeedDownXicPlusMCS = new THnSparseF("fHistoElePtvsV0dcaFeedDownXicPlusMCS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3892  fHistoElePtvsV0dcaFeedDownXicPlusMCS1 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXicPlusMCS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3894  fHistoElePtvsV0dcaFeedDownXicPlusMCS2 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXicPlusMCS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3896 
3897  Int_t bins_elelamptvsv0dl[4]= {100 ,20 ,20, 10};
3898  Double_t xmin_elelamptvsv0dl[4]={0.,0. ,-0.1, 0.0};
3899  Double_t xmax_elelamptvsv0dl[4]={20.,40.,0.1 ,100};
3900  fHistoEleLambdaPtvsV0dlRS = new THnSparseF("fHistoEleLambdaPtvsV0dlRS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3902  fHistoEleLambdaPtvsV0dlRS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlRS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3904  fHistoEleLambdaPtvsV0dlRS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlRS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3906  fHistoEleLambdaPtvsV0dlRSSide = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3908  fHistoEleLambdaPtvsV0dlRSSide1 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3910  fHistoEleLambdaPtvsV0dlRSSide2 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3912  fHistoEleLambdaPtvsV0dlRSMix = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3914  fHistoEleLambdaPtvsV0dlRSMix1 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3916  fHistoEleLambdaPtvsV0dlRSMix2 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3918  fHistoEleLambdaPtvsV0dlWS = new THnSparseF("fHistoEleLambdaPtvsV0dlWS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3920  fHistoEleLambdaPtvsV0dlWS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlWS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3922  fHistoEleLambdaPtvsV0dlWS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlWS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3924  fHistoEleLambdaPtvsV0dlWSSide = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3926  fHistoEleLambdaPtvsV0dlWSSide1 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3928  fHistoEleLambdaPtvsV0dlWSSide2 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3930  fHistoEleLambdaPtvsV0dlWSMix = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3932  fHistoEleLambdaPtvsV0dlWSMix1 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3934  fHistoEleLambdaPtvsV0dlWSMix2 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3936  fHistoEleLambdaPtvsV0dlMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3938  fHistoEleLambdaPtvsV0dlMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3940  fHistoEleLambdaPtvsV0dlMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3942  fHistoEleLambdaPtvsV0dlPromptMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlPromptMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3944  fHistoEleLambdaPtvsV0dlPromptMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlPromptMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3946  fHistoEleLambdaPtvsV0dlPromptMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlPromptMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3948  fHistoEleLambdaPtvsV0dlBFeeddownMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlBFeeddownMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3950  fHistoEleLambdaPtvsV0dlBFeeddownMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlBFeeddownMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3952  fHistoEleLambdaPtvsV0dlBFeeddownMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlBFeeddownMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3954  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0MCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3956  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3958  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3960  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3962  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3964  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3966  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3968  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3970  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3972 
3973  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3975  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3977  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3979  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3981  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3983  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3985  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3987  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3989  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3991 
3992  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3994  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3996  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3998  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4000  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4002  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4004  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4006  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4008  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4010 
4011  fHistoEleLambdaPtvsV0dlRSAway = new THnSparseF("fHistoEleLambdaPtvsV0dlRSAway","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4013  fHistoEleLambdaPtvsV0dlRS1Away = new THnSparseF("fHistoEleLambdaPtvsV0dlRS1Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4015  fHistoEleLambdaPtvsV0dlRS2Away = new THnSparseF("fHistoEleLambdaPtvsV0dlRS2Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4017  fHistoEleLambdaPtvsV0dlRSSideAway = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSideAway","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4019  fHistoEleLambdaPtvsV0dlRSSide1Away = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide1Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4021  fHistoEleLambdaPtvsV0dlRSSide2Away = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide2Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4023  fHistoEleLambdaPtvsV0dlRSMixAway = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMixAway","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4025  fHistoEleLambdaPtvsV0dlRSMix1Away = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix1Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4027  fHistoEleLambdaPtvsV0dlRSMix2Away = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix2Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4029  fHistoEleLambdaPtvsV0dlWSAway = new THnSparseF("fHistoEleLambdaPtvsV0dlWSAway","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4031  fHistoEleLambdaPtvsV0dlWS1Away = new THnSparseF("fHistoEleLambdaPtvsV0dlWS1Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4033  fHistoEleLambdaPtvsV0dlWS2Away = new THnSparseF("fHistoEleLambdaPtvsV0dlWS2Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4035  fHistoEleLambdaPtvsV0dlWSSideAway = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSideAway","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4037  fHistoEleLambdaPtvsV0dlWSSide1Away = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide1Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4039  fHistoEleLambdaPtvsV0dlWSSide2Away = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide2Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4041  fHistoEleLambdaPtvsV0dlWSMixAway = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMixAway","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4043  fHistoEleLambdaPtvsV0dlWSMix1Away = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix1Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4045  fHistoEleLambdaPtvsV0dlWSMix2Away = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix2Away","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
4047 
4048  fHistoResponseElePt = new TH2D("fHistoResponseElePt","",100,0.,10.,100,0.,10.);
4050  fHistoResponseElePt1 = new TH2D("fHistoResponseElePt1","",100,0.,10.,100,0.,10.);
4052  fHistoResponseElePt2 = new TH2D("fHistoResponseElePt2","",100,0.,10.,100,0.,10.);
4054  fHistoResponseEleLambdaPt = new TH2D("fHistoResponseEleLambdaPt","",100,0.,20.,100,0.,20.);
4056  fHistoResponseEleLambdaPt1 = new TH2D("fHistoResponseEleLambdaPt1","",100,0.,20.,100,0.,20.);
4058  fHistoResponseEleLambdaPt2 = new TH2D("fHistoResponseEleLambdaPt2","",100,0.,20.,100,0.,20.);
4060  fHistoResponseEleLambdaPtFeeddownXic0 = new TH2D("fHistoResponseEleLambdaPtFeeddownXic0","",100,0.,20.,100,0.,20.);
4062  fHistoResponseEleLambdaPtFeeddownXic01 = new TH2D("fHistoResponseEleLambdaPtFeeddownXic01","",100,0.,20.,100,0.,20.);
4064  fHistoResponseEleLambdaPtFeeddownXic02 = new TH2D("fHistoResponseEleLambdaPtFeeddownXic02","",100,0.,20.,100,0.,20.);
4066  fHistoResponseEleLambdaPtFeeddownXicPlus = new TH2D("fHistoResponseEleLambdaPtFeeddownXicPlus","",100,0.,20.,100,0.,20.);
4068  fHistoResponseEleLambdaPtFeeddownXicPlus1 = new TH2D("fHistoResponseEleLambdaPtFeeddownXicPlus1","",100,0.,20.,100,0.,20.);
4070  fHistoResponseEleLambdaPtFeeddownXicPlus2 = new TH2D("fHistoResponseEleLambdaPtFeeddownXicPlus2","",100,0.,20.,100,0.,20.);
4072 
4073  fHistonEvtvsRunNumber=new TH1F("fHistonEvtvsRunNumber","",20000,-0.5,19999.5);
4075  fHistonElevsRunNumber=new TH1F("fHistonElevsRunNumber","",20000,-0.5,19999.5);
4077  fHistonLambdavsRunNumber=new TH1F("fHistonLambdavsRunNumber","",20000,-0.5,19999.5);
4079  fHistoMCEventType=new TH1F("fHistoMCEventType","",4,-0.5,3.5);
4081  fHistoMCDeltaPhiccbar=new TH1F("fHistoMCDeltaPhiccbar","",100,0.,3.2);
4083 
4084  for(Int_t ih=0;ih<17;ih++){
4085  Int_t bins_eleptvscutvars[3];
4086  Double_t xmin_eleptvscutvars[3];
4087  Double_t xmax_eleptvscutvars[3];
4088 
4089  bins_eleptvscutvars[0] = 20;//electron pT bin
4090  xmin_eleptvscutvars[0] = 0.;
4091  xmax_eleptvscutvars[0] = 20.;
4092  bins_eleptvscutvars[2] = 10;//centrality bin
4093  xmin_eleptvscutvars[2] = 0.;
4094  xmax_eleptvscutvars[2] = 100.;
4095 
4096  if(ih==0 || ih==1){
4097  //0: TPC Ncluster 1: TPC ncluster PID
4098  bins_eleptvscutvars[1] = 40;
4099  xmin_eleptvscutvars[1] = 0.;
4100  xmax_eleptvscutvars[1] = 160.;
4101  }else if(ih==2 || ih==3){
4102  //2: nSigma(TPC,e) 3: nSigma(TOF,e)
4103  bins_eleptvscutvars[1] = 20;
4104  xmin_eleptvscutvars[1] = -5.;
4105  xmax_eleptvscutvars[1] = 5.;
4106  }else if(ih==4){
4107  //4: eta
4108  bins_eleptvscutvars[1] = 30;
4109  xmin_eleptvscutvars[1] = -1.5;
4110  xmax_eleptvscutvars[1] = 1.5;
4111  }else if(ih==5){
4112  //5: nITS cluster
4113  bins_eleptvscutvars[1] = 7;
4114  xmin_eleptvscutvars[1] = -0.5;
4115  xmax_eleptvscutvars[1] = 6.5;
4116  }else if(ih==6){
4117  //6: Lambda mass
4118  bins_eleptvscutvars[1] = 50;
4119  xmin_eleptvscutvars[1] = 1.1156-0.03;
4120  xmax_eleptvscutvars[1] = 1.1156+0.03;
4121  }else if(ih==7){
4122  //7: Rfid Lambda
4123  bins_eleptvscutvars[1] = 20;
4124  xmin_eleptvscutvars[1] = 0.;
4125  xmax_eleptvscutvars[1] = 5.;
4126  }else if(ih==8){
4127  //10: Dca V0
4128  bins_eleptvscutvars[1] = 20;
4129  xmin_eleptvscutvars[1] = 0.;
4130  xmax_eleptvscutvars[1] = 2.;
4131  }else if(ih==9 || ih==10 ){
4132  //9: DCA V0pr to prim 10: DCA V0pi to prim
4133  bins_eleptvscutvars[1] = 20;
4134  xmin_eleptvscutvars[1] = 0.;
4135  xmax_eleptvscutvars[1] = 0.5;
4136  }else if(ih==11){
4137  //11: CosPAv0
4138  bins_eleptvscutvars[1] = 20;
4139  xmin_eleptvscutvars[1] = 0.95;
4140  xmax_eleptvscutvars[1] = 1.0;
4141  }else if(ih==12){
4142  //12:K0s masss
4143  bins_eleptvscutvars[1] = 50;
4144  xmin_eleptvscutvars[1] = 0.497-0.03;
4145  xmax_eleptvscutvars[1] = 0.497+0.03;
4146  }else if(ih==13 || ih==14){
4147  //13: nSigmaTPC(pr), nSigma(pi)
4148  bins_eleptvscutvars[1] = 20;
4149  xmin_eleptvscutvars[1] = -5;
4150  xmax_eleptvscutvars[1] = 5;
4151  }else if(ih==15){
4152  //15: eta
4153  bins_eleptvscutvars[1] = 30;
4154  xmin_eleptvscutvars[1] = -1.5;
4155  xmax_eleptvscutvars[1] = 1.5;
4156  }else if(ih==16){
4157  //16: Opening angle
4158  bins_eleptvscutvars[1] = 20;
4159  xmin_eleptvscutvars[1] = 0.;
4160  xmax_eleptvscutvars[1] = 3.141592/2;
4161  }
4162 
4163  fHistoElePtvsCutVarsRS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsRS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
4165  fHistoElePtvsCutVarsWS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsWS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
4167  fHistoElePtvsCutVarsMCS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsMCS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
4169  }
4170 
4171  return;
4172 }
4173 
4174 //________________________________________________________________________
4175 AliAODRecoCascadeHF* AliAnalysisTaskSELc2eleLambdafromAODtracks::MakeCascadeHF(AliAODv0 *v0, AliAODTrack *part, AliAODEvent * aod, AliAODVertex *secVert)
4176 {
4180 
4181  if(!v0) return 0x0;
4182  if(!part) return 0x0;
4183  if(!aod) return 0x0;
4184 
4185  //------------------------------------------------
4186  // PrimaryVertex
4187  //------------------------------------------------
4188  AliAODVertex *primVertexAOD;
4189  Bool_t unsetvtx = kFALSE;
4191  primVertexAOD = CallPrimaryVertex(v0,part,aod);
4192  if(!primVertexAOD){
4193  primVertexAOD = fVtx1;
4194  }else{
4195  unsetvtx = kTRUE;
4196  }
4197  }else{
4198  primVertexAOD = fVtx1;
4199  }
4200  if(!primVertexAOD) return 0x0;
4201  Double_t posprim[3]; primVertexAOD->GetXYZ(posprim);
4202 
4203  //------------------------------------------------
4204  // DCA between tracks
4205  //------------------------------------------------
4206  AliESDtrack *esdtrack = new AliESDtrack((AliVTrack*)part);
4207 
4208  AliNeutralTrackParam *trackV0=NULL;
4209  const AliVTrack *trackVV0 = dynamic_cast<const AliVTrack*>(v0);
4210  if(trackVV0) trackV0 = new AliNeutralTrackParam(trackVV0);
4211 
4212  Double_t xdummy, ydummy;
4213  Double_t dca = esdtrack->GetDCA(trackV0,fBzkG,xdummy,ydummy);
4214 
4215 
4216  //------------------------------------------------
4217  // Propagate all tracks to the secondary vertex and calculate momentum there
4218  //------------------------------------------------
4219 
4220  Double_t d0z0bach[2],covd0z0bach[3];
4221  if(sqrt(pow(secVert->GetX(),2)+pow(secVert->GetY(),2))<1.){
4222  part->PropagateToDCA(secVert,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
4223  trackV0->PropagateToDCA(secVert,fBzkG,kVeryBig);
4224  }else{
4225  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
4226  trackV0->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig);
4227  }
4228  Double_t momv0_new[3]={-9999,-9999,-9999.};
4229  trackV0->GetPxPyPz(momv0_new);
4230 
4231  Double_t px[2],py[2],pz[2];
4232  px[0] = part->Px(); py[0] = part->Py(); pz[0] = part->Pz();
4233  px[1] = momv0_new[0]; py[1] = momv0_new[1]; pz[1] = momv0_new[2];
4234 
4235  //------------------------------------------------
4236  // d0
4237  //------------------------------------------------
4238  Double_t d0[3],d0err[3];
4239 
4240  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
4241  d0[0]= d0z0bach[0];
4242  d0err[0] = TMath::Sqrt(covd0z0bach[0]);
4243 
4244  Double_t d0z0v0[2],covd0z0v0[3];
4245  trackV0->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0v0,covd0z0v0);
4246  d0[1]= d0z0v0[0];
4247  d0err[1] = TMath::Sqrt(covd0z0v0[0]);
4248 
4249  //------------------------------------------------
4250  // Create AliAODRecoCascadeHF
4251  //------------------------------------------------
4252  Short_t charge = part->Charge();
4253  AliAODRecoCascadeHF *theCascade = new AliAODRecoCascadeHF(secVert,charge,px,py,pz,d0,d0err,dca);
4254  if(!theCascade)
4255  {
4256  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
4257  if(esdtrack) delete esdtrack;
4258  if(trackV0) delete trackV0;
4259  return 0x0;
4260  }
4261  theCascade->SetOwnPrimaryVtx(primVertexAOD);
4262  UShort_t id[2]={(UShort_t)part->GetID(),(UShort_t)trackV0->GetID()};
4263  theCascade->SetProngIDs(2,id);
4264 
4265  theCascade->GetSecondaryVtx()->AddDaughter(part);
4266  theCascade->GetSecondaryVtx()->AddDaughter(v0);
4267 
4268  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
4269  if(esdtrack) delete esdtrack;
4270  if(trackV0) delete trackV0;
4271 
4272  return theCascade;
4273 }
4274 
4275 //________________________________________________________________________
4276 AliAODVertex* AliAnalysisTaskSELc2eleLambdafromAODtracks::CallPrimaryVertex(AliAODv0 *v0, AliAODTrack *trk, AliAODEvent* aod)
4277 {
4278  //
4281  //
4282 
4283  TObjArray *TrackArray = new TObjArray(3);
4284 
4285  AliESDtrack *cptrk1 = new AliESDtrack((AliVTrack*)trk);
4286  TrackArray->AddAt(cptrk1,0);
4287 
4288  AliESDtrack *cascptrack = new AliESDtrack((AliVTrack*)v0->GetDaughter(0));
4289  TrackArray->AddAt(cascptrack,1);
4290  AliESDtrack *cascntrack = new AliESDtrack((AliVTrack*)v0->GetDaughter(1));
4291  TrackArray->AddAt(cascntrack,2);
4292 
4293  AliAODVertex *newvert = PrimaryVertex(TrackArray,aod);
4294 
4295  for(Int_t i=0;i<3;i++)
4296  {
4297  AliESDtrack *tesd = (AliESDtrack*)TrackArray->UncheckedAt(i);
4298  delete tesd;
4299  }
4300  TrackArray->Clear();
4301  delete TrackArray;
4302 
4303  return newvert;
4304 }
4305 
4306 //________________________________________________________________________
4307 AliAODVertex* AliAnalysisTaskSELc2eleLambdafromAODtracks::PrimaryVertex(const TObjArray *trkArray,
4308  AliVEvent *event)
4309 {
4310  //
4313  //
4314 
4315  Bool_t fRecoPrimVtxSkippingTrks = kTRUE;
4316  Bool_t fRmTrksFromPrimVtx = kFALSE;
4317 
4318  AliESDVertex *vertexESD = 0;
4319  AliAODVertex *vertexAOD = 0;
4320 
4321  //vertexESD = new AliESDVertex(*fV1);
4322 
4323 
4324  if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) {
4325  // primary vertex from the input event
4326 
4327  vertexESD = new AliESDVertex(*fV1);
4328 
4329  } else {
4330  // primary vertex specific to this candidate
4331 
4332  Int_t nTrks = trkArray->GetEntriesFast();
4333  AliVertexerTracks *vertexer = new AliVertexerTracks(event->GetMagneticField());
4334 
4335  if(fRecoPrimVtxSkippingTrks) {
4336  // recalculating the vertex
4337 
4338  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraint")) {
4339  Float_t diamondcovxy[3];
4340  event->GetDiamondCovXY(diamondcovxy);
4341  Double_t pos[3]={event->GetDiamondX(),event->GetDiamondY(),0.};
4342  Double_t cov[6]={diamondcovxy[0],diamondcovxy[1],diamondcovxy[2],0.,0.,10.*10.};
4343  AliESDVertex *diamond = new AliESDVertex(pos,cov,1.,1);
4344  vertexer->SetVtxStart(diamond);
4345  delete diamond; diamond=NULL;
4346  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraintOnlyFitter"))
4347  vertexer->SetOnlyFitter();
4348  }
4349  Int_t skipped[1000];
4350  Int_t nTrksToSkip=0,id;
4351  AliExternalTrackParam *t = 0;
4352  for(Int_t i=0; i<nTrks; i++) {
4353  t = (AliExternalTrackParam*)trkArray->UncheckedAt(i);
4354  id = (Int_t)t->GetID();
4355  if(id<0) continue;
4356  skipped[nTrksToSkip++] = id;
4357  }
4358  // TEMPORARY FIX
4359  // For AOD, skip also tracks without covariance matrix
4360  Double_t covtest[21];
4361  for(Int_t j=0; j<event->GetNumberOfTracks(); j++) {
4362  AliVTrack *vtrack = (AliVTrack*)event->GetTrack(j);
4363  if(!vtrack->GetCovarianceXYZPxPyPz(covtest)) {
4364  id = (Int_t)vtrack->GetID();
4365  if(id<0) continue;
4366  skipped[nTrksToSkip++] = id;
4367  }
4368  }
4369  for(Int_t ijk=nTrksToSkip; ijk<1000; ijk++) skipped[ijk]=-1;
4370  //
4371  vertexer->SetSkipTracks(nTrksToSkip,skipped);
4372  vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(event);
4373 
4374  } else if(fRmTrksFromPrimVtx && nTrks>0) {
4375  // removing the prongs tracks
4376 
4377  TObjArray rmArray(nTrks);
4378  UShort_t *rmId = new UShort_t[nTrks];
4379  AliESDtrack *esdTrack = 0;
4380  AliESDtrack *t = 0;
4381  for(Int_t i=0; i<nTrks; i++) {
4382  t = (AliESDtrack*)trkArray->UncheckedAt(i);
4383  esdTrack = new AliESDtrack(*t);
4384  rmArray.AddLast(esdTrack);
4385  if(esdTrack->GetID()>=0) {
4386  rmId[i]=(UShort_t)esdTrack->GetID();
4387  } else {
4388  rmId[i]=9999;
4389  }
4390  }
4391  Float_t diamondxy[2]={static_cast<Float_t>(event->GetDiamondX()),static_cast<Float_t>(event->GetDiamondY())};
4392  vertexESD = vertexer->RemoveTracksFromVertex(fV1,&rmArray,rmId,diamondxy);
4393  delete [] rmId; rmId=NULL;
4394  rmArray.Delete();
4395 
4396  }
4397 
4398  delete vertexer; vertexer=NULL;
4399  if(!vertexESD) return vertexAOD;
4400  if(vertexESD->GetNContributors()<=0) {
4401  //AliDebug(2,"vertexing failed");
4402  delete vertexESD; vertexESD=NULL;
4403  return vertexAOD;
4404  }
4405 
4406 
4407  }
4408 
4409  // convert to AliAODVertex
4410  Double_t pos[3],cov[6],chi2perNDF;
4411  vertexESD->GetXYZ(pos); // position
4412  vertexESD->GetCovMatrix(cov); //covariance matrix
4413  chi2perNDF = vertexESD->GetChi2toNDF();
4414  delete vertexESD; vertexESD=NULL;
4415 
4416  vertexAOD = new AliAODVertex(pos,cov,chi2perNDF);
4417 
4418  return vertexAOD;
4419 }
4420 
4421 //________________________________________________________________________
4422 AliAODVertex* AliAnalysisTaskSELc2eleLambdafromAODtracks::ReconstructSecondaryVertex(AliAODv0 *v0, AliAODTrack *part, AliAODEvent * aod)
4423 {
4424  //
4425  // Reconstruct secondary vertex from trkArray (Copied from AliAnalysisVertexingHF)
4426  // Currently only returns Primary vertex (can we reconstruct secondary vertex from e - v0??)
4427  //
4428 
4429  AliAODVertex *primVertexAOD;
4430  Bool_t unsetvtx = kFALSE;
4432  primVertexAOD = CallPrimaryVertex(v0,part,aod);
4433  if(!primVertexAOD){
4434  primVertexAOD = fVtx1;
4435  }else{
4436  unsetvtx = kTRUE;
4437  }
4438  }else{
4439  primVertexAOD = fVtx1;
4440  }
4441  if(!primVertexAOD) return 0x0;
4442 
4443  AliESDVertex * vertexESD = new AliESDVertex(*fV1);
4444 
4445  Double_t pos[3],cov[6],chi2perNDF;
4446  vertexESD->GetXYZ(pos); // position
4447  vertexESD->GetCovMatrix(cov); //covariance matrix
4448  chi2perNDF = vertexESD->GetChi2toNDF();
4449  delete vertexESD; vertexESD=NULL;
4450 
4451  AliAODVertex *secVert = new AliAODVertex(pos,cov,chi2perNDF);
4452 
4453  return secVert;
4454 }
4455 //________________________________________________________________________
4456 Int_t AliAnalysisTaskSELc2eleLambdafromAODtracks::MatchToMC(AliAODRecoCascadeHF *elobj, TClonesArray *mcArray, Int_t *pdgarray_ele, Int_t *pdgarray_v0, Int_t *labelarray_ele, Int_t *labelarray_v0, Int_t &ngen_ele, Int_t &ngen_v0)
4457 {
4458  //
4459  // Match to MC
4460  //
4461  for(Int_t i=0;i<100;i++){
4462  pdgarray_ele[i] = -9999;
4463  labelarray_ele[i] = -9999;
4464  pdgarray_v0[i] = -9999;
4465  labelarray_v0[i] = -9999;
4466  }
4467  ngen_ele = 0;
4468  ngen_v0 = 0;
4469 
4470  AliVTrack *trk = dynamic_cast<AliVTrack*>(elobj->GetBachelor());
4471  if(!trk) return -1;
4472  Int_t labEle = trk->GetLabel();
4473  if(labEle<0) return -1;
4474  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
4475  if(!mcetrk) return -1;
4476  labelarray_ele[0] = labEle;
4477  pdgarray_ele[0] = mcetrk->GetPdgCode();
4478  ngen_ele ++;
4479 
4480  AliAODMCParticle *mcprimele=0;
4481  mcprimele = mcetrk;
4482  while(mcprimele->GetMother()>=0) {
4483  Int_t labprim_ele=mcprimele->GetMother();
4484  AliAODMCParticle *tmcprimele = (AliAODMCParticle*)mcArray->At(labprim_ele);
4485  if(!tmcprimele) {
4486  break;
4487  }
4488 
4489  mcprimele = tmcprimele;
4490  pdgarray_ele[ngen_ele] = mcprimele->GetPdgCode();
4491  labelarray_ele[ngen_ele] = labprim_ele;
4492  ngen_ele ++;
4493  if(ngen_ele==100) break;
4494  }
4495 
4496  AliAODv0 *theV0 = dynamic_cast<AliAODv0*>(elobj->Getv0());
4497  if(!theV0) return -1;
4498  Int_t pdgdgv0[2]={2212,211};
4499  Int_t labV0 = theV0->MatchToMC(3122,mcArray,2,pdgdgv0); // the V0
4500  if(labV0<0) return -1;
4501  AliAODMCParticle *mcv0 = (AliAODMCParticle*)mcArray->At(labV0);
4502  if(!mcv0) return -1;
4503  labelarray_v0[0] = labV0;
4504  pdgarray_v0[0] = mcv0->GetPdgCode();
4505  ngen_v0 ++;
4506 
4507  AliAODMCParticle *mcprimv0=0;
4508  mcprimv0 = mcv0;
4509  while(mcprimv0->GetMother()>=0) {
4510  Int_t labprim_v0=mcprimv0->GetMother();
4511  AliAODMCParticle *tmcprimv0 = (AliAODMCParticle*)mcArray->At(labprim_v0);
4512  if(!tmcprimv0) {
4513  break;
4514  }
4515 
4516  mcprimv0 = tmcprimv0;
4517  pdgarray_v0[ngen_v0] = mcprimv0->GetPdgCode();
4518  labelarray_v0[ngen_v0] = labprim_v0;
4519  ngen_v0 ++;
4520  if(ngen_v0==100) break;
4521  }
4522 
4523  Bool_t same_flag = kFALSE;
4524  Int_t matchedlabel=-9999;
4525  for(Int_t iemc=0;iemc<ngen_ele;iemc++){
4526  for(Int_t ivmc=0;ivmc<ngen_v0;ivmc++){
4527  if(labelarray_ele[iemc]==labelarray_v0[ivmc]){
4528  same_flag = kTRUE;
4529  matchedlabel = labelarray_ele[iemc];
4530  break;
4531  }
4532  }
4533  if(same_flag) break;
4534  }
4535 
4536  return matchedlabel;
4537 
4538 }
4539 //________________________________________________________________________
4540 void AliAnalysisTaskSELc2eleLambdafromAODtracks::SelectTrack( const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks,Bool_t *seleFlags, TClonesArray *mcArray)
4541 {
4542  //
4543  // Select good tracks using fAnalCuts (AliRDHFCuts object) and return the array of their ids
4544  //
4545 
4546  if(trkEntries==0) return;
4547 
4548  nSeleTrks=0;
4549  for(Int_t i=0; i<trkEntries; i++) {
4550  seleFlags[i] = kFALSE;
4551 
4552  AliVTrack *track;
4553  track = (AliVTrack*)event->GetTrack(i);
4554 
4555  if(track->GetID()<0) continue;
4556  Double_t covtest[21];
4557  if(!track->GetCovarianceXYZPxPyPz(covtest)) continue;
4558 
4559  AliAODTrack *aodt = (AliAODTrack*)track;
4560  Double_t nsigma_tpcele = -9999;
4561  Double_t nsigma_tofele = -9999;
4562  if(fAnalCuts->GetIsUsePID()){
4563  nsigma_tpcele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(aodt,AliPID::kElectron);
4564  nsigma_tofele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(aodt,AliPID::kElectron);
4565  }
4566 
4567  if(!fAnalCuts) continue;
4568  if(fAnalCuts->SingleTrkCutsNoPID(aodt,fVtx1)){
4569  fHistoElectronTPCPID->Fill(aodt->Pt(),nsigma_tpcele);
4570  fHistoElectronTOFPID->Fill(aodt->Pt(),nsigma_tofele);
4571  if(fabs(nsigma_tofele)<3.){
4572  fHistoElectronTPCPIDSelTOF->Fill(aodt->Pt(),nsigma_tpcele);
4573  Double_t eleeta = aodt->Eta();
4574  if(fabs(eleeta)<0.6)
4575  fHistoElectronTPCPIDSelTOFSmallEta->Fill(aodt->Pt(),nsigma_tpcele);
4576  if(fabs(eleeta)>0.6 && fabs(eleeta)<0.8)
4577  fHistoElectronTPCPIDSelTOFLargeEta->Fill(aodt->Pt(),nsigma_tpcele);
4578  if(eleeta>-0.8 && eleeta<-0.6){
4579  fHistoElectronTPCPIDSelTOFEtaDep[0]->Fill(aodt->Pt(),nsigma_tpcele);
4580  }else if(eleeta>-0.6&&eleeta<-0.4){
4581  fHistoElectronTPCPIDSelTOFEtaDep[1]->Fill(aodt->Pt(),nsigma_tpcele);
4582  }else if(eleeta>-0.4&&eleeta<-0.2){
4583  fHistoElectronTPCPIDSelTOFEtaDep[2]->Fill(aodt->Pt(),nsigma_tpcele);
4584  }else if(eleeta>-0.2&&eleeta<0.0){
4585  fHistoElectronTPCPIDSelTOFEtaDep[3]->Fill(aodt->Pt(),nsigma_tpcele);
4586  }else if(eleeta>0.0&&eleeta<0.2){
4587  fHistoElectronTPCPIDSelTOFEtaDep[4]->Fill(aodt->Pt(),nsigma_tpcele);
4588  }else if(eleeta>0.2&&eleeta<0.4){
4589  fHistoElectronTPCPIDSelTOFEtaDep[5]->Fill(aodt->Pt(),nsigma_tpcele);
4590  }else if(eleeta>0.4&&eleeta<0.6){
4591  fHistoElectronTPCPIDSelTOFEtaDep[6]->Fill(aodt->Pt(),nsigma_tpcele);
4592  }else if(eleeta>0.6&&eleeta<0.8){
4593  fHistoElectronTPCPIDSelTOFEtaDep[7]->Fill(aodt->Pt(),nsigma_tpcele);
4594  }
4595  }
4596  }
4597  if(fAnalCuts->SingleTrkCuts(aodt,fVtx1)){
4598  seleFlags[i]=kTRUE;
4599  nSeleTrks++;
4600  fHistoElectronTPCSelPID->Fill(aodt->Pt(),nsigma_tpcele);
4601  fHistoElectronTOFSelPID->Fill(aodt->Pt(),nsigma_tofele);
4602  FillElectronROOTObjects(aodt,mcArray);
4603 
4604  Double_t minmass;
4605  Bool_t isconv = fAnalCuts->TagConversions(aodt,(AliAODEvent*)event,trkEntries,minmass);
4606  fHistoMassConversionsMin->Fill(minmass);
4607  if(isconv) seleFlags[i] = kFALSE;
4608 
4609 // Double_t minmasslike;
4610 // fAnalCuts->TagConversionsSameSign(aodt,(AliAODEvent*)event,trkEntries,minmasslike);
4611 // fHistoMassConversionsSameSignMin->Fill(minmasslike);
4612 
4613  }
4614  } // end loop on tracks
4615 }
4616 //________________________________________________________________________
4617 void AliAnalysisTaskSELc2eleLambdafromAODtracks::SelectV0( const AliVEvent *event,Int_t nV0s,Int_t &nSeleV0, Bool_t *seleV0Flags, TClonesArray *mcArray)
4618 {
4619  //
4620  // Select good V0 using fAnalCuts (AliRDHFCuts object) and return the array of their ids
4621  //
4622 
4623  nSeleV0 = 0;
4624  for(Int_t iv0=0;iv0<nV0s;iv0++)
4625  {
4626  seleV0Flags[iv0] = kFALSE;
4627  AliAODv0 *v0 = ((AliAODEvent*)event)->GetV0(iv0);
4628 
4629  if(!fAnalCuts) continue;
4630  if(fAnalCuts->SingleV0Cuts(v0,fVtx1)){
4631  seleV0Flags[iv0] = kTRUE;
4632  nSeleV0++;
4633 
4634  FillV0ROOTObjects(v0, mcArray);
4635  }
4636  }
4637 }
4638 //_________________________________________________________________
4640  //
4641  // check in which of the pools the current event falls
4642  //
4643 
4644  Int_t theBinZ=TMath::BinarySearch(fNzVtxBins,fZvtxBins,zvert);
4645  if(theBinZ<0 || theBinZ>=fNzVtxBins) return -1;
4646  Int_t theBinM=TMath::BinarySearch(fNCentBins,fCentBins,mult);
4647  if(theBinM<0 || theBinM>=fNCentBins) return -1;
4648  return fNCentBins*theBinZ+theBinM;
4649 }
4650 //_________________________________________________________________
4652  //
4653  // delete the contets of the pool
4654  //
4655  if(poolIndex<0 || poolIndex>=fNOfPools) return;
4656  delete fEventBuffer[poolIndex];
4657  fEventBuffer[poolIndex]=new TTree(Form("EventBuffer_%d",poolIndex), "Temporary buffer for event mixing");
4658 
4659  fEventBuffer[poolIndex]->Branch("zVertex", &fVtxZ);
4660  fEventBuffer[poolIndex]->Branch("centrality", &fCentrality);
4661  fEventBuffer[poolIndex]->Branch("eventInfo", "TObjString",&fEventInfo);
4662  fEventBuffer[poolIndex]->Branch("v1array", "TObjArray", &fV0Tracks1);
4663  fEventBuffer[poolIndex]->Branch("v2array", "TObjArray", &fV0Tracks2);
4664  fEventBuffer[poolIndex]->Branch("vdl1array", &fV0dlArray1);
4665  fEventBuffer[poolIndex]->Branch("vdl2array", &fV0dlArray2);
4666  fEventBuffer[poolIndex]->Branch("vdca1array", &fV0dcaArray1);
4667  fEventBuffer[poolIndex]->Branch("vdca2array", &fV0dcaArray2);
4668 
4669  return;
4670 }
4671 //_________________________________________________________________
4673 {
4674  //
4675  // perform mixed event analysis
4676  //
4677 
4678  if(poolIndex<0 || poolIndex>fNzVtxBins*fNCentBins) return;
4679  if(fEventBuffer[poolIndex]->GetEntries()<fNumberOfEventsForMixing) return;
4680 
4681  Int_t nEle = fElectronTracks->GetEntries();
4682  Int_t nEvents=fEventBuffer[poolIndex]->GetEntries();
4683 
4684  TObjArray* v1array=0x0;
4685  TObjArray* v2array=0x0;
4686  std::vector<Double_t>* vdl1array=0x0;
4687  std::vector<Double_t>* vdl2array=0x0;
4688  std::vector<Double_t>* vdca1array=0x0;
4689  std::vector<Double_t>* vdca2array=0x0;
4690  Float_t zVertex,cent;
4691  TObjString* eventInfo=0x0;
4692  fEventBuffer[poolIndex]->SetBranchAddress("eventInfo",&eventInfo);
4693  fEventBuffer[poolIndex]->SetBranchAddress("zVertex", &zVertex);
4694  fEventBuffer[poolIndex]->SetBranchAddress("centrality", &cent);
4695  fEventBuffer[poolIndex]->SetBranchAddress("v1array", &v1array);
4696  fEventBuffer[poolIndex]->SetBranchAddress("v2array", &v2array);
4697  fEventBuffer[poolIndex]->SetBranchAddress("vdl1array", &vdl1array);
4698  fEventBuffer[poolIndex]->SetBranchAddress("vdl2array", &vdl2array);
4699  fEventBuffer[poolIndex]->SetBranchAddress("vdca1array", &vdca1array);
4700  fEventBuffer[poolIndex]->SetBranchAddress("vdca2array", &vdca2array);
4701  for (Int_t i=0; i<nEle; i++)
4702  {
4703  TLorentzVector* trke=(TLorentzVector*) fElectronTracks->At(i);
4704  if(!trke)continue;
4705 
4706  for(Int_t iEv=0; iEv<fNumberOfEventsForMixing; iEv++){
4707  fEventBuffer[poolIndex]->GetEvent(iEv + nEvents - fNumberOfEventsForMixing);
4708 
4709  //TObjArray* v1array1=(TObjArray*)v1array->Clone();
4710  Int_t nV01=v1array->GetEntries();
4711  Int_t nV01_test=vdl1array->size();
4712  if(nV01 != nV01_test){
4713  cout<<"Something is wrong"<<endl;
4714  exit(1);
4715  }
4716  for(Int_t iTr1=0; iTr1<nV01; iTr1++){
4717  TLorentzVector* v01=(TLorentzVector*)v1array->At(iTr1);
4718  if(!v01 ) continue;
4719  Double_t v0info1[2];
4720  v0info1[0] = vdl1array->at(iTr1);
4721  v0info1[1] = vdca1array->at(iTr1);
4722  FillMixROOTObjects(trke,v01,v0info1,1);
4723  }//v0 loop
4724 
4725  //TObjArray* v2array1=(TObjArray*)v2array->Clone();
4726  Int_t nV02=v2array->GetEntries();
4727  Int_t nV02_test=vdl2array->size();
4728  if(nV02 != nV02_test){
4729  cout<<"Something is wrong"<<endl;
4730  exit(1);
4731  }
4732  for(Int_t iTr2=0; iTr2<nV02; iTr2++){
4733  TLorentzVector* v02=(TLorentzVector*)v2array->At(iTr2);
4734  if(!v02 ) continue;
4735  Double_t v0info2[2];
4736  v0info2[0] = vdl2array->at(iTr2);
4737  v0info2[1] = vdca2array->at(iTr2);
4738  FillMixROOTObjects(trke,v02,v0info2,-1);
4739  }//v0 loop
4740 
4741  //delete v1array1;
4742  //delete v2array1;
4743  }//event loop
4744 
4745  }//track loop
4746 }
4747 //_________________________________________________________________
4749 {
4750  //
4751  // Analyze AliAODmcparticle
4752  //
4753 
4754  Int_t nmcpart = mcArray->GetEntriesFast();
4755 
4756  Int_t mcevttype = 0;
4757  Bool_t sigmaevent = kFALSE;
4758  if(fMCEventType==1 || fMCEventType==2 || fMCEventType==11 || fMCEventType==12){
4759  //1: c quark event
4760  //2: b quark event
4761  //11: near side c-cbar event
4762  //12: away side c-cbar event
4763  Int_t ncquark = 0;
4764  Int_t ncbarquark = 0;
4765  Double_t phi_c = -9999.;
4766  Double_t phi_cbar = -9999.;
4767  for(Int_t i=0;i<nmcpart;i++)
4768  {
4769  AliAODMCParticle *mcpart = (AliAODMCParticle*) mcArray->At(i);
4770  if(TMath::Abs(mcpart->GetPdgCode())==4){
4771  if(fabs(mcpart->Y())<1.5){
4772  if(mcpart->GetPdgCode()==4){
4773  phi_c = mcpart->Phi();
4774  ncquark++;
4775  }
4776  if(mcpart->GetPdgCode()==-4){
4777  phi_cbar = mcpart->Phi();
4778  ncbarquark++;
4779  }
4780  if(mcevttype==0){
4781  mcevttype = 1;
4782  }else if(mcevttype==1){
4783  mcevttype = 1;
4784  }else if(mcevttype==2){
4785  mcevttype = 3;
4786  }else if(mcevttype==3){
4787  mcevttype = 3;
4788  }
4789  }
4790  }
4791  if(TMath::Abs(mcpart->GetPdgCode())==5){
4792  if(fabs(mcpart->Y())<1.5){
4793  if(mcevttype==0){
4794  mcevttype = 2;
4795  }else if(mcevttype==1){
4796  mcevttype = 3;
4797  }else if(mcevttype==2){
4798  mcevttype = 2;
4799  }else if(mcevttype==3){
4800  mcevttype = 3;
4801  }
4802  }
4803  }
4804  }
4805 
4806  if(fMCEventType==1||fMCEventType==11||fMCEventType==12){
4807  if((mcevttype==2)||(mcevttype==0)||(mcevttype==3)) return kFALSE;
4808  }else if(fMCEventType==2){
4809  if((mcevttype==1)||(mcevttype==0)||(mcevttype==3)) return kFALSE;
4810  }
4811 
4812  if(fMCEventType>10){
4813  if(ncquark!=1) return kFALSE;
4814  if(ncbarquark!=1) return kFALSE;
4815  Double_t dphi = fabs(phi_c - phi_cbar);
4816  if(dphi>2*M_PI) dphi -= 2*M_PI;
4817  if(dphi>M_PI) dphi = 2*M_PI-dphi;
4818  if(fMCEventType==11 && dphi>M_PI/3.) return kFALSE;
4819  if(fMCEventType==12 && dphi<2*M_PI/3.) return kFALSE;
4820  fHistoMCDeltaPhiccbar->Fill(dphi);
4821  }
4822 
4823  fHistoMCEventType->Fill(mcevttype);
4824  }
4825 
4826  for(Int_t i=0;i<nmcpart;i++)
4827  {
4828  AliAODMCParticle *mcpart = (AliAODMCParticle*) mcArray->At(i);
4829  if(TMath::Abs(mcpart->GetPdgCode())==4122){
4830  //cout<<"Lambdac"<<endl;
4831  Bool_t e_flag = kFALSE;
4832  Bool_t lam_flag = kFALSE;
4833  Bool_t sigma_flag = kFALSE;
4834  AliAODMCParticle *mcepart = 0;
4835  AliAODMCParticle *mcv0part = 0;
4836  for(Int_t idau=mcpart->GetFirstDaughter();idau<mcpart->GetLastDaughter()+1;idau++)
4837  {
4838  if(idau<0) break;
4839  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
4840  if(!mcdau) continue;
4841  if(TMath::Abs(mcdau->GetPdgCode())==11){
4842  e_flag = kTRUE;
4843  mcepart = mcdau;
4844  }
4845  if(TMath::Abs(mcdau->GetPdgCode())==3122){
4846  lam_flag = kTRUE;
4847  mcv0part = mcdau;
4848  }
4849  if(TMath::Abs(mcdau->GetPdgCode())==3212){
4850  sigma_flag = kTRUE;
4851  mcv0part = mcdau;
4852  }
4853  if(TMath::Abs(mcdau->GetPdgCode())==3214){
4854  sigma_flag = kTRUE;
4855  mcv0part = mcdau;
4856  }
4857  if(TMath::Abs(mcdau->GetPdgCode())==3224){
4858  sigma_flag = kTRUE;
4859  mcv0part = mcdau;
4860  }
4861  }
4862 
4863  Int_t decaytype = -9999;
4864  if(e_flag && lam_flag) decaytype = 0;
4865  if(e_flag && sigma_flag) decaytype = 3;
4866 
4867  FillMCROOTObjects(mcpart,mcepart,mcv0part,decaytype);
4868  }
4869  if(TMath::Abs(mcpart->GetPdgCode())==4132){
4870  //cout<<"Lambdac"<<endl;
4871  Bool_t e_flag = kFALSE;
4872  Bool_t xi_flag = kFALSE;
4873  Bool_t lam_flag = kFALSE;
4874  AliAODMCParticle *mcepart = 0;
4875  AliAODMCParticle *mccascpart = 0;
4876  AliAODMCParticle *mcv0part = 0;
4877  for(Int_t idau=mcpart->GetFirstDaughter();idau<mcpart->GetLastDaughter()+1;idau++)
4878  {
4879  if(idau<0) break;
4880  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
4881  if(!mcdau) continue;
4882  if(TMath::Abs(mcdau->GetPdgCode())==11){
4883  e_flag = kTRUE;
4884  mcepart = mcdau;
4885  }
4886  if(TMath::Abs(mcdau->GetPdgCode())==3312){
4887  xi_flag = kTRUE;
4888  mccascpart = mcdau;
4889  for(Int_t idauxi=mccascpart->GetFirstDaughter();idauxi<mccascpart->GetLastDaughter()+1;idauxi++)
4890  {
4891  if(idauxi<0) break;
4892  AliAODMCParticle *mcdauxi = (AliAODMCParticle*) mcArray->At(idauxi);
4893  if(!mcdauxi) continue;
4894  if(TMath::Abs(mcdauxi->GetPdgCode())==3122){
4895  lam_flag = kTRUE;
4896  mcv0part = mcdauxi;
4897  }
4898  }
4899  }
4900  }
4901  Int_t decaytype = -9999;
4902  if(e_flag && xi_flag && lam_flag) decaytype = 1;
4903 
4904  FillMCROOTObjects(mcpart,mcepart,mcv0part,decaytype);
4905  }
4906  if(TMath::Abs(mcpart->GetPdgCode())==4232){
4907  //cout<<"Lambdac"<<endl;
4908  Bool_t e_flag = kFALSE;
4909  Bool_t xi_flag = kFALSE;
4910  Bool_t lam_flag = kFALSE;
4911  AliAODMCParticle *mcepart = 0;
4912  AliAODMCParticle *mccascpart = 0;
4913  AliAODMCParticle *mcv0part = 0;
4914  for(Int_t idau=mcpart->GetFirstDaughter();idau<mcpart->GetLastDaughter()+1;idau++)
4915  {
4916  if(idau<0) break;
4917  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
4918  if(!mcdau) continue;
4919  if(TMath::Abs(mcdau->GetPdgCode())==11){
4920  e_flag = kTRUE;
4921  mcepart = mcdau;
4922  }
4923  if(TMath::Abs(mcdau->GetPdgCode())==3322){
4924  xi_flag = kTRUE;
4925  mccascpart = mcdau;
4926  for(Int_t idauxi=mccascpart->GetFirstDaughter();idauxi<mccascpart->GetLastDaughter()+1;idauxi++)
4927  {
4928  if(idauxi<0) break;
4929  AliAODMCParticle *mcdauxi = (AliAODMCParticle*) mcArray->At(idauxi);
4930  if(!mcdauxi) continue;
4931  if(TMath::Abs(mcdauxi->GetPdgCode())==3122){
4932  lam_flag = kTRUE;
4933  mcv0part = mcdauxi;
4934  }
4935  }
4936  }
4937  }
4938  Int_t decaytype = -9999;
4939  if(e_flag && xi_flag && lam_flag) decaytype = 2;
4940 
4941  FillMCROOTObjects(mcpart,mcepart,mcv0part,decaytype);
4942  }
4943 
4944  if(TMath::Abs(mcpart->GetPdgCode())==11 && mcpart->GetStatus()==1){
4945  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
4946  Float_t etamin, etamax;
4947  esdcuts->GetEtaRange(etamin,etamax);
4948  if(fabs(mcpart->Eta())<etamax){
4949  Bool_t gamma_flag = kFALSE;
4950  Int_t labmother = mcpart->GetMother();
4951  if(labmother>=0){
4952  AliAODMCParticle *mcmother = (AliAODMCParticle*) mcArray->At(labmother);
4953  Int_t pdgmother = mcmother->GetPdgCode();
4954  if(TMath::Abs(pdgmother)==22) gamma_flag = kTRUE;
4955  }
4956  if(!gamma_flag) fHistoBachPtMCGen->Fill(mcpart->Pt());
4957  }
4958  FillMCEleROOTObjects(mcpart, mcArray);
4959  }
4960  if(TMath::Abs(mcpart->GetPdgCode())==3122){
4961  Double_t etamin, etamax, rapmin, rapmax;
4962  fAnalCuts->GetProdV0EtaRange(etamin,etamax);
4963  fAnalCuts->GetProdV0RapRange(rapmin,rapmax);
4964 
4965  if((fabs(mcpart->Y())<rapmax) && (fabs(mcpart->Eta())<etamax)){
4966  fHistoLambdaMassvsPtMCGen->Fill(1.115683, mcpart->Pt());
4967  }
4968  FillMCV0ROOTObjects(mcpart, mcArray);
4969  }
4970  }
4971 
4972  if(fMCDoPairAnalysis)
4973  {
4974  for(Int_t i=0;i<nmcpart;i++)
4975  {
4976  AliAODMCParticle *mcparte = (AliAODMCParticle*) mcArray->At(i);
4977  if(!mcparte) continue;
4978  if(TMath::Abs(mcparte->GetPdgCode())!=11) continue;
4979  if(mcparte->GetStatus()!=1) continue;
4980  if(mcparte->Pt()<0.4) continue;//Apply rough cuts
4981  if(fabs(mcparte->Eta())>0.8) continue;//Apply rough cuts
4982  for(Int_t j=0;j<nmcpart;j++)
4983  {
4984  AliAODMCParticle *mcpartv = (AliAODMCParticle*) mcArray->At(j);
4985  if(!mcpartv) continue;
4986  if(TMath::Abs(mcpartv->GetPdgCode())!=3122) continue;
4987  if(mcpartv->Pt()<0.4) continue;//Apply rough cuts
4988  if(fabs(mcpartv->Eta())>0.8) continue;//Apply rough cuts
4989  if(mcpartv->GetNDaughters()!=2) continue;
4990 
4991  FillMCGenPairROOTObjects(mcparte,mcpartv,mcArray);
4992  }
4993  }
4994  return kFALSE;
4995  }
4996 
4997  return kTRUE;
4998 }
4999 
5002 {
5003  //
5004  // Define mc pair tree variables
5005  //
5006 
5007  const char* nameoutput = GetOutputSlot(11)->GetContainer()->GetName();
5008  fMCGenPairVariablesTree = new TTree(nameoutput,"MC pair variables tree");
5009  Int_t nVar = 38;
5010  fCandidateMCGenPairVariables = new Float_t [nVar];
5011  TString * fCandidateVariableNames = new TString[nVar];
5012 
5013  fCandidateVariableNames[ 0] = "InvMassEleLambda";
5014  fCandidateVariableNames[ 1] = "EleLambdaPx";
5015  fCandidateVariableNames[ 2] = "EleLambdaPy";
5016  fCandidateVariableNames[ 3] = "EleLambdaPz";
5017  fCandidateVariableNames[ 4] = "ElePdgCode";
5018  fCandidateVariableNames[ 5] = "ElePx";
5019  fCandidateVariableNames[ 6] = "ElePy";
5020  fCandidateVariableNames[ 7] = "ElePz";
5021  fCandidateVariableNames[ 8] = "LambdaPdgCode";
5022  fCandidateVariableNames[ 9] = "LambdaPx";
5023  fCandidateVariableNames[10] = "LambdaPy";
5024  fCandidateVariableNames[11] = "LambdaPz";
5025  fCandidateVariableNames[12] = "SameFlag";
5026  fCandidateVariableNames[13] = "EleNGeneration";
5027  fCandidateVariableNames[14] = "EleGen1PDG";
5028  fCandidateVariableNames[15] = "EleGen2PDG";
5029  fCandidateVariableNames[16] = "EleGen3PDG";
5030  fCandidateVariableNames[17] = "EleGen4PDG";
5031  fCandidateVariableNames[18] = "EleGen5PDG";
5032  fCandidateVariableNames[19] = "EleGen6PDG";
5033  fCandidateVariableNames[20] = "EleGen7PDG";
5034  fCandidateVariableNames[21] = "EleGen8PDG";
5035  fCandidateVariableNames[22] = "EleGen9PDG";
5036  fCandidateVariableNames[23] = "EleGen10PDG";
5037  fCandidateVariableNames[24] = "ElePrimPDG";
5038  fCandidateVariableNames[25] = "LamNGeneration";
5039  fCandidateVariableNames[26] = "LambdaGen1PDG";
5040  fCandidateVariableNames[27] = "LambdaGen2PDG";
5041  fCandidateVariableNames[28] = "LambdaGen3PDG";
5042  fCandidateVariableNames[29] = "LambdaGen4PDG";
5043  fCandidateVariableNames[30] = "LambdaGen5PDG";
5044  fCandidateVariableNames[31] = "LambdaGen6PDG";
5045  fCandidateVariableNames[32] = "LambdaGen7PDG";
5046  fCandidateVariableNames[33] = "LambdaGen8PDG";
5047  fCandidateVariableNames[34] = "LambdaGen9PDG";
5048  fCandidateVariableNames[35] = "LambdaGen10PDG";
5049  fCandidateVariableNames[36] = "LambdaPrimPDG";
5050  fCandidateVariableNames[37] = "MatchedPDG";
5051 
5052  for (Int_t ivar=0; ivar<nVar; ivar++) {
5053  fMCGenPairVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCGenPairVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
5054  }
5055  return;
5056 }
5057 
5059 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCGenPairROOTObjects(AliAODMCParticle *mcparte, AliAODMCParticle *mcpartv, TClonesArray *mcArray)
5060 {
5061  //
5062  // Fill histograms or mc pair analysis tree
5063  //
5064  for(Int_t i=0;i<38;i++){
5065  fCandidateMCGenPairVariables[i] = -9999.;
5066  }
5067 
5068  TLorentzVector vele, vlam, velam;
5069  vele.SetXYZM(mcparte->Px(),mcparte->Py(),mcparte->Pz(),0.000510998928);
5070  vlam.SetXYZM(mcpartv->Px(),mcpartv->Py(),mcpartv->Pz(),1.115683);
5071  velam = vele + vlam;
5072 
5073  Int_t pdgarray_ele[100], labelarray_ele[100], ngen_ele;
5074  Int_t pdgarray_lam[100], labelarray_lam[100], ngen_lam;
5075  GetMCDecayHistory(mcparte,mcArray,pdgarray_ele,labelarray_ele,ngen_ele);
5076  GetMCDecayHistory(mcpartv,mcArray,pdgarray_lam,labelarray_lam,ngen_lam);
5077 
5078  Bool_t same_flag = kFALSE;
5079  Int_t matched_pdg = -999999;
5080  for(Int_t iemc=0;iemc<ngen_ele;iemc++){
5081  for(Int_t ivmc=0;ivmc<ngen_lam;ivmc++){
5082  if(labelarray_ele[iemc]==labelarray_lam[ivmc]){
5083  same_flag = kTRUE;
5084  matched_pdg = pdgarray_ele[iemc];
5085  break;
5086  }
5087  }
5088  if(same_flag) break;
5089  }
5090  Int_t pdgprim_ele = pdgarray_ele[ngen_ele-1];
5091  Int_t pdgprim_lam = pdgarray_lam[ngen_lam-1];
5092 
5093  fCandidateMCGenPairVariables[ 0] = velam.M();
5094  fCandidateMCGenPairVariables[ 1] = velam.Px();
5095  fCandidateMCGenPairVariables[ 2] = velam.Py();
5096  fCandidateMCGenPairVariables[ 3] = velam.Pz();
5097  fCandidateMCGenPairVariables[ 4] = mcparte->GetPdgCode();
5098  fCandidateMCGenPairVariables[ 5] = vele.Px();
5099  fCandidateMCGenPairVariables[ 6] = vele.Py();
5100  fCandidateMCGenPairVariables[ 7] = vele.Pz();
5101  fCandidateMCGenPairVariables[ 8] = mcpartv->GetPdgCode();
5102  fCandidateMCGenPairVariables[ 9] = vlam.Px();
5103  fCandidateMCGenPairVariables[10] = vlam.Py();
5104  fCandidateMCGenPairVariables[11] = vlam.Pz();
5105  fCandidateMCGenPairVariables[12] = (Float_t)same_flag;
5106  fCandidateMCGenPairVariables[13] = (Float_t)ngen_ele;
5107  fCandidateMCGenPairVariables[14] = (Float_t)pdgarray_ele[0];
5108  fCandidateMCGenPairVariables[15] = (Float_t)pdgarray_ele[1];
5109  fCandidateMCGenPairVariables[16] = (Float_t)pdgarray_ele[2];
5110  fCandidateMCGenPairVariables[17] = (Float_t)pdgarray_ele[3];
5111  fCandidateMCGenPairVariables[18] = (Float_t)pdgarray_ele[4];
5112  fCandidateMCGenPairVariables[19] = (Float_t)pdgarray_ele[5];
5113  fCandidateMCGenPairVariables[20] = (Float_t)pdgarray_ele[6];
5114  fCandidateMCGenPairVariables[21] = (Float_t)pdgarray_ele[7];
5115  fCandidateMCGenPairVariables[22] = (Float_t)pdgarray_ele[8];
5116  fCandidateMCGenPairVariables[23] = (Float_t)pdgarray_ele[9];
5117  fCandidat