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