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