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