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