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