AliPhysics  vAN-20151014 (f894c76)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskSELc2eleLambdafromAODtracks.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appeuear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 /* $Id$ */
17 
18 //
19 //
20 // Lc->e Lambda analysis code
21 //
22 // Input: AOD
23 // Output: TTree and/or THnSparse (mass vs pT vs Centrality)
24 //
25 // Cuts:
26 // TTree: SingleCuts on V0 and electron
27 // THnSparse: In addition to that, IsSelected(obj, kCandidate) applied
28 //
29 //-------------------------------------------------------------------------
30 //
31 // Authors: Y.S Watanabe(a)
32 // (a) CNS, the University of Tokyo
33 // Contatcs: wyosuke@cns.s.u-tokyo.ac.jp
34 //-------------------------------------------------------------------------
35 
36 #include <TSystem.h>
37 #include <TParticle.h>
38 #include <TParticlePDG.h>
39 #include <TH1F.h>
40 #include <TH1F.h>
41 #include <TH2F.h>
42 #include <THnSparse.h>
43 #include <TLorentzVector.h>
44 #include <TTree.h>
45 #include "TROOT.h"
46 #include <TDatabasePDG.h>
47 #include <AliAnalysisDataSlot.h>
48 #include <AliAnalysisDataContainer.h>
49 #include "AliStack.h"
50 #include "AliMCEvent.h"
51 #include "AliAnalysisManager.h"
52 #include "AliAODMCHeader.h"
53 #include "AliAODHandler.h"
54 #include "AliLog.h"
55 #include "AliExternalTrackParam.h"
56 #include "AliAODVertex.h"
57 #include "AliESDVertex.h"
58 #include "AliAODRecoDecay.h"
59 #include "AliAODRecoDecayHF.h"
60 #include "AliAODRecoCascadeHF.h"
61 #include "AliESDtrack.h"
62 #include "AliAODTrack.h"
63 #include "AliAODv0.h"
64 #include "AliAODcascade.h"
65 #include "AliAODMCParticle.h"
66 #include "AliAnalysisTaskSE.h"
68 #include "AliPIDResponse.h"
69 #include "AliPIDCombined.h"
70 #include "AliTOFPIDResponse.h"
71 #include "AliAODPidHF.h"
72 #include "AliInputEventHandler.h"
73 #include "AliESDtrackCuts.h"
74 #include "AliNeutralTrackParam.h"
75 #include "AliKFParticle.h"
76 #include "AliKFVertex.h"
77 #include "AliExternalTrackParam.h"
78 #include "AliESDtrack.h"
79 #include "AliCentrality.h"
80 #include "AliVertexerTracks.h"
81 #include "AliEventPoolManager.h"
83 
84 using std::cout;
85 using std::endl;
86 
90 
91 //__________________________________________________________________________
93  AliAnalysisTaskSE(),
94  fUseMCInfo(kFALSE),
95  fOutput(0),
96  fOutputAll(0),
97  fListCuts(0),
98  fCEvents(0),
99  fHTrigger(0),
100  fHCentrality(0),
101  fAnalCuts(0),
102  fIsEventSelected(kFALSE),
103  fWriteVariableTree(kFALSE),
104  fWriteEachVariableTree(kFALSE),
105  fWriteMCVariableTree(kFALSE),
106  fVariablesTree(0),
107  fEleVariablesTree(0),
108  fV0VariablesTree(0),
109  fMCVariablesTree(0),
110  fMCEleVariablesTree(0),
111  fMCV0VariablesTree(0),
112  fReconstructPrimVert(kFALSE),
113  fIsMB(kFALSE),
114  fIsSemi(kFALSE),
115  fIsCent(kFALSE),
116  fIsINT7(kFALSE),
117  fIsEMC7(kFALSE),
118  fCandidateVariables(),
119  fCandidateEleVariables(),
120  fCandidateV0Variables(),
121  fCandidateMCVariables(),
122  fCandidateMCEleVariables(),
123  fCandidateMCV0Variables(),
124  fVtx1(0),
125  fV1(0),
126  fVtxZ(0),
127  fBzkG(0),
128  fCentrality(0),
129  fRunNumber(0),
130  fTriggerCheck(0),
131  fUseCentralityV0M(kFALSE),
132  fEvNumberCounter(0),
133  fHistoEleLambdaMass(0),
134  fHistoEleLambdaMassRS(0),
135  fHistoEleLambdaMassWS(0),
136  fHistoEleLambdaMassRSMix(0),
137  fHistoEleLambdaMassWSMix(0),
138  fHistoEleLambdaMassRSSide(0),
139  fHistoEleLambdaMassWSSide(0),
140  fHistoEleLambdaMassvsElePtRS(0),
141  fHistoEleLambdaMassvsElePtWS(0),
142  fHistoEleLambdaMassvsElePtRSMix(0),
143  fHistoEleLambdaMassvsElePtWSMix(0),
144  fHistoEleLambdaMassvsElePtRSSide(0),
145  fHistoEleLambdaMassvsElePtWSSide(0),
146  fHistoEleLambdaMassvsElePtRS1(0),
147  fHistoEleLambdaMassvsElePtWS1(0),
148  fHistoEleLambdaMassvsElePtRSMix1(0),
149  fHistoEleLambdaMassvsElePtWSMix1(0),
150  fHistoEleLambdaMassvsElePtRSSide1(0),
151  fHistoEleLambdaMassvsElePtWSSide1(0),
152  fHistoEleLambdaMassvsElePtRS2(0),
153  fHistoEleLambdaMassvsElePtWS2(0),
154  fHistoEleLambdaMassvsElePtRSMix2(0),
155  fHistoEleLambdaMassvsElePtWSMix2(0),
156  fHistoEleLambdaMassvsElePtRSSide2(0),
157  fHistoEleLambdaMassvsElePtWSSide2(0),
158  fHistoElePtRS(0),
159  fHistoElePtWS(0),
160  fHistoElePtRSMix(0),
161  fHistoElePtWSMix(0),
162  fHistoEleLambdaMassMCS(0),
163  fHistoEleLambdaMassMCGen(0),
164  fHistoEleLambdaMassvsElePtMCS(0),
165  fHistoEleLambdaMassvsElePtMCGen(0),
166  fHistoEleLambdaMassvsElePtMCS1(0),
167  fHistoEleLambdaMassvsElePtMCGen1(0),
168  fHistoEleLambdaMassvsElePtMCS2(0),
169  fHistoEleLambdaMassvsElePtMCGen2(0),
170  fHistoElePtMCS(0),
171  fHistoElePtMCGen(0),
172  fHistoElePtvsEtaRS(0),
173  fHistoElePtvsEtaWS(0),
174  fHistoElePtvsEtaRSMix(0),
175  fHistoElePtvsEtaWSMix(0),
176  fHistoElePtvsEtaMCS(0),
177  fHistoElePtvsEtaMCGen(0),
178  fHistoElePtvsLambdaPtRS(0),
179  fHistoElePtvsLambdaPtWS(0),
180  fHistoElePtvsLambdaPtRSMix(0),
181  fHistoElePtvsLambdaPtWSMix(0),
182  fHistoElePtvsLambdaPtMCS(0),
183  fHistoElePtvsLambdaPtvsLcPtMCS(0),
184  fHistoElePtvsLambdaPtMCGen(0),
185  fHistoElePtvsLambdaPtvsLcPtMCGen(0),
186  fHistoElePtvsLambdaPtMCLcGen(0),
187  fHistoElePtvsd0RS(0),
188  fHistoElePtvsd0WS(0),
189  fHistoElePtvsd0RSMix(0),
190  fHistoElePtvsd0WSMix(0),
191  fHistoElePtvsd0MCS(0),
192  fHistoElePtvsd0PromptMCS(0),
193  fHistoElePtvsd0BFeeddownMCS(0),
194  fHistoEleLambdaMassFeeddownXic0MCS(0),
195  fHistoEleLambdaMassFeeddownXic0MCGen(0),
196  fHistoEleLambdaMassvsElePtFeeddownXic0MCS(0),
197  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen(0),
198  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1(0),
199  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1(0),
200  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2(0),
201  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2(0),
202  fHistoElePtFeeddownXic0MCS(0),
203  fHistoElePtFeeddownXic0MCGen(0),
204  fHistoElePtvsEtaFeeddownXic0MCS(0),
205  fHistoElePtvsEtaFeeddownXic0MCGen(0),
206  fHistoElePtvsLambdaPtFeeddownXic0MCS(0),
207  fHistoElePtvsLambdaPtFeeddownXic0MCGen(0),
208  fHistoEleLambdaMassFeeddownXicPlusMCS(0),
209  fHistoEleLambdaMassFeeddownXicPlusMCGen(0),
210  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS(0),
211  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen(0),
212  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1(0),
213  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1(0),
214  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2(0),
215  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2(0),
216  fHistoElePtFeeddownXicPlusMCS(0),
217  fHistoElePtFeeddownXicPlusMCGen(0),
218  fHistoElePtvsEtaFeeddownXicPlusMCS(0),
219  fHistoElePtvsEtaFeeddownXicPlusMCGen(0),
220  fHistoElePtvsLambdaPtFeeddownXicPlusMCS(0),
221  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen(0),
222  fHistoBachPt(0),
223  fHistoBachPtMCS(0),
224  fHistoBachPtMCGen(0),
225  fHistod0Bach(0),
226  fHistoLambdaMassvsPt(0),
227  fHistoLambdaMassvsPtMCS(0),
228  fHistoLambdaMassvsPtMCGen(0),
229  fHistoLambdaPtvsDl(0),
230  fHistoLambdaPtvsDlSide(0),
231  fHistoLambdaPtvsDlMCS(0),
232  fHistoLambdaPtvsDlFeeddownXi0MCS(0),
233  fHistoLambdaPtvsDlFeeddownXiMinusMCS(0),
234  fHistoLambdaPtvsDlFeeddownOmegaMCS(0),
235  fHistoK0sMassvsPt(0),
236  fHistoElectronTPCPID(0),
237  fHistoElectronTOFPID(0),
238  fHistoElectronTPCSelPID(0),
239  fHistoElectronTOFSelPID(0),
240  fHistoElectronTPCPIDSelTOF(0),
241  fHistoElectronTPCPIDSelTOFSmallEta(0),
242  fHistoElectronTPCPIDSelTOFLargeEta(0),
243  fHistoElectronQovPtvsPhi(0),
244  fHistoLambdaQovPtvsPhi(0),
245  fHistoLcMCGen(0),
246  fHistoLcMCGen1(0),
247  fHistoLcMCGen2(0),
248  fHistoLcMCS(0),
249  fHistoLcMCS1(0),
250  fHistoLcMCS2(0),
251  fHistoFeedDownXic0MCGen(0),
252  fHistoFeedDownXic0MCGen1(0),
253  fHistoFeedDownXic0MCGen2(0),
254  fHistoFeedDownXic0MCS(0),
255  fHistoFeedDownXic0MCS1(0),
256  fHistoFeedDownXic0MCS2(0),
257  fHistoFeedDownXicPlusMCGen(0),
258  fHistoFeedDownXicPlusMCGen1(0),
259  fHistoFeedDownXicPlusMCGen2(0),
260  fHistoFeedDownXicPlusMCS(0),
261  fHistoFeedDownXicPlusMCS1(0),
262  fHistoFeedDownXicPlusMCS2(0),
263  fHistoLcElectronMCGen(0),
264  fHistoLcElectronMCGen1(0),
265  fHistoLcElectronMCGen2(0),
266  fHistoLcElectronMCS(0),
267  fHistoLcElectronMCS1(0),
268  fHistoLcElectronMCS2(0),
269  fHistoElectronFeedDownXic0MCGen(0),
270  fHistoElectronFeedDownXic0MCGen1(0),
271  fHistoElectronFeedDownXic0MCGen2(0),
272  fHistoElectronFeedDownXic0MCS(0),
273  fHistoElectronFeedDownXic0MCS1(0),
274  fHistoElectronFeedDownXic0MCS2(0),
275  fHistoElectronFeedDownXicPlusMCGen(0),
276  fHistoElectronFeedDownXicPlusMCGen1(0),
277  fHistoElectronFeedDownXicPlusMCGen2(0),
278  fHistoElectronFeedDownXicPlusMCS(0),
279  fHistoElectronFeedDownXicPlusMCS1(0),
280  fHistoElectronFeedDownXicPlusMCS2(0),
281  fHistoElectronMCGen(0),
282  fHistoLambdaMCGen(0),
283  fHistoElePtvsV0dlRS(0),
284  fHistoElePtvsV0dlRS1(0),
285  fHistoElePtvsV0dlRS2(0),
286  fHistoElePtvsV0dlRSSide(0),
287  fHistoElePtvsV0dlRSSide1(0),
288  fHistoElePtvsV0dlRSSide2(0),
289  fHistoElePtvsV0dlRSMix(0),
290  fHistoElePtvsV0dlRSMix1(0),
291  fHistoElePtvsV0dlRSMix2(0),
292  fHistoElePtvsV0dlWS(0),
293  fHistoElePtvsV0dlWS1(0),
294  fHistoElePtvsV0dlWS2(0),
295  fHistoElePtvsV0dlWSSide(0),
296  fHistoElePtvsV0dlWSSide1(0),
297  fHistoElePtvsV0dlWSSide2(0),
298  fHistoElePtvsV0dlWSMix(0),
299  fHistoElePtvsV0dlWSMix1(0),
300  fHistoElePtvsV0dlWSMix2(0),
301  fHistoElePtvsV0dlMCS(0),
302  fHistoElePtvsV0dlMCS1(0),
303  fHistoElePtvsV0dlMCS2(0),
304  fHistoElePtvsV0dlFeedDownXic0MCS(0),
305  fHistoElePtvsV0dlFeedDownXic0MCS1(0),
306  fHistoElePtvsV0dlFeedDownXic0MCS2(0),
307  fHistoElePtvsV0dlFeedDownXicPlusMCS(0),
308  fHistoElePtvsV0dlFeedDownXicPlusMCS1(0),
309  fHistoElePtvsV0dlFeedDownXicPlusMCS2(0),
310  fHistoElePtvsV0dcaRS(0),
311  fHistoElePtvsV0dcaRS1(0),
312  fHistoElePtvsV0dcaRS2(0),
313  fHistoElePtvsV0dcaRSSide(0),
314  fHistoElePtvsV0dcaRSSide1(0),
315  fHistoElePtvsV0dcaRSSide2(0),
316  fHistoElePtvsV0dcaRSMix(0),
317  fHistoElePtvsV0dcaRSMix1(0),
318  fHistoElePtvsV0dcaRSMix2(0),
319  fHistoElePtvsV0dcaWS(0),
320  fHistoElePtvsV0dcaWS1(0),
321  fHistoElePtvsV0dcaWS2(0),
322  fHistoElePtvsV0dcaWSSide(0),
323  fHistoElePtvsV0dcaWSSide1(0),
324  fHistoElePtvsV0dcaWSSide2(0),
325  fHistoElePtvsV0dcaWSMix(0),
326  fHistoElePtvsV0dcaWSMix1(0),
327  fHistoElePtvsV0dcaWSMix2(0),
328  fHistoElePtvsV0dcaMCS(0),
329  fHistoElePtvsV0dcaMCS1(0),
330  fHistoElePtvsV0dcaMCS2(0),
331  fHistoElePtvsV0dcaFeedDownXic0MCS(0),
332  fHistoElePtvsV0dcaFeedDownXic0MCS1(0),
333  fHistoElePtvsV0dcaFeedDownXic0MCS2(0),
334  fHistoElePtvsV0dcaFeedDownXicPlusMCS(0),
335  fHistoElePtvsV0dcaFeedDownXicPlusMCS1(0),
336  fHistoElePtvsV0dcaFeedDownXicPlusMCS2(0),
337  fHistoEleLambdaPtvsV0dlRS(0),
338  fHistoEleLambdaPtvsV0dlRS1(0),
339  fHistoEleLambdaPtvsV0dlRS2(0),
340  fHistoEleLambdaPtvsV0dlRSSide(0),
341  fHistoEleLambdaPtvsV0dlRSSide1(0),
342  fHistoEleLambdaPtvsV0dlRSSide2(0),
343  fHistoEleLambdaPtvsV0dlRSMix(0),
344  fHistoEleLambdaPtvsV0dlRSMix1(0),
345  fHistoEleLambdaPtvsV0dlRSMix2(0),
346  fHistoEleLambdaPtvsV0dlWS(0),
347  fHistoEleLambdaPtvsV0dlWS1(0),
348  fHistoEleLambdaPtvsV0dlWS2(0),
349  fHistoEleLambdaPtvsV0dlWSSide(0),
350  fHistoEleLambdaPtvsV0dlWSSide1(0),
351  fHistoEleLambdaPtvsV0dlWSSide2(0),
352  fHistoEleLambdaPtvsV0dlWSMix(0),
353  fHistoEleLambdaPtvsV0dlWSMix1(0),
354  fHistoEleLambdaPtvsV0dlWSMix2(0),
355  fHistoEleLambdaPtvsV0dlMCS(0),
356  fHistoEleLambdaPtvsV0dlMCS1(0),
357  fHistoEleLambdaPtvsV0dlMCS2(0),
358  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS(0),
359  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1(0),
360  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2(0),
361  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS(0),
362  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1(0),
363  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2(0),
364  fHistoResponseElePt(0),
365  fHistoResponseEleLambdaPt(0),
366  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt(0),
367  fCounter(0),
368  fHistonEvtvsRunNumber(0),
369  fHistonElevsRunNumber(0),
370  fHistonLambdavsRunNumber(0),
371  fDoEventMixing(0),
372  fNumberOfEventsForMixing (5),
373  fNzVtxBins (0),
374  fNCentBins (0),
375  fNOfPools(1),
376  fEventBuffer(0x0),
377  fEventInfo(0x0),
378  fElectronTracks(0x0),
379  fV0Tracks1(0x0),
380  fV0Tracks2(0x0),
381  fV0dlArray1(0x0),
382  fV0dlArray2(0x0),
383  fV0dcaArray1(0x0),
384  fV0dcaArray2(0x0)
385 {
386  //
388  //
389  for(Int_t i=0;i<17;i++){
390  fHistoElePtvsCutVarsRS[i] = 0;
391  fHistoElePtvsCutVarsWS[i] = 0;
393  }
394  for(Int_t i=0;i<8;i++){
396  }
397 }
398 
399 //___________________________________________________________________________
402  Bool_t writeVariableTree) :
403  AliAnalysisTaskSE(name),
404  fUseMCInfo(kFALSE),
405  fOutput(0),
406  fOutputAll(0),
407  fListCuts(0),
408  fCEvents(0),
409  fHTrigger(0),
410  fHCentrality(0),
411  fAnalCuts(analCuts),
412  fIsEventSelected(kFALSE),
413  fWriteVariableTree(writeVariableTree),
414  fWriteEachVariableTree(kFALSE),
415  fWriteMCVariableTree(kFALSE),
416  fVariablesTree(0),
417  fEleVariablesTree(0),
418  fV0VariablesTree(0),
419  fMCVariablesTree(0),
420  fMCEleVariablesTree(0),
421  fMCV0VariablesTree(0),
422  fReconstructPrimVert(kFALSE),
423  fIsMB(kFALSE),
424  fIsSemi(kFALSE),
425  fIsCent(kFALSE),
426  fIsINT7(kFALSE),
427  fIsEMC7(kFALSE),
428  fCandidateVariables(),
429  fCandidateEleVariables(),
430  fCandidateV0Variables(),
431  fCandidateMCVariables(),
432  fCandidateMCEleVariables(),
433  fCandidateMCV0Variables(),
434  fVtx1(0),
435  fV1(0),
436  fVtxZ(0),
437  fBzkG(0),
438  fCentrality(0),
439  fRunNumber(0),
440  fTriggerCheck(0),
441  fUseCentralityV0M(kFALSE),
442  fEvNumberCounter(0),
443  fHistoEleLambdaMass(0),
444  fHistoEleLambdaMassRS(0),
445  fHistoEleLambdaMassWS(0),
446  fHistoEleLambdaMassRSMix(0),
447  fHistoEleLambdaMassWSMix(0),
448  fHistoEleLambdaMassRSSide(0),
449  fHistoEleLambdaMassWSSide(0),
450  fHistoEleLambdaMassvsElePtRS(0),
451  fHistoEleLambdaMassvsElePtWS(0),
452  fHistoEleLambdaMassvsElePtRSMix(0),
453  fHistoEleLambdaMassvsElePtWSMix(0),
454  fHistoEleLambdaMassvsElePtRSSide(0),
455  fHistoEleLambdaMassvsElePtWSSide(0),
456  fHistoEleLambdaMassvsElePtRS1(0),
457  fHistoEleLambdaMassvsElePtWS1(0),
458  fHistoEleLambdaMassvsElePtRSMix1(0),
459  fHistoEleLambdaMassvsElePtWSMix1(0),
460  fHistoEleLambdaMassvsElePtRSSide1(0),
461  fHistoEleLambdaMassvsElePtWSSide1(0),
462  fHistoEleLambdaMassvsElePtRS2(0),
463  fHistoEleLambdaMassvsElePtWS2(0),
464  fHistoEleLambdaMassvsElePtRSMix2(0),
465  fHistoEleLambdaMassvsElePtWSMix2(0),
466  fHistoEleLambdaMassvsElePtRSSide2(0),
467  fHistoEleLambdaMassvsElePtWSSide2(0),
468  fHistoElePtRS(0),
469  fHistoElePtWS(0),
470  fHistoElePtRSMix(0),
471  fHistoElePtWSMix(0),
472  fHistoEleLambdaMassMCS(0),
473  fHistoEleLambdaMassMCGen(0),
474  fHistoEleLambdaMassvsElePtMCS(0),
475  fHistoEleLambdaMassvsElePtMCGen(0),
476  fHistoEleLambdaMassvsElePtMCS1(0),
477  fHistoEleLambdaMassvsElePtMCGen1(0),
478  fHistoEleLambdaMassvsElePtMCS2(0),
479  fHistoEleLambdaMassvsElePtMCGen2(0),
480  fHistoElePtMCS(0),
481  fHistoElePtMCGen(0),
482  fHistoElePtvsEtaRS(0),
483  fHistoElePtvsEtaWS(0),
484  fHistoElePtvsEtaRSMix(0),
485  fHistoElePtvsEtaWSMix(0),
486  fHistoElePtvsEtaMCS(0),
487  fHistoElePtvsEtaMCGen(0),
488  fHistoElePtvsLambdaPtRS(0),
489  fHistoElePtvsLambdaPtWS(0),
490  fHistoElePtvsLambdaPtRSMix(0),
491  fHistoElePtvsLambdaPtWSMix(0),
492  fHistoElePtvsLambdaPtMCS(0),
493  fHistoElePtvsLambdaPtvsLcPtMCS(0),
494  fHistoElePtvsLambdaPtMCGen(0),
495  fHistoElePtvsLambdaPtvsLcPtMCGen(0),
496  fHistoElePtvsLambdaPtMCLcGen(0),
497  fHistoElePtvsd0RS(0),
498  fHistoElePtvsd0WS(0),
499  fHistoElePtvsd0RSMix(0),
500  fHistoElePtvsd0WSMix(0),
501  fHistoElePtvsd0MCS(0),
502  fHistoElePtvsd0PromptMCS(0),
503  fHistoElePtvsd0BFeeddownMCS(0),
504  fHistoEleLambdaMassFeeddownXic0MCS(0),
505  fHistoEleLambdaMassFeeddownXic0MCGen(0),
506  fHistoEleLambdaMassvsElePtFeeddownXic0MCS(0),
507  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen(0),
508  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1(0),
509  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1(0),
510  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2(0),
511  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2(0),
512  fHistoElePtFeeddownXic0MCS(0),
513  fHistoElePtFeeddownXic0MCGen(0),
514  fHistoElePtvsEtaFeeddownXic0MCS(0),
515  fHistoElePtvsEtaFeeddownXic0MCGen(0),
516  fHistoElePtvsLambdaPtFeeddownXic0MCS(0),
517  fHistoElePtvsLambdaPtFeeddownXic0MCGen(0),
518  fHistoEleLambdaMassFeeddownXicPlusMCS(0),
519  fHistoEleLambdaMassFeeddownXicPlusMCGen(0),
520  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS(0),
521  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen(0),
522  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1(0),
523  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1(0),
524  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2(0),
525  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2(0),
526  fHistoElePtFeeddownXicPlusMCS(0),
527  fHistoElePtFeeddownXicPlusMCGen(0),
528  fHistoElePtvsEtaFeeddownXicPlusMCS(0),
529  fHistoElePtvsEtaFeeddownXicPlusMCGen(0),
530  fHistoElePtvsLambdaPtFeeddownXicPlusMCS(0),
531  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen(0),
532  fHistoBachPt(0),
533  fHistoBachPtMCS(0),
534  fHistoBachPtMCGen(0),
535  fHistod0Bach(0),
536  fHistoLambdaMassvsPt(0),
537  fHistoLambdaMassvsPtMCS(0),
538  fHistoLambdaMassvsPtMCGen(0),
539  fHistoLambdaPtvsDl(0),
540  fHistoLambdaPtvsDlSide(0),
541  fHistoLambdaPtvsDlMCS(0),
542  fHistoLambdaPtvsDlFeeddownXi0MCS(0),
543  fHistoLambdaPtvsDlFeeddownXiMinusMCS(0),
544  fHistoLambdaPtvsDlFeeddownOmegaMCS(0),
545  fHistoK0sMassvsPt(0),
546  fHistoElectronTPCPID(0),
547  fHistoElectronTOFPID(0),
548  fHistoElectronTPCSelPID(0),
549  fHistoElectronTOFSelPID(0),
550  fHistoElectronTPCPIDSelTOF(0),
551  fHistoElectronTPCPIDSelTOFSmallEta(0),
552  fHistoElectronTPCPIDSelTOFLargeEta(0),
553  fHistoElectronQovPtvsPhi(0),
554  fHistoLambdaQovPtvsPhi(0),
555  fHistoLcMCGen(0),
556  fHistoLcMCGen1(0),
557  fHistoLcMCGen2(0),
558  fHistoLcMCS(0),
559  fHistoLcMCS1(0),
560  fHistoLcMCS2(0),
561  fHistoFeedDownXic0MCGen(0),
562  fHistoFeedDownXic0MCGen1(0),
563  fHistoFeedDownXic0MCGen2(0),
564  fHistoFeedDownXic0MCS(0),
565  fHistoFeedDownXic0MCS1(0),
566  fHistoFeedDownXic0MCS2(0),
567  fHistoFeedDownXicPlusMCGen(0),
568  fHistoFeedDownXicPlusMCGen1(0),
569  fHistoFeedDownXicPlusMCGen2(0),
570  fHistoFeedDownXicPlusMCS(0),
571  fHistoFeedDownXicPlusMCS1(0),
572  fHistoFeedDownXicPlusMCS2(0),
573  fHistoLcElectronMCGen(0),
574  fHistoLcElectronMCGen1(0),
575  fHistoLcElectronMCGen2(0),
576  fHistoLcElectronMCS(0),
577  fHistoLcElectronMCS1(0),
578  fHistoLcElectronMCS2(0),
579  fHistoElectronFeedDownXic0MCGen(0),
580  fHistoElectronFeedDownXic0MCGen1(0),
581  fHistoElectronFeedDownXic0MCGen2(0),
582  fHistoElectronFeedDownXic0MCS(0),
583  fHistoElectronFeedDownXic0MCS1(0),
584  fHistoElectronFeedDownXic0MCS2(0),
585  fHistoElectronFeedDownXicPlusMCGen(0),
586  fHistoElectronFeedDownXicPlusMCGen1(0),
587  fHistoElectronFeedDownXicPlusMCGen2(0),
588  fHistoElectronFeedDownXicPlusMCS(0),
589  fHistoElectronFeedDownXicPlusMCS1(0),
590  fHistoElectronFeedDownXicPlusMCS2(0),
591  fHistoElectronMCGen(0),
592  fHistoLambdaMCGen(0),
593  fHistoElePtvsV0dlRS(0),
594  fHistoElePtvsV0dlRS1(0),
595  fHistoElePtvsV0dlRS2(0),
596  fHistoElePtvsV0dlRSSide(0),
597  fHistoElePtvsV0dlRSSide1(0),
598  fHistoElePtvsV0dlRSSide2(0),
599  fHistoElePtvsV0dlRSMix(0),
600  fHistoElePtvsV0dlRSMix1(0),
601  fHistoElePtvsV0dlRSMix2(0),
602  fHistoElePtvsV0dlWS(0),
603  fHistoElePtvsV0dlWS1(0),
604  fHistoElePtvsV0dlWS2(0),
605  fHistoElePtvsV0dlWSSide(0),
606  fHistoElePtvsV0dlWSSide1(0),
607  fHistoElePtvsV0dlWSSide2(0),
608  fHistoElePtvsV0dlWSMix(0),
609  fHistoElePtvsV0dlWSMix1(0),
610  fHistoElePtvsV0dlWSMix2(0),
611  fHistoElePtvsV0dlMCS(0),
612  fHistoElePtvsV0dlMCS1(0),
613  fHistoElePtvsV0dlMCS2(0),
614  fHistoElePtvsV0dlFeedDownXic0MCS(0),
615  fHistoElePtvsV0dlFeedDownXic0MCS1(0),
616  fHistoElePtvsV0dlFeedDownXic0MCS2(0),
617  fHistoElePtvsV0dlFeedDownXicPlusMCS(0),
618  fHistoElePtvsV0dlFeedDownXicPlusMCS1(0),
619  fHistoElePtvsV0dlFeedDownXicPlusMCS2(0),
620  fHistoElePtvsV0dcaRS(0),
621  fHistoElePtvsV0dcaRS1(0),
622  fHistoElePtvsV0dcaRS2(0),
623  fHistoElePtvsV0dcaRSSide(0),
624  fHistoElePtvsV0dcaRSSide1(0),
625  fHistoElePtvsV0dcaRSSide2(0),
626  fHistoElePtvsV0dcaRSMix(0),
627  fHistoElePtvsV0dcaRSMix1(0),
628  fHistoElePtvsV0dcaRSMix2(0),
629  fHistoElePtvsV0dcaWS(0),
630  fHistoElePtvsV0dcaWS1(0),
631  fHistoElePtvsV0dcaWS2(0),
632  fHistoElePtvsV0dcaWSSide(0),
633  fHistoElePtvsV0dcaWSSide1(0),
634  fHistoElePtvsV0dcaWSSide2(0),
635  fHistoElePtvsV0dcaWSMix(0),
636  fHistoElePtvsV0dcaWSMix1(0),
637  fHistoElePtvsV0dcaWSMix2(0),
638  fHistoElePtvsV0dcaMCS(0),
639  fHistoElePtvsV0dcaMCS1(0),
640  fHistoElePtvsV0dcaMCS2(0),
641  fHistoElePtvsV0dcaFeedDownXic0MCS(0),
642  fHistoElePtvsV0dcaFeedDownXic0MCS1(0),
643  fHistoElePtvsV0dcaFeedDownXic0MCS2(0),
644  fHistoElePtvsV0dcaFeedDownXicPlusMCS(0),
645  fHistoElePtvsV0dcaFeedDownXicPlusMCS1(0),
646  fHistoElePtvsV0dcaFeedDownXicPlusMCS2(0),
647  fHistoEleLambdaPtvsV0dlRS(0),
648  fHistoEleLambdaPtvsV0dlRS1(0),
649  fHistoEleLambdaPtvsV0dlRS2(0),
650  fHistoEleLambdaPtvsV0dlRSSide(0),
651  fHistoEleLambdaPtvsV0dlRSSide1(0),
652  fHistoEleLambdaPtvsV0dlRSSide2(0),
653  fHistoEleLambdaPtvsV0dlRSMix(0),
654  fHistoEleLambdaPtvsV0dlRSMix1(0),
655  fHistoEleLambdaPtvsV0dlRSMix2(0),
656  fHistoEleLambdaPtvsV0dlWS(0),
657  fHistoEleLambdaPtvsV0dlWS1(0),
658  fHistoEleLambdaPtvsV0dlWS2(0),
659  fHistoEleLambdaPtvsV0dlWSSide(0),
660  fHistoEleLambdaPtvsV0dlWSSide1(0),
661  fHistoEleLambdaPtvsV0dlWSSide2(0),
662  fHistoEleLambdaPtvsV0dlWSMix(0),
663  fHistoEleLambdaPtvsV0dlWSMix1(0),
664  fHistoEleLambdaPtvsV0dlWSMix2(0),
665  fHistoEleLambdaPtvsV0dlMCS(0),
666  fHistoEleLambdaPtvsV0dlMCS1(0),
667  fHistoEleLambdaPtvsV0dlMCS2(0),
668  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS(0),
669  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1(0),
670  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2(0),
671  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS(0),
672  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1(0),
673  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2(0),
674  fHistoResponseElePt(0),
675  fHistoResponseEleLambdaPt(0),
676  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt(0),
677  fCounter(0),
678  fHistonEvtvsRunNumber(0),
679  fHistonElevsRunNumber(0),
680  fHistonLambdavsRunNumber(0),
681  fDoEventMixing(0),
682  fNumberOfEventsForMixing (5),
683  fNzVtxBins (0),
684  fNCentBins (0),
685  fNOfPools(1),
686  fEventBuffer(0x0),
687  fEventInfo(0x0),
688  fElectronTracks(0x0),
689  fV0Tracks1(0x0),
690  fV0Tracks2(0x0),
691  fV0dlArray1(0x0),
692  fV0dlArray2(0x0),
693  fV0dcaArray1(0x0),
694  fV0dcaArray2(0x0)
695 {
696  //
698  //
699  Info("AliAnalysisTaskSELc2eleLambdafromAODtracks","Calling Constructor");
700 
701  for(Int_t i=0;i<17;i++){
702  fHistoElePtvsCutVarsRS[i] = 0;
703  fHistoElePtvsCutVarsWS[i] = 0;
705  }
706  for(Int_t i=0;i<8;i++){
708  }
709 
710  DefineOutput(1,TList::Class()); //conters
711  DefineOutput(2,TList::Class());
712  DefineOutput(3,TList::Class()); //conters
713  DefineOutput(4,TTree::Class()); //My private output
714  DefineOutput(5,TTree::Class()); //My private output
715  DefineOutput(6,TTree::Class()); //My private output
716  DefineOutput(7,TTree::Class()); //My private output
717  DefineOutput(8,AliNormalizationCounter::Class());
718  DefineOutput(9,TTree::Class()); //My private output
719  DefineOutput(10,TTree::Class()); //My private output
720 }
721 
722 //___________________________________________________________________________
724  //
726  //
727  Info("~AliAnalysisTaskSELc2eleLambdafromAODtracks","Calling Destructor");
728 
729  if (fOutput) {
730  delete fOutput;
731  fOutput = 0;
732  }
733 
734  if (fOutputAll) {
735  delete fOutputAll;
736  fOutputAll = 0;
737  }
738 
739  if (fListCuts) {
740  delete fListCuts;
741  fListCuts = 0;
742  }
743 
744 
745  if (fAnalCuts) {
746  delete fAnalCuts;
747  fAnalCuts = 0;
748  }
749 
750  if (fVariablesTree) {
751  delete fVariablesTree;
752  fVariablesTree = 0;
753  }
754  if (fEleVariablesTree) {
755  delete fEleVariablesTree;
756  fEleVariablesTree = 0;
757  }
758  if (fV0VariablesTree) {
759  delete fV0VariablesTree;
760  fV0VariablesTree = 0;
761  }
762  if (fMCVariablesTree) {
763  delete fMCVariablesTree;
764  fMCVariablesTree = 0;
765  }
766  if (fMCEleVariablesTree) {
767  delete fMCEleVariablesTree;
769  }
770  if (fMCV0VariablesTree) {
771  delete fMCV0VariablesTree;
772  fMCV0VariablesTree = 0;
773  }
774  if(fCounter){
775  delete fCounter;
776  fCounter = 0;
777  }
778 
779  if(fElectronTracks) fElectronTracks->Delete();
780  delete fElectronTracks;
781  if(fV0Tracks1) fV0Tracks1->Delete();
782  delete fV0Tracks1;
783  if(fV0Tracks2) fV0Tracks2->Delete();
784  delete fV0Tracks2;
785  if(fEventBuffer){
786  for(Int_t i=0; i<fNOfPools; i++) delete fEventBuffer[i];
787  delete fEventBuffer;
788  }
789  delete fEventInfo;
790 }
791 
792 //_________________________________________________
794  //
796  //
797  //
798 
799  fIsEventSelected=kFALSE;
800 
801  if (fDebug > 1) AliInfo("Init");
802 
803  fListCuts = new TList();
804  fListCuts->SetOwner();
805  fListCuts->SetName("ListCuts");
807  PostData(2,fListCuts);
808 
809  return;
810 }
811 
812 //_________________________________________________
814 {
815  //
817  //
818 
819  if (!fInputEvent) {
820  AliError("NO EVENT FOUND!");
821  return;
822  }
823  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
824  fCEvents->Fill(1);
826 
827  //------------------------------------------------
828  // First check if the event has proper B
829  //------------------------------------------------
830 
831  fBzkG = (Double_t)aodEvent->GetMagneticField();
832  AliKFParticle::SetField(fBzkG);
833  if (TMath::Abs(fBzkG)<0.001) {
834  return;
835  }
836  fCEvents->Fill(2);
837 
840 
841  //------------------------------------------------
842  // MC analysis setting
843  //------------------------------------------------
844  TClonesArray *mcArray = 0;
845  AliAODMCHeader *mcHeader=0;
846  if (fUseMCInfo) {
847  // MC array need for maching
848  mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
849  if (!mcArray) {
850  AliError("Could not find Monte-Carlo in AOD");
851  return;
852  }
853  fCEvents->Fill(6); // in case of MC events
854 
855  // load MC header
856  mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
857  if (!mcHeader) {
858  AliError("AliAnalysisTaskSELc2eleLambdafromAODtracks::UserExec: MC header branch not found!\n");
859  return;
860  }
861  fCEvents->Fill(7); // in case of MC events
862 
863  Double_t zMCVertex = mcHeader->GetVtxZ();
864  if (TMath::Abs(zMCVertex) > fAnalCuts->GetMaxVtxZ()) {
865  AliDebug(2,Form("Event rejected: abs(zVtxMC)=%f > fAnalCuts->GetMaxVtxZ()=%f",zMCVertex,fAnalCuts->GetMaxVtxZ()));
866  return;
867  } else {
868  fCEvents->Fill(17); // in case of MC events
869  }
870  if ((TMath::Abs(zMCVertex) < fAnalCuts->GetMaxVtxZ()) && (!fAnalCuts->IsEventRejectedDuePhysicsSelection()) && (!fAnalCuts->IsEventRejectedDueToTrigger())) {
871  MakeMCAnalysis(mcArray);
872  }
873  }
874 
875  //------------------------------------------------
876  // Event selection
877  //------------------------------------------------
878  fVtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
879  if (!fVtx1) return;
880 
881  Double_t pos[3],cov[6];
882  fVtx1->GetXYZ(pos);
883  fVtx1->GetCovarianceMatrix(cov);
884  fV1 = new AliESDVertex(pos,cov,100.,100,fVtx1->GetName());
885  fVtxZ = pos[2];
886 
887  Bool_t fIsTriggerNotOK = fAnalCuts->IsEventRejectedDueToTrigger();
888  if(!fIsTriggerNotOK) fCEvents->Fill(3);
889  if(!fIsEventSelected) {
890  delete fV1;
891  return;
892  }
893  fCEvents->Fill(4);
894 
895  fIsMB=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kMB)==(AliVEvent::kMB);
896  fIsSemi=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kSemiCentral)==(AliVEvent::kSemiCentral);
897  fIsCent=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kCentral)==(AliVEvent::kCentral);
898  fIsINT7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kINT7)==(AliVEvent::kINT7);
899  fIsEMC7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kEMC7)==(AliVEvent::kEMC7);
901  if(fIsMB) fHTrigger->Fill(1);
902  if(fIsSemi) fHTrigger->Fill(2);
903  if(fIsCent) fHTrigger->Fill(3);
904  if(fIsINT7) fHTrigger->Fill(4);
905  if(fIsEMC7) fHTrigger->Fill(5);
906  if(fIsMB|fIsSemi|fIsCent) fHTrigger->Fill(7);
907  if(fIsINT7|fIsEMC7) fHTrigger->Fill(8);
908  if(fIsMB&fIsSemi) fHTrigger->Fill(10);
909  if(fIsMB&fIsCent) fHTrigger->Fill(11);
910  if(fIsINT7&fIsEMC7) fHTrigger->Fill(12);
911 
912  if(fUseCentralityV0M){
913  AliCentrality *cent = aodEvent->GetCentrality();
914  fCentrality = cent->GetCentralityPercentile("V0M");
915  }else{
916  fCentrality = 1.;
917  }
918  if(fCentrality<0.||fCentrality>100.-0.0000001) {
919  delete fV1;
920  return;
921  }
922  fHCentrality->Fill(fCentrality);
923  fRunNumber = aodEvent->GetRunNumber();
924 
925  Int_t runnumber_offset = 0;
926  Int_t runnumber = aodEvent->GetRunNumber();
927  if(runnumber<=131000&&runnumber>=114000){
928  runnumber_offset = 114000;//lhc10bcde
929  }else if(runnumber<=196000&&runnumber>=195000){
930  runnumber_offset = 195000;//lhc13bc
931  }else if(runnumber<=170593&&runnumber>=167902){
932  runnumber_offset = 167902;//lhc11h
933  }
934  fHistonEvtvsRunNumber->Fill(runnumber-runnumber_offset,1.);
935 
936  //------------------------------------------------
937  // Check if the event has v0 candidate
938  //------------------------------------------------
939  //Int_t nv0 = aodEvent->GetNumberOfV0s();
940  fCEvents->Fill(5);
941 
942 
943  //------------------------------------------------
944  // Main analysis done in this function
945  //------------------------------------------------
946  MakeAnalysis(aodEvent,mcArray);
947 
948 
949  PostData(1,fOutput);
950  PostData(3,fOutputAll);
951  PostData(4,fVariablesTree);
952  PostData(5,fEleVariablesTree);
953  PostData(6,fV0VariablesTree);
954  PostData(7,fMCVariablesTree);
955  PostData(8,fCounter);
956  PostData(9,fMCEleVariablesTree);
957  PostData(10,fMCV0VariablesTree);
958 
959  fIsEventSelected=kFALSE;
960 
961  delete fV1;
962  return;
963 }
964 
965 //________________________________________ terminate ___________________________
967 {
971 
972  //AliInfo("Terminate","");
973  AliAnalysisTaskSE::Terminate();
974 
975  fOutput = dynamic_cast<TList*> (GetOutputData(1));
976  if (!fOutput) {
977  AliError("fOutput not available");
978  return;
979  }
980 
981  fOutputAll = dynamic_cast<TList*> (GetOutputData(3));
982  if (!fOutputAll) {
983  AliError("fOutputAll not available");
984  return;
985  }
986 
987  return;
988 }
989 
990 //___________________________________________________________________________
992 {
996  //AliInfo(Form("CreateOutputObjects of task %s\n", GetName()));
997 
998  //------------------------------------------------
999  // output object setting
1000  //------------------------------------------------
1001  fOutput = new TList();
1002  fOutput->SetOwner();
1003  fOutput->SetName("chist0");
1004  DefineGeneralHistograms(); // define general histograms
1005  PostData(1,fOutput);
1006 
1007  fOutputAll = new TList();
1008  fOutputAll->SetOwner();
1009  fOutputAll->SetName("anahisto");
1010  DefineAnalysisHistograms(); // define general histograms
1011  PostData(3,fOutputAll);
1012 
1014  PostData(4,fVariablesTree);
1015 
1017  PostData(5,fEleVariablesTree);
1018 
1020  PostData(6,fV0VariablesTree);
1021 
1023  PostData(7,fMCVariablesTree);
1024 
1026  PostData(9,fMCEleVariablesTree);
1027 
1029  PostData(10,fMCV0VariablesTree);
1030 
1031  //Counter for Normalization
1032  TString normName="NormalizationCounter";
1033  AliAnalysisDataContainer *cont = GetOutputSlot(8)->GetContainer();
1034  if(cont)normName=(TString)cont->GetName();
1035  fCounter = new AliNormalizationCounter(normName.Data());
1036  fCounter->Init();
1037  PostData(8,fCounter);
1038 
1039  if(fDoEventMixing){
1040  fElectronTracks = new TObjArray();
1041  fElectronTracks->SetOwner();
1042  fV0Tracks1 = new TObjArray();
1043  fV0Tracks1->SetOwner();
1044  fV0Tracks2 = new TObjArray();
1045  fV0Tracks2->SetOwner();
1046 
1048  fEventBuffer = new TTree*[fNOfPools];
1049  for(Int_t i=0; i<fNOfPools; i++){
1050  fEventBuffer[i]=new TTree(Form("EventBuffer_%d",i), "Temporary buffer for event mixing");
1051  fEventBuffer[i]->Branch("zVertex", &fVtxZ);
1052  fEventBuffer[i]->Branch("centrality", &fCentrality);
1053  fEventBuffer[i]->Branch("eventInfo", "TObjString",&fEventInfo);
1054  fEventBuffer[i]->Branch("v1array", "TObjArray", &fV0Tracks1);
1055  fEventBuffer[i]->Branch("v2array", "TObjArray", &fV0Tracks2);
1056  fEventBuffer[i]->Branch("vdl1array", &fV0dlArray1);
1057  fEventBuffer[i]->Branch("vdl2array", &fV0dlArray2);
1058  fEventBuffer[i]->Branch("vdca1array", &fV0dcaArray1);
1059  fEventBuffer[i]->Branch("vdca2array", &fV0dcaArray2);
1060  }
1061  }
1062 
1063 
1064  return;
1065 }
1066 
1067 //-------------------------------------------------------------------------------
1070  AliAODEvent *aodEvent, TClonesArray *mcArray
1071  )
1072 {
1073  //
1075  //
1076  if(fDoEventMixing){
1077  if(fElectronTracks) fElectronTracks->Delete();
1078  if(fV0Tracks1) fV0Tracks1->Delete();
1079  if(fV0Tracks2) fV0Tracks2->Delete();
1080  fV0dlArray1.clear();
1081  fV0dlArray2.clear();
1082  fV0dcaArray1.clear();
1083  fV0dcaArray2.clear();
1084  }
1085 
1086  //------------------------------------------------
1087  // Select good track before hand to save time
1088  //------------------------------------------------
1089 
1090  Int_t nV0s= aodEvent->GetNumberOfV0s();
1091  Int_t nTracks= aodEvent->GetNumberOfTracks();
1092 
1093  Bool_t seleTrkFlags[nTracks];
1094  Int_t nSeleTrks=0;
1095  SelectTrack(aodEvent,nTracks,nSeleTrks,seleTrkFlags,mcArray);
1096 
1097  Bool_t seleV0Flags[nV0s];
1098  Int_t nSeleV0=0;
1099  SelectV0(aodEvent,nV0s,nSeleV0,seleV0Flags,mcArray);
1100 
1101  Int_t runnumber_offset = 0;
1102  Int_t runnumber = aodEvent->GetRunNumber();
1103  if(runnumber<=131000&&runnumber>=114000){
1104  runnumber_offset = 114000;//lhc10bcde
1105  }else if(runnumber<=196000&&runnumber>=195000){
1106  runnumber_offset = 195000;//lhc13bc
1107  }else if(runnumber<=170593&&runnumber>=167902){
1108  runnumber_offset = 167902;//lhc11h
1109  }
1110  fHistonElevsRunNumber->Fill(runnumber-runnumber_offset,nSeleTrks);
1111  fHistonLambdavsRunNumber->Fill(runnumber-runnumber_offset,nSeleV0);
1112 
1113  //------------------------------------------------
1114  // V0 loop
1115  //------------------------------------------------
1116  for (Int_t iv0 = 0; iv0<nV0s; iv0++) {
1117  if(!seleV0Flags[iv0]) continue;
1118  AliAODv0 *v0 = aodEvent->GetV0(iv0);
1119  if(!v0) continue;
1120 
1121  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
1122  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
1123 
1124  //------------------------------------------------
1125  // track loop
1126  //------------------------------------------------
1127  for (Int_t itrk = 0; itrk<nTracks; itrk++) {
1128  if(!seleTrkFlags[itrk]) continue;
1129  AliAODTrack *trk = (AliAODTrack*)aodEvent->GetTrack(itrk);
1130  if(trk->GetID()<0) continue;
1131 
1132  Int_t cpid = cptrack->GetID();
1133  Int_t cnid = cntrack->GetID();
1134  Int_t lpid = trk->GetID();
1135  if((cpid==lpid)||(cnid==lpid)) continue;
1136 
1137  //if(!fAnalCuts->SelectWithRoughCuts(v0,trk)) continue;
1138 
1139  AliAODVertex *secVert = ReconstructSecondaryVertex(v0,trk,aodEvent);//Fake, prim vertex is just used as secondary vertex. place holder for future
1140  if(!secVert) continue;
1141 
1142  AliAODRecoCascadeHF *elobj = MakeCascadeHF(v0,trk,aodEvent,secVert);
1143  if(!elobj) {
1144  continue;
1145  }
1146 
1147  FillROOTObjects(elobj, v0,trk,mcArray);
1148 
1149  elobj->GetSecondaryVtx()->RemoveDaughters();
1150  elobj->UnsetOwnPrimaryVtx();
1151  delete elobj;elobj=NULL;
1152  delete secVert;
1153  }
1154  }
1155 
1156  if(fDoEventMixing){
1157  fEventInfo->SetString(Form("Ev%d_esd%d_E%d_V%d",AliAnalysisManager::GetAnalysisManager()->GetNcalls(),((AliAODHeader*)aodEvent->GetHeader())->GetEventNumberESDFile(),fElectronTracks->GetEntries(),fV0Tracks1->GetEntries()+fV0Tracks2->GetEntries()));
1158  Int_t ind=GetPoolIndex(fVtxZ,fCentrality);
1159  if(ind>=0 && ind<fNOfPools){
1160  if(fEventBuffer[ind]->GetEntries() >= fNumberOfEventsForMixing){
1161  DoEventMixingWithPools(ind);
1162  if(fEventBuffer[ind]->GetEntries() >= 20*fNumberOfEventsForMixing){
1163  ResetPool(ind);
1164  }
1165  }
1166  fEventBuffer[ind]->Fill();
1167  }
1168  }
1169 }
1172 {
1176 
1177  const char* nameoutput = GetOutputSlot(4)->GetContainer()->GetName();
1178  fVariablesTree = new TTree(nameoutput,"Candidates variables tree");
1179  Int_t nVar = 74;
1180  fCandidateVariables = new Float_t [nVar];
1181  TString * fCandidateVariableNames = new TString[nVar];
1182 
1183  fCandidateVariableNames[ 0]="Centrality";
1184  fCandidateVariableNames[ 1]="InvMassEleLambda";
1185  fCandidateVariableNames[ 2]="EleLambdaPt";
1186  fCandidateVariableNames[ 3]="EleLambdaPx";
1187  fCandidateVariableNames[ 4]="EleLambdaPy";
1188  fCandidateVariableNames[ 5]="EleLambdaPz";
1189  fCandidateVariableNames[ 6]="ElePx";
1190  fCandidateVariableNames[ 7]="ElePy";
1191  fCandidateVariableNames[ 8]="ElePz";
1192  fCandidateVariableNames[ 9]="V0Px";
1193  fCandidateVariableNames[10]="V0Py";
1194  fCandidateVariableNames[11]="V0Pz";
1195  fCandidateVariableNames[12]="AntiLambdaFlag";
1196  fCandidateVariableNames[13]="MassLambda";
1197  fCandidateVariableNames[14]="MassAntiLambda";
1198  fCandidateVariableNames[15]="Eled0";
1199  fCandidateVariableNames[16]="V0d0";
1200  fCandidateVariableNames[17]="nSigmaTPCele";
1201  fCandidateVariableNames[18]="nSigmaTOFele";
1202  fCandidateVariableNames[19]="nSigmaTPCv0pr";
1203  fCandidateVariableNames[20]="nSigmaTOFv0pr";
1204  fCandidateVariableNames[21]="EleCharge";
1205  fCandidateVariableNames[22]="ProtonPx";
1206  fCandidateVariableNames[23]="ProtonPy";
1207  fCandidateVariableNames[24]="ProtonPz";
1208  fCandidateVariableNames[25]="PiPx";
1209  fCandidateVariableNames[26]="PiPy";
1210  fCandidateVariableNames[27]="PiPz";
1211  fCandidateVariableNames[28]="mcpdglc";
1212  fCandidateVariableNames[29]="mclablc";
1213  fCandidateVariableNames[30]="mcpdgmomele";
1214  fCandidateVariableNames[31]="mcpdgmomv0";
1215  fCandidateVariableNames[32]="Mixing";
1216  fCandidateVariableNames[33]="mcpdgele";
1217  fCandidateVariableNames[34]="nSigmaTPCpr_etrk";
1218  fCandidateVariableNames[35]="nSigmaTOFpr_etrk";
1219  fCandidateVariableNames[36]="nSigmaTPCka_etrk";
1220  fCandidateVariableNames[37]="nSigmaTOFka_etrk";
1221  fCandidateVariableNames[38]="MassK0Short";
1222  fCandidateVariableNames[39]="mcpdggrmomele";
1223  fCandidateVariableNames[40]="mcpdggrmomv0";
1224  fCandidateVariableNames[41]="mcngenele";
1225  fCandidateVariableNames[42]="mcngenv0";
1226  fCandidateVariableNames[43]="mclcpx";
1227  fCandidateVariableNames[44]="mclcpy";
1228  fCandidateVariableNames[45]="mclcpz";
1229  fCandidateVariableNames[46]="mcelepx";
1230  fCandidateVariableNames[47]="mcelepy";
1231  fCandidateVariableNames[48]="mcelepz";
1232  fCandidateVariableNames[49]="mcv0px";
1233  fCandidateVariableNames[50]="mcv0py";
1234  fCandidateVariableNames[51]="mcv0pz";
1235  fCandidateVariableNames[52]="nSigmaTPCpi_etrk";
1236  fCandidateVariableNames[53]="nSigmaTOFpi_etrk";
1237  fCandidateVariableNames[54]="PrimVertx";
1238  fCandidateVariableNames[55]="PrimVerty";
1239  fCandidateVariableNames[56]="PrimVertz";
1240  fCandidateVariableNames[57]="V0Vertx";
1241  fCandidateVariableNames[58]="V0Verty";
1242  fCandidateVariableNames[59]="V0Vertz";
1243 
1244  fCandidateVariableNames[60]="DcaV0PrToPrimVertex";
1245  fCandidateVariableNames[61]="DcaV0PiToPrimVertex";
1246  fCandidateVariableNames[62]="DcaV0daughters";
1247  fCandidateVariableNames[63]="V0CosPointingAngle";
1248  fCandidateVariableNames[64]="V0ProperDecayLength";
1249  fCandidateVariableNames[65]="MassK0Short2";
1250 
1251  fCandidateVariableNames[66]="nSigmaTPCv0pi";
1252  fCandidateVariableNames[67]="nSigmaTOFv0pi";
1253 
1254  fCandidateVariableNames[68]= "EleITSMatch";
1255  fCandidateVariableNames[69]= "V0PosITSMatch";
1256  fCandidateVariableNames[70]= "V0NegITSMatch";
1257  fCandidateVariableNames[71]= "IsV0PeakRegion";
1258 
1259  fCandidateVariableNames[72]="EvNumber";
1260  fCandidateVariableNames[73]="RunNumber";
1261 
1262  for (Int_t ivar=0; ivar<nVar; ivar++) {
1263  fVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1264  }
1265 
1266  return;
1267 }
1268 
1270 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillROOTObjects(AliAODRecoCascadeHF *elobj, AliAODv0 *v0, AliAODTrack *trk, TClonesArray *mcArray)
1271 {
1275  if(!trk) return;
1276  if(!v0) return;
1277 
1278  for(Int_t i=0;i<74;i++){
1279  fCandidateVariables[i] = -9999.;
1280  }
1281 
1282  Bool_t anti_lambda_flag = kFALSE;
1283  if(fabs(v0->MassAntiLambda()-1.115683)<fAnalCuts->GetProdV0MassTolLambdaRough()) anti_lambda_flag = kTRUE;
1284 
1285  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
1286  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
1287  if(cptrack->Charge()<0 && cntrack->Charge()>0){
1288  cptrack = (AliAODTrack*)(v0->GetDaughter(1));
1289  cntrack = (AliAODTrack*)(v0->GetDaughter(0));
1290  }
1291 
1293  UInt_t pdgdg[2]={11,3122};
1294  fCandidateVariables[ 1] = elobj->InvMass(2,pdgdg);
1295  fCandidateVariables[ 2] = elobj->Pt();
1296  fCandidateVariables[ 3] = elobj->Px();
1297  fCandidateVariables[ 4] = elobj->Py();
1298  fCandidateVariables[ 5] = elobj->Pz();
1299  fCandidateVariables[ 6] = elobj->PxProng(0);
1300  fCandidateVariables[ 7] = elobj->PyProng(0);
1301  fCandidateVariables[ 8] = elobj->PzProng(0);
1302  fCandidateVariables[ 9] = elobj->PxProng(1);
1303  fCandidateVariables[10] = elobj->PyProng(1);
1304  fCandidateVariables[11] = elobj->PzProng(1);
1305  fCandidateVariables[12] = anti_lambda_flag;
1306  fCandidateVariables[13] = v0->MassLambda();
1307  fCandidateVariables[14] = v0->MassAntiLambda();
1308  fCandidateVariables[15] = elobj->Getd0Prong(0);
1309  fCandidateVariables[16] = elobj->Getd0Prong(1);
1310 
1311  Double_t nSigmaTPCele=-9999.;
1312  Double_t nSigmaTOFele=-9999.;
1313  Double_t nSigmaTPCv0pr=-9999.;
1314  Double_t nSigmaTOFv0pr=-9999.;
1315  Double_t nSigmaTPCv0pi=-9999.;
1316  Double_t nSigmaTOFv0pi=-9999.;
1317  if(fAnalCuts->GetIsUsePID())
1318  {
1319  nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
1320  nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
1321  fCandidateVariables[17] = nSigmaTPCele;
1322  fCandidateVariables[18] = nSigmaTOFele;
1323  }
1324 
1325  if(fAnalCuts->GetUseLambdaPID())
1326  {
1327  if(anti_lambda_flag){
1328  nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
1329  nSigmaTOFv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kProton);
1330  nSigmaTPCv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
1331  nSigmaTOFv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kPion);
1332  }else{
1333  nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
1334  nSigmaTOFv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kProton);
1335  nSigmaTPCv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
1336  nSigmaTOFv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kPion);
1337  }
1338  fCandidateVariables[19] = nSigmaTPCv0pr;
1339  fCandidateVariables[20] = nSigmaTOFv0pr;
1340  fCandidateVariables[66] = nSigmaTPCv0pi;
1341  fCandidateVariables[67] = nSigmaTOFv0pi;
1342  }
1343  fCandidateVariables[21] = trk->Charge();
1344 
1345  if(anti_lambda_flag){
1346  fCandidateVariables[22] = cntrack->Px();
1347  fCandidateVariables[23] = cntrack->Py();
1348  fCandidateVariables[24] = cntrack->Pz();
1349  fCandidateVariables[25] = cptrack->Px();
1350  fCandidateVariables[26] = cptrack->Py();
1351  fCandidateVariables[27] = cptrack->Pz();
1352  }else{
1353  fCandidateVariables[22] = cptrack->Px();
1354  fCandidateVariables[23] = cptrack->Py();
1355  fCandidateVariables[24] = cptrack->Pz();
1356  fCandidateVariables[25] = cntrack->Px();
1357  fCandidateVariables[26] = cntrack->Py();
1358  fCandidateVariables[27] = cntrack->Pz();
1359  }
1360 
1361  AliAODMCParticle *mclc = 0;
1362  AliAODMCParticle *mcele = 0;
1363  AliAODMCParticle *mcv0 = 0;
1364  Int_t mclablc = 0;
1365  Int_t mcpdgele_array[100];
1366  Int_t mcpdgv0_array[100];
1367  Int_t mclabelele_array[100];
1368  Int_t mclabelv0_array[100];
1369  Int_t mcngen_ele=-9999;
1370  Int_t mcngen_v0=-9999;
1371 
1372  if(fUseMCInfo && mcArray){
1373 
1374  mclablc = MatchToMC(elobj,mcArray,mcpdgele_array, mcpdgv0_array,mclabelele_array,mclabelv0_array,mcngen_ele,mcngen_v0);
1375 
1376  if(mclablc>-1){
1377  mclc = (AliAODMCParticle*) mcArray->At(mclablc);
1378  if(mclabelele_array[0]>=0)
1379  mcele = (AliAODMCParticle*) mcArray->At(mclabelele_array[0]);
1380  if(mclabelv0_array[0]>=0)
1381  mcv0 = (AliAODMCParticle*) mcArray->At(mclabelv0_array[0]);
1382  if(mclc){
1383  fCandidateVariables[28] = mclc->GetPdgCode();
1384  fCandidateVariables[29] = mclc->Label();
1385  fCandidateVariables[43] = mclc->Px();
1386  fCandidateVariables[44] = mclc->Py();
1387  fCandidateVariables[45] = mclc->Pz();
1388  }
1389  if(mcele){
1390  fCandidateVariables[46] = mcele->Px();
1391  fCandidateVariables[47] = mcele->Py();
1392  fCandidateVariables[48] = mcele->Pz();
1393  }
1394  if(mcv0){
1395  fCandidateVariables[49] = mcv0->Px();
1396  fCandidateVariables[50] = mcv0->Py();
1397  fCandidateVariables[51] = mcv0->Pz();
1398  }
1399  }
1400  fCandidateVariables[30] = mcpdgele_array[1];
1401  fCandidateVariables[31] = mcpdgv0_array[1];
1402  fCandidateVariables[33] = mcpdgele_array[0];
1403  fCandidateVariables[39] = mcpdgele_array[2];
1404  fCandidateVariables[40] = mcpdgv0_array[2];
1405  fCandidateVariables[41] = mcngen_ele;
1406  fCandidateVariables[42] = mcngen_v0;
1407  }
1408  fCandidateVariables[32] = 0;
1409 
1410  if(fAnalCuts->GetIsUsePID())
1411  {
1412  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
1413  Double_t nSigmaTOFpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kProton);
1414  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
1415  Double_t nSigmaTOFka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kKaon);
1416  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
1417  Double_t nSigmaTOFpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kPion);
1418  fCandidateVariables[34] = nSigmaTPCpr_etrk;
1419  fCandidateVariables[35] = nSigmaTOFpr_etrk;
1420  fCandidateVariables[36] = nSigmaTPCka_etrk;
1421  fCandidateVariables[37] = nSigmaTOFka_etrk;
1422  fCandidateVariables[52] = nSigmaTPCpi_etrk;
1423  fCandidateVariables[53] = nSigmaTOFpi_etrk;
1424  }
1425  fCandidateVariables[38] = v0->MassK0Short();
1426 
1427  fCandidateVariables[54] = fVtx1->GetX();
1428  fCandidateVariables[55] = fVtx1->GetY();
1429  fCandidateVariables[56] = fVtx1->GetZ();
1430  fCandidateVariables[57] = v0->DecayVertexV0X();
1431  fCandidateVariables[58] = v0->DecayVertexV0Y();
1432  fCandidateVariables[59] = v0->DecayVertexV0Z();
1433 
1434  Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
1435  Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
1436  if(!anti_lambda_flag){
1437  fCandidateVariables[60] = lDcaPosToPrimVertex;
1438  fCandidateVariables[61] = lDcaNegToPrimVertex;
1439  }else{
1440  fCandidateVariables[60] = lDcaNegToPrimVertex;
1441  fCandidateVariables[61] = lDcaPosToPrimVertex;
1442  }
1443  fCandidateVariables[62] = v0->DcaV0Daughters();
1444  Double_t posVtx[3] = {0.,0.,0.};
1445  fVtx1->GetXYZ(posVtx);
1446  fCandidateVariables[63] = v0->CosPointingAngle(posVtx);
1447  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
1448  fCandidateVariables[64] = v0->DecayLengthV0(posVtx)*1.1157/ptotlam;
1449  fCandidateVariables[65] = v0->MassK0Short();
1450 
1451  if(trk) fCandidateVariables[68] = trk->GetITSClusterMap();
1452  if(cptrack) fCandidateVariables[69] = cptrack->GetITSClusterMap();
1453  if(cntrack) fCandidateVariables[70] = cntrack->GetITSClusterMap();
1454 
1458 
1459 
1460  if(fWriteVariableTree)
1461  fVariablesTree->Fill();
1462 
1463  Double_t cont[3];
1464  cont[0] = elobj->InvMass(2,pdgdg);
1465  cont[1] = elobj->Pt();
1466  cont[2] = fCentrality;
1467  fHistoEleLambdaMass->Fill(cont);
1468  Double_t cont2[3];
1469  cont2[0] = elobj->InvMass(2,pdgdg);
1470  cont2[1] = trk->Pt();
1471  cont2[2] = fCentrality;
1472  Double_t cont_eleptvseta[3];
1473  cont_eleptvseta[0] = trk->Pt();
1474  cont_eleptvseta[1] = trk->Eta();
1475  cont_eleptvseta[2] = fCentrality;
1476 
1477  Double_t cont_eleptvslambdapt[3];
1478  cont_eleptvslambdapt[0] = trk->Pt();
1479  cont_eleptvslambdapt[1] = v0->Pt();
1480  cont_eleptvslambdapt[2] = fCentrality;
1481 
1482  Double_t cont_eleptvsd0[3];
1483  cont_eleptvsd0[0] = trk->Pt();
1484  cont_eleptvsd0[1] = elobj->Getd0Prong(0)*trk->Charge();
1485  cont_eleptvsd0[2] = fCentrality;
1486 
1487  Double_t cont_eleptvsv0dl[3];
1488  cont_eleptvsv0dl[0] = trk->Pt();
1489  cont_eleptvsv0dl[1] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;
1490  cont_eleptvsv0dl[2] = fCentrality;
1491 
1492  Double_t cont_elelamptvsv0dl[3];
1493  cont_elelamptvsv0dl[0] = elobj->Pt();
1494  cont_elelamptvsv0dl[1] = v0->DecayLengthV0(posVtx)*1.115683/ptotlam;
1495  cont_elelamptvsv0dl[2] = fCentrality;
1496 
1497 
1498  Double_t cont_eleptvsv0dca[3];
1499  cont_eleptvsv0dca[0] = trk->Pt();
1500  cont_eleptvsv0dca[1] = v0->DcaV0ToPrimVertex();
1501  cont_eleptvsv0dca[2] = fCentrality;
1502 
1503 
1505  {
1506 
1507  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
1508  fHistoEleLambdaMassRS->Fill(cont);
1509  fHistoEleLambdaMassvsElePtRS->Fill(cont2);
1510  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtRS1->Fill(cont2);
1511  else fHistoEleLambdaMassvsElePtRS2->Fill(cont2);
1512  if(cont[0]<2.3){
1513  fHistoElePtRS->Fill(trk->Pt(),fCentrality);
1514  fHistoElePtvsEtaRS->Fill(cont_eleptvseta);
1515  fHistoElePtvsLambdaPtRS->Fill(cont_eleptvslambdapt);
1516  fHistoElePtvsd0RS->Fill(cont_eleptvsd0);
1517 
1518  fHistoElePtvsV0dlRS->Fill(cont_eleptvsv0dl);
1519  if(trk->Charge()>0) fHistoElePtvsV0dlRS1->Fill(cont_eleptvsv0dl);
1520  else fHistoElePtvsV0dlRS2->Fill(cont_eleptvsv0dl);
1521 
1522  fHistoEleLambdaPtvsV0dlRS->Fill(cont_elelamptvsv0dl);
1523  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRS1->Fill(cont_elelamptvsv0dl);
1524  else fHistoEleLambdaPtvsV0dlRS2->Fill(cont_elelamptvsv0dl);
1525 
1526  fHistoElePtvsV0dcaRS->Fill(cont_eleptvsv0dca);
1527  if(trk->Charge()>0) fHistoElePtvsV0dcaRS1->Fill(cont_eleptvsv0dca);
1528  else fHistoElePtvsV0dcaRS2->Fill(cont_eleptvsv0dca);
1529 
1530  for(Int_t ih=0;ih<17;ih++){
1531  Double_t cont_eleptvscutvars[3];
1532  cont_eleptvscutvars[0] = trk->Pt();
1533  cont_eleptvscutvars[2] = fCentrality;
1534 
1535  if(ih==0){
1536  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1537  }else if(ih==1){
1538  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1539  }else if(ih==2){
1540  cont_eleptvscutvars[1] = nSigmaTPCele;
1541  }else if(ih==3){
1542  cont_eleptvscutvars[1] = nSigmaTOFele;
1543  }else if(ih==4){
1544  cont_eleptvscutvars[1] = trk->Eta();
1545  }else if(ih==5){
1546  cont_eleptvscutvars[1] = trk->GetITSNcls();
1547  }else if(ih==6){
1548  if(!anti_lambda_flag)
1549  cont_eleptvscutvars[1] = v0->MassLambda();
1550  else
1551  cont_eleptvscutvars[1] = v0->MassAntiLambda();
1552  }else if(ih==7){
1553  Double_t lPosV0[3];
1554  lPosV0[0] = v0->DecayVertexV0X();
1555  lPosV0[1] = v0->DecayVertexV0Y();
1556  lPosV0[2] = v0->DecayVertexV0Z();
1557  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1558  }else if(ih==8){
1559  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
1560  }else if(ih==9){
1561  if(!anti_lambda_flag)
1562  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1563  else
1564  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1565  }else if(ih==10){
1566  if(!anti_lambda_flag)
1567  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1568  else
1569  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1570  }else if(ih==11){
1571  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
1572  }else if(ih==12){
1573  cont_eleptvscutvars[1] = v0->MassK0Short();
1574  }else if(ih==13){
1575  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1576  }else if(ih==14){
1577  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1578  }else if(ih==15){
1579  cont_eleptvscutvars[1] = v0->Eta();
1580  }else if(ih==16){
1581  Double_t v0px = elobj->PxProng(1);
1582  Double_t v0py = elobj->PyProng(1);
1583  Double_t v0pz = elobj->PzProng(1);
1584  Double_t epx = elobj->PxProng(0);
1585  Double_t epy = elobj->PyProng(0);
1586  Double_t epz = elobj->PzProng(0);
1587  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
1588  }else{
1589  cont_eleptvscutvars[1] = -9999.;
1590  }
1591 
1592  fHistoElePtvsCutVarsRS[ih]->Fill(cont_eleptvscutvars);
1593  }
1594  }
1595  }else if((trk->Charge()<0 && !anti_lambda_flag) || (trk->Charge()>0 && anti_lambda_flag)){
1596  fHistoEleLambdaMassWS->Fill(cont);
1597  fHistoEleLambdaMassvsElePtWS->Fill(cont2);
1598  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtWS1->Fill(cont2);
1599  else fHistoEleLambdaMassvsElePtWS2->Fill(cont2);
1600  if(cont[0]<2.3){
1601  fHistoElePtWS->Fill(trk->Pt(),fCentrality);
1602  fHistoElePtvsEtaWS->Fill(cont_eleptvseta);
1603  fHistoElePtvsLambdaPtWS->Fill(cont_eleptvslambdapt);
1604  fHistoElePtvsd0WS->Fill(cont_eleptvsd0);
1605 
1606  fHistoElePtvsV0dlWS->Fill(cont_eleptvsv0dl);
1607  if(trk->Charge()>0) fHistoElePtvsV0dlWS1->Fill(cont_eleptvsv0dl);
1608  else fHistoElePtvsV0dlWS2->Fill(cont_eleptvsv0dl);
1609 
1610  fHistoEleLambdaPtvsV0dlWS->Fill(cont_elelamptvsv0dl);
1611  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWS1->Fill(cont_elelamptvsv0dl);
1612  else fHistoEleLambdaPtvsV0dlWS2->Fill(cont_elelamptvsv0dl);
1613 
1614  fHistoElePtvsV0dcaWS->Fill(cont_eleptvsv0dca);
1615  if(trk->Charge()>0) fHistoElePtvsV0dcaWS1->Fill(cont_eleptvsv0dca);
1616  else fHistoElePtvsV0dcaWS2->Fill(cont_eleptvsv0dca);
1617 
1618  for(Int_t ih=0;ih<17;ih++){
1619  Double_t cont_eleptvscutvars[3];
1620  cont_eleptvscutvars[0] = trk->Pt();
1621  cont_eleptvscutvars[2] = fCentrality;
1622 
1623  if(ih==0){
1624  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1625  }else if(ih==1){
1626  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1627  }else if(ih==2){
1628  cont_eleptvscutvars[1] = nSigmaTPCele;
1629  }else if(ih==3){
1630  cont_eleptvscutvars[1] = nSigmaTOFele;
1631  }else if(ih==4){
1632  cont_eleptvscutvars[1] = trk->Eta();
1633  }else if(ih==5){
1634  cont_eleptvscutvars[1] = trk->GetITSNcls();
1635  }else if(ih==6){
1636  if(!anti_lambda_flag)
1637  cont_eleptvscutvars[1] = v0->MassLambda();
1638  else
1639  cont_eleptvscutvars[1] = v0->MassAntiLambda();
1640  }else if(ih==7){
1641  Double_t lPosV0[3];
1642  lPosV0[0] = v0->DecayVertexV0X();
1643  lPosV0[1] = v0->DecayVertexV0Y();
1644  lPosV0[2] = v0->DecayVertexV0Z();
1645  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1646  }else if(ih==8){
1647  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
1648  }else if(ih==9){
1649  if(!anti_lambda_flag)
1650  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1651  else
1652  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1653  }else if(ih==10){
1654  if(!anti_lambda_flag)
1655  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1656  else
1657  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1658  }else if(ih==11){
1659  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
1660  }else if(ih==12){
1661  cont_eleptvscutvars[1] = v0->MassK0Short();
1662  }else if(ih==13){
1663  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1664  }else if(ih==14){
1665  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1666  }else if(ih==15){
1667  cont_eleptvscutvars[1] = v0->Eta();
1668  }else if(ih==16){
1669  Double_t v0px = elobj->PxProng(1);
1670  Double_t v0py = elobj->PyProng(1);
1671  Double_t v0pz = elobj->PzProng(1);
1672  Double_t epx = elobj->PxProng(0);
1673  Double_t epy = elobj->PyProng(0);
1674  Double_t epz = elobj->PzProng(0);
1675  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
1676  }else{
1677  cont_eleptvscutvars[1] = -9999.;
1678  }
1679 
1680  fHistoElePtvsCutVarsWS[ih]->Fill(cont_eleptvscutvars);
1681  }
1682  }
1683  }
1684 
1685  if(fUseMCInfo){
1686  if(mclc){
1687  Int_t pdgcode = mclc->GetPdgCode();
1688  Double_t cont_mclc[3];
1689  cont_mclc[0] = mclc->Pt();
1690  cont_mclc[1] = mclc->Y();
1691  cont_mclc[2] = fCentrality;
1692  Double_t cont_mcele[3];
1693  cont_mcele[0] = mcele->Pt();
1694  cont_mcele[1] = mcele->Eta();
1695  cont_mcele[2] = fCentrality;
1696 
1697  if(abs(pdgcode)==4122 && abs(mcpdgele_array[1])==4122 && abs(mcpdgv0_array[1])==4122){
1698  cont2[1] = mcele->Pt();
1699  fHistoEleLambdaMassMCS->Fill(cont);
1700  fHistoEleLambdaMassvsElePtMCS->Fill(cont2);
1701  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtMCS1->Fill(cont2);
1702  else fHistoEleLambdaMassvsElePtMCS2->Fill(cont2);
1703  if(cont[0]<2.3){
1704  fHistoElePtMCS->Fill(trk->Pt(),fCentrality);
1705  fHistoElePtvsEtaMCS->Fill(cont_eleptvseta);
1706  fHistoElePtvsLambdaPtMCS->Fill(cont_eleptvslambdapt);
1707  fHistoElePtvsd0MCS->Fill(cont_eleptvsd0);
1708 
1709  fHistoElePtvsV0dlMCS->Fill(cont_eleptvsv0dl);
1710  if(trk->Charge()>0) fHistoElePtvsV0dlMCS1->Fill(cont_eleptvsv0dl);
1711  else fHistoElePtvsV0dlMCS2->Fill(cont_eleptvsv0dl);
1712 
1713  fHistoElePtvsV0dcaMCS->Fill(cont_eleptvsv0dca);
1714  if(trk->Charge()>0) fHistoElePtvsV0dcaMCS1->Fill(cont_eleptvsv0dca);
1715  else fHistoElePtvsV0dcaMCS2->Fill(cont_eleptvsv0dca);
1716 
1717  fHistoEleLambdaPtvsV0dlMCS->Fill(cont_elelamptvsv0dl);
1718  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlMCS1->Fill(cont_elelamptvsv0dl);
1719  else fHistoEleLambdaPtvsV0dlMCS2->Fill(cont_elelamptvsv0dl);
1720 
1721  fHistoLcMCS->Fill(cont_mclc);
1722  if(trk->Charge()>0) fHistoLcMCS1->Fill(cont_mclc);
1723  else fHistoLcMCS2->Fill(cont_mclc);
1724 
1725  fHistoLcElectronMCS->Fill(cont_mcele);
1726  if(trk->Charge()>0) fHistoLcElectronMCS1->Fill(cont_mcele);
1727  else fHistoLcElectronMCS2->Fill(cont_mcele);
1728 
1729  fHistoResponseElePt->Fill(mcele->Pt(),trk->Pt());
1730  fHistoResponseEleLambdaPt->Fill(mclc->Pt(),elobj->Pt());
1731 
1732  Double_t cont_eleptvslambdaptvslcpt[4];
1733  cont_eleptvslambdaptvslcpt[0] = cont_eleptvslambdapt[0];
1734  cont_eleptvslambdaptvslcpt[1] = cont_eleptvslambdapt[1];
1735  cont_eleptvslambdaptvslcpt[2] = mclc->Pt();
1736  cont_eleptvslambdaptvslcpt[3] = cont_eleptvslambdapt[2];
1737  fHistoElePtvsLambdaPtvsLcPtMCS->Fill(cont_eleptvslambdaptvslcpt);
1738 
1739  Double_t cont_allpt[4];
1740  cont_allpt[0] = mclc->Pt();
1741  cont_allpt[1] = elobj->Pt();
1742  cont_allpt[2] = trk->Pt();
1743  cont_allpt[3] = v0->Pt();
1744  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt->Fill(cont_allpt);
1745 
1746  Int_t labmotherlc = mclc->GetMother();
1747  if(labmotherlc>=0){
1748  AliAODMCParticle *motherlc = (AliAODMCParticle*)mcArray->At(labmotherlc);
1749  Int_t pdgmotherlc = motherlc->GetPdgCode();
1750  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){
1751  fHistoElePtvsd0BFeeddownMCS->Fill(cont_eleptvsd0);
1752  }else{
1753  fHistoElePtvsd0PromptMCS->Fill(cont_eleptvsd0);
1754  }
1755  }else{
1756  fHistoElePtvsd0PromptMCS->Fill(cont_eleptvsd0);
1757  }
1758 
1759  for(Int_t ih=0;ih<17;ih++){
1760  Double_t cont_eleptvscutvars[3];
1761  cont_eleptvscutvars[0] = trk->Pt();
1762  cont_eleptvscutvars[2] = fCentrality;
1763 
1764  if(ih==0){
1765  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1766  }else if(ih==1){
1767  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1768  }else if(ih==2){
1769  cont_eleptvscutvars[1] = nSigmaTPCele;
1770  }else if(ih==3){
1771  cont_eleptvscutvars[1] = nSigmaTOFele;
1772  }else if(ih==4){
1773  cont_eleptvscutvars[1] = trk->Eta();
1774  }else if(ih==5){
1775  cont_eleptvscutvars[1] = trk->GetITSNcls();
1776  }else if(ih==6){
1777  if(!anti_lambda_flag)
1778  cont_eleptvscutvars[1] = v0->MassLambda();
1779  else
1780  cont_eleptvscutvars[1] = v0->MassAntiLambda();
1781  }else if(ih==7){
1782  Double_t lPosV0[3];
1783  lPosV0[0] = v0->DecayVertexV0X();
1784  lPosV0[1] = v0->DecayVertexV0Y();
1785  lPosV0[2] = v0->DecayVertexV0Z();
1786  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1787  }else if(ih==8){
1788  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
1789  }else if(ih==9){
1790  if(!anti_lambda_flag)
1791  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1792  else
1793  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1794  }else if(ih==10){
1795  if(!anti_lambda_flag)
1796  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1797  else
1798  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1799  }else if(ih==11){
1800  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
1801  }else if(ih==12){
1802  cont_eleptvscutvars[1] = v0->MassK0Short();
1803  }else if(ih==13){
1804  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1805  }else if(ih==14){
1806  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1807  }else if(ih==15){
1808  cont_eleptvscutvars[1] = v0->Eta();
1809  }else if(ih==16){
1810  Double_t v0px = elobj->PxProng(1);
1811  Double_t v0py = elobj->PyProng(1);
1812  Double_t v0pz = elobj->PzProng(1);
1813  Double_t epx = elobj->PxProng(0);
1814  Double_t epy = elobj->PyProng(0);
1815  Double_t epz = elobj->PzProng(0);
1816  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
1817  }else{
1818  cont_eleptvscutvars[1] = -9999.;
1819  }
1820 
1821  fHistoElePtvsCutVarsMCS[ih]->Fill(cont_eleptvscutvars);
1822  }
1823  }
1824  }
1825  if(abs(pdgcode)==4132 && abs(mcpdgele_array[1])==4132 && abs(mcpdgv0_array[1])==3312){
1828  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtFeeddownXic0MCS1->Fill(cont2);
1830  if(cont[0]<2.3){
1831  fHistoFeedDownXic0MCS->Fill(cont_mclc);
1832  if(trk->Charge()>0) fHistoFeedDownXic0MCS1->Fill(cont_mclc);
1833  else fHistoFeedDownXic0MCS2->Fill(cont_mclc);
1834 
1835  fHistoElectronFeedDownXic0MCS1->Fill(cont_mcele);
1836  if(trk->Charge()>0) fHistoElectronFeedDownXic0MCS1->Fill(cont_mcele);
1837  else fHistoElectronFeedDownXic0MCS2->Fill(cont_mcele);
1838 
1839  fHistoElePtvsV0dlFeedDownXic0MCS->Fill(cont_eleptvsv0dl);
1840  if(trk->Charge()>0) fHistoElePtvsV0dlFeedDownXic0MCS1->Fill(cont_eleptvsv0dl);
1841  else fHistoElePtvsV0dlFeedDownXic0MCS2->Fill(cont_eleptvsv0dl);
1842 
1843  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS->Fill(cont_elelamptvsv0dl);
1844  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1->Fill(cont_elelamptvsv0dl);
1845  else fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2->Fill(cont_elelamptvsv0dl);
1846 
1847  fHistoElePtvsV0dcaFeedDownXic0MCS->Fill(cont_eleptvsv0dca);
1848  if(trk->Charge()>0) fHistoElePtvsV0dcaFeedDownXic0MCS->Fill(cont_eleptvsv0dca);
1849  else fHistoElePtvsV0dcaFeedDownXic0MCS->Fill(cont_eleptvsv0dca);
1850 
1851  fHistoElePtFeeddownXic0MCS->Fill(trk->Pt(),fCentrality);
1852  fHistoElePtvsEtaFeeddownXic0MCS->Fill(cont_eleptvseta);
1853  fHistoElePtvsLambdaPtFeeddownXic0MCS->Fill(cont_eleptvslambdapt);
1854  }
1855  }
1856  if(abs(pdgcode)==4232 && abs(mcpdgele_array[1])==4232 && abs(mcpdgv0_array[1])==3322){
1859  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1->Fill(cont2);
1861  if(cont[0]<2.3){
1862  fHistoFeedDownXic0MCS->Fill(cont_mclc);
1863  if(trk->Charge()>0) fHistoFeedDownXic0MCS1->Fill(cont_mclc);
1864  else fHistoFeedDownXic0MCS2->Fill(cont_mclc);
1865 
1866  fHistoElectronFeedDownXicPlusMCS1->Fill(cont_mcele);
1867  if(trk->Charge()>0) fHistoElectronFeedDownXicPlusMCS1->Fill(cont_mcele);
1868  else fHistoElectronFeedDownXicPlusMCS2->Fill(cont_mcele);
1869 
1870  fHistoElePtvsV0dlFeedDownXicPlusMCS->Fill(cont_eleptvsv0dl);
1871  if(trk->Charge()>0) fHistoElePtvsV0dlFeedDownXicPlusMCS1->Fill(cont_eleptvsv0dl);
1872  else fHistoElePtvsV0dlFeedDownXicPlusMCS2->Fill(cont_eleptvsv0dl);
1873 
1874  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS->Fill(cont_elelamptvsv0dl);
1875  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1->Fill(cont_elelamptvsv0dl);
1876  else fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2->Fill(cont_elelamptvsv0dl);
1877 
1878  fHistoElePtvsV0dcaFeedDownXicPlusMCS->Fill(cont_eleptvsv0dca);
1879  if(trk->Charge()>0) fHistoElePtvsV0dcaFeedDownXicPlusMCS->Fill(cont_eleptvsv0dca);
1880  else fHistoElePtvsV0dcaFeedDownXicPlusMCS->Fill(cont_eleptvsv0dca);
1881 
1882  fHistoElePtFeeddownXicPlusMCS->Fill(trk->Pt(),fCentrality);
1883  fHistoElePtvsEtaFeeddownXicPlusMCS->Fill(cont_eleptvseta);
1884  fHistoElePtvsLambdaPtFeeddownXicPlusMCS->Fill(cont_eleptvslambdapt);
1885  }
1886  }
1887  }
1888  }
1889  }
1890 
1892  {
1893  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
1894  fHistoEleLambdaMassRSSide->Fill(cont);
1895  fHistoEleLambdaMassvsElePtRSSide->Fill(cont2);
1896  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtRSSide1->Fill(cont2);
1897  else fHistoEleLambdaMassvsElePtRSSide2->Fill(cont2);
1898 
1899  fHistoElePtvsV0dlRSSide->Fill(cont_eleptvsv0dl);
1900  if(trk->Charge()>0) fHistoElePtvsV0dlRSSide1->Fill(cont_eleptvsv0dl);
1901  else fHistoElePtvsV0dlRSSide2->Fill(cont_eleptvsv0dl);
1902 
1903  fHistoEleLambdaPtvsV0dlRSSide->Fill(cont_elelamptvsv0dl);
1904  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlRSSide1->Fill(cont_elelamptvsv0dl);
1905  else fHistoEleLambdaPtvsV0dlRSSide2->Fill(cont_elelamptvsv0dl);
1906 
1907  fHistoElePtvsV0dcaRSSide->Fill(cont_eleptvsv0dca);
1908  if(trk->Charge()>0) fHistoElePtvsV0dcaRSSide1->Fill(cont_eleptvsv0dca);
1909  else fHistoElePtvsV0dcaRSSide2->Fill(cont_eleptvsv0dca);
1910 
1911  }else if((trk->Charge()<0 && !anti_lambda_flag) || (trk->Charge()>0 && anti_lambda_flag)){
1912  fHistoEleLambdaMassWSSide->Fill(cont);
1913  fHistoEleLambdaMassvsElePtWSSide->Fill(cont2);
1914  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtWSSide1->Fill(cont2);
1915  else fHistoEleLambdaMassvsElePtWSSide2->Fill(cont2);
1916 
1917  fHistoElePtvsV0dlWSSide->Fill(cont_eleptvsv0dl);
1918  if(trk->Charge()>0) fHistoElePtvsV0dlWSSide1->Fill(cont_eleptvsv0dl);
1919  else fHistoElePtvsV0dlWSSide2->Fill(cont_eleptvsv0dl);
1920 
1921  fHistoEleLambdaPtvsV0dlWSSide->Fill(cont_elelamptvsv0dl);
1922  if(trk->Charge()>0) fHistoEleLambdaPtvsV0dlWSSide1->Fill(cont_elelamptvsv0dl);
1923  else fHistoEleLambdaPtvsV0dlWSSide2->Fill(cont_elelamptvsv0dl);
1924 
1925  fHistoElePtvsV0dcaWSSide->Fill(cont_eleptvsv0dca);
1926  if(trk->Charge()>0) fHistoElePtvsV0dcaWSSide1->Fill(cont_eleptvsv0dca);
1927  else fHistoElePtvsV0dcaWSSide2->Fill(cont_eleptvsv0dca);
1928  }
1929  }
1930 
1931  return;
1932 }
1933 
1935 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMixROOTObjects(TLorentzVector *trke, TLorentzVector *v0, Double_t *v0info, Int_t chargepr)
1936 {
1940  if(!trke) return;
1941  if(!v0) return;
1942 
1943  for(Int_t i=0;i<73;i++){
1944  fCandidateVariables[i] = -9999.;
1945  }
1946 
1947 
1948  Double_t pxe = trke->Px();
1949  Double_t pye = trke->Py();
1950  Double_t pze = trke->Pz();
1951  Double_t mome = sqrt(pxe*pxe+pye*pye+pze*pze);
1952  Double_t Ee = sqrt(mome*mome+0.000510998928*0.000510998928);
1953 
1954  Double_t pxv = v0->Px();
1955  Double_t pyv = v0->Py();
1956  Double_t pzv = v0->Pz();
1957  Double_t momv = sqrt(pxv*pxv+pyv*pyv+pzv*pzv);
1958  Double_t Ev = sqrt(momv*momv+1.115683*1.115683);
1959 
1960  Double_t cosoa = (pxe*pxv+pye*pyv+pze*pzv)/mome/momv;
1961 
1962  Double_t pxsum = pxe + pxv;
1963  Double_t pysum = pye + pyv;
1964  Double_t pzsum = pze + pzv;
1965  Double_t Esum = Ee + Ev;
1966 
1967  Double_t mel = sqrt(Esum*Esum-pxsum*pxsum-pysum*pysum-pzsum*pzsum);
1968 
1970  UInt_t pdgdg[2]={11,3122};
1971  fCandidateVariables[ 1] = mel;
1972  fCandidateVariables[ 2] = sqrt(pxsum*pxsum+pysum*pysum);
1973  fCandidateVariables[ 3] = pxsum;
1974  fCandidateVariables[ 4] = pysum;
1975  fCandidateVariables[ 5] = pzsum;
1976  fCandidateVariables[ 6] = pxe;
1977  fCandidateVariables[ 7] = pye;
1978  fCandidateVariables[ 8] = pze;
1979  fCandidateVariables[ 9] = pxv;
1980  fCandidateVariables[10] = pyv;
1981  fCandidateVariables[11] = pzv;
1982  if(chargepr>0){
1983  fCandidateVariables[12] = 0;
1984  fCandidateVariables[13] = v0->M();
1985  fCandidateVariables[14] = 0.;
1986  }else{
1987  fCandidateVariables[12] = 1;
1988  fCandidateVariables[13] = 0;
1989  fCandidateVariables[14] = v0->M();
1990  }
1991 
1992  fCandidateVariables[21] = trke->T();
1993 
1994  fCandidateVariables[32] = 1;
1995 
1996  fCandidateVariables[54] = fVtx1->GetX();
1997  fCandidateVariables[55] = fVtx1->GetY();
1998  fCandidateVariables[56] = fVtx1->GetZ();
1999  fCandidateVariables[64] = v0info[0];
2000 
2003 
2004 
2005  if(fWriteVariableTree)
2006  fVariablesTree->Fill();
2007 
2008  if(cosoa>0. && fAnalCuts->IsPeakRegion(v0))
2009  {
2010  Double_t cont[3];
2011  cont[0] = mel;
2012  cont[1] = sqrt(pxsum*pxsum+pysum*pysum);
2013  cont[2] = fCentrality;
2014  fHistoEleLambdaMass->Fill(cont);
2015  Double_t cont2[3];
2016  cont2[0] = mel;
2017  cont2[1] = sqrt(pxe*pxe+pye*pye);
2018  cont2[2] = fCentrality;
2019  Double_t cont_eleptvseta[3];
2020  cont_eleptvseta[0] = trke->Pt();
2021  cont_eleptvseta[1] = trke->Eta();
2022  cont_eleptvseta[2] = fCentrality;
2023 
2024  Double_t cont_eleptvslambdapt[3];
2025  cont_eleptvslambdapt[0] = trke->Pt();
2026  cont_eleptvslambdapt[1] = v0->Pt();
2027  cont_eleptvslambdapt[2] = fCentrality;
2028 
2029  Double_t cont_eleptvsd0[3];
2030  cont_eleptvsd0[0] = trke->Pt();
2031  cont_eleptvsd0[1] = 0.;
2032  cont_eleptvsd0[2] = fCentrality;
2033 
2034  Double_t cont_eleptvsv0dl[3];
2035  cont_eleptvsv0dl[0] = trke->Pt();
2036  cont_eleptvsv0dl[1] = v0info[0];
2037  cont_eleptvsv0dl[2] = fCentrality;
2038 
2039  Double_t cont_eleptvsv0dca[3];
2040  cont_eleptvsv0dca[0] = trke->Pt();
2041  cont_eleptvsv0dca[1] = v0info[1];
2042  cont_eleptvsv0dca[2] = fCentrality;
2043 
2044  Double_t cont_elelamptvsv0dl[3];
2045  cont_elelamptvsv0dl[0] = sqrt(pxsum*pxsum+pysum*pysum);
2046  cont_elelamptvsv0dl[1] = v0info[0];
2047  cont_elelamptvsv0dl[2] = fCentrality;
2048 
2049 
2050  if(((int)trke->T())*chargepr>0){
2051  fHistoEleLambdaMassRSMix->Fill(cont);
2052  fHistoEleLambdaMassvsElePtRSMix->Fill(cont2);
2053  if(trke->T()>0) fHistoEleLambdaMassvsElePtRSMix1->Fill(cont2);
2054  else fHistoEleLambdaMassvsElePtRSMix2->Fill(cont2);
2055  if(cont[0]<2.3){
2056  fHistoElePtRSMix->Fill(trke->Pt(),fCentrality);
2057  fHistoElePtvsEtaRSMix->Fill(cont_eleptvseta);
2058  fHistoElePtvsLambdaPtRSMix->Fill(cont_eleptvslambdapt);
2059  fHistoElePtvsd0RSMix->Fill(cont_eleptvsd0);
2060 
2061  fHistoElePtvsV0dlRSMix->Fill(cont_eleptvsv0dl);
2062  if(trke->T()>0) fHistoElePtvsV0dlRSMix1->Fill(cont_eleptvsv0dl);
2063  else fHistoElePtvsV0dlRSMix2->Fill(cont_eleptvsv0dl);
2064 
2065  fHistoEleLambdaPtvsV0dlRSMix->Fill(cont_elelamptvsv0dl);
2066  if(trke->T()>0) fHistoEleLambdaPtvsV0dlRSMix1->Fill(cont_elelamptvsv0dl);
2067  else fHistoEleLambdaPtvsV0dlRSMix2->Fill(cont_elelamptvsv0dl);
2068 
2069  fHistoElePtvsV0dcaRSMix->Fill(cont_eleptvsv0dca);
2070  if(trke->T()>0) fHistoElePtvsV0dcaRSMix1->Fill(cont_eleptvsv0dca);
2071  else fHistoElePtvsV0dcaRSMix2->Fill(cont_eleptvsv0dca);
2072  }
2073  }else{
2074  fHistoEleLambdaMassWSMix->Fill(cont);
2075  fHistoEleLambdaMassvsElePtWSMix->Fill(cont2);
2076  if(trke->T()>0) fHistoEleLambdaMassvsElePtWSMix1->Fill(cont2);
2077  else fHistoEleLambdaMassvsElePtWSMix2->Fill(cont2);
2078  if(cont[0]<2.3){
2079  fHistoElePtWSMix->Fill(trke->Pt(),fCentrality);
2080  fHistoElePtvsEtaWSMix->Fill(cont_eleptvseta);
2081  fHistoElePtvsLambdaPtWSMix->Fill(cont_eleptvslambdapt);
2082  fHistoElePtvsd0WSMix->Fill(cont_eleptvsd0);
2083 
2084  fHistoElePtvsV0dlWSMix->Fill(cont_eleptvsv0dl);
2085  if(trke->T()>0) fHistoElePtvsV0dlWSMix1->Fill(cont_eleptvsv0dl);
2086  else fHistoElePtvsV0dlWSMix2->Fill(cont_eleptvsv0dl);
2087 
2088  fHistoEleLambdaPtvsV0dlWSMix->Fill(cont_elelamptvsv0dl);
2089  if(trke->T()>0) fHistoEleLambdaPtvsV0dlWSMix1->Fill(cont_elelamptvsv0dl);
2090  else fHistoEleLambdaPtvsV0dlWSMix2->Fill(cont_elelamptvsv0dl);
2091 
2092  fHistoElePtvsV0dcaWSMix->Fill(cont_eleptvsv0dca);
2093  if(trke->T()>0) fHistoElePtvsV0dcaWSMix1->Fill(cont_eleptvsv0dca);
2094  else fHistoElePtvsV0dcaWSMix2->Fill(cont_eleptvsv0dca);
2095  }
2096  }
2097  }
2098 
2099  return;
2100 }
2103 {
2104  //
2106  //
2107 
2108  const char* nameoutput = GetOutputSlot(5)->GetContainer()->GetName();
2109  fEleVariablesTree = new TTree(nameoutput,"electron variables tree");
2110  Int_t nVar = 26;
2111  fCandidateEleVariables = new Float_t [nVar];
2112  TString * fCandidateVariableNames = new TString[nVar];
2113 
2114  fCandidateVariableNames[ 0]="ElePx";
2115  fCandidateVariableNames[ 1]="ElePy";
2116  fCandidateVariableNames[ 2]="ElePz";
2117  fCandidateVariableNames[ 3]="TPCChi2overNDF";
2118  fCandidateVariableNames[ 4]="ITSNcls";
2119  fCandidateVariableNames[ 5]="TPCNcls";
2120  fCandidateVariableNames[ 6]="TPCNclsPID";
2121  fCandidateVariableNames[ 7]="TPCNclsRatio";
2122  fCandidateVariableNames[ 8]="d0R";
2123  fCandidateVariableNames[ 9]="d0Z";
2124  fCandidateVariableNames[10]="ITSClusterMap";
2125  fCandidateVariableNames[11]="nSigmaTPCele";
2126  fCandidateVariableNames[12]="nSigmaTOFele";
2127  fCandidateVariableNames[13]="nSigmaTPCpi";
2128  fCandidateVariableNames[14]="nSigmaTPCka";
2129  fCandidateVariableNames[15]="nSigmaTPCpr";
2130  fCandidateVariableNames[16]="EvNumber";
2131  fCandidateVariableNames[17]="EleCharge";
2132  fCandidateVariableNames[18]="ElePdgCode";
2133  fCandidateVariableNames[19]="EleMotherPdgCode";
2134  fCandidateVariableNames[20]="mcelepx";
2135  fCandidateVariableNames[21]="mcelepy";
2136  fCandidateVariableNames[22]="mcelepz";
2137  fCandidateVariableNames[23]="Centrality";
2138  fCandidateVariableNames[24]="PrimVertZ";
2139  fCandidateVariableNames[25]="RunNumber";
2140 
2141  for (Int_t ivar=0; ivar<nVar; ivar++) {
2142  fEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2143  }
2144 
2145  return;
2146 }
2148 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillElectronROOTObjects(AliAODTrack *trk, TClonesArray *mcArray)
2149 {
2150  //
2152  //
2153 
2154  if(!trk) return;
2155 
2156  fHistoBachPt->Fill(trk->Pt());
2157  fHistoElectronQovPtvsPhi->Fill(trk->Phi(),(Double_t)trk->Charge()/trk->Pt());
2158 
2159  if(fDoEventMixing){
2160  fElectronTracks->AddLast(new TLorentzVector(trk->Px(),trk->Py(),trk->Pz(),trk->Charge()));
2161  }
2162 
2163  if(!fWriteEachVariableTree) return;
2164 
2165  Int_t pdgEle = -9999;
2166  Int_t pdgEleMother = -9999;
2167  Float_t mcelepx = -9999;
2168  Float_t mcelepy = -9999;
2169  Float_t mcelepz = -9999;
2170  if(fUseMCInfo)
2171  {
2172  Int_t labEle = trk->GetLabel();
2173  if(labEle<0) return;
2174  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
2175  if(!mcetrk) return;
2176  pdgEle = mcetrk->GetPdgCode();
2177  if(abs(pdgEle)!=11) return;
2178 
2179  fHistoBachPtMCS->Fill(trk->Pt());
2180 
2181  Bool_t hfe_flag = kFALSE;
2182  Int_t labemother = mcetrk->GetMother();
2183  if(labemother>=0){
2184  AliAODMCParticle *motherele = (AliAODMCParticle*)mcArray->At(labemother);
2185  pdgEleMother = motherele->GetPdgCode();
2186  if(abs(pdgEleMother)>4000&&abs(pdgEleMother)<4400){
2187  hfe_flag = kTRUE;
2188  }
2189  }
2190  if(!hfe_flag) return;
2191  mcelepx = mcetrk->Px();
2192  mcelepy = mcetrk->Py();
2193  mcelepz = mcetrk->Pz();
2194  }
2195 
2196  for(Int_t i=0;i<26;i++){
2197  fCandidateEleVariables[i] = -9999.;
2198  }
2199 
2200  fCandidateEleVariables[ 0] = trk->Px();
2201  fCandidateEleVariables[ 1] = trk->Py();
2202  fCandidateEleVariables[ 2] = trk->Pz();
2203  fCandidateEleVariables[ 3] = trk->Chi2perNDF();
2204  fCandidateEleVariables[ 4] = trk->GetITSNcls();
2205  fCandidateEleVariables[ 5] = trk->GetTPCncls();
2206  fCandidateEleVariables[ 6] = trk->GetTPCsignalN();
2207  if(trk->GetTPCNclsF()>0)
2208  fCandidateEleVariables[ 7] = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
2209 
2210  Double_t d0z0[2],covd0z0[3];
2211  trk->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);
2212 
2213  fCandidateEleVariables[ 8] = d0z0[0];
2214  fCandidateEleVariables[ 9] = d0z0[1];
2215  Int_t itsmap = trk->GetITSClusterMap();
2216  Int_t bit1 = 1;
2217  Int_t bit2 = 2;
2218  Bool_t spdfirst = (itsmap & bit1) == bit1;
2219  Bool_t spdsecond = (itsmap & bit2) == bit2;
2220  fCandidateEleVariables[10] = ((Int_t)spdfirst) + 2 * ((Int_t)spdsecond);
2221 
2222  if(fAnalCuts->GetIsUsePID())
2223  {
2224  Double_t nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
2225  Double_t nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
2226  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
2227  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
2228  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
2229  fCandidateEleVariables[11] = nSigmaTPCele;
2230  fCandidateEleVariables[12] = nSigmaTOFele;
2231  fCandidateEleVariables[13] = nSigmaTPCpi_etrk;
2232  fCandidateEleVariables[14] = nSigmaTPCka_etrk;
2233  fCandidateEleVariables[15] = nSigmaTPCpr_etrk;
2234  }
2236  fCandidateEleVariables[17] = trk->Charge();
2237  fCandidateEleVariables[18] = pdgEle;
2238  fCandidateEleVariables[19] = pdgEleMother;
2239  fCandidateEleVariables[20] = mcelepx;
2240  fCandidateEleVariables[21] = mcelepy;
2241  fCandidateEleVariables[22] = mcelepz;
2245 
2246  fHistod0Bach->Fill(d0z0[0]);
2247 
2248  fEleVariablesTree->Fill();
2249 }
2252 {
2253  //
2255  //
2256 
2257  const char* nameoutput = GetOutputSlot(6)->GetContainer()->GetName();
2258  fV0VariablesTree = new TTree(nameoutput,"v0 variables tree");
2259  Int_t nVar = 33;
2260  fCandidateV0Variables = new Float_t [nVar];
2261  TString * fCandidateVariableNames = new TString[nVar];
2262 
2263  fCandidateVariableNames[ 0]="V0Px";
2264  fCandidateVariableNames[ 1]="V0Py";
2265  fCandidateVariableNames[ 2]="V0Pz";
2266  fCandidateVariableNames[ 3]="MassLambda";
2267  fCandidateVariableNames[ 4]="MassAntiLambda";
2268  fCandidateVariableNames[ 5]="ProtonPx";
2269  fCandidateVariableNames[ 6]="ProtonPy";
2270  fCandidateVariableNames[ 7]="ProtonPz";
2271  fCandidateVariableNames[ 8]="PionPx";
2272  fCandidateVariableNames[ 9]="PionPy";
2273  fCandidateVariableNames[10]="PionPz";
2274  fCandidateVariableNames[11]="RfidV0";
2275  fCandidateVariableNames[12]="DcaV0PrToPrimVertex";
2276  fCandidateVariableNames[13]="DcaV0PiToPrimVertex";
2277  fCandidateVariableNames[14]="DcaV0daughters";
2278  fCandidateVariableNames[15]="V0CosPointingAngle";
2279  fCandidateVariableNames[16]="V0ProperDecayLength";
2280  fCandidateVariableNames[17]="MassK0Short";
2281  fCandidateVariableNames[18]="nSigmaTPCpr";
2282  fCandidateVariableNames[19]="nSigmaTPCpi";
2283  fCandidateVariableNames[20]="TPCNCrossV0Pr";
2284  fCandidateVariableNames[21]="TPCNCrossV0Pi";
2285  fCandidateVariableNames[22]="TPCNCrossRatioV0Pr";
2286  fCandidateVariableNames[23]="TPCNCrossRatioV0Pi";
2287  fCandidateVariableNames[24]="V0PdgCode";
2288  fCandidateVariableNames[25]="V0MotherPdgCode";
2289  fCandidateVariableNames[26]="mcv0px";
2290  fCandidateVariableNames[27]="mcv0py";
2291  fCandidateVariableNames[28]="mcv0pz";
2292  fCandidateVariableNames[29]="EvNumber";
2293  fCandidateVariableNames[30]="Centrality";
2294  fCandidateVariableNames[31]="PrimVertZ";
2295  fCandidateVariableNames[32]="RunNumber";
2296 
2297  for (Int_t ivar=0; ivar<nVar; ivar++) {
2298  fV0VariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateV0Variables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2299  }
2300 
2301  return;
2302 }
2303 
2305 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillV0ROOTObjects(AliAODv0 *v0, TClonesArray *mcArray)
2306 {
2307  //
2309  //
2310  if(!v0) return;
2311 
2312  Double_t mlamPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
2313  Double_t posVtx[3] = {0.,0.,0.};
2314  fVtx1->GetXYZ(posVtx);
2315  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
2316  Double_t v0propdl = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
2317 
2318  if(TMath::Abs(v0->MassLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
2319  fHistoLambdaMassvsPt->Fill(v0->MassLambda(),v0->Pt());
2320  }
2321  if(TMath::Abs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
2322  fHistoLambdaMassvsPt->Fill(v0->MassAntiLambda(),v0->Pt());
2323  }
2324  fHistoK0sMassvsPt->Fill(v0->MassK0Short(),v0->Pt());
2325 
2326  if(fAnalCuts->IsPeakRegion(v0)){
2327  fHistoLambdaPtvsDl->Fill(v0->Pt(),v0propdl);
2328  }
2329  if(fAnalCuts->IsSideBand(v0)){
2330  fHistoLambdaPtvsDlSide->Fill(v0->Pt(),v0propdl);
2331  }
2332 
2333  Double_t momv0x = v0->MomV0X();
2334  Double_t momv0y = v0->MomV0Y();
2335  Double_t phi_alice = atan2(momv0y,momv0x);
2336  if(phi_alice<0.) phi_alice += 2 * M_PI;
2337  fHistoLambdaQovPtvsPhi->Fill(phi_alice,1./sqrt(momv0x*momv0x+momv0y*momv0y));
2338 
2339  Int_t v0pdgcode = -9999;
2340  Int_t v0motherpdgcode = -9999;
2341  Float_t mcv0px = -9999;
2342  Float_t mcv0py = -9999;
2343  Float_t mcv0pz = -9999;
2344  if(fUseMCInfo)
2345  {
2346  Int_t pdgdgv0[2]={2212,211};
2347  Int_t labV0 = v0->MatchToMC(3122,mcArray,2,pdgdgv0); // the V0
2348  if(labV0>=0){
2349  if(TMath::Abs(v0->MassLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
2350  fHistoLambdaMassvsPtMCS->Fill(v0->MassLambda(),v0->Pt());
2351  }
2352  if(TMath::Abs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
2353  fHistoLambdaMassvsPtMCS->Fill(v0->MassAntiLambda(),v0->Pt());
2354  }
2355  }
2356  if(labV0<0) return;
2357  AliAODMCParticle *mcv0trk = (AliAODMCParticle*)mcArray->At(labV0);
2358  if(!mcv0trk) return;
2359 
2360  Bool_t hfv0_flag = kFALSE;
2361  v0pdgcode = mcv0trk->GetPdgCode();
2362  Int_t labv0mother = mcv0trk->GetMother();
2363  if(labv0mother>=0){
2364  AliAODMCParticle *motherv0 = (AliAODMCParticle*)mcArray->At(labv0mother);
2365  if(motherv0){
2366  v0motherpdgcode = motherv0->GetPdgCode();
2367  if(abs(v0motherpdgcode)>4000&&abs(v0motherpdgcode)<4400){
2368  hfv0_flag = kTRUE;
2369  }
2370  if(abs(v0motherpdgcode)==3322){
2371  fHistoLambdaPtvsDlFeeddownXi0MCS->Fill(v0->Pt(),v0propdl);
2372  }else if(abs(v0motherpdgcode)==3312){
2373  fHistoLambdaPtvsDlFeeddownXiMinusMCS->Fill(v0->Pt(),v0propdl);
2374  }else if(abs(v0motherpdgcode)==3334){
2375  fHistoLambdaPtvsDlFeeddownOmegaMCS->Fill(v0->Pt(),v0propdl);
2376  }else{
2377  fHistoLambdaPtvsDlMCS->Fill(v0->Pt(),v0propdl);
2378  }
2379  }
2380  }
2381  if(!hfv0_flag) return;
2382  mcv0px = mcv0trk->Px();
2383  mcv0py = mcv0trk->Py();
2384  mcv0pz = mcv0trk->Pz();
2385  }
2386 
2387  if(fDoEventMixing){
2388  Double_t posVtx[3] = {0.,0.,0.};
2389  fVtx1->GetXYZ(posVtx);
2390  TLorentzVector *lv = new TLorentzVector();
2391  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
2392  if(TMath::Abs(v0->MassLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()){
2393  lv->SetXYZM(v0->Px(),v0->Py(),v0->Pz(),v0->MassLambda());
2394  fV0Tracks1->AddLast(lv);
2395  fV0dlArray1.push_back(v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam);
2396  fV0dcaArray1.push_back(v0->DcaV0ToPrimVertex());
2397  }else{
2398  lv->SetXYZM(v0->Px(),v0->Py(),v0->Pz(),v0->MassAntiLambda());
2399  fV0Tracks2->AddLast(lv);
2400  fV0dlArray2.push_back(v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam);
2401  fV0dcaArray2.push_back(v0->DcaV0ToPrimVertex());
2402  }
2403  }
2404 
2405 
2406  if(!fWriteEachVariableTree) return;
2407 
2408  for(Int_t i=0;i<32;i++){
2409  fCandidateV0Variables[i] = -9999.;
2410  }
2411 
2412  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
2413  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
2414  if(!cptrack) return;
2415  if(!cntrack) return;
2416  if(cptrack->Charge()<0 && cntrack->Charge()>0){
2417  cptrack = (AliAODTrack*)(v0->GetDaughter(1));
2418  cntrack = (AliAODTrack*)(v0->GetDaughter(0));
2419  }
2420 
2421  fCandidateV0Variables[ 0] = v0->Px();
2422  fCandidateV0Variables[ 1] = v0->Py();
2423  fCandidateV0Variables[ 2] = v0->Pz();
2424  fCandidateV0Variables[ 3] = v0->MassLambda();
2425  fCandidateV0Variables[ 4] = v0->MassAntiLambda();
2426 
2427  Bool_t isparticle = kTRUE;
2428  if(fabs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()) isparticle=kFALSE;
2429 
2430  if(isparticle){
2431  fCandidateV0Variables[ 5] = cptrack->Px();
2432  fCandidateV0Variables[ 6] = cptrack->Py();
2433  fCandidateV0Variables[ 7] = cptrack->Pz();
2434  fCandidateV0Variables[ 8] = cntrack->Px();
2435  fCandidateV0Variables[ 9] = cntrack->Py();
2436  fCandidateV0Variables[10] = cntrack->Pz();
2437  }else{
2438  fCandidateV0Variables[ 5] = cntrack->Px();
2439  fCandidateV0Variables[ 6] = cntrack->Py();
2440  fCandidateV0Variables[ 7] = cntrack->Pz();
2441  fCandidateV0Variables[ 8] = cptrack->Px();
2442  fCandidateV0Variables[ 9] = cptrack->Py();
2443  fCandidateV0Variables[10] = cptrack->Pz();
2444  }
2445 
2446  Double_t lPosV0[3];
2447  lPosV0[0] = v0->DecayVertexV0X();
2448  lPosV0[1] = v0->DecayVertexV0Y();
2449  lPosV0[2] = v0->DecayVertexV0Z();
2450  Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
2451  fCandidateV0Variables[11] = decayvertV0;
2452 
2453  Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
2454  Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
2455  if(isparticle){
2456  fCandidateV0Variables[12] = lDcaPosToPrimVertex;
2457  fCandidateV0Variables[13] = lDcaNegToPrimVertex;
2458  }else{
2459  fCandidateV0Variables[12] = lDcaNegToPrimVertex;
2460  fCandidateV0Variables[13] = lDcaPosToPrimVertex;
2461  }
2462  fCandidateV0Variables[14] = v0->DcaV0Daughters();
2463  fCandidateV0Variables[15] = v0->CosPointingAngle(posVtx);
2464  fCandidateV0Variables[16] = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
2465  fCandidateV0Variables[17] = v0->MassK0Short();
2466 
2467  if(fAnalCuts->GetUseLambdaPID())
2468  {
2469  if(isparticle){
2470  Double_t nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
2471  Double_t nSigmaTPCv0pi = fAnalCuts->GetPidPion()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
2472  fCandidateV0Variables[18] = nSigmaTPCv0pr;
2473  fCandidateV0Variables[19] = nSigmaTPCv0pi;
2474  }else{
2475  Double_t nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
2476  Double_t nSigmaTPCv0pi = fAnalCuts->GetPidPion()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
2477  fCandidateV0Variables[18] = nSigmaTPCv0pr;
2478  fCandidateV0Variables[19] = nSigmaTPCv0pi;
2479  }
2480  }
2481  if(isparticle){
2482  fCandidateV0Variables[20] = cptrack->GetTPCClusterInfo(2,1);
2483  fCandidateV0Variables[21] = cntrack->GetTPCClusterInfo(2,1);
2484  if(cptrack->GetTPCNclsF()>0)
2485  fCandidateV0Variables[22] = (Float_t) cptrack->GetTPCClusterInfo(2,1)/(Float_t)cptrack->GetTPCNclsF();
2486  if(cntrack->GetTPCNclsF()>0)
2487  fCandidateV0Variables[23] =(Float_t) cntrack->GetTPCClusterInfo(2,1)/(Float_t)cntrack->GetTPCNclsF();
2488  }else{
2489  fCandidateV0Variables[20] = cntrack->GetTPCClusterInfo(2,1);
2490  fCandidateV0Variables[21] = cptrack->GetTPCClusterInfo(2,1);
2491  if(cntrack->GetTPCNclsF()>0)
2492  fCandidateV0Variables[22] = (Float_t) cntrack->GetTPCClusterInfo(2,1)/(Float_t)cntrack->GetTPCNclsF();
2493  if(cptrack->GetTPCNclsF()>0)
2494  fCandidateV0Variables[23] = (Float_t) cptrack->GetTPCClusterInfo(2,1)/(Float_t)cptrack->GetTPCNclsF();
2495  }
2496  fCandidateV0Variables[24] = v0pdgcode;
2497  fCandidateV0Variables[25] = v0motherpdgcode;
2498  fCandidateV0Variables[26] = mcv0px;
2499  fCandidateV0Variables[27] = mcv0py;
2500  fCandidateV0Variables[28] = mcv0pz;
2505 
2506 
2507  fV0VariablesTree->Fill();
2508 }
2511 {
2515 
2516  const char* nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
2517  fMCVariablesTree = new TTree(nameoutput,"MC variables tree");
2518  Int_t nVar = 11;
2519  fCandidateMCVariables = new Float_t [nVar];
2520  TString * fCandidateVariableNames = new TString[nVar];
2521 
2522  fCandidateVariableNames[ 0]="Centrality";
2523  fCandidateVariableNames[ 1]="DecayType";
2524  fCandidateVariableNames[ 2]="LcPx";
2525  fCandidateVariableNames[ 3]="LcPy";
2526  fCandidateVariableNames[ 4]="LcPz";
2527  fCandidateVariableNames[ 5]="ElePx";
2528  fCandidateVariableNames[ 6]="ElePy";
2529  fCandidateVariableNames[ 7]="ElePz";
2530  fCandidateVariableNames[ 8]="V0Px";
2531  fCandidateVariableNames[ 9]="V0Py";
2532  fCandidateVariableNames[10]="V0Pz";
2533 
2534  for (Int_t ivar=0; ivar<nVar; ivar++) {
2535  fMCVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2536  }
2537  return;
2538 }
2540 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCROOTObjects(AliAODMCParticle *mcpart, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype)
2541 {
2542  //
2544  //
2545  if(!mcpart) return;
2546  if(!mcepart) return;
2547  if(!mcv0part) return;
2548 
2549  for(Int_t i=0;i<11;i++){
2550  fCandidateMCVariables[i] = -9999.;
2551  }
2552 
2554  fCandidateMCVariables[ 1] = (Float_t) decaytype;
2555  fCandidateMCVariables[ 2] = mcpart->Px();
2556  fCandidateMCVariables[ 3] = mcpart->Py();
2557  fCandidateMCVariables[ 4] = mcpart->Pz();
2558  fCandidateMCVariables[ 5] = mcepart->Px();
2559  fCandidateMCVariables[ 6] = mcepart->Py();
2560  fCandidateMCVariables[ 7] = mcepart->Pz();
2561  fCandidateMCVariables[ 8] = mcv0part->Px();
2562  fCandidateMCVariables[ 9] = mcv0part->Py();
2563  fCandidateMCVariables[10] = mcv0part->Pz();
2564 
2565  Double_t epx = mcepart->Px();
2566  Double_t epy = mcepart->Py();
2567  Double_t epz = mcepart->Pz();
2568  Double_t eE = sqrt(epx*epx+epy*epy+epz*epz+0.000511*0.000511);
2569  Double_t v0px = mcv0part->Px();
2570  Double_t v0py = mcv0part->Py();
2571  Double_t v0pz = mcv0part->Pz();
2572  Double_t v0E = sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz+1.1157*1.1157);
2573 
2574  Double_t InvMassEleLambda = sqrt(pow(eE+v0E,2)-pow(epx+v0px,2)-pow(epy+v0py,2)-pow(epz+v0pz,2));
2575 
2576  Double_t cont[3];
2577  cont[0] = InvMassEleLambda;
2578  cont[1] = mcpart->Pt();
2579  cont[2] = fCentrality;
2580  Double_t cont2[3];
2581  cont2[0] = InvMassEleLambda;
2582  cont2[1] = mcepart->Pt();
2583  cont2[2] = fCentrality;
2584  Double_t cont_eleptvseta[3];
2585  cont_eleptvseta[0] = mcepart->Pt();
2586  cont_eleptvseta[1] = mcepart->Eta();
2587  cont_eleptvseta[2] = fCentrality;
2588  Double_t cont_eleptvslambdapt[3];
2589  cont_eleptvslambdapt[0] = mcepart->Pt();
2590  cont_eleptvslambdapt[1] = mcv0part->Pt();
2591  cont_eleptvslambdapt[2] = fCentrality;
2592  Double_t cont_eleptvslambdaptvslcpt[4];
2593  cont_eleptvslambdaptvslcpt[0] = mcepart->Pt();
2594  cont_eleptvslambdaptvslcpt[1] = mcv0part->Pt();
2595  cont_eleptvslambdaptvslcpt[2] = mcpart->Pt();
2596  cont_eleptvslambdaptvslcpt[3] = fCentrality;
2597  Double_t contmc[3];
2598  contmc[0] = mcpart->Pt();
2599  contmc[1] = mcpart->Y();
2600  contmc[2] = fCentrality;
2601  Double_t contmcele[3];
2602  contmcele[0] = mcepart->Pt();
2603  contmcele[1] = mcepart->Eta();
2604  contmcele[2] = fCentrality;
2605 
2606  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
2607  Float_t etamin, etamax;
2608  esdcuts->GetEtaRange(etamin,etamax);
2609 
2610  if(decaytype==0){
2611  fHistoLcMCGen->Fill(contmc);
2612  if(mcpart->GetPdgCode()>0) fHistoLcMCGen1->Fill(contmc);
2613  if(mcpart->GetPdgCode()<0) fHistoLcMCGen2->Fill(contmc);
2614  fHistoLcElectronMCGen->Fill(contmcele);
2615  if(mcepart->GetPdgCode()<0) fHistoLcElectronMCGen1->Fill(contmcele);
2616  if(mcepart->GetPdgCode()>0) fHistoLcElectronMCGen2->Fill(contmcele);
2617  fHistoEleLambdaMassMCGen->Fill(cont);
2618  if(fabs(mcepart->Eta())<etamax){
2619  fHistoEleLambdaMassvsElePtMCGen->Fill(cont2);
2620  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtMCGen1->Fill(cont2);
2621  else fHistoEleLambdaMassvsElePtMCGen2->Fill(cont2);
2622  if(InvMassEleLambda<2.3){
2623  fHistoElePtMCGen->Fill(mcepart->Pt(),fCentrality);
2624  fHistoElePtvsEtaMCGen->Fill(cont_eleptvseta);
2625  fHistoElePtvsLambdaPtMCGen->Fill(cont_eleptvslambdapt);
2626  }
2627  }
2628  if(fabs(mcpart->Y())<0.7){
2629  if(InvMassEleLambda<2.3){
2630  fHistoElePtvsLambdaPtMCLcGen->Fill(cont_eleptvslambdapt);
2631  fHistoElePtvsLambdaPtvsLcPtMCGen->Fill(cont_eleptvslambdaptvslcpt);
2632  }
2633  }
2634  }else if(decaytype==1){
2635  fHistoFeedDownXic0MCGen->Fill(contmc);
2636  if(mcpart->GetPdgCode()>0) fHistoFeedDownXic0MCGen1->Fill(contmc);
2637  if(mcpart->GetPdgCode()<0) fHistoFeedDownXic0MCGen2->Fill(contmc);
2639  fHistoElectronFeedDownXic0MCGen->Fill(contmcele);
2640  if(mcepart->GetPdgCode()<0) fHistoElectronFeedDownXic0MCGen1->Fill(contmcele);
2641  if(mcepart->GetPdgCode()>0) fHistoElectronFeedDownXic0MCGen2->Fill(contmcele);
2642  if(fabs(mcepart->Eta())<etamax){
2644  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1->Fill(cont2);
2646  if(InvMassEleLambda<2.3){
2647  fHistoElePtFeeddownXic0MCGen->Fill(mcepart->Pt(),fCentrality);
2648  fHistoElePtvsEtaFeeddownXic0MCGen->Fill(cont_eleptvseta);
2649  fHistoElePtvsLambdaPtFeeddownXic0MCGen->Fill(cont_eleptvslambdapt);
2650  }
2651  }
2652  }else if(decaytype==2){
2653  fHistoFeedDownXicPlusMCGen->Fill(contmc);
2654  if(mcpart->GetPdgCode()>0) fHistoFeedDownXicPlusMCGen1->Fill(contmc);
2655  if(mcpart->GetPdgCode()<0) fHistoFeedDownXicPlusMCGen2->Fill(contmc);
2657  fHistoElectronFeedDownXicPlusMCGen->Fill(contmcele);
2658  if(mcepart->GetPdgCode()<0) fHistoElectronFeedDownXicPlusMCGen1->Fill(contmcele);
2659  if(mcepart->GetPdgCode()>0) fHistoElectronFeedDownXicPlusMCGen2->Fill(contmcele);
2660  if(fabs(mcepart->Eta())<etamax){
2662  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1->Fill(cont2);
2664  if(InvMassEleLambda<2.3){
2665  fHistoElePtFeeddownXicPlusMCGen->Fill(mcepart->Pt(),fCentrality);
2666  fHistoElePtvsEtaFeeddownXicPlusMCGen->Fill(cont_eleptvseta);
2667  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen->Fill(cont_eleptvslambdapt);
2668  }
2669  }
2670  }
2671 
2673  fMCVariablesTree->Fill();
2674 }
2677 {
2678  //
2679  // Define electron tree variables
2680  //
2681 
2682  const char* nameoutput = GetOutputSlot(9)->GetContainer()->GetName();
2683  fMCEleVariablesTree = new TTree(nameoutput,"MC Ele variables tree");
2684  Int_t nVar = 8;
2685  fCandidateMCEleVariables = new Float_t [nVar];
2686  TString * fCandidateVariableNames = new TString[nVar];
2687 
2688  fCandidateVariableNames[ 0]="Centrality";
2689  fCandidateVariableNames[ 1]="ElePx";
2690  fCandidateVariableNames[ 2]="ElePy";
2691  fCandidateVariableNames[ 3]="ElePz";
2692  fCandidateVariableNames[ 4]="ElePdgCode";
2693  fCandidateVariableNames[ 5]="EleMotherPdgCode";
2694  fCandidateVariableNames[ 6]="RunNumber";
2695  fCandidateVariableNames[ 7]="EvNumber";
2696 
2697  for (Int_t ivar=0; ivar<nVar; ivar++) {
2698  fMCEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2699  }
2700  return;
2701 }
2703 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
2704 {
2705  //
2706  // Fill tree depending on fWriteMCVariableTree
2707  //
2708  if(!mcepart) return;
2709 
2710  Bool_t hfe_flag = kFALSE;
2711  Int_t labemother = mcepart->GetMother();
2712  Int_t pdgmotherele = -9999;
2713  if(labemother>=0){
2714  AliAODMCParticle *motherele = (AliAODMCParticle*)mcArray->At(labemother);
2715  pdgmotherele = motherele->GetPdgCode();
2716  if(abs(pdgmotherele)>4000&&abs(pdgmotherele)<4400){
2717  hfe_flag = kTRUE;
2718  }
2719  }
2720  if(!hfe_flag) return;
2721 
2722  Double_t contmc[3];
2723  contmc[0] = mcepart->Pt();
2724  contmc[1] = mcepart->Eta();
2725  contmc[2] = fCentrality;
2726  fHistoElectronMCGen->Fill(contmc);
2727 
2728  for(Int_t i=0;i<8;i++){
2729  fCandidateMCEleVariables[i] = -9999.;
2730  }
2731 
2733  fCandidateMCEleVariables[ 1] = mcepart->Px();
2734  fCandidateMCEleVariables[ 2] = mcepart->Py();
2735  fCandidateMCEleVariables[ 3] = mcepart->Pz();
2736  fCandidateMCEleVariables[ 4] = mcepart->GetPdgCode();
2737  fCandidateMCEleVariables[ 5] = pdgmotherele;
2740 
2741 // if(fWriteMCVariableTree && fWriteEachVariableTree && mcepart->Pt()>0.4 && fabs(mcepart->Eta())<1.0 )
2742 // fMCEleVariablesTree->Fill();
2743 
2744 }
2747 {
2748  //
2749  // Define Mc v0 tree variables
2750  //
2751 
2752  const char* nameoutput = GetOutputSlot(10)->GetContainer()->GetName();
2753  fMCV0VariablesTree = new TTree(nameoutput,"MC v0 variables tree");
2754  Int_t nVar = 8;
2755  fCandidateMCV0Variables = new Float_t [nVar];
2756  TString * fCandidateVariableNames = new TString[nVar];
2757 
2758  fCandidateVariableNames[ 0]="Centrality";
2759  fCandidateVariableNames[ 1]="V0Px";
2760  fCandidateVariableNames[ 2]="V0Py";
2761  fCandidateVariableNames[ 3]="V0Pz";
2762  fCandidateVariableNames[ 4]="V0PdgCode";
2763  fCandidateVariableNames[ 5]="V0MotherPdgCode";
2764  fCandidateVariableNames[ 6]="RunNumber";
2765  fCandidateVariableNames[ 7]="EvNumber";
2766 
2767  for (Int_t ivar=0; ivar<nVar; ivar++) {
2768  fMCV0VariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCV0Variables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2769  }
2770  return;
2771 }
2773 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCV0ROOTObjects(AliAODMCParticle *mcv0part, TClonesArray *mcArray)
2774 {
2775  //
2776  // Fill histograms or tree depending on fWriteMCVariableTree
2777  //
2778  if(!mcv0part) return;
2779 
2780  for(Int_t i=0;i<8;i++){
2781  fCandidateMCV0Variables[i] = -9999.;
2782  }
2783 
2784  Bool_t hfv0_flag = kFALSE;
2785  Int_t labv0mother = mcv0part->GetMother();
2786  Int_t pdgmotherv0 = -9999;
2787  if(labv0mother>=0){
2788  AliAODMCParticle *motherv0 = (AliAODMCParticle*)mcArray->At(labv0mother);
2789  if(motherv0){
2790  pdgmotherv0 = motherv0->GetPdgCode();
2791  if(abs(pdgmotherv0)>4000&&abs(pdgmotherv0)<4400){
2792  hfv0_flag = kTRUE;
2793  }
2794  }
2795  }
2796  if(!hfv0_flag) return;
2797 
2798  Double_t contmc[3];
2799  contmc[0] = mcv0part->Pt();
2800  contmc[1] = mcv0part->Eta();
2801  contmc[2] = fCentrality;
2802  fHistoLambdaMCGen->Fill(contmc);
2803 
2805  fCandidateMCV0Variables[ 1] = mcv0part->Px();
2806  fCandidateMCV0Variables[ 2] = mcv0part->Py();
2807  fCandidateMCV0Variables[ 3] = mcv0part->Pz();
2808  fCandidateMCV0Variables[ 4] = mcv0part->GetPdgCode();
2809  fCandidateMCV0Variables[ 5] = pdgmotherv0;
2812 
2813  if(fWriteMCVariableTree && fWriteEachVariableTree && mcv0part->Pt()>0.4 && fabs(mcv0part->Eta())<1.0 )
2814  fMCV0VariablesTree->Fill();
2815 }
2816 
2817 
2820  //
2822  //
2823 
2824  fCEvents = new TH1F("fCEvents","conter",18,-0.5,17.5);
2825  fCEvents->SetStats(kTRUE);
2826  fCEvents->GetXaxis()->SetBinLabel(1,"X1");
2827  fCEvents->GetXaxis()->SetBinLabel(2,"Analyzed events");
2828  fCEvents->GetXaxis()->SetBinLabel(3,"AliAODVertex exists");
2829  fCEvents->GetXaxis()->SetBinLabel(4,"TriggerOK");
2830  fCEvents->GetXaxis()->SetBinLabel(5,"IsEventSelected");
2831  fCEvents->GetXaxis()->SetBinLabel(6,"CascadesHF exists");
2832  fCEvents->GetXaxis()->SetBinLabel(7,"MCarray exists");
2833  fCEvents->GetXaxis()->SetBinLabel(8,"MCheader exists");
2834  fCEvents->GetXaxis()->SetBinLabel(9,"triggerClass!=CINT1");
2835  fCEvents->GetXaxis()->SetBinLabel(10,"triggerMask!=kAnyINT");
2836  fCEvents->GetXaxis()->SetBinLabel(11,"triggerMask!=kAny");
2837  fCEvents->GetXaxis()->SetBinLabel(12,"vtxTitle.Contains(Z)");
2838  fCEvents->GetXaxis()->SetBinLabel(13,"vtxTitle.Contains(3D)");
2839  fCEvents->GetXaxis()->SetBinLabel(14,"vtxTitle.Doesn'tContain(Z-3D)");
2840  fCEvents->GetXaxis()->SetBinLabel(15,Form("zVtx<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
2841  fCEvents->GetXaxis()->SetBinLabel(16,"!IsEventSelected");
2842  fCEvents->GetXaxis()->SetBinLabel(17,"triggerMask!=kAnyINT || triggerClass!=CINT1");
2843  fCEvents->GetXaxis()->SetBinLabel(18,Form("zVtxMC<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
2844  //fCEvents->GetXaxis()->SetTitle("");
2845  fCEvents->GetYaxis()->SetTitle("counts");
2846 
2847  fHTrigger = new TH1F("fHTrigger","counter",18,-0.5,17.5);
2848  fHTrigger->SetStats(kTRUE);
2849  fHTrigger->GetXaxis()->SetBinLabel(1,"X1");
2850  fHTrigger->GetXaxis()->SetBinLabel(2,"kMB");
2851  fHTrigger->GetXaxis()->SetBinLabel(3,"kSemiCentral");
2852  fHTrigger->GetXaxis()->SetBinLabel(4,"kCentral");
2853  fHTrigger->GetXaxis()->SetBinLabel(5,"kINT7");
2854  fHTrigger->GetXaxis()->SetBinLabel(6,"kEMC7");
2855  //fHTrigger->GetXaxis()->SetBinLabel(7,"Space");
2856  fHTrigger->GetXaxis()->SetBinLabel(8,"kMB|kSemiCentral|kCentral");
2857  fHTrigger->GetXaxis()->SetBinLabel(9,"kINT7|kEMC7");
2858  fHTrigger->GetXaxis()->SetBinLabel(11,"kMB&kSemiCentral");
2859  fHTrigger->GetXaxis()->SetBinLabel(12,"kMB&kCentral");
2860  fHTrigger->GetXaxis()->SetBinLabel(13,"kINT7&kEMC7");
2861 
2862  fHCentrality = new TH1F("fHCentrality","conter",100,0.,100.);
2863 
2864 
2865  fOutput->Add(fCEvents);
2866  fOutput->Add(fHTrigger);
2867  fOutput->Add(fHCentrality);
2868 
2869  return;
2870 }
2871 //__________________________________________________________________________
2873 {
2874  //
2876  //
2877 
2878  //------------------------------------------------
2879  // Basic histogram
2880  //------------------------------------------------
2881  Int_t bins_base[3]= {10,100 ,10};
2882  Double_t xmin_base[3]={1.1,0 ,0.00};
2883  Double_t xmax_base[3]={3.1,20. ,100};
2884  fHistoEleLambdaMass = new THnSparseF("fHistoEleLambdaMass","",3,bins_base,xmin_base,xmax_base);
2886  fHistoEleLambdaMassRS = new THnSparseF("fHistoEleLambdaMassRS","",3,bins_base,xmin_base,xmax_base);
2888  fHistoEleLambdaMassWS = new THnSparseF("fHistoEleLambdaMassWS","",3,bins_base,xmin_base,xmax_base);
2890  fHistoEleLambdaMassRSMix = new THnSparseF("fHistoEleLambdaMassRSMix","",3,bins_base,xmin_base,xmax_base);
2892  fHistoEleLambdaMassWSMix = new THnSparseF("fHistoEleLambdaMassWSMix","",3,bins_base,xmin_base,xmax_base);
2894  fHistoEleLambdaMassRSSide = new THnSparseF("fHistoEleLambdaMassRSSide","",3,bins_base,xmin_base,xmax_base);
2896  fHistoEleLambdaMassWSSide = new THnSparseF("fHistoEleLambdaMassWSSide","",3,bins_base,xmin_base,xmax_base);
2898 
2899  Int_t bins_base_elept[3]= {10,100 ,10};
2900  Double_t xmin_base_elept[3]={1.1,0 ,0.00};
2901  Double_t xmax_base_elept[3]={3.1,10. ,100};
2902  fHistoEleLambdaMassvsElePtRS = new THnSparseF("fHistoEleLambdaMassvsElePtRS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2904  fHistoEleLambdaMassvsElePtWS = new THnSparseF("fHistoEleLambdaMassvsElePtWS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2906  fHistoEleLambdaMassvsElePtRSMix = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2908  fHistoEleLambdaMassvsElePtWSMix = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2910  fHistoEleLambdaMassvsElePtRSSide = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2912  fHistoEleLambdaMassvsElePtWSSide = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2914  fHistoEleLambdaMassvsElePtRS1 = new THnSparseF("fHistoEleLambdaMassvsElePtRS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2916  fHistoEleLambdaMassvsElePtWS1 = new THnSparseF("fHistoEleLambdaMassvsElePtWS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2918  fHistoEleLambdaMassvsElePtRSMix1 = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2920  fHistoEleLambdaMassvsElePtWSMix1 = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2922  fHistoEleLambdaMassvsElePtRSSide1 = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2924  fHistoEleLambdaMassvsElePtWSSide1 = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2926  fHistoEleLambdaMassvsElePtRS2 = new THnSparseF("fHistoEleLambdaMassvsElePtRS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2928  fHistoEleLambdaMassvsElePtWS2 = new THnSparseF("fHistoEleLambdaMassvsElePtWS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2930  fHistoEleLambdaMassvsElePtRSMix2 = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2932  fHistoEleLambdaMassvsElePtWSMix2 = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2934  fHistoEleLambdaMassvsElePtRSSide2 = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2936  fHistoEleLambdaMassvsElePtWSSide2 = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2938 
2939  fHistoEleLambdaMassMCS = new THnSparseF("fHistoEleLambdaMassMCS","",3,bins_base,xmin_base,xmax_base);
2941  fHistoEleLambdaMassMCGen = new THnSparseF("fHistoEleLambdaMassMCGen","",3,bins_base,xmin_base,xmax_base);
2943  fHistoEleLambdaMassvsElePtMCS = new THnSparseF("fHistoEleLambdaMassvsElePtMCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2945  fHistoEleLambdaMassvsElePtMCGen = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2947  fHistoEleLambdaMassvsElePtMCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtMCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2949  fHistoEleLambdaMassvsElePtMCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2951  fHistoEleLambdaMassvsElePtMCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtMCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2953  fHistoEleLambdaMassvsElePtMCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
2955 
2956  fHistoElePtRS = new TH2F("fHistoElePtRS","",100,0,10,10,0,100);
2957  fOutputAll->Add(fHistoElePtRS);
2958  fHistoElePtWS = new TH2F("fHistoElePtWS","",100,0.,10.,10,0,100);
2959  fOutputAll->Add(fHistoElePtWS);
2960  fHistoElePtRSMix = new TH2F("fHistoElePtRSMix","",100,0.,10.,10,0,100);
2962  fHistoElePtWSMix = new TH2F("fHistoElePtWSMix","",100,0.,10.,10,0,100);
2964  fHistoElePtMCS = new TH2F("fHistoElePtMCS","",100,0,10,10,0,100);
2965  fOutputAll->Add(fHistoElePtMCS);
2966  fHistoElePtMCGen = new TH2F("fHistoElePtMCGen","",100,0,10,10,0,100);
2968 
2969  Int_t bins_eleptvseta[3]= {10,10 ,10};
2970  Double_t xmin_eleptvseta[3]={0.,-1. ,0.0};
2971  Double_t xmax_eleptvseta[3]={5.,1. ,100};
2972 
2973  fHistoElePtvsEtaRS = new THnSparseF("fHistoElePtvsEtaRS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2975  fHistoElePtvsEtaWS = new THnSparseF("fHistoElePtvsEtaWS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2977  fHistoElePtvsEtaRSMix = new THnSparseF("fHistoElePtvsEtaRSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2979  fHistoElePtvsEtaWSMix = new THnSparseF("fHistoElePtvsEtaWSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2981  fHistoElePtvsEtaMCS = new THnSparseF("fHistoElePtvsEtaMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2983  fHistoElePtvsEtaMCGen = new THnSparseF("fHistoElePtvsEtaMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2985 
2986  Int_t bins_eleptvslambdapt[3]= {10,10 ,10};
2987  Double_t xmin_eleptvslambdapt[3]={0.,0. ,0.0};
2988  Double_t xmax_eleptvslambdapt[3]={5.,5. ,100};
2989 
2990  fHistoElePtvsLambdaPtRS = new THnSparseF("fHistoElePtvsLambdaPtRS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2992  fHistoElePtvsLambdaPtWS = new THnSparseF("fHistoElePtvsLambdaPtWS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2994  fHistoElePtvsLambdaPtRSMix = new THnSparseF("fHistoElePtvsLambdaPtRSMix","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2996  fHistoElePtvsLambdaPtWSMix = new THnSparseF("fHistoElePtvsLambdaPtWSMix","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2998  fHistoElePtvsLambdaPtMCS = new THnSparseF("fHistoElePtvsLambdaPtMCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3000  fHistoElePtvsLambdaPtMCGen = new THnSparseF("fHistoElePtvsLambdaPtMCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3002  fHistoElePtvsLambdaPtMCLcGen = new THnSparseF("fHistoElePtvsLambdaPtMCLcGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3004 
3005  Int_t bins_eleptvslambdaptvslcpt[4]= {10,10,10,10};
3006  Double_t xmin_eleptvslambdaptvslcpt[4]={0.,0.,0.,0.0};
3007  Double_t xmax_eleptvslambdaptvslcpt[4]={5.,5.,10.,100};
3008  fHistoElePtvsLambdaPtvsLcPtMCS = new THnSparseF("fHistoElePtvsLambdaPtvsLcPtMCS","",4,bins_eleptvslambdaptvslcpt,xmin_eleptvslambdaptvslcpt,xmax_eleptvslambdaptvslcpt);
3010  fHistoElePtvsLambdaPtvsLcPtMCGen = new THnSparseF("fHistoElePtvsLambdaPtvsLcPtMCGen","",4,bins_eleptvslambdaptvslcpt,xmin_eleptvslambdaptvslcpt,xmax_eleptvslambdaptvslcpt);
3012 
3013  Int_t bins_allpt[4]= {10,10,20,20};
3014  Double_t xmin_allpt[4]={0.,0.,0.,0.0};
3015  Double_t xmax_allpt[4]={20.,20.,10.,10};
3016  fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt = new THnSparseF("fHistoLcPtvseleLambdaPtvsElePtvsLambdaPt","",4,bins_allpt,xmin_allpt,xmax_allpt);
3018 
3019  Int_t bins_eleptvsd0[3]= {10 ,10 ,10};
3020  Double_t xmin_eleptvsd0[3]={0.,-0.2 ,0.0};
3021  Double_t xmax_eleptvsd0[3]={5.,0.2 ,100};
3022 
3023  fHistoElePtvsd0RS = new THnSparseF("fHistoElePtvsd0RS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3025  fHistoElePtvsd0WS = new THnSparseF("fHistoElePtvsd0WS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3027  fHistoElePtvsd0RSMix = new THnSparseF("fHistoElePtvsd0RSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3029  fHistoElePtvsd0WSMix = new THnSparseF("fHistoElePtvsd0WSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3031  fHistoElePtvsd0MCS = new THnSparseF("fHistoElePtvsd0MCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3033  fHistoElePtvsd0PromptMCS = new THnSparseF("fHistoElePtvsd0PromptMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3035  fHistoElePtvsd0BFeeddownMCS = new THnSparseF("fHistoElePtvsd0BFeeddownMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3037 
3038 
3039  //Feeddown from Xic0
3040  fHistoEleLambdaMassFeeddownXic0MCS = new THnSparseF("fHistoEleLambdaMassFeeddownXic0MCS","",3,bins_base,xmin_base,xmax_base);
3042  fHistoEleLambdaMassFeeddownXic0MCGen = new THnSparseF("fHistoEleLambdaMassFeeddownXic0MCGen","",3,bins_base,xmin_base,xmax_base);
3044  fHistoEleLambdaMassvsElePtFeeddownXic0MCS = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3046  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3048  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3050  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3052  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3054  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3056  fHistoElePtFeeddownXic0MCS = new TH2F("fHistoElePtFeeddownXic0MCS","",100,0,10,10,0,100);
3058  fHistoElePtFeeddownXic0MCGen = new TH2F("fHistoElePtFeeddownXic0MCGen","",100,0,10,10,0,100);
3060  fHistoElePtvsEtaFeeddownXic0MCS = new THnSparseF("fHistoElePtvsEtaFeeddownXic0MCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3062  fHistoElePtvsEtaFeeddownXic0MCGen = new THnSparseF("fHistoElePtvsEtaFeeddownXic0MCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3064  fHistoElePtvsLambdaPtFeeddownXic0MCS = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXic0MCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3066  fHistoElePtvsLambdaPtFeeddownXic0MCGen = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXic0MCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3068 
3069  //Feeddown from XicPlus
3070  fHistoEleLambdaMassFeeddownXicPlusMCS = new THnSparseF("fHistoEleLambdaMassFeeddownXicPlusMCS","",3,bins_base,xmin_base,xmax_base);
3072  fHistoEleLambdaMassFeeddownXicPlusMCGen = new THnSparseF("fHistoEleLambdaMassFeeddownXicPlusMCGen","",3,bins_base,xmin_base,xmax_base);
3074  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3076  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3078  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3080  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3082  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3084  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3086  fHistoElePtFeeddownXicPlusMCS = new TH2F("fHistoElePtFeeddownXicPlusMCS","",100,0,10,10,0,100);
3088  fHistoElePtFeeddownXicPlusMCGen = new TH2F("fHistoElePtFeeddownXicPlusMCGen","",100,0,10,10,0,100);
3090  fHistoElePtvsEtaFeeddownXicPlusMCS = new THnSparseF("fHistoElePtvsEtaFeeddownXicPlusMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3092  fHistoElePtvsEtaFeeddownXicPlusMCGen = new THnSparseF("fHistoElePtvsEtaFeeddownXicPlusMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3094  fHistoElePtvsLambdaPtFeeddownXicPlusMCS = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXicPlusMCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3096  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXicPlusMCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
3098 
3099  //------------------------------------------------
3100  // checking histograms
3101  //------------------------------------------------
3102  fHistoBachPt = new TH1F("fHistoBachPt","Bachelor p_{T}",100,0.0,5.0);
3103  fOutputAll->Add(fHistoBachPt);
3104  fHistoBachPtMCS = new TH1F("fHistoBachPtMCS","Bachelor p_{T}",100,0.0,5.0);
3106  fHistoBachPtMCGen = new TH1F("fHistoBachPtMCGen","Bachelor p_{T}",100,0.0,5.0);
3108  fHistod0Bach = new TH1F("fHistod0Bach","Bachelor d_{0}",100,-0.5,0.5);
3109  fOutputAll->Add(fHistod0Bach);
3110  fHistoLambdaMassvsPt=new TH2F("fHistoLambdaMassvsPt","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
3112  fHistoLambdaMassvsPtMCS=new TH2F("fHistoLambdaMassvsPtMCS","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
3114  fHistoLambdaMassvsPtMCGen=new TH2F("fHistoLambdaMassvsPtMCGen","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
3116  fHistoK0sMassvsPt=new TH2F("fHistoK0sMassvsPt","K0s mass",100,0.497-0.05,0.497+0.05,20,0.,10.);
3118  fHistoLambdaPtvsDl=new TH2F("fHistoLambdaPtvsDl","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3120  fHistoLambdaPtvsDlSide=new TH2F("fHistoLambdaPtvsDlSide","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3122  fHistoLambdaPtvsDlMCS=new TH2F("fHistoLambdaPtvsDlMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3124  fHistoLambdaPtvsDlFeeddownXi0MCS=new TH2F("fHistoLambdaPtvsDlFeeddownXi0MCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3126  fHistoLambdaPtvsDlFeeddownXiMinusMCS=new TH2F("fHistoLambdaPtvsDlFeeddownXiMinusMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3128  fHistoLambdaPtvsDlFeeddownOmegaMCS=new TH2F("fHistoLambdaPtvsDlFeeddownOmegaMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3130 
3131  fHistoElectronTPCPID=new TH2F("fHistoElectronTPCPID","",50,0.,5.,50,-20.,20.);
3133  fHistoElectronTOFPID=new TH2F("fHistoElectronTOFPID","",50,0.,5.,50,-20.,20.);
3135  fHistoElectronTPCSelPID=new TH2F("fHistoElectronTPCSelPID","",50,0.,5.,50,-20.,20.);
3137  fHistoElectronTOFSelPID=new TH2F("fHistoElectronTOFSelPID","",50,0.,5.,50,-20.,20.);
3139  fHistoElectronTPCPIDSelTOF=new TH2F("fHistoElectronTPCPIDSelTOF","",10,0.,5.,500,-10.,10.);
3141  fHistoElectronTPCPIDSelTOFSmallEta=new TH2F("fHistoElectronTPCPIDSelTOFSmallEta","",10,0.,5.,500,-10.,10.);
3143  fHistoElectronTPCPIDSelTOFLargeEta=new TH2F("fHistoElectronTPCPIDSelTOFLargeEta","",10,0.,5.,500,-10.,10.);
3145 
3146  for(Int_t i=0;i<8;i++){
3147  fHistoElectronTPCPIDSelTOFEtaDep[i]=new TH2F(Form("fHistoElectronTPCPIDSelTOFEtaDep[%d]",i),"",10,0.,5.,500,-10.,10.);
3149  }
3150  fHistoElectronQovPtvsPhi=new TH2F("fHistoElectronQovPtvsPhi","",70,0.,7.,50,-2.,2.);
3152  fHistoLambdaQovPtvsPhi=new TH2F("fHistoLambdaQovPtvsPhi","",70,0.,7.,50,-2.,2.);
3154 
3155  Int_t bins_lcmcgen[3]= {100 ,20 ,10};
3156  Double_t xmin_lcmcgen[3]={0.,-1.0 ,0.0};
3157  Double_t xmax_lcmcgen[3]={20.,1.0 ,100};
3158  fHistoLcMCGen = new THnSparseF("fHistoLcMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3159  fOutputAll->Add(fHistoLcMCGen);
3160  fHistoLcMCGen1 = new THnSparseF("fHistoLcMCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3161  fOutputAll->Add(fHistoLcMCGen1);
3162  fHistoLcMCGen2 = new THnSparseF("fHistoLcMCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3163  fOutputAll->Add(fHistoLcMCGen2);
3164  fHistoFeedDownXic0MCGen = new THnSparseF("fHistoFeedDownXic0MCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3166  fHistoFeedDownXic0MCGen1 = new THnSparseF("fHistoFeedDownXic0MCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3168  fHistoFeedDownXic0MCGen2 = new THnSparseF("fHistoFeedDownXic0MCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3170  fHistoFeedDownXicPlusMCGen = new THnSparseF("fHistoFeedDownXicPlusMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3172  fHistoFeedDownXicPlusMCGen1 = new THnSparseF("fHistoFeedDownXicPlusMCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3174  fHistoFeedDownXicPlusMCGen2 = new THnSparseF("fHistoFeedDownXicPlusMCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3176  fHistoLcMCS = new THnSparseF("fHistoLcMCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3177  fOutputAll->Add(fHistoLcMCS);
3178  fHistoLcMCS1 = new THnSparseF("fHistoLcMCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3179  fOutputAll->Add(fHistoLcMCS1);
3180  fHistoLcMCS2 = new THnSparseF("fHistoLcMCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3181  fOutputAll->Add(fHistoLcMCS2);
3182  fHistoFeedDownXic0MCS = new THnSparseF("fHistoFeedDownXic0MCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3184  fHistoFeedDownXic0MCS1 = new THnSparseF("fHistoFeedDownXic0MCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3186  fHistoFeedDownXic0MCS2 = new THnSparseF("fHistoFeedDownXic0MCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3188  fHistoFeedDownXicPlusMCS = new THnSparseF("fHistoFeedDownXicPlusMCS","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3190  fHistoFeedDownXicPlusMCS1 = new THnSparseF("fHistoFeedDownXicPlusMCS1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3192  fHistoFeedDownXicPlusMCS2 = new THnSparseF("fHistoFeedDownXicPlusMCS2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
3194 
3195  Int_t bins_elemcgen[3]= {100 ,20 ,10};
3196  Double_t xmin_elemcgen[3]={0.,-1.0 ,0.0};
3197  Double_t xmax_elemcgen[3]={10.,1.0 ,100};
3198  fHistoElectronMCGen = new THnSparseF("fHistoElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3200  fHistoLcElectronMCGen = new THnSparseF("fHistoLcElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3202  fHistoLcElectronMCGen1 = new THnSparseF("fHistoLcElectronMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3204  fHistoLcElectronMCGen2 = new THnSparseF("fHistoLcElectronMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3206  fHistoElectronFeedDownXic0MCGen = new THnSparseF("fHistoElectronFeedDownXic0MCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3208  fHistoElectronFeedDownXic0MCGen1 = new THnSparseF("fHistoElectronFeedDownXic0MCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3210  fHistoElectronFeedDownXic0MCGen2 = new THnSparseF("fHistoElectronFeedDownXic0MCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3212  fHistoElectronFeedDownXicPlusMCGen = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3214  fHistoElectronFeedDownXicPlusMCGen1 = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3216  fHistoElectronFeedDownXicPlusMCGen2 = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3218  fHistoLcElectronMCS = new THnSparseF("fHistoLcElectronMCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3220  fHistoLcElectronMCS1 = new THnSparseF("fHistoLcElectronMCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3222  fHistoLcElectronMCS2 = new THnSparseF("fHistoLcElectronMCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3224  fHistoElectronFeedDownXic0MCS = new THnSparseF("fHistoElectronFeedDownXic0MCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3226  fHistoElectronFeedDownXic0MCS1 = new THnSparseF("fHistoElectronFeedDownXic0MCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3228  fHistoElectronFeedDownXic0MCS2 = new THnSparseF("fHistoElectronFeedDownXic0MCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3230  fHistoElectronFeedDownXicPlusMCS = new THnSparseF("fHistoElectronFeedDownXicPlusMCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3232  fHistoElectronFeedDownXicPlusMCS1 = new THnSparseF("fHistoElectronFeedDownXicPlusMCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3234  fHistoElectronFeedDownXicPlusMCS2 = new THnSparseF("fHistoElectronFeedDownXicPlusMCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3236 
3237  Int_t bins_lambdamcgen[3]= {50 ,20 ,10};
3238  Double_t xmin_lambdamcgen[3]={0.,-1.0 ,0.0};
3239  Double_t xmax_lambdamcgen[3]={10.,1.0 ,100};
3240  fHistoLambdaMCGen = new THnSparseF("fHistoLambdaMCGen","",3,bins_lambdamcgen,xmin_lambdamcgen,xmax_lambdamcgen);
3242 
3243  Int_t bins_eleptvsv0dl[3]= {100 ,20 ,10};
3244  Double_t xmin_eleptvsv0dl[3]={0.,0. ,0.0};
3245  Double_t xmax_eleptvsv0dl[3]={10.,40. ,100};
3246  fHistoElePtvsV0dlRS = new THnSparseF("fHistoElePtvsV0dlRS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3248  fHistoElePtvsV0dlRS1 = new THnSparseF("fHistoElePtvsV0dlRS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3250  fHistoElePtvsV0dlRS2 = new THnSparseF("fHistoElePtvsV0dlRS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3252  fHistoElePtvsV0dlRSSide = new THnSparseF("fHistoElePtvsV0dlRSSide","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3254  fHistoElePtvsV0dlRSSide1 = new THnSparseF("fHistoElePtvsV0dlRSSide1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3256  fHistoElePtvsV0dlRSSide2 = new THnSparseF("fHistoElePtvsV0dlRSSide2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3258  fHistoElePtvsV0dlRSMix = new THnSparseF("fHistoElePtvsV0dlRSMix","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3260  fHistoElePtvsV0dlRSMix1 = new THnSparseF("fHistoElePtvsV0dlRSMix1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3262  fHistoElePtvsV0dlRSMix2 = new THnSparseF("fHistoElePtvsV0dlRSMix2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3264  fHistoElePtvsV0dlWS = new THnSparseF("fHistoElePtvsV0dlWS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3266  fHistoElePtvsV0dlWS1 = new THnSparseF("fHistoElePtvsV0dlWS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3268  fHistoElePtvsV0dlWS2 = new THnSparseF("fHistoElePtvsV0dlWS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3270  fHistoElePtvsV0dlWSSide = new THnSparseF("fHistoElePtvsV0dlWSSide","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3272  fHistoElePtvsV0dlWSSide1 = new THnSparseF("fHistoElePtvsV0dlWSSide1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3274  fHistoElePtvsV0dlWSSide2 = new THnSparseF("fHistoElePtvsV0dlWSSide2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3276  fHistoElePtvsV0dlWSMix = new THnSparseF("fHistoElePtvsV0dlWSMix","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3278  fHistoElePtvsV0dlWSMix1 = new THnSparseF("fHistoElePtvsV0dlWSMix1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3280  fHistoElePtvsV0dlWSMix2 = new THnSparseF("fHistoElePtvsV0dlWSMix2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3282  fHistoElePtvsV0dlMCS = new THnSparseF("fHistoElePtvsV0dlMCS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3284  fHistoElePtvsV0dlMCS1 = new THnSparseF("fHistoElePtvsV0dlMCS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3286  fHistoElePtvsV0dlMCS2 = new THnSparseF("fHistoElePtvsV0dlMCS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3288  fHistoElePtvsV0dlFeedDownXic0MCS = new THnSparseF("fHistoElePtvsV0dlFeedDownXic0MCS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3290  fHistoElePtvsV0dlFeedDownXic0MCS1 = new THnSparseF("fHistoElePtvsV0dlFeedDownXic0MCS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3292  fHistoElePtvsV0dlFeedDownXic0MCS2 = new THnSparseF("fHistoElePtvsV0dlFeedDownXic0MCS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3294  fHistoElePtvsV0dlFeedDownXicPlusMCS = new THnSparseF("fHistoElePtvsV0dlFeedDownXicPlusMCS","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3296  fHistoElePtvsV0dlFeedDownXicPlusMCS1 = new THnSparseF("fHistoElePtvsV0dlFeedDownXicPlusMCS1","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3298  fHistoElePtvsV0dlFeedDownXicPlusMCS2 = new THnSparseF("fHistoElePtvsV0dlFeedDownXicPlusMCS2","",3,bins_eleptvsv0dl,xmin_eleptvsv0dl,xmax_eleptvsv0dl);
3300 
3301  Int_t bins_eleptvsv0dca[3]= {100 ,20 ,10};
3302  Double_t xmin_eleptvsv0dca[3]={0.,0. ,0.0};
3303  Double_t xmax_eleptvsv0dca[3]={10.,1. ,100};
3304  fHistoElePtvsV0dcaRS = new THnSparseF("fHistoElePtvsV0dcaRS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3306  fHistoElePtvsV0dcaRS1 = new THnSparseF("fHistoElePtvsV0dcaRS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3308  fHistoElePtvsV0dcaRS2 = new THnSparseF("fHistoElePtvsV0dcaRS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3310  fHistoElePtvsV0dcaRSSide = new THnSparseF("fHistoElePtvsV0dcaRSSide","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3312  fHistoElePtvsV0dcaRSSide1 = new THnSparseF("fHistoElePtvsV0dcaRSSide1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3314  fHistoElePtvsV0dcaRSSide2 = new THnSparseF("fHistoElePtvsV0dcaRSSide2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3316  fHistoElePtvsV0dcaRSMix = new THnSparseF("fHistoElePtvsV0dcaRSMix","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3318  fHistoElePtvsV0dcaRSMix1 = new THnSparseF("fHistoElePtvsV0dcaRSMix1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3320  fHistoElePtvsV0dcaRSMix2 = new THnSparseF("fHistoElePtvsV0dcaRSMix2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3322  fHistoElePtvsV0dcaWS = new THnSparseF("fHistoElePtvsV0dcaWS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3324  fHistoElePtvsV0dcaWS1 = new THnSparseF("fHistoElePtvsV0dcaWS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3326  fHistoElePtvsV0dcaWS2 = new THnSparseF("fHistoElePtvsV0dcaWS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3328  fHistoElePtvsV0dcaWSSide = new THnSparseF("fHistoElePtvsV0dcaWSSide","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3330  fHistoElePtvsV0dcaWSSide1 = new THnSparseF("fHistoElePtvsV0dcaWSSide1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3332  fHistoElePtvsV0dcaWSSide2 = new THnSparseF("fHistoElePtvsV0dcaWSSide2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3334  fHistoElePtvsV0dcaWSMix = new THnSparseF("fHistoElePtvsV0dcaWSMix","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3336  fHistoElePtvsV0dcaWSMix1 = new THnSparseF("fHistoElePtvsV0dcaWSMix1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3338  fHistoElePtvsV0dcaWSMix2 = new THnSparseF("fHistoElePtvsV0dcaWSMix2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3340  fHistoElePtvsV0dcaMCS = new THnSparseF("fHistoElePtvsV0dcaMCS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3342  fHistoElePtvsV0dcaMCS1 = new THnSparseF("fHistoElePtvsV0dcaMCS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3344  fHistoElePtvsV0dcaMCS2 = new THnSparseF("fHistoElePtvsV0dcaMCS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3346  fHistoElePtvsV0dcaFeedDownXic0MCS = new THnSparseF("fHistoElePtvsV0dcaFeedDownXic0MCS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3348  fHistoElePtvsV0dcaFeedDownXic0MCS1 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXic0MCS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3350  fHistoElePtvsV0dcaFeedDownXic0MCS2 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXic0MCS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3352  fHistoElePtvsV0dcaFeedDownXicPlusMCS = new THnSparseF("fHistoElePtvsV0dcaFeedDownXicPlusMCS","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3354  fHistoElePtvsV0dcaFeedDownXicPlusMCS1 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXicPlusMCS1","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3356  fHistoElePtvsV0dcaFeedDownXicPlusMCS2 = new THnSparseF("fHistoElePtvsV0dcaFeedDownXicPlusMCS2","",3,bins_eleptvsv0dca,xmin_eleptvsv0dca,xmax_eleptvsv0dca);
3358 
3359  Int_t bins_elelamptvsv0dl[3]= {100 ,20 ,10};
3360  Double_t xmin_elelamptvsv0dl[3]={0.,0. ,0.0};
3361  Double_t xmax_elelamptvsv0dl[3]={20.,40. ,100};
3362  fHistoEleLambdaPtvsV0dlRS = new THnSparseF("fHistoEleLambdaPtvsV0dlRS","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3364  fHistoEleLambdaPtvsV0dlRS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlRS1","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3366  fHistoEleLambdaPtvsV0dlRS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlRS2","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3368  fHistoEleLambdaPtvsV0dlRSSide = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3370  fHistoEleLambdaPtvsV0dlRSSide1 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide1","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3372  fHistoEleLambdaPtvsV0dlRSSide2 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSSide2","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3374  fHistoEleLambdaPtvsV0dlRSMix = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3376  fHistoEleLambdaPtvsV0dlRSMix1 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix1","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3378  fHistoEleLambdaPtvsV0dlRSMix2 = new THnSparseF("fHistoEleLambdaPtvsV0dlRSMix2","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3380  fHistoEleLambdaPtvsV0dlWS = new THnSparseF("fHistoEleLambdaPtvsV0dlWS","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3382  fHistoEleLambdaPtvsV0dlWS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlWS1","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3384  fHistoEleLambdaPtvsV0dlWS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlWS2","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3386  fHistoEleLambdaPtvsV0dlWSSide = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3388  fHistoEleLambdaPtvsV0dlWSSide1 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide1","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3390  fHistoEleLambdaPtvsV0dlWSSide2 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSSide2","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3392  fHistoEleLambdaPtvsV0dlWSMix = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3394  fHistoEleLambdaPtvsV0dlWSMix1 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix1","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3396  fHistoEleLambdaPtvsV0dlWSMix2 = new THnSparseF("fHistoEleLambdaPtvsV0dlWSMix2","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3398  fHistoEleLambdaPtvsV0dlMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlMCS","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3400  fHistoEleLambdaPtvsV0dlMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlMCS1","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3402  fHistoEleLambdaPtvsV0dlMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlMCS2","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3404  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0MCS","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3406  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3408  fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3410  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3412  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3414  fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2 = new THnSparseF("fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2","",3,bins_elelamptvsv0dl,xmin_elelamptvsv0dl,xmax_elelamptvsv0dl);
3416 
3417  fHistoResponseElePt = new TH2D("fHistoResponseElePt","",100,0.,10.,100,0.,10.);
3419  fHistoResponseEleLambdaPt = new TH2D("fHistoResponseEleLambdaPt","",100,0.,20.,100,0.,20.);
3421 
3422  fHistonEvtvsRunNumber=new TH1F("fHistonEvtvsRunNumber","",20000,-0.5,19999.5);
3424  fHistonElevsRunNumber=new TH1F("fHistonElevsRunNumber","",20000,-0.5,19999.5);
3426  fHistonLambdavsRunNumber=new TH1F("fHistonLambdavsRunNumber","",20000,-0.5,19999.5);
3428 
3429  for(Int_t ih=0;ih<17;ih++){
3430  Int_t bins_eleptvscutvars[3];
3431  Double_t xmin_eleptvscutvars[3];
3432  Double_t xmax_eleptvscutvars[3];
3433 
3434  bins_eleptvscutvars[0] = 50;//electron pT bin
3435  xmin_eleptvscutvars[0] = 0.;
3436  xmax_eleptvscutvars[0] = 5.;
3437  bins_eleptvscutvars[2] = 10;//centrality bin
3438  xmin_eleptvscutvars[2] = 0.;
3439  xmax_eleptvscutvars[2] = 100.;
3440 
3441  if(ih==0 || ih==1){
3442  //0: TPC Ncluster 1: TPC ncluster PID
3443  bins_eleptvscutvars[1] = 40;
3444  xmin_eleptvscutvars[1] = 0.;
3445  xmax_eleptvscutvars[1] = 160.;
3446  }else if(ih==2 || ih==3){
3447  //2: nSigma(TPC,e) 3: nSigma(TOF,e)
3448  bins_eleptvscutvars[1] = 20;
3449  xmin_eleptvscutvars[1] = -5.;
3450  xmax_eleptvscutvars[1] = 5.;
3451  }else if(ih==4){
3452  //4: eta
3453  bins_eleptvscutvars[1] = 30;
3454  xmin_eleptvscutvars[1] = -1.5;
3455  xmax_eleptvscutvars[1] = 1.5;
3456  }else if(ih==5){
3457  //5: nITS cluster
3458  bins_eleptvscutvars[1] = 7;
3459  xmin_eleptvscutvars[1] = -0.5;
3460  xmax_eleptvscutvars[1] = 6.5;
3461  }else if(ih==6){
3462  //6: Lambda mass
3463  bins_eleptvscutvars[1] = 50;
3464  xmin_eleptvscutvars[1] = 1.1156-0.03;
3465  xmax_eleptvscutvars[1] = 1.1156+0.03;
3466  }else if(ih==7){
3467  //7: Rfid Lambda
3468  bins_eleptvscutvars[1] = 20;
3469  xmin_eleptvscutvars[1] = 0.;
3470  xmax_eleptvscutvars[1] = 5.;
3471  }else if(ih==8){
3472  //10: Dca V0
3473  bins_eleptvscutvars[1] = 20;
3474  xmin_eleptvscutvars[1] = 0.;
3475  xmax_eleptvscutvars[1] = 2.;
3476  }else if(ih==9 || ih==10 ){
3477  //9: DCA V0pr to prim 10: DCA V0pi to prim
3478  bins_eleptvscutvars[1] = 20;
3479  xmin_eleptvscutvars[1] = 0.;
3480  xmax_eleptvscutvars[1] = 0.5;
3481  }else if(ih==11){
3482  //11: CosPAv0
3483  bins_eleptvscutvars[1] = 20;
3484  xmin_eleptvscutvars[1] = 0.95;
3485  xmax_eleptvscutvars[1] = 1.0;
3486  }else if(ih==12){
3487  //12:K0s masss
3488  bins_eleptvscutvars[1] = 50;
3489  xmin_eleptvscutvars[1] = 0.497-0.03;
3490  xmax_eleptvscutvars[1] = 0.497+0.03;
3491  }else if(ih==13 || ih==14){
3492  //13: nSigmaTPC(pr), nSigma(pi)
3493  bins_eleptvscutvars[1] = 20;
3494  xmin_eleptvscutvars[1] = -5;
3495  xmax_eleptvscutvars[1] = 5;
3496  }else if(ih==15){
3497  //15: eta
3498  bins_eleptvscutvars[1] = 30;
3499  xmin_eleptvscutvars[1] = -1.5;
3500  xmax_eleptvscutvars[1] = 1.5;
3501  }else if(ih==16){
3502  //16: Opening angle
3503  bins_eleptvscutvars[1] = 20;
3504  xmin_eleptvscutvars[1] = 0.;
3505  xmax_eleptvscutvars[1] = 3.141592/2;
3506  }
3507 
3508  fHistoElePtvsCutVarsRS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsRS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
3510  fHistoElePtvsCutVarsWS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsWS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
3512  fHistoElePtvsCutVarsMCS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsMCS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
3514  }
3515 
3516  return;
3517 }
3518 
3519 //________________________________________________________________________
3520 AliAODRecoCascadeHF* AliAnalysisTaskSELc2eleLambdafromAODtracks::MakeCascadeHF(AliAODv0 *v0, AliAODTrack *part, AliAODEvent * aod, AliAODVertex *secVert)
3521 {
3525 
3526  if(!v0) return 0x0;
3527  if(!part) return 0x0;
3528  if(!aod) return 0x0;
3529 
3530  //------------------------------------------------
3531  // PrimaryVertex
3532  //------------------------------------------------
3533  AliAODVertex *primVertexAOD;
3534  Bool_t unsetvtx = kFALSE;
3536  primVertexAOD = CallPrimaryVertex(v0,part,aod);
3537  if(!primVertexAOD){
3538  primVertexAOD = fVtx1;
3539  }else{
3540  unsetvtx = kTRUE;
3541  }
3542  }else{
3543  primVertexAOD = fVtx1;
3544  }
3545  if(!primVertexAOD) return 0x0;
3546  Double_t posprim[3]; primVertexAOD->GetXYZ(posprim);
3547 
3548  //------------------------------------------------
3549  // DCA between tracks
3550  //------------------------------------------------
3551  AliESDtrack *esdtrack = new AliESDtrack((AliVTrack*)part);
3552 
3553  AliNeutralTrackParam *trackV0=NULL;
3554  const AliVTrack *trackVV0 = dynamic_cast<const AliVTrack*>(v0);
3555  if(trackVV0) trackV0 = new AliNeutralTrackParam(trackVV0);
3556 
3557  Double_t xdummy, ydummy;
3558  Double_t dca = esdtrack->GetDCA(trackV0,fBzkG,xdummy,ydummy);
3559 
3560 
3561  //------------------------------------------------
3562  // Propagate all tracks to the secondary vertex and calculate momentum there
3563  //------------------------------------------------
3564 
3565  Double_t d0z0bach[2],covd0z0bach[3];
3566  if(sqrt(pow(secVert->GetX(),2)+pow(secVert->GetY(),2))<1.){
3567  part->PropagateToDCA(secVert,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
3568  trackV0->PropagateToDCA(secVert,fBzkG,kVeryBig);
3569  }else{
3570  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
3571  trackV0->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig);
3572  }
3573  Double_t momv0_new[3]={-9999,-9999,-9999.};
3574  trackV0->GetPxPyPz(momv0_new);
3575 
3576  Double_t px[2],py[2],pz[2];
3577  px[0] = part->Px(); py[0] = part->Py(); pz[0] = part->Pz();
3578  px[1] = momv0_new[0]; py[1] = momv0_new[1]; pz[1] = momv0_new[2];
3579 
3580  //------------------------------------------------
3581  // d0
3582  //------------------------------------------------
3583  Double_t d0[3],d0err[3];
3584 
3585  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
3586  d0[0]= d0z0bach[0];
3587  d0err[0] = TMath::Sqrt(covd0z0bach[0]);
3588 
3589  Double_t d0z0v0[2],covd0z0v0[3];
3590  trackV0->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0v0,covd0z0v0);
3591  d0[1]= d0z0v0[0];
3592  d0err[1] = TMath::Sqrt(covd0z0v0[0]);
3593 
3594  //------------------------------------------------
3595  // Create AliAODRecoCascadeHF
3596  //------------------------------------------------
3597  Short_t charge = part->Charge();
3598  AliAODRecoCascadeHF *theCascade = new AliAODRecoCascadeHF(secVert,charge,px,py,pz,d0,d0err,dca);
3599  if(!theCascade)
3600  {
3601  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
3602  if(esdtrack) delete esdtrack;
3603  if(trackV0) delete trackV0;
3604  return 0x0;
3605  }
3606  theCascade->SetOwnPrimaryVtx(primVertexAOD);
3607  UShort_t id[2]={(UShort_t)part->GetID(),(UShort_t)trackV0->GetID()};
3608  theCascade->SetProngIDs(2,id);
3609 
3610  theCascade->GetSecondaryVtx()->AddDaughter(part);
3611  theCascade->GetSecondaryVtx()->AddDaughter(v0);
3612 
3613  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
3614  if(esdtrack) delete esdtrack;
3615  if(trackV0) delete trackV0;
3616 
3617  return theCascade;
3618 }
3619 
3620 //________________________________________________________________________
3621 AliAODVertex* AliAnalysisTaskSELc2eleLambdafromAODtracks::CallPrimaryVertex(AliAODv0 *v0, AliAODTrack *trk, AliAODEvent* aod)
3622 {
3623  //
3626  //
3627 
3628  TObjArray *TrackArray = new TObjArray(3);
3629 
3630  AliESDtrack *cptrk1 = new AliESDtrack((AliVTrack*)trk);
3631  TrackArray->AddAt(cptrk1,0);
3632 
3633  AliESDtrack *cascptrack = new AliESDtrack((AliVTrack*)v0->GetDaughter(0));
3634  TrackArray->AddAt(cascptrack,1);
3635  AliESDtrack *cascntrack = new AliESDtrack((AliVTrack*)v0->GetDaughter(1));
3636  TrackArray->AddAt(cascntrack,2);
3637 
3638  AliAODVertex *newvert = PrimaryVertex(TrackArray,aod);
3639 
3640  for(Int_t i=0;i<3;i++)
3641  {
3642  AliESDtrack *tesd = (AliESDtrack*)TrackArray->UncheckedAt(i);
3643  delete tesd;
3644  }
3645  TrackArray->Clear();
3646  delete TrackArray;
3647 
3648  return newvert;
3649 }
3650 
3651 //________________________________________________________________________
3652 AliAODVertex* AliAnalysisTaskSELc2eleLambdafromAODtracks::PrimaryVertex(const TObjArray *trkArray,
3653  AliVEvent *event)
3654 {
3655  //
3658  //
3659 
3660  Bool_t fRecoPrimVtxSkippingTrks = kTRUE;
3661  Bool_t fRmTrksFromPrimVtx = kFALSE;
3662 
3663  AliESDVertex *vertexESD = 0;
3664  AliAODVertex *vertexAOD = 0;
3665 
3666  //vertexESD = new AliESDVertex(*fV1);
3667 
3668 
3669  if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) {
3670  // primary vertex from the input event
3671 
3672  vertexESD = new AliESDVertex(*fV1);
3673 
3674  } else {
3675  // primary vertex specific to this candidate
3676 
3677  Int_t nTrks = trkArray->GetEntriesFast();
3678  AliVertexerTracks *vertexer = new AliVertexerTracks(event->GetMagneticField());
3679 
3680  if(fRecoPrimVtxSkippingTrks) {
3681  // recalculating the vertex
3682 
3683  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraint")) {
3684  Float_t diamondcovxy[3];
3685  event->GetDiamondCovXY(diamondcovxy);
3686  Double_t pos[3]={event->GetDiamondX(),event->GetDiamondY(),0.};
3687  Double_t cov[6]={diamondcovxy[0],diamondcovxy[1],diamondcovxy[2],0.,0.,10.*10.};
3688  AliESDVertex *diamond = new AliESDVertex(pos,cov,1.,1);
3689  vertexer->SetVtxStart(diamond);
3690  delete diamond; diamond=NULL;
3691  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraintOnlyFitter"))
3692  vertexer->SetOnlyFitter();
3693  }
3694  Int_t skipped[1000];
3695  Int_t nTrksToSkip=0,id;
3696  AliExternalTrackParam *t = 0;
3697  for(Int_t i=0; i<nTrks; i++) {
3698  t = (AliExternalTrackParam*)trkArray->UncheckedAt(i);
3699  id = (Int_t)t->GetID();
3700  if(id<0) continue;
3701  skipped[nTrksToSkip++] = id;
3702  }
3703  // TEMPORARY FIX
3704  // For AOD, skip also tracks without covariance matrix
3705  Double_t covtest[21];
3706  for(Int_t j=0; j<event->GetNumberOfTracks(); j++) {
3707  AliVTrack *vtrack = (AliVTrack*)event->GetTrack(j);
3708  if(!vtrack->GetCovarianceXYZPxPyPz(covtest)) {
3709  id = (Int_t)vtrack->GetID();
3710  if(id<0) continue;
3711  skipped[nTrksToSkip++] = id;
3712  }
3713  }
3714  for(Int_t ijk=nTrksToSkip; ijk<1000; ijk++) skipped[ijk]=-1;
3715  //
3716  vertexer->SetSkipTracks(nTrksToSkip,skipped);
3717  vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(event);
3718 
3719  } else if(fRmTrksFromPrimVtx && nTrks>0) {
3720  // removing the prongs tracks
3721 
3722  TObjArray rmArray(nTrks);
3723  UShort_t *rmId = new UShort_t[nTrks];
3724  AliESDtrack *esdTrack = 0;
3725  AliESDtrack *t = 0;
3726  for(Int_t i=0; i<nTrks; i++) {
3727  t = (AliESDtrack*)trkArray->UncheckedAt(i);
3728  esdTrack = new AliESDtrack(*t);
3729  rmArray.AddLast(esdTrack);
3730  if(esdTrack->GetID()>=0) {
3731  rmId[i]=(UShort_t)esdTrack->GetID();
3732  } else {
3733  rmId[i]=9999;
3734  }
3735  }
3736  Float_t diamondxy[2]={static_cast<Float_t>(event->GetDiamondX()),static_cast<Float_t>(event->GetDiamondY())};
3737  vertexESD = vertexer->RemoveTracksFromVertex(fV1,&rmArray,rmId,diamondxy);
3738  delete [] rmId; rmId=NULL;
3739  rmArray.Delete();
3740 
3741  }
3742 
3743  delete vertexer; vertexer=NULL;
3744  if(!vertexESD) return vertexAOD;
3745  if(vertexESD->GetNContributors()<=0) {
3746  //AliDebug(2,"vertexing failed");
3747  delete vertexESD; vertexESD=NULL;
3748  return vertexAOD;
3749  }
3750 
3751 
3752  }
3753 
3754  // convert to AliAODVertex
3755  Double_t pos[3],cov[6],chi2perNDF;
3756  vertexESD->GetXYZ(pos); // position
3757  vertexESD->GetCovMatrix(cov); //covariance matrix
3758  chi2perNDF = vertexESD->GetChi2toNDF();
3759  delete vertexESD; vertexESD=NULL;
3760 
3761  vertexAOD = new AliAODVertex(pos,cov,chi2perNDF);
3762 
3763  return vertexAOD;
3764 }
3765 
3766 //________________________________________________________________________
3767 AliAODVertex* AliAnalysisTaskSELc2eleLambdafromAODtracks::ReconstructSecondaryVertex(AliAODv0 *v0, AliAODTrack *part, AliAODEvent * aod)
3768 {
3769  //
3770  // Reconstruct secondary vertex from trkArray (Copied from AliAnalysisVertexingHF)
3771  // Currently only returns Primary vertex (can we reconstruct secondary vertex from e - v0??)
3772  //
3773 
3774  AliAODVertex *primVertexAOD;
3775  Bool_t unsetvtx = kFALSE;
3777  primVertexAOD = CallPrimaryVertex(v0,part,aod);
3778  if(!primVertexAOD){
3779  primVertexAOD = fVtx1;
3780  }else{
3781  unsetvtx = kTRUE;
3782  }
3783  }else{
3784  primVertexAOD = fVtx1;
3785  }
3786  if(!primVertexAOD) return 0x0;
3787 
3788  AliESDVertex * vertexESD = new AliESDVertex(*fV1);
3789 
3790  Double_t pos[3],cov[6],chi2perNDF;
3791  vertexESD->GetXYZ(pos); // position
3792  vertexESD->GetCovMatrix(cov); //covariance matrix
3793  chi2perNDF = vertexESD->GetChi2toNDF();
3794  delete vertexESD; vertexESD=NULL;
3795 
3796  AliAODVertex *secVert = new AliAODVertex(pos,cov,chi2perNDF);
3797 
3798  return secVert;
3799 }
3800 //________________________________________________________________________
3801 Int_t AliAnalysisTaskSELc2eleLambdafromAODtracks::MatchToMC(AliAODRecoCascadeHF *elobj, TClonesArray *mcArray, Int_t *pdgarray_ele, Int_t *pdgarray_v0, Int_t *labelarray_ele, Int_t *labelarray_v0, Int_t &ngen_ele, Int_t &ngen_v0)
3802 {
3803  //
3804  // Match to MC
3805  //
3806  for(Int_t i=0;i<100;i++){
3807  pdgarray_ele[i] = -9999;
3808  labelarray_ele[i] = -9999;
3809  pdgarray_v0[i] = -9999;
3810  labelarray_v0[i] = -9999;
3811  }
3812  ngen_ele = 0;
3813  ngen_v0 = 0;
3814 
3815  AliVTrack *trk = dynamic_cast<AliVTrack*>(elobj->GetBachelor());
3816  if(!trk) return -1;
3817  Int_t labEle = trk->GetLabel();
3818  if(labEle<0) return -1;
3819  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
3820  if(!mcetrk) return -1;
3821  labelarray_ele[0] = labEle;
3822  pdgarray_ele[0] = mcetrk->GetPdgCode();
3823  ngen_ele ++;
3824 
3825  AliAODMCParticle *mcprimele=0;
3826  mcprimele = mcetrk;
3827  while(mcprimele->GetMother()>=0) {
3828  Int_t labprim_ele=mcprimele->GetMother();
3829  AliAODMCParticle *tmcprimele = (AliAODMCParticle*)mcArray->At(labprim_ele);
3830  if(!tmcprimele) {
3831  break;
3832  }
3833 
3834  mcprimele = tmcprimele;
3835  pdgarray_ele[ngen_ele] = mcprimele->GetPdgCode();
3836  labelarray_ele[ngen_ele] = labprim_ele;
3837  ngen_ele ++;
3838  if(ngen_ele==100) break;
3839  }
3840 
3841  AliAODv0 *theV0 = dynamic_cast<AliAODv0*>(elobj->Getv0());
3842  if(!theV0) return -1;
3843  Int_t pdgdgv0[2]={2212,211};
3844  Int_t labV0 = theV0->MatchToMC(3122,mcArray,2,pdgdgv0); // the V0
3845  if(labV0<0) return -1;
3846  AliAODMCParticle *mcv0 = (AliAODMCParticle*)mcArray->At(labV0);
3847  if(!mcv0) return -1;
3848  labelarray_v0[0] = labV0;
3849  pdgarray_v0[0] = mcv0->GetPdgCode();
3850  ngen_v0 ++;
3851 
3852  AliAODMCParticle *mcprimv0=0;
3853  mcprimv0 = mcv0;
3854  while(mcprimv0->GetMother()>=0) {
3855  Int_t labprim_v0=mcprimv0->GetMother();
3856  AliAODMCParticle *tmcprimv0 = (AliAODMCParticle*)mcArray->At(labprim_v0);
3857  if(!tmcprimv0) {
3858  break;
3859  }
3860 
3861  mcprimv0 = tmcprimv0;
3862  pdgarray_v0[ngen_v0] = mcprimv0->GetPdgCode();
3863  labelarray_v0[ngen_v0] = labprim_v0;
3864  ngen_v0 ++;
3865  if(ngen_v0==100) break;
3866  }
3867 
3868  Bool_t same_flag = kFALSE;
3869  Int_t matchedlabel=-9999;
3870  for(Int_t iemc=0;iemc<ngen_ele;iemc++){
3871  for(Int_t ivmc=0;ivmc<ngen_v0;ivmc++){
3872  if(labelarray_ele[iemc]==labelarray_v0[ivmc]){
3873  same_flag = kTRUE;
3874  matchedlabel = labelarray_ele[iemc];
3875  break;
3876  }
3877  }
3878  if(same_flag) break;
3879  }
3880 
3881  return matchedlabel;
3882 
3883 }
3884 //________________________________________________________________________
3885 void AliAnalysisTaskSELc2eleLambdafromAODtracks::SelectTrack( const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks,Bool_t *seleFlags, TClonesArray *mcArray)
3886 {
3887  //
3888  // Select good tracks using fAnalCuts (AliRDHFCuts object) and return the array of their ids
3889  //
3890 
3891  if(trkEntries==0) return;
3892 
3893  nSeleTrks=0;
3894  for(Int_t i=0; i<trkEntries; i++) {
3895  seleFlags[i] = kFALSE;
3896 
3897  AliVTrack *track;
3898  track = (AliVTrack*)event->GetTrack(i);
3899 
3900  if(track->GetID()<0) continue;
3901  Double_t covtest[21];
3902  if(!track->GetCovarianceXYZPxPyPz(covtest)) continue;
3903 
3904  AliAODTrack *aodt = (AliAODTrack*)track;
3905  Double_t nsigma_tpcele = -9999;
3906  Double_t nsigma_tofele = -9999;
3907  if(fAnalCuts->GetIsUsePID()){
3908  nsigma_tpcele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(aodt,AliPID::kElectron);
3909  nsigma_tofele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(aodt,AliPID::kElectron);
3910  }
3911 
3912  if(!fAnalCuts) continue;
3913  if(fAnalCuts->SingleTrkCutsNoPID(aodt,fVtx1)){
3914  fHistoElectronTPCPID->Fill(aodt->Pt(),nsigma_tpcele);
3915  fHistoElectronTOFPID->Fill(aodt->Pt(),nsigma_tofele);
3916  if(fabs(nsigma_tofele)<3.){
3917  fHistoElectronTPCPIDSelTOF->Fill(aodt->Pt(),nsigma_tpcele);
3918  Double_t eleeta = aodt->Eta();
3919  if(fabs(eleeta)<0.6)
3920  fHistoElectronTPCPIDSelTOFSmallEta->Fill(aodt->Pt(),nsigma_tpcele);
3921  if(fabs(eleeta)>0.6 && fabs(eleeta)<0.8)
3922  fHistoElectronTPCPIDSelTOFLargeEta->Fill(aodt->Pt(),nsigma_tpcele);
3923  if(eleeta>-0.8 && eleeta<-0.6){
3924  fHistoElectronTPCPIDSelTOFEtaDep[0]->Fill(aodt->Pt(),nsigma_tpcele);
3925  }else if(eleeta>-0.6&&eleeta<-0.4){
3926  fHistoElectronTPCPIDSelTOFEtaDep[1]->Fill(aodt->Pt(),nsigma_tpcele);
3927  }else if(eleeta>-0.4&&eleeta<-0.2){
3928  fHistoElectronTPCPIDSelTOFEtaDep[2]->Fill(aodt->Pt(),nsigma_tpcele);
3929  }else if(eleeta>-0.2&&eleeta<0.0){
3930  fHistoElectronTPCPIDSelTOFEtaDep[3]->Fill(aodt->Pt(),nsigma_tpcele);
3931  }else if(eleeta>0.0&&eleeta<0.2){
3932  fHistoElectronTPCPIDSelTOFEtaDep[4]->Fill(aodt->Pt(),nsigma_tpcele);
3933  }else if(eleeta>0.2&&eleeta<0.4){
3934  fHistoElectronTPCPIDSelTOFEtaDep[5]->Fill(aodt->Pt(),nsigma_tpcele);
3935  }else if(eleeta>0.4&&eleeta<0.6){
3936  fHistoElectronTPCPIDSelTOFEtaDep[6]->Fill(aodt->Pt(),nsigma_tpcele);
3937  }else if(eleeta>0.6&&eleeta<0.8){
3938  fHistoElectronTPCPIDSelTOFEtaDep[7]->Fill(aodt->Pt(),nsigma_tpcele);
3939  }
3940  }
3941  }
3942  if(fAnalCuts->SingleTrkCuts(aodt,fVtx1)){
3943  seleFlags[i]=kTRUE;
3944  nSeleTrks++;
3945  fHistoElectronTPCSelPID->Fill(aodt->Pt(),nsigma_tpcele);
3946  fHistoElectronTOFSelPID->Fill(aodt->Pt(),nsigma_tofele);
3947  FillElectronROOTObjects(aodt,mcArray);
3948  }
3949 
3950  } // end loop on tracks
3951 }
3952 //________________________________________________________________________
3953 void AliAnalysisTaskSELc2eleLambdafromAODtracks::SelectV0( const AliVEvent *event,Int_t nV0s,Int_t &nSeleV0, Bool_t *seleV0Flags, TClonesArray *mcArray)
3954 {
3955  //
3956  // Select good V0 using fAnalCuts (AliRDHFCuts object) and return the array of their ids
3957  //
3958 
3959  nSeleV0 = 0;
3960  for(Int_t iv0=0;iv0<nV0s;iv0++)
3961  {
3962  seleV0Flags[iv0] = kFALSE;
3963  AliAODv0 *v0 = ((AliAODEvent*)event)->GetV0(iv0);
3964 
3965  if(!fAnalCuts) continue;
3966  if(fAnalCuts->SingleV0Cuts(v0,fVtx1)){
3967  seleV0Flags[iv0] = kTRUE;
3968  nSeleV0++;
3969 
3970  FillV0ROOTObjects(v0, mcArray);
3971  }
3972  }
3973 }
3974 //_________________________________________________________________
3976  //
3977  // check in which of the pools the current event falls
3978  //
3979 
3980  Int_t theBinZ=TMath::BinarySearch(fNzVtxBins,fZvtxBins,zvert);
3981  if(theBinZ<0 || theBinZ>=fNzVtxBins) return -1;
3982  Int_t theBinM=TMath::BinarySearch(fNCentBins,fCentBins,mult);
3983  if(theBinM<0 || theBinM>=fNCentBins) return -1;
3984  return fNCentBins*theBinZ+theBinM;
3985 }
3986 //_________________________________________________________________
3988  //
3989  // delete the contets of the pool
3990  //
3991  if(poolIndex<0 || poolIndex>=fNOfPools) return;
3992  delete fEventBuffer[poolIndex];
3993  fEventBuffer[poolIndex]=new TTree(Form("EventBuffer_%d",poolIndex), "Temporary buffer for event mixing");
3994 
3995  fEventBuffer[poolIndex]->Branch("zVertex", &fVtxZ);
3996  fEventBuffer[poolIndex]->Branch("centrality", &fCentrality);
3997  fEventBuffer[poolIndex]->Branch("eventInfo", "TObjString",&fEventInfo);
3998  fEventBuffer[poolIndex]->Branch("v1array", "TObjArray", &fV0Tracks1);
3999  fEventBuffer[poolIndex]->Branch("v2array", "TObjArray", &fV0Tracks2);
4000  fEventBuffer[poolIndex]->Branch("vdl1array", &fV0dlArray1);
4001  fEventBuffer[poolIndex]->Branch("vdl2array", &fV0dlArray2);
4002  fEventBuffer[poolIndex]->Branch("vdca1array", &fV0dcaArray1);
4003  fEventBuffer[poolIndex]->Branch("vdca2array", &fV0dcaArray2);
4004 
4005  return;
4006 }
4007 //_________________________________________________________________
4009 {
4010  //
4011  // perform mixed event analysis
4012  //
4013 
4014  if(poolIndex<0 || poolIndex>fNzVtxBins*fNCentBins) return;
4015  if(fEventBuffer[poolIndex]->GetEntries()<fNumberOfEventsForMixing) return;
4016 
4017  Int_t nEle = fElectronTracks->GetEntries();
4018  Int_t nEvents=fEventBuffer[poolIndex]->GetEntries();
4019 
4020  TObjArray* v1array=0x0;
4021  TObjArray* v2array=0x0;
4022  std::vector<Double_t>* vdl1array=0x0;
4023  std::vector<Double_t>* vdl2array=0x0;
4024  std::vector<Double_t>* vdca1array=0x0;
4025  std::vector<Double_t>* vdca2array=0x0;
4026  Float_t zVertex,cent;
4027  TObjString* eventInfo=0x0;
4028  fEventBuffer[poolIndex]->SetBranchAddress("eventInfo",&eventInfo);
4029  fEventBuffer[poolIndex]->SetBranchAddress("zVertex", &zVertex);
4030  fEventBuffer[poolIndex]->SetBranchAddress("centrality", &cent);
4031  fEventBuffer[poolIndex]->SetBranchAddress("v1array", &v1array);
4032  fEventBuffer[poolIndex]->SetBranchAddress("v2array", &v2array);
4033  fEventBuffer[poolIndex]->SetBranchAddress("vdl1array", &vdl1array);
4034  fEventBuffer[poolIndex]->SetBranchAddress("vdl2array", &vdl2array);
4035  fEventBuffer[poolIndex]->SetBranchAddress("vdca1array", &vdca1array);
4036  fEventBuffer[poolIndex]->SetBranchAddress("vdca2array", &vdca2array);
4037  for (Int_t i=0; i<nEle; i++)
4038  {
4039  TLorentzVector* trke=(TLorentzVector*) fElectronTracks->At(i);
4040  if(!trke)continue;
4041 
4042  for(Int_t iEv=0; iEv<fNumberOfEventsForMixing; iEv++){
4043  fEventBuffer[poolIndex]->GetEvent(iEv + nEvents - fNumberOfEventsForMixing);
4044 
4045  TObjArray* v1array1=(TObjArray*)v1array->Clone();
4046  Int_t nV01=v1array1->GetEntries();
4047  Int_t nV01_test=vdl1array->size();
4048  if(nV01 != nV01_test){
4049  cout<<"Something is wrong"<<endl;
4050  exit(1);
4051  }
4052  for(Int_t iTr1=0; iTr1<nV01; iTr1++){
4053  TLorentzVector* v01=(TLorentzVector*)v1array1->At(iTr1);
4054  if(!v01 ) continue;
4055  Double_t v0info1[2];
4056  v0info1[0] = vdl1array->at(iTr1);
4057  v0info1[1] = vdca1array->at(iTr1);
4058  FillMixROOTObjects(trke,v01,v0info1,1);
4059  }//v0 loop
4060 
4061  TObjArray* v2array1=(TObjArray*)v2array->Clone();
4062  Int_t nV02=v2array1->GetEntries();
4063  Int_t nV02_test=vdl2array->size();
4064  if(nV02 != nV02_test){
4065  cout<<"Something is wrong"<<endl;
4066  exit(1);
4067  }
4068  for(Int_t iTr2=0; iTr2<nV02; iTr2++){
4069  TLorentzVector* v02=(TLorentzVector*)v2array1->At(iTr2);
4070  if(!v02 ) continue;
4071  Double_t v0info2[2];
4072  v0info2[0] = vdl2array->at(iTr2);
4073  v0info2[1] = vdca2array->at(iTr2);
4074  FillMixROOTObjects(trke,v02,v0info2,-1);
4075  }//v0 loop
4076 
4077  delete v1array1;
4078  delete v2array1;
4079  }//event loop
4080 
4081  }//track loop
4082 }
4083 //_________________________________________________________________
4085 {
4086  //
4087  // Analyze AliAODmcparticle
4088  //
4089 
4090  Int_t nmcpart = mcArray->GetEntriesFast();
4091  for(Int_t i=0;i<nmcpart;i++)
4092  {
4093  AliAODMCParticle *mcpart = (AliAODMCParticle*) mcArray->At(i);
4094  if(TMath::Abs(mcpart->GetPdgCode())==4122){
4095  //cout<<"Lambdac"<<endl;
4096  Bool_t e_flag = kFALSE;
4097  Bool_t lam_flag = kFALSE;
4098  AliAODMCParticle *mcepart = 0;
4099  AliAODMCParticle *mcv0part = 0;
4100  for(Int_t idau=mcpart->GetFirstDaughter();idau<mcpart->GetLastDaughter()+1;idau++)
4101  {
4102  if(idau<0) break;
4103  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
4104  if(!mcdau) continue;
4105  if(TMath::Abs(mcdau->GetPdgCode())==11){
4106  e_flag = kTRUE;
4107  mcepart = mcdau;
4108  }
4109  if(TMath::Abs(mcdau->GetPdgCode())==3122){
4110  lam_flag = kTRUE;
4111  mcv0part = mcdau;
4112  }
4113  }
4114 
4115  Int_t decaytype = -9999;
4116  if(e_flag && lam_flag) decaytype = 0;
4117 
4118  FillMCROOTObjects(mcpart,mcepart,mcv0part,decaytype);
4119  }
4120  if(TMath::Abs(mcpart->GetPdgCode())==4132){
4121  //cout<<"Lambdac"<<endl;
4122  Bool_t e_flag = kFALSE;
4123  Bool_t xi_flag = kFALSE;
4124  Bool_t lam_flag = kFALSE;
4125  AliAODMCParticle *mcepart = 0;
4126  AliAODMCParticle *mccascpart = 0;
4127  AliAODMCParticle *mcv0part = 0;
4128  for(Int_t idau=mcpart->GetFirstDaughter();idau<mcpart->GetLastDaughter()+1;idau++)
4129  {
4130  if(idau<0) break;
4131  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
4132  if(!mcdau) continue;
4133  if(TMath::Abs(mcdau->GetPdgCode())==11){
4134  e_flag = kTRUE;
4135  mcepart = mcdau;
4136  }
4137  if(TMath::Abs(mcdau->GetPdgCode())==3312){
4138  xi_flag = kTRUE;
4139  mccascpart = mcdau;
4140  for(Int_t idauxi=mccascpart->GetFirstDaughter();idauxi<mccascpart->GetLastDaughter()+1;idauxi++)
4141  {
4142  if(idauxi<0) break;
4143  AliAODMCParticle *mcdauxi = (AliAODMCParticle*) mcArray->At(idauxi);
4144  if(!mcdauxi) continue;
4145  if(TMath::Abs(mcdauxi->GetPdgCode())==3122){
4146  lam_flag = kTRUE;
4147  mcv0part = mcdauxi;
4148  }
4149  }
4150  }
4151  }
4152  Int_t decaytype = -9999;
4153  if(e_flag && xi_flag && lam_flag) decaytype = 1;
4154 
4155  FillMCROOTObjects(mcpart,mcepart,mcv0part,decaytype);
4156  }
4157  if(TMath::Abs(mcpart->GetPdgCode())==4232){
4158  //cout<<"Lambdac"<<endl;
4159  Bool_t e_flag = kFALSE;
4160  Bool_t xi_flag = kFALSE;
4161  Bool_t lam_flag = kFALSE;
4162  AliAODMCParticle *mcepart = 0;
4163  AliAODMCParticle *mccascpart = 0;
4164  AliAODMCParticle *mcv0part = 0;
4165  for(Int_t idau=mcpart->GetFirstDaughter();idau<mcpart->GetLastDaughter()+1;idau++)
4166  {
4167  if(idau<0) break;
4168  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
4169  if(!mcdau) continue;
4170  if(TMath::Abs(mcdau->GetPdgCode())==11){
4171  e_flag = kTRUE;
4172  mcepart = mcdau;
4173  }
4174  if(TMath::Abs(mcdau->GetPdgCode())==3322){
4175  xi_flag = kTRUE;
4176  mccascpart = mcdau;
4177  for(Int_t idauxi=mccascpart->GetFirstDaughter();idauxi<mccascpart->GetLastDaughter()+1;idauxi++)
4178  {
4179  if(idauxi<0) break;
4180  AliAODMCParticle *mcdauxi = (AliAODMCParticle*) mcArray->At(idauxi);
4181  if(!mcdauxi) continue;
4182  if(TMath::Abs(mcdauxi->GetPdgCode())==3122){
4183  lam_flag = kTRUE;
4184  mcv0part = mcdauxi;
4185  }
4186  }
4187  }
4188  }
4189  Int_t decaytype = -9999;
4190  if(e_flag && xi_flag && lam_flag) decaytype = 2;
4191 
4192  FillMCROOTObjects(mcpart,mcepart,mcv0part,decaytype);
4193  }
4194 
4195  if(TMath::Abs(mcpart->GetPdgCode())==11 && mcpart->GetStatus()==1){
4196  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
4197  Float_t etamin, etamax;
4198  esdcuts->GetEtaRange(etamin,etamax);
4199  if(fabs(mcpart->Eta())<etamax){
4200  fHistoBachPtMCGen->Fill(mcpart->Pt());
4201  }
4202  FillMCEleROOTObjects(mcpart, mcArray);
4203  }
4204  if(TMath::Abs(mcpart->GetPdgCode())==3122){
4205  Double_t etamin, etamax, rapmin, rapmax;
4206  fAnalCuts->GetProdV0EtaRange(etamin,etamax);
4207  fAnalCuts->GetProdV0RapRange(rapmin,rapmax);
4208 
4209  if((fabs(mcpart->Y())<rapmax) && (fabs(mcpart->Eta())<etamax)){
4210  fHistoLambdaMassvsPtMCGen->Fill(1.115683, mcpart->Pt());
4211  }
4212  FillMCV0ROOTObjects(mcpart, mcArray);
4213  }
4214  }
4215  return;
4216 }
Int_t charge
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2
! EFficiency calculation numerator
Bool_t SingleV0Cuts(AliAODv0 *v0, AliAODVertex *vert)
THnSparse * fHistoEleLambdaMassvsElePtRSMix1
! e-Lambda mass vs elept spectra right sign (mixed event)
THnSparse * fHistoEleLambdaMassMCGen
! EFficiency calculation denominator
THnSparse * fHistoEleLambdaPtvsV0dlRS2
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaMassvsElePtRSMix
! e-Lambda mass vs elept spectra right sign (mixed event)
TH2F * fHistoElectronTOFSelPID
! TOF electron PID after selection
THnSparse * fHistoElePtvsV0dlFeedDownXic0MCS1
! Feeddown subtraction using Lambda vertex distribution
TH2F * fHistoElePtRSMix
! e spectra right sign (mixed event)
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Bool_t fIsMB
Reconstruct primary vertex excluding candidate tracks.
THnSparse * fHistoEleLambdaPtvsV0dlWSMix1
! Feeddown subtraction using Lambda vertex distribution
TObjArray * fElectronTracks
unique event id for mixed event check
THnSparse * fHistoElePtvsV0dlWSSide
! Feeddown subtraction using Lambda vertex distribution
virtual void UserCreateOutputObjects()
Implementation of interface methods.
THnSparse * fHistoElePtvsLambdaPtRSMix
! e-Xi spectra (right-sign, mix)
THnSparse * fHistoElePtvsLambdaPtMCGen
! e-Xi spectra efficiency denominator
THnSparse * fHistoEleLambdaMassvsElePtWS2
! e-Lambda mass vs elept spectra wrong sign
THnSparse * fHistoElePtvsV0dcaMCS
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsV0dlWS1
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsV0dlWSSide2
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS
! EFficiency calculation numerator
TTree * fVariablesTree
flag to decide whether to write the candidate variables on a tree variables
TObjArray * fV0Tracks2
array of lambda-compatible tracks
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen
! EFficiency calculation numerator
TH2F * fHistoElectronTPCPIDSelTOFSmallEta
! TPC electron PID after TOF 3 sigma cut (|eta|<0.6)
THnSparse * fHistoElePtvsV0dlRSSide
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaMassRSMix
! e-Lambda mass spectra right sign (mixed event)
THnSparse * fHistoEleLambdaPtvsV0dlRSMix
! Feeddown subtraction using Lambda vertex distribution
Int_t fNzVtxBins
maximum number of events to be used in event mixing
TH2D * fHistoResponseElePt
! Response function electron pT <- True ept
THnSparse * fHistoElePtvsV0dlMCS
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaMassvsElePtWSMix1
! e-Lambda mass vs elept spectra wrong sign (mixed event)
THnSparse * fHistoElePtvsV0dcaFeedDownXic0MCS2
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaPtvsV0dlFeedDownXic0MCS1
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsV0dcaWSMix2
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaMassvsElePtRSMix2
! e-Lambda mass vs elept spectra right sign (mixed event)
TTree * fMCVariablesTree
! tree of the candidate variables after track selection on output slot 4
THnSparse * fHistoEleLambdaPtvsV0dlRS1
! Feeddown subtraction using Lambda vertex distribution
Float_t * fCandidateMCEleVariables
! variables to be written to the tree
void FillMCROOTObjects(AliAODMCParticle *part, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype)
THnSparse * fHistoElePtvsV0dcaFeedDownXic0MCS1
! Feeddown subtraction using Lambda vertex distribution
void FillMixROOTObjects(TLorentzVector *et, TLorentzVector *ev, Double_t *v0info, Int_t charge)
THnSparse * fHistoEleLambdaPtvsV0dlMCS1
! Feeddown subtraction using Lambda vertex distribution
void FillMCV0ROOTObjects(AliAODMCParticle *mcv0part, TClonesArray *mcArray)
THnSparse * fHistoElePtvsd0RSMix
! e pt-d0 spectra (right-sign, mix)
THnSparse * fHistoElePtvsV0dlFeedDownXicPlusMCS
! Feeddown subtraction using Lambda vertex distribution
AliAODv0 * Getv0() const
THnSparse * fHistoEleLambdaPtvsV0dlMCS
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsV0dlFeedDownXicPlusMCS1
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaMassvsElePtRSSide1
! e-Lambda mass vs elept spectra right sign (mixed event)
TList * fOutputAll
! User Output slot 3 //analysis histograms
THnSparse * fHistoElePtvsV0dcaRS
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsV0dcaWS2
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaMassvsElePtRS
! e-Lambda mass vs elept spectra right sign
THnSparse * fHistoElePtvsV0dcaWSMix
! Feeddown subtraction using Lambda vertex distribution
TH2F * fHistoElePtFeeddownXicPlusMCS
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassFeeddownXic0MCGen
! EFficiency calculation numerator
THnSparse * fHistoElePtvsV0dcaFeedDownXicPlusMCS2
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaMassvsElePtRS1
! e-Lambda mass vs elept spectra right sign
AliAODVertex * PrimaryVertex(const TObjArray *trkArray, AliVEvent *event)
THnSparse * fHistoElePtvsLambdaPtFeeddownXic0MCS
! e-Xi spectra efficiency numerator
THnSparse * fHistoEleLambdaMassMCS
! EFficiency calculation numerator
TH2F * fHistoElePtMCGen
! EFficiency calculation denominator
TH2F * fHistoElePtWSMix
! e spectra wrong sign (mixed event)
void FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
THnSparse * fHistoEleLambdaPtvsV0dlRSSide2
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsd0PromptMCS
! e pt-d0 spectra (right-sign)
THnSparse * fHistoEleLambdaMassFeeddownXicPlusMCS
! EFficiency calculation numerator
THnSparse * fHistoElePtvsV0dcaWS1
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2
! EFficiency calculation numerator
THnSparse * fHistoElePtvsV0dcaRSMix1
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS2
! Feeddown subtraction using Lambda vertex distribution
Float_t * fCandidateMCVariables
! variables to be written to the tree
THnSparse * fHistoElePtvsLambdaPtFeeddownXic0MCGen
! e-Xi spectra efficiency numerator
Double_t GetMaxVtxZ() const
Definition: AliRDHFCuts.h:241
THnSparse * fHistoEleLambdaPtvsV0dlWSMix2
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsCutVarsWS[17]
! e pt- cut variables (Wrong-sign)
THnSparse * fHistoElePtvsLambdaPtMCS
! e-Xi spectra efficiency numerator
THnSparse * fHistoEleLambdaMassvsElePtWSSide
! e-Lambda mass vs elept spectra wrong sign (mixed event)
THnSparse * fHistoEleLambdaMassFeeddownXic0MCS
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassWS
! e-Lambda mass spectra wrong sign
THnSparse * fHistoElePtvsV0dlWSMix
! Feeddown subtraction using Lambda vertex distribution
AliAODPidHF * GetPidHF() const
Definition: AliRDHFCuts.h:231
Bool_t fWriteMCVariableTree
flag to decide whether to write the candidate variables on a tree variables
THnSparse * fHistoElePtvsV0dlFeedDownXic0MCS2
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsV0dcaRSMix2
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCS1
! EFficiency calculation numerator
THnSparse * fHistoElePtvsV0dcaWSSide2
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsEtaMCGen
! e spectra efficiency denominator
THnSparse * fHistoEleLambdaPtvsV0dlWSSide
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElectronMCGen
! electron in mcArray (only from charmed baryon)
THnSparse * fHistoElePtvsV0dlRSSide2
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsd0BFeeddownMCS
! e pt-d0 spectra (right-sign)
const Double_t etamin
THnSparse * fHistoEleLambdaPtvsV0dlWS
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaMassvsElePtWSMix2
! e-Lambda mass vs elept spectra wrong sign (mixed event)
THnSparse * fHistoElePtvsV0dlRS
! Feeddown subtraction using Lambda vertex distribution
void SelectTrack(const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks, Bool_t *seleFlags, TClonesArray *mcArray)
THnSparse * fHistoElePtvsV0dcaRSSide
! Feeddown subtraction using Lambda vertex distribution
Bool_t fWriteEachVariableTree
flag to decide whether to write the candidate variables on a tree variables
std::vector< Double_t > fV0dcaArray1
array of antilambda-compatible tracks' information
Float_t * fCandidateMCV0Variables
! variables to be written to the tree
TH2D * fHistoResponseEleLambdaPt
! Response function e-Lambda pT <- XicPt
THnSparse * fHistoEleLambdaPtvsV0dlMCS2
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaPtvsV0dlWSMix
! Feeddown subtraction using Lambda vertex distribution
void FillElectronROOTObjects(AliAODTrack *trk, TClonesArray *mcArray)
TH2F * fHistoElectronTPCPIDSelTOFLargeEta
! TPC electron PID after TOF 3 sigma cut (0.8>|eta|>0.6)
THnSparse * fHistoElePtvsV0dlWSSide1
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaMassRSSide
! e-Lambda mass spectra right sign (mixed event)
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCGen
! EFficiency calculation numerator
THnSparse * fHistoElePtvsV0dcaRSSide2
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCS2
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaPtvsV0dlWS2
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsV0dlRS1
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsV0dlRS2
! Feeddown subtraction using Lambda vertex distribution
TH2F * fHistoElePtFeeddownXicPlusMCGen
! EFficiency calculation numerator
AliAODTrack * GetBachelor() const
THnSparse * fHistoEleLambdaMassvsElePtRSSide
! e-Lambda mass vs elept spectra right sign (mixed event)
TH2F * fHistoElePtFeeddownXic0MCGen
! EFficiency calculation numerator
void FillROOTObjects(AliAODRecoCascadeHF *elobj, AliAODv0 *v0, AliAODTrack *trk, TClonesArray *mcArray)
THnSparse * fHistoElePtvsV0dlMCS1
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsCutVarsRS[17]
! e pt- cut variables (Right-sign)
THnSparse * fHistoElePtvsLambdaPtWSMix
! e-Xi spectra (wrong-sign, mix)
AliESDtrackCuts * GetTrackCuts() const
Definition: AliRDHFCuts.h:245
std::vector< Double_t > fV0dcaArray2
array of lambda-compatible tracks' information
void SetProngIDs(Int_t nIDs, UShort_t *id)
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1
! EFficiency calculation numerator
THnSparse * fHistoElePtvsV0dcaWS
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsV0dcaRS1
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaMassvsElePtMCS
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaPtvsV0dlRS
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsV0dlWS2
! Feeddown subtraction using Lambda vertex distribution
TH2F * fHistoElePtFeeddownXic0MCS
! EFficiency calculation numerator
THnSparse * fHistoElePtvsd0WSMix
! e pt-d0 spectra (wrong-sign, mix)
THnSparse * fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS
! Feeddown subtraction using Lambda vertex distribution
AliPIDResponse * GetPidResponse() const
Definition: AliAODPidHF.h:160
TTree * fMCV0VariablesTree
! tree of the candidate variables after track selection on output slot 4
THnSparse * fHistoEleLambdaPtvsV0dlFeedDownXic0MCS
! Feeddown subtraction using Lambda vertex distribution
TH2F * fHistoElectronTPCPIDSelTOF
! TPC electron PID after TOF 3 sigma cut
THnSparse * fHistoEleLambdaMassFeeddownXicPlusMCGen
! EFficiency calculation numerator
THnSparse * fHistoElePtvsV0dlWSMix2
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoLambdaMCGen
! Lambda in mcArray (only from charmed baryon)
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Int_t MatchToMC(AliAODRecoCascadeHF *elobj, TClonesArray *mcArray, Int_t *pdgele_array, Int_t *pdgv0_array, Int_t *labelele_array, Int_t *labelv0_array, Int_t &ngen_ele, Int_t &ngen_v0)
Bool_t IsEventRejectedDuePhysicsSelection() const
Definition: AliRDHFCuts.h:319
THnSparse * fHistoEleLambdaMassvsElePtWSMix
! e-Lambda mass vs elept spectra wrong sign (mixed event)
THnSparse * fHistoElePtvsEtaFeeddownXicPlusMCGen
! e spectra efficiency numerator
THnSparse * fHistoElePtvsV0dcaRSMix
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsV0dlWS
! Feeddown subtraction using Lambda vertex distribution
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
THnSparse * fHistoElePtvsEtaFeeddownXic0MCGen
! e spectra efficiency numerator
THnSparse * fHistoElePtvsV0dcaWSSide1
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaMassvsElePtRS2
! e-Lambda mass vs elept spectra right sign
THnSparse * fHistoElePtvsV0dcaMCS1
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaPtvsV0dlRSMix1
! Feeddown subtraction using Lambda vertex distribution
TTree * fMCEleVariablesTree
! tree of the candidate variables after track selection on output slot 4
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1
! EFficiency calculation numerator
TTree * fV0VariablesTree
! tree of the candidate variables after track selection on output slot 4
THnSparse * fHistoElePtvsLambdaPtvsLcPtMCGen
! e-Xi spectra efficiency denominator
THnSparse * fHistoEleLambdaMassWSSide
! e-Lambda mass spectra wrong sign (mixed event)
void SelectV0(const AliVEvent *event, Int_t nV0, Int_t &nSeleV0, Bool_t *seleV0Flags, TClonesArray *mcArray)
THnSparse * fHistoEleLambdaMassWSMix
! e-Lambda mass spectra wrong sign (mixed event)
THnSparse * fHistoEleLambdaPtvsV0dlFeedDownXicPlusMCS1
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsEtaFeeddownXic0MCS
! e spectra efficiency numerator
Float_t * fCandidateEleVariables
! variables to be written to the tree
AliNormalizationCounter * fCounter
! Counter for normalization
THnSparse * fHistoElePtvsV0dcaWSSide
! Feeddown subtraction using Lambda vertex distribution
Bool_t IsEventSelected(AliVEvent *event)
THnSparse * fHistoElePtvsLambdaPtMCLcGen
! e-Xi spectra efficiency denominator
THnSparse * fHistoElePtvsEtaFeeddownXicPlusMCS
! e spectra efficiency numerator
THnSparse * fHistoElePtvsLambdaPtFeeddownXicPlusMCS
! e-Xi spectra efficiency numerator
THnSparse * fHistoElePtvsLambdaPtFeeddownXicPlusMCGen
! e-Xi spectra efficiency numerator
THnSparse * fHistoElePtvsV0dlMCS2
! Feeddown subtraction using Lambda vertex distribution
Float_t nEvents[nProd]
THnSparse * fHistoEleLambdaPtvsV0dlRSMix2
! Feeddown subtraction using Lambda vertex distribution
AliAODVertex * CallPrimaryVertex(AliAODv0 *v0, AliAODTrack *trk, AliAODEvent *evt)
THnSparse * fHistoElePtvsEtaMCS
! e spectra efficiency numerator
THnSparse * fHistoEleLambdaMassvsElePtWS1
! e-Lambda mass vs elept spectra wrong sign
THnSparse * fHistoEleLambdaMassvsElePtMCGen2
! EFficiency calculation denominator
THnSparse * fHistoEleLambdaMassvsElePtMCS1
! EFficiency calculation numerator
THnSparse * fHistoElePtvsV0dlRSMix1
! Feeddown subtraction using Lambda vertex distribution
TH1F * fHistoBachPtMCGen
! Bachelor pT histogram (efficiency denominator)
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCS
! EFficiency calculation numerator
TObjArray * fV0Tracks1
array of electron-compatible tracks
THnSparse * fHistoEleLambdaMassRS
! e-Lambda mass spectra right sign
const Double_t etamax
Bool_t SingleTrkCutsNoPID(AliAODTrack *trk, AliAODVertex *vert)
THnSparse * fHistoElePtvsV0dcaRSSide1
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsV0dcaFeedDownXicPlusMCS1
! Feeddown subtraction using Lambda vertex distribution
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
THnSparse * fHistoEleLambdaMassvsElePtMCGen
! EFficiency calculation denominator
THnSparse * fHistoElePtvsV0dcaFeedDownXicPlusMCS
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaMassvsElePtWSSide1
! e-Lambda mass vs elept spectra wrong sign (mixed event)
Bool_t GetIsUsePID() const
Definition: AliRDHFCuts.h:253
THnSparse * fHistoElePtvsCutVarsMCS[17]
! e pt- cut variables (MCS)
THnSparse * fHistoElePtvsV0dlWSMix1
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoEleLambdaPtvsV0dlRSSide
! Feeddown subtraction using Lambda vertex distribution
THnSparse * fHistoElePtvsV0dcaWSMix1
! Feeddown subtraction using Lambda vertex distribution
Bool_t IsEventRejectedDueToTrigger() const
Definition: AliRDHFCuts.h:295
THnSparse * fHistoEleLambdaPtvsV0dlFeedDownXic0MCS2
! Feeddown subtraction using Lambda vertex distribution
TH1F * fHistoBachPtMCS
! Bachelor pT histogram (efficiency numerator)
THnSparse * fHistoElePtvsV0dcaMCS2
! Feeddown subtraction using Lambda vertex distribution
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999)
THnSparse * fHistoEleLambdaMassvsElePtWSSide2
! e-Lambda mass vs elept spectra wrong sign (mixed event)
THnSparse * fHistoEleLambdaPtvsV0dlWSSide2
! Feeddown subtraction using Lambda vertex distribution