AliPhysics  2797316 (2797316)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 #include "AliVertexingHFUtils.h"
84 
85 using std::cout;
86 using std::endl;
87 
91 
92 //__________________________________________________________________________
94  AliAnalysisTaskSE(),
95  fUseMCInfo(kFALSE),
96  fOutput(0),
97  fOutputAll(0),
98  fListCuts(0),
99  fCEvents(0),
100  fHTrigger(0),
101  fHCentrality(0),
102  fHNTrackletvsZ(0),
103  fHNTrackletCorrvsZ(0),
104  fAnalCuts(0),
105  fIsEventSelected(kFALSE),
106  fWriteVariableTree(kFALSE),
107  fWriteEachVariableTree(kFALSE),
108  fWriteMCVariableTree(kFALSE),
109  fVariablesTree(0),
110  fEleVariablesTree(0),
111  fV0VariablesTree(0),
112  fMCVariablesTree(0),
113  fMCEleVariablesTree(0),
114  fMCV0VariablesTree(0),
115  fMCGenPairVariablesTree(0),
116  fCorrelationVariablesTree(0),
117  fReconstructPrimVert(kFALSE),
118  fIsMB(kFALSE),
119  fIsSemi(kFALSE),
120  fIsCent(kFALSE),
121  fIsINT7(kFALSE),
122  fIsEMC7(kFALSE),
123  fCandidateVariables(),
124  fCandidateEleVariables(),
125  fCandidateV0Variables(),
126  fCandidateMCVariables(),
127  fCandidateMCEleVariables(),
128  fCandidateMCV0Variables(),
129  fCandidateMCGenPairVariables(),
130  fCorrelationVariables(),
131  fVtx1(0),
132  fV1(0),
133  fVtxZ(0),
134  fBzkG(0),
135  fCentrality(0),
136  fRunNumber(0),
137  fTriggerCheck(0),
138  fUseCentralityV0M(kFALSE),
139  fUseCentralitySPDTracklet(kFALSE),
140  fEvNumberCounter(0),
141  fMCEventType(-9999),
142  fMCDoPairAnalysis(kFALSE),
143  fHistoEleLambdaMass(0),
144  fHistoEleLambdaMassRS(0),
145  fHistoEleLambdaMassRS1(0),
146  fHistoEleLambdaMassRS2(0),
147  fHistoEleLambdaMassWS(0),
148  fHistoEleLambdaMassWS1(0),
149  fHistoEleLambdaMassWS2(0),
150  fHistoEleLambdaMassRSMix(0),
151  fHistoEleLambdaMassRSMix1(0),
152  fHistoEleLambdaMassRSMix2(0),
153  fHistoEleLambdaMassWSMix(0),
154  fHistoEleLambdaMassWSMix1(0),
155  fHistoEleLambdaMassWSMix2(0),
156  fHistoEleLambdaMassRSSide(0),
157  fHistoEleLambdaMassRSSide1(0),
158  fHistoEleLambdaMassRSSide2(0),
159  fHistoEleLambdaMassWSSide(0),
160  fHistoEleLambdaMassWSSide1(0),
161  fHistoEleLambdaMassWSSide2(0),
162  fHistoEleLambdaMassRSAway(0),
163  fHistoEleLambdaMassRS1Away(0),
164  fHistoEleLambdaMassRS2Away(0),
165  fHistoEleLambdaMassWSAway(0),
166  fHistoEleLambdaMassWS1Away(0),
167  fHistoEleLambdaMassWS2Away(0),
168  fHistoEleLambdaMassRSMixAway(0),
169  fHistoEleLambdaMassRSMix1Away(0),
170  fHistoEleLambdaMassRSMix2Away(0),
171  fHistoEleLambdaMassWSMixAway(0),
172  fHistoEleLambdaMassWSMix1Away(0),
173  fHistoEleLambdaMassWSMix2Away(0),
174  fHistoEleLambdaMassRSSideAway(0),
175  fHistoEleLambdaMassRSSide1Away(0),
176  fHistoEleLambdaMassRSSide2Away(0),
177  fHistoEleLambdaMassWSSideAway(0),
178  fHistoEleLambdaMassWSSide1Away(0),
179  fHistoEleLambdaMassWSSide2Away(0),
180  fHistoEleLambdaMassvsElePtRS(0),
181  fHistoEleLambdaMassvsElePtWS(0),
182  fHistoEleLambdaMassvsElePtRSMix(0),
183  fHistoEleLambdaMassvsElePtWSMix(0),
184  fHistoEleLambdaMassvsElePtRSSide(0),
185  fHistoEleLambdaMassvsElePtWSSide(0),
186  fHistoEleLambdaMassvsElePtRS1(0),
187  fHistoEleLambdaMassvsElePtWS1(0),
188  fHistoEleLambdaMassvsElePtRSMix1(0),
189  fHistoEleLambdaMassvsElePtWSMix1(0),
190  fHistoEleLambdaMassvsElePtRSSide1(0),
191  fHistoEleLambdaMassvsElePtWSSide1(0),
192  fHistoEleLambdaMassvsElePtRS2(0),
193  fHistoEleLambdaMassvsElePtWS2(0),
194  fHistoEleLambdaMassvsElePtRSMix2(0),
195  fHistoEleLambdaMassvsElePtWSMix2(0),
196  fHistoEleLambdaMassvsElePtRSSide2(0),
197  fHistoEleLambdaMassvsElePtWSSide2(0),
198  fHistoElePtRS(0),
199  fHistoElePtWS(0),
200  fHistoElePtRSMix(0),
201  fHistoElePtWSMix(0),
202  fHistoEleLambdaMassMCS(0),
203  fHistoEleLambdaMassLambdabMCS(0),
204  fHistoEleLambdaMassXibMCS(0),
205  fHistoEleLambdaMassMCGen(0),
206  fHistoEleLambdaMassvsElePtMCS(0),
207  fHistoEleLambdaMassvsElePtMCGen(0),
208  fHistoEleLambdaMassvsElePtMCS1(0),
209  fHistoEleLambdaMassvsElePtMCGen1(0),
210  fHistoEleLambdaMassvsElePtMCS2(0),
211  fHistoEleLambdaMassvsElePtMCGen2(0),
212  fHistoElePtMCS(0),
213  fHistoElePtMCGen(0),
214  fHistoElePtvsEtaRS(0),
215  fHistoElePtvsEtaWS(0),
216  fHistoElePtvsEtaRSMix(0),
217  fHistoElePtvsEtaWSMix(0),
218  fHistoElePtvsEtaMCS(0),
219  fHistoElePtvsEtaMCGen(0),
220  fHistoElePtvsLambdaPtRS(0),
221  fHistoElePtvsLambdaPtWS(0),
222  fHistoElePtvsLambdaPtRSMix(0),
223  fHistoElePtvsLambdaPtWSMix(0),
224  fHistoElePtvsLambdaPtMCS(0),
225  fHistoElePtvsLambdaPtvsLcPtMCS(0),
226  fHistoElePtvsLambdaPtMCGen(0),
227  fHistoElePtvsLambdaPtvsLcPtMCGen(0),
228  fHistoElePtvsLambdaPtMCLcGen(0),
229  fHistoElePtvsd0RS(0),
230  fHistoElePtvsd0WS(0),
231  fHistoElePtvsd0RSMix(0),
232  fHistoElePtvsd0WSMix(0),
233  fHistoElePtvsd0MCS(0),
234  fHistoElePtvsd0PromptMCS(0),
235  fHistoElePtvsd0BFeeddownMCS(0),
236  fHistoEleLambdaMassFeeddownXic0MCS(0),
237  fHistoEleLambdaMassFeeddownXic0MCGen(0),
238  fHistoEleLambdaMassvsElePtFeeddownXic0MCS(0),
239  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen(0),
240  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1(0),
241  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1(0),
242  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2(0),
243  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2(0),
244  fHistoElePtFeeddownXic0MCS(0),
245  fHistoElePtFeeddownXic0MCGen(0),
246  fHistoElePtvsEtaFeeddownXic0MCS(0),
247  fHistoElePtvsEtaFeeddownXic0MCGen(0),
248  fHistoElePtvsLambdaPtFeeddownXic0MCS(0),
249  fHistoElePtvsLambdaPtFeeddownXic0MCGen(0),
250  fHistoEleLambdaMassFeeddownXicPlusMCS(0),
251  fHistoEleLambdaMassFeeddownXicPlusMCGen(0),
252  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS(0),
253  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen(0),
254  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1(0),
255  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1(0),
256  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2(0),
257  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2(0),
258  fHistoElePtFeeddownXicPlusMCS(0),
259  fHistoElePtFeeddownXicPlusMCGen(0),
260  fHistoElePtvsEtaFeeddownXicPlusMCS(0),
261  fHistoElePtvsEtaFeeddownXicPlusMCGen(0),
262  fHistoElePtvsLambdaPtFeeddownXicPlusMCS(0),
263  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen(0),
264  fHistoBachPt(0),
265  fHistoBachPtMCS(0),
266  fHistoBachPtMCGen(0),
267  fHistod0Bach(0),
268  fHistoLambdaMassvsPt(0),
269  fHistoLambdaMassvsPtMCS(0),
270  fHistoLambdaMassvsPtMCGen(0),
271  fHistoLambdaPtvsEta(0),
272  fHistoLambdaPtvsEtaMCS(0),
273  fHistoLambdaPtvsEtaMCGen(0),
274  fHistoLambdaArmenteros(0),
275  fHistoLambdaArmenterosMCS(0),
276  fHistoLambdaPtvsDl(0),
277  fHistoLambdaPtvsDlSide(0),
278  fHistoLambdaPtvsDlMCS(0),
279  fHistoLambdaPtvsDlFeeddownXi0MCS(0),
280  fHistoLambdaPtvsDlFeeddownXiMinusMCS(0),
281  fHistoLambdaPtvsDlFeeddownOmegaMCS(0),
282  fHistoK0sMassvsPt(0),
283  fHistoElectronTPCPID(0),
284  fHistoElectronTOFPID(0),
285  fHistoElectronTPCSelPID(0),
286  fHistoElectronTOFSelPID(0),
287  fHistoElectronTPCPIDSelTOF(0),
288  fHistoElectronTPCPIDSelTOFSmallEta(0),
289  fHistoElectronTPCPIDSelTOFLargeEta(0),
290  fHistoMassConversionsMin(0),
291  fHistoMassConversionsSameSignMin(0),
292  fHistoElectronQovPtvsPhi(0),
293  fHistoLambdaQovPtvsPhi(0),
294  fHistoLcMCGen(0),
295  fHistoLcMCGen1(0),
296  fHistoLcMCGen2(0),
297  fHistoLbMCGen(0),
298  fHistoLbMCGen1(0),
299  fHistoLbMCGen2(0),
300  fHistoLcMCGenWithEleA(0),
301  fHistoLcMCGenWithEleB(0),
302  fHistoLbMCGenWithEleA(0),
303  fHistoLbMCGenWithEleB(0),
304  fHistoLbMCGenWithLambdac(0),
305  fHistoLcMCS(0),
306  fHistoLcMCS1(0),
307  fHistoLcMCS2(0),
308  fHistoLbMCS(0),
309  fHistoLbMCS1(0),
310  fHistoLbMCS2(0),
311  fHistoFeedDownXic0MCGen(0),
312  fHistoFeedDownXic0MCGen1(0),
313  fHistoFeedDownXic0MCGen2(0),
314  fHistoFeedDownXic0MCS(0),
315  fHistoFeedDownXic0MCS1(0),
316  fHistoFeedDownXic0MCS2(0),
317  fHistoFeedDownXicPlusMCGen(0),
318  fHistoFeedDownXicPlusMCGen1(0),
319  fHistoFeedDownXicPlusMCGen2(0),
320  fHistoFeedDownXicPlusMCS(0),
321  fHistoFeedDownXicPlusMCS1(0),
322  fHistoFeedDownXicPlusMCS2(0),
323  fHistoFeedDownSigmaMCGen(0),
324  fHistoFeedDownSigmaMCGen1(0),
325  fHistoFeedDownSigmaMCGen2(0),
326  fHistoFeedDownSigmaMCS(0),
327  fHistoFeedDownSigmaMCS1(0),
328  fHistoFeedDownSigmaMCS2(0),
329  fHistoLcElectronMCGen(0),
330  fHistoLcElectronMCGen1(0),
331  fHistoLcElectronMCGen2(0),
332  fHistoLcElectronMCS(0),
333  fHistoLcElectronMCS1(0),
334  fHistoLcElectronMCS2(0),
335  fHistoLbElectronMCGen(0),
336  fHistoLbElectronMCGen1(0),
337  fHistoLbElectronMCGen2(0),
338  fHistoLbElectronMCS(0),
339  fHistoLbElectronMCS1(0),
340  fHistoLbElectronMCS2(0),
341  fHistoElectronFeedDownXic0MCGen(0),
342  fHistoElectronFeedDownXic0MCGen1(0),
343  fHistoElectronFeedDownXic0MCGen2(0),
344  fHistoElectronFeedDownXic0MCS(0),
345  fHistoElectronFeedDownXic0MCS1(0),
346  fHistoElectronFeedDownXic0MCS2(0),
347  fHistoElectronFeedDownXicPlusMCGen(0),
348  fHistoElectronFeedDownXicPlusMCGen1(0),
349  fHistoElectronFeedDownXicPlusMCGen2(0),
350  fHistoElectronFeedDownXicPlusMCS(0),
351  fHistoElectronFeedDownXicPlusMCS1(0),
352  fHistoElectronFeedDownXicPlusMCS2(0),
353  fHistoElectronFeedDownXibMCGen(0),
354  fHistoElectronFeedDownXibMCGen1(0),
355  fHistoElectronFeedDownXibMCGen2(0),
356  fHistoElectronFeedDownXibMCS(0),
357  fHistoElectronFeedDownXibMCS1(0),
358  fHistoElectronFeedDownXibMCS2(0),
359  fHistoElectronMCGen(0),
360  fHistoBottomElectronMCGen(0),
361  fHistoCharmElectronMCGen(0),
362  fHistoLambdaMCGen(0),
363  fHistoElePtvsV0dlRS(0),
364  fHistoElePtvsV0dlRS1(0),
365  fHistoElePtvsV0dlRS2(0),
366  fHistoElePtvsV0dlRSSide(0),
367  fHistoElePtvsV0dlRSSide1(0),
368  fHistoElePtvsV0dlRSSide2(0),
369  fHistoElePtvsV0dlRSMix(0),
370  fHistoElePtvsV0dlRSMix1(0),
371  fHistoElePtvsV0dlRSMix2(0),
372  fHistoElePtvsV0dlWS(0),
373  fHistoElePtvsV0dlWS1(0),
374  fHistoElePtvsV0dlWS2(0),
375  fHistoElePtvsV0dlWSSide(0),
376  fHistoElePtvsV0dlWSSide1(0),
377  fHistoElePtvsV0dlWSSide2(0),
378  fHistoElePtvsV0dlWSMix(0),
379  fHistoElePtvsV0dlWSMix1(0),
380  fHistoElePtvsV0dlWSMix2(0),
381  fHistoElePtvsV0dlMCS(0),
382  fHistoElePtvsV0dlMCS1(0),
383  fHistoElePtvsV0dlMCS2(0),
384  fHistoElePtvsV0dlFeedDownXic0MCS(0),
385  fHistoElePtvsV0dlFeedDownXic0MCS1(0),
386  fHistoElePtvsV0dlFeedDownXic0MCS2(0),
387  fHistoElePtvsV0dlFeedDownXicPlusMCS(0),
388  fHistoElePtvsV0dlFeedDownXicPlusMCS1(0),
389  fHistoElePtvsV0dlFeedDownXicPlusMCS2(0),
390  fHistoElePtvsV0dcaRS(0),
391  fHistoElePtvsV0dcaRS1(0),
392  fHistoElePtvsV0dcaRS2(0),
393  fHistoElePtvsV0dcaRSSide(0),
394  fHistoElePtvsV0dcaRSSide1(0),
395  fHistoElePtvsV0dcaRSSide2(0),
396  fHistoElePtvsV0dcaRSMix(0),
397  fHistoElePtvsV0dcaRSMix1(0),
398  fHistoElePtvsV0dcaRSMix2(0),
399  fHistoElePtvsV0dcaWS(0),
400  fHistoElePtvsV0dcaWS1(0),
401  fHistoElePtvsV0dcaWS2(0),
402  fHistoElePtvsV0dcaWSSide(0),
403  fHistoElePtvsV0dcaWSSide1(0),
404  fHistoElePtvsV0dcaWSSide2(0),
405  fHistoElePtvsV0dcaWSMix(0),
406  fHistoElePtvsV0dcaWSMix1(0),
407  fHistoElePtvsV0dcaWSMix2(0),
408  fHistoElePtvsV0dcaMCS(0),
409  fHistoElePtvsV0dcaMCS1(0),
410  fHistoElePtvsV0dcaMCS2(0),
411  fHistoElePtvsV0dcaFeedDownXic0MCS(0),
412  fHistoElePtvsV0dcaFeedDownXic0MCS1(0),
413  fHistoElePtvsV0dcaFeedDownXic0MCS2(0),
414  fHistoElePtvsV0dcaFeedDownXicPlusMCS(0),
415  fHistoElePtvsV0dcaFeedDownXicPlusMCS1(0),
416  fHistoElePtvsV0dcaFeedDownXicPlusMCS2(0),
417  fHistoEleLambdaPtvsV0dlRS(0),
418  fHistoEleLambdaPtvsV0dlRS1(0),
419  fHistoEleLambdaPtvsV0dlRS2(0),
420  fHistoEleLambdaPtvsV0dlRSSide(0),
421  fHistoEleLambdaPtvsV0dlRSSide1(0),
422  fHistoEleLambdaPtvsV0dlRSSide2(0),
423  fHistoEleLambdaPtvsV0dlRSMix(0),
424  fHistoEleLambdaPtvsV0dlRSMix1(0),
425  fHistoEleLambdaPtvsV0dlRSMix2(0),
426  fHistoEleLambdaPtvsV0dlWS(0),
427  fHistoEleLambdaPtvsV0dlWS1(0),
428  fHistoEleLambdaPtvsV0dlWS2(0),
429  fHistoEleLambdaPtvsV0dlWSSide(0),
430  fHistoEleLambdaPtvsV0dlWSSide1(0),
431  fHistoEleLambdaPtvsV0dlWSSide2(0),
432  fHistoEleLambdaPtvsV0dlWSMix(0),
433  fHistoEleLambdaPtvsV0dlWSMix1(0),
434  fHistoEleLambdaPtvsV0dlWSMix2(0),
435  fHistoEleLambdaPtvsV0dlMCS(0),
436  fHistoEleLambdaPtvsV0dlMCS1(0),
437  fHistoEleLambdaPtvsV0dlMCS2(0),
438  fHistoEleLambdaPtvsV0dlPromptMCS(0),
439  fHistoEleLambdaPtvsV0dlPromptMCS1(0),
440  fHistoEleLambdaPtvsV0dlPromptMCS2(0),
441  fHistoEleLambdaPtvsV0dlBFeeddownMCS(0),
442  fHistoEleLambdaPtvsV0dlBFeeddownMCS1(0),
443  fHistoEleLambdaPtvsV0dlBFeeddownMCS2(0),
444  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS(0),
445  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1(0),
446  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2(0),
447  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS(0),
448  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS1(0),
449  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS2(0),
450  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS(0),
451  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS1(0),
452  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS2(0),
453  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS(0),
454  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1(0),
455  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2(0),
456  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS(0),
457  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS1(0),
458  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS2(0),
459  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS(0),
460  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS1(0),
461  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS2(0),
462  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS(0),
463  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS1(0),
464  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS2(0),
465  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS(0),
466  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS1(0),
467  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS2(0),
468  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS(0),
469  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS1(0),
470  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS2(0),
471  fHistoEleLambdaPtvsV0dlLambdabMCS(0),
472  fHistoEleLambdaPtvsV0dlLambdabMCS1(0),
473  fHistoEleLambdaPtvsV0dlLambdabMCS2(0),
474  fHistoEleLambdaPtvsV0dlXibMCS(0),
475  fHistoEleLambdaPtvsV0dlXibMCS1(0),
476  fHistoEleLambdaPtvsV0dlXibMCS2(0),
477  fHistoEleLambdaPtvsV0dlRSAway(0),
478  fHistoEleLambdaPtvsV0dlRS1Away(0),
479  fHistoEleLambdaPtvsV0dlRS2Away(0),
480  fHistoEleLambdaPtvsV0dlRSSideAway(0),
481  fHistoEleLambdaPtvsV0dlRSSide1Away(0),
482  fHistoEleLambdaPtvsV0dlRSSide2Away(0),
483  fHistoEleLambdaPtvsV0dlRSMixAway(0),
484  fHistoEleLambdaPtvsV0dlRSMix1Away(0),
485  fHistoEleLambdaPtvsV0dlRSMix2Away(0),
486  fHistoEleLambdaPtvsV0dlWSAway(0),
487  fHistoEleLambdaPtvsV0dlWS1Away(0),
488  fHistoEleLambdaPtvsV0dlWS2Away(0),
489  fHistoEleLambdaPtvsV0dlWSSideAway(0),
490  fHistoEleLambdaPtvsV0dlWSSide1Away(0),
491  fHistoEleLambdaPtvsV0dlWSSide2Away(0),
492  fHistoEleLambdaPtvsV0dlWSMixAway(0),
493  fHistoEleLambdaPtvsV0dlWSMix1Away(0),
494  fHistoEleLambdaPtvsV0dlWSMix2Away(0),
495  fHistoCorrelationVariablesvsEleLambdaPt(0),
496  fHistoCorrelationVariablesvsEleLambdaPtMix(0),
497  fHistoCorrelationVariablesvsEleLambdaPtMC(0),
498  fHistoCorrelationVariablesvsElePt(0),
499  fHistoCorrelationVariablesvsElePtMix(0),
500  fHistoCorrelationVariablesvsElePtMC(0),
501  fHistoCorrelationVariablesvsLambdaPt(0),
502  fHistoCorrelationVariablesvsLambdaPtMix(0),
503  fHistoCorrelationVariablesvsLambdaPtMC(0),
504  fHistoMassVariablesvsEleLambdaPt(0),
505  fHistoMassVariablesvsEleLambdaPtMix(0),
506  fHistoMassVariablesvsEleLambdaPtMC(0),
507  fHistoMassVariablesvsElePt(0),
508  fHistoMassVariablesvsElePtMix(0),
509  fHistoMassVariablesvsElePtMC(0),
510  fHistoMassVariablesvsLambdaPt(0),
511  fHistoMassVariablesvsLambdaPtMix(0),
512  fHistoMassVariablesvsLambdaPtMC(0),
513  fHistoSingleElectronVariablesvsElePt(0),
514  fHistoSingleElectronVariablesvsElePtMix(0),
515  fHistoSingleElectronVariablesvsElePtMC(0),
516  fHistoResponseElePt(0),
517  fHistoResponseElePt1(0),
518  fHistoResponseElePt2(0),
519  fHistoResponseEleLambdaPt(0),
520  fHistoResponseEleLambdaPt1(0),
521  fHistoResponseEleLambdaPt2(0),
522  fHistoResponseEleLambdaPtFeeddownXic0(0),
523  fHistoResponseEleLambdaPtFeeddownXic01(0),
524  fHistoResponseEleLambdaPtFeeddownXic02(0),
525  fHistoResponseEleLambdaPtFeeddownXicPlus(0),
526  fHistoResponseEleLambdaPtFeeddownXicPlus1(0),
527  fHistoResponseEleLambdaPtFeeddownXicPlus2(0),
528  fHistoResponseEleLambdaPtFeeddownSigma(0),
529  fHistoResponseEleLambdaPtFeeddownSigma1(0),
530  fHistoResponseEleLambdaPtFeeddownSigma2(0),
531  fHistoResponseEleLambdaPtLambdab(0),
532  fHistoResponseElePtLambdab(0),
533  fHistoResponseLambdaPtLambdab(0),
534  fHistoResponseLambdaPt(0),
535  fHistoResponseLambdaPtFeeddownXic0(0),
536  fHistoResponseLambdaPtFeeddownXicPlus(0),
537  fHistoResponseLambdaPtFeeddownSigma(0),
538  fHistoResponseLambdaPtvsEleLambdaPt(0),
539  fHistoResponseLambdaPtvsEleLambdaPtLambdab(0),
540  fHistoResponseMcGenLambdabPtvsLambdacPt(0),
541  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt(0),
542  fHistoEleLambdaPtvsRapidityRS(0),
543  fHistoEleLambdaPtvsRapidityWS(0),
544  fHistoEleLambdaPtvsRapidityMCS(0),
545  fHistoPi0MCGen(0),
546  fHistoElectronPi0Total(0),
547  fHistoElectronPi0Tag(0),
548  fHistoEtaMCGen(0),
549  fHistoElectronEtaTotal(0),
550  fHistoElectronEtaTag(0),
551  fCounter(0),
552  fHistonEvtvsRunNumber(0),
553  fHistonElevsRunNumber(0),
554  fHistonLambdavsRunNumber(0),
555  fHistoMCEventType(0),
556  fHistoMCDeltaPhiccbar(0),
557  fRefMult(9.26),
558  fGTI(0),fGTIndex(0), fTrackBuffSize(19000),
559  fHistodPhiSdEtaSElectronProtonR125RS(0),
560  fHistodPhiSdEtaSElectronProtonR125WS(0),
561  fHistodPhiSdEtaSElectronProtonR125RSMix(0),
562  fHistodPhiSdEtaSElectronProtonR125WSMix(0),
563  fHistodPhiSdEtaSElectronPionR125RS(0),
564  fHistodPhiSdEtaSElectronPionR125WS(0),
565  fHistodPhiSdEtaSElectronPionR125RSMix(0),
566  fHistodPhiSdEtaSElectronPionR125WSMix(0),
567  fDoSingleElectronAnalysis(kTRUE),
568  fDoEventMixing(0),
569  fMixWithoutConversionFlag(kFALSE),
570  fNumberOfEventsForMixing (5),
571  fNzVtxBins (0),
572  fNCentBins (0),
573  fNOfPools(1),
574  fEventBuffer(0x0),
575  fEventInfo(new TObjString("")),
576  fElectronTracks(0x0),
577  fV0Tracks1(0x0),
578  fV0Tracks2(0x0),
579  fElectronCutVarsArray(0x0),
580  fV0CutVarsArray1(0x0),
581  fV0CutVarsArray2(0x0),
582  fHistoPoolNumberOfDumps(0),
583  fHistoPoolNumberOfResets(0)
584 {
585  //
587  //
588  for(Int_t i=0;i<17;i++){
589  fHistoElePtvsCutVarsRS[i] = 0;
590  fHistoElePtvsCutVarsWS[i] = 0;
592  }
593  for(Int_t i=0;i<8;i++){
595  }
596  for(Int_t i=0; i<4; i++) fMultEstimatorAvg[i]=0;
597 }
598 
599 //___________________________________________________________________________
602  Bool_t writeVariableTree) :
603  AliAnalysisTaskSE(name),
604  fUseMCInfo(kFALSE),
605  fOutput(0),
606  fOutputAll(0),
607  fListCuts(0),
608  fCEvents(0),
609  fHTrigger(0),
610  fHCentrality(0),
611  fHNTrackletvsZ(0),
612  fHNTrackletCorrvsZ(0),
613  fAnalCuts(analCuts),
614  fIsEventSelected(kFALSE),
615  fWriteVariableTree(writeVariableTree),
616  fWriteEachVariableTree(kFALSE),
617  fWriteMCVariableTree(kFALSE),
618  fVariablesTree(0),
619  fEleVariablesTree(0),
620  fV0VariablesTree(0),
621  fMCVariablesTree(0),
622  fMCEleVariablesTree(0),
623  fMCV0VariablesTree(0),
624  fMCGenPairVariablesTree(0),
625  fCorrelationVariablesTree(0),
626  fReconstructPrimVert(kFALSE),
627  fIsMB(kFALSE),
628  fIsSemi(kFALSE),
629  fIsCent(kFALSE),
630  fIsINT7(kFALSE),
631  fIsEMC7(kFALSE),
632  fCandidateVariables(),
633  fCandidateEleVariables(),
634  fCandidateV0Variables(),
635  fCandidateMCVariables(),
636  fCandidateMCEleVariables(),
637  fCandidateMCV0Variables(),
638  fCandidateMCGenPairVariables(),
639  fCorrelationVariables(),
640  fVtx1(0),
641  fV1(0),
642  fVtxZ(0),
643  fBzkG(0),
644  fCentrality(0),
645  fRunNumber(0),
646  fTriggerCheck(0),
647  fUseCentralityV0M(kFALSE),
648  fUseCentralitySPDTracklet(kFALSE),
649  fEvNumberCounter(0),
650  fMCEventType(-9999),
651  fMCDoPairAnalysis(kFALSE),
652  fHistoEleLambdaMass(0),
653  fHistoEleLambdaMassRS(0),
654  fHistoEleLambdaMassRS1(0),
655  fHistoEleLambdaMassRS2(0),
656  fHistoEleLambdaMassWS(0),
657  fHistoEleLambdaMassWS1(0),
658  fHistoEleLambdaMassWS2(0),
659  fHistoEleLambdaMassRSMix(0),
660  fHistoEleLambdaMassRSMix1(0),
661  fHistoEleLambdaMassRSMix2(0),
662  fHistoEleLambdaMassWSMix(0),
663  fHistoEleLambdaMassWSMix1(0),
664  fHistoEleLambdaMassWSMix2(0),
665  fHistoEleLambdaMassRSSide(0),
666  fHistoEleLambdaMassRSSide1(0),
667  fHistoEleLambdaMassRSSide2(0),
668  fHistoEleLambdaMassWSSide(0),
669  fHistoEleLambdaMassWSSide1(0),
670  fHistoEleLambdaMassWSSide2(0),
671  fHistoEleLambdaMassRSAway(0),
672  fHistoEleLambdaMassRS1Away(0),
673  fHistoEleLambdaMassRS2Away(0),
674  fHistoEleLambdaMassWSAway(0),
675  fHistoEleLambdaMassWS1Away(0),
676  fHistoEleLambdaMassWS2Away(0),
677  fHistoEleLambdaMassRSMixAway(0),
678  fHistoEleLambdaMassRSMix1Away(0),
679  fHistoEleLambdaMassRSMix2Away(0),
680  fHistoEleLambdaMassWSMixAway(0),
681  fHistoEleLambdaMassWSMix1Away(0),
682  fHistoEleLambdaMassWSMix2Away(0),
683  fHistoEleLambdaMassRSSideAway(0),
684  fHistoEleLambdaMassRSSide1Away(0),
685  fHistoEleLambdaMassRSSide2Away(0),
686  fHistoEleLambdaMassWSSideAway(0),
687  fHistoEleLambdaMassWSSide1Away(0),
688  fHistoEleLambdaMassWSSide2Away(0),
689  fHistoEleLambdaMassvsElePtRS(0),
690  fHistoEleLambdaMassvsElePtWS(0),
691  fHistoEleLambdaMassvsElePtRSMix(0),
692  fHistoEleLambdaMassvsElePtWSMix(0),
693  fHistoEleLambdaMassvsElePtRSSide(0),
694  fHistoEleLambdaMassvsElePtWSSide(0),
695  fHistoEleLambdaMassvsElePtRS1(0),
696  fHistoEleLambdaMassvsElePtWS1(0),
697  fHistoEleLambdaMassvsElePtRSMix1(0),
698  fHistoEleLambdaMassvsElePtWSMix1(0),
699  fHistoEleLambdaMassvsElePtRSSide1(0),
700  fHistoEleLambdaMassvsElePtWSSide1(0),
701  fHistoEleLambdaMassvsElePtRS2(0),
702  fHistoEleLambdaMassvsElePtWS2(0),
703  fHistoEleLambdaMassvsElePtRSMix2(0),
704  fHistoEleLambdaMassvsElePtWSMix2(0),
705  fHistoEleLambdaMassvsElePtRSSide2(0),
706  fHistoEleLambdaMassvsElePtWSSide2(0),
707  fHistoElePtRS(0),
708  fHistoElePtWS(0),
709  fHistoElePtRSMix(0),
710  fHistoElePtWSMix(0),
711  fHistoEleLambdaMassMCS(0),
712  fHistoEleLambdaMassLambdabMCS(0),
713  fHistoEleLambdaMassXibMCS(0),
714  fHistoEleLambdaMassMCGen(0),
715  fHistoEleLambdaMassvsElePtMCS(0),
716  fHistoEleLambdaMassvsElePtMCGen(0),
717  fHistoEleLambdaMassvsElePtMCS1(0),
718  fHistoEleLambdaMassvsElePtMCGen1(0),
719  fHistoEleLambdaMassvsElePtMCS2(0),
720  fHistoEleLambdaMassvsElePtMCGen2(0),
721  fHistoElePtMCS(0),
722  fHistoElePtMCGen(0),
723  fHistoElePtvsEtaRS(0),
724  fHistoElePtvsEtaWS(0),
725  fHistoElePtvsEtaRSMix(0),
726  fHistoElePtvsEtaWSMix(0),
727  fHistoElePtvsEtaMCS(0),
728  fHistoElePtvsEtaMCGen(0),
729  fHistoElePtvsLambdaPtRS(0),
730  fHistoElePtvsLambdaPtWS(0),
731  fHistoElePtvsLambdaPtRSMix(0),
732  fHistoElePtvsLambdaPtWSMix(0),
733  fHistoElePtvsLambdaPtMCS(0),
734  fHistoElePtvsLambdaPtvsLcPtMCS(0),
735  fHistoElePtvsLambdaPtMCGen(0),
736  fHistoElePtvsLambdaPtvsLcPtMCGen(0),
737  fHistoElePtvsLambdaPtMCLcGen(0),
738  fHistoElePtvsd0RS(0),
739  fHistoElePtvsd0WS(0),
740  fHistoElePtvsd0RSMix(0),
741  fHistoElePtvsd0WSMix(0),
742  fHistoElePtvsd0MCS(0),
743  fHistoElePtvsd0PromptMCS(0),
744  fHistoElePtvsd0BFeeddownMCS(0),
745  fHistoEleLambdaMassFeeddownXic0MCS(0),
746  fHistoEleLambdaMassFeeddownXic0MCGen(0),
747  fHistoEleLambdaMassvsElePtFeeddownXic0MCS(0),
748  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen(0),
749  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1(0),
750  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1(0),
751  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2(0),
752  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2(0),
753  fHistoElePtFeeddownXic0MCS(0),
754  fHistoElePtFeeddownXic0MCGen(0),
755  fHistoElePtvsEtaFeeddownXic0MCS(0),
756  fHistoElePtvsEtaFeeddownXic0MCGen(0),
757  fHistoElePtvsLambdaPtFeeddownXic0MCS(0),
758  fHistoElePtvsLambdaPtFeeddownXic0MCGen(0),
759  fHistoEleLambdaMassFeeddownXicPlusMCS(0),
760  fHistoEleLambdaMassFeeddownXicPlusMCGen(0),
761  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS(0),
762  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen(0),
763  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1(0),
764  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1(0),
765  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2(0),
766  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2(0),
767  fHistoElePtFeeddownXicPlusMCS(0),
768  fHistoElePtFeeddownXicPlusMCGen(0),
769  fHistoElePtvsEtaFeeddownXicPlusMCS(0),
770  fHistoElePtvsEtaFeeddownXicPlusMCGen(0),
771  fHistoElePtvsLambdaPtFeeddownXicPlusMCS(0),
772  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen(0),
773  fHistoBachPt(0),
774  fHistoBachPtMCS(0),
775  fHistoBachPtMCGen(0),
776  fHistod0Bach(0),
777  fHistoLambdaMassvsPt(0),
778  fHistoLambdaMassvsPtMCS(0),
779  fHistoLambdaMassvsPtMCGen(0),
780  fHistoLambdaPtvsEta(0),
781  fHistoLambdaPtvsEtaMCS(0),
782  fHistoLambdaPtvsEtaMCGen(0),
783  fHistoLambdaArmenteros(0),
784  fHistoLambdaArmenterosMCS(0),
785  fHistoLambdaPtvsDl(0),
786  fHistoLambdaPtvsDlSide(0),
787  fHistoLambdaPtvsDlMCS(0),
788  fHistoLambdaPtvsDlFeeddownXi0MCS(0),
789  fHistoLambdaPtvsDlFeeddownXiMinusMCS(0),
790  fHistoLambdaPtvsDlFeeddownOmegaMCS(0),
791  fHistoK0sMassvsPt(0),
792  fHistoElectronTPCPID(0),
793  fHistoElectronTOFPID(0),
794  fHistoElectronTPCSelPID(0),
795  fHistoElectronTOFSelPID(0),
796  fHistoElectronTPCPIDSelTOF(0),
797  fHistoElectronTPCPIDSelTOFSmallEta(0),
798  fHistoElectronTPCPIDSelTOFLargeEta(0),
799  fHistoMassConversionsMin(0),
800  fHistoMassConversionsSameSignMin(0),
801  fHistoElectronQovPtvsPhi(0),
802  fHistoLambdaQovPtvsPhi(0),
803  fHistoLcMCGen(0),
804  fHistoLcMCGen1(0),
805  fHistoLcMCGen2(0),
806  fHistoLbMCGen(0),
807  fHistoLbMCGen1(0),
808  fHistoLbMCGen2(0),
809  fHistoLcMCGenWithEleA(0),
810  fHistoLcMCGenWithEleB(0),
811  fHistoLbMCGenWithEleA(0),
812  fHistoLbMCGenWithEleB(0),
813  fHistoLbMCGenWithLambdac(0),
814  fHistoLcMCS(0),
815  fHistoLcMCS1(0),
816  fHistoLcMCS2(0),
817  fHistoLbMCS(0),
818  fHistoLbMCS1(0),
819  fHistoLbMCS2(0),
820  fHistoFeedDownXic0MCGen(0),
821  fHistoFeedDownXic0MCGen1(0),
822  fHistoFeedDownXic0MCGen2(0),
823  fHistoFeedDownXic0MCS(0),
824  fHistoFeedDownXic0MCS1(0),
825  fHistoFeedDownXic0MCS2(0),
826  fHistoFeedDownXicPlusMCGen(0),
827  fHistoFeedDownXicPlusMCGen1(0),
828  fHistoFeedDownXicPlusMCGen2(0),
829  fHistoFeedDownXicPlusMCS(0),
830  fHistoFeedDownXicPlusMCS1(0),
831  fHistoFeedDownXicPlusMCS2(0),
832  fHistoFeedDownSigmaMCGen(0),
833  fHistoFeedDownSigmaMCGen1(0),
834  fHistoFeedDownSigmaMCGen2(0),
835  fHistoFeedDownSigmaMCS(0),
836  fHistoFeedDownSigmaMCS1(0),
837  fHistoFeedDownSigmaMCS2(0),
838  fHistoLcElectronMCGen(0),
839  fHistoLcElectronMCGen1(0),
840  fHistoLcElectronMCGen2(0),
841  fHistoLcElectronMCS(0),
842  fHistoLcElectronMCS1(0),
843  fHistoLcElectronMCS2(0),
844  fHistoLbElectronMCGen(0),
845  fHistoLbElectronMCGen1(0),
846  fHistoLbElectronMCGen2(0),
847  fHistoLbElectronMCS(0),
848  fHistoLbElectronMCS1(0),
849  fHistoLbElectronMCS2(0),
850  fHistoElectronFeedDownXic0MCGen(0),
851  fHistoElectronFeedDownXic0MCGen1(0),
852  fHistoElectronFeedDownXic0MCGen2(0),
853  fHistoElectronFeedDownXic0MCS(0),
854  fHistoElectronFeedDownXic0MCS1(0),
855  fHistoElectronFeedDownXic0MCS2(0),
856  fHistoElectronFeedDownXicPlusMCGen(0),
857  fHistoElectronFeedDownXicPlusMCGen1(0),
858  fHistoElectronFeedDownXicPlusMCGen2(0),
859  fHistoElectronFeedDownXicPlusMCS(0),
860  fHistoElectronFeedDownXicPlusMCS1(0),
861  fHistoElectronFeedDownXicPlusMCS2(0),
862  fHistoElectronFeedDownXibMCGen(0),
863  fHistoElectronFeedDownXibMCGen1(0),
864  fHistoElectronFeedDownXibMCGen2(0),
865  fHistoElectronFeedDownXibMCS(0),
866  fHistoElectronFeedDownXibMCS1(0),
867  fHistoElectronFeedDownXibMCS2(0),
868  fHistoElectronMCGen(0),
869  fHistoBottomElectronMCGen(0),
870  fHistoCharmElectronMCGen(0),
871  fHistoLambdaMCGen(0),
872  fHistoElePtvsV0dlRS(0),
873  fHistoElePtvsV0dlRS1(0),
874  fHistoElePtvsV0dlRS2(0),
875  fHistoElePtvsV0dlRSSide(0),
876  fHistoElePtvsV0dlRSSide1(0),
877  fHistoElePtvsV0dlRSSide2(0),
878  fHistoElePtvsV0dlRSMix(0),
879  fHistoElePtvsV0dlRSMix1(0),
880  fHistoElePtvsV0dlRSMix2(0),
881  fHistoElePtvsV0dlWS(0),
882  fHistoElePtvsV0dlWS1(0),
883  fHistoElePtvsV0dlWS2(0),
884  fHistoElePtvsV0dlWSSide(0),
885  fHistoElePtvsV0dlWSSide1(0),
886  fHistoElePtvsV0dlWSSide2(0),
887  fHistoElePtvsV0dlWSMix(0),
888  fHistoElePtvsV0dlWSMix1(0),
889  fHistoElePtvsV0dlWSMix2(0),
890  fHistoElePtvsV0dlMCS(0),
891  fHistoElePtvsV0dlMCS1(0),
892  fHistoElePtvsV0dlMCS2(0),
893  fHistoElePtvsV0dlFeedDownXic0MCS(0),
894  fHistoElePtvsV0dlFeedDownXic0MCS1(0),
895  fHistoElePtvsV0dlFeedDownXic0MCS2(0),
896  fHistoElePtvsV0dlFeedDownXicPlusMCS(0),
897  fHistoElePtvsV0dlFeedDownXicPlusMCS1(0),
898  fHistoElePtvsV0dlFeedDownXicPlusMCS2(0),
899  fHistoElePtvsV0dcaRS(0),
900  fHistoElePtvsV0dcaRS1(0),
901  fHistoElePtvsV0dcaRS2(0),
902  fHistoElePtvsV0dcaRSSide(0),
903  fHistoElePtvsV0dcaRSSide1(0),
904  fHistoElePtvsV0dcaRSSide2(0),
905  fHistoElePtvsV0dcaRSMix(0),
906  fHistoElePtvsV0dcaRSMix1(0),
907  fHistoElePtvsV0dcaRSMix2(0),
908  fHistoElePtvsV0dcaWS(0),
909  fHistoElePtvsV0dcaWS1(0),
910  fHistoElePtvsV0dcaWS2(0),
911  fHistoElePtvsV0dcaWSSide(0),
912  fHistoElePtvsV0dcaWSSide1(0),
913  fHistoElePtvsV0dcaWSSide2(0),
914  fHistoElePtvsV0dcaWSMix(0),
915  fHistoElePtvsV0dcaWSMix1(0),
916  fHistoElePtvsV0dcaWSMix2(0),
917  fHistoElePtvsV0dcaMCS(0),
918  fHistoElePtvsV0dcaMCS1(0),
919  fHistoElePtvsV0dcaMCS2(0),
920  fHistoElePtvsV0dcaFeedDownXic0MCS(0),
921  fHistoElePtvsV0dcaFeedDownXic0MCS1(0),
922  fHistoElePtvsV0dcaFeedDownXic0MCS2(0),
923  fHistoElePtvsV0dcaFeedDownXicPlusMCS(0),
924  fHistoElePtvsV0dcaFeedDownXicPlusMCS1(0),
925  fHistoElePtvsV0dcaFeedDownXicPlusMCS2(0),
926  fHistoEleLambdaPtvsV0dlRS(0),
927  fHistoEleLambdaPtvsV0dlRS1(0),
928  fHistoEleLambdaPtvsV0dlRS2(0),
929  fHistoEleLambdaPtvsV0dlRSSide(0),
930  fHistoEleLambdaPtvsV0dlRSSide1(0),
931  fHistoEleLambdaPtvsV0dlRSSide2(0),
932  fHistoEleLambdaPtvsV0dlRSMix(0),
933  fHistoEleLambdaPtvsV0dlRSMix1(0),
934  fHistoEleLambdaPtvsV0dlRSMix2(0),
935  fHistoEleLambdaPtvsV0dlWS(0),
936  fHistoEleLambdaPtvsV0dlWS1(0),
937  fHistoEleLambdaPtvsV0dlWS2(0),
938  fHistoEleLambdaPtvsV0dlWSSide(0),
939  fHistoEleLambdaPtvsV0dlWSSide1(0),
940  fHistoEleLambdaPtvsV0dlWSSide2(0),
941  fHistoEleLambdaPtvsV0dlWSMix(0),
942  fHistoEleLambdaPtvsV0dlWSMix1(0),
943  fHistoEleLambdaPtvsV0dlWSMix2(0),
944  fHistoEleLambdaPtvsV0dlMCS(0),
945  fHistoEleLambdaPtvsV0dlMCS1(0),
946  fHistoEleLambdaPtvsV0dlMCS2(0),
947  fHistoEleLambdaPtvsV0dlPromptMCS(0),
948  fHistoEleLambdaPtvsV0dlPromptMCS1(0),
949  fHistoEleLambdaPtvsV0dlPromptMCS2(0),
950  fHistoEleLambdaPtvsV0dlBFeeddownMCS(0),
951  fHistoEleLambdaPtvsV0dlBFeeddownMCS1(0),
952  fHistoEleLambdaPtvsV0dlBFeeddownMCS2(0),
953  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS(0),
954  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1(0),
955  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2(0),
956  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS(0),
957  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS1(0),
958  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS2(0),
959  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS(0),
960  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS1(0),
961  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS2(0),
962  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS(0),
963  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1(0),
964  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2(0),
965  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS(0),
966  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS1(0),
967  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS2(0),
968  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS(0),
969  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS1(0),
970  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS2(0),
971  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS(0),
972  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS1(0),
973  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS2(0),
974  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS(0),
975  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS1(0),
976  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS2(0),
977  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS(0),
978  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS1(0),
979  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS2(0),
980  fHistoEleLambdaPtvsV0dlLambdabMCS(0),
981  fHistoEleLambdaPtvsV0dlLambdabMCS1(0),
982  fHistoEleLambdaPtvsV0dlLambdabMCS2(0),
983  fHistoEleLambdaPtvsV0dlXibMCS(0),
984  fHistoEleLambdaPtvsV0dlXibMCS1(0),
985  fHistoEleLambdaPtvsV0dlXibMCS2(0),
986  fHistoEleLambdaPtvsV0dlRSAway(0),
987  fHistoEleLambdaPtvsV0dlRS1Away(0),
988  fHistoEleLambdaPtvsV0dlRS2Away(0),
989  fHistoEleLambdaPtvsV0dlRSSideAway(0),
990  fHistoEleLambdaPtvsV0dlRSSide1Away(0),
991  fHistoEleLambdaPtvsV0dlRSSide2Away(0),
992  fHistoEleLambdaPtvsV0dlRSMixAway(0),
993  fHistoEleLambdaPtvsV0dlRSMix1Away(0),
994  fHistoEleLambdaPtvsV0dlRSMix2Away(0),
995  fHistoEleLambdaPtvsV0dlWSAway(0),
996  fHistoEleLambdaPtvsV0dlWS1Away(0),
997  fHistoEleLambdaPtvsV0dlWS2Away(0),
998  fHistoEleLambdaPtvsV0dlWSSideAway(0),
999  fHistoEleLambdaPtvsV0dlWSSide1Away(0),
1000  fHistoEleLambdaPtvsV0dlWSSide2Away(0),
1001  fHistoEleLambdaPtvsV0dlWSMixAway(0),
1002  fHistoEleLambdaPtvsV0dlWSMix1Away(0),
1003  fHistoEleLambdaPtvsV0dlWSMix2Away(0),
1004  fHistoCorrelationVariablesvsEleLambdaPt(0),
1005  fHistoCorrelationVariablesvsEleLambdaPtMix(0),
1006  fHistoCorrelationVariablesvsEleLambdaPtMC(0),
1007  fHistoCorrelationVariablesvsElePt(0),
1008  fHistoCorrelationVariablesvsElePtMix(0),
1009  fHistoCorrelationVariablesvsElePtMC(0),
1010  fHistoCorrelationVariablesvsLambdaPt(0),
1011  fHistoCorrelationVariablesvsLambdaPtMix(0),
1012  fHistoCorrelationVariablesvsLambdaPtMC(0),
1013  fHistoMassVariablesvsEleLambdaPt(0),
1014  fHistoMassVariablesvsEleLambdaPtMix(0),
1015  fHistoMassVariablesvsEleLambdaPtMC(0),
1016  fHistoMassVariablesvsElePt(0),
1017  fHistoMassVariablesvsElePtMix(0),
1018  fHistoMassVariablesvsElePtMC(0),
1019  fHistoMassVariablesvsLambdaPt(0),
1020  fHistoMassVariablesvsLambdaPtMix(0),
1021  fHistoMassVariablesvsLambdaPtMC(0),
1022  fHistoSingleElectronVariablesvsElePt(0),
1023  fHistoSingleElectronVariablesvsElePtMix(0),
1024  fHistoSingleElectronVariablesvsElePtMC(0),
1025  fHistoResponseElePt(0),
1026  fHistoResponseElePt1(0),
1027  fHistoResponseElePt2(0),
1028  fHistoResponseEleLambdaPt(0),
1029  fHistoResponseEleLambdaPt1(0),
1030  fHistoResponseEleLambdaPt2(0),
1031  fHistoResponseEleLambdaPtFeeddownXic0(0),
1032  fHistoResponseEleLambdaPtFeeddownXic01(0),
1033  fHistoResponseEleLambdaPtFeeddownXic02(0),
1034  fHistoResponseEleLambdaPtFeeddownXicPlus(0),
1035  fHistoResponseEleLambdaPtFeeddownXicPlus1(0),
1036  fHistoResponseEleLambdaPtFeeddownXicPlus2(0),
1037  fHistoResponseEleLambdaPtFeeddownSigma(0),
1038  fHistoResponseEleLambdaPtFeeddownSigma1(0),
1039  fHistoResponseEleLambdaPtFeeddownSigma2(0),
1040  fHistoResponseEleLambdaPtLambdab(0),
1041  fHistoResponseElePtLambdab(0),
1042  fHistoResponseLambdaPtLambdab(0),
1043  fHistoResponseLambdaPt(0),
1044  fHistoResponseLambdaPtFeeddownXic0(0),
1045  fHistoResponseLambdaPtFeeddownXicPlus(0),
1046  fHistoResponseLambdaPtFeeddownSigma(0),
1047  fHistoResponseLambdaPtvsEleLambdaPt(0),
1048  fHistoResponseLambdaPtvsEleLambdaPtLambdab(0),
1049  fHistoResponseMcGenLambdabPtvsLambdacPt(0),
1050  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt(0),
1051  fHistoEleLambdaPtvsRapidityRS(0),
1052  fHistoEleLambdaPtvsRapidityWS(0),
1053  fHistoEleLambdaPtvsRapidityMCS(0),
1054  fHistoPi0MCGen(0),
1055  fHistoElectronPi0Total(0),
1056  fHistoElectronPi0Tag(0),
1057  fHistoEtaMCGen(0),
1058  fHistoElectronEtaTotal(0),
1059  fHistoElectronEtaTag(0),
1060  fCounter(0),
1061  fHistonEvtvsRunNumber(0),
1062  fHistonElevsRunNumber(0),
1063  fHistonLambdavsRunNumber(0),
1064  fHistoMCEventType(0),
1065  fHistoMCDeltaPhiccbar(0),
1066  fRefMult(9.26),
1067  fGTI(0),fGTIndex(0), fTrackBuffSize(19000),
1068  fHistodPhiSdEtaSElectronProtonR125RS(0),
1069  fHistodPhiSdEtaSElectronProtonR125WS(0),
1070  fHistodPhiSdEtaSElectronProtonR125RSMix(0),
1071  fHistodPhiSdEtaSElectronProtonR125WSMix(0),
1072  fHistodPhiSdEtaSElectronPionR125RS(0),
1073  fHistodPhiSdEtaSElectronPionR125WS(0),
1074  fHistodPhiSdEtaSElectronPionR125RSMix(0),
1075  fHistodPhiSdEtaSElectronPionR125WSMix(0),
1076  fDoSingleElectronAnalysis(kTRUE),
1077  fDoEventMixing(0),
1078  fMixWithoutConversionFlag(kFALSE),
1079  fNumberOfEventsForMixing (5),
1080  fNzVtxBins (0),
1081  fNCentBins (0),
1082  fNOfPools(1),
1083  fEventBuffer(0x0),
1084  fEventInfo(new TObjString("")),
1085  fElectronTracks(0x0),
1086  fV0Tracks1(0x0),
1087  fV0Tracks2(0x0),
1088  fElectronCutVarsArray(0x0),
1089  fV0CutVarsArray1(0x0),
1090  fV0CutVarsArray2(0x0),
1091  fHistoPoolNumberOfDumps(0),
1092  fHistoPoolNumberOfResets(0)
1093 {
1094  //
1096  //
1097  Info("AliAnalysisTaskSELc2eleLambdafromAODtracks","Calling Constructor");
1098 
1099  for(Int_t i=0;i<17;i++){
1100  fHistoElePtvsCutVarsRS[i] = 0;
1101  fHistoElePtvsCutVarsWS[i] = 0;
1102  fHistoElePtvsCutVarsMCS[i] = 0;
1103  }
1104  for(Int_t i=0;i<8;i++){
1106  }
1107  for(Int_t i=0; i<4; i++) fMultEstimatorAvg[i]=0;
1108 
1109  DefineOutput(1,TList::Class()); //conters
1110  DefineOutput(2,TList::Class());
1111  DefineOutput(3,TList::Class()); //conters
1112  DefineOutput(4,TTree::Class()); //My private output
1113  DefineOutput(5,TTree::Class()); //My private output
1114  DefineOutput(6,TTree::Class()); //My private output
1115  DefineOutput(7,TTree::Class()); //My private output
1116  DefineOutput(8,AliNormalizationCounter::Class());
1117  DefineOutput(9,TTree::Class()); //My private output
1118  DefineOutput(10,TTree::Class()); //My private output
1119  DefineOutput(11,TTree::Class()); //My private output
1120  DefineOutput(12,TTree::Class()); //My private output
1121 }
1122 
1123 //___________________________________________________________________________
1125  //
1127  //
1128  Info("~AliAnalysisTaskSELc2eleLambdafromAODtracks","Calling Destructor");
1129 
1130  if (fOutput) {
1131  delete fOutput;
1132  fOutput = 0;
1133  }
1134 
1135  if (fOutputAll) {
1136  delete fOutputAll;
1137  fOutputAll = 0;
1138  }
1139 
1140  if (fListCuts) {
1141  delete fListCuts;
1142  fListCuts = 0;
1143  }
1144 
1145 
1146  if (fAnalCuts) {
1147  delete fAnalCuts;
1148  fAnalCuts = 0;
1149  }
1150 
1151  if (fVariablesTree) {
1152  delete fVariablesTree;
1153  fVariablesTree = 0;
1154  }
1155  if (fEleVariablesTree) {
1156  delete fEleVariablesTree;
1157  fEleVariablesTree = 0;
1158  }
1159  if (fV0VariablesTree) {
1160  delete fV0VariablesTree;
1161  fV0VariablesTree = 0;
1162  }
1163  if (fMCVariablesTree) {
1164  delete fMCVariablesTree;
1165  fMCVariablesTree = 0;
1166  }
1167  if (fMCEleVariablesTree) {
1168  delete fMCEleVariablesTree;
1169  fMCEleVariablesTree = 0;
1170  }
1171  if (fMCV0VariablesTree) {
1172  delete fMCV0VariablesTree;
1173  fMCV0VariablesTree = 0;
1174  }
1176  delete fMCGenPairVariablesTree;
1178  }
1182  }
1183  if(fCounter){
1184  delete fCounter;
1185  fCounter = 0;
1186  }
1187 
1188  if(fElectronTracks) fElectronTracks->Delete();
1189  delete fElectronTracks;
1190  if(fV0Tracks1) fV0Tracks1->Delete();
1191  delete fV0Tracks1;
1192  if(fV0Tracks2) fV0Tracks2->Delete();
1193  delete fV0Tracks2;
1194  if(fEventBuffer){
1195  for(Int_t i=0; i<fNOfPools; i++) delete fEventBuffer[i];
1196  delete fEventBuffer;
1197  }
1198  delete fEventInfo;
1200  delete fElectronCutVarsArray;
1201  if(fV0CutVarsArray1) fV0CutVarsArray1->Delete();
1202  delete fV0CutVarsArray1;
1203  if(fV0CutVarsArray2) fV0CutVarsArray2->Delete();
1204  delete fV0CutVarsArray2;
1205 
1206  if (fGTI)
1207  delete[] fGTI;
1208  fGTI=0;
1209  if (fGTIndex)
1210  delete[] fGTIndex;
1211  fGTIndex=0;
1212 }
1213 
1214 //_________________________________________________
1216  //
1218  //
1219  //
1220 
1221  fIsEventSelected=kFALSE;
1222 
1223  if (fDebug > 1) AliInfo("Init");
1224 
1225  fListCuts = new TList();
1226  fListCuts->SetOwner();
1227  fListCuts->SetName("ListCuts");
1229  PostData(2,fListCuts);
1230 
1231  return;
1232 }
1233 
1234 //_________________________________________________
1236 {
1237  //
1239  //
1240 
1241  if (!fInputEvent) {
1242  AliError("NO EVENT FOUND!");
1243  return;
1244  }
1245  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
1246  fCEvents->Fill(1);
1247  fEvNumberCounter++;
1248 
1249  //------------------------------------------------
1250  // First check if the event has proper B
1251  //------------------------------------------------
1252 
1253  fBzkG = (Double_t)aodEvent->GetMagneticField();
1254  AliKFParticle::SetField(fBzkG);
1255  if (TMath::Abs(fBzkG)<0.001) {
1256  return;
1257  }
1258  fCEvents->Fill(2);
1259 
1260  Int_t countTr=0;
1261  Double_t countCorr=0;
1263  {
1264  AliAODTracklets* tracklets=aodEvent->GetTracklets();
1265  Int_t nTr=tracklets->GetNumberOfTracklets();
1266  for(Int_t iTr=0; iTr<nTr; iTr++){
1267  Double_t theta=tracklets->GetTheta(iTr);
1268  Double_t eta=-TMath::Log(TMath::Tan(theta/2.));
1269  if(eta>-1.0 && eta<1.0) countTr++;
1270  }
1271  AliAODVertex *vtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
1272  Bool_t isVtxOk=kFALSE;
1273  if(vtx1){
1274  if(vtx1->GetNContributors()>0){
1275  fCEvents->Fill(8);
1276  isVtxOk=kTRUE;
1277  }
1278  }
1279 
1280  countCorr=countTr;
1281  if(isVtxOk){
1282  TProfile* estimatorAvg = GetEstimatorHistogram(aodEvent);
1283  countCorr=static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,countTr,vtx1->GetZ(),fRefMult));
1284  }
1285  }
1286 
1287 
1289  fCounter->StoreEvent(aodEvent,fAnalCuts,fUseMCInfo,countCorr);
1290  }else{
1292  }
1294 
1295  //------------------------------------------------
1296  // MC analysis setting
1297  //------------------------------------------------
1298  TClonesArray *mcArray = 0;
1299  AliAODMCHeader *mcHeader=0;
1300  if (fUseMCInfo) {
1301  // MC array need for maching
1302  mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
1303  if (!mcArray) {
1304  AliError("Could not find Monte-Carlo in AOD");
1305  return;
1306  }
1307  fCEvents->Fill(6); // in case of MC events
1308 
1309  // load MC header
1310  mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1311  if (!mcHeader) {
1312  AliError("AliAnalysisTaskSELc2eleLambdafromAODtracks::UserExec: MC header branch not found!\n");
1313  return;
1314  }
1315  fCEvents->Fill(7); // in case of MC events
1316 
1317  Double_t zMCVertex = mcHeader->GetVtxZ();
1318  if (TMath::Abs(zMCVertex) > fAnalCuts->GetMaxVtxZ()) {
1319  AliDebug(2,Form("Event rejected: abs(zVtxMC)=%f > fAnalCuts->GetMaxVtxZ()=%f",zMCVertex,fAnalCuts->GetMaxVtxZ()));
1320  return;
1321  } else {
1322  fCEvents->Fill(17); // in case of MC events
1323  }
1324  if ((TMath::Abs(zMCVertex) < fAnalCuts->GetMaxVtxZ()) && (!fAnalCuts->IsEventRejectedDuePhysicsSelection()) && (!fAnalCuts->IsEventRejectedDueToTrigger())) {
1325  Bool_t selevt = MakeMCAnalysis(mcArray);
1326  if(!selevt) return;
1327  }
1328  }
1329 
1330  //------------------------------------------------
1331  // Event selection
1332  //------------------------------------------------
1333  fVtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
1334  if (!fVtx1) return;
1335 
1336  Double_t pos[3],cov[6];
1337  fVtx1->GetXYZ(pos);
1338  fVtx1->GetCovarianceMatrix(cov);
1339  fV1 = new AliESDVertex(pos,cov,100.,100,fVtx1->GetName());
1340  fVtxZ = pos[2];
1341 
1342  Bool_t fIsTriggerNotOK = fAnalCuts->IsEventRejectedDueToTrigger();
1343  if(!fIsTriggerNotOK) fCEvents->Fill(3);
1344  if(!fIsEventSelected) {
1345  delete fV1;
1346  return;
1347  }
1348  fCEvents->Fill(4);
1349 
1350  fHNTrackletvsZ->Fill(fVtxZ,countTr);
1351  fHNTrackletCorrvsZ->Fill(fVtxZ,countCorr);
1352 
1353  fIsMB=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kMB)==(AliVEvent::kMB);
1354  fIsSemi=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kSemiCentral)==(AliVEvent::kSemiCentral);
1355  fIsCent=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kCentral)==(AliVEvent::kCentral);
1356  fIsINT7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kINT7)==(AliVEvent::kINT7);
1357  fIsEMC7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kEMC7)==(AliVEvent::kEMC7);
1359  if(fIsMB) fHTrigger->Fill(1);
1360  if(fIsSemi) fHTrigger->Fill(2);
1361  if(fIsCent) fHTrigger->Fill(3);
1362  if(fIsINT7) fHTrigger->Fill(4);
1363  if(fIsEMC7) fHTrigger->Fill(5);
1364  if(fIsMB|fIsSemi|fIsCent) fHTrigger->Fill(7);
1365  if(fIsINT7|fIsEMC7) fHTrigger->Fill(8);
1366  if(fIsMB&fIsSemi) fHTrigger->Fill(10);
1367  if(fIsMB&fIsCent) fHTrigger->Fill(11);
1368  if(fIsINT7&fIsEMC7) fHTrigger->Fill(12);
1369 
1370  if(fUseCentralityV0M){
1371  AliCentrality *cent = aodEvent->GetCentrality();
1372  fCentrality = cent->GetCentralityPercentile("V0M");
1373  }else if(fUseCentralitySPDTracklet){
1374  if(countCorr>=0 && countCorr<=0) fCentrality = 5.;
1375  else if(countCorr>=1 && countCorr<=8) fCentrality = 15.;
1376  else if(countCorr>= 9 && countCorr<=13) fCentrality = 25.;
1377  else if(countCorr>=14 && countCorr<=19) fCentrality = 35.;
1378  else if(countCorr>=20 && countCorr<=30) fCentrality = 45.;
1379  else if(countCorr>=31 && countCorr<=49) fCentrality = 55.;
1380  else fCentrality = 65.;
1381  }else{
1382  fCentrality = 1.;
1383  }
1384  if(fCentrality<0.||fCentrality>100.-0.0000001) {
1385  delete fV1;
1386  return;
1387  }
1388  fHCentrality->Fill(fCentrality);
1389  fRunNumber = aodEvent->GetRunNumber();
1390 
1391  Int_t runnumber_offset = 0;
1392  Int_t runnumber = aodEvent->GetRunNumber();
1393  if(runnumber<=131000&&runnumber>=114000){
1394  runnumber_offset = 114000;//lhc10bcde
1395  }else if(runnumber<=196000&&runnumber>=195000){
1396  runnumber_offset = 195000;//lhc13bc
1397  }else if(runnumber<=170593&&runnumber>=167902){
1398  runnumber_offset = 167902;//lhc11h
1399  }
1400  fHistonEvtvsRunNumber->Fill(runnumber-runnumber_offset,1.);
1401 
1402  //------------------------------------------------
1403  // Check if the event has v0 candidate
1404  //------------------------------------------------
1405  //Int_t nv0 = aodEvent->GetNumberOfV0s();
1406  fCEvents->Fill(5);
1407 
1408 
1409  //------------------------------------------------
1410  // Main analysis done in this function
1411  //------------------------------------------------
1414  MakeAnalysis(aodEvent,mcArray);
1415 
1416 
1417  PostData(1,fOutput);
1418  PostData(3,fOutputAll);
1419  PostData(4,fVariablesTree);
1420  PostData(5,fEleVariablesTree);
1421  PostData(6,fV0VariablesTree);
1422  PostData(7,fMCVariablesTree);
1423  PostData(8,fCounter);
1424  PostData(9,fMCEleVariablesTree);
1425  PostData(10,fMCV0VariablesTree);
1426  PostData(11,fMCGenPairVariablesTree);
1427  PostData(12,fCorrelationVariablesTree);
1428 
1429  fIsEventSelected=kFALSE;
1430 
1431  delete fV1;
1432  return;
1433 }
1434 
1435 //________________________________________ terminate ___________________________
1437 {
1441 
1442  //AliInfo("Terminate","");
1443  AliAnalysisTaskSE::Terminate();
1444 
1445 
1446  fOutput = dynamic_cast<TList*> (GetOutputData(1));
1447  if (!fOutput) {
1448  AliError("fOutput not available");
1449  return;
1450  }
1451 
1452  fOutputAll = dynamic_cast<TList*> (GetOutputData(3));
1453  if (!fOutputAll) {
1454  AliError("fOutputAll not available");
1455  return;
1456  }
1457 
1458  return;
1459 }
1460 
1461 //___________________________________________________________________________
1463 {
1467  //AliInfo(Form("CreateOutputObjects of task %s\n", GetName()));
1468 
1469  //------------------------------------------------
1470  // output object setting
1471  //------------------------------------------------
1472  fOutput = new TList();
1473  fOutput->SetOwner();
1474  fOutput->SetName("chist0");
1475  DefineGeneralHistograms(); // define general histograms
1476  PostData(1,fOutput);
1477 
1478  fOutputAll = new TList();
1479  fOutputAll->SetOwner();
1480  fOutputAll->SetName("anahisto");
1481  DefineAnalysisHistograms(); // define general histograms
1482  PostData(3,fOutputAll);
1483 
1485  PostData(4,fVariablesTree);
1486 
1488  PostData(5,fEleVariablesTree);
1489 
1491  PostData(6,fV0VariablesTree);
1492 
1494  PostData(7,fMCVariablesTree);
1495 
1497  PostData(9,fMCEleVariablesTree);
1498 
1500  PostData(10,fMCV0VariablesTree);
1501 
1503  PostData(11,fMCGenPairVariablesTree);
1504 
1506  PostData(12,fCorrelationVariablesTree);
1507 
1508  //Counter for Normalization
1509  TString normName="NormalizationCounter";
1510  AliAnalysisDataContainer *cont = GetOutputSlot(8)->GetContainer();
1511  if(cont)normName=(TString)cont->GetName();
1512  fCounter = new AliNormalizationCounter(normName.Data());
1514  fCounter->SetStudyMultiplicity(kTRUE,1.);
1515  }
1516  fCounter->Init();
1517  PostData(8,fCounter);
1518 
1519  if(fDoEventMixing){
1520  fElectronTracks = new TObjArray();
1521  fElectronTracks->SetOwner();
1522  fV0Tracks1 = new TObjArray();
1523  fV0Tracks1->SetOwner();
1524  fV0Tracks2 = new TObjArray();
1525  fV0Tracks2->SetOwner();
1526  fElectronCutVarsArray = new TObjArray();
1527  fElectronCutVarsArray->SetOwner();
1528  fV0CutVarsArray1 = new TObjArray();
1529  fV0CutVarsArray1->SetOwner();
1530  fV0CutVarsArray2 = new TObjArray();
1531  fV0CutVarsArray2->SetOwner();
1532 
1534  fEventBuffer = new TTree*[fNOfPools];
1535  for(Int_t i=0; i<fNOfPools; i++){
1536  fEventBuffer[i]=new TTree(Form("EventBuffer_%d",i), "Temporary buffer for event mixing");
1537  fEventBuffer[i]->Branch("zVertex", &fVtxZ);
1538  fEventBuffer[i]->Branch("centrality", &fCentrality);
1539  fEventBuffer[i]->Branch("eventInfo", "TObjString",&fEventInfo);
1540  fEventBuffer[i]->Branch("v1array", "TObjArray", &fV0Tracks1);
1541  fEventBuffer[i]->Branch("v2array", "TObjArray", &fV0Tracks2);
1542  fEventBuffer[i]->Branch("v1varsarray", "TObjArray", &fV0CutVarsArray1);
1543  fEventBuffer[i]->Branch("v2varsarray", "TObjArray", &fV0CutVarsArray2);
1544  }
1545  }
1546 
1547  fGTI = new AliAODTrack *[fTrackBuffSize]; // Array of pointers
1548  fGTIndex = new Int_t [fTrackBuffSize]; // Array of index
1549 
1550  return;
1551 }
1552 
1553 //-------------------------------------------------------------------------------
1556  AliAODEvent *aodEvent, TClonesArray *mcArray
1557  )
1558 {
1559  //
1561  //
1562  if(fDoEventMixing){
1563  if(fElectronTracks) fElectronTracks->Delete();
1564  if(fV0Tracks1) fV0Tracks1->Delete();
1565  if(fV0Tracks2) fV0Tracks2->Delete();
1566  if(fElectronCutVarsArray) fElectronCutVarsArray->Delete();
1567  if(fV0CutVarsArray1) fV0CutVarsArray1->Delete();
1568  if(fV0CutVarsArray2) fV0CutVarsArray2->Delete();
1569  }
1570 
1571  ResetGlobalTrackReference();
1572  // ..and set it
1573  for (Int_t iTrack=0;iTrack<aodEvent->GetNumberOfTracks();iTrack++){
1574  // cast needed since the event now returns AliVTrack instead of AliAODTrack
1575  AliAODTrack *track = dynamic_cast<AliAODTrack *>(aodEvent->GetTrack(iTrack));
1576  if (!track) continue;
1577 
1578  // Store the reference of the global tracks
1579  StoreGlobalTrackReference(track,iTrack);
1580  }
1581 
1582  //------------------------------------------------
1583  // Select good track before hand to save time
1584  //------------------------------------------------
1585 
1586  Int_t nV0s= aodEvent->GetNumberOfV0s();
1587  Int_t nTracks= aodEvent->GetNumberOfTracks();
1588 
1589  Bool_t seleTrkFlags[nTracks];
1590  Int_t nSeleTrks=0;
1591  SelectTrack(aodEvent,nTracks,nSeleTrks,seleTrkFlags,mcArray);
1592 
1593  Bool_t seleV0Flags[nV0s];
1594  Int_t nSeleV0=0;
1595  SelectV0(aodEvent,nV0s,nSeleV0,seleV0Flags,mcArray);
1596 
1597  Int_t runnumber_offset = 0;
1598  Int_t runnumber = aodEvent->GetRunNumber();
1599  if(runnumber<=131000&&runnumber>=114000){
1600  runnumber_offset = 114000;//lhc10bcde
1601  }else if(runnumber<=196000&&runnumber>=195000){
1602  runnumber_offset = 195000;//lhc13bc
1603  }else if(runnumber<=170593&&runnumber>=167902){
1604  runnumber_offset = 167902;//lhc11h
1605  }
1606  fHistonElevsRunNumber->Fill(runnumber-runnumber_offset,nSeleTrks);
1607  fHistonLambdavsRunNumber->Fill(runnumber-runnumber_offset,nSeleV0);
1608 
1609  //------------------------------------------------
1610  // V0 loop
1611  //------------------------------------------------
1612  for (Int_t iv0 = 0; iv0<nV0s; iv0++) {
1613  if(!seleV0Flags[iv0]) continue;
1614  AliAODv0 *v0 = aodEvent->GetV0(iv0);
1615  if(!v0) continue;
1616 
1617  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
1618  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
1619 
1620  //------------------------------------------------
1621  // track loop
1622  //------------------------------------------------
1623  for (Int_t itrk = 0; itrk<nTracks; itrk++) {
1624  if(!seleTrkFlags[itrk]) continue;
1625  AliAODTrack *trk = (AliAODTrack*)aodEvent->GetTrack(itrk);
1626  //if(trk->GetID()<0) continue;
1627 
1628  //if(!fAnalCuts->SelectWithRoughCuts(v0,trk)) continue;
1629 
1630  //TPC only track (BIT 7) does not have PID information
1631  //In addition to that, TPC only tracks does not have good DCA resolution
1632  //(according to femtoscopy code)
1633  AliAODTrack *trkpid = 0;
1634  if(fAnalCuts->GetProdAODFilterBit()==7){
1635  trkpid = fGTI[-trk->GetID()-1];
1636  }else{
1637  trkpid = trk;
1638  }
1639 
1640  Int_t cpid = cptrack->GetID();
1641  Int_t cnid = cntrack->GetID();
1642  Int_t lpid = trkpid->GetID();
1643  if((cpid==lpid)||(cnid==lpid)) continue;
1644 
1645  AliAODVertex *secVert = ReconstructSecondaryVertex(v0,trk,aodEvent);//Fake, prim vertex is just used as secondary vertex. place holder for future
1646  if(!secVert) continue;
1647 
1648  AliAODRecoCascadeHF *elobj = MakeCascadeHF(v0,trk,trkpid,aodEvent,secVert);
1649  if(!elobj) {
1650  continue;
1651  }
1652 
1653  FillROOTObjects(elobj,v0,trk,trkpid,aodEvent,mcArray);
1654 
1655  elobj->GetSecondaryVtx()->RemoveDaughters();
1656  elobj->UnsetOwnPrimaryVtx();
1657  delete elobj;elobj=NULL;
1658  delete secVert;
1659  }
1660  }
1661 
1662  if(fDoSingleElectronAnalysis){
1663  //------------------------------------------------
1664  // track loop
1665  //------------------------------------------------
1666  for (Int_t itrk = 0; itrk<nTracks; itrk++) {
1667  if(!seleTrkFlags[itrk]) continue;
1668  AliAODTrack *trk = (AliAODTrack*)aodEvent->GetTrack(itrk);
1669 
1670  //TPC only track (BIT 7) does not have PID information
1671  //In addition to that, TPC only tracks does not have good DCA resolution
1672  //(according to femtoscopy code)
1673  AliAODTrack *trkpid = 0;
1674  if(fAnalCuts->GetProdAODFilterBit()==7){
1675  trkpid = fGTI[-trk->GetID()-1];
1676  }else{
1677  trkpid = trk;
1678  }
1679 
1680  Int_t nlam_near = 0;
1681  Int_t nantilam_near = 0;
1682  for (Int_t iv0 = 0; iv0<nV0s; iv0++) {
1683  if(!seleV0Flags[iv0]) continue;
1684  AliAODv0 *v0 = aodEvent->GetV0(iv0);
1685  if(!v0) continue;
1686  if(!fAnalCuts->IsPeakRegion(v0)) continue;
1687 
1688  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
1689  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
1690 
1691  Int_t cpid = cptrack->GetID();
1692  Int_t cnid = cntrack->GetID();
1693  Int_t lpid = trkpid->GetID();
1694  if((cpid==lpid)||(cnid==lpid)) continue;
1695 
1696  Bool_t anti_lambda_flag = kFALSE;
1697  if(fabs(v0->MassAntiLambda()-1.115683)<fAnalCuts->GetProdV0MassTolLambdaRough()) anti_lambda_flag = kTRUE;
1698 
1699  Double_t v0px = v0->Px();
1700  Double_t v0py = v0->Py();
1701  Double_t v0pt = v0->Pt();
1702  Double_t epx = trk->Px();
1703  Double_t epy = trk->Py();
1704  Double_t ept = trk->Pt();
1705  Double_t cosdphi = (v0px*epx+v0py*epy)/v0pt/ept;
1706  Double_t cosdphimin = cos(2.*(0.0690941+0.521911/ept));
1707 
1708  if(cosdphi>cosdphimin){
1709  if(anti_lambda_flag){
1710  nantilam_near++;
1711  }else{
1712  nlam_near++;
1713  }
1714  }
1715  }
1716 
1717  Double_t cont_se_nd[8];
1718  for(Int_t iv=0;iv<8;iv++){
1719  cont_se_nd[iv] = -9999.;
1720  }
1721 
1722  Double_t d0z0bach[2],covd0z0bach[3];
1723  Double_t d0[3],d0err[3];
1724  trk->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
1725 
1726  d0[0]= d0z0bach[0];
1727  d0err[0] = TMath::Sqrt(covd0z0bach[0]);
1728  cont_se_nd[0] = trk->Pt();
1729  if(fBzkG>0.)
1730  cont_se_nd[1] = d0[0]*trk->Charge();
1731  else
1732  cont_se_nd[1] = -1.*d0[0]*trk->Charge();
1733  cont_se_nd[2] = nlam_near;
1734  cont_se_nd[3] = nantilam_near;
1735  cont_se_nd[4] = trk->Charge();
1736  Double_t minmass_ee = 9999.;
1737  Bool_t isconv = fAnalCuts->TagConversions(trk,fGTIndex,aodEvent,aodEvent->GetNumberOfTracks(),minmass_ee);
1738  Double_t minmasslike_ee = 9999.;
1739  Bool_t isconv_like = fAnalCuts->TagConversionsSameSign(trk,fGTIndex,aodEvent,aodEvent->GetNumberOfTracks(),minmasslike_ee);
1740  cont_se_nd[5] = isconv + 2*isconv_like;
1741  cont_se_nd[6] = 0;
1742  cont_se_nd[7] = fCentrality;
1743 
1744  fHistoSingleElectronVariablesvsElePt->Fill(cont_se_nd);
1745 
1746  if(fUseMCInfo){
1747  Int_t pdgarray_ele[100];
1748  Int_t labelarray_ele[100];
1749  for(Int_t i=0;i<100;i++){
1750  pdgarray_ele[i] = -9999;
1751  labelarray_ele[i] = -9999;
1752  }
1753  Int_t ngen_ele = 0;
1754 
1755  Int_t labEle = trk->GetLabel();
1756 
1757  AliAODMCParticle *mcetrk = 0;
1758  if(labEle>-1) mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
1759 
1760  if(mcetrk){
1761  GetMCDecayHistory(mcetrk,mcArray,pdgarray_ele,labelarray_ele,ngen_ele);
1762  if(abs(pdgarray_ele[0])==4122) cont_se_nd[6] = 1;
1763  if(abs(pdgarray_ele[0])==4132) cont_se_nd[6] = 2;
1764  if(abs(pdgarray_ele[0])==4232) cont_se_nd[6] = 3;
1765  if(abs(pdgarray_ele[0])==5122) cont_se_nd[6] = 4;
1766  if(abs(pdgarray_ele[0])==5132) cont_se_nd[6] = 5;
1767  if(abs(pdgarray_ele[0])==5232) cont_se_nd[6] = 6;
1768  }
1769 
1770  fHistoSingleElectronVariablesvsElePtMC->Fill(cont_se_nd);
1771  }
1772 
1773  }
1774  }
1775 
1776  if(fDoEventMixing){
1777  fEventInfo->SetString(Form("Ev%d_esd%d_E%d_V%d",AliAnalysisManager::GetAnalysisManager()->GetNcalls(),((AliAODHeader*)aodEvent->GetHeader())->GetEventNumberESDFile(),fElectronTracks->GetEntries(),fV0Tracks1->GetEntries()+fV0Tracks2->GetEntries()));
1778  Int_t ind=GetPoolIndex(fVtxZ,fCentrality);
1779  if(ind>=0 && ind<fNOfPools){
1780  if(fEventBuffer[ind]->GetEntries() >= fNumberOfEventsForMixing){
1781  DoEventMixingWithPools(ind);
1782  if(fEventBuffer[ind]->GetEntries() >= 100*fNumberOfEventsForMixing){
1783  ResetPool(ind);
1784  fHistoPoolNumberOfResets->Fill(ind);
1785  }
1786  fHistoPoolNumberOfDumps->Fill(ind);
1787  }
1788  fEventBuffer[ind]->Fill();
1789  }
1790  }
1791 }
1794 {
1798 
1799  const char* nameoutput = GetOutputSlot(4)->GetContainer()->GetName();
1800  fVariablesTree = new TTree(nameoutput,"Candidates variables tree");
1801  Int_t nVar = 94;
1802  fCandidateVariables = new Float_t [nVar];
1803  TString * fCandidateVariableNames = new TString[nVar];
1804 
1805  fCandidateVariableNames[ 0]="Centrality";
1806  fCandidateVariableNames[ 1]="InvMassEleLambda";
1807  fCandidateVariableNames[ 2]="EleLambdaPt";
1808  fCandidateVariableNames[ 3]="EleLambdaPx";
1809  fCandidateVariableNames[ 4]="EleLambdaPy";
1810  fCandidateVariableNames[ 5]="EleLambdaPz";
1811  fCandidateVariableNames[ 6]="ElePx";
1812  fCandidateVariableNames[ 7]="ElePy";
1813  fCandidateVariableNames[ 8]="ElePz";
1814  fCandidateVariableNames[ 9]="V0Px";
1815  fCandidateVariableNames[10]="V0Py";
1816  fCandidateVariableNames[11]="V0Pz";
1817  fCandidateVariableNames[12]="AntiLambdaFlag";
1818  fCandidateVariableNames[13]="MassLambda";
1819  fCandidateVariableNames[14]="MassAntiLambda";
1820  fCandidateVariableNames[15]="Eled0";
1821  fCandidateVariableNames[16]="V0d0";
1822  fCandidateVariableNames[17]="nSigmaTPCele";
1823  fCandidateVariableNames[18]="nSigmaTOFele";
1824  fCandidateVariableNames[19]="nSigmaTPCv0pr";
1825  fCandidateVariableNames[20]="nSigmaTOFv0pr";
1826  fCandidateVariableNames[21]="EleCharge";
1827  fCandidateVariableNames[22]="ProtonPx";
1828  fCandidateVariableNames[23]="ProtonPy";
1829  fCandidateVariableNames[24]="ProtonPz";
1830  fCandidateVariableNames[25]="PiPx";
1831  fCandidateVariableNames[26]="PiPy";
1832  fCandidateVariableNames[27]="PiPz";
1833  fCandidateVariableNames[28]="mcpdglc";
1834  fCandidateVariableNames[29]="mclablc";
1835  fCandidateVariableNames[30]="mcpdgmomele";
1836  fCandidateVariableNames[31]="mcpdgmomv0";
1837  fCandidateVariableNames[32]="Mixing";
1838  fCandidateVariableNames[33]="mcpdgele";
1839  fCandidateVariableNames[34]="nSigmaTPCpr_etrk";
1840  fCandidateVariableNames[35]="nSigmaTOFpr_etrk";
1841  fCandidateVariableNames[36]="nSigmaTPCka_etrk";
1842  fCandidateVariableNames[37]="nSigmaTOFka_etrk";
1843  fCandidateVariableNames[38]="MassK0Short";
1844  fCandidateVariableNames[39]="mcpdggrmomele";
1845  fCandidateVariableNames[40]="mcpdggrmomv0";
1846  fCandidateVariableNames[41]="mcngenele";
1847  fCandidateVariableNames[42]="mcngenv0";
1848  fCandidateVariableNames[43]="mclcpx";
1849  fCandidateVariableNames[44]="mclcpy";
1850  fCandidateVariableNames[45]="mclcpz";
1851  fCandidateVariableNames[46]="mcelepx";
1852  fCandidateVariableNames[47]="mcelepy";
1853  fCandidateVariableNames[48]="mcelepz";
1854  fCandidateVariableNames[49]="mcv0px";
1855  fCandidateVariableNames[50]="mcv0py";
1856  fCandidateVariableNames[51]="mcv0pz";
1857  fCandidateVariableNames[52]="nSigmaTPCpi_etrk";
1858  fCandidateVariableNames[53]="nSigmaTOFpi_etrk";
1859  fCandidateVariableNames[54]="PrimVertx";
1860  fCandidateVariableNames[55]="PrimVerty";
1861  fCandidateVariableNames[56]="PrimVertz";
1862  fCandidateVariableNames[57]="V0Vertx";
1863  fCandidateVariableNames[58]="V0Verty";
1864  fCandidateVariableNames[59]="V0Vertz";
1865 
1866  fCandidateVariableNames[60]="DcaV0PrToPrimVertex";
1867  fCandidateVariableNames[61]="DcaV0PiToPrimVertex";
1868  fCandidateVariableNames[62]="DcaV0daughters";
1869  fCandidateVariableNames[63]="V0CosPointingAngle";
1870  fCandidateVariableNames[64]="V0ProperDecayLength";
1871  fCandidateVariableNames[65]="MassK0Short2";
1872 
1873  fCandidateVariableNames[66]="nSigmaTPCv0pi";
1874  fCandidateVariableNames[67]="nSigmaTOFv0pi";
1875 
1876  fCandidateVariableNames[68]= "EleITSMatch";
1877  fCandidateVariableNames[69]= "V0PosITSMatch";
1878  fCandidateVariableNames[70]= "V0NegITSMatch";
1879  fCandidateVariableNames[71]= "IsV0PeakRegion";
1880  fCandidateVariableNames[72]= "mcpdgv0";
1881 
1882  fCandidateVariableNames[73]= "mcv0pospx";
1883  fCandidateVariableNames[74]= "mcv0pospy";
1884  fCandidateVariableNames[75]= "mcv0pospz";
1885  fCandidateVariableNames[76]= "mcpdgv0pos";
1886  fCandidateVariableNames[77]= "mcv0negpx";
1887  fCandidateVariableNames[78]= "mcv0negpy";
1888  fCandidateVariableNames[79]= "mcv0negpz";
1889  fCandidateVariableNames[80]= "mcpdgv0neg";
1890 
1891  fCandidateVariableNames[81]= "ProtonPxPV";
1892  fCandidateVariableNames[82]= "ProtonPyPV";
1893  fCandidateVariableNames[83]= "ProtonPzPV";
1894  fCandidateVariableNames[84]= "PiPxPV";
1895  fCandidateVariableNames[85]= "PiPyPV";
1896  fCandidateVariableNames[86]= "PiPzPV";
1897 
1898  fCandidateVariableNames[87]= "mcv0vertx";
1899  fCandidateVariableNames[88]= "mcv0verty";
1900  fCandidateVariableNames[89]= "mcv0vertz";
1901 
1902  fCandidateVariableNames[90]="OnFlyStatus";
1903  fCandidateVariableNames[91]="MagneticField";
1904  fCandidateVariableNames[92]="EvNumber";
1905  fCandidateVariableNames[93]="RunNumber";
1906 
1907 
1908  for (Int_t ivar=0; ivar<nVar; ivar++) {
1909  fVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1910  }
1911 
1912  return;
1913 }
1914 
1916 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillROOTObjects(AliAODRecoCascadeHF *elobj, AliAODv0 *v0, AliAODTrack *trk, AliAODTrack *trkpid, AliAODEvent *event, TClonesArray *mcArray)
1917 {
1921  if(!trk) return;
1922  if(!trkpid) return;
1923  if(!v0) return;
1924 
1925  for(Int_t i=0;i<94;i++)
1926  {
1927  fCandidateVariables[i] = -9999.;
1928  }
1929 
1930  Bool_t anti_lambda_flag = kFALSE;
1931  if(fabs(v0->MassAntiLambda()-1.115683)<fAnalCuts->GetProdV0MassTolLambdaRough()) anti_lambda_flag = kTRUE;
1932 
1933  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
1934  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
1935 // if(cptrack->Charge()<0 && cntrack->Charge()>0){
1936 // cptrack = (AliAODTrack*)(v0->GetDaughter(1));
1937 // cntrack = (AliAODTrack*)(v0->GetDaughter(0));
1938 // }
1939 
1940  Double_t v0px = elobj->PxProng(1);
1941  Double_t v0py = elobj->PyProng(1);
1942  Double_t v0pz = elobj->PzProng(1);
1943  Double_t momv0 = sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz);
1944  Double_t Ev0 = sqrt(momv0*momv0+1.115683*1.115683);
1945  Double_t epx = elobj->PxProng(0);
1946  Double_t epy = elobj->PyProng(0);
1947  Double_t epz = elobj->PzProng(0);
1948  Double_t mome = sqrt(epx*epx+epy*epy+epz*epz);
1949  Double_t Ee = sqrt(mome*mome+0.000510998928*0.000510998928);
1950  Double_t cosoa = (v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz);
1951  Double_t Esum = Ee + Ev0;
1952 
1953  Double_t uxe = epx/mome;
1954  Double_t uye = epy/mome;
1955  Double_t uze = epz/mome;
1956  Double_t lf = -2.*(v0px*uxe+v0py*uye+v0pz*uze);
1957  Double_t pxv_flip = v0px + lf * uxe;
1958  Double_t pyv_flip = v0py + lf * uye;
1959  Double_t pzv_flip = v0pz + lf * uze;
1960  Double_t pxsum_flip = epx + pxv_flip;
1961  Double_t pysum_flip = epy + pyv_flip;
1962  Double_t pzsum_flip = epz + pzv_flip;
1963  Double_t melam_flip = sqrt(Esum*Esum-pxsum_flip*pxsum_flip-pysum_flip*pysum_flip-pzsum_flip*pzsum_flip);
1964  Double_t ptelam_flip = sqrt(pxsum_flip*pxsum_flip+pysum_flip*pysum_flip);
1965 
1966  Double_t minmass_ee = 9999.;
1967  Bool_t isconv = fAnalCuts->TagConversions(trk,fGTIndex,(AliAODEvent*)event,event->GetNumberOfTracks(),minmass_ee);
1968  Double_t minmasslike_ee = 9999.;
1969  Bool_t isconv_like = fAnalCuts->TagConversionsSameSign(trk,fGTIndex,(AliAODEvent*)event,event->GetNumberOfTracks(),minmasslike_ee);
1970 
1972  UInt_t pdgdg[2]={11,3122};
1973  fCandidateVariables[ 1] = elobj->InvMass(2,pdgdg);
1974  fCandidateVariables[ 2] = elobj->Pt();
1975  fCandidateVariables[ 3] = elobj->Px();
1976  fCandidateVariables[ 4] = elobj->Py();
1977  fCandidateVariables[ 5] = elobj->Pz();
1978  fCandidateVariables[ 6] = elobj->PxProng(0);
1979  fCandidateVariables[ 7] = elobj->PyProng(0);
1980  fCandidateVariables[ 8] = elobj->PzProng(0);
1981  fCandidateVariables[ 9] = elobj->PxProng(1);
1982  fCandidateVariables[10] = elobj->PyProng(1);
1983  fCandidateVariables[11] = elobj->PzProng(1);
1984  fCandidateVariables[12] = anti_lambda_flag;
1985  fCandidateVariables[13] = v0->MassLambda();
1986  fCandidateVariables[14] = v0->MassAntiLambda();
1987  fCandidateVariables[15] = elobj->Getd0Prong(0);
1988  fCandidateVariables[16] = elobj->Getd0Prong(1);
1989 
1990  Double_t nSigmaTPCele=-9999.;
1991  Double_t nSigmaTOFele=-9999.;
1992  Double_t nSigmaTPCv0pr=-9999.;
1993  Double_t nSigmaTOFv0pr=-9999.;
1994  Double_t nSigmaTPCv0pi=-9999.;
1995  Double_t nSigmaTOFv0pi=-9999.;
1996  if(fAnalCuts->GetIsUsePID())
1997  {
1998  nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kElectron);
1999  nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kElectron);
2000  fCandidateVariables[17] = nSigmaTPCele;
2001  fCandidateVariables[18] = nSigmaTOFele;
2002  }
2003 
2004  if(fAnalCuts->GetUseLambdaPID())
2005  {
2006  if(anti_lambda_flag){
2007  nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
2008  nSigmaTOFv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kProton);
2009  nSigmaTPCv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
2010  nSigmaTOFv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kPion);
2011  }else{
2012  nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
2013  nSigmaTOFv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kProton);
2014  nSigmaTPCv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
2015  nSigmaTOFv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kPion);
2016  }
2017  fCandidateVariables[19] = nSigmaTPCv0pr;
2018  fCandidateVariables[20] = nSigmaTOFv0pr;
2019  fCandidateVariables[66] = nSigmaTPCv0pi;
2020  fCandidateVariables[67] = nSigmaTOFv0pi;
2021  }
2022  fCandidateVariables[21] = trk->Charge();
2023 
2024  if(anti_lambda_flag){
2025  fCandidateVariables[22] = v0->MomNegX(); //cntrack->Px();
2026  fCandidateVariables[23] = v0->MomNegY(); //cntrack->Py();
2027  fCandidateVariables[24] = v0->MomNegZ(); //cntrack->Pz();
2028  fCandidateVariables[25] = v0->MomPosX(); //cptrack->Px();
2029  fCandidateVariables[26] = v0->MomPosY(); //cptrack->Py();
2030  fCandidateVariables[27] = v0->MomPosZ(); //cptrack->Pz();
2031  }else{
2032  fCandidateVariables[22] = v0->MomPosX(); //cptrack->Px();
2033  fCandidateVariables[23] = v0->MomPosY(); //cptrack->Py();
2034  fCandidateVariables[24] = v0->MomPosZ(); //cptrack->Pz();
2035  fCandidateVariables[25] = v0->MomNegX(); //cntrack->Px();
2036  fCandidateVariables[26] = v0->MomNegY(); //cntrack->Py();
2037  fCandidateVariables[27] = v0->MomNegZ(); //cntrack->Pz();
2038  }
2039 
2040  AliAODMCParticle *mclc = 0;
2041  AliAODMCParticle *mcele = 0;
2042  AliAODMCParticle *mcv0 = 0;
2043  Int_t mclablc = 0;
2044  Int_t mcpdgele_array[100];
2045  Int_t mcpdgv0_array[100];
2046  Int_t mclabelele_array[100];
2047  Int_t mclabelv0_array[100];
2048  Int_t mcngen_ele=-9999;
2049  Int_t mcngen_v0=-9999;
2050 
2051  if(fUseMCInfo && mcArray){
2052  mclablc = MatchToMC(elobj,mcArray,mcpdgele_array, mcpdgv0_array,mclabelele_array,mclabelv0_array,mcngen_ele,mcngen_v0);
2053  if(mclabelele_array[0]>=0){
2054  mcele = (AliAODMCParticle*) mcArray->At(mclabelele_array[0]);
2055  if(mcele){
2056  fCandidateVariables[46] = mcele->Px();
2057  fCandidateVariables[47] = mcele->Py();
2058  fCandidateVariables[48] = mcele->Pz();
2059  }
2060  }
2061  if(mclabelv0_array[0]>=0){
2062  mcv0 = (AliAODMCParticle*) mcArray->At(mclabelv0_array[0]);
2063  if(mcv0){
2064  fCandidateVariables[49] = mcv0->Px();
2065  fCandidateVariables[50] = mcv0->Py();
2066  fCandidateVariables[51] = mcv0->Pz();
2067  fCandidateVariables[72] = mcv0->GetPdgCode();
2068  }
2069  }else{
2070  Int_t pdgdgv0[2]={211,211};
2071  Int_t labV0 = v0->MatchToMC(310,mcArray,2,pdgdgv0); // the V0
2072  if(labV0>=0){
2073  mcv0 = (AliAODMCParticle*) mcArray->At(labV0);
2074  if(mcv0){
2075  fCandidateVariables[49] = mcv0->Px();
2076  fCandidateVariables[50] = mcv0->Py();
2077  fCandidateVariables[51] = mcv0->Pz();
2078  fCandidateVariables[72] = mcv0->GetPdgCode();
2079  }
2080  }
2081  }
2082 
2083  Int_t labPos = cptrack->GetLabel();
2084  if(labPos>=0){
2085  AliAODMCParticle *mcv0pos = (AliAODMCParticle*)mcArray->At(labPos);
2086  fCandidateVariables[73] = mcv0pos->Px();
2087  fCandidateVariables[74] = mcv0pos->Py();
2088  fCandidateVariables[75] = mcv0pos->Pz();
2089  fCandidateVariables[76] = mcv0pos->GetPdgCode();
2090  fCandidateVariables[87] = mcv0pos->Xv();
2091  fCandidateVariables[88] = mcv0pos->Yv();
2092  fCandidateVariables[89] = mcv0pos->Zv();
2093  }
2094  Int_t labNeg = cntrack->GetLabel();
2095  if(labNeg>=0){
2096  AliAODMCParticle *mcv0neg = (AliAODMCParticle*)mcArray->At(labNeg);
2097  fCandidateVariables[77] = mcv0neg->Px();
2098  fCandidateVariables[78] = mcv0neg->Py();
2099  fCandidateVariables[79] = mcv0neg->Pz();
2100  fCandidateVariables[80] = mcv0neg->GetPdgCode();
2101  }
2102 
2103  if(mclablc>-1){
2104  mclc = (AliAODMCParticle*) mcArray->At(mclablc);
2105  if(mclc){
2106  fCandidateVariables[28] = mclc->GetPdgCode();
2107  fCandidateVariables[29] = mclc->Label();
2108  fCandidateVariables[43] = mclc->Px();
2109  fCandidateVariables[44] = mclc->Py();
2110  fCandidateVariables[45] = mclc->Pz();
2111  }
2112  }
2113  fCandidateVariables[30] = mcpdgele_array[1];
2114  fCandidateVariables[31] = mcpdgv0_array[1];
2115  fCandidateVariables[33] = mcpdgele_array[0];
2116  fCandidateVariables[39] = mcpdgele_array[2];
2117  fCandidateVariables[40] = mcpdgv0_array[2];
2118  fCandidateVariables[41] = mcngen_ele;
2119  fCandidateVariables[42] = mcngen_v0;
2120  }
2121  fCandidateVariables[32] = 0;
2122 
2123  if(fAnalCuts->GetIsUsePID())
2124  {
2125  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kProton);
2126  Double_t nSigmaTOFpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kProton);
2127  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kKaon);
2128  Double_t nSigmaTOFka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kKaon);
2129  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kPion);
2130  Double_t nSigmaTOFpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kPion);
2131  fCandidateVariables[34] = nSigmaTPCpr_etrk;
2132  fCandidateVariables[35] = nSigmaTOFpr_etrk;
2133  fCandidateVariables[36] = nSigmaTPCka_etrk;
2134  fCandidateVariables[37] = nSigmaTOFka_etrk;
2135  fCandidateVariables[52] = nSigmaTPCpi_etrk;
2136  fCandidateVariables[53] = nSigmaTOFpi_etrk;
2137  }
2138  fCandidateVariables[38] = v0->MassK0Short();
2139 
2140  fCandidateVariables[54] = fVtx1->GetX();
2141  fCandidateVariables[55] = fVtx1->GetY();
2142  fCandidateVariables[56] = fVtx1->GetZ();
2143  fCandidateVariables[57] = v0->DecayVertexV0X();
2144  fCandidateVariables[58] = v0->DecayVertexV0Y();
2145  fCandidateVariables[59] = v0->DecayVertexV0Z();
2146 
2147  Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
2148  Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
2149  if(!anti_lambda_flag){
2150  fCandidateVariables[60] = lDcaPosToPrimVertex;
2151  fCandidateVariables[61] = lDcaNegToPrimVertex;
2152  }else{
2153  fCandidateVariables[60] = lDcaNegToPrimVertex;
2154  fCandidateVariables[61] = lDcaPosToPrimVertex;
2155  }
2156  fCandidateVariables[62] = v0->DcaV0Daughters();
2157  Double_t posVtx[3] = {0.,0.,0.};
2158  fVtx1->GetXYZ(posVtx);
2159  fCandidateVariables[63] = v0->CosPointingAngle(posVtx);
2160  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
2161  fCandidateVariables[64] = v0->DecayLengthV0(posVtx)*1.1157/ptotlam;
2162  fCandidateVariables[65] = v0->MassK0Short();
2163 
2164  if(trk) fCandidateVariables[68] = trk->GetITSClusterMap();
2165  if(cptrack) fCandidateVariables[69] = cptrack->GetITSClusterMap();
2166  if(cntrack) fCandidateVariables[70] = cntrack->GetITSClusterMap();
2167 
2169 
2170  if(!anti_lambda_flag){
2171  fCandidateVariables[81] = cptrack->Px();
2172  fCandidateVariables[82] = cptrack->Py();
2173  fCandidateVariables[83] = cptrack->Pz();
2174  fCandidateVariables[84] = cntrack->Px();
2175  fCandidateVariables[85] = cntrack->Py();
2176  fCandidateVariables[86] = cntrack->Pz();
2177  }else{
2178  fCandidateVariables[81] = cntrack->Px();
2179  fCandidateVariables[82] = cntrack->Py();
2180  fCandidateVariables[83] = cntrack->Pz();
2181  fCandidateVariables[84] = cptrack->Px();
2182  fCandidateVariables[85] = cptrack->Py();
2183  fCandidateVariables[86] = cptrack->Pz();
2184  }
2185  fCandidateVariables[90] = v0->GetOnFlyStatus();
2186 
2187  fCandidateVariables[91] = fBzkG;
2190 
2191 
2192 // if(fWriteVariableTree)
2193 // fVariablesTree->Fill();
2194 
2195  Double_t dphis_ele_pr, detas_ele_pr,dphis_ele_pi, detas_ele_pi;
2196  dphis_ele_pr = 9999.;detas_ele_pr = 9999.;dphis_ele_pi = 9999.;detas_ele_pi = 9999.;
2197  //fAnalCuts->GetdPhiSdEtaSR125(trk,cptrack,cntrack,fBzkG,posVtx, dphis_ele_pr,detas_ele_pr,dphis_ele_pi,detas_ele_pi);
2198 
2199  Double_t cont[3];
2200  cont[0] = elobj->InvMass(2,pdgdg);
2201  cont[1] = elobj->Pt();
2202  cont[2] = fCentrality;
2203  fHistoEleLambdaMass->Fill(cont);
2204 
2205  Double_t cont_flip[3];
2206  cont_flip[0] = melam_flip;
2207  cont_flip[1] = ptelam_flip;
2208  cont_flip[2] = fCentrality;
2209 
2210  Double_t cont2[3];
2211  cont2[0] = elobj->InvMass(2,pdgdg);
2212  cont2[1] = trk->Pt();
2213  cont2[2] = fCentrality;
2214  Double_t cont_eleptvseta[3];
2215  cont_eleptvseta[0] = trk->Pt();
2216  cont_eleptvseta[1] = trk->Eta();
2217  cont_eleptvseta[2] = fCentrality;
2218 
2219  Double_t cont_eleptvslambdapt[3];
2220  cont_eleptvslambdapt[0] = trk->Pt();
2221  cont_eleptvslambdapt[1] = v0->Pt();
2222  cont_eleptvslambdapt[2] = fCentrality;
2223 
2224  Double_t cont_eleptvsd0[3];
2225  cont_eleptvsd0[0] = trk->Pt();
2226  cont_eleptvsd0[1] = elobj->Getd0Prong(0)*trk->Charge();
2227  cont_eleptvsd0[2] = fCentrality;
2228 
2229  Double_t cont_eleptvsv0dl[3];
2230  cont_eleptvsv0dl[0] = trk->Pt();
2231  cont_eleptvsv0dl[1] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;
2232  cont_eleptvsv0dl[2] = fCentrality;
2233 
2234  Double_t cont_elelamptvsv0dl[4];
2235  cont_elelamptvsv0dl[0] = elobj->Pt();
2236  cont_elelamptvsv0dl[1] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;
2237  cont_elelamptvsv0dl[2] = elobj->Getd0Prong(0)*trk->Charge();
2238  cont_elelamptvsv0dl[3] = fCentrality;
2239 
2240  Double_t cont_elelamptvsv0dl_flip[4];
2241  cont_elelamptvsv0dl_flip[0] = ptelam_flip;
2242  cont_elelamptvsv0dl_flip[1] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;
2243  cont_elelamptvsv0dl_flip[2] = 0.0;
2244  cont_elelamptvsv0dl_flip[3] = fCentrality;
2245 
2246 
2247  Double_t cont_eleptvsv0dca[3];
2248  cont_eleptvsv0dca[0] = trk->Pt();
2249  cont_eleptvsv0dca[1] = v0->DcaV0ToPrimVertex();
2250  cont_eleptvsv0dca[2] = fCentrality;
2251 
2252  Double_t elobj_mass = elobj->InvMass(2,pdgdg);
2253  Double_t elobj_px = elobj->Px();
2254  Double_t elobj_py = elobj->Py();
2255  Double_t elobj_pz = elobj->Pz();
2256  Double_t elobj_E = sqrt(elobj_mass*elobj_mass+elobj_px*elobj_px+elobj_py*elobj_py+elobj_pz*elobj_pz);
2257  Double_t elobj_rap = 0.5*log((elobj_E+elobj_pz)/(elobj_E-elobj_pz));
2258 
2259  //
2260  // Old strategy only look at mass and pairpt
2261  //
2263  {
2264  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
2265  fHistoEleLambdaMassRS->Fill(cont);
2266  if(trk->Charge()>0) fHistoEleLambdaMassRS1->Fill(cont);
2267  else fHistoEleLambdaMassRS2->Fill(cont);
2268 
2269  fHistoEleLambdaMassvsElePtRS->Fill(cont2);
2270  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtRS1->Fill(cont2);
2271  else fHistoEleLambdaMassvsElePtRS2->Fill(cont2);
2272  if(cont[0]<2.3){
2273  fHistoEleLambdaPtvsRapidityRS->Fill(elobj->Pt(),elobj_rap);
2274  fHistoElePtRS->Fill(trk->Pt(),fCentrality);
2275  fHistoElePtvsEtaRS->Fill(cont_eleptvseta);
2276  fHistoElePtvsLambdaPtRS->Fill(cont_eleptvslambdapt);
2277  fHistoElePtvsd0RS->Fill(cont_eleptvsd0);
2278 
2279  fHistoElePtvsV0dlRS->Fill(cont_eleptvsv0dl);
2280  if(trk->Charge()>0) fHistoElePtvsV0dlRS1->Fill(cont_eleptvsv0dl);
2281  else fHistoElePtvsV0dlRS2->Fill(cont_eleptvsv0dl);
2282 
2283  fHistoEleLambdaPtvsV0dlRS->Fill(cont_elelamptvsv0dl);
2284  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRS1->Fill(cont_elelamptvsv0dl);
2285  else fHistoEleLambdaPtvsV0dlRS2->Fill(cont_elelamptvsv0dl);
2286 
2287  fHistoElePtvsV0dcaRS->Fill(cont_eleptvsv0dca);
2288  if(trk->Charge()>0) fHistoElePtvsV0dcaRS1->Fill(cont_eleptvsv0dca);
2289  else fHistoElePtvsV0dcaRS2->Fill(cont_eleptvsv0dca);
2290 
2291  for(Int_t ih=0;ih<17;ih++){
2292  Double_t cont_eleptvscutvars[3];
2293  cont_eleptvscutvars[0] = elobj->Pt();
2294  cont_eleptvscutvars[2] = fCentrality;
2295 
2296  if(ih==0){
2297  cont_eleptvscutvars[1] = trk->GetTPCNcls();
2298  }else if(ih==1){
2299  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
2300  }else if(ih==2){
2301  cont_eleptvscutvars[1] = nSigmaTPCele;
2302  }else if(ih==3){
2303  cont_eleptvscutvars[1] = nSigmaTOFele;
2304  }else if(ih==4){
2305  cont_eleptvscutvars[1] = trk->Eta();
2306  }else if(ih==5){
2307  cont_eleptvscutvars[1] = trk->GetITSNcls();
2308  }else if(ih==6){
2309  if(!anti_lambda_flag)
2310  cont_eleptvscutvars[1] = v0->MassLambda();
2311  else
2312  cont_eleptvscutvars[1] = v0->MassAntiLambda();
2313  }else if(ih==7){
2314  Double_t lPosV0[3];
2315  lPosV0[0] = v0->DecayVertexV0X();
2316  lPosV0[1] = v0->DecayVertexV0Y();
2317  lPosV0[2] = v0->DecayVertexV0Z();
2318  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
2319  }else if(ih==8){
2320  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
2321  }else if(ih==9){
2322  if(!anti_lambda_flag)
2323  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2324  else
2325  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2326  }else if(ih==10){
2327  if(!anti_lambda_flag)
2328  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2329  else
2330  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2331  }else if(ih==11){
2332  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
2333  }else if(ih==12){
2334  cont_eleptvscutvars[1] = v0->MassK0Short();
2335  }else if(ih==13){
2336  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
2337  }else if(ih==14){
2338  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
2339  }else if(ih==15){
2340  cont_eleptvscutvars[1] = v0->Eta();
2341  }else if(ih==16){
2342  Double_t v0px = elobj->PxProng(1);
2343  Double_t v0py = elobj->PyProng(1);
2344  Double_t v0pz = elobj->PzProng(1);
2345  Double_t epx = elobj->PxProng(0);
2346  Double_t epy = elobj->PyProng(0);
2347  Double_t epz = elobj->PzProng(0);
2348  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
2349  }else{
2350  cont_eleptvscutvars[1] = -9999.;
2351  }
2352 
2353  fHistoElePtvsCutVarsRS[ih]->Fill(cont_eleptvscutvars);
2354  }
2355  }
2356  if(fUseMCInfo){
2357  if(mclc){
2358  Int_t pdgcode = mclc->GetPdgCode();
2359  Double_t cont_mclc[3];
2360  cont_mclc[0] = mclc->Pt();
2361  cont_mclc[1] = mclc->Y();
2362  cont_mclc[2] = fCentrality;
2363  Double_t cont_mcele[3];
2364  cont_mcele[0] = mcele->Pt();
2365  cont_mcele[1] = mcele->Eta();
2366  cont_mcele[2] = fCentrality;
2367 
2368  Int_t labmotherlc = mclc->GetMother();
2369  Bool_t isbottomfd = kFALSE;
2370  if(labmotherlc>=0){
2371  AliAODMCParticle *motherlc = (AliAODMCParticle*)mcArray->At(labmotherlc);
2372  Int_t pdgmotherlc = motherlc->GetPdgCode();
2373  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){
2374  isbottomfd = kTRUE;
2375  }
2376  }
2377  cont2[1] = mcele->Pt();
2378 
2379  if(abs(pdgcode)==4122 && abs(mcpdgele_array[1])==4122 && abs(mcpdgv0_array[1])==4122){
2380  fHistoEleLambdaMassMCS->Fill(cont);
2381  fHistoEleLambdaMassvsElePtMCS->Fill(cont2);
2382  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtMCS1->Fill(cont2);
2383  else fHistoEleLambdaMassvsElePtMCS2->Fill(cont2);
2384  if(cont[0]<2.3){
2385  fHistoEleLambdaPtvsRapidityMCS->Fill(elobj->Pt(),elobj_rap);
2386  fHistoElePtMCS->Fill(trk->Pt(),fCentrality);
2387  fHistoElePtvsEtaMCS->Fill(cont_eleptvseta);
2388  fHistoElePtvsLambdaPtMCS->Fill(cont_eleptvslambdapt);
2389  fHistoElePtvsd0MCS->Fill(cont_eleptvsd0);
2390 
2391  fHistoElePtvsV0dlMCS->Fill(cont_eleptvsv0dl);
2392  if(trk->Charge()>0) fHistoElePtvsV0dlMCS1->Fill(cont_eleptvsv0dl);
2393  else fHistoElePtvsV0dlMCS2->Fill(cont_eleptvsv0dl);
2394 
2395  fHistoElePtvsV0dcaMCS->Fill(cont_eleptvsv0dca);
2396  if(trk->Charge()>0) fHistoElePtvsV0dcaMCS1->Fill(cont_eleptvsv0dca);
2397  else fHistoElePtvsV0dcaMCS2->Fill(cont_eleptvsv0dca);
2398 
2399  fHistoEleLambdaPtvsV0dlMCS->Fill(cont_elelamptvsv0dl);
2400  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlMCS1->Fill(cont_elelamptvsv0dl);
2401  else fHistoEleLambdaPtvsV0dlMCS2->Fill(cont_elelamptvsv0dl);
2402 
2403  if(isbottomfd){
2404  fHistoEleLambdaPtvsV0dlBFeeddownMCS->Fill(cont_elelamptvsv0dl);
2405  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlBFeeddownMCS1->Fill(cont_elelamptvsv0dl);
2406  else fHistoEleLambdaPtvsV0dlBFeeddownMCS2->Fill(cont_elelamptvsv0dl);
2407  }else{
2408  fHistoEleLambdaPtvsV0dlPromptMCS->Fill(cont_elelamptvsv0dl);
2409  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlPromptMCS1->Fill(cont_elelamptvsv0dl);
2410  else fHistoEleLambdaPtvsV0dlPromptMCS2->Fill(cont_elelamptvsv0dl);
2411  }
2412 
2413  fHistoLcMCS->Fill(cont_mclc);
2414  if(trk->Charge()>0) fHistoLcMCS1->Fill(cont_mclc);
2415  else fHistoLcMCS2->Fill(cont_mclc);
2416 
2417  fHistoLcElectronMCS->Fill(cont_mcele);
2418  if(trk->Charge()>0) fHistoLcElectronMCS1->Fill(cont_mcele);
2419  else fHistoLcElectronMCS2->Fill(cont_mcele);
2420 
2421  fHistoResponseElePt->Fill(mclc->Pt(),trk->Pt());
2422  if(trk->Charge()>0) fHistoResponseElePt1->Fill(mclc->Pt(),trk->Pt());
2423  else fHistoResponseElePt2->Fill(mclc->Pt(),trk->Pt());
2424  fHistoResponseEleLambdaPt->Fill(mclc->Pt(),elobj->Pt());
2425  if(trk->Charge()>0) fHistoResponseEleLambdaPt1->Fill(mclc->Pt(),trk->Pt());
2426  else fHistoResponseEleLambdaPt2->Fill(mclc->Pt(),trk->Pt());
2427 
2428  fHistoResponseLambdaPt->Fill(mclc->Pt(),v0->Pt());
2429  fHistoResponseLambdaPtvsEleLambdaPt->Fill(elobj->Pt(),v0->Pt());
2430 
2431  Double_t cont_eleptvslambdaptvslcpt[4];
2432  cont_eleptvslambdaptvslcpt[0] = cont_eleptvslambdapt[0];
2433  cont_eleptvslambdaptvslcpt[1] = cont_eleptvslambdapt[1];
2434  cont_eleptvslambdaptvslcpt[2] = mclc->Pt();
2435  cont_eleptvslambdaptvslcpt[3] = cont_eleptvslambdapt[2];
2436  fHistoElePtvsLambdaPtvsLcPtMCS->Fill(cont_eleptvslambdaptvslcpt);
2437 
2438  Double_t cont_allpt[4];
2439  cont_allpt[0] = mclc->Pt();
2440  cont_allpt[1] = elobj->Pt();
2441  cont_allpt[2] = trk->Pt();
2442  cont_allpt[3] = v0->Pt();
2443  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt->Fill(cont_allpt);
2444 
2445  if(isbottomfd){
2446  fHistoElePtvsd0BFeeddownMCS->Fill(cont_eleptvsd0);
2447  }else{
2448  fHistoElePtvsd0PromptMCS->Fill(cont_eleptvsd0);
2449  }
2450 
2451  for(Int_t ih=0;ih<17;ih++){
2452  Double_t cont_eleptvscutvars[3];
2453  cont_eleptvscutvars[0] = elobj->Pt();
2454  cont_eleptvscutvars[2] = fCentrality;
2455 
2456  if(ih==0){
2457  cont_eleptvscutvars[1] = trk->GetTPCNcls();
2458  }else if(ih==1){
2459  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
2460  }else if(ih==2){
2461  cont_eleptvscutvars[1] = nSigmaTPCele;
2462  }else if(ih==3){
2463  cont_eleptvscutvars[1] = nSigmaTOFele;
2464  }else if(ih==4){
2465  cont_eleptvscutvars[1] = trk->Eta();
2466  }else if(ih==5){
2467  cont_eleptvscutvars[1] = trk->GetITSNcls();
2468  }else if(ih==6){
2469  if(!anti_lambda_flag)
2470  cont_eleptvscutvars[1] = v0->MassLambda();
2471  else
2472  cont_eleptvscutvars[1] = v0->MassAntiLambda();
2473  }else if(ih==7){
2474  Double_t lPosV0[3];
2475  lPosV0[0] = v0->DecayVertexV0X();
2476  lPosV0[1] = v0->DecayVertexV0Y();
2477  lPosV0[2] = v0->DecayVertexV0Z();
2478  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
2479  }else if(ih==8){
2480  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
2481  }else if(ih==9){
2482  if(!anti_lambda_flag)
2483  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2484  else
2485  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2486  }else if(ih==10){
2487  if(!anti_lambda_flag)
2488  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2489  else
2490  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2491  }else if(ih==11){
2492  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
2493  }else if(ih==12){
2494  cont_eleptvscutvars[1] = v0->MassK0Short();
2495  }else if(ih==13){
2496  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
2497  }else if(ih==14){
2498  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
2499  }else if(ih==15){
2500  cont_eleptvscutvars[1] = v0->Eta();
2501  }else if(ih==16){
2502  Double_t v0px = elobj->PxProng(1);
2503  Double_t v0py = elobj->PyProng(1);
2504  Double_t v0pz = elobj->PzProng(1);
2505  Double_t epx = elobj->PxProng(0);
2506  Double_t epy = elobj->PyProng(0);
2507  Double_t epz = elobj->PzProng(0);
2508  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
2509  }else{
2510  cont_eleptvscutvars[1] = -9999.;
2511  }
2512 
2513  fHistoElePtvsCutVarsMCS[ih]->Fill(cont_eleptvscutvars);
2514  }
2515  }
2516  }
2517  if(abs(pdgcode)==4132 && abs(mcpdgele_array[1])==4132 && abs(mcpdgv0_array[1])==3312){
2520  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtFeeddownXic0MCS1->Fill(cont2);
2522  if(cont[0]<2.3){
2523  fHistoFeedDownXic0MCS->Fill(cont_mclc);
2524  if(trk->Charge()>0) fHistoFeedDownXic0MCS1->Fill(cont_mclc);
2525  else fHistoFeedDownXic0MCS2->Fill(cont_mclc);
2526 
2527  fHistoElectronFeedDownXic0MCS->Fill(cont_mcele);
2528  if(trk->Charge()>0) fHistoElectronFeedDownXic0MCS1->Fill(cont_mcele);
2529  else fHistoElectronFeedDownXic0MCS2->Fill(cont_mcele);
2530 
2531  fHistoElePtvsV0dlFeedDownXic0MCS->Fill(cont_eleptvsv0dl);
2532  if(trk->Charge()>0) fHistoElePtvsV0dlFeedDownXic0MCS1->Fill(cont_eleptvsv0dl);
2533  else fHistoElePtvsV0dlFeedDownXic0MCS2->Fill(cont_eleptvsv0dl);
2534 
2535  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS->Fill(cont_elelamptvsv0dl);
2536  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1->Fill(cont_elelamptvsv0dl);
2537  else fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2->Fill(cont_elelamptvsv0dl);
2538 
2539  if(isbottomfd){
2540  fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS->Fill(cont_elelamptvsv0dl);
2541  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS1->Fill(cont_elelamptvsv0dl);
2542  else fHistoEleLambdaPtvsV0dlFeedDownXic0BFeeddownMCS2->Fill(cont_elelamptvsv0dl);
2543  }else{
2544  fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS->Fill(cont_elelamptvsv0dl);
2545  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS1->Fill(cont_elelamptvsv0dl);
2546  else fHistoEleLambdaPtvsV0dlFeedDownXic0PromptMCS2->Fill(cont_elelamptvsv0dl);
2547  }
2548 
2549  fHistoElePtvsV0dcaFeedDownXic0MCS->Fill(cont_eleptvsv0dca);
2550  if(trk->Charge()>0) fHistoElePtvsV0dcaFeedDownXic0MCS->Fill(cont_eleptvsv0dca);
2551  else fHistoElePtvsV0dcaFeedDownXic0MCS->Fill(cont_eleptvsv0dca);
2552 
2553  fHistoResponseEleLambdaPtFeeddownXic0->Fill(mclc->Pt(),elobj->Pt());
2554  if(trk->Charge()>0) fHistoResponseEleLambdaPtFeeddownXic01->Fill(mclc->Pt(),trk->Pt());
2555  else fHistoResponseEleLambdaPtFeeddownXic02->Fill(mclc->Pt(),trk->Pt());
2556 
2557  fHistoResponseLambdaPtFeeddownXic0->Fill(mclc->Pt(),v0->Pt());
2558 
2559  fHistoElePtFeeddownXic0MCS->Fill(trk->Pt(),fCentrality);
2560  fHistoElePtvsEtaFeeddownXic0MCS->Fill(cont_eleptvseta);
2561  fHistoElePtvsLambdaPtFeeddownXic0MCS->Fill(cont_eleptvslambdapt);
2562  }
2563  }
2564  if(abs(pdgcode)==4232 && abs(mcpdgele_array[1])==4232 && abs(mcpdgv0_array[1])==3322){
2567  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1->Fill(cont2);
2569  if(cont[0]<2.3){
2570  fHistoFeedDownXicPlusMCS->Fill(cont_mclc);
2571  if(trk->Charge()>0) fHistoFeedDownXicPlusMCS1->Fill(cont_mclc);
2572  else fHistoFeedDownXicPlusMCS2->Fill(cont_mclc);
2573 
2574  fHistoElectronFeedDownXicPlusMCS->Fill(cont_mcele);
2575  if(trk->Charge()>0) fHistoElectronFeedDownXicPlusMCS1->Fill(cont_mcele);
2576  else fHistoElectronFeedDownXicPlusMCS2->Fill(cont_mcele);
2577 
2578  fHistoElePtvsV0dlFeedDownXicPlusMCS->Fill(cont_eleptvsv0dl);
2579  if(trk->Charge()>0) fHistoElePtvsV0dlFeedDownXicPlusMCS1->Fill(cont_eleptvsv0dl);
2580  else fHistoElePtvsV0dlFeedDownXicPlusMCS2->Fill(cont_eleptvsv0dl);
2581 
2582  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS->Fill(cont_elelamptvsv0dl);
2583  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1->Fill(cont_elelamptvsv0dl);
2584  else fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2->Fill(cont_elelamptvsv0dl);
2585 
2586  if(isbottomfd){
2587  fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS->Fill(cont_elelamptvsv0dl);
2588  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS1->Fill(cont_elelamptvsv0dl);
2589  else fHistoEleLambdaPtvsV0dlFeedDownXicPlusBFeeddownMCS2->Fill(cont_elelamptvsv0dl);
2590  }else{
2591  fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS->Fill(cont_elelamptvsv0dl);
2592  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS1->Fill(cont_elelamptvsv0dl);
2593  else fHistoEleLambdaPtvsV0dlFeedDownXicPlusPromptMCS2->Fill(cont_elelamptvsv0dl);
2594  }
2595 
2596  fHistoElePtvsV0dcaFeedDownXicPlusMCS->Fill(cont_eleptvsv0dca);
2597  if(trk->Charge()>0) fHistoElePtvsV0dcaFeedDownXicPlusMCS->Fill(cont_eleptvsv0dca);
2598  else fHistoElePtvsV0dcaFeedDownXicPlusMCS->Fill(cont_eleptvsv0dca);
2599 
2600  fHistoResponseEleLambdaPtFeeddownXicPlus->Fill(mclc->Pt(),elobj->Pt());
2601  if(trk->Charge()>0) fHistoResponseEleLambdaPtFeeddownXicPlus1->Fill(mclc->Pt(),trk->Pt());
2602  else fHistoResponseEleLambdaPtFeeddownXicPlus2->Fill(mclc->Pt(),trk->Pt());
2603 
2604  fHistoResponseLambdaPtFeeddownXicPlus->Fill(mclc->Pt(),v0->Pt());
2605 
2606  fHistoElePtFeeddownXicPlusMCS->Fill(trk->Pt(),fCentrality);
2607  fHistoElePtvsEtaFeeddownXicPlusMCS->Fill(cont_eleptvseta);
2608  fHistoElePtvsLambdaPtFeeddownXicPlusMCS->Fill(cont_eleptvslambdapt);
2609  }
2610  }
2611  if(abs(pdgcode)==4122 && abs(mcpdgele_array[1])==4122 && ( abs(mcpdgv0_array[1])==3212 || abs(mcpdgv0_array[1])==3214 || abs(mcpdgv0_array[1])==3224) ){
2612  if(cont[0]<2.3){
2613  fHistoFeedDownSigmaMCS->Fill(cont_mclc);
2614  if(trk->Charge()>0) fHistoFeedDownSigmaMCS1->Fill(cont_mclc);
2615  else fHistoFeedDownSigmaMCS2->Fill(cont_mclc);
2616 
2617  fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS->Fill(cont_elelamptvsv0dl);
2618  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS1->Fill(cont_elelamptvsv0dl);
2619  else fHistoEleLambdaPtvsV0dlFeedDownSigmaMCS2->Fill(cont_elelamptvsv0dl);
2620 
2621  if(isbottomfd){
2622  fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS->Fill(cont_elelamptvsv0dl);
2623  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS1->Fill(cont_elelamptvsv0dl);
2624  else fHistoEleLambdaPtvsV0dlFeedDownSigmaBFeeddownMCS2->Fill(cont_elelamptvsv0dl);
2625  }else{
2626  fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS->Fill(cont_elelamptvsv0dl);
2627  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS1->Fill(cont_elelamptvsv0dl);
2628  else fHistoEleLambdaPtvsV0dlFeedDownSigmaPromptMCS2->Fill(cont_elelamptvsv0dl);
2629  }
2630  fHistoResponseEleLambdaPtFeeddownSigma->Fill(mclc->Pt(),elobj->Pt());
2631  if(trk->Charge()>0) fHistoResponseEleLambdaPtFeeddownSigma1->Fill(mclc->Pt(),trk->Pt());
2632  else fHistoResponseEleLambdaPtFeeddownSigma2->Fill(mclc->Pt(),trk->Pt());
2633 
2634  fHistoResponseLambdaPtFeeddownSigma->Fill(mclc->Pt(),v0->Pt());
2635  }
2636  }
2637  }
2638  }
2639  fHistodPhiSdEtaSElectronProtonR125RS->Fill(dphis_ele_pr,detas_ele_pr);
2640  fHistodPhiSdEtaSElectronPionR125RS->Fill(dphis_ele_pi,detas_ele_pi);
2641  }else if((trk->Charge()<0 && !anti_lambda_flag) || (trk->Charge()>0 && anti_lambda_flag)){
2642  fHistoEleLambdaMassWS->Fill(cont);
2643  if(trk->Charge()>0) fHistoEleLambdaMassWS1->Fill(cont);
2644  else fHistoEleLambdaMassWS2->Fill(cont);
2645 
2646  fHistoEleLambdaMassvsElePtWS->Fill(cont2);
2647  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtWS1->Fill(cont2);
2648  else fHistoEleLambdaMassvsElePtWS2->Fill(cont2);
2649  if(cont[0]<2.3){
2650  fHistoEleLambdaPtvsRapidityWS->Fill(elobj->Pt(),elobj_rap);
2651  fHistoElePtWS->Fill(trk->Pt(),fCentrality);
2652  fHistoElePtvsEtaWS->Fill(cont_eleptvseta);
2653  fHistoElePtvsLambdaPtWS->Fill(cont_eleptvslambdapt);
2654  fHistoElePtvsd0WS->Fill(cont_eleptvsd0);
2655 
2656  fHistoElePtvsV0dlWS->Fill(cont_eleptvsv0dl);
2657  if(trk->Charge()>0) fHistoElePtvsV0dlWS1->Fill(cont_eleptvsv0dl);
2658  else fHistoElePtvsV0dlWS2->Fill(cont_eleptvsv0dl);
2659 
2660  fHistoEleLambdaPtvsV0dlWS->Fill(cont_elelamptvsv0dl);
2661  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWS1->Fill(cont_elelamptvsv0dl);
2662  else fHistoEleLambdaPtvsV0dlWS2->Fill(cont_elelamptvsv0dl);
2663 
2664  fHistoElePtvsV0dcaWS->Fill(cont_eleptvsv0dca);
2665  if(trk->Charge()>0) fHistoElePtvsV0dcaWS1->Fill(cont_eleptvsv0dca);
2666  else fHistoElePtvsV0dcaWS2->Fill(cont_eleptvsv0dca);
2667 
2668  for(Int_t ih=0;ih<17;ih++){
2669  Double_t cont_eleptvscutvars[3];
2670  cont_eleptvscutvars[0] = elobj->Pt();
2671  cont_eleptvscutvars[2] = fCentrality;
2672 
2673  if(ih==0){
2674  cont_eleptvscutvars[1] = trk->GetTPCNcls();
2675  }else if(ih==1){
2676  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
2677  }else if(ih==2){
2678  cont_eleptvscutvars[1] = nSigmaTPCele;
2679  }else if(ih==3){
2680  cont_eleptvscutvars[1] = nSigmaTOFele;
2681  }else if(ih==4){
2682  cont_eleptvscutvars[1] = trk->Eta();
2683  }else if(ih==5){
2684  cont_eleptvscutvars[1] = trk->GetITSNcls();
2685  }else if(ih==6){
2686  if(!anti_lambda_flag)
2687  cont_eleptvscutvars[1] = v0->MassLambda();
2688  else
2689  cont_eleptvscutvars[1] = v0->MassAntiLambda();
2690  }else if(ih==7){
2691  Double_t lPosV0[3];
2692  lPosV0[0] = v0->DecayVertexV0X();
2693  lPosV0[1] = v0->DecayVertexV0Y();
2694  lPosV0[2] = v0->DecayVertexV0Z();
2695  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
2696  }else if(ih==8){
2697  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
2698  }else if(ih==9){
2699  if(!anti_lambda_flag)
2700  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2701  else
2702  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2703  }else if(ih==10){
2704  if(!anti_lambda_flag)
2705  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
2706  else
2707  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
2708  }else if(ih==11){
2709  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
2710  }else if(ih==12){
2711  cont_eleptvscutvars[1] = v0->MassK0Short();
2712  }else if(ih==13){
2713  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
2714  }else if(ih==14){
2715  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
2716  }else if(ih==15){
2717  cont_eleptvscutvars[1] = v0->Eta();
2718  }else if(ih==16){
2719  Double_t v0px = elobj->PxProng(1);
2720  Double_t v0py = elobj->PyProng(1);
2721  Double_t v0pz = elobj->PzProng(1);
2722  Double_t epx = elobj->PxProng(0);
2723  Double_t epy = elobj->PyProng(0);
2724  Double_t epz = elobj->PzProng(0);
2725  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
2726  }else{
2727  cont_eleptvscutvars[1] = -9999.;
2728  }
2729 
2730  fHistoElePtvsCutVarsWS[ih]->Fill(cont_eleptvscutvars);
2731  }
2732  }
2733  if(fUseMCInfo){
2734  if(mclc){
2735  Int_t pdgcode = mclc->GetPdgCode();
2736  Double_t cont_mclb[3];
2737  cont_mclb[0] = mclc->Pt();
2738  cont_mclb[1] = mclc->Y();
2739  cont_mclb[2] = fCentrality;
2740  Double_t cont_mcele[3];
2741  cont_mcele[0] = mcele->Pt();
2742  cont_mcele[1] = mcele->Eta();
2743  cont_mcele[2] = fCentrality;
2744 
2745  if(abs(pdgcode)==5122 && abs(mcpdgele_array[1])==5122 && abs(mcpdgv0_array[1])==4122 && abs(mcpdgv0_array[2])==5122){
2746  fHistoEleLambdaMassLambdabMCS->Fill(cont);
2747  if(cont[0]<2.3){
2748  fHistoResponseEleLambdaPtLambdab->Fill(mclc->Pt(),elobj->Pt());
2749  fHistoResponseElePtLambdab->Fill(mclc->Pt(),trk->Pt());
2750  fHistoResponseLambdaPtLambdab->Fill(mclc->Pt(),v0->Pt());
2751  fHistoResponseLambdaPtvsEleLambdaPtLambdab->Fill(elobj->Pt(),v0->Pt());
2752 
2753  fHistoLbMCS->Fill(cont_mclb);
2754  if(trk->Charge()>0) fHistoLbMCS1->Fill(cont_mclb);
2755  else fHistoLbMCS2->Fill(cont_mclb);
2756 
2757  fHistoEleLambdaPtvsV0dlLambdabMCS->Fill(cont_elelamptvsv0dl);
2758  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlLambdabMCS1->Fill(cont_elelamptvsv0dl);
2759  else fHistoEleLambdaPtvsV0dlLambdabMCS2->Fill(cont_elelamptvsv0dl);
2760 
2761  fHistoLbElectronMCS->Fill(cont_mcele);
2762  if(trk->Charge()>0) fHistoLbElectronMCS1->Fill(cont_mcele);
2763  else fHistoLbElectronMCS2->Fill(cont_mcele);
2764  }
2765  }
2766  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgv0_array[1])==4132 && abs(mcpdgv0_array[2])==5132){
2767  fHistoEleLambdaMassXibMCS->Fill(cont);
2768  if(cont[0]<2.3){
2769  fHistoEleLambdaPtvsV0dlXibMCS->Fill(cont_elelamptvsv0dl);
2770  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlXibMCS1->Fill(cont_elelamptvsv0dl);
2771  else fHistoEleLambdaPtvsV0dlXibMCS2->Fill(cont_elelamptvsv0dl);
2772 
2773  fHistoElectronFeedDownXibMCS->Fill(cont_mcele);
2774  if(trk->Charge()>0) fHistoElectronFeedDownXibMCS1->Fill(cont_mcele);
2775  else fHistoElectronFeedDownXibMCS2->Fill(cont_mcele);
2776  }
2777  }
2778  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgv0_array[1])==4232 && abs(mcpdgv0_array[2])==5132){
2779  fHistoEleLambdaMassXibMCS->Fill(cont);
2780  if(cont[0]<2.3){
2781  fHistoEleLambdaPtvsV0dlXibMCS->Fill(cont_elelamptvsv0dl);
2782  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlXibMCS1->Fill(cont_elelamptvsv0dl);
2783  else fHistoEleLambdaPtvsV0dlXibMCS2->Fill(cont_elelamptvsv0dl);
2784 
2785  fHistoElectronFeedDownXibMCS->Fill(cont_mcele);
2786  if(trk->Charge()>0) fHistoElectronFeedDownXibMCS1->Fill(cont_mcele);
2787  else fHistoElectronFeedDownXibMCS2->Fill(cont_mcele);
2788  }
2789  }
2790  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgv0_array[1])==4132 && abs(mcpdgv0_array[2])==5232){
2791  fHistoEleLambdaMassXibMCS->Fill(cont);
2792  if(cont[0]<2.3){
2793  fHistoEleLambdaPtvsV0dlXibMCS->Fill(cont_elelamptvsv0dl);
2794  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlXibMCS1->Fill(cont_elelamptvsv0dl);
2795  else fHistoEleLambdaPtvsV0dlXibMCS2->Fill(cont_elelamptvsv0dl);
2796 
2797  fHistoElectronFeedDownXibMCS->Fill(cont_mcele);
2798  if(trk->Charge()>0) fHistoElectronFeedDownXibMCS1->Fill(cont_mcele);
2799  else fHistoElectronFeedDownXibMCS2->Fill(cont_mcele);
2800  }
2801  }
2802  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgv0_array[1])==4232 && abs(mcpdgv0_array[2])==5232){
2803  fHistoEleLambdaMassXibMCS->Fill(cont);
2804  if(cont[0]<2.3){
2805  fHistoEleLambdaPtvsV0dlXibMCS->Fill(cont_elelamptvsv0dl);
2806  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlXibMCS1->Fill(cont_elelamptvsv0dl);
2807  else fHistoEleLambdaPtvsV0dlXibMCS2->Fill(cont_elelamptvsv0dl);
2808 
2809  fHistoElectronFeedDownXibMCS->Fill(cont_mcele);
2810  if(trk->Charge()>0) fHistoElectronFeedDownXibMCS1->Fill(cont_mcele);
2811  else fHistoElectronFeedDownXibMCS2->Fill(cont_mcele);
2812  }
2813  }
2814  }
2815  }
2816  fHistodPhiSdEtaSElectronProtonR125WS->Fill(dphis_ele_pr,detas_ele_pr);
2817  fHistodPhiSdEtaSElectronPionR125WS->Fill(dphis_ele_pi,detas_ele_pi);
2818  }
2819  }
2820 
2821  //if( elobj->InvMass(2,pdgdg) < 10. && cosoa < 0. && fAnalCuts->IsPeakRegion(v0))
2822  if( melam_flip < 10. && cosoa < 0. && fAnalCuts->IsPeakRegion(v0))
2823  {
2824  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
2825  fHistoEleLambdaMassRSAway->Fill(cont_flip);
2826  if(trk->Charge()>0) fHistoEleLambdaMassRS1Away->Fill(cont_flip);
2827  else fHistoEleLambdaMassRS2Away->Fill(cont_flip);
2828  if(cont_flip[0]<2.3){
2829  fHistoEleLambdaPtvsV0dlRSAway->Fill(cont_elelamptvsv0dl_flip);
2830  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRS1Away->Fill(cont_elelamptvsv0dl_flip);
2831  else fHistoEleLambdaPtvsV0dlRS2Away->Fill(cont_elelamptvsv0dl_flip);
2832  }
2833  }else{
2834  fHistoEleLambdaMassWSAway->Fill(cont_flip);
2835  if(trk->Charge()>0) fHistoEleLambdaMassWS1Away->Fill(cont_flip);
2836  else fHistoEleLambdaMassWS2Away->Fill(cont_flip);
2837  if(cont_flip[0]<2.3){
2838  fHistoEleLambdaPtvsV0dlWSAway->Fill(cont_elelamptvsv0dl_flip);
2839  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWS1Away->Fill(cont_elelamptvsv0dl_flip);
2840  else fHistoEleLambdaPtvsV0dlWS2Away->Fill(cont_elelamptvsv0dl_flip);
2841  }
2842  }
2843  }
2844 
2846  {
2847  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
2848  fHistoEleLambdaMassRSSide->Fill(cont);
2849  if(trk->Charge()>0) fHistoEleLambdaMassRSSide1->Fill(cont);
2850  else fHistoEleLambdaMassRSSide2->Fill(cont);
2851 
2852  fHistoEleLambdaMassvsElePtRSSide->Fill(cont2);
2853  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtRSSide1->Fill(cont2);
2854  else fHistoEleLambdaMassvsElePtRSSide2->Fill(cont2);
2855 
2856  fHistoElePtvsV0dlRSSide->Fill(cont_eleptvsv0dl);
2857  if(trk->Charge()>0) fHistoElePtvsV0dlRSSide1->Fill(cont_eleptvsv0dl);
2858  else fHistoElePtvsV0dlRSSide2->Fill(cont_eleptvsv0dl);
2859 
2860  fHistoEleLambdaPtvsV0dlRSSide->Fill(cont_elelamptvsv0dl);
2861  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRSSide1->Fill(cont_elelamptvsv0dl);
2862  else fHistoEleLambdaPtvsV0dlRSSide2->Fill(cont_elelamptvsv0dl);
2863 
2864  fHistoElePtvsV0dcaRSSide->Fill(cont_eleptvsv0dca);
2865  if(trk->Charge()>0) fHistoElePtvsV0dcaRSSide1->Fill(cont_eleptvsv0dca);
2866  else fHistoElePtvsV0dcaRSSide2->Fill(cont_eleptvsv0dca);
2867 
2868  }else if((trk->Charge()<0 && !anti_lambda_flag) || (trk->Charge()>0 && anti_lambda_flag)){
2869  fHistoEleLambdaMassWSSide->Fill(cont);
2870  if(trk->Charge()>0) fHistoEleLambdaMassWSSide1->Fill(cont);
2871  else fHistoEleLambdaMassWSSide2->Fill(cont);
2872 
2873  fHistoEleLambdaMassvsElePtWSSide->Fill(cont2);
2874  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtWSSide1->Fill(cont2);
2875  else fHistoEleLambdaMassvsElePtWSSide2->Fill(cont2);
2876 
2877  fHistoElePtvsV0dlWSSide->Fill(cont_eleptvsv0dl);
2878  if(trk->Charge()>0) fHistoElePtvsV0dlWSSide1->Fill(cont_eleptvsv0dl);
2879  else fHistoElePtvsV0dlWSSide2->Fill(cont_eleptvsv0dl);
2880 
2881  fHistoEleLambdaPtvsV0dlWSSide->Fill(cont_elelamptvsv0dl);
2882  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWSSide1->Fill(cont_elelamptvsv0dl);
2883  else fHistoEleLambdaPtvsV0dlWSSide2->Fill(cont_elelamptvsv0dl);
2884 
2885  fHistoElePtvsV0dcaWSSide->Fill(cont_eleptvsv0dca);
2886  if(trk->Charge()>0) fHistoElePtvsV0dcaWSSide1->Fill(cont_eleptvsv0dca);
2887  else fHistoElePtvsV0dcaWSSide2->Fill(cont_eleptvsv0dca);
2888  }
2889  }
2890 
2891  //if( elobj->InvMass(2,pdgdg) < 10. && cosoa < 0. && fAnalCuts->IsSideBand(v0))
2892  if( melam_flip < 10. && cosoa < 0. && fAnalCuts->IsSideBand(v0))
2893  {
2894  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
2895  fHistoEleLambdaMassRSSideAway->Fill(cont_flip);
2896  if(trk->Charge()>0) fHistoEleLambdaMassRSSide1Away->Fill(cont_flip);
2897  else fHistoEleLambdaMassRSSide2Away->Fill(cont_flip);
2898  if(cont_flip[0]<2.3){
2899  fHistoEleLambdaPtvsV0dlRSSideAway->Fill(cont_elelamptvsv0dl_flip);
2900  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRSSide1Away->Fill(cont_elelamptvsv0dl_flip);
2901  else fHistoEleLambdaPtvsV0dlRSSide2Away->Fill(cont_elelamptvsv0dl_flip);
2902  }
2903  }else{
2904  fHistoEleLambdaMassWSSideAway->Fill(cont_flip);
2905  if(trk->Charge()>0) fHistoEleLambdaMassWSSide1Away->Fill(cont_flip);
2906  else fHistoEleLambdaMassWSSide2Away->Fill(cont_flip);
2907  if(cont_flip[0]<2.3){
2908  fHistoEleLambdaPtvsV0dlWSSideAway->Fill(cont_elelamptvsv0dl_flip);
2909  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWSSide1Away->Fill(cont_elelamptvsv0dl_flip);
2910  else fHistoEleLambdaPtvsV0dlWSSide2Away->Fill(cont_elelamptvsv0dl_flip);
2911  }
2912  }
2913  }
2914 
2915  //
2916  // New strategy: Fully analyze correlation
2917  //
2918  for(Int_t iv=0;iv<13;iv++){
2919  fCorrelationVariables[iv] = -9999.;
2920  }
2921 
2922  Double_t cont_cor_nd[7];
2923  for(Int_t iv=0;iv<7;iv++){
2924  cont_cor_nd[iv] = -9999.;
2925  }
2926  Double_t cont_mass_nd[8];
2927  for(Int_t iv=0;iv<8;iv++){
2928  cont_mass_nd[iv] = -9999.;
2929  }
2930 
2931  fCorrelationVariables[0] = v0->Pt();
2932  fCorrelationVariables[1] = trk->Pt();
2935  fCorrelationVariables[4] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;;
2936  fCorrelationVariables[5] = elobj->Getd0Prong(0);
2937  if(!fUseMCInfo) fCorrelationVariables[6] = 0;
2938  else fCorrelationVariables[6] = 1;
2939  if(trk->Charge()>0){
2940  if(!anti_lambda_flag) fCorrelationVariables[7] = 0;
2941  else fCorrelationVariables[7] = 2;
2942  }else if(trk->Charge()<0){
2943  if(!anti_lambda_flag) fCorrelationVariables[7] = 1;
2944  else fCorrelationVariables[7] = 3;
2945  }
2946  fCorrelationVariables[8] = (Int_t)isconv + 2 * (Int_t)isconv_like;
2948  fCorrelationVariables[11] = elobj->Pt();
2949  fCorrelationVariables[12] = elobj->InvMass(2,pdgdg);
2950 
2951  cont_cor_nd[0] = elobj->Pt();
2952  cont_cor_nd[1] = fAnalCuts->DeltaPhi(v0,trk);
2953  cont_cor_nd[2] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;;
2954  if(trk->Charge()>0){
2955  if(!anti_lambda_flag) cont_cor_nd[3] = 0;
2956  else cont_cor_nd[3] = 2;
2957  }else if(trk->Charge()<0){
2958  if(!anti_lambda_flag) cont_cor_nd[3] = 3;
2959  else cont_cor_nd[3] = 1;
2960  }
2961  cont_cor_nd[4] = fCorrelationVariables[8];
2962  cont_cor_nd[5] = 0;
2963  cont_cor_nd[6] = fCentrality;
2964 
2965  if(fUseMCInfo && FromSemileptonicDecays(mcpdgele_array)>0){
2966  if(mclc){
2967  Int_t pdgcode = mclc->GetPdgCode();
2968  if(abs(pdgcode)==4122 && abs(mcpdgele_array[1])==4122 && abs(mcpdgv0_array[1])==4122){
2969  fCorrelationVariables[9] = 1;
2970  cont_cor_nd[5] = 1;
2971  }
2972  if(abs(pdgcode)==4122 && abs(mcpdgele_array[1])==4122 && ( abs(mcpdgv0_array[1])==3212 || abs(mcpdgv0_array[1])==3214 || abs(mcpdgv0_array[1])==3224) ){
2973  fCorrelationVariables[9] = 2;
2974  cont_cor_nd[5] = 2;
2975  }
2976  if(abs(pdgcode)==4132 && abs(mcpdgele_array[1])==4132 && abs(mcpdgv0_array[1])==3312){
2977  fCorrelationVariables[9] = 3;
2978  cont_cor_nd[5] = 3;
2979  }
2980  if(abs(pdgcode)==4232 && abs(mcpdgele_array[1])==4232 && abs(mcpdgv0_array[1])==3322){
2981  fCorrelationVariables[9] = 4;
2982  cont_cor_nd[5] = 4;
2983  }
2984  if(abs(pdgcode)==5122 && abs(mcpdgele_array[1])==5122 && abs(mcpdgv0_array[1])==4122 && abs(mcpdgv0_array[2])==5122){
2985  fCorrelationVariables[9] = 11;
2986  cont_cor_nd[5] = 5;
2987  }
2988  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgv0_array[1])==4132 && abs(mcpdgv0_array[2])==5132){
2989  fCorrelationVariables[9] = 12;
2990  cont_cor_nd[5] = 6;
2991  }
2992  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgv0_array[1])==4232 && abs(mcpdgv0_array[2])==5132){
2993  fCorrelationVariables[9] = 13;
2994  cont_cor_nd[5] = 6;
2995  }
2996  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgv0_array[1])==4132 && abs(mcpdgv0_array[2])==5232){
2997  fCorrelationVariables[9] = 14;
2998  cont_cor_nd[5] = 6;
2999  }
3000  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgv0_array[1])==4232 && abs(mcpdgv0_array[2])==5232){
3001  fCorrelationVariables[9] = 15;
3002  cont_cor_nd[5] = 6;
3003  }
3004  }
3005  if(fCorrelationVariables[9]<0){
3006  Bool_t lam_from_bottom = HaveBottomInHistory(mcpdgv0_array);
3007  Bool_t lam_from_charm = HaveCharmInHistory(mcpdgv0_array);
3008  if(FromSemileptonicDecays(mcpdgele_array)==1){
3009  if(lam_from_bottom) fCorrelationVariables[9] = 1011;
3010  else if(lam_from_charm) fCorrelationVariables[9] = 1012;
3011  else fCorrelationVariables[9] = 1013;
3012 
3013  cont_cor_nd[5] = 7;
3014  }
3015  if(FromSemileptonicDecays(mcpdgele_array)==2){
3016  if(lam_from_bottom) fCorrelationVariables[9] = 1014;
3017  else if(lam_from_charm) fCorrelationVariables[9] = 1015;
3018  else fCorrelationVariables[9] = 1016;
3019 
3020  cont_cor_nd[5] = 8;
3021  }
3022  if(FromSemileptonicDecays(mcpdgele_array)==1 && HaveBottomInHistory(mcpdgele_array)){
3023  if(lam_from_bottom) fCorrelationVariables[9] = 1017;
3024  else if(lam_from_charm) fCorrelationVariables[9] = 1018;
3025  else fCorrelationVariables[9] = 1019;
3026 
3027  cont_cor_nd[5] = 9;
3028  }
3029  }
3030  }
3031 
3033  {
3034  if(fWriteVariableTree)
3035  fCorrelationVariablesTree->Fill();
3036 
3037  if(fUseMCInfo){
3038  if(elobj->InvMass(2,pdgdg)<2.3)
3039  fHistoCorrelationVariablesvsEleLambdaPtMC->Fill(cont_cor_nd);
3040  cont_cor_nd[0] = trk->Pt();
3041  fHistoCorrelationVariablesvsElePtMC->Fill(cont_cor_nd);
3042  cont_cor_nd[0] = v0->Pt();
3043  fHistoCorrelationVariablesvsLambdaPtMC->Fill(cont_cor_nd);
3044  }else{
3045  if(elobj->InvMass(2,pdgdg)<2.3)
3046  fHistoCorrelationVariablesvsEleLambdaPt->Fill(cont_cor_nd);
3047  cont_cor_nd[0] = trk->Pt();
3048  fHistoCorrelationVariablesvsElePt->Fill(cont_cor_nd);
3049  cont_cor_nd[0] = v0->Pt();
3050  fHistoCorrelationVariablesvsLambdaPt->Fill(cont_cor_nd);
3051  }
3052  }
3053 
3054  cont_mass_nd[0] = elobj->InvMass(2,pdgdg);
3055  cont_mass_nd[1] = cont_cor_nd[0];
3056  cont_mass_nd[4] = cont_cor_nd[3];
3057  cont_mass_nd[5] = cont_cor_nd[4];
3058  cont_mass_nd[6] = cont_cor_nd[5];
3059  cont_mass_nd[7] = cont_cor_nd[6];
3060 
3061  if(fAnalCuts->IsPeakRegion(v0)) cont_mass_nd[3] = 1;
3062  if(fAnalCuts->IsSideBand(v0)) cont_mass_nd[3] = 0;
3063  if(fAnalCuts->IsSelected(elobj,AliRDHFCuts::kCandidate)) cont_mass_nd[2]=1;
3064  if(melam_flip < 10.&& cosoa < 0.) cont_mass_nd[2]=0;
3065  if(fUseMCInfo){
3066  fHistoMassVariablesvsEleLambdaPtMC->Fill(cont_mass_nd);
3067  cont_mass_nd[1] = trk->Pt();
3068  fHistoMassVariablesvsElePtMC->Fill(cont_mass_nd);
3069  cont_mass_nd[1] = v0->Pt();
3070  fHistoMassVariablesvsLambdaPtMC->Fill(cont_mass_nd);
3071  }else{
3072  fHistoMassVariablesvsEleLambdaPt->Fill(cont_mass_nd);
3073  cont_mass_nd[1] = trk->Pt();
3074  fHistoMassVariablesvsElePt->Fill(cont_mass_nd);
3075  cont_mass_nd[1] = v0->Pt();
3076  fHistoMassVariablesvsLambdaPt->Fill(cont_mass_nd);
3077  }
3078 
3079  return;
3080 }
3081 
3083 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMixROOTObjects(TLorentzVector *trke, TLorentzVector *v0, TVector *elevars, TVector *v0vars, Int_t chargepr)
3084 {
3088  if(!trke) return;
3089  if(!v0) return;
3090 
3091  for(Int_t i=0;i<94;i++)
3092  {
3093  fCandidateVariables[i] = -9999.;
3094  }
3095 
3096 
3097  Double_t pxe = trke->Px();
3098  Double_t pye = trke->Py();
3099  Double_t pze = trke->Pz();
3100  Double_t mome = sqrt(pxe*pxe+pye*pye+pze*pze);
3101  Double_t Ee = sqrt(mome*mome+0.000510998928*0.000510998928);
3102 
3103  Double_t pxv = v0->Px();
3104  Double_t pyv = v0->Py();
3105  Double_t pzv = v0->Pz();
3106  Double_t momv = sqrt(pxv*pxv+pyv*pyv+pzv*pzv);
3107  Double_t Ev = sqrt(momv*momv+1.115683*1.115683);
3108 
3109  Double_t cosoa = (pxe*pxv+pye*pyv+pze*pzv)/mome/momv;
3110 
3111  Double_t pxsum = pxe + pxv;
3112  Double_t pysum = pye + pyv;
3113  Double_t pzsum = pze + pzv;
3114  Double_t Esum = Ee + Ev;
3115  Double_t mel = sqrt(Esum*Esum-pxsum*pxsum-pysum*pysum-pzsum*pzsum);
3116 
3117  Double_t uxe = pxe/mome;
3118  Double_t uye = pye/mome;
3119  Double_t uze = pze/mome;
3120  Double_t lf = -2.*(pxv*uxe+pyv*uye+pzv*uze);
3121  Double_t pxv_flip = pxv + lf * uxe;
3122  Double_t pyv_flip = pyv + lf * uye;
3123  Double_t pzv_flip = pzv + lf * uze;
3124  Double_t pxsum_flip = pxe + pxv_flip;
3125  Double_t pysum_flip = pye + pyv_flip;
3126  Double_t pzsum_flip = pze + pzv_flip;
3127  Double_t mel_flip = sqrt(Esum*Esum-pxsum_flip*pxsum_flip-pysum_flip*pysum_flip-pzsum_flip*pzsum_flip);
3128  Double_t ptel_flip = sqrt(pxsum_flip*pxsum_flip+pysum_flip*pysum_flip);
3129 
3131  UInt_t pdgdg[2]={11,3122};
3132  fCandidateVariables[ 1] = mel;
3133  fCandidateVariables[ 2] = sqrt(pxsum*pxsum+pysum*pysum);
3134  fCandidateVariables[ 3] = pxsum;
3135  fCandidateVariables[ 4] = pysum;
3136  fCandidateVariables[ 5] = pzsum;
3137  fCandidateVariables[ 6] = pxe;
3138  fCandidateVariables[ 7] = pye;
3139  fCandidateVariables[ 8] = pze;
3140  fCandidateVariables[ 9] = pxv;
3141  fCandidateVariables[10] = pyv;
3142  fCandidateVariables[11] = pzv;
3143  if(chargepr>0){
3144  fCandidateVariables[12] = 0;
3145  fCandidateVariables[13] = v0->M();
3146  fCandidateVariables[14] = 0.;
3147  }else{
3148  fCandidateVariables[12] = 1;
3149  fCandidateVariables[13] = 0;
3150  fCandidateVariables[14] = v0->M();
3151  }
3152 
3153  fCandidateVariables[17] = (*elevars)[3];
3154  fCandidateVariables[18] = (*elevars)[4];
3155 
3156  fCandidateVariables[21] = trke->T();
3157  fCandidateVariables[22] = (*v0vars)[9];
3158  fCandidateVariables[23] = (*v0vars)[10];
3159  fCandidateVariables[24] = (*v0vars)[11];
3160  fCandidateVariables[25] = (*v0vars)[12];
3161  fCandidateVariables[26] = (*v0vars)[13];
3162  fCandidateVariables[27] = (*v0vars)[14];
3163 
3164  fCandidateVariables[32] = 1;
3165 
3166  fCandidateVariables[54] = fVtx1->GetX();
3167  fCandidateVariables[55] = fVtx1->GetY();
3168  fCandidateVariables[56] = fVtx1->GetZ();
3169  fCandidateVariables[57] = (*v0vars)[6];
3170  fCandidateVariables[58] = (*v0vars)[7];
3171  fCandidateVariables[59] = (*v0vars)[8];
3172  fCandidateVariables[64] = (*v0vars)[15];
3173 
3174  fCandidateVariables[91] = fBzkG;
3177 
3178 
3179 // if(fWriteVariableTree)
3180 // fVariablesTree->Fill();
3181 
3182  Double_t cont[3];
3183  cont[0] = mel;
3184  cont[1] = sqrt(pxsum*pxsum+pysum*pysum);
3185  cont[2] = fCentrality;
3186  fHistoEleLambdaMass->Fill(cont);
3187 
3188  Double_t cont_flip[3];
3189  cont_flip[0] = mel_flip;
3190  cont_flip[1] = ptel_flip;
3191  cont_flip[2] = fCentrality;
3192 
3193  Double_t cont2[3];
3194  cont2[0] = mel;
3195  cont2[1] = sqrt(pxe*pxe+pye*pye);
3196  cont2[2] = fCentrality;
3197  Double_t cont_eleptvseta[3];
3198  cont_eleptvseta[0] = trke->Pt();
3199  cont_eleptvseta[1] = trke->Eta();
3200  cont_eleptvseta[2] = fCentrality;
3201 
3202  Double_t cont_eleptvslambdapt[3];
3203  cont_eleptvslambdapt[0] = trke->Pt();
3204  cont_eleptvslambdapt[1] = v0->Pt();
3205  cont_eleptvslambdapt[2] = fCentrality;
3206 
3207  Double_t cont_eleptvsd0[3];
3208  cont_eleptvsd0[0] = trke->Pt();
3209  cont_eleptvsd0[1] = 0.;
3210  cont_eleptvsd0[2] = fCentrality;
3211 
3212  Double_t cont_eleptvsv0dl[3];
3213  cont_eleptvsv0dl[0] = trke->Pt();
3214  cont_eleptvsv0dl[1] = (*v0vars)[15];
3215  cont_eleptvsv0dl[2] = fCentrality;
3216 
3217  Double_t cont_eleptvsv0dca[3];
3218  cont_eleptvsv0dca[0] = trke->Pt();
3219  cont_eleptvsv0dca[1] = (*v0vars)[16];
3220  cont_eleptvsv0dca[2] = fCentrality;
3221 
3222  Double_t cont_elelamptvsv0dl[4];
3223  cont_elelamptvsv0dl[0] = sqrt(pxsum*pxsum+pysum*pysum);
3224  cont_elelamptvsv0dl[1] = (*v0vars)[15];
3225  cont_elelamptvsv0dl[2] = 0.0;
3226  cont_elelamptvsv0dl[3] = fCentrality;
3227 
3228  Double_t cont_elelamptvsv0dl_flip[4];
3229  cont_elelamptvsv0dl_flip[0] = ptel_flip;
3230  cont_elelamptvsv0dl_flip[1] = (*v0vars)[15];
3231  cont_elelamptvsv0dl_flip[2] = 0.0;
3232  cont_elelamptvsv0dl_flip[3] = fCentrality;
3233 
3234  Double_t xyzR125_ele[3], xyzR125_pr[3], xyzR125_pi[3];
3235  xyzR125_ele[0] = (*elevars)[0];
3236  xyzR125_ele[1] = (*elevars)[1];
3237  xyzR125_ele[2] = (*elevars)[2];
3238  xyzR125_pr[0] = (*v0vars)[0];
3239  xyzR125_pr[1] = (*v0vars)[1];
3240  xyzR125_pr[2] = (*v0vars)[2];
3241  xyzR125_pi[0] = (*v0vars)[3];
3242  xyzR125_pi[1] = (*v0vars)[4];
3243  xyzR125_pi[2] = (*v0vars)[5];
3244 
3245  Double_t rdhfcutvars[9];
3246  rdhfcutvars[0] = xyzR125_ele[0];
3247  rdhfcutvars[1] = xyzR125_ele[1];
3248  rdhfcutvars[2] = xyzR125_ele[2];
3249  rdhfcutvars[3] = xyzR125_pr[0];
3250  rdhfcutvars[4] = xyzR125_pr[1];
3251  rdhfcutvars[5] = xyzR125_pr[2];
3252  rdhfcutvars[6] = xyzR125_pi[0];
3253  rdhfcutvars[7] = xyzR125_pi[1];
3254  rdhfcutvars[8] = xyzR125_pi[2];
3255 
3256  Double_t dphis_ele_pr = fAnalCuts->dPhiSR125(xyzR125_ele,xyzR125_pr);
3257  Double_t detas_ele_pr = fAnalCuts->dEtaSR125(xyzR125_ele,xyzR125_pr);
3258  Double_t dphis_ele_pi = fAnalCuts->dPhiSR125(xyzR125_ele,xyzR125_pi);
3259  Double_t detas_ele_pi = fAnalCuts->dEtaSR125(xyzR125_ele,xyzR125_pi);
3260 
3261  //if(mel < 10. && cosoa>0. && fAnalCuts->IsPeakRegion(v0))
3262  if(fAnalCuts->IsSelected(trke,v0,rdhfcutvars,AliRDHFCuts::kCandidate) && fAnalCuts->IsPeakRegion(v0))
3263  {
3264 
3265  if(((int)trke->T())*chargepr>0){
3266  fHistoEleLambdaMassRSMix->Fill(cont);
3267  if(trke->T()>0) fHistoEleLambdaMassRSMix1->Fill(cont);
3268  else fHistoEleLambdaMassRSMix2->Fill(cont);
3269 
3270  fHistoEleLambdaMassvsElePtRSMix->Fill(cont2);
3271  if(trke->T()>0) fHistoEleLambdaMassvsElePtRSMix1->Fill(cont2);
3272  else fHistoEleLambdaMassvsElePtRSMix2->Fill(cont2);
3273  if(cont[0]<2.3){
3274  fHistoElePtRSMix->Fill(trke->Pt(),fCentrality);
3275  fHistoElePtvsEtaRSMix->Fill(cont_eleptvseta);
3276  fHistoElePtvsLambdaPtRSMix->Fill(cont_eleptvslambdapt);
3277  fHistoElePtvsd0RSMix->Fill(cont_eleptvsd0);
3278 
3279  fHistoElePtvsV0dlRSMix->Fill(cont_eleptvsv0dl);
3280  if(trke->T()>0) fHistoElePtvsV0dlRSMix1->Fill(cont_eleptvsv0dl);
3281  else fHistoElePtvsV0dlRSMix2->Fill(cont_eleptvsv0dl);
3282 
3283  fHistoEleLambdaPtvsV0dlRSMix->Fill(cont_elelamptvsv0dl);
3284  if(trke->T()>0) fHistoEleLambdaPtvsV0dlRSMix1->Fill(cont_elelamptvsv0dl);
3285  else fHistoEleLambdaPtvsV0dlRSMix2->Fill(cont_elelamptvsv0dl);
3286 
3287  fHistoElePtvsV0dcaRSMix->Fill(cont_eleptvsv0dca);
3288  if(trke->T()>0) fHistoElePtvsV0dcaRSMix1->Fill(cont_eleptvsv0dca);
3289  else fHistoElePtvsV0dcaRSMix2->Fill(cont_eleptvsv0dca);
3290  }
3291  fHistodPhiSdEtaSElectronProtonR125RSMix->Fill(dphis_ele_pr,detas_ele_pr);
3292  fHistodPhiSdEtaSElectronPionR125RSMix->Fill(dphis_ele_pi,detas_ele_pi);
3293  }else{
3294  fHistoEleLambdaMassWSMix->Fill(cont);
3295  if(trke->T()>0) fHistoEleLambdaMassWSMix1->Fill(cont);
3296  else fHistoEleLambdaMassWSMix2->Fill(cont);
3297 
3298  fHistoEleLambdaMassvsElePtWSMix->Fill(cont2);
3299  if(trke->T()>0) fHistoEleLambdaMassvsElePtWSMix1->Fill(cont2);
3300  else fHistoEleLambdaMassvsElePtWSMix2->Fill(cont2);
3301  if(cont[0]<2.3){
3302  fHistoElePtWSMix->Fill(trke->Pt(),fCentrality);
3303  fHistoElePtvsEtaWSMix->Fill(cont_eleptvseta);
3304  fHistoElePtvsLambdaPtWSMix->Fill(cont_eleptvslambdapt);
3305  fHistoElePtvsd0WSMix->Fill(cont_eleptvsd0);
3306 
3307  fHistoElePtvsV0dlWSMix->Fill(cont_eleptvsv0dl);
3308  if(trke->T()>0) fHistoElePtvsV0dlWSMix1->Fill(cont_eleptvsv0dl);
3309  else fHistoElePtvsV0dlWSMix2->Fill(cont_eleptvsv0dl);
3310 
3311  fHistoEleLambdaPtvsV0dlWSMix->Fill(cont_elelamptvsv0dl);
3312  if(trke->T()>0) fHistoEleLambdaPtvsV0dlWSMix1->Fill(cont_elelamptvsv0dl);
3313  else fHistoEleLambdaPtvsV0dlWSMix2->Fill(cont_elelamptvsv0dl);
3314 
3315  fHistoElePtvsV0dcaWSMix->Fill(cont_eleptvsv0dca);
3316  if(trke->T()>0) fHistoElePtvsV0dcaWSMix1->Fill(cont_eleptvsv0dca);
3317  else fHistoElePtvsV0dcaWSMix2->Fill(cont_eleptvsv0dca);
3318  }
3319  fHistodPhiSdEtaSElectronProtonR125WSMix->Fill(dphis_ele_pr,detas_ele_pr);
3320  fHistodPhiSdEtaSElectronPionR125WSMix->Fill(dphis_ele_pi,detas_ele_pi);
3321  }
3322  }
3323 
3324  //if(mel < 10. && cosoa<0. && fAnalCuts->IsPeakRegion(v0))
3325  if(mel_flip < 10. && cosoa<0. && fAnalCuts->IsPeakRegion(v0))
3326  {
3327  if(((int)trke->T())*chargepr>0){
3328  fHistoEleLambdaMassRSMixAway->Fill(cont_flip);
3329  if(trke->T()>0) fHistoEleLambdaMassRSMix1Away->Fill(cont_flip);
3330  else fHistoEleLambdaMassRSMix2Away->Fill(cont_flip);
3331  if(cont_flip[0]<2.3){
3332  fHistoEleLambdaPtvsV0dlRSMixAway->Fill(cont_elelamptvsv0dl_flip);
3333  if(trke->T()>0) fHistoEleLambdaPtvsV0dlRSMix1Away->Fill(cont_elelamptvsv0dl_flip);
3334  else fHistoEleLambdaPtvsV0dlRSMix2Away->Fill(cont_elelamptvsv0dl_flip);
3335  }
3336  }else{
3337  fHistoEleLambdaMassWSMixAway->Fill(cont_flip);
3338  if(trke->T()>0) fHistoEleLambdaMassWSMix1Away->Fill(cont_flip);
3339  else fHistoEleLambdaMassWSMix2Away->Fill(cont_flip);
3340  if(cont_flip[0]<2.3){
3341  fHistoEleLambdaPtvsV0dlWSMixAway->Fill(cont_elelamptvsv0dl_flip);
3342  if(trke->T()>0) fHistoEleLambdaPtvsV0dlWSMix1Away->Fill(cont_elelamptvsv0dl_flip);
3343  else fHistoEleLambdaPtvsV0dlWSMix2Away->Fill(cont_elelamptvsv0dl_flip);
3344  }
3345  }
3346  }
3347 
3348  //
3349  // New strategy: Fully analyze correlation
3350  //
3351  for(Int_t iv=0;iv<13;iv++){
3352  fCorrelationVariables[iv] = -9999.;
3353  }
3354 
3355  Double_t cont_cor_nd[7];
3356  for(Int_t iv=0;iv<7;iv++){
3357  cont_cor_nd[iv] = -9999.;
3358  }
3359  Double_t cont_mass_nd[8];
3360  for(Int_t iv=0;iv<8;iv++){
3361  cont_mass_nd[iv] = -9999.;
3362  }
3363 
3364  fCorrelationVariables[0] = v0->Pt();
3365  fCorrelationVariables[1] = trke->Pt();
3366  fCorrelationVariables[2] = TVector2::Phi_mpi_pi(v0->Phi()-trke->Phi());
3367  fCorrelationVariables[3] = v0->Eta()-trke->Eta();
3368  fCorrelationVariables[4] = (*v0vars)[15];
3369  fCorrelationVariables[5] = (*elevars)[5];
3370  fCorrelationVariables[6] = 2;
3371  if(trke->T()>0){
3372  if(chargepr>0) fCorrelationVariables[7] = 0;
3373  else fCorrelationVariables[7] = 2;
3374  }else if(trke->T()<0){
3375  if(chargepr>0) fCorrelationVariables[7] = 1;
3376  else fCorrelationVariables[7] = 3;
3377  }
3378  fCorrelationVariables[8] = (*elevars)[6];
3379  fCorrelationVariables[9] = (*elevars)[7];
3380  fCorrelationVariables[10] = fCentrality;
3381  fCorrelationVariables[11] = sqrt(pxsum*pxsum+pysum*pysum);
3382  fCorrelationVariables[12] = mel;
3383 
3384  cont_cor_nd[0] = sqrt(pxsum*pxsum+pysum*pysum);
3385  cont_cor_nd[1] = TVector2::Phi_mpi_pi(v0->Phi()-trke->Phi());
3386  cont_cor_nd[2] = (*v0vars)[15];
3387  if(trke->T()>0){
3388  if(chargepr>0) cont_cor_nd[3] = 0;
3389  else cont_cor_nd[3] = 2;
3390  }else if(trke->T()<0){
3391  if(chargepr>0) cont_cor_nd[3] = 3;
3392  else cont_cor_nd[3] = 1;
3393  }
3394  cont_cor_nd[4] = fCorrelationVariables[8];
3395  cont_cor_nd[5] = 0;
3396  if(fabs(fCorrelationVariables[9]-1013)<0.001) cont_cor_nd[5] = 7;
3397  if(fabs(fCorrelationVariables[9]-1016)<0.001) cont_cor_nd[5] = 8;
3398  if(fabs(fCorrelationVariables[9]-1019)<0.001) cont_cor_nd[5] = 9;
3399  cont_cor_nd[6] = fCentrality;
3400 
3401  if(fAnalCuts->IsSelected(trke,v0,rdhfcutvars,AliRDHFCuts::kCandidate) && fAnalCuts->IsPeakRegion(v0))
3402  {
3403  if(fWriteVariableTree)
3404  fCorrelationVariablesTree->Fill();
3405 
3406  if(mel<2.3)
3407  fHistoCorrelationVariablesvsEleLambdaPtMix->Fill(cont_cor_nd);
3408  cont_cor_nd[0] = trke->Pt();
3409  fHistoCorrelationVariablesvsElePtMix->Fill(cont_cor_nd);
3410  cont_cor_nd[0] = v0->Pt();
3411  fHistoCorrelationVariablesvsLambdaPtMix->Fill(cont_cor_nd);
3412  }
3413 
3414  cont_mass_nd[0] = mel;
3415  cont_mass_nd[1] = cont_cor_nd[0];
3416  cont_mass_nd[4] = cont_cor_nd[3];
3417  cont_mass_nd[5] = cont_cor_nd[4];
3418  cont_mass_nd[6] = cont_cor_nd[5];
3419  cont_mass_nd[7] = cont_cor_nd[6];
3420 
3421  if(fAnalCuts->IsPeakRegion(v0)) cont_mass_nd[3] = 1;
3422  if(fAnalCuts->IsSideBand(v0)) cont_mass_nd[3] = 0;
3423  if(fAnalCuts->IsSelected(trke,v0,rdhfcutvars,AliRDHFCuts::kCandidate)) cont_mass_nd[2]=1;
3424  if(mel_flip < 10.&& cosoa < 0.) cont_mass_nd[2]=0;
3425  fHistoMassVariablesvsEleLambdaPtMix->Fill(cont_mass_nd);
3426  cont_mass_nd[0] = trke->Pt();
3427  fHistoMassVariablesvsElePtMix->Fill(cont_mass_nd);
3428  cont_mass_nd[0] = v0->Pt();
3429  fHistoMassVariablesvsLambdaPtMix->Fill(cont_mass_nd);
3430 
3431  return;
3432 }
3435 {
3436  //
3438  //
3439 
3440  const char* nameoutput = GetOutputSlot(5)->GetContainer()->GetName();
3441  fEleVariablesTree = new TTree(nameoutput,"electron variables tree");
3442  Int_t nVar = 26;
3443  fCandidateEleVariables = new Float_t [nVar];
3444  TString * fCandidateVariableNames = new TString[nVar];
3445 
3446  fCandidateVariableNames[ 0]="ElePx";
3447  fCandidateVariableNames[ 1]="ElePy";
3448  fCandidateVariableNames[ 2]="ElePz";
3449  fCandidateVariableNames[ 3]="TPCChi2overNDF";
3450  fCandidateVariableNames[ 4]="ITSNcls";
3451  fCandidateVariableNames[ 5]="TPCNcls";
3452  fCandidateVariableNames[ 6]="TPCNclsPID";
3453  fCandidateVariableNames[ 7]="TPCNclsRatio";
3454  fCandidateVariableNames[ 8]="d0R";
3455  fCandidateVariableNames[ 9]="d0Z";
3456  fCandidateVariableNames[10]="ITSClusterMap";
3457  fCandidateVariableNames[11]="nSigmaTPCele";
3458  fCandidateVariableNames[12]="nSigmaTOFele";
3459  fCandidateVariableNames[13]="nSigmaTPCpi";
3460  fCandidateVariableNames[14]="nSigmaTPCka";
3461  fCandidateVariableNames[15]="nSigmaTPCpr";
3462  fCandidateVariableNames[16]="EvNumber";
3463  fCandidateVariableNames[17]="EleCharge";
3464  fCandidateVariableNames[18]="ElePdgCode";
3465  fCandidateVariableNames[19]="EleMotherPdgCode";
3466  fCandidateVariableNames[20]="mcelepx";
3467  fCandidateVariableNames[21]="mcelepy";
3468  fCandidateVariableNames[22]="mcelepz";
3469  fCandidateVariableNames[23]="Centrality";
3470  fCandidateVariableNames[24]="PrimVertZ";
3471  fCandidateVariableNames[25]="RunNumber";
3472 
3473  for (Int_t ivar=0; ivar<nVar; ivar++) {
3474  fEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
3475  }
3476 
3477  return;
3478 }
3480 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillElectronROOTObjects(AliAODTrack *trk, AliAODTrack *trkpid, Int_t convtype, Int_t mcetype, AliAODEvent *event, TClonesArray *mcArray)
3481 {
3482  //
3484  //
3485 
3486  if(!trk) return;
3487 
3488  fHistoBachPt->Fill(trk->Pt());
3489  fHistoElectronQovPtvsPhi->Fill(trk->Phi(),(Double_t)trk->Charge()/trk->Pt());
3490 
3491  Double_t d0z0[2],covd0z0[3];
3492  trk->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);
3493 
3494  if(fDoEventMixing){
3495  Double_t pv[3];
3496  pv[0] = fVtx1->GetX();
3497  pv[1] = fVtx1->GetY();
3498  pv[2] = fVtx1->GetZ();
3499  Double_t xyzR125[3]={9999.,9999.,9999.};
3500  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(trk,fBzkG,pv,xyzR125);
3501  TVector *varvec = new TVector(8);
3502  (*varvec)[0] = xyzR125[0];
3503  (*varvec)[1] = xyzR125[1];
3504  (*varvec)[2] = xyzR125[2];
3505  (*varvec)[3] = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kElectron);
3506  (*varvec)[4] = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kElectron);
3507  (*varvec)[5] = d0z0[0];
3508  (*varvec)[6] = convtype;
3509  (*varvec)[7] = mcetype;
3510 
3511  fElectronTracks->AddLast(new TLorentzVector(trk->Px(),trk->Py(),trk->Pz(),trk->Charge()));
3512  fElectronCutVarsArray->AddLast(varvec);
3513  }
3514 
3515  Int_t pdgEle = -9999;
3516  Int_t pdgEleMother = -9999;
3517  Float_t mcelepx = -9999;
3518  Float_t mcelepy = -9999;
3519  Float_t mcelepz = -9999;
3520  if(fUseMCInfo)
3521  {
3522  Int_t labEle = trk->GetLabel();
3523  if(labEle<0) return;
3524  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
3525  if(!mcetrk) return;
3526  pdgEle = mcetrk->GetPdgCode();
3527  mcelepx = mcetrk->Px();
3528  mcelepy = mcetrk->Py();
3529  mcelepz = mcetrk->Pz();
3530  }
3531 
3532  //test propagation
3533 // cout<<"B: "<<fBzkG<<endl;
3534 // cout<<"trk: "<<trk->Charge()<<" "<<trk->Px()<<" "<<trk->Py()<<" "<<trk->Pz()<<endl;
3535 // AliExternalTrackParam etp;
3536 // etp.CopyFromVTrack(trk);
3537 // Double_t xyz_test[3]={-9999.,-9999.,-9999.};
3538 // etp.GetXYZ(xyz_test);
3539 // cout<<"Before: "<<xyz_test[0]<<" "<<xyz_test[1]<<" "<<xyz_test[2]<<endl;
3540 // etp.PropagateTo(80.,(Float_t)fBzkG);
3541 // etp.GetXYZ(xyz_test); // GetXYZ returns global coordinates
3542 // cout<<"After: "<<xyz_test[0]<<" "<<xyz_test[1]<<" "<<xyz_test[2]<<endl;
3543 
3544  if(!fWriteEachVariableTree) return;
3545 
3546  for(Int_t i=0;i<26;i++){
3547  fCandidateEleVariables[i] = -9999.;
3548  }
3549 
3550  fCandidateEleVariables[ 0] = trk->Px();
3551  fCandidateEleVariables[ 1] = trk->Py();
3552  fCandidateEleVariables[ 2] = trk->Pz();
3553  fCandidateEleVariables[ 3] = trk->Chi2perNDF();
3554  fCandidateEleVariables[ 4] = trk->GetITSNcls();
3555  fCandidateEleVariables[ 5] = trk->GetTPCncls();
3556  fCandidateEleVariables[ 6] = trk->GetTPCsignalN();
3557  if(trk->GetTPCNclsF()>0)
3558  fCandidateEleVariables[ 7] = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
3559 
3560  fCandidateEleVariables[ 8] = d0z0[0];
3561  fCandidateEleVariables[ 9] = d0z0[1];
3562  Int_t itsmap = trk->GetITSClusterMap();
3563  Int_t bit1 = 1;
3564  Int_t bit2 = 2;
3565  Bool_t spdfirst = (itsmap & bit1) == bit1;
3566  Bool_t spdsecond = (itsmap & bit2) == bit2;
3567  fCandidateEleVariables[10] = ((Int_t)spdfirst) + 2 * ((Int_t)spdsecond);
3568 
3569  if(fAnalCuts->GetIsUsePID())
3570  {
3571  Double_t nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
3572  Double_t nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
3573  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
3574  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
3575  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
3576  fCandidateEleVariables[11] = nSigmaTPCele;
3577  fCandidateEleVariables[12] = nSigmaTOFele;
3578  fCandidateEleVariables[13] = nSigmaTPCpi_etrk;
3579  fCandidateEleVariables[14] = nSigmaTPCka_etrk;
3580  fCandidateEleVariables[15] = nSigmaTPCpr_etrk;
3581  }
3583  fCandidateEleVariables[17] = trk->Charge();
3584  fCandidateEleVariables[18] = pdgEle;
3585  fCandidateEleVariables[19] = pdgEleMother;
3586  fCandidateEleVariables[20] = mcelepx;
3587  fCandidateEleVariables[21] = mcelepy;
3588  fCandidateEleVariables[22] = mcelepz;
3592 
3593  fHistod0Bach->Fill(d0z0[0]);
3594 
3595  fEleVariablesTree->Fill();
3596 }
3599 {
3600  //
3602  //
3603 
3604  const char* nameoutput = GetOutputSlot(6)->GetContainer()->GetName();
3605  fV0VariablesTree = new TTree(nameoutput,"v0 variables tree");
3606  Int_t nVar = 36;
3607  fCandidateV0Variables = new Float_t [nVar];
3608  TString * fCandidateVariableNames = new TString[nVar];
3609 
3610  fCandidateVariableNames[ 0]="V0Px";
3611  fCandidateVariableNames[ 1]="V0Py";
3612  fCandidateVariableNames[ 2]="V0Pz";
3613  fCandidateVariableNames[ 3]="MassLambda";
3614  fCandidateVariableNames[ 4]="MassAntiLambda";
3615  fCandidateVariableNames[ 5]="ProtonPx";
3616  fCandidateVariableNames[ 6]="ProtonPy";
3617  fCandidateVariableNames[ 7]="ProtonPz";
3618  fCandidateVariableNames[ 8]="PionPx";
3619  fCandidateVariableNames[ 9]="PionPy";
3620  fCandidateVariableNames[10]="PionPz";
3621  fCandidateVariableNames[11]="RfidV0";
3622  fCandidateVariableNames[12]="DcaV0PrToPrimVertex";
3623  fCandidateVariableNames[13]="DcaV0PiToPrimVertex";
3624  fCandidateVariableNames[14]="DcaV0daughters";
3625  fCandidateVariableNames[15]="V0CosPointingAngle";
3626  fCandidateVariableNames[16]="V0ProperDecayLength";
3627  fCandidateVariableNames[17]="MassK0Short";
3628  fCandidateVariableNames[18]="nSigmaTPCpr";
3629  fCandidateVariableNames[19]="nSigmaTPCpi";
3630  fCandidateVariableNames[20]="TPCNCrossV0Pr";
3631  fCandidateVariableNames[21]="TPCNCrossV0Pi";
3632  fCandidateVariableNames[22]="TPCNCrossRatioV0Pr";
3633  fCandidateVariableNames[23]="TPCNCrossRatioV0Pi";
3634  fCandidateVariableNames[24]="V0PdgCode";
3635  fCandidateVariableNames[25]="V0MotherPdgCode";
3636  fCandidateVariableNames[26]="mcv0px";
3637  fCandidateVariableNames[27]="mcv0py";
3638  fCandidateVariableNames[28]="mcv0pz";
3639  fCandidateVariableNames[29]="mcv0vertx";
3640  fCandidateVariableNames[30]="mcv0verty";
3641  fCandidateVariableNames[31]="mcv0vertz";
3642  fCandidateVariableNames[32]="EvNumber";
3643  fCandidateVariableNames[33]="Centrality";
3644  fCandidateVariableNames[34]="PrimVertZ";
3645  fCandidateVariableNames[35]="RunNumber";
3646 
3647  for (Int_t ivar=0; ivar<nVar; ivar++) {
3648  fV0VariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateV0Variables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
3649  }
3650 
3651  return;
3652 }
3653 
3655 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillV0ROOTObjects(AliAODv0 *v0, TClonesArray *mcArray)
3656 {
3657  //
3659  //
3660  if(!v0) return;
3661  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
3662  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
3663  if(!cptrack) return;
3664  if(!cntrack) return;
3665 // if(cptrack->Charge()<0 && cntrack->Charge()>0){
3666 // cptrack = (AliAODTrack*)(v0->GetDaughter(1));
3667 // cntrack = (AliAODTrack*)(v0->GetDaughter(0));
3668 // }
3669  //test propagation
3670 // cout<<"B: "<<fBzkG<<endl;
3671 // cout<<"trk: "<<cptrack->Charge()<<" "<<v0->MomPosX()<<" "<<v0->MomPosY()<<" "<<v0->MomPosZ()<<endl;
3672 // cout<<"vert: "<<v0->DecayVertexV0X()<<" "<<v0->DecayVertexV0Y()<<" "<<v0->DecayVertexV0Z()<<endl;
3673 // AliExternalTrackParam etp;
3674 // etp.CopyFromVTrack(cptrack);
3675 // Double_t xyz_test[3]={-9999.,-9999.,-9999.};
3676 // etp.PropagateTo(10.,(Float_t)fBzkG);
3677 // etp.GetXYZ(xyz_test); // GetXYZ returns global coordinates
3678 // cout<<"10: "<<xyz_test[0]<<" "<<xyz_test[1]<<" "<<xyz_test[2]<<endl;
3679 // etp.PropagateTo(120.,(Float_t)fBzkG);
3680 // etp.GetXYZ(xyz_test); // GetXYZ returns global coordinates
3681 // cout<<"120: "<<xyz_test[0]<<" "<<xyz_test[1]<<" "<<xyz_test[2]<<endl;
3682 
3683  Double_t mlamPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
3684  Double_t posVtx[3] = {0.,0.,0.};
3685  fVtx1->GetXYZ(posVtx);
3686  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
3687  Double_t v0propdl = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
3688  Double_t cont_arm[3];
3689  cont_arm[0] = v0->Pt();
3690  cont_arm[1] = v0->PtArmV0();
3691  cont_arm[2] = v0->AlphaV0();
3692 
3693  if(TMath::Abs(v0->MassLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
3694  fHistoLambdaMassvsPt->Fill(v0->MassLambda(),v0->Pt());
3695  }
3696  if(TMath::Abs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
3697  fHistoLambdaMassvsPt->Fill(v0->MassAntiLambda(),v0->Pt());
3698  }
3699  fHistoK0sMassvsPt->Fill(v0->MassK0Short(),v0->Pt());
3700 
3701  if(fAnalCuts->IsPeakRegion(v0)){
3702  fHistoLambdaPtvsDl->Fill(v0->Pt(),v0propdl);
3703  fHistoLambdaPtvsEta->Fill(v0->Pt(),v0->Eta());
3704  fHistoLambdaArmenteros->Fill(cont_arm);
3705  }
3706  if(fAnalCuts->IsSideBand(v0)){
3707  fHistoLambdaPtvsDlSide->Fill(v0->Pt(),v0propdl);
3708  }
3709 
3710  Double_t momv0x = v0->MomV0X();
3711  Double_t momv0y = v0->MomV0Y();
3712  Double_t phi_alice = atan2(momv0y,momv0x);
3713  if(phi_alice<0.) phi_alice += 2 * M_PI;
3714  fHistoLambdaQovPtvsPhi->Fill(phi_alice,1./sqrt(momv0x*momv0x+momv0y*momv0y));
3715 
3716  Int_t v0pdgcode = -9999;
3717  Int_t v0motherpdgcode = -9999;
3718  Float_t mcv0px = -9999;
3719  Float_t mcv0py = -9999;
3720  Float_t mcv0pz = -9999;
3721  Float_t mcv0vertx = -9999;
3722  Float_t mcv0verty = -9999;
3723  Float_t mcv0vertz = -9999;
3724  if(fUseMCInfo)
3725  {
3726  Int_t pdgdgv0[2]={2212,211};
3727  Int_t labV0 = v0->MatchToMC(3122,mcArray,2,pdgdgv0); // the V0
3728  if(labV0>=0){
3729  if(TMath::Abs(v0->MassLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
3730  fHistoLambdaMassvsPtMCS->Fill(v0->MassLambda(),v0->Pt());
3731  }
3732  if(TMath::Abs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
3733  fHistoLambdaMassvsPtMCS->Fill(v0->MassAntiLambda(),v0->Pt());
3734  }
3735  if(fAnalCuts->IsPeakRegion(v0)){
3736  fHistoLambdaPtvsEtaMCS->Fill(v0->Pt(),v0->Eta());
3737  fHistoLambdaArmenterosMCS->Fill(cont_arm);
3738  }
3739  }
3740  if(labV0<0) return;
3741  AliAODMCParticle *mcv0trk = (AliAODMCParticle*)mcArray->At(labV0);
3742  if(!mcv0trk) return;
3743 
3744  Bool_t hfv0_flag = kFALSE;
3745  Bool_t promptv0_flag = kFALSE;
3746  v0pdgcode = mcv0trk->GetPdgCode();
3747  Int_t labv0mother = mcv0trk->GetMother();
3748  if(labv0mother>=0){
3749  AliAODMCParticle *motherv0 = (AliAODMCParticle*)mcArray->At(labv0mother);
3750  if(motherv0){
3751  v0motherpdgcode = motherv0->GetPdgCode();
3752  if(abs(v0motherpdgcode)>4000&&abs(v0motherpdgcode)<4400){
3753  hfv0_flag = kTRUE;
3754  }
3755  if(abs(v0motherpdgcode)==3322){
3756  fHistoLambdaPtvsDlFeeddownXi0MCS->Fill(v0->Pt(),v0propdl);
3757  }else if(abs(v0motherpdgcode)==3312){
3758  fHistoLambdaPtvsDlFeeddownXiMinusMCS->Fill(v0->Pt(),v0propdl);
3759  }else if(abs(v0motherpdgcode)==3334){
3760  fHistoLambdaPtvsDlFeeddownOmegaMCS->Fill(v0->Pt(),v0propdl);
3761  }else{
3762  fHistoLambdaPtvsDlMCS->Fill(v0->Pt(),v0propdl);
3763  promptv0_flag = kTRUE;
3764  }
3765  }
3766  }
3767  if(!hfv0_flag) return;
3768  //if(!promptv0_flag) return;
3769 
3770  mcv0px = mcv0trk->Px();
3771  mcv0py = mcv0trk->Py();
3772  mcv0pz = mcv0trk->Pz();
3773 
3774  Int_t labptrk = cptrack->GetLabel();
3775  if(labptrk>=0){
3776  AliAODMCParticle *mcv0ptrk = (AliAODMCParticle*)mcArray->At(labptrk);
3777  if(mcv0ptrk){
3778  mcv0vertx = mcv0ptrk->Xv();
3779  mcv0verty = mcv0ptrk->Yv();
3780  mcv0vertz = mcv0ptrk->Zv();
3781  }
3782  }
3783  }
3784 
3785 
3786  if(fDoEventMixing){
3787  Double_t posVtx[3] = {0.,0.,0.};
3788  fVtx1->GetXYZ(posVtx);
3789  TLorentzVector *lv = new TLorentzVector();
3790  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
3791  Double_t xyzR125pr[3] = {9999.,9999.,9999.};
3792  Double_t xyzR125pi[3] = {9999.,9999.,9999.};
3793  if(TMath::Abs(v0->MassLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
3794  lv->SetXYZM(v0->Px(),v0->Py(),v0->Pz(),v0->MassLambda());
3795  fV0Tracks1->AddLast(lv);
3796  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(cptrack,fBzkG,posVtx,xyzR125pr);
3797  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(cntrack,fBzkG,posVtx,xyzR125pi);
3798  TVector *varvec = new TVector(17);
3799  (*varvec)[0] = xyzR125pr[0];
3800  (*varvec)[1] = xyzR125pr[1];
3801  (*varvec)[2] = xyzR125pr[2];
3802  (*varvec)[3] = xyzR125pi[0];
3803  (*varvec)[4] = xyzR125pi[1];
3804  (*varvec)[5] = xyzR125pi[2];
3805  (*varvec)[6] = v0->DecayVertexV0X();
3806  (*varvec)[7] = v0->DecayVertexV0Y();
3807  (*varvec)[8] = v0->DecayVertexV0Z();
3808  (*varvec)[9] = v0->MomPosX();
3809  (*varvec)[10] = v0->MomPosY();
3810  (*varvec)[11] = v0->MomPosZ();
3811  (*varvec)[12] = v0->MomNegX();
3812  (*varvec)[13] = v0->MomNegY();
3813  (*varvec)[14] = v0->MomNegZ();
3814  (*varvec)[15] = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
3815  (*varvec)[16] = v0->DcaV0ToPrimVertex();
3816  fV0CutVarsArray1->AddLast(varvec);
3817  }else{
3818  lv->SetXYZM(v0->Px(),v0->Py(),v0->Pz(),v0->MassAntiLambda());
3819  fV0Tracks2->AddLast(lv);
3820  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(cntrack,fBzkG,posVtx,xyzR125pr);
3821  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(cptrack,fBzkG,posVtx,xyzR125pi);
3822  TVector *varvec = new TVector(17);
3823  (*varvec)[0] = xyzR125pr[0];
3824  (*varvec)[1] = xyzR125pr[1];
3825  (*varvec)[2] = xyzR125pr[2];
3826  (*varvec)[3] = xyzR125pi[0];
3827  (*varvec)[4] = xyzR125pi[1];
3828  (*varvec)[5] = xyzR125pi[2];
3829  (*varvec)[6] = v0->DecayVertexV0X();
3830  (*varvec)[7] = v0->DecayVertexV0Y();
3831  (*varvec)[8] = v0->DecayVertexV0Z();
3832  (*varvec)[9] = v0->MomNegX();
3833  (*varvec)[10] = v0->MomNegY();
3834  (*varvec)[11] = v0->MomNegZ();
3835  (*varvec)[12] = v0->MomPosX();
3836  (*varvec)[13] = v0->MomPosY();
3837  (*varvec)[14] = v0->MomPosZ();
3838  (*varvec)[15] = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
3839  (*varvec)[16] = v0->DcaV0ToPrimVertex();
3840  fV0CutVarsArray2->AddLast(varvec);
3841  }
3842  }
3843 
3844  if(!fWriteEachVariableTree) return;
3845 
3846  for(Int_t i=0;i<36;i++){
3847  fCandidateV0Variables[i] = -9999.;
3848  }
3849 
3850  fCandidateV0Variables[ 0] = v0->Px();
3851  fCandidateV0Variables[ 1] = v0->Py();
3852  fCandidateV0Variables[ 2] = v0->Pz();
3853  fCandidateV0Variables[ 3] = v0->MassLambda();
3854  fCandidateV0Variables[ 4] = v0->MassAntiLambda();
3855 
3856  Bool_t isparticle = kTRUE;
3857  if(fabs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()) isparticle=kFALSE;
3858 
3859  if(isparticle){
3860  fCandidateV0Variables[ 5] = v0->MomPosX(); //cptrack->Px();
3861  fCandidateV0Variables[ 6] = v0->MomPosY(); //cptrack->Py();
3862  fCandidateV0Variables[ 7] = v0->MomPosZ(); //cptrack->Pz();
3863  fCandidateV0Variables[ 8] = v0->MomNegX(); //cntrack->Px();
3864  fCandidateV0Variables[ 9] = v0->MomNegY(); //cntrack->Py();
3865  fCandidateV0Variables[10] = v0->MomNegZ(); //cntrack->Pz();
3866  }else{
3867  fCandidateV0Variables[ 5] = v0->MomNegX(); //cntrack->Px();
3868  fCandidateV0Variables[ 6] = v0->MomNegY(); //cntrack->Py();
3869  fCandidateV0Variables[ 7] = v0->MomNegZ(); //cntrack->Pz();
3870  fCandidateV0Variables[ 8] = v0->MomPosX(); //cptrack->Px();
3871  fCandidateV0Variables[ 9] = v0->MomPosY(); //cptrack->Py();
3872  fCandidateV0Variables[10] = v0->MomPosZ(); //cptrack->Pz();
3873  }
3874 
3875  Double_t lPosV0[3];
3876  lPosV0[0] = v0->DecayVertexV0X();
3877  lPosV0[1] = v0->DecayVertexV0Y();
3878  lPosV0[2] = v0->DecayVertexV0Z();
3879  Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
3880  fCandidateV0Variables[11] = decayvertV0;
3881 
3882  Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
3883  Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
3884  if(isparticle){
3885  fCandidateV0Variables[12] = lDcaPosToPrimVertex;
3886  fCandidateV0Variables[13] = lDcaNegToPrimVertex;
3887  }else{
3888  fCandidateV0Variables[12] = lDcaNegToPrimVertex;
3889  fCandidateV0Variables[13] = lDcaPosToPrimVertex;
3890  }
3891  fCandidateV0Variables[14] = v0->DcaV0Daughters();
3892  fCandidateV0Variables[15] = v0->CosPointingAngle(posVtx);
3893  fCandidateV0Variables[16] = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
3894  fCandidateV0Variables[17] = v0->MassK0Short();
3895 
3896  if(fAnalCuts->GetUseLambdaPID())
3897  {
3898  if(isparticle){
3899  Double_t nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
3900  Double_t nSigmaTPCv0pi = fAnalCuts->GetPidPion()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
3901  fCandidateV0Variables[18] = nSigmaTPCv0pr;
3902  fCandidateV0Variables[19] = nSigmaTPCv0pi;
3903  }else{
3904  Double_t nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
3905  Double_t nSigmaTPCv0pi = fAnalCuts->GetPidPion()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
3906  fCandidateV0Variables[18] = nSigmaTPCv0pr;
3907  fCandidateV0Variables[19] = nSigmaTPCv0pi;
3908  }
3909  }
3910  if(isparticle){
3911  fCandidateV0Variables[20] = cptrack->GetTPCClusterInfo(2,1);
3912  fCandidateV0Variables[21] = cntrack->GetTPCClusterInfo(2,1);
3913  if(cptrack->GetTPCNclsF()>0)
3914  fCandidateV0Variables[22] = (Float_t) cptrack->GetTPCClusterInfo(2,1)/(Float_t)cptrack->GetTPCNclsF();
3915  if(cntrack->GetTPCNclsF()>0)
3916  fCandidateV0Variables[23] =(Float_t) cntrack->GetTPCClusterInfo(2,1)/(Float_t)cntrack->GetTPCNclsF();
3917  }else{
3918  fCandidateV0Variables[20] = cntrack->GetTPCClusterInfo(2,1);
3919  fCandidateV0Variables[21] = cptrack->GetTPCClusterInfo(2,1);
3920  if(cntrack->GetTPCNclsF()>0)
3921  fCandidateV0Variables[22] = (Float_t) cntrack->GetTPCClusterInfo(2,1)/(Float_t)cntrack->GetTPCNclsF();
3922  if(cptrack->GetTPCNclsF()>0)
3923  fCandidateV0Variables[23] = (Float_t) cptrack->GetTPCClusterInfo(2,1)/(Float_t)cptrack->GetTPCNclsF();
3924  }
3925  fCandidateV0Variables[24] = v0pdgcode;
3926  fCandidateV0Variables[25] = v0motherpdgcode;
3927  fCandidateV0Variables[26] = mcv0px;
3928  fCandidateV0Variables[27] = mcv0py;
3929  fCandidateV0Variables[28] = mcv0pz;
3930  fCandidateV0Variables[29] = mcv0vertx;
3931  fCandidateV0Variables[30] = mcv0verty;
3932  fCandidateV0Variables[31] = mcv0vertz;
3937 
3938 
3939  fV0VariablesTree->Fill();
3940 }
3943 {
3947 
3948  const char* nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
3949  fMCVariablesTree = new TTree(nameoutput,"MC variables tree");
3950  Int_t nVar = 11;
3951  fCandidateMCVariables = new Float_t [nVar];
3952  TString * fCandidateVariableNames = new TString[nVar];
3953 
3954  fCandidateVariableNames[ 0]="Centrality";
3955  fCandidateVariableNames[ 1]="DecayType";
3956  fCandidateVariableNames[ 2]="LcPx";
3957  fCandidateVariableNames[ 3]="LcPy";
3958  fCandidateVariableNames[ 4]="LcPz";
3959  fCandidateVariableNames[ 5]="ElePx";
3960  fCandidateVariableNames[ 6]="ElePy";
3961  fCandidateVariableNames[ 7]="ElePz";
3962  fCandidateVariableNames[ 8]="V0Px";
3963  fCandidateVariableNames[ 9]="V0Py";
3964  fCandidateVariableNames[10]="V0Pz";
3965 
3966  for (Int_t ivar=0; ivar<nVar; ivar++) {
3967  fMCVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
3968  }
3969  return;
3970 }
3972 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCROOTObjects(AliAODMCParticle *mcpart, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype)
3973 {
3974  //
3976  //
3977  if(!mcpart) return;
3978  if(!mcepart) return;
3979  if(!mcv0part) return;
3980 
3981  for(Int_t i=0;i<11;i++){
3982  fCandidateMCVariables[i] = -9999.;
3983  }
3984 
3986  fCandidateMCVariables[ 1] = (Float_t) decaytype;
3987  fCandidateMCVariables[ 2] = mcpart->Px();
3988  fCandidateMCVariables[ 3] = mcpart->Py();
3989  fCandidateMCVariables[ 4] = mcpart->Pz();
3990  fCandidateMCVariables[ 5] = mcepart->Px();
3991  fCandidateMCVariables[ 6] = mcepart->Py();
3992  fCandidateMCVariables[ 7] = mcepart->Pz();
3993  fCandidateMCVariables[ 8] = mcv0part->Px();
3994  fCandidateMCVariables[ 9] = mcv0part->Py();
3995  fCandidateMCVariables[10] = mcv0part->Pz();
3996 
3997  Double_t epx = mcepart->Px();
3998  Double_t epy = mcepart->Py();
3999  Double_t epz = mcepart->Pz();
4000  Double_t eE = sqrt(epx*epx+epy*epy+epz*epz+0.000511*0.000511);
4001  Double_t v0px = mcv0part->Px();
4002  Double_t v0py = mcv0part->Py();
4003  Double_t v0pz = mcv0part->Pz();
4004  Double_t v0E = sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz+1.1157*1.1157);
4005 
4006  Double_t InvMassEleLambda = sqrt(pow(eE+v0E,2)-pow(epx+v0px,2)-pow(epy+v0py,2)-pow(epz+v0pz,2));
4007 
4008  Double_t cont[3];
4009  cont[0] = InvMassEleLambda;
4010  cont[1] = mcpart->Pt();
4011  cont[2] = fCentrality;
4012  Double_t cont2[3];
4013  cont2[0] = InvMassEleLambda;
4014  cont2[1] = mcepart->Pt();
4015  cont2[2] = fCentrality;
4016  Double_t cont_eleptvseta[3];
4017  cont_eleptvseta[0] = mcepart->Pt();
4018  cont_eleptvseta[1] = mcepart->Eta();
4019  cont_eleptvseta[2] = fCentrality;
4020  Double_t cont_eleptvslambdapt[3];
4021  cont_eleptvslambdapt[0] = mcepart->Pt();
4022  cont_eleptvslambdapt[1] = mcv0part->Pt();
4023  cont_eleptvslambdapt[2] = fCentrality;
4024  Double_t cont_eleptvslambdaptvslcpt[4];
4025  cont_eleptvslambdaptvslcpt[0] = mcepart->Pt();
4026  cont_eleptvslambdaptvslcpt[1] = mcv0part->Pt();
4027  cont_eleptvslambdaptvslcpt[2] = mcpart->Pt();
4028  cont_eleptvslambdaptvslcpt[3] = fCentrality;
4029  Double_t contmc[3];
4030  contmc[0] = mcpart->Pt();
4031  contmc[1] = mcpart->Y();
4032  contmc[2] = fCentrality;
4033  Double_t contmcele[3];
4034  contmcele[0] = mcepart->Pt();
4035  contmcele[1] = mcepart->Eta();
4036  contmcele[2] = fCentrality;
4037  Double_t contmc_withele[3];
4038  contmc_withele[0] = mcpart->Pt();
4039  contmc_withele[1] = mcpart->Y();
4040  contmc_withele[2] = mcepart->Y();
4041 
4042  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
4043  Float_t etamin, etamax;
4044  esdcuts->GetEtaRange(etamin,etamax);
4045 
4046  if(decaytype==0){
4047  fHistoLcMCGen->Fill(contmc);
4048  if(mcpart->GetPdgCode()>0) fHistoLcMCGen1->Fill(contmc);
4049  if(mcpart->GetPdgCode()<0) fHistoLcMCGen2->Fill(contmc);
4050  fHistoLcMCGenWithEleA->Fill(contmc_withele);
4051  if(fabs(mcepart->Eta())<0.8){
4052  fHistoLcMCGenWithEleB->Fill(mcpart->Pt(),mcepart->Pt());
4053  }
4054  fHistoLcElectronMCGen->Fill(contmcele);
4055  if(mcepart->GetPdgCode()<0) fHistoLcElectronMCGen1->Fill(contmcele);
4056  if(mcepart->GetPdgCode()>0) fHistoLcElectronMCGen2->Fill(contmcele);
4057  fHistoEleLambdaMassMCGen->Fill(cont);
4058  if(fabs(mcepart->Eta())<etamax){
4059  fHistoEleLambdaMassvsElePtMCGen->Fill(cont2);
4060  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtMCGen1->Fill(cont2);
4061  else fHistoEleLambdaMassvsElePtMCGen2->Fill(cont2);
4062  if(InvMassEleLambda<2.3){
4063  fHistoElePtMCGen->Fill(mcepart->Pt(),fCentrality);
4064  fHistoElePtvsEtaMCGen->Fill(cont_eleptvseta);
4065  fHistoElePtvsLambdaPtMCGen->Fill(cont_eleptvslambdapt);
4066  }
4067  }
4068  if(fabs(mcpart->Y())<0.7){
4069  if(InvMassEleLambda<2.3){
4070  fHistoElePtvsLambdaPtMCLcGen->Fill(cont_eleptvslambdapt);
4071  fHistoElePtvsLambdaPtvsLcPtMCGen->Fill(cont_eleptvslambdaptvslcpt);
4072  }
4073  }
4074  }else if(decaytype==1){
4075  fHistoFeedDownXic0MCGen->Fill(contmc);
4076  if(mcpart->GetPdgCode()>0) fHistoFeedDownXic0MCGen1->Fill(contmc);
4077  if(mcpart->GetPdgCode()<0) fHistoFeedDownXic0MCGen2->Fill(contmc);
4079  fHistoElectronFeedDownXic0MCGen->Fill(contmcele);
4080  if(mcepart->GetPdgCode()<0) fHistoElectronFeedDownXic0MCGen1->Fill(contmcele);
4081  if(mcepart->GetPdgCode()>0) fHistoElectronFeedDownXic0MCGen2->Fill(contmcele);
4082  if(fabs(mcepart->Eta())<etamax){
4084  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1->Fill(cont2);
4086  if(InvMassEleLambda<2.3){
4087  fHistoElePtFeeddownXic0MCGen->Fill(mcepart->Pt(),fCentrality);
4088  fHistoElePtvsEtaFeeddownXic0MCGen->Fill(cont_eleptvseta);
4089  fHistoElePtvsLambdaPtFeeddownXic0MCGen->Fill(cont_eleptvslambdapt);
4090  }
4091  }
4092  }else if(decaytype==2){
4093  fHistoFeedDownXicPlusMCGen->Fill(contmc);
4094  if(mcpart->GetPdgCode()>0) fHistoFeedDownXicPlusMCGen1->Fill(contmc);
4095  if(mcpart->GetPdgCode()<0) fHistoFeedDownXicPlusMCGen2->Fill(contmc);
4097  fHistoElectronFeedDownXicPlusMCGen->Fill(contmcele);
4098  if(mcepart->GetPdgCode()<0) fHistoElectronFeedDownXicPlusMCGen1->Fill(contmcele);
4099  if(mcepart->GetPdgCode()>0) fHistoElectronFeedDownXicPlusMCGen2->Fill(contmcele);
4100  if(fabs(mcepart->Eta())<etamax){
4102  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1->Fill(cont2);
4104  if(InvMassEleLambda<2.3){
4105  fHistoElePtFeeddownXicPlusMCGen->Fill(mcepart->Pt(),fCentrality);
4106  fHistoElePtvsEtaFeeddownXicPlusMCGen->Fill(cont_eleptvseta);
4107  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen->Fill(cont_eleptvslambdapt);
4108  }
4109  }
4110  }else if(decaytype==3){
4111  fHistoFeedDownSigmaMCGen->Fill(contmc);
4112  if(mcpart->GetPdgCode()>0) fHistoFeedDownSigmaMCGen1->Fill(contmc);
4113  if(mcpart->GetPdgCode()<0) fHistoFeedDownSigmaMCGen2->Fill(contmc);
4114  }else if(decaytype==10){
4115  fHistoLbElectronMCGen->Fill(contmcele);
4116  if(mcepart->GetPdgCode()<0) fHistoLbElectronMCGen1->Fill(contmcele);
4117  if(mcepart->GetPdgCode()>0) fHistoLbElectronMCGen2->Fill(contmcele);
4118  fHistoLbMCGen->Fill(contmc);
4119  if(mcpart->GetPdgCode()>0) fHistoLbMCGen1->Fill(contmc);
4120  if(mcpart->GetPdgCode()<0) fHistoLbMCGen2->Fill(contmc);
4121 
4122  fHistoLcMCGenWithEleA->Fill(contmc_withele);
4123  if(fabs(mcepart->Eta())<0.8){
4124  fHistoLcMCGenWithEleB->Fill(mcpart->Pt(),mcepart->Pt());
4125  }
4126  }else if(decaytype==11){
4127  fHistoElectronFeedDownXibMCGen->Fill(contmcele);
4128  if(mcepart->GetPdgCode()<0) fHistoElectronFeedDownXibMCGen1->Fill(contmcele);
4129  if(mcepart->GetPdgCode()>0) fHistoElectronFeedDownXibMCGen2->Fill(contmcele);
4130  }
4131 
4133  fMCVariablesTree->Fill();
4134 }
4137 {
4138  //
4139  // Define electron tree variables
4140  //
4141 
4142  const char* nameoutput = GetOutputSlot(9)->GetContainer()->GetName();
4143  fMCEleVariablesTree = new TTree(nameoutput,"MC Ele variables tree");
4144  Int_t nVar = 8;
4145  fCandidateMCEleVariables = new Float_t [nVar];
4146  TString * fCandidateVariableNames = new TString[nVar];
4147 
4148  fCandidateVariableNames[ 0]="Centrality";
4149  fCandidateVariableNames[ 1]="ElePx";
4150  fCandidateVariableNames[ 2]="ElePy";
4151  fCandidateVariableNames[ 3]="ElePz";
4152  fCandidateVariableNames[ 4]="ElePdgCode";
4153  fCandidateVariableNames[ 5]="EleMotherPdgCode";
4154  fCandidateVariableNames[ 6]="RunNumber";
4155  fCandidateVariableNames[ 7]="EvNumber";
4156 
4157  for (Int_t ivar=0; ivar<nVar; ivar++) {
4158  fMCEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
4159  }
4160  return;
4161 }
4163 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
4164 {
4165  //
4166  // Fill tree depending on fWriteMCVariableTree
4167  //
4168  if(!mcepart) return;
4169 
4170  Int_t pdgarray_ele[100], labelarray_ele[100], ngen_ele;
4171  GetMCDecayHistory(mcepart,mcArray,pdgarray_ele,labelarray_ele,ngen_ele);
4172  Bool_t ele_from_bottom = HaveBottomInHistory(pdgarray_ele);
4173  Bool_t ele_from_charm = HaveCharmInHistory(pdgarray_ele);
4174  //Int_t semi_flag = FromSemileptonicDecays(pdgarray_ele);
4175  Int_t semi_flag = 0;
4176  if(pdgarray_ele[0]>400&&pdgarray_ele[0]<450) semi_flag = 1;
4177  if(pdgarray_ele[0]>4000&&pdgarray_ele[0]<4500) semi_flag = 1;
4178  if(pdgarray_ele[0]>500&&pdgarray_ele[0]<550) semi_flag = 2;
4179  if(pdgarray_ele[0]>5000&&pdgarray_ele[0]<5500) semi_flag = 2;
4180 
4181  Double_t contmc[3];
4182  contmc[0] = mcepart->Pt();
4183  contmc[1] = mcepart->Eta();
4184  contmc[2] = fCentrality;
4185 
4186  if(semi_flag==1 && !ele_from_bottom){
4187  fHistoCharmElectronMCGen->Fill(contmc);
4188  }
4189  if(semi_flag==1 && ele_from_bottom){
4190  fHistoBottomElectronMCGen->Fill(contmc);
4191  }
4192  if(semi_flag==2 ){
4193  fHistoBottomElectronMCGen->Fill(contmc);
4194  }
4195 
4196  Bool_t hfe_flag = kFALSE;
4197  Int_t labemother = mcepart->GetMother();
4198  Int_t pdgmotherele = -9999;
4199  if(labemother>=0){
4200  AliAODMCParticle *motherele = (AliAODMCParticle*)mcArray->At(labemother);
4201  pdgmotherele = motherele->GetPdgCode();
4202  if(abs(pdgmotherele)>4000&&abs(pdgmotherele)<4400){
4203  hfe_flag = kTRUE;
4204  }
4205  }
4206 
4207  if(!hfe_flag) return;
4208 
4209  fHistoElectronMCGen->Fill(contmc);
4210 
4211  for(Int_t i=0;i<8;i++){
4212  fCandidateMCEleVariables[i] = -9999.;
4213  }
4214 
4216  fCandidateMCEleVariables[ 1] = mcepart->Px();
4217  fCandidateMCEleVariables[ 2] = mcepart->Py();
4218  fCandidateMCEleVariables[ 3] = mcepart->Pz();
4219  fCandidateMCEleVariables[ 4] = mcepart->GetPdgCode();
4220  fCandidateMCEleVariables[ 5] = pdgmotherele;
4223 
4224 // if(fWriteMCVariableTree && fWriteEachVariableTree && mcepart->Pt()>0.4 && fabs(mcepart->Eta())<1.0 )
4225 // fMCEleVariablesTree->Fill();
4226 
4227 }
4230 {
4231  //
4232  // Define Mc v0 tree variables
4233  //
4234 
4235  const char* nameoutput = GetOutputSlot(10)->GetContainer()->GetName();
4236  fMCV0VariablesTree = new TTree(nameoutput,"MC v0 variables tree");
4237  Int_t nVar = 8;
4238  fCandidateMCV0Variables = new Float_t [nVar];
4239  TString * fCandidateVariableNames = new TString[nVar];
4240 
4241  fCandidateVariableNames[ 0]="Centrality";
4242  fCandidateVariableNames[ 1]="V0Px";
4243  fCandidateVariableNames[ 2]="V0Py";
4244  fCandidateVariableNames[ 3]="V0Pz";
4245  fCandidateVariableNames[ 4]="V0PdgCode";
4246  fCandidateVariableNames[ 5]="V0MotherPdgCode";
4247  fCandidateVariableNames[ 6]="RunNumber";
4248  fCandidateVariableNames[ 7]="EvNumber";
4249 
4250  for (Int_t ivar=0; ivar<nVar; ivar++) {
4251  fMCV0VariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCV0Variables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
4252  }
4253  return;
4254 }
4256 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCV0ROOTObjects(AliAODMCParticle *mcv0part, TClonesArray *mcArray)
4257 {
4258  //
4259  // Fill histograms or tree depending on fWriteMCVariableTree
4260  //
4261  if(!mcv0part) return;
4262 
4263  for(Int_t i=0;i<8;i++){
4264  fCandidateMCV0Variables[i] = -9999.;
4265  }
4266 
4267  Bool_t hfv0_flag = kFALSE;
4268  Int_t labv0mother = mcv0part->GetMother();
4269  Int_t pdgmotherv0 = -9999;
4270  if(labv0mother>=0){
4271  AliAODMCParticle *motherv0 = (AliAODMCParticle*)mcArray->At(labv0mother);
4272  if(motherv0){
4273  pdgmotherv0 = motherv0->GetPdgCode();
4274  if(abs(pdgmotherv0)>4000&&abs(pdgmotherv0)<4400){
4275  hfv0_flag = kTRUE;
4276  }
4277  }
4278  }
4279  if(!hfv0_flag) return;
4280 
4281  Double_t contmc[3];
4282  contmc[0] = mcv0part->Pt();
4283  contmc[1] = mcv0part->Eta();
4284  contmc[2] = fCentrality;
4285  fHistoLambdaMCGen->Fill(contmc);
4286 
4288  fCandidateMCV0Variables[ 1] = mcv0part->Px();
4289  fCandidateMCV0Variables[ 2] = mcv0part->Py();
4290  fCandidateMCV0Variables[ 3] = mcv0part->Pz();
4291  fCandidateMCV0Variables[ 4] = mcv0part->GetPdgCode();
4292  fCandidateMCV0Variables[ 5] = pdgmotherv0;
4295 
4296  if(fWriteMCVariableTree && fWriteEachVariableTree && mcv0part->Pt()>0.4 && fabs(mcv0part->Eta())<1.0 )
4297  fMCV0VariablesTree->Fill();
4298 }
4299 
4300 
4303  //
4305  //
4306 
4307  fCEvents = new TH1F("fCEvents","conter",18,-0.5,17.5);
4308  fCEvents->SetStats(kTRUE);
4309  fCEvents->GetXaxis()->SetBinLabel(1,"X1");
4310  fCEvents->GetXaxis()->SetBinLabel(2,"Analyzed events");
4311  fCEvents->GetXaxis()->SetBinLabel(3,"AliAODVertex exists");
4312  fCEvents->GetXaxis()->SetBinLabel(4,"TriggerOK");
4313  fCEvents->GetXaxis()->SetBinLabel(5,"IsEventSelected");
4314  fCEvents->GetXaxis()->SetBinLabel(6,"CascadesHF exists");
4315  fCEvents->GetXaxis()->SetBinLabel(7,"MCarray exists");
4316  fCEvents->GetXaxis()->SetBinLabel(8,"MCheader exists");
4317  fCEvents->GetXaxis()->SetBinLabel(9,"triggerClass!=CINT1");
4318  fCEvents->GetXaxis()->SetBinLabel(10,"triggerMask!=kAnyINT");
4319  fCEvents->GetXaxis()->SetBinLabel(11,"triggerMask!=kAny");
4320  fCEvents->GetXaxis()->SetBinLabel(12,"vtxTitle.Contains(Z)");
4321  fCEvents->GetXaxis()->SetBinLabel(13,"vtxTitle.Contains(3D)");
4322  fCEvents->GetXaxis()->SetBinLabel(14,"vtxTitle.Doesn'tContain(Z-3D)");
4323  fCEvents->GetXaxis()->SetBinLabel(15,Form("zVtx<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
4324  fCEvents->GetXaxis()->SetBinLabel(16,"!IsEventSelected");
4325  fCEvents->GetXaxis()->SetBinLabel(17,"triggerMask!=kAnyINT || triggerClass!=CINT1");
4326  fCEvents->GetXaxis()->SetBinLabel(18,Form("zVtxMC<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
4327  //fCEvents->GetXaxis()->SetTitle("");
4328  fCEvents->GetYaxis()->SetTitle("counts");
4329 
4330  fHTrigger = new TH1F("fHTrigger","counter",18,-0.5,17.5);
4331  fHTrigger->SetStats(kTRUE);
4332  fHTrigger->GetXaxis()->SetBinLabel(1,"X1");
4333  fHTrigger->GetXaxis()->SetBinLabel(2,"kMB");
4334  fHTrigger->GetXaxis()->SetBinLabel(3,"kSemiCentral");
4335  fHTrigger->GetXaxis()->SetBinLabel(4,"kCentral");
4336  fHTrigger->GetXaxis()->SetBinLabel(5,"kINT7");
4337  fHTrigger->GetXaxis()->SetBinLabel(6,"kEMC7");
4338  //fHTrigger->GetXaxis()->SetBinLabel(7,"Space");
4339  fHTrigger->GetXaxis()->SetBinLabel(8,"kMB|kSemiCentral|kCentral");
4340  fHTrigger->GetXaxis()->SetBinLabel(9,"kINT7|kEMC7");
4341  fHTrigger->GetXaxis()->SetBinLabel(11,"kMB&kSemiCentral");
4342  fHTrigger->GetXaxis()->SetBinLabel(12,"kMB&kCentral");
4343  fHTrigger->GetXaxis()->SetBinLabel(13,"kINT7&kEMC7");
4344 
4345  fHCentrality = new TH1F("fHCentrality","conter",100,0.,100.);
4346  fHNTrackletvsZ = new TH2F("fHNTrackletvsZ","N_{tracklet} vs z",30,-15.,15.,120,-0.5,119.5);
4347  fHNTrackletCorrvsZ = new TH2F("fHNTrackletCorrvsZ","N_{tracklet} vs z",30,-15.,15.,120,-0.5,119.5);
4348 
4349  fHistoPoolNumberOfDumps = new TH1F("fHistoPoolNumberOfDumps","Number of dumps",1000,-0.5,999.5);
4351  fHistoPoolNumberOfResets = new TH1F("fHistoPoolNumberOfResets","Number of dumps",1000,-0.5,999.5);
4352 
4353  fOutput->Add(fCEvents);
4354  fOutput->Add(fHTrigger);
4355  fOutput->Add(fHCentrality);
4356  fOutput->Add(fHNTrackletvsZ);
4360 
4361  return;
4362 }
4363 //__________________________________________________________________________
4365 {
4366  //
4368  //
4369 
4370  //------------------------------------------------
4371  // Basic histogram
4372  //------------------------------------------------
4373  Int_t bins_base[3]= {23,100 ,10};
4374  Double_t xmin_base[3]={1.1,0 ,0.00};
4375  Double_t xmax_base[3]={5.7,20. ,100};
4376  fHistoEleLambdaMass = new THnSparseF("fHistoEleLambdaMass","",3,bins_base,xmin_base,xmax_base);
4378  fHistoEleLambdaMassRS = new THnSparseF("fHistoEleLambdaMassRS","",3,bins_base,xmin_base,xmax_base);
4380  fHistoEleLambdaMassRS1 = new THnSparseF("fHistoEleLambdaMassRS1","",3,bins_base,xmin_base,xmax_base);
4382  fHistoEleLambdaMassRS2 = new THnSparseF("fHistoEleLambdaMassRS2","",3,bins_base,xmin_base,xmax_base);
4384  fHistoEleLambdaMassWS = new THnSparseF("fHistoEleLambdaMassWS","",3,bins_base,xmin_base,xmax_base);
4386  fHistoEleLambdaMassWS1 = new THnSparseF("fHistoEleLambdaMassWS1","",3,bins_base,xmin_base,xmax_base);
4388  fHistoEleLambdaMassWS2 = new THnSparseF("fHistoEleLambdaMassWS2","",3,bins_base,xmin_base,xmax_base);
4390  fHistoEleLambdaMassRSMix = new THnSparseF("fHistoEleLambdaMassRSMix","",3,bins_base,xmin_base,xmax_base);
4392  fHistoEleLambdaMassRSMix1 = new THnSparseF("fHistoEleLambdaMassRSMix1","",3,bins_base,xmin_base,xmax_base);
4394  fHistoEleLambdaMassRSMix2 = new THnSparseF("fHistoEleLambdaMassRSMix2","",3,bins_base,xmin_base,xmax_base);
4396  fHistoEleLambdaMassWSMix = new THnSparseF("fHistoEleLambdaMassWSMix","",3,bins_base,xmin_base,xmax_base);
4398  fHistoEleLambdaMassWSMix1 = new THnSparseF("fHistoEleLambdaMassWSMix1","",3,bins_base,xmin_base,xmax_base);
4400  fHistoEleLambdaMassWSMix2 = new THnSparseF("fHistoEleLambdaMassWSMix2","",3,bins_base,xmin_base,xmax_base);
4402  fHistoEleLambdaMassRSSide = new THnSparseF("fHistoEleLambdaMassRSSide","",3,bins_base,xmin_base,xmax_base);
4404  fHistoEleLambdaMassRSSide1 = new THnSparseF("fHistoEleLambdaMassRSSide1","",3,bins_base,xmin_base,xmax_base);
4406  fHistoEleLambdaMassRSSide2 = new THnSparseF("fHistoEleLambdaMassRSSide2","",3,bins_base,xmin_base,xmax_base);
4408  fHistoEleLambdaMassWSSide = new THnSparseF("fHistoEleLambdaMassWSSide","",3,bins_base,xmin_base,xmax_base);
4410  fHistoEleLambdaMassWSSide1 = new THnSparseF("fHistoEleLambdaMassWSSide1","",3,bins_base,xmin_base,xmax_base);
4412  fHistoEleLambdaMassWSSide2 = new THnSparseF("fHistoEleLambdaMassWSSide2","",3,bins_base,xmin_base,xmax_base);
4414 
4415  fHistoEleLambdaMassRSAway = new THnSparseF("fHistoEleLambdaMassRSAway","",3,bins_base,xmin_base,xmax_base);
4417  fHistoEleLambdaMassRS1Away = new THnSparseF("fHistoEleLambdaMassRS1Away","",3,bins_base,xmin_base,xmax_base);
4419  fHistoEleLambdaMassRS2Away = new THnSparseF("fHistoEleLambdaMassRS2Away","",3,bins_base,xmin_base,xmax_base);
4421  fHistoEleLambdaMassWSAway = new THnSparseF("fHistoEleLambdaMassWSAway","",3,bins_base,xmin_base,xmax_base);
4423  fHistoEleLambdaMassWS1Away = new THnSparseF("fHistoEleLambdaMassWS1Away","",3,bins_base,xmin_base,xmax_base);
4425  fHistoEleLambdaMassWS2Away = new THnSparseF("fHistoEleLambdaMassWS2Away","",3,bins_base,xmin_base,xmax_base);
4427  fHistoEleLambdaMassRSMixAway = new THnSparseF("fHistoEleLambdaMassRSMixAway","",3,bins_base,xmin_base,xmax_base);
4429  fHistoEleLambdaMassRSMix1Away = new THnSparseF("fHistoEleLambdaMassRSMix1Away","",3,bins_base,xmin_base,xmax_base);
4431  fHistoEleLambdaMassRSMix2Away = new THnSparseF("fHistoEleLambdaMassRSMix2Away","",3,bins_base,xmin_base,xmax_base);
4433  fHistoEleLambdaMassWSMixAway = new THnSparseF("fHistoEleLambdaMassWSMixAway","",3,bins_base,xmin_base,xmax_base);
4435  fHistoEleLambdaMassWSMix1Away = new THnSparseF("fHistoEleLambdaMassWSMix1Away","",3,bins_base,xmin_base,xmax_base);
4437  fHistoEleLambdaMassWSMix2Away = new THnSparseF("fHistoEleLambdaMassWSMix2Away","",3,bins_base,xmin_base,xmax_base);
4439  fHistoEleLambdaMassRSSideAway = new THnSparseF("fHistoEleLambdaMassRSSideAway","",3,bins_base,xmin_base,xmax_base);
4441  fHistoEleLambdaMassRSSide1Away = new THnSparseF("fHistoEleLambdaMassRSSide1Away","",3,bins_base,xmin_base,xmax_base);
4443  fHistoEleLambdaMassRSSide2Away = new THnSparseF("fHistoEleLambdaMassRSSide2Away","",3,bins_base,xmin_base,xmax_base);
4445  fHistoEleLambdaMassWSSideAway = new THnSparseF("fHistoEleLambdaMassWSSideAway","",3,bins_base,xmin_base,xmax_base);
4447  fHistoEleLambdaMassWSSide1Away = new THnSparseF("fHistoEleLambdaMassWSSide1Away","",3,bins_base,xmin_base,xmax_base);
4449  fHistoEleLambdaMassWSSide2Away = new THnSparseF("fHistoEleLambdaMassWSSide2Away","",3,bins_base,xmin_base,xmax_base);
4451 
4452  Int_t bins_base_elept[3]= {10,100 ,10};
4453  Double_t xmin_base_elept[3]={1.1,0 ,0.00};
4454  Double_t xmax_base_elept[3]={3.1,10. ,100};
4455  fHistoEleLambdaMassvsElePtRS = new THnSparseF("fHistoEleLambdaMassvsElePtRS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4457  fHistoEleLambdaMassvsElePtWS = new THnSparseF("fHistoEleLambdaMassvsElePtWS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4459  fHistoEleLambdaMassvsElePtRSMix = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4461  fHistoEleLambdaMassvsElePtWSMix = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4463  fHistoEleLambdaMassvsElePtRSSide = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4465  fHistoEleLambdaMassvsElePtWSSide = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4467  fHistoEleLambdaMassvsElePtRS1 = new THnSparseF("fHistoEleLambdaMassvsElePtRS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4469  fHistoEleLambdaMassvsElePtWS1 = new THnSparseF("fHistoEleLambdaMassvsElePtWS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4471  fHistoEleLambdaMassvsElePtRSMix1 = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4473  fHistoEleLambdaMassvsElePtWSMix1 = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4475  fHistoEleLambdaMassvsElePtRSSide1 = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4477  fHistoEleLambdaMassvsElePtWSSide1 = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4479  fHistoEleLambdaMassvsElePtRS2 = new THnSparseF("fHistoEleLambdaMassvsElePtRS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4481  fHistoEleLambdaMassvsElePtWS2 = new THnSparseF("fHistoEleLambdaMassvsElePtWS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4483  fHistoEleLambdaMassvsElePtRSMix2 = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4485  fHistoEleLambdaMassvsElePtWSMix2 = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4487  fHistoEleLambdaMassvsElePtRSSide2 = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4489  fHistoEleLambdaMassvsElePtWSSide2 = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4491 
4492  fHistoEleLambdaMassMCS = new THnSparseF("fHistoEleLambdaMassMCS","",3,bins_base,xmin_base,xmax_base);
4494  fHistoEleLambdaMassLambdabMCS = new THnSparseF("fHistoEleLambdaMassLambdabMCS","",3,bins_base,xmin_base,xmax_base);
4496  fHistoEleLambdaMassXibMCS = new THnSparseF("fHistoEleLambdaMassXibMCS","",3,bins_base,xmin_base,xmax_base);
4498  fHistoEleLambdaMassMCGen = new THnSparseF("fHistoEleLambdaMassMCGen","",3,bins_base,xmin_base,xmax_base);
4500  fHistoEleLambdaMassvsElePtMCS = new THnSparseF("fHistoEleLambdaMassvsElePtMCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4502  fHistoEleLambdaMassvsElePtMCGen = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4504  fHistoEleLambdaMassvsElePtMCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtMCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4506  fHistoEleLambdaMassvsElePtMCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4508  fHistoEleLambdaMassvsElePtMCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtMCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4510  fHistoEleLambdaMassvsElePtMCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4512 
4513  fHistoElePtRS = new TH2F("fHistoElePtRS","",100,0,10,10,0,100);
4514  fOutputAll->Add(fHistoElePtRS);
4515  fHistoElePtWS = new TH2F("fHistoElePtWS","",100,0.,10.,10,0,100);
4516  fOutputAll->Add(fHistoElePtWS);
4517  fHistoElePtRSMix = new TH2F("fHistoElePtRSMix","",100,0.,10.,10,0,100);
4519  fHistoElePtWSMix = new TH2F("fHistoElePtWSMix","",100,0.,10.,10,0,100);
4521  fHistoElePtMCS = new TH2F("fHistoElePtMCS","",100,0,10,10,0,100);
4522  fOutputAll->Add(fHistoElePtMCS);
4523  fHistoElePtMCGen = new TH2F("fHistoElePtMCGen","",100,0,10,10,0,100);
4525 
4526  Int_t bins_eleptvseta[3]= {10,10 ,10};
4527  Double_t xmin_eleptvseta[3]={0.,-1. ,0.0};
4528  Double_t xmax_eleptvseta[3]={5.,1. ,100};
4529 
4530  fHistoElePtvsEtaRS = new THnSparseF("fHistoElePtvsEtaRS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4532  fHistoElePtvsEtaWS = new THnSparseF("fHistoElePtvsEtaWS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4534  fHistoElePtvsEtaRSMix = new THnSparseF("fHistoElePtvsEtaRSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4536  fHistoElePtvsEtaWSMix = new THnSparseF("fHistoElePtvsEtaWSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4538  fHistoElePtvsEtaMCS = new THnSparseF("fHistoElePtvsEtaMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4540  fHistoElePtvsEtaMCGen = new THnSparseF("fHistoElePtvsEtaMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4542 
4543  Int_t bins_eleptvslambdapt[3]= {10,10 ,10};
4544  Double_t xmin_eleptvslambdapt[3]={0.,0. ,0.0};
4545  Double_t xmax_eleptvslambdapt[3]={5.,5. ,100};
4546 
4547  fHistoElePtvsLambdaPtRS = new THnSparseF("fHistoElePtvsLambdaPtRS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4549  fHistoElePtvsLambdaPtWS = new THnSparseF("fHistoElePtvsLambdaPtWS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4551  fHistoElePtvsLambdaPtRSMix = new THnSparseF("fHistoElePtvsLambdaPtRSMix","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4553  fHistoElePtvsLambdaPtWSMix = new THnSparseF("fHistoElePtvsLambdaPtWSMix","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4555  fHistoElePtvsLambdaPtMCS = new THnSparseF("fHistoElePtvsLambdaPtMCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4557  fHistoElePtvsLambdaPtMCGen = new THnSparseF("fHistoElePtvsLambdaPtMCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4559  fHistoElePtvsLambdaPtMCLcGen = new THnSparseF("fHistoElePtvsLambdaPtMCLcGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4561 
4562  Int_t bins_eleptvslambdaptvslcpt[4]= {10,10,10,10};
4563  Double_t xmin_eleptvslambdaptvslcpt[4]={0.,0.,0.,0.0};
4564  Double_t xmax_eleptvslambdaptvslcpt[4]={5.,5.,10.,100};
4565  fHistoElePtvsLambdaPtvsLcPtMCS = new THnSparseF("fHistoElePtvsLambdaPtvsLcPtMCS","",4,bins_eleptvslambdaptvslcpt,xmin_eleptvslambdaptvslcpt,xmax_eleptvslambdaptvslcpt);
4567  fHistoElePtvsLambdaPtvsLcPtMCGen = new THnSparseF("fHistoElePtvsLambdaPtvsLcPtMCGen","",4,bins_eleptvslambdaptvslcpt,xmin_eleptvslambdaptvslcpt,xmax_eleptvslambdaptvslcpt);
4569 
4570  Int_t bins_allpt[4]= {10,10,20,20};
4571  Double_t xmin_allpt[4]={0.,0.,0.,0.0};
4572  Double_t xmax_allpt[4]={20.,20.,10.,10};
4573  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt = new THnSparseF("fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt","",4,bins_allpt,xmin_allpt,xmax_allpt);
4575 
4576  fHistoEleLambdaPtvsRapidityRS=new TH2F("fHistoEleLambdaPtvsRapidityRS","EleLambda pt vs rap",20,0.,20.,40,-2.,2.);
4578  fHistoEleLambdaPtvsRapidityWS=new TH2F("fHistoEleLambdaPtvsRapidityWS","EleLambda pt vs rap",20,0.,20.,40,-2.,2.);
4580  fHistoEleLambdaPtvsRapidityMCS=new TH2F("fHistoEleLambdaPtvsRapidityMCS","EleLambda pt vs rap",20,0.,20.,40,-2.,2.);
4582 
4583  Int_t bins_eleptvsd0[3]= {10 ,10 ,10};
4584  Double_t xmin_eleptvsd0[3]={0.,-0.2 ,0.0};
4585  Double_t xmax_eleptvsd0[3]={5.,0.2 ,100};
4586 
4587  fHistoElePtvsd0RS = new THnSparseF("fHistoElePtvsd0RS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
4589  fHistoElePtvsd0WS = new THnSparseF("fHistoElePtvsd0WS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
4591  fHistoElePtvsd0RSMix = new THnSparseF("fHistoElePtvsd0RSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
4593  fHistoElePtvsd0WSMix = new THnSparseF("fHistoElePtvsd0WSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
4595  fHistoElePtvsd0MCS = new THnSparseF("fHistoElePtvsd0MCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
4597  fHistoElePtvsd0PromptMCS = new THnSparseF("fHistoElePtvsd0PromptMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
4599  fHistoElePtvsd0BFeeddownMCS = new THnSparseF("fHistoElePtvsd0BFeeddownMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
4601 
4602 
4603  //Feeddown from Xic0
4604  fHistoEleLambdaMassFeeddownXic0MCS = new THnSparseF("fHistoEleLambdaMassFeeddownXic0MCS","",3,bins_base,xmin_base,xmax_base);
4606  fHistoEleLambdaMassFeeddownXic0MCGen = new THnSparseF("fHistoEleLambdaMassFeeddownXic0MCGen","",3,bins_base,xmin_base,xmax_base);
4608  fHistoEleLambdaMassvsElePtFeeddownXic0MCS = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4610  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4612  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4614  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4616  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4618  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4620  fHistoElePtFeeddownXic0MCS = new TH2F("fHistoElePtFeeddownXic0MCS","",100,0,10,10,0,100);
4622  fHistoElePtFeeddownXic0MCGen = new TH2F("fHistoElePtFeeddownXic0MCGen","",100,0,10,10,0,100);
4624  fHistoElePtvsEtaFeeddownXic0MCS = new THnSparseF("fHistoElePtvsEtaFeeddownXic0MCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4626  fHistoElePtvsEtaFeeddownXic0MCGen = new THnSparseF("fHistoElePtvsEtaFeeddownXic0MCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4628  fHistoElePtvsLambdaPtFeeddownXic0MCS = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXic0MCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4630  fHistoElePtvsLambdaPtFeeddownXic0MCGen = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXic0MCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4632 
4633  //Feeddown from XicPlus
4634  fHistoEleLambdaMassFeeddownXicPlusMCS = new THnSparseF("fHistoEleLambdaMassFeeddownXicPlusMCS","",3,bins_base,xmin_base,xmax_base);
4636  fHistoEleLambdaMassFeeddownXicPlusMCGen = new THnSparseF("fHistoEleLambdaMassFeeddownXicPlusMCGen","",3,bins_base,xmin_base,xmax_base);
4638  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4640  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4642  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4644  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4646  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4648  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
4650  fHistoElePtFeeddownXicPlusMCS = new TH2F("fHistoElePtFeeddownXicPlusMCS","",100,0,10,10,0,100);
4652  fHistoElePtFeeddownXicPlusMCGen = new TH2F("fHistoElePtFeeddownXicPlusMCGen","",100,0,10,10,0,100);
4654  fHistoElePtvsEtaFeeddownXicPlusMCS = new THnSparseF("fHistoElePtvsEtaFeeddownXicPlusMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4656  fHistoElePtvsEtaFeeddownXicPlusMCGen = new THnSparseF("fHistoElePtvsEtaFeeddownXicPlusMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
4658  fHistoElePtvsLambdaPtFeeddownXicPlusMCS = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXicPlusMCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4660  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXicPlusMCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
4662 
4663  fHistoBachPt = new TH1F("fHistoBachPt","Bachelor p_{T}",100,0.0,5.0);
4664  fOutputAll->Add(fHistoBachPt);
4665 
4666  //------------------------------------------------
4667  // checking histograms
4668  //------------------------------------------------
4669  fHistoBachPt = new TH1F("fHistoBachPt","Bachelor p_{T}",100,0.0,5.0);
4670  fOutputAll->Add(fHistoBachPt);
4671  fHistoBachPtMCS = new TH1F("fHistoBachPtMCS","Bachelor p_{T}",100,0.0,5.0);
4673  fHistoBachPtMCGen = new TH1F("fHistoBachPtMCGen","Bachelor p_{T}",100,0.0,5.0);
4675  fHistod0Bach = new TH1F("fHistod0Bach","Bachelor d_{0}",100,-0.5,0.5);
4676  fOutputAll->Add(fHistod0Bach);
4677  fHistoLambdaMassvsPt=new TH2F("fHistoLambdaMassvsPt","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
4679  fHistoLambdaMassvsPtMCS=new TH2F("fHistoLambdaMassvsPtMCS","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
4681  fHistoLambdaMassvsPtMCGen=new TH2F("fHistoLambdaMassvsPtMCGen","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
4683  fHistoLambdaPtvsEta=new TH2F("fHistoLambdaPtvsEta","Lambda mass",20,0.,10.,20,-1.,1.);
4685  fHistoLambdaPtvsEtaMCS=new TH2F("fHistoLambdaPtvsEtaMCS","Lambda mass",20,0.,10.,20,-1.,1.);
4687  fHistoLambdaPtvsEtaMCGen=new TH2F("fHistoLambdaPtvsEtaMCGen","Lambda mass",20,0.,10.,20,-1.,1.);
4689  fHistoK0sMassvsPt=new TH2F("fHistoK0sMassvsPt","K0s mass",100,0.497-0.05,0.497+0.05,20,0.,10.);
4691  fHistoLambdaPtvsDl=new TH2F("fHistoLambdaPtvsDl","Lambda pt vs dl",20,0.,10.,20,0.,40.);
4693  fHistoLambdaPtvsDlSide=new TH2F("fHistoLambdaPtvsDlSide","Lambda pt vs dl",20,0.,10.,20,0.,40.);
4695  fHistoLambdaPtvsDlMCS=new TH2F("fHistoLambdaPtvsDlMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
4697  fHistoLambdaPtvsDlFeeddownXi0MCS=new TH2F("fHistoLambdaPtvsDlFeeddownXi0MCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
4699  fHistoLambdaPtvsDlFeeddownXiMinusMCS=new TH2F("fHistoLambdaPtvsDlFeeddownXiMinusMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
4701  fHistoLambdaPtvsDlFeeddownOmegaMCS=new TH2F("fHistoLambdaPtvsDlFeeddownOmegaMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
4703 
4704  Int_t bins_armenteros[3]= {20 ,100 ,200};
4705  Double_t xmin_armenteros[3]={0.,0. ,-1.};
4706  Double_t xmax_armenteros[3]={20.,1. ,1.};
4707  fHistoLambdaArmenteros = new THnSparseF("fHistoLambdaArmenteros","",3,bins_armenteros,xmin_armenteros,xmax_armenteros);
4709  fHistoLambdaArmenterosMCS = new THnSparseF("fHistoLambdaArmenterosMCS","",3,bins_armenteros,xmin_armenteros,xmax_armenteros);
4711 
4712  fHistoElectronTPCPID=new TH2F("fHistoElectronTPCPID","",50,0.,5.,50,-20.,20.);
4714  fHistoElectronTOFPID=new TH2F("fHistoElectronTOFPID","",50,0.,5.,50,-20.,20.);
4716  fHistoElectronTPCSelPID=new TH2F("fHistoElectronTPCSelPID","",50,0.,5.,50,-20.,20.);
4718  fHistoElectronTOFSelPID=new TH2F("fHistoElectronTOFSelPID","",50,0.,5.,50,-20.,20.);
4720  fHistoElectronTPCPIDSelTOF=new TH2F("fHistoElectronTPCPIDSelTOF","",10,0.,5.,500,-10.,10.);
4722  fHistoElectronTPCPIDSelTOFSmallEta=new TH2F("fHistoElectronTPCPIDSelTOFSmallEta","",10,0.,5.,500,-10.,10.);
4724  fHistoElectronTPCPIDSelTOFLargeEta=new TH2F("fHistoElectronTPCPIDSelTOFLargeEta","",10,0.,5.,500,-10.,10.);
4726  fHistoMassConversionsMin=new TH1F("fHistoMassConversionsMin","",500,0,0.5);
4728  fHistoMassConversionsSameSignMin=new TH1F("fHistoMassConversionsSameSignMin","",500,0,0.5);
4730 
4731  for(Int_t i=0;i<8;i++){
4732  fHistoElectronTPCPIDSelTOFEtaDep[i]=new TH2F(Form("fHistoElectronTPCPIDSelTOFEtaDep[%d]",i),"",10,0.,5.,500,-10.,10.);
4734  }
4735  fHistoElectronQovPtvsPhi=new TH2F("fHistoElectronQovPtvsPhi","",70,0.,7.,50,-2.,2.);
4737  fHistoLambdaQovPtvsPhi=new TH2F("fHistoLambdaQovPtvsPhi","",70,0.,7.,50,-2.,2.);
4739 
4740  Int_t bins_lcmcgen_withelea[3]= {20 ,100 ,100};
4741  Double_t xmin_lcmcgen_withelea[3]={0.,-5.,-5.};
4742  Double_t xmax_lcmcgen_withelea[3]={20.,5.,5.};
4743  fHistoLcMCGenWithEleA = new THnSparseF("fHistoLcMCGenWithEleA","",3,bins_lcmcgen_withelea,xmin_lcmcgen_withelea,xmax_lcmcgen_withelea);
4745  fHistoLcMCGenWithEleB = new TH2D("fHistoLcMCGenWithEleB","",100,0.,20.,100,0.,10.);
4747 
4748  fHistoLbMCGenWithEleA = new THnSparseF("fHistoLbMCGenWithEleA","",3,bins_lcmcgen_withelea,xmin_lcmcgen_withelea,xmax_lcmcgen_withelea);
4750  fHistoLbMCGenWithEleB = new TH2D("fHistoLbMCGenWithEleB","",100,0.,20.,100,0.,10.);
4752 
4753  Int_t bins_lbmcgen_withlc[3]= {50 ,100 ,100};
4754  Double_t xmin_lbmcgen_withlc[3]={0.,-5.,-5.};
4755  Double_t xmax_lbmcgen_withlc[3]={50.,5.,5.};
4756  fHistoLbMCGenWithLambdac = new THnSparseF("fHistoLbMCGenWithLambdac","",3,bins_lbmcgen_withlc,xmin_lbmcgen_withlc,xmax_lbmcgen_withlc);
4758 
4759  Int_t bins_lcmcgen[3]= {100 ,20 ,10};
4760  Double_t xmin_lcmcgen[3]={0.,-1.0 ,0.0};
4761  Double_t xmax_lcmcgen[3]={20.,1.0 ,100};
4762  Int_t bins_lbmcgen[3]= {100 ,20 ,10};
4763  Double_t xmin_lbmcgen[3]={0.,-1.0 ,0.0};
4764  Double_t xmax_lbmcgen[3]={50.,1.0 ,100};
4765  fHistoLcMCGen = new THnSparseF("fHistoLcMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4766  fOutputAll->Add(fHistoLcMCGen);
4767  fHistoLcMCGen1 = new THnSparseF("fHistoLcMCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4768  fOutputAll->Add(fHistoLcMCGen1);
4769  fHistoLcMCGen2 = new THnSparseF("fHistoLcMCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4770  fOutputAll->Add(fHistoLcMCGen2);
4771  fHistoLbMCGen = new THnSparseF("fHistoLbMCGen","",3,bins_lbmcgen,xmin_lbmcgen,xmax_lbmcgen);
4772  fOutputAll->Add(fHistoLbMCGen);
4773  fHistoLbMCGen1 = new THnSparseF("fHistoLbMCGen1","",3,bins_lbmcgen,xmin_lbmcgen,xmax_lbmcgen);
4774  fOutputAll->Add(fHistoLbMCGen1);
4775  fHistoLbMCGen2 = new THnSparseF("fHistoLbMCGen2","",3,bins_lbmcgen,xmin_lbmcgen,xmax_lbmcgen);
4776  fOutputAll->Add(fHistoLbMCGen2);
4777  fHistoFeedDownXic0MCGen = new THnSparseF("fHistoFeedDownXic0MCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4779  fHistoFeedDownXic0MCGen1 = new THnSparseF("fHistoFeedDownXic0MCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4781  fHistoFeedDownXic0MCGen2 = new THnSparseF("fHistoFeedDownXic0MCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4783  fHistoFeedDownXicPlusMCGen = new THnSparseF("fHistoFeedDownXicPlusMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4785  fHistoFeedDownXicPlusMCGen1 = new THnSparseF("fHistoFeedDownXicPlusMCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4787  fHistoFeedDownXicPlusMCGen2 = new THnSparseF("fHistoFeedDownXicPlusMCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4789  fHistoFeedDownSigmaMCGen = new THnSparseF("fHistoFeedDownSigmaMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4791  fHistoFeedDownSigmaMCGen1 = new THnSparseF("fHistoFeedDownSigmaMCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4793  fHistoFeedDownSigmaMCGen2 = new THnSparseF("fHistoFeedDownSigmaMCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4795 
4796  fHistoLcMCS = new THnSparseF("fHistoLcMCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4797  fOutputAll->Add(fHistoLcMCS);
4798  fHistoLcMCS1 = new THnSparseF("fHistoLcMCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4799  fOutputAll->Add(fHistoLcMCS1);
4800  fHistoLcMCS2 = new THnSparseF("fHistoLcMCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4801  fOutputAll->Add(fHistoLcMCS2);
4802  fHistoLbMCS = new THnSparseF("fHistoLbMCS","",3,bins_lbmcgen,xmin_lbmcgen,xmax_lbmcgen);
4803  fOutputAll->Add(fHistoLbMCS);
4804  fHistoLbMCS1 = new THnSparseF("fHistoLbMCS1","",3,bins_lbmcgen,xmin_lbmcgen,xmax_lbmcgen);
4805  fOutputAll->Add(fHistoLbMCS1);
4806  fHistoLbMCS2 = new THnSparseF("fHistoLbMCS2","",3,bins_lbmcgen,xmin_lbmcgen,xmax_lbmcgen);
4807  fOutputAll->Add(fHistoLbMCS2);
4808  fHistoFeedDownXic0MCS = new THnSparseF("fHistoFeedDownXic0MCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4810  fHistoFeedDownXic0MCS1 = new THnSparseF("fHistoFeedDownXic0MCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4812  fHistoFeedDownXic0MCS2 = new THnSparseF("fHistoFeedDownXic0MCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4814  fHistoFeedDownXicPlusMCS = new THnSparseF("fHistoFeedDownXicPlusMCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4816  fHistoFeedDownXicPlusMCS1 = new THnSparseF("fHistoFeedDownXicPlusMCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4818  fHistoFeedDownXicPlusMCS2 = new THnSparseF("fHistoFeedDownXicPlusMCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4820  fHistoFeedDownSigmaMCS = new THnSparseF("fHistoFeedDownSigmaMCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4822  fHistoFeedDownSigmaMCS1 = new THnSparseF("fHistoFeedDownSigmaMCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4824  fHistoFeedDownSigmaMCS2 = new THnSparseF("fHistoFeedDownSigmaMCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
4826 
4827  Int_t bins_elemcgen[3]= {100 ,20 ,10};
4828  Double_t xmin_elemcgen[3]={0.,-1.0 ,0.0};
4829  Double_t xmax_elemcgen[3]={10.,1.0 ,100};
4830  fHistoElectronMCGen = new THnSparseF("fHistoElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4832  fHistoBottomElectronMCGen = new THnSparseF("fHistoBottomElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4834  fHistoCharmElectronMCGen = new THnSparseF("fHistoCharmElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4836  fHistoLcElectronMCGen = new THnSparseF("fHistoLcElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4838  fHistoLcElectronMCGen1 = new THnSparseF("fHistoLcElectronMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4840  fHistoLcElectronMCGen2 = new THnSparseF("fHistoLcElectronMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4842  fHistoLbElectronMCGen = new THnSparseF("fHistoLbElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4844  fHistoLbElectronMCGen1 = new THnSparseF("fHistoLbElectronMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4846  fHistoLbElectronMCGen2 = new THnSparseF("fHistoLbElectronMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4848  fHistoElectronFeedDownXic0MCGen = new THnSparseF("fHistoElectronFeedDownXic0MCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4850  fHistoElectronFeedDownXic0MCGen1 = new THnSparseF("fHistoElectronFeedDownXic0MCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4852  fHistoElectronFeedDownXic0MCGen2 = new THnSparseF("fHistoElectronFeedDownXic0MCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4854  fHistoElectronFeedDownXicPlusMCGen = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4856  fHistoElectronFeedDownXicPlusMCGen1 = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4858  fHistoElectronFeedDownXicPlusMCGen2 = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4860  fHistoElectronFeedDownXibMCGen = new THnSparseF("fHistoElectronFeedDownXibMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4862  fHistoElectronFeedDownXibMCGen1 = new THnSparseF("fHistoElectronFeedDownXibMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4864  fHistoElectronFeedDownXibMCGen2 = new THnSparseF("fHistoElectronFeedDownXibMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4866  fHistoLcElectronMCS = new THnSparseF("fHistoLcElectronMCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4868  fHistoLcElectronMCS1 = new THnSparseF("fHistoLcElectronMCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4870  fHistoLcElectronMCS2 = new THnSparseF("fHistoLcElectronMCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4872  fHistoLbElectronMCS = new THnSparseF("fHistoLbElectronMCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4874  fHistoLbElectronMCS1 = new THnSparseF("fHistoLbElectronMCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4876  fHistoLbElectronMCS2 = new THnSparseF("fHistoLbElectronMCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4878  fHistoElectronFeedDownXic0MCS = new THnSparseF("fHistoElectronFeedDownXic0MCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4880  fHistoElectronFeedDownXic0MCS1 = new THnSparseF("fHistoElectronFeedDownXic0MCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4882  fHistoElectronFeedDownXic0MCS2 = new THnSparseF("fHistoElectronFeedDownXic0MCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4884  fHistoElectronFeedDownXicPlusMCS = new THnSparseF("fHistoElectronFeedDownXicPlusMCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4886  fHistoElectronFeedDownXicPlusMCS1 = new THnSparseF("fHistoElectronFeedDownXicPlusMCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4888  fHistoElectronFeedDownXicPlusMCS2 = new THnSparseF("fHistoElectronFeedDownXicPlusMCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4890  fHistoElectronFeedDownXibMCS = new THnSparseF("fHistoElectronFeedDownXibMCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4892  fHistoElectronFeedDownXibMCS1 = new THnSparseF("fHistoElectronFeedDownXibMCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4894  fHistoElectronFeedDownXibMCS2 = new THnSparseF("fHistoElectronFeedDownXibMCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
4896 
4897  Int_t bins_lambdamcgen[3]= {50 ,20 ,10};
4898  Double_t xmin_lambdamcgen[3]={0.,-1.0 ,0.0};
4899  Double_t xmax_lambdamcgen[3]={10.,1.0 ,100};
4900  fHistoLambdaMCGen = new THnSparseF("fHistoLambdaMCGen","",3,bins_lambdamcgen,xmin_lambdamcgen,xmax_lambdamcgen);
4902 
4903  Int_t bins_eleptvsv0dl[3]= {100 ,20 ,10};
4904  Double_t xmin_eleptvsv0dl[3]={0.,0. ,0.0};
4905  Double_t xmax_eleptvsv0dl[3]={10.,40. ,100};
4906  fHistoElePtvsV0dlRS = new THnSparseF("fHistoElePtvsV0dlRS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4908  fHistoElePtvsV0dlRS1 = new THnSparseF("fHistoElePtvsV0dlRS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4910  fHistoElePtvsV0dlRS2 = new THnSparseF("fHistoElePtvsV0dlRS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4912  fHistoElePtvsV0dlRSSide = new THnSparseF("fHistoElePtvsV0dlRSSide","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4914  fHistoElePtvsV0dlRSSide1 = new THnSparseF("fHistoElePtvsV0dlRSSide1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4916  fHistoElePtvsV0dlRSSide2 = new THnSparseF("fHistoElePtvsV0dlRSSide2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4918  fHistoElePtvsV0dlRSMix = new THnSparseF("fHistoElePtvsV0dlRSMix","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4920  fHistoElePtvsV0dlRSMix1 = new THnSparseF("fHistoElePtvsV0dlRSMix1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4922  fHistoElePtvsV0dlRSMix2 = new THnSparseF("fHistoElePtvsV0dlRSMix2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4924  fHistoElePtvsV0dlWS = new THnSparseF("fHistoElePtvsV0dlWS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4926  fHistoElePtvsV0dlWS1 = new THnSparseF("fHistoElePtvsV0dlWS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4928  fHistoElePtvsV0dlWS2 = new THnSparseF("fHistoElePtvsV0dlWS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4930  fHistoElePtvsV0dlWSSide = new THnSparseF("fHistoElePtvsV0dlWSSide","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4932  fHistoElePtvsV0dlWSSide1 = new THnSparseF("fHistoElePtvsV0dlWSSide1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4934  fHistoElePtvsV0dlWSSide2 = new THnSparseF("fHistoElePtvsV0dlWSSide2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4936  fHistoElePtvsV0dlWSMix = new THnSparseF("fHistoElePtvsV0dlWSMix","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4938  fHistoElePtvsV0dlWSMix1 = new THnSparseF("fHistoElePtvsV0dlWSMix1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4940  fHistoElePtvsV0dlWSMix2 = new THnSparseF("fHistoElePtvsV0dlWSMix2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4942  fHistoElePtvsV0dlMCS = new THnSparseF("fHistoElePtvsV0dlMCS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4944  fHistoElePtvsV0dlMCS1 = new THnSparseF("fHistoElePtvsV0dlMCS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4946  fHistoElePtvsV0dlMCS2 = new THnSparseF("fHistoElePtvsV0dlMCS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4948  fHistoElePtvsV0dlFeedDownXic0MCS = new THnSparseF("fHistoElePtvsV0dlFeedDownXic0MCS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4950  fHistoElePtvsV0dlFeedDownXic0MCS1 = new THnSparseF("fHistoElePtvsV0dlFeedDownXic0MCS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4952  fHistoElePtvsV0dlFeedDownXic0MCS2 = new THnSparseF("fHistoElePtvsV0dlFeedDownXic0MCS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4954  fHistoElePtvsV0dlFeedDownXicPlusMCS = new THnSparseF("fHistoElePtvsV0dlFeedDownXicPlusMCS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4956  fHistoElePtvsV0dlFeedDownXicPlusMCS1 = new THnSparseF("fHistoElePtvsV0dlFeedDownXicPlusMCS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4958  fHistoElePtvsV0dlFeedDownXicPlusMCS2 = new THnSparseF("fHistoElePtvsV0dlFeedDownXicPlusMCS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
4960 
4961  Int_t bins_eleptvsv0dca[3]= {100 ,20 ,10};
4962  Double_t xmin_eleptvsv0dca[3]={0.,0. ,0.0};
4963  Double_t xmax_eleptvsv0dca[3]={10.,1. ,100};
4964  fHistoElePtvsV0dcaRS = new THnSparseF("fHistoElePtvsV0dcaRS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4966  fHistoElePtvsV0dcaRS1 = new THnSparseF("fHistoElePtvsV0dcaRS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4968  fHistoElePtvsV0dcaRS2 = new THnSparseF("fHistoElePtvsV0dcaRS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4970  fHistoElePtvsV0dcaRSSide = new THnSparseF("fHistoElePtvsV0dcaRSSide","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4972  fHistoElePtvsV0dcaRSSide1 = new THnSparseF("fHistoElePtvsV0dcaRSSide1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4974  fHistoElePtvsV0dcaRSSide2 = new THnSparseF("fHistoElePtvsV0dcaRSSide2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4976  fHistoElePtvsV0dcaRSMix = new THnSparseF("fHistoElePtvsV0dcaRSMix","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4978  fHistoElePtvsV0dcaRSMix1 = new THnSparseF("fHistoElePtvsV0dcaRSMix1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4980  fHistoElePtvsV0dcaRSMix2 = new THnSparseF("fHistoElePtvsV0dcaRSMix2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4982  fHistoElePtvsV0dcaWS = new THnSparseF("fHistoElePtvsV0dcaWS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4984  fHistoElePtvsV0dcaWS1 = new THnSparseF("fHistoElePtvsV0dcaWS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4986  fHistoElePtvsV0dcaWS2 = new THnSparseF("fHistoElePtvsV0dcaWS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4988  fHistoElePtvsV0dcaWSSide = new THnSparseF("fHistoElePtvsV0dcaWSSide","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4990  fHistoElePtvsV0dcaWSSide1 = new THnSparseF("fHistoElePtvsV0dcaWSSide1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4992  fHistoElePtvsV0dcaWSSide2 = new THnSparseF("fHistoElePtvsV0dcaWSSide2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4994  fHistoElePtvsV0dcaWSMix = new THnSparseF("fHistoElePtvsV0dcaWSMix","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4996  fHistoElePtvsV0dcaWSMix1 = new THnSparseF("fHistoElePtvsV0dcaWSMix1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
4998  fHistoElePtvsV0dcaWSMix2 = new THnSparseF("fHistoElePtvsV0dcaWSMix2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5000  fHistoElePtvsV0dcaMCS = new THnSparseF("fHistoElePtvsV0dcaMCS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5002  fHistoElePtvsV0dcaMCS1 = new THnSparseF("fHistoElePtvsV0dcaMCS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5004  fHistoElePtvsV0dcaMCS2 = new THnSparseF("fHistoElePtvsV0dcaMCS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5006  fHistoElePtvsV0dcaFeedDownXic0MCS = new THnSparseF("fHistoElePtvsV0dcaFeedDownXic0MCS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5008  fHistoElePtvsV0dcaFeedDownXic0MCS1 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXic0MCS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5010  fHistoElePtvsV0dcaFeedDownXic0MCS2 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXic0MCS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5012  fHistoElePtvsV0dcaFeedDownXicPlusMCS = new THnSparseF("fHistoElePtvsV0dcaFeedDownXicPlusMCS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5014  fHistoElePtvsV0dcaFeedDownXicPlusMCS1 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXicPlusMCS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5016  fHistoElePtvsV0dcaFeedDownXicPlusMCS2 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXicPlusMCS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
5018 
5019  Int_t bins_elelamptvsv0dl[4]= {100 ,20 ,100, 10};
5020  Double_t xmin_elelamptvsv0dl[4]={0.,0. ,-0.5, 0.0};
5021  Double_t xmax_elelamptvsv0dl[4]={20.,40.,0.5 ,100};
5022  fHistoEleLambdaPtvsV0dlRS = new THnSparseF("fHistoEleLambdaPtvsV0dlRS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5024  fHistoEleLambdaPtvsV0dlRS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlRS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5026  fHistoEleLambdaPtvsV0dlRS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlRS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5028  fHistoEleLambdaPtvsV0dlRSSide = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5030  fHistoEleLambdaPtvsV0dlRSSide1 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5032  fHistoEleLambdaPtvsV0dlRSSide2 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5034  fHistoEleLambdaPtvsV0dlRSMix = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5036  fHistoEleLambdaPtvsV0dlRSMix1 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5038  fHistoEleLambdaPtvsV0dlRSMix2 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5040  fHistoEleLambdaPtvsV0dlWS = new THnSparseF("fHistoEleLambdaPtvsV0dlWS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5042  fHistoEleLambdaPtvsV0dlWS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlWS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5044  fHistoEleLambdaPtvsV0dlWS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlWS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5046  fHistoEleLambdaPtvsV0dlWSSide = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5048  fHistoEleLambdaPtvsV0dlWSSide1 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5050  fHistoEleLambdaPtvsV0dlWSSide2 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5052  fHistoEleLambdaPtvsV0dlWSMix = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5054  fHistoEleLambdaPtvsV0dlWSMix1 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5056  fHistoEleLambdaPtvsV0dlWSMix2 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5058  fHistoEleLambdaPtvsV0dlMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5060  fHistoEleLambdaPtvsV0dlMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5062  fHistoEleLambdaPtvsV0dlMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5064  fHistoEleLambdaPtvsV0dlPromptMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlPromptMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5066  fHistoEleLambdaPtvsV0dlPromptMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlPromptMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5068  fHistoEleLambdaPtvsV0dlPromptMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlPromptMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5070  fHistoEleLambdaPtvsV0dlBFeeddownMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlBFeeddownMCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5072  fHistoEleLambdaPtvsV0dlBFeeddownMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlBFeeddownMCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5074  fHistoEleLambdaPtvsV0dlBFeeddownMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlBFeeddownMCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5076  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0MCS","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5078  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5080  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2","",4,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
5081