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