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