AliPhysics  5dd2c10 (5dd2c10)
 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  fHistoK0sMassvsPt(0),
230  fHistoElectronTPCPID(0),
231  fHistoElectronTOFPID(0),
232  fHistoElectronTPCSelPID(0),
233  fHistoElectronTOFSelPID(0),
234  fHistoElectronTPCPIDSelTOF(0),
235  fHistoElectronTPCPIDSelTOFSmallEta(0),
236  fHistoElectronTPCPIDSelTOFLargeEta(0),
237  fHistoElectronQovPtvsPhi(0),
238  fHistoLambdaQovPtvsPhi(0),
239  fHistoLcMCGen(0),
240  fHistoLcMCGen1(0),
241  fHistoLcMCGen2(0),
242  fHistoFeedDownXic0MCGen(0),
243  fHistoFeedDownXic0MCGen1(0),
244  fHistoFeedDownXic0MCGen2(0),
245  fHistoFeedDownXicPlusMCGen(0),
246  fHistoFeedDownXicPlusMCGen1(0),
247  fHistoFeedDownXicPlusMCGen2(0),
248  fHistoLcElectronMCGen(0),
249  fHistoLcElectronMCGen1(0),
250  fHistoLcElectronMCGen2(0),
251  fHistoElectronFeedDownXic0MCGen(0),
252  fHistoElectronFeedDownXic0MCGen1(0),
253  fHistoElectronFeedDownXic0MCGen2(0),
254  fHistoElectronFeedDownXicPlusMCGen(0),
255  fHistoElectronFeedDownXicPlusMCGen1(0),
256  fHistoElectronFeedDownXicPlusMCGen2(0),
257  fHistoElectronMCGen(0),
258  fHistoLambdaMCGen(0),
259  fCounter(0),
260  fHistonEvtvsRunNumber(0),
261  fHistonElevsRunNumber(0),
262  fHistonLambdavsRunNumber(0),
263  fDoEventMixing(0),
264  fNumberOfEventsForMixing (5),
265  fNzVtxBins (0),
266  fNCentBins (0),
267  fNOfPools(1),
268  fEventBuffer(0x0),
269  fEventInfo(0x0),
270  fElectronTracks(0x0),
271  fV0Tracks1(0x0),
272  fV0Tracks2(0x0)
273 {
274  //
276  //
277  for(Int_t i=0;i<17;i++){
278  fHistoElePtvsCutVarsRS[i] = 0;
279  fHistoElePtvsCutVarsWS[i] = 0;
281  }
282  for(Int_t i=0;i<8;i++){
284  }
285 }
286 
287 //___________________________________________________________________________
290  Bool_t writeVariableTree) :
291  AliAnalysisTaskSE(name),
292  fUseMCInfo(kFALSE),
293  fOutput(0),
294  fOutputAll(0),
295  fListCuts(0),
296  fCEvents(0),
297  fHTrigger(0),
298  fHCentrality(0),
299  fAnalCuts(analCuts),
300  fIsEventSelected(kFALSE),
301  fWriteVariableTree(writeVariableTree),
302  fWriteEachVariableTree(kFALSE),
303  fWriteMCVariableTree(kFALSE),
304  fVariablesTree(0),
305  fEleVariablesTree(0),
306  fV0VariablesTree(0),
307  fMCVariablesTree(0),
308  fMCEleVariablesTree(0),
309  fMCV0VariablesTree(0),
310  fReconstructPrimVert(kFALSE),
311  fIsMB(kFALSE),
312  fIsSemi(kFALSE),
313  fIsCent(kFALSE),
314  fIsINT7(kFALSE),
315  fIsEMC7(kFALSE),
316  fCandidateVariables(),
317  fCandidateEleVariables(),
318  fCandidateV0Variables(),
319  fCandidateMCVariables(),
320  fCandidateMCEleVariables(),
321  fCandidateMCV0Variables(),
322  fVtx1(0),
323  fV1(0),
324  fVtxZ(0),
325  fBzkG(0),
326  fCentrality(0),
327  fRunNumber(0),
328  fTriggerCheck(0),
329  fUseCentralityV0M(kFALSE),
330  fEvNumberCounter(0),
331  fHistoEleLambdaMass(0),
332  fHistoEleLambdaMassRS(0),
333  fHistoEleLambdaMassWS(0),
334  fHistoEleLambdaMassRSMix(0),
335  fHistoEleLambdaMassWSMix(0),
336  fHistoEleLambdaMassRSSide(0),
337  fHistoEleLambdaMassWSSide(0),
338  fHistoEleLambdaMassvsElePtRS(0),
339  fHistoEleLambdaMassvsElePtWS(0),
340  fHistoEleLambdaMassvsElePtRSMix(0),
341  fHistoEleLambdaMassvsElePtWSMix(0),
342  fHistoEleLambdaMassvsElePtRSSide(0),
343  fHistoEleLambdaMassvsElePtWSSide(0),
344  fHistoEleLambdaMassvsElePtRS1(0),
345  fHistoEleLambdaMassvsElePtWS1(0),
346  fHistoEleLambdaMassvsElePtRSMix1(0),
347  fHistoEleLambdaMassvsElePtWSMix1(0),
348  fHistoEleLambdaMassvsElePtRSSide1(0),
349  fHistoEleLambdaMassvsElePtWSSide1(0),
350  fHistoEleLambdaMassvsElePtRS2(0),
351  fHistoEleLambdaMassvsElePtWS2(0),
352  fHistoEleLambdaMassvsElePtRSMix2(0),
353  fHistoEleLambdaMassvsElePtWSMix2(0),
354  fHistoEleLambdaMassvsElePtRSSide2(0),
355  fHistoEleLambdaMassvsElePtWSSide2(0),
356  fHistoElePtRS(0),
357  fHistoElePtWS(0),
358  fHistoElePtRSMix(0),
359  fHistoElePtWSMix(0),
360  fHistoEleLambdaMassMCS(0),
361  fHistoEleLambdaMassMCGen(0),
362  fHistoEleLambdaMassvsElePtMCS(0),
363  fHistoEleLambdaMassvsElePtMCGen(0),
364  fHistoEleLambdaMassvsElePtMCS1(0),
365  fHistoEleLambdaMassvsElePtMCGen1(0),
366  fHistoEleLambdaMassvsElePtMCS2(0),
367  fHistoEleLambdaMassvsElePtMCGen2(0),
368  fHistoElePtMCS(0),
369  fHistoElePtMCGen(0),
370  fHistoElePtvsEtaRS(0),
371  fHistoElePtvsEtaWS(0),
372  fHistoElePtvsEtaRSMix(0),
373  fHistoElePtvsEtaWSMix(0),
374  fHistoElePtvsEtaMCS(0),
375  fHistoElePtvsEtaMCGen(0),
376  fHistoElePtvsLambdaPtRS(0),
377  fHistoElePtvsLambdaPtWS(0),
378  fHistoElePtvsLambdaPtRSMix(0),
379  fHistoElePtvsLambdaPtWSMix(0),
380  fHistoElePtvsLambdaPtMCS(0),
381  fHistoElePtvsLambdaPtvsLcPtMCS(0),
382  fHistoElePtvsLambdaPtMCGen(0),
383  fHistoElePtvsLambdaPtvsLcPtMCGen(0),
384  fHistoElePtvsLambdaPtMCLcGen(0),
385  fHistoElePtvsd0RS(0),
386  fHistoElePtvsd0WS(0),
387  fHistoElePtvsd0RSMix(0),
388  fHistoElePtvsd0WSMix(0),
389  fHistoElePtvsd0MCS(0),
390  fHistoElePtvsd0PromptMCS(0),
391  fHistoElePtvsd0BFeeddownMCS(0),
392  fHistoEleLambdaMassFeeddownXic0MCS(0),
393  fHistoEleLambdaMassFeeddownXic0MCGen(0),
394  fHistoEleLambdaMassvsElePtFeeddownXic0MCS(0),
395  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen(0),
396  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1(0),
397  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1(0),
398  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2(0),
399  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2(0),
400  fHistoElePtFeeddownXic0MCS(0),
401  fHistoElePtFeeddownXic0MCGen(0),
402  fHistoElePtvsEtaFeeddownXic0MCS(0),
403  fHistoElePtvsEtaFeeddownXic0MCGen(0),
404  fHistoElePtvsLambdaPtFeeddownXic0MCS(0),
405  fHistoElePtvsLambdaPtFeeddownXic0MCGen(0),
406  fHistoEleLambdaMassFeeddownXicPlusMCS(0),
407  fHistoEleLambdaMassFeeddownXicPlusMCGen(0),
408  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS(0),
409  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen(0),
410  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1(0),
411  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1(0),
412  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2(0),
413  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2(0),
414  fHistoElePtFeeddownXicPlusMCS(0),
415  fHistoElePtFeeddownXicPlusMCGen(0),
416  fHistoElePtvsEtaFeeddownXicPlusMCS(0),
417  fHistoElePtvsEtaFeeddownXicPlusMCGen(0),
418  fHistoElePtvsLambdaPtFeeddownXicPlusMCS(0),
419  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen(0),
420  fHistoBachPt(0),
421  fHistoBachPtMCS(0),
422  fHistoBachPtMCGen(0),
423  fHistod0Bach(0),
424  fHistoLambdaMassvsPt(0),
425  fHistoLambdaMassvsPtMCS(0),
426  fHistoLambdaMassvsPtMCGen(0),
427  fHistoK0sMassvsPt(0),
428  fHistoElectronTPCPID(0),
429  fHistoElectronTOFPID(0),
430  fHistoElectronTPCSelPID(0),
431  fHistoElectronTOFSelPID(0),
432  fHistoElectronTPCPIDSelTOF(0),
433  fHistoElectronTPCPIDSelTOFSmallEta(0),
434  fHistoElectronTPCPIDSelTOFLargeEta(0),
435  fHistoElectronQovPtvsPhi(0),
436  fHistoLambdaQovPtvsPhi(0),
437  fHistoLcMCGen(0),
438  fHistoLcMCGen1(0),
439  fHistoLcMCGen2(0),
440  fHistoFeedDownXic0MCGen(0),
441  fHistoFeedDownXic0MCGen1(0),
442  fHistoFeedDownXic0MCGen2(0),
443  fHistoFeedDownXicPlusMCGen(0),
444  fHistoFeedDownXicPlusMCGen1(0),
445  fHistoFeedDownXicPlusMCGen2(0),
446  fHistoLcElectronMCGen(0),
447  fHistoLcElectronMCGen1(0),
448  fHistoLcElectronMCGen2(0),
449  fHistoElectronFeedDownXic0MCGen(0),
450  fHistoElectronFeedDownXic0MCGen1(0),
451  fHistoElectronFeedDownXic0MCGen2(0),
452  fHistoElectronFeedDownXicPlusMCGen(0),
453  fHistoElectronFeedDownXicPlusMCGen1(0),
454  fHistoElectronFeedDownXicPlusMCGen2(0),
455  fHistoElectronMCGen(0),
456  fHistoLambdaMCGen(0),
457  fCounter(0),
458  fHistonEvtvsRunNumber(0),
459  fHistonElevsRunNumber(0),
460  fHistonLambdavsRunNumber(0),
461  fDoEventMixing(0),
462  fNumberOfEventsForMixing (5),
463  fNzVtxBins (0),
464  fNCentBins (0),
465  fNOfPools(1),
466  fEventBuffer(0x0),
467  fEventInfo(0x0),
468  fElectronTracks(0x0),
469  fV0Tracks1(0x0),
470  fV0Tracks2(0x0)
471 {
472  //
474  //
475  Info("AliAnalysisTaskSELc2eleLambdafromAODtracks","Calling Constructor");
476 
477  for(Int_t i=0;i<17;i++){
478  fHistoElePtvsCutVarsRS[i] = 0;
479  fHistoElePtvsCutVarsWS[i] = 0;
481  }
482  for(Int_t i=0;i<8;i++){
484  }
485 
486  DefineOutput(1,TList::Class()); //conters
487  DefineOutput(2,TList::Class());
488  DefineOutput(3,TList::Class()); //conters
489  DefineOutput(4,TTree::Class()); //My private output
490  DefineOutput(5,TTree::Class()); //My private output
491  DefineOutput(6,TTree::Class()); //My private output
492  DefineOutput(7,TTree::Class()); //My private output
493  DefineOutput(8,AliNormalizationCounter::Class());
494  DefineOutput(9,TTree::Class()); //My private output
495  DefineOutput(10,TTree::Class()); //My private output
496 }
497 
498 //___________________________________________________________________________
500  //
502  //
503  Info("~AliAnalysisTaskSELc2eleLambdafromAODtracks","Calling Destructor");
504 
505  if (fOutput) {
506  delete fOutput;
507  fOutput = 0;
508  }
509 
510  if (fOutputAll) {
511  delete fOutputAll;
512  fOutputAll = 0;
513  }
514 
515  if (fListCuts) {
516  delete fListCuts;
517  fListCuts = 0;
518  }
519 
520 
521  if (fAnalCuts) {
522  delete fAnalCuts;
523  fAnalCuts = 0;
524  }
525 
526  if (fVariablesTree) {
527  delete fVariablesTree;
528  fVariablesTree = 0;
529  }
530  if (fEleVariablesTree) {
531  delete fEleVariablesTree;
532  fEleVariablesTree = 0;
533  }
534  if (fV0VariablesTree) {
535  delete fV0VariablesTree;
536  fV0VariablesTree = 0;
537  }
538  if (fMCVariablesTree) {
539  delete fMCVariablesTree;
540  fMCVariablesTree = 0;
541  }
542  if (fMCEleVariablesTree) {
543  delete fMCEleVariablesTree;
545  }
546  if (fMCV0VariablesTree) {
547  delete fMCV0VariablesTree;
548  fMCV0VariablesTree = 0;
549  }
550  if(fCounter){
551  delete fCounter;
552  fCounter = 0;
553  }
554 
555  if(fElectronTracks) fElectronTracks->Delete();
556  delete fElectronTracks;
557  if(fV0Tracks1) fV0Tracks1->Delete();
558  delete fV0Tracks1;
559  if(fV0Tracks2) fV0Tracks2->Delete();
560  delete fV0Tracks2;
561  if(fEventBuffer){
562  for(Int_t i=0; i<fNOfPools; i++) delete fEventBuffer[i];
563  delete fEventBuffer;
564  }
565  delete fEventInfo;
566 }
567 
568 //_________________________________________________
570  //
572  //
573  //
574 
575  fIsEventSelected=kFALSE;
576 
577  if (fDebug > 1) AliInfo("Init");
578 
579  fListCuts = new TList();
580  fListCuts->SetOwner();
581  fListCuts->SetName("ListCuts");
583  PostData(2,fListCuts);
584 
585  return;
586 }
587 
588 //_________________________________________________
590 {
591  //
593  //
594 
595  if (!fInputEvent) {
596  AliError("NO EVENT FOUND!");
597  return;
598  }
599  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
600  fCEvents->Fill(1);
602 
603  //------------------------------------------------
604  // First check if the event has proper B
605  //------------------------------------------------
606 
607  fBzkG = (Double_t)aodEvent->GetMagneticField();
608  AliKFParticle::SetField(fBzkG);
609  if (TMath::Abs(fBzkG)<0.001) {
610  return;
611  }
612  fCEvents->Fill(2);
613 
616 
617  //------------------------------------------------
618  // MC analysis setting
619  //------------------------------------------------
620  TClonesArray *mcArray = 0;
621  AliAODMCHeader *mcHeader=0;
622  if (fUseMCInfo) {
623  // MC array need for maching
624  mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
625  if (!mcArray) {
626  AliError("Could not find Monte-Carlo in AOD");
627  return;
628  }
629  fCEvents->Fill(6); // in case of MC events
630 
631  // load MC header
632  mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
633  if (!mcHeader) {
634  AliError("AliAnalysisTaskSELc2eleLambdafromAODtracks::UserExec: MC header branch not found!\n");
635  return;
636  }
637  fCEvents->Fill(7); // in case of MC events
638 
639  Double_t zMCVertex = mcHeader->GetVtxZ();
640  if (TMath::Abs(zMCVertex) > fAnalCuts->GetMaxVtxZ()) {
641  AliDebug(2,Form("Event rejected: abs(zVtxMC)=%f > fAnalCuts->GetMaxVtxZ()=%f",zMCVertex,fAnalCuts->GetMaxVtxZ()));
642  return;
643  } else {
644  fCEvents->Fill(17); // in case of MC events
645  }
646  if ((TMath::Abs(zMCVertex) < fAnalCuts->GetMaxVtxZ()) && (!fAnalCuts->IsEventRejectedDuePhysicsSelection()) && (!fAnalCuts->IsEventRejectedDueToTrigger())) {
647  MakeMCAnalysis(mcArray);
648  }
649  }
650 
651  //------------------------------------------------
652  // Event selection
653  //------------------------------------------------
654  fVtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
655  if (!fVtx1) return;
656 
657  Double_t pos[3],cov[6];
658  fVtx1->GetXYZ(pos);
659  fVtx1->GetCovarianceMatrix(cov);
660  fV1 = new AliESDVertex(pos,cov,100.,100,fVtx1->GetName());
661  fVtxZ = pos[2];
662 
663  Bool_t fIsTriggerNotOK = fAnalCuts->IsEventRejectedDueToTrigger();
664  if(!fIsTriggerNotOK) fCEvents->Fill(3);
665  if(!fIsEventSelected) {
666  delete fV1;
667  return;
668  }
669  fCEvents->Fill(4);
670 
671  fIsMB=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kMB)==(AliVEvent::kMB);
672  fIsSemi=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kSemiCentral)==(AliVEvent::kSemiCentral);
673  fIsCent=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kCentral)==(AliVEvent::kCentral);
674  fIsINT7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kINT7)==(AliVEvent::kINT7);
675  fIsEMC7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kEMC7)==(AliVEvent::kEMC7);
677  if(fIsMB) fHTrigger->Fill(1);
678  if(fIsSemi) fHTrigger->Fill(2);
679  if(fIsCent) fHTrigger->Fill(3);
680  if(fIsINT7) fHTrigger->Fill(4);
681  if(fIsEMC7) fHTrigger->Fill(5);
682  if(fIsMB|fIsSemi|fIsCent) fHTrigger->Fill(7);
683  if(fIsINT7|fIsEMC7) fHTrigger->Fill(8);
684  if(fIsMB&fIsSemi) fHTrigger->Fill(10);
685  if(fIsMB&fIsCent) fHTrigger->Fill(11);
686  if(fIsINT7&fIsEMC7) fHTrigger->Fill(12);
687 
688  if(fUseCentralityV0M){
689  AliCentrality *cent = aodEvent->GetCentrality();
690  fCentrality = cent->GetCentralityPercentile("V0M");
691  }else{
692  fCentrality = 1.;
693  }
694  if(fCentrality<0.||fCentrality>100.-0.0000001) {
695  delete fV1;
696  return;
697  }
698  fHCentrality->Fill(fCentrality);
699  fRunNumber = aodEvent->GetRunNumber();
700 
701  Int_t runnumber_offset = 0;
702  Int_t runnumber = aodEvent->GetRunNumber();
703  if(runnumber<=131000&&runnumber>=114000){
704  runnumber_offset = 114000;//lhc10bcde
705  }else if(runnumber<=196000&&runnumber>=195000){
706  runnumber_offset = 195000;//lhc13bc
707  }else if(runnumber<=170593&&runnumber>=167902){
708  runnumber_offset = 167902;//lhc11h
709  }
710  fHistonEvtvsRunNumber->Fill(runnumber-runnumber_offset,1.);
711 
712  //------------------------------------------------
713  // Check if the event has v0 candidate
714  //------------------------------------------------
715  //Int_t nv0 = aodEvent->GetNumberOfV0s();
716  fCEvents->Fill(5);
717 
718 
719  //------------------------------------------------
720  // Main analysis done in this function
721  //------------------------------------------------
722  MakeAnalysis(aodEvent,mcArray);
723 
724 
725  PostData(1,fOutput);
726  PostData(3,fOutputAll);
727  PostData(4,fVariablesTree);
728  PostData(5,fEleVariablesTree);
729  PostData(6,fV0VariablesTree);
730  PostData(7,fMCVariablesTree);
731  PostData(8,fCounter);
732  PostData(9,fMCEleVariablesTree);
733  PostData(10,fMCV0VariablesTree);
734 
735  fIsEventSelected=kFALSE;
736 
737  delete fV1;
738  return;
739 }
740 
741 //________________________________________ terminate ___________________________
743 {
747 
748  //AliInfo("Terminate","");
749  AliAnalysisTaskSE::Terminate();
750 
751  fOutput = dynamic_cast<TList*> (GetOutputData(1));
752  if (!fOutput) {
753  AliError("fOutput not available");
754  return;
755  }
756 
757  fOutputAll = dynamic_cast<TList*> (GetOutputData(3));
758  if (!fOutputAll) {
759  AliError("fOutputAll not available");
760  return;
761  }
762 
763  return;
764 }
765 
766 //___________________________________________________________________________
768 {
772  //AliInfo(Form("CreateOutputObjects of task %s\n", GetName()));
773 
774  //------------------------------------------------
775  // output object setting
776  //------------------------------------------------
777  fOutput = new TList();
778  fOutput->SetOwner();
779  fOutput->SetName("chist0");
780  DefineGeneralHistograms(); // define general histograms
781  PostData(1,fOutput);
782 
783  fOutputAll = new TList();
784  fOutputAll->SetOwner();
785  fOutputAll->SetName("anahisto");
786  DefineAnalysisHistograms(); // define general histograms
787  PostData(3,fOutputAll);
788 
790  PostData(4,fVariablesTree);
791 
793  PostData(5,fEleVariablesTree);
794 
796  PostData(6,fV0VariablesTree);
797 
799  PostData(7,fMCVariablesTree);
800 
802  PostData(9,fMCEleVariablesTree);
803 
805  PostData(10,fMCV0VariablesTree);
806 
807  //Counter for Normalization
808  TString normName="NormalizationCounter";
809  AliAnalysisDataContainer *cont = GetOutputSlot(8)->GetContainer();
810  if(cont)normName=(TString)cont->GetName();
811  fCounter = new AliNormalizationCounter(normName.Data());
812  fCounter->Init();
813  PostData(8,fCounter);
814 
815  if(fDoEventMixing){
816  fElectronTracks = new TObjArray();
817  fElectronTracks->SetOwner();
818  fV0Tracks1 = new TObjArray();
819  fV0Tracks1->SetOwner();
820  fV0Tracks2 = new TObjArray();
821  fV0Tracks2->SetOwner();
822 
824  fEventBuffer = new TTree*[fNOfPools];
825  for(Int_t i=0; i<fNOfPools; i++){
826  fEventBuffer[i]=new TTree(Form("EventBuffer_%d",i), "Temporary buffer for event mixing");
827  fEventBuffer[i]->Branch("zVertex", &fVtxZ);
828  fEventBuffer[i]->Branch("centrality", &fCentrality);
829  fEventBuffer[i]->Branch("eventInfo", "TObjString",&fEventInfo);
830  fEventBuffer[i]->Branch("v1array", "TObjArray", &fV0Tracks1);
831  fEventBuffer[i]->Branch("v2array", "TObjArray", &fV0Tracks2);
832  }
833  }
834 
835 
836  return;
837 }
838 
839 //-------------------------------------------------------------------------------
841 (
842  AliAODEvent *aodEvent, TClonesArray *mcArray
843  )
844 {
845  //
847  //
848  if(fDoEventMixing && fElectronTracks) fElectronTracks->Delete();
849  if(fDoEventMixing && fV0Tracks1) fV0Tracks1->Delete();
850  if(fDoEventMixing && fV0Tracks2) fV0Tracks2->Delete();
851 
852  //------------------------------------------------
853  // Select good track before hand to save time
854  //------------------------------------------------
855 
856  Int_t nV0s= aodEvent->GetNumberOfV0s();
857  Int_t nTracks= aodEvent->GetNumberOfTracks();
858 
859  Bool_t seleTrkFlags[nTracks];
860  Int_t nSeleTrks=0;
861  SelectTrack(aodEvent,nTracks,nSeleTrks,seleTrkFlags,mcArray);
862 
863  Bool_t seleV0Flags[nV0s];
864  Int_t nSeleV0=0;
865  SelectV0(aodEvent,nV0s,nSeleV0,seleV0Flags,mcArray);
866 
867  Int_t runnumber_offset = 0;
868  Int_t runnumber = aodEvent->GetRunNumber();
869  if(runnumber<=131000&&runnumber>=114000){
870  runnumber_offset = 114000;//lhc10bcde
871  }else if(runnumber<=196000&&runnumber>=195000){
872  runnumber_offset = 195000;//lhc13bc
873  }else if(runnumber<=170593&&runnumber>=167902){
874  runnumber_offset = 167902;//lhc11h
875  }
876  fHistonElevsRunNumber->Fill(runnumber-runnumber_offset,nSeleTrks);
877  fHistonLambdavsRunNumber->Fill(runnumber-runnumber_offset,nSeleV0);
878 
879  //------------------------------------------------
880  // V0 loop
881  //------------------------------------------------
882  for (Int_t iv0 = 0; iv0<nV0s; iv0++) {
883  if(!seleV0Flags[iv0]) continue;
884  AliAODv0 *v0 = aodEvent->GetV0(iv0);
885  if(!v0) continue;
886 
887  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
888  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
889 
890  //------------------------------------------------
891  // track loop
892  //------------------------------------------------
893  for (Int_t itrk = 0; itrk<nTracks; itrk++) {
894  if(!seleTrkFlags[itrk]) continue;
895  AliAODTrack *trk = (AliAODTrack*)aodEvent->GetTrack(itrk);
896  if(trk->GetID()<0) continue;
897 
898  Int_t cpid = cptrack->GetID();
899  Int_t cnid = cntrack->GetID();
900  Int_t lpid = trk->GetID();
901  if((cpid==lpid)||(cnid==lpid)) continue;
902 
903  //if(!fAnalCuts->SelectWithRoughCuts(v0,trk)) continue;
904 
905  AliAODVertex *secVert = ReconstructSecondaryVertex(v0,trk,aodEvent);//Fake, prim vertex is just used as secondary vertex. place holder for future
906  if(!secVert) continue;
907 
908  AliAODRecoCascadeHF *elobj = MakeCascadeHF(v0,trk,aodEvent,secVert);
909  if(!elobj) {
910  continue;
911  }
912 
913  FillROOTObjects(elobj, v0,trk,mcArray);
914 
915  elobj->GetSecondaryVtx()->RemoveDaughters();
916  elobj->UnsetOwnPrimaryVtx();
917  delete elobj;elobj=NULL;
918  delete secVert;
919  }
920  }
921 
922  if(fDoEventMixing){
923  fEventInfo->SetString(Form("Ev%d_esd%d_E%d_V%d",AliAnalysisManager::GetAnalysisManager()->GetNcalls(),((AliAODHeader*)aodEvent->GetHeader())->GetEventNumberESDFile(),fElectronTracks->GetEntries(),fV0Tracks1->GetEntries()+fV0Tracks2->GetEntries()));
924  Int_t ind=GetPoolIndex(fVtxZ,fCentrality);
925  if(ind>=0 && ind<fNOfPools){
926  if(fEventBuffer[ind]->GetEntries() >= fNumberOfEventsForMixing){
927  DoEventMixingWithPools(ind);
928  if(fEventBuffer[ind]->GetEntries() >= 20*fNumberOfEventsForMixing){
929  ResetPool(ind);
930  }
931  }
932  fEventBuffer[ind]->Fill();
933  }
934  }
935 }
938 {
942 
943  const char* nameoutput = GetOutputSlot(4)->GetContainer()->GetName();
944  fVariablesTree = new TTree(nameoutput,"Candidates variables tree");
945  Int_t nVar = 74;
946  fCandidateVariables = new Float_t [nVar];
947  TString * fCandidateVariableNames = new TString[nVar];
948 
949  fCandidateVariableNames[ 0]="Centrality";
950  fCandidateVariableNames[ 1]="InvMassEleLambda";
951  fCandidateVariableNames[ 2]="EleLambdaPt";
952  fCandidateVariableNames[ 3]="EleLambdaPx";
953  fCandidateVariableNames[ 4]="EleLambdaPy";
954  fCandidateVariableNames[ 5]="EleLambdaPz";
955  fCandidateVariableNames[ 6]="ElePx";
956  fCandidateVariableNames[ 7]="ElePy";
957  fCandidateVariableNames[ 8]="ElePz";
958  fCandidateVariableNames[ 9]="V0Px";
959  fCandidateVariableNames[10]="V0Py";
960  fCandidateVariableNames[11]="V0Pz";
961  fCandidateVariableNames[12]="AntiLambdaFlag";
962  fCandidateVariableNames[13]="MassLambda";
963  fCandidateVariableNames[14]="MassAntiLambda";
964  fCandidateVariableNames[15]="Eled0";
965  fCandidateVariableNames[16]="V0d0";
966  fCandidateVariableNames[17]="nSigmaTPCele";
967  fCandidateVariableNames[18]="nSigmaTOFele";
968  fCandidateVariableNames[19]="nSigmaTPCv0pr";
969  fCandidateVariableNames[20]="nSigmaTOFv0pr";
970  fCandidateVariableNames[21]="EleCharge";
971  fCandidateVariableNames[22]="ProtonPx";
972  fCandidateVariableNames[23]="ProtonPy";
973  fCandidateVariableNames[24]="ProtonPz";
974  fCandidateVariableNames[25]="PiPx";
975  fCandidateVariableNames[26]="PiPy";
976  fCandidateVariableNames[27]="PiPz";
977  fCandidateVariableNames[28]="mcpdglc";
978  fCandidateVariableNames[29]="mclablc";
979  fCandidateVariableNames[30]="mcpdgmomele";
980  fCandidateVariableNames[31]="mcpdgmomv0";
981  fCandidateVariableNames[32]="Mixing";
982  fCandidateVariableNames[33]="mcpdgele";
983  fCandidateVariableNames[34]="nSigmaTPCpr_etrk";
984  fCandidateVariableNames[35]="nSigmaTOFpr_etrk";
985  fCandidateVariableNames[36]="nSigmaTPCka_etrk";
986  fCandidateVariableNames[37]="nSigmaTOFka_etrk";
987  fCandidateVariableNames[38]="MassK0Short";
988  fCandidateVariableNames[39]="mcpdggrmomele";
989  fCandidateVariableNames[40]="mcpdggrmomv0";
990  fCandidateVariableNames[41]="mcngenele";
991  fCandidateVariableNames[42]="mcngenv0";
992  fCandidateVariableNames[43]="mclcpx";
993  fCandidateVariableNames[44]="mclcpy";
994  fCandidateVariableNames[45]="mclcpz";
995  fCandidateVariableNames[46]="mcelepx";
996  fCandidateVariableNames[47]="mcelepy";
997  fCandidateVariableNames[48]="mcelepz";
998  fCandidateVariableNames[49]="mcv0px";
999  fCandidateVariableNames[50]="mcv0py";
1000  fCandidateVariableNames[51]="mcv0pz";
1001  fCandidateVariableNames[52]="nSigmaTPCpi_etrk";
1002  fCandidateVariableNames[53]="nSigmaTOFpi_etrk";
1003  fCandidateVariableNames[54]="PrimVertx";
1004  fCandidateVariableNames[55]="PrimVerty";
1005  fCandidateVariableNames[56]="PrimVertz";
1006  fCandidateVariableNames[57]="V0Vertx";
1007  fCandidateVariableNames[58]="V0Verty";
1008  fCandidateVariableNames[59]="V0Vertz";
1009 
1010  fCandidateVariableNames[60]="DcaV0PrToPrimVertex";
1011  fCandidateVariableNames[61]="DcaV0PiToPrimVertex";
1012  fCandidateVariableNames[62]="DcaV0daughters";
1013  fCandidateVariableNames[63]="V0CosPointingAngle";
1014  fCandidateVariableNames[64]="V0ProperDecayLength";
1015  fCandidateVariableNames[65]="MassK0Short2";
1016 
1017  fCandidateVariableNames[66]="nSigmaTPCv0pi";
1018  fCandidateVariableNames[67]="nSigmaTOFv0pi";
1019 
1020  fCandidateVariableNames[68]= "EleITSMatch";
1021  fCandidateVariableNames[69]= "V0PosITSMatch";
1022  fCandidateVariableNames[70]= "V0NegITSMatch";
1023  fCandidateVariableNames[71]= "IsV0PeakRegion";
1024 
1025  fCandidateVariableNames[72]="EvNumber";
1026  fCandidateVariableNames[73]="RunNumber";
1027 
1028  for (Int_t ivar=0; ivar<nVar; ivar++) {
1029  fVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1030  }
1031 
1032  return;
1033 }
1034 
1036 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillROOTObjects(AliAODRecoCascadeHF *elobj, AliAODv0 *v0, AliAODTrack *trk, TClonesArray *mcArray)
1037 {
1041  if(!trk) return;
1042  if(!v0) return;
1043 
1044  for(Int_t i=0;i<74;i++){
1045  fCandidateVariables[i] = -9999.;
1046  }
1047 
1048  Bool_t anti_lambda_flag = kFALSE;
1049  if(fabs(v0->MassAntiLambda()-1.115683)<fAnalCuts->GetProdV0MassTolLambdaRough()) anti_lambda_flag = kTRUE;
1050 
1051  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
1052  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
1053  if(cptrack->Charge()<0 && cntrack->Charge()>0){
1054  cptrack = (AliAODTrack*)(v0->GetDaughter(1));
1055  cntrack = (AliAODTrack*)(v0->GetDaughter(0));
1056  }
1057 
1059  UInt_t pdgdg[2]={11,3122};
1060  fCandidateVariables[ 1] = elobj->InvMass(2,pdgdg);
1061  fCandidateVariables[ 2] = elobj->Pt();
1062  fCandidateVariables[ 3] = elobj->Px();
1063  fCandidateVariables[ 4] = elobj->Py();
1064  fCandidateVariables[ 5] = elobj->Pz();
1065  fCandidateVariables[ 6] = elobj->PxProng(0);
1066  fCandidateVariables[ 7] = elobj->PyProng(0);
1067  fCandidateVariables[ 8] = elobj->PzProng(0);
1068  fCandidateVariables[ 9] = elobj->PxProng(1);
1069  fCandidateVariables[10] = elobj->PyProng(1);
1070  fCandidateVariables[11] = elobj->PzProng(1);
1071  fCandidateVariables[12] = anti_lambda_flag;
1072  fCandidateVariables[13] = v0->MassLambda();
1073  fCandidateVariables[14] = v0->MassAntiLambda();
1074  fCandidateVariables[15] = elobj->Getd0Prong(0);
1075  fCandidateVariables[16] = elobj->Getd0Prong(1);
1076 
1077  Double_t nSigmaTPCele=-9999.;
1078  Double_t nSigmaTOFele=-9999.;
1079  Double_t nSigmaTPCv0pr=-9999.;
1080  Double_t nSigmaTOFv0pr=-9999.;
1081  Double_t nSigmaTPCv0pi=-9999.;
1082  Double_t nSigmaTOFv0pi=-9999.;
1083  if(fAnalCuts->GetIsUsePID())
1084  {
1085  nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
1086  nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
1087  fCandidateVariables[17] = nSigmaTPCele;
1088  fCandidateVariables[18] = nSigmaTOFele;
1089  }
1090 
1091  if(fAnalCuts->GetUseLambdaPID())
1092  {
1093  if(anti_lambda_flag){
1094  nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
1095  nSigmaTOFv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kProton);
1096  nSigmaTPCv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
1097  nSigmaTOFv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kPion);
1098  }else{
1099  nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
1100  nSigmaTOFv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kProton);
1101  nSigmaTPCv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
1102  nSigmaTOFv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kPion);
1103  }
1104  fCandidateVariables[19] = nSigmaTPCv0pr;
1105  fCandidateVariables[20] = nSigmaTOFv0pr;
1106  fCandidateVariables[66] = nSigmaTPCv0pi;
1107  fCandidateVariables[67] = nSigmaTOFv0pi;
1108  }
1109  fCandidateVariables[21] = trk->Charge();
1110 
1111  if(anti_lambda_flag){
1112  fCandidateVariables[22] = cntrack->Px();
1113  fCandidateVariables[23] = cntrack->Py();
1114  fCandidateVariables[24] = cntrack->Pz();
1115  fCandidateVariables[25] = cptrack->Px();
1116  fCandidateVariables[26] = cptrack->Py();
1117  fCandidateVariables[27] = cptrack->Pz();
1118  }else{
1119  fCandidateVariables[22] = cptrack->Px();
1120  fCandidateVariables[23] = cptrack->Py();
1121  fCandidateVariables[24] = cptrack->Pz();
1122  fCandidateVariables[25] = cntrack->Px();
1123  fCandidateVariables[26] = cntrack->Py();
1124  fCandidateVariables[27] = cntrack->Pz();
1125  }
1126 
1127  AliAODMCParticle *mclc = 0;
1128  AliAODMCParticle *mcele = 0;
1129  AliAODMCParticle *mcv0 = 0;
1130  Int_t mclablc = 0;
1131  Int_t mcpdgele_array[100];
1132  Int_t mcpdgv0_array[100];
1133  Int_t mclabelele_array[100];
1134  Int_t mclabelv0_array[100];
1135  Int_t mcngen_ele=-9999;
1136  Int_t mcngen_v0=-9999;
1137 
1138  if(fUseMCInfo && mcArray){
1139 
1140  mclablc = MatchToMC(elobj,mcArray,mcpdgele_array, mcpdgv0_array,mclabelele_array,mclabelv0_array,mcngen_ele,mcngen_v0);
1141 
1142  if(mclablc>-1){
1143  mclc = (AliAODMCParticle*) mcArray->At(mclablc);
1144  if(mclabelele_array[0]>=0)
1145  mcele = (AliAODMCParticle*) mcArray->At(mclabelele_array[0]);
1146  if(mclabelv0_array[0]>=0)
1147  mcv0 = (AliAODMCParticle*) mcArray->At(mclabelv0_array[0]);
1148  if(mclc){
1149  fCandidateVariables[28] = mclc->GetPdgCode();
1150  fCandidateVariables[29] = mclc->Label();
1151  fCandidateVariables[43] = mclc->Px();
1152  fCandidateVariables[44] = mclc->Py();
1153  fCandidateVariables[45] = mclc->Pz();
1154  }
1155  if(mcele){
1156  fCandidateVariables[46] = mcele->Px();
1157  fCandidateVariables[47] = mcele->Py();
1158  fCandidateVariables[48] = mcele->Pz();
1159  }
1160  if(mcv0){
1161  fCandidateVariables[49] = mcv0->Px();
1162  fCandidateVariables[50] = mcv0->Py();
1163  fCandidateVariables[51] = mcv0->Pz();
1164  }
1165  }
1166  fCandidateVariables[30] = mcpdgele_array[1];
1167  fCandidateVariables[31] = mcpdgv0_array[1];
1168  fCandidateVariables[33] = mcpdgele_array[0];
1169  fCandidateVariables[39] = mcpdgele_array[2];
1170  fCandidateVariables[40] = mcpdgv0_array[2];
1171  fCandidateVariables[41] = mcngen_ele;
1172  fCandidateVariables[42] = mcngen_v0;
1173  }
1174  fCandidateVariables[32] = 0;
1175 
1176  if(fAnalCuts->GetIsUsePID())
1177  {
1178  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
1179  Double_t nSigmaTOFpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kProton);
1180  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
1181  Double_t nSigmaTOFka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kKaon);
1182  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
1183  Double_t nSigmaTOFpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kPion);
1184  fCandidateVariables[34] = nSigmaTPCpr_etrk;
1185  fCandidateVariables[35] = nSigmaTOFpr_etrk;
1186  fCandidateVariables[36] = nSigmaTPCka_etrk;
1187  fCandidateVariables[37] = nSigmaTOFka_etrk;
1188  fCandidateVariables[52] = nSigmaTPCpi_etrk;
1189  fCandidateVariables[53] = nSigmaTOFpi_etrk;
1190  }
1191  fCandidateVariables[38] = v0->MassK0Short();
1192 
1193  fCandidateVariables[54] = fVtx1->GetX();
1194  fCandidateVariables[55] = fVtx1->GetY();
1195  fCandidateVariables[56] = fVtx1->GetZ();
1196  fCandidateVariables[57] = v0->DecayVertexV0X();
1197  fCandidateVariables[58] = v0->DecayVertexV0Y();
1198  fCandidateVariables[59] = v0->DecayVertexV0Z();
1199 
1200  Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
1201  Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
1202  if(!anti_lambda_flag){
1203  fCandidateVariables[60] = lDcaPosToPrimVertex;
1204  fCandidateVariables[61] = lDcaNegToPrimVertex;
1205  }else{
1206  fCandidateVariables[60] = lDcaNegToPrimVertex;
1207  fCandidateVariables[61] = lDcaPosToPrimVertex;
1208  }
1209  fCandidateVariables[62] = v0->DcaV0Daughters();
1210  Double_t posVtx[3] = {0.,0.,0.};
1211  fVtx1->GetXYZ(posVtx);
1212  fCandidateVariables[63] = v0->CosPointingAngle(posVtx);
1213  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
1214  fCandidateVariables[64] = v0->DecayLengthV0(posVtx)*1.1157/ptotlam;
1215  fCandidateVariables[65] = v0->MassK0Short();
1216 
1217  if(trk) fCandidateVariables[68] = trk->GetITSClusterMap();
1218  if(cptrack) fCandidateVariables[69] = cptrack->GetITSClusterMap();
1219  if(cntrack) fCandidateVariables[70] = cntrack->GetITSClusterMap();
1220 
1224 
1225 
1226  if(fWriteVariableTree)
1227  fVariablesTree->Fill();
1228 
1229  Double_t cont[3];
1230  cont[0] = elobj->InvMass(2,pdgdg);
1231  cont[1] = elobj->Pt();
1232  cont[2] = fCentrality;
1233  fHistoEleLambdaMass->Fill(cont);
1234  Double_t cont2[3];
1235  cont2[0] = elobj->InvMass(2,pdgdg);
1236  cont2[1] = trk->Pt();
1237  cont2[2] = fCentrality;
1238  Double_t cont_eleptvseta[3];
1239  cont_eleptvseta[0] = trk->Pt();
1240  cont_eleptvseta[1] = trk->Eta();
1241  cont_eleptvseta[2] = fCentrality;
1242 
1243  Double_t cont_eleptvslambdapt[3];
1244  cont_eleptvslambdapt[0] = trk->Pt();
1245  cont_eleptvslambdapt[1] = v0->Pt();
1246  cont_eleptvslambdapt[2] = fCentrality;
1247 
1248  Double_t cont_eleptvsd0[3];
1249  cont_eleptvsd0[0] = trk->Pt();
1250  cont_eleptvsd0[1] = elobj->Getd0Prong(0)*trk->Charge();
1251  cont_eleptvsd0[2] = fCentrality;
1252 
1253 
1255  {
1256 
1257  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
1258  fHistoEleLambdaMassRS->Fill(cont);
1259  fHistoEleLambdaMassvsElePtRS->Fill(cont2);
1260  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtRS1->Fill(cont2);
1261  else fHistoEleLambdaMassvsElePtRS2->Fill(cont2);
1262  if(cont[0]<2.3){
1263  fHistoElePtRS->Fill(trk->Pt(),fCentrality);
1264  fHistoElePtvsEtaRS->Fill(cont_eleptvseta);
1265  fHistoElePtvsLambdaPtRS->Fill(cont_eleptvslambdapt);
1266  fHistoElePtvsd0RS->Fill(cont_eleptvsd0);
1267 
1268  for(Int_t ih=0;ih<17;ih++){
1269  Double_t cont_eleptvscutvars[3];
1270  cont_eleptvscutvars[0] = trk->Pt();
1271  cont_eleptvscutvars[2] = fCentrality;
1272 
1273  if(ih==0){
1274  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1275  }else if(ih==1){
1276  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1277  }else if(ih==2){
1278  cont_eleptvscutvars[1] = nSigmaTPCele;
1279  }else if(ih==3){
1280  cont_eleptvscutvars[1] = nSigmaTOFele;
1281  }else if(ih==4){
1282  cont_eleptvscutvars[1] = trk->Eta();
1283  }else if(ih==5){
1284  cont_eleptvscutvars[1] = trk->GetITSNcls();
1285  }else if(ih==6){
1286  if(!anti_lambda_flag)
1287  cont_eleptvscutvars[1] = v0->MassLambda();
1288  else
1289  cont_eleptvscutvars[1] = v0->MassAntiLambda();
1290  }else if(ih==7){
1291  Double_t lPosV0[3];
1292  lPosV0[0] = v0->DecayVertexV0X();
1293  lPosV0[1] = v0->DecayVertexV0Y();
1294  lPosV0[2] = v0->DecayVertexV0Z();
1295  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1296  }else if(ih==8){
1297  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
1298  }else if(ih==9){
1299  if(!anti_lambda_flag)
1300  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1301  else
1302  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1303  }else if(ih==10){
1304  if(!anti_lambda_flag)
1305  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1306  else
1307  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1308  }else if(ih==11){
1309  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
1310  }else if(ih==12){
1311  cont_eleptvscutvars[1] = v0->MassK0Short();
1312  }else if(ih==13){
1313  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1314  }else if(ih==14){
1315  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1316  }else if(ih==15){
1317  cont_eleptvscutvars[1] = v0->Eta();
1318  }else if(ih==16){
1319  Double_t v0px = elobj->PxProng(1);
1320  Double_t v0py = elobj->PyProng(1);
1321  Double_t v0pz = elobj->PzProng(1);
1322  Double_t epx = elobj->PxProng(0);
1323  Double_t epy = elobj->PyProng(0);
1324  Double_t epz = elobj->PzProng(0);
1325  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
1326  }else{
1327  cont_eleptvscutvars[1] = -9999.;
1328  }
1329 
1330  fHistoElePtvsCutVarsRS[ih]->Fill(cont_eleptvscutvars);
1331  }
1332  }
1333  }else if((trk->Charge()<0 && !anti_lambda_flag) || (trk->Charge()>0 && anti_lambda_flag)){
1334  fHistoEleLambdaMassWS->Fill(cont);
1335  fHistoEleLambdaMassvsElePtWS->Fill(cont2);
1336  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtWS1->Fill(cont2);
1337  else fHistoEleLambdaMassvsElePtWS2->Fill(cont2);
1338  if(cont[0]<2.3){
1339  fHistoElePtWS->Fill(trk->Pt(),fCentrality);
1340  fHistoElePtvsEtaWS->Fill(cont_eleptvseta);
1341  fHistoElePtvsLambdaPtWS->Fill(cont_eleptvslambdapt);
1342  fHistoElePtvsd0WS->Fill(cont_eleptvsd0);
1343 
1344  for(Int_t ih=0;ih<17;ih++){
1345  Double_t cont_eleptvscutvars[3];
1346  cont_eleptvscutvars[0] = trk->Pt();
1347  cont_eleptvscutvars[2] = fCentrality;
1348 
1349  if(ih==0){
1350  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1351  }else if(ih==1){
1352  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1353  }else if(ih==2){
1354  cont_eleptvscutvars[1] = nSigmaTPCele;
1355  }else if(ih==3){
1356  cont_eleptvscutvars[1] = nSigmaTOFele;
1357  }else if(ih==4){
1358  cont_eleptvscutvars[1] = trk->Eta();
1359  }else if(ih==5){
1360  cont_eleptvscutvars[1] = trk->GetITSNcls();
1361  }else if(ih==6){
1362  if(!anti_lambda_flag)
1363  cont_eleptvscutvars[1] = v0->MassLambda();
1364  else
1365  cont_eleptvscutvars[1] = v0->MassAntiLambda();
1366  }else if(ih==7){
1367  Double_t lPosV0[3];
1368  lPosV0[0] = v0->DecayVertexV0X();
1369  lPosV0[1] = v0->DecayVertexV0Y();
1370  lPosV0[2] = v0->DecayVertexV0Z();
1371  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1372  }else if(ih==8){
1373  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
1374  }else if(ih==9){
1375  if(!anti_lambda_flag)
1376  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1377  else
1378  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1379  }else if(ih==10){
1380  if(!anti_lambda_flag)
1381  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1382  else
1383  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1384  }else if(ih==11){
1385  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
1386  }else if(ih==12){
1387  cont_eleptvscutvars[1] = v0->MassK0Short();
1388  }else if(ih==13){
1389  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1390  }else if(ih==14){
1391  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1392  }else if(ih==15){
1393  cont_eleptvscutvars[1] = v0->Eta();
1394  }else if(ih==16){
1395  Double_t v0px = elobj->PxProng(1);
1396  Double_t v0py = elobj->PyProng(1);
1397  Double_t v0pz = elobj->PzProng(1);
1398  Double_t epx = elobj->PxProng(0);
1399  Double_t epy = elobj->PyProng(0);
1400  Double_t epz = elobj->PzProng(0);
1401  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
1402  }else{
1403  cont_eleptvscutvars[1] = -9999.;
1404  }
1405 
1406  fHistoElePtvsCutVarsWS[ih]->Fill(cont_eleptvscutvars);
1407  }
1408  }
1409  }
1410 
1411  if(fUseMCInfo){
1412  if(mclc){
1413  Int_t pdgcode = mclc->GetPdgCode();
1414  if(abs(pdgcode)==4122 && abs(mcpdgele_array[1])==4122 && abs(mcpdgv0_array[1])==4122){
1415  cont2[1] = mcele->Pt();
1416  fHistoEleLambdaMassMCS->Fill(cont);
1417  fHistoEleLambdaMassvsElePtMCS->Fill(cont2);
1418  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtMCS1->Fill(cont2);
1419  else fHistoEleLambdaMassvsElePtMCS2->Fill(cont2);
1420  if(cont[0]<2.3){
1421  fHistoElePtMCS->Fill(trk->Pt(),fCentrality);
1422  fHistoElePtvsEtaMCS->Fill(cont_eleptvseta);
1423  fHistoElePtvsLambdaPtMCS->Fill(cont_eleptvslambdapt);
1424  fHistoElePtvsd0MCS->Fill(cont_eleptvsd0);
1425 
1426  Double_t cont_eleptvslambdaptvslcpt[4];
1427  cont_eleptvslambdaptvslcpt[0] = cont_eleptvslambdapt[0];
1428  cont_eleptvslambdaptvslcpt[1] = cont_eleptvslambdapt[1];
1429  cont_eleptvslambdaptvslcpt[2] = mclc->Pt();
1430  cont_eleptvslambdaptvslcpt[3] = cont_eleptvslambdapt[2];
1431  fHistoElePtvsLambdaPtvsLcPtMCS->Fill(cont_eleptvslambdaptvslcpt);
1432 
1433  Int_t labmotherlc = mclc->GetMother();
1434  if(labmotherlc>=0){
1435  AliAODMCParticle *motherlc = (AliAODMCParticle*)mcArray->At(labmotherlc);
1436  Int_t pdgmotherlc = motherlc->GetPdgCode();
1437  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){
1438  fHistoElePtvsd0BFeeddownMCS->Fill(cont_eleptvsd0);
1439  }else{
1440  fHistoElePtvsd0PromptMCS->Fill(cont_eleptvsd0);
1441  }
1442  }else{
1443  fHistoElePtvsd0PromptMCS->Fill(cont_eleptvsd0);
1444  }
1445 
1446  for(Int_t ih=0;ih<17;ih++){
1447  Double_t cont_eleptvscutvars[3];
1448  cont_eleptvscutvars[0] = trk->Pt();
1449  cont_eleptvscutvars[2] = fCentrality;
1450 
1451  if(ih==0){
1452  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1453  }else if(ih==1){
1454  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1455  }else if(ih==2){
1456  cont_eleptvscutvars[1] = nSigmaTPCele;
1457  }else if(ih==3){
1458  cont_eleptvscutvars[1] = nSigmaTOFele;
1459  }else if(ih==4){
1460  cont_eleptvscutvars[1] = trk->Eta();
1461  }else if(ih==5){
1462  cont_eleptvscutvars[1] = trk->GetITSNcls();
1463  }else if(ih==6){
1464  if(!anti_lambda_flag)
1465  cont_eleptvscutvars[1] = v0->MassLambda();
1466  else
1467  cont_eleptvscutvars[1] = v0->MassAntiLambda();
1468  }else if(ih==7){
1469  Double_t lPosV0[3];
1470  lPosV0[0] = v0->DecayVertexV0X();
1471  lPosV0[1] = v0->DecayVertexV0Y();
1472  lPosV0[2] = v0->DecayVertexV0Z();
1473  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1474  }else if(ih==8){
1475  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
1476  }else if(ih==9){
1477  if(!anti_lambda_flag)
1478  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1479  else
1480  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1481  }else if(ih==10){
1482  if(!anti_lambda_flag)
1483  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1484  else
1485  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1486  }else if(ih==11){
1487  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
1488  }else if(ih==12){
1489  cont_eleptvscutvars[1] = v0->MassK0Short();
1490  }else if(ih==13){
1491  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1492  }else if(ih==14){
1493  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1494  }else if(ih==15){
1495  cont_eleptvscutvars[1] = v0->Eta();
1496  }else if(ih==16){
1497  Double_t v0px = elobj->PxProng(1);
1498  Double_t v0py = elobj->PyProng(1);
1499  Double_t v0pz = elobj->PzProng(1);
1500  Double_t epx = elobj->PxProng(0);
1501  Double_t epy = elobj->PyProng(0);
1502  Double_t epz = elobj->PzProng(0);
1503  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
1504  }else{
1505  cont_eleptvscutvars[1] = -9999.;
1506  }
1507 
1508  fHistoElePtvsCutVarsMCS[ih]->Fill(cont_eleptvscutvars);
1509  }
1510  }
1511  }
1512  if(abs(pdgcode)==4132 && abs(mcpdgele_array[1])==4132 && abs(mcpdgv0_array[1])==3312){
1515  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtFeeddownXic0MCS1->Fill(cont2);
1517  if(cont[0]<2.3){
1518  fHistoElePtFeeddownXic0MCS->Fill(trk->Pt(),fCentrality);
1519  fHistoElePtvsEtaFeeddownXic0MCS->Fill(cont_eleptvseta);
1520  fHistoElePtvsLambdaPtFeeddownXic0MCS->Fill(cont_eleptvslambdapt);
1521  }
1522  }
1523  if(abs(pdgcode)==4232 && abs(mcpdgele_array[1])==4232 && abs(mcpdgv0_array[1])==3322){
1526  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1->Fill(cont2);
1528  if(cont[0]<2.3){
1529  fHistoElePtFeeddownXicPlusMCS->Fill(trk->Pt(),fCentrality);
1530  fHistoElePtvsEtaFeeddownXicPlusMCS->Fill(cont_eleptvseta);
1531  fHistoElePtvsLambdaPtFeeddownXicPlusMCS->Fill(cont_eleptvslambdapt);
1532  }
1533  }
1534  }
1535  }
1536  }
1537 
1539  {
1540  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
1541  fHistoEleLambdaMassRSSide->Fill(cont);
1542  fHistoEleLambdaMassvsElePtRSSide->Fill(cont2);
1543  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtRSSide1->Fill(cont2);
1544  else fHistoEleLambdaMassvsElePtRSSide2->Fill(cont2);
1545  }else if((trk->Charge()<0 && !anti_lambda_flag) || (trk->Charge()>0 && anti_lambda_flag)){
1546  fHistoEleLambdaMassWSSide->Fill(cont);
1547  fHistoEleLambdaMassvsElePtWSSide->Fill(cont2);
1548  if(trk->Charge()>0) fHistoEleLambdaMassvsElePtWSSide1->Fill(cont2);
1549  else fHistoEleLambdaMassvsElePtWSSide2->Fill(cont2);
1550  }
1551  }
1552 
1553  return;
1554 }
1555 
1557 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMixROOTObjects(TLorentzVector *trke, TLorentzVector *v0, Int_t chargepr)
1558 {
1562  if(!trke) return;
1563  if(!v0) return;
1564 
1565  for(Int_t i=0;i<73;i++){
1566  fCandidateVariables[i] = -9999.;
1567  }
1568 
1569 
1570  Double_t pxe = trke->Px();
1571  Double_t pye = trke->Py();
1572  Double_t pze = trke->Pz();
1573  Double_t mome = sqrt(pxe*pxe+pye*pye+pze*pze);
1574  Double_t Ee = sqrt(mome*mome+0.000510998928*0.000510998928);
1575 
1576  Double_t pxv = v0->Px();
1577  Double_t pyv = v0->Py();
1578  Double_t pzv = v0->Pz();
1579  Double_t momv = sqrt(pxv*pxv+pyv*pyv+pzv*pzv);
1580  Double_t Ev = sqrt(momv*momv+1.115683*1.115683);
1581 
1582  Double_t cosoa = (pxe*pxv+pye*pyv+pze*pzv)/mome/momv;
1583 
1584  Double_t pxsum = pxe + pxv;
1585  Double_t pysum = pye + pyv;
1586  Double_t pzsum = pze + pzv;
1587  Double_t Esum = Ee + Ev;
1588 
1589  Double_t mel = sqrt(Esum*Esum-pxsum*pxsum-pysum*pysum-pzsum*pzsum);
1590 
1592  UInt_t pdgdg[2]={11,3122};
1593  fCandidateVariables[ 1] = mel;
1594  fCandidateVariables[ 2] = sqrt(pxsum*pxsum+pysum*pysum);
1595  fCandidateVariables[ 3] = pxsum;
1596  fCandidateVariables[ 4] = pysum;
1597  fCandidateVariables[ 5] = pzsum;
1598  fCandidateVariables[ 6] = pxe;
1599  fCandidateVariables[ 7] = pye;
1600  fCandidateVariables[ 8] = pze;
1601  fCandidateVariables[ 9] = pxv;
1602  fCandidateVariables[10] = pyv;
1603  fCandidateVariables[11] = pzv;
1604  if(chargepr>0){
1605  fCandidateVariables[12] = 0;
1606  fCandidateVariables[13] = v0->M();
1607  fCandidateVariables[14] = 0.;
1608  }else{
1609  fCandidateVariables[12] = 1;
1610  fCandidateVariables[13] = 0;
1611  fCandidateVariables[14] = v0->M();
1612  }
1613 
1614  fCandidateVariables[21] = trke->T();
1615 
1616  fCandidateVariables[32] = 1;
1617 
1618  fCandidateVariables[54] = fVtx1->GetX();
1619  fCandidateVariables[55] = fVtx1->GetY();
1620  fCandidateVariables[56] = fVtx1->GetZ();
1621 
1624 
1625 
1626  if(fWriteVariableTree)
1627  fVariablesTree->Fill();
1628 
1629  if(cosoa>0. && fAnalCuts->IsPeakRegion(v0))
1630  {
1631  Double_t cont[3];
1632  cont[0] = mel;
1633  cont[1] = sqrt(pxsum*pxsum+pysum*pysum);
1634  cont[2] = fCentrality;
1635  fHistoEleLambdaMass->Fill(cont);
1636  Double_t cont2[3];
1637  cont2[0] = mel;
1638  cont2[1] = sqrt(pxe*pxe+pye*pye);
1639  cont2[2] = fCentrality;
1640  Double_t cont_eleptvseta[3];
1641  cont_eleptvseta[0] = trke->Pt();
1642  cont_eleptvseta[1] = trke->Eta();
1643  cont_eleptvseta[2] = fCentrality;
1644 
1645  Double_t cont_eleptvslambdapt[3];
1646  cont_eleptvslambdapt[0] = trke->Pt();
1647  cont_eleptvslambdapt[1] = v0->Pt();
1648  cont_eleptvslambdapt[2] = fCentrality;
1649 
1650  Double_t cont_eleptvsd0[3];
1651  cont_eleptvsd0[0] = trke->Pt();
1652  cont_eleptvsd0[1] = 0.;
1653  cont_eleptvsd0[2] = fCentrality;
1654 
1655 
1656  if(((int)trke->T())*chargepr>0){
1657  fHistoEleLambdaMassRSMix->Fill(cont);
1658  fHistoEleLambdaMassvsElePtRSMix->Fill(cont2);
1659  if(trke->T()>0) fHistoEleLambdaMassvsElePtRSMix1->Fill(cont2);
1660  else fHistoEleLambdaMassvsElePtRSMix2->Fill(cont2);
1661  if(cont[0]<2.3){
1662  fHistoElePtRSMix->Fill(trke->Pt(),fCentrality);
1663  fHistoElePtvsEtaRSMix->Fill(cont_eleptvseta);
1664  fHistoElePtvsLambdaPtRSMix->Fill(cont_eleptvslambdapt);
1665  fHistoElePtvsd0RSMix->Fill(cont_eleptvsd0);
1666  }
1667  }else{
1668  fHistoEleLambdaMassWSMix->Fill(cont);
1669  fHistoEleLambdaMassvsElePtWSMix->Fill(cont2);
1670  if(trke->T()>0) fHistoEleLambdaMassvsElePtWSMix1->Fill(cont2);
1671  else fHistoEleLambdaMassvsElePtWSMix2->Fill(cont2);
1672  if(cont[0]<2.3){
1673  fHistoElePtWSMix->Fill(trke->Pt(),fCentrality);
1674  fHistoElePtvsEtaWSMix->Fill(cont_eleptvseta);
1675  fHistoElePtvsLambdaPtWSMix->Fill(cont_eleptvslambdapt);
1676  fHistoElePtvsd0WSMix->Fill(cont_eleptvsd0);
1677  }
1678  }
1679  }
1680 
1681  return;
1682 }
1685 {
1686  //
1688  //
1689 
1690  const char* nameoutput = GetOutputSlot(5)->GetContainer()->GetName();
1691  fEleVariablesTree = new TTree(nameoutput,"electron variables tree");
1692  Int_t nVar = 26;
1693  fCandidateEleVariables = new Float_t [nVar];
1694  TString * fCandidateVariableNames = new TString[nVar];
1695 
1696  fCandidateVariableNames[ 0]="ElePx";
1697  fCandidateVariableNames[ 1]="ElePy";
1698  fCandidateVariableNames[ 2]="ElePz";
1699  fCandidateVariableNames[ 3]="TPCChi2overNDF";
1700  fCandidateVariableNames[ 4]="ITSNcls";
1701  fCandidateVariableNames[ 5]="TPCNcls";
1702  fCandidateVariableNames[ 6]="TPCNclsPID";
1703  fCandidateVariableNames[ 7]="TPCNclsRatio";
1704  fCandidateVariableNames[ 8]="d0R";
1705  fCandidateVariableNames[ 9]="d0Z";
1706  fCandidateVariableNames[10]="ITSClusterMap";
1707  fCandidateVariableNames[11]="nSigmaTPCele";
1708  fCandidateVariableNames[12]="nSigmaTOFele";
1709  fCandidateVariableNames[13]="nSigmaTPCpi";
1710  fCandidateVariableNames[14]="nSigmaTPCka";
1711  fCandidateVariableNames[15]="nSigmaTPCpr";
1712  fCandidateVariableNames[16]="EvNumber";
1713  fCandidateVariableNames[17]="EleCharge";
1714  fCandidateVariableNames[18]="ElePdgCode";
1715  fCandidateVariableNames[19]="EleMotherPdgCode";
1716  fCandidateVariableNames[20]="mcelepx";
1717  fCandidateVariableNames[21]="mcelepy";
1718  fCandidateVariableNames[22]="mcelepz";
1719  fCandidateVariableNames[23]="Centrality";
1720  fCandidateVariableNames[24]="PrimVertZ";
1721  fCandidateVariableNames[25]="RunNumber";
1722 
1723  for (Int_t ivar=0; ivar<nVar; ivar++) {
1724  fEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1725  }
1726 
1727  return;
1728 }
1730 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillElectronROOTObjects(AliAODTrack *trk, TClonesArray *mcArray)
1731 {
1732  //
1734  //
1735 
1736  if(!trk) return;
1737 
1738  fHistoBachPt->Fill(trk->Pt());
1739  fHistoElectronQovPtvsPhi->Fill(trk->Phi(),(Double_t)trk->Charge()/trk->Pt());
1740 
1741  if(fDoEventMixing){
1742  fElectronTracks->AddLast(new TLorentzVector(trk->Px(),trk->Py(),trk->Pz(),trk->Charge()));
1743  }
1744 
1745  if(!fWriteEachVariableTree) return;
1746 
1747  Int_t pdgEle = -9999;
1748  Int_t pdgEleMother = -9999;
1749  Float_t mcelepx = -9999;
1750  Float_t mcelepy = -9999;
1751  Float_t mcelepz = -9999;
1752  if(fUseMCInfo)
1753  {
1754  Int_t labEle = trk->GetLabel();
1755  if(labEle<0) return;
1756  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
1757  if(!mcetrk) return;
1758  pdgEle = mcetrk->GetPdgCode();
1759  if(abs(pdgEle)!=11) return;
1760 
1761  fHistoBachPtMCS->Fill(trk->Pt());
1762 
1763  Bool_t hfe_flag = kFALSE;
1764  Int_t labemother = mcetrk->GetMother();
1765  if(labemother>=0){
1766  AliAODMCParticle *motherele = (AliAODMCParticle*)mcArray->At(labemother);
1767  pdgEleMother = motherele->GetPdgCode();
1768  if(abs(pdgEleMother)>4000&&abs(pdgEleMother)<4400){
1769  hfe_flag = kTRUE;
1770  }
1771  }
1772  if(!hfe_flag) return;
1773  mcelepx = mcetrk->Px();
1774  mcelepy = mcetrk->Py();
1775  mcelepz = mcetrk->Pz();
1776  }
1777 
1778  for(Int_t i=0;i<26;i++){
1779  fCandidateEleVariables[i] = -9999.;
1780  }
1781 
1782  fCandidateEleVariables[ 0] = trk->Px();
1783  fCandidateEleVariables[ 1] = trk->Py();
1784  fCandidateEleVariables[ 2] = trk->Pz();
1785  fCandidateEleVariables[ 3] = trk->Chi2perNDF();
1786  fCandidateEleVariables[ 4] = trk->GetITSNcls();
1787  fCandidateEleVariables[ 5] = trk->GetTPCncls();
1788  fCandidateEleVariables[ 6] = trk->GetTPCsignalN();
1789  if(trk->GetTPCNclsF()>0)
1790  fCandidateEleVariables[ 7] = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
1791 
1792  Double_t d0z0[2],covd0z0[3];
1793  trk->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);
1794 
1795  fCandidateEleVariables[ 8] = d0z0[0];
1796  fCandidateEleVariables[ 9] = d0z0[1];
1797  Int_t itsmap = trk->GetITSClusterMap();
1798  Int_t bit1 = 1;
1799  Int_t bit2 = 2;
1800  Bool_t spdfirst = (itsmap & bit1) == bit1;
1801  Bool_t spdsecond = (itsmap & bit2) == bit2;
1802  fCandidateEleVariables[10] = ((Int_t)spdfirst) + 2 * ((Int_t)spdsecond);
1803 
1804  if(fAnalCuts->GetIsUsePID())
1805  {
1806  Double_t nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
1807  Double_t nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
1808  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
1809  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
1810  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
1811  fCandidateEleVariables[11] = nSigmaTPCele;
1812  fCandidateEleVariables[12] = nSigmaTOFele;
1813  fCandidateEleVariables[13] = nSigmaTPCpi_etrk;
1814  fCandidateEleVariables[14] = nSigmaTPCka_etrk;
1815  fCandidateEleVariables[15] = nSigmaTPCpr_etrk;
1816  }
1818  fCandidateEleVariables[17] = trk->Charge();
1819  fCandidateEleVariables[18] = pdgEle;
1820  fCandidateEleVariables[19] = pdgEleMother;
1821  fCandidateEleVariables[20] = mcelepx;
1822  fCandidateEleVariables[21] = mcelepy;
1823  fCandidateEleVariables[22] = mcelepz;
1827 
1828  fHistod0Bach->Fill(d0z0[0]);
1829 
1830  fEleVariablesTree->Fill();
1831 }
1834 {
1835  //
1837  //
1838 
1839  const char* nameoutput = GetOutputSlot(6)->GetContainer()->GetName();
1840  fV0VariablesTree = new TTree(nameoutput,"v0 variables tree");
1841  Int_t nVar = 33;
1842  fCandidateV0Variables = new Float_t [nVar];
1843  TString * fCandidateVariableNames = new TString[nVar];
1844 
1845  fCandidateVariableNames[ 0]="V0Px";
1846  fCandidateVariableNames[ 1]="V0Py";
1847  fCandidateVariableNames[ 2]="V0Pz";
1848  fCandidateVariableNames[ 3]="MassLambda";
1849  fCandidateVariableNames[ 4]="MassAntiLambda";
1850  fCandidateVariableNames[ 5]="ProtonPx";
1851  fCandidateVariableNames[ 6]="ProtonPy";
1852  fCandidateVariableNames[ 7]="ProtonPz";
1853  fCandidateVariableNames[ 8]="PionPx";
1854  fCandidateVariableNames[ 9]="PionPy";
1855  fCandidateVariableNames[10]="PionPz";
1856  fCandidateVariableNames[11]="RfidV0";
1857  fCandidateVariableNames[12]="DcaV0PrToPrimVertex";
1858  fCandidateVariableNames[13]="DcaV0PiToPrimVertex";
1859  fCandidateVariableNames[14]="DcaV0daughters";
1860  fCandidateVariableNames[15]="V0CosPointingAngle";
1861  fCandidateVariableNames[16]="V0ProperDecayLength";
1862  fCandidateVariableNames[17]="MassK0Short";
1863  fCandidateVariableNames[18]="nSigmaTPCpr";
1864  fCandidateVariableNames[19]="nSigmaTPCpi";
1865  fCandidateVariableNames[20]="TPCNCrossV0Pr";
1866  fCandidateVariableNames[21]="TPCNCrossV0Pi";
1867  fCandidateVariableNames[22]="TPCNCrossRatioV0Pr";
1868  fCandidateVariableNames[23]="TPCNCrossRatioV0Pi";
1869  fCandidateVariableNames[24]="V0PdgCode";
1870  fCandidateVariableNames[25]="V0MotherPdgCode";
1871  fCandidateVariableNames[26]="mcv0px";
1872  fCandidateVariableNames[27]="mcv0py";
1873  fCandidateVariableNames[28]="mcv0pz";
1874  fCandidateVariableNames[29]="EvNumber";
1875  fCandidateVariableNames[30]="Centrality";
1876  fCandidateVariableNames[31]="PrimVertZ";
1877  fCandidateVariableNames[32]="RunNumber";
1878 
1879  for (Int_t ivar=0; ivar<nVar; ivar++) {
1880  fV0VariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateV0Variables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1881  }
1882 
1883  return;
1884 }
1885 
1887 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillV0ROOTObjects(AliAODv0 *v0, TClonesArray *mcArray)
1888 {
1889  //
1891  //
1892  if(!v0) return;
1893 
1894  if(TMath::Abs(v0->MassLambda()-1.1156)<fAnalCuts->GetProdV0MassTolLambdaRough()){
1895  fHistoLambdaMassvsPt->Fill(v0->MassLambda(),v0->Pt());
1896  }
1897  if(TMath::Abs(v0->MassAntiLambda()-1.1156)<fAnalCuts->GetProdV0MassTolLambdaRough()){
1898  fHistoLambdaMassvsPt->Fill(v0->MassAntiLambda(),v0->Pt());
1899  }
1900  fHistoK0sMassvsPt->Fill(v0->MassK0Short(),v0->Pt());
1901 
1902  Double_t momv0x = v0->MomV0X();
1903  Double_t momv0y = v0->MomV0Y();
1904  Double_t phi_alice = atan2(momv0y,momv0x);
1905  if(phi_alice<0.) phi_alice += 2 * M_PI;
1906  fHistoLambdaQovPtvsPhi->Fill(phi_alice,1./sqrt(momv0x*momv0x+momv0y*momv0y));
1907 
1908  Int_t v0pdgcode = -9999;
1909  Int_t v0motherpdgcode = -9999;
1910  Float_t mcv0px = -9999;
1911  Float_t mcv0py = -9999;
1912  Float_t mcv0pz = -9999;
1913  if(fUseMCInfo)
1914  {
1915  Int_t pdgdgv0[2]={2212,211};
1916  Int_t labV0 = v0->MatchToMC(3122,mcArray,2,pdgdgv0); // the V0
1917  if(labV0>=0){
1918  if(TMath::Abs(v0->MassLambda()-1.1156)<0.03){
1919  fHistoLambdaMassvsPtMCS->Fill(v0->MassLambda(),v0->Pt());
1920  }
1921  if(TMath::Abs(v0->MassAntiLambda()-1.1156)<0.03){
1922  fHistoLambdaMassvsPtMCS->Fill(v0->MassAntiLambda(),v0->Pt());
1923  }
1924  }
1925  if(labV0<0) return;
1926  AliAODMCParticle *mcv0trk = (AliAODMCParticle*)mcArray->At(labV0);
1927  if(!mcv0trk) return;
1928 
1929  Bool_t hfv0_flag = kFALSE;
1930  v0pdgcode = mcv0trk->GetPdgCode();
1931  Int_t labv0mother = mcv0trk->GetMother();
1932  if(labv0mother>=0){
1933  AliAODMCParticle *motherv0 = (AliAODMCParticle*)mcArray->At(labv0mother);
1934  if(motherv0){
1935  v0motherpdgcode = motherv0->GetPdgCode();
1936  if(abs(v0motherpdgcode)>4000&&abs(v0motherpdgcode)<4400){
1937  hfv0_flag = kTRUE;
1938  }
1939  }
1940  }
1941  if(!hfv0_flag) return;
1942  mcv0px = mcv0trk->Px();
1943  mcv0py = mcv0trk->Py();
1944  mcv0pz = mcv0trk->Pz();
1945  }
1946 
1947  if(fDoEventMixing){
1948  TLorentzVector *lv = new TLorentzVector();
1949  if(TMath::Abs(v0->MassLambda()-1.1156)<fAnalCuts->GetProdV0MassTolLambdaRough()){
1950  lv->SetXYZM(v0->Px(),v0->Py(),v0->Pz(),v0->MassLambda());
1951  fV0Tracks1->AddLast(lv);
1952  }else{
1953  lv->SetXYZM(v0->Px(),v0->Py(),v0->Pz(),v0->MassAntiLambda());
1954  fV0Tracks2->AddLast(lv);
1955  }
1956  }
1957 
1958 
1959  if(!fWriteEachVariableTree) return;
1960 
1961  for(Int_t i=0;i<32;i++){
1962  fCandidateV0Variables[i] = -9999.;
1963  }
1964 
1965  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
1966  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
1967  if(!cptrack) return;
1968  if(!cntrack) return;
1969  if(cptrack->Charge()<0 && cntrack->Charge()>0){
1970  cptrack = (AliAODTrack*)(v0->GetDaughter(1));
1971  cntrack = (AliAODTrack*)(v0->GetDaughter(0));
1972  }
1973  Double_t mlamPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
1974 
1975  fCandidateV0Variables[ 0] = v0->Px();
1976  fCandidateV0Variables[ 1] = v0->Py();
1977  fCandidateV0Variables[ 2] = v0->Pz();
1978  fCandidateV0Variables[ 3] = v0->MassLambda();
1979  fCandidateV0Variables[ 4] = v0->MassAntiLambda();
1980 
1981  Bool_t isparticle = kTRUE;
1982  if(fabs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambdaRough()) isparticle=kFALSE;
1983 
1984  if(isparticle){
1985  fCandidateV0Variables[ 5] = cptrack->Px();
1986  fCandidateV0Variables[ 6] = cptrack->Py();
1987  fCandidateV0Variables[ 7] = cptrack->Pz();
1988  fCandidateV0Variables[ 8] = cntrack->Px();
1989  fCandidateV0Variables[ 9] = cntrack->Py();
1990  fCandidateV0Variables[10] = cntrack->Pz();
1991  }else{
1992  fCandidateV0Variables[ 5] = cntrack->Px();
1993  fCandidateV0Variables[ 6] = cntrack->Py();
1994  fCandidateV0Variables[ 7] = cntrack->Pz();
1995  fCandidateV0Variables[ 8] = cptrack->Px();
1996  fCandidateV0Variables[ 9] = cptrack->Py();
1997  fCandidateV0Variables[10] = cptrack->Pz();
1998  }
1999 
2000  Double_t lPosV0[3];
2001  lPosV0[0] = v0->DecayVertexV0X();
2002  lPosV0[1] = v0->DecayVertexV0Y();
2003  lPosV0[2] = v0->DecayVertexV0Z();
2004  Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
2005  fCandidateV0Variables[11] = decayvertV0;
2006 
2007  Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
2008  Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
2009  if(isparticle){
2010  fCandidateV0Variables[12] = lDcaPosToPrimVertex;
2011  fCandidateV0Variables[13] = lDcaNegToPrimVertex;
2012  }else{
2013  fCandidateV0Variables[12] = lDcaNegToPrimVertex;
2014  fCandidateV0Variables[13] = lDcaPosToPrimVertex;
2015  }
2016  fCandidateV0Variables[14] = v0->DcaV0Daughters();
2017  Double_t posVtx[3] = {0.,0.,0.};
2018  fVtx1->GetXYZ(posVtx);
2019  fCandidateV0Variables[15] = v0->CosPointingAngle(posVtx);
2020  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
2021  fCandidateV0Variables[16] = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
2022  fCandidateV0Variables[17] = v0->MassK0Short();
2023 
2024  if(fAnalCuts->GetUseLambdaPID())
2025  {
2026  if(isparticle){
2027  Double_t nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
2028  Double_t nSigmaTPCv0pi = fAnalCuts->GetPidPion()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
2029  fCandidateV0Variables[18] = nSigmaTPCv0pr;
2030  fCandidateV0Variables[19] = nSigmaTPCv0pi;
2031  }else{
2032  Double_t nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
2033  Double_t nSigmaTPCv0pi = fAnalCuts->GetPidPion()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
2034  fCandidateV0Variables[18] = nSigmaTPCv0pr;
2035  fCandidateV0Variables[19] = nSigmaTPCv0pi;
2036  }
2037  }
2038  if(isparticle){
2039  fCandidateV0Variables[20] = cptrack->GetTPCClusterInfo(2,1);
2040  fCandidateV0Variables[21] = cntrack->GetTPCClusterInfo(2,1);
2041  if(cptrack->GetTPCNclsF()>0)
2042  fCandidateV0Variables[22] = (Float_t) cptrack->GetTPCClusterInfo(2,1)/(Float_t)cptrack->GetTPCNclsF();
2043  if(cntrack->GetTPCNclsF()>0)
2044  fCandidateV0Variables[23] =(Float_t) cntrack->GetTPCClusterInfo(2,1)/(Float_t)cntrack->GetTPCNclsF();
2045  }else{
2046  fCandidateV0Variables[20] = cntrack->GetTPCClusterInfo(2,1);
2047  fCandidateV0Variables[21] = cptrack->GetTPCClusterInfo(2,1);
2048  if(cntrack->GetTPCNclsF()>0)
2049  fCandidateV0Variables[22] = (Float_t) cntrack->GetTPCClusterInfo(2,1)/(Float_t)cntrack->GetTPCNclsF();
2050  if(cptrack->GetTPCNclsF()>0)
2051  fCandidateV0Variables[23] = (Float_t) cptrack->GetTPCClusterInfo(2,1)/(Float_t)cptrack->GetTPCNclsF();
2052  }
2053  fCandidateV0Variables[24] = v0pdgcode;
2054  fCandidateV0Variables[25] = v0motherpdgcode;
2055  fCandidateV0Variables[26] = mcv0px;
2056  fCandidateV0Variables[27] = mcv0py;
2057  fCandidateV0Variables[28] = mcv0pz;
2062 
2063 
2064  fV0VariablesTree->Fill();
2065 }
2068 {
2072 
2073  const char* nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
2074  fMCVariablesTree = new TTree(nameoutput,"MC variables tree");
2075  Int_t nVar = 11;
2076  fCandidateMCVariables = new Float_t [nVar];
2077  TString * fCandidateVariableNames = new TString[nVar];
2078 
2079  fCandidateVariableNames[ 0]="Centrality";
2080  fCandidateVariableNames[ 1]="DecayType";
2081  fCandidateVariableNames[ 2]="LcPx";
2082  fCandidateVariableNames[ 3]="LcPy";
2083  fCandidateVariableNames[ 4]="LcPz";
2084  fCandidateVariableNames[ 5]="ElePx";
2085  fCandidateVariableNames[ 6]="ElePy";
2086  fCandidateVariableNames[ 7]="ElePz";
2087  fCandidateVariableNames[ 8]="V0Px";
2088  fCandidateVariableNames[ 9]="V0Py";
2089  fCandidateVariableNames[10]="V0Pz";
2090 
2091  for (Int_t ivar=0; ivar<nVar; ivar++) {
2092  fMCVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2093  }
2094  return;
2095 }
2097 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCROOTObjects(AliAODMCParticle *mcpart, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype)
2098 {
2099  //
2101  //
2102  if(!mcpart) return;
2103  if(!mcepart) return;
2104  if(!mcv0part) return;
2105 
2106  for(Int_t i=0;i<11;i++){
2107  fCandidateMCVariables[i] = -9999.;
2108  }
2109 
2111  fCandidateMCVariables[ 1] = (Float_t) decaytype;
2112  fCandidateMCVariables[ 2] = mcpart->Px();
2113  fCandidateMCVariables[ 3] = mcpart->Py();
2114  fCandidateMCVariables[ 4] = mcpart->Pz();
2115  fCandidateMCVariables[ 5] = mcepart->Px();
2116  fCandidateMCVariables[ 6] = mcepart->Py();
2117  fCandidateMCVariables[ 7] = mcepart->Pz();
2118  fCandidateMCVariables[ 8] = mcv0part->Px();
2119  fCandidateMCVariables[ 9] = mcv0part->Py();
2120  fCandidateMCVariables[10] = mcv0part->Pz();
2121 
2122  Double_t epx = mcepart->Px();
2123  Double_t epy = mcepart->Py();
2124  Double_t epz = mcepart->Pz();
2125  Double_t eE = sqrt(epx*epx+epy*epy+epz*epz+0.000511*0.000511);
2126  Double_t v0px = mcv0part->Px();
2127  Double_t v0py = mcv0part->Py();
2128  Double_t v0pz = mcv0part->Pz();
2129  Double_t v0E = sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz+1.1157*1.1157);
2130 
2131  Double_t InvMassEleLambda = sqrt(pow(eE+v0E,2)-pow(epx+v0px,2)-pow(epy+v0py,2)-pow(epz+v0pz,2));
2132 
2133  Double_t cont[3];
2134  cont[0] = InvMassEleLambda;
2135  cont[1] = mcpart->Pt();
2136  cont[2] = fCentrality;
2137  Double_t cont2[3];
2138  cont2[0] = InvMassEleLambda;
2139  cont2[1] = mcepart->Pt();
2140  cont2[2] = fCentrality;
2141  Double_t cont_eleptvseta[3];
2142  cont_eleptvseta[0] = mcepart->Pt();
2143  cont_eleptvseta[1] = mcepart->Eta();
2144  cont_eleptvseta[2] = fCentrality;
2145  Double_t cont_eleptvslambdapt[3];
2146  cont_eleptvslambdapt[0] = mcepart->Pt();
2147  cont_eleptvslambdapt[1] = mcv0part->Pt();
2148  cont_eleptvslambdapt[2] = fCentrality;
2149  Double_t cont_eleptvslambdaptvslcpt[4];
2150  cont_eleptvslambdaptvslcpt[0] = mcepart->Pt();
2151  cont_eleptvslambdaptvslcpt[1] = mcv0part->Pt();
2152  cont_eleptvslambdaptvslcpt[2] = mcpart->Pt();
2153  cont_eleptvslambdaptvslcpt[3] = fCentrality;
2154  Double_t contmc[3];
2155  contmc[0] = mcpart->Pt();
2156  contmc[1] = mcpart->Y();
2157  contmc[2] = fCentrality;
2158  Double_t contmcele[3];
2159  contmcele[0] = mcepart->Pt();
2160  contmcele[1] = mcepart->Eta();
2161  contmcele[2] = fCentrality;
2162 
2163  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
2164  Float_t etamin, etamax;
2165  esdcuts->GetEtaRange(etamin,etamax);
2166 
2167  if(decaytype==0){
2168  fHistoLcMCGen->Fill(contmc);
2169  if(mcpart->GetPdgCode()>0) fHistoLcMCGen1->Fill(contmc);
2170  if(mcpart->GetPdgCode()<0) fHistoLcMCGen2->Fill(contmc);
2171  fHistoLcElectronMCGen->Fill(contmcele);
2172  if(mcepart->GetPdgCode()<0) fHistoLcElectronMCGen1->Fill(contmcele);
2173  if(mcepart->GetPdgCode()>0) fHistoLcElectronMCGen2->Fill(contmcele);
2174  fHistoEleLambdaMassMCGen->Fill(cont);
2175  if(fabs(mcepart->Eta())<etamax){
2176  fHistoEleLambdaMassvsElePtMCGen->Fill(cont2);
2177  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtMCGen1->Fill(cont2);
2178  else fHistoEleLambdaMassvsElePtMCGen2->Fill(cont2);
2179  if(InvMassEleLambda<2.3){
2180  fHistoElePtMCGen->Fill(mcepart->Pt(),fCentrality);
2181  fHistoElePtvsEtaMCGen->Fill(cont_eleptvseta);
2182  fHistoElePtvsLambdaPtMCGen->Fill(cont_eleptvslambdapt);
2183  }
2184  }
2185  if(fabs(mcpart->Y())<0.7){
2186  if(InvMassEleLambda<2.3){
2187  fHistoElePtvsLambdaPtMCLcGen->Fill(cont_eleptvslambdapt);
2188  fHistoElePtvsLambdaPtvsLcPtMCGen->Fill(cont_eleptvslambdaptvslcpt);
2189  }
2190  }
2191  }else if(decaytype==1){
2192  fHistoFeedDownXic0MCGen->Fill(contmc);
2193  if(mcpart->GetPdgCode()>0) fHistoFeedDownXic0MCGen1->Fill(contmc);
2194  if(mcpart->GetPdgCode()<0) fHistoFeedDownXic0MCGen2->Fill(contmc);
2196  fHistoElectronFeedDownXic0MCGen->Fill(contmcele);
2197  if(mcepart->GetPdgCode()<0) fHistoElectronFeedDownXic0MCGen1->Fill(contmcele);
2198  if(mcepart->GetPdgCode()>0) fHistoElectronFeedDownXic0MCGen2->Fill(contmcele);
2199  if(fabs(mcepart->Eta())<etamax){
2201  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1->Fill(cont2);
2203  if(InvMassEleLambda<2.3){
2204  fHistoElePtFeeddownXic0MCGen->Fill(mcepart->Pt(),fCentrality);
2205  fHistoElePtvsEtaFeeddownXic0MCGen->Fill(cont_eleptvseta);
2206  fHistoElePtvsLambdaPtFeeddownXic0MCGen->Fill(cont_eleptvslambdapt);
2207  }
2208  }
2209  }else if(decaytype==2){
2210  fHistoFeedDownXicPlusMCGen->Fill(contmc);
2211  if(mcpart->GetPdgCode()>0) fHistoFeedDownXicPlusMCGen1->Fill(contmc);
2212  if(mcpart->GetPdgCode()<0) fHistoFeedDownXicPlusMCGen2->Fill(contmc);
2214  fHistoElectronFeedDownXicPlusMCGen->Fill(contmcele);
2215  if(mcepart->GetPdgCode()<0) fHistoElectronFeedDownXicPlusMCGen1->Fill(contmcele);
2216  if(mcepart->GetPdgCode()>0) fHistoElectronFeedDownXicPlusMCGen2->Fill(contmcele);
2217  if(fabs(mcepart->Eta())<etamax){
2219  if(mcepart->GetPdgCode()<0) fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1->Fill(cont2);
2221  if(InvMassEleLambda<2.3){
2222  fHistoElePtFeeddownXicPlusMCGen->Fill(mcepart->Pt(),fCentrality);
2223  fHistoElePtvsEtaFeeddownXicPlusMCGen->Fill(cont_eleptvseta);
2224  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen->Fill(cont_eleptvslambdapt);
2225  }
2226  }
2227  }
2228 
2230  fMCVariablesTree->Fill();
2231 }
2234 {
2235  //
2236  // Define electron tree variables
2237  //
2238 
2239  const char* nameoutput = GetOutputSlot(9)->GetContainer()->GetName();
2240  fMCEleVariablesTree = new TTree(nameoutput,"MC Ele variables tree");
2241  Int_t nVar = 8;
2242  fCandidateMCEleVariables = new Float_t [nVar];
2243  TString * fCandidateVariableNames = new TString[nVar];
2244 
2245  fCandidateVariableNames[ 0]="Centrality";
2246  fCandidateVariableNames[ 1]="ElePx";
2247  fCandidateVariableNames[ 2]="ElePy";
2248  fCandidateVariableNames[ 3]="ElePz";
2249  fCandidateVariableNames[ 4]="ElePdgCode";
2250  fCandidateVariableNames[ 5]="EleMotherPdgCode";
2251  fCandidateVariableNames[ 6]="RunNumber";
2252  fCandidateVariableNames[ 7]="EvNumber";
2253 
2254  for (Int_t ivar=0; ivar<nVar; ivar++) {
2255  fMCEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2256  }
2257  return;
2258 }
2260 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
2261 {
2262  //
2263  // Fill tree depending on fWriteMCVariableTree
2264  //
2265  if(!mcepart) return;
2266 
2267  Bool_t hfe_flag = kFALSE;
2268  Int_t labemother = mcepart->GetMother();
2269  Int_t pdgmotherele = -9999;
2270  if(labemother>=0){
2271  AliAODMCParticle *motherele = (AliAODMCParticle*)mcArray->At(labemother);
2272  pdgmotherele = motherele->GetPdgCode();
2273  if(abs(pdgmotherele)>4000&&abs(pdgmotherele)<4400){
2274  hfe_flag = kTRUE;
2275  }
2276  }
2277  if(!hfe_flag) return;
2278 
2279  Double_t contmc[3];
2280  contmc[0] = mcepart->Pt();
2281  contmc[1] = mcepart->Eta();
2282  contmc[2] = fCentrality;
2283  fHistoElectronMCGen->Fill(contmc);
2284 
2285  for(Int_t i=0;i<8;i++){
2286  fCandidateMCEleVariables[i] = -9999.;
2287  }
2288 
2290  fCandidateMCEleVariables[ 1] = mcepart->Px();
2291  fCandidateMCEleVariables[ 2] = mcepart->Py();
2292  fCandidateMCEleVariables[ 3] = mcepart->Pz();
2293  fCandidateMCEleVariables[ 4] = mcepart->GetPdgCode();
2294  fCandidateMCEleVariables[ 5] = pdgmotherele;
2297 
2298 // if(fWriteMCVariableTree && fWriteEachVariableTree && mcepart->Pt()>0.4 && fabs(mcepart->Eta())<1.0 )
2299 // fMCEleVariablesTree->Fill();
2300 
2301 }
2304 {
2305  //
2306  // Define Mc v0 tree variables
2307  //
2308 
2309  const char* nameoutput = GetOutputSlot(10)->GetContainer()->GetName();
2310  fMCV0VariablesTree = new TTree(nameoutput,"MC v0 variables tree");
2311  Int_t nVar = 8;
2312  fCandidateMCV0Variables = new Float_t [nVar];
2313  TString * fCandidateVariableNames = new TString[nVar];
2314 
2315  fCandidateVariableNames[ 0]="Centrality";
2316  fCandidateVariableNames[ 1]="V0Px";
2317  fCandidateVariableNames[ 2]="V0Py";
2318  fCandidateVariableNames[ 3]="V0Pz";
2319  fCandidateVariableNames[ 4]="V0PdgCode";
2320  fCandidateVariableNames[ 5]="V0MotherPdgCode";
2321  fCandidateVariableNames[ 6]="RunNumber";
2322  fCandidateVariableNames[ 7]="EvNumber";
2323 
2324  for (Int_t ivar=0; ivar<nVar; ivar++) {
2325  fMCV0VariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCV0Variables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2326  }
2327  return;
2328 }
2330 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCV0ROOTObjects(AliAODMCParticle *mcv0part, TClonesArray *mcArray)
2331 {
2332  //
2333  // Fill histograms or tree depending on fWriteMCVariableTree
2334  //
2335  if(!mcv0part) return;
2336 
2337  for(Int_t i=0;i<8;i++){
2338  fCandidateMCV0Variables[i] = -9999.;
2339  }
2340 
2341  Bool_t hfv0_flag = kFALSE;
2342  Int_t labv0mother = mcv0part->GetMother();
2343  Int_t pdgmotherv0 = -9999;
2344  if(labv0mother>=0){
2345  AliAODMCParticle *motherv0 = (AliAODMCParticle*)mcArray->At(labv0mother);
2346  if(motherv0){
2347  pdgmotherv0 = motherv0->GetPdgCode();
2348  if(abs(pdgmotherv0)>4000&&abs(pdgmotherv0)<4400){
2349  hfv0_flag = kTRUE;
2350  }
2351  }
2352  }
2353  if(!hfv0_flag) return;
2354 
2355  Double_t contmc[3];
2356  contmc[0] = mcv0part->Pt();
2357  contmc[1] = mcv0part->Eta();
2358  contmc[2] = fCentrality;
2359  fHistoLambdaMCGen->Fill(contmc);
2360 
2362  fCandidateMCV0Variables[ 1] = mcv0part->Px();
2363  fCandidateMCV0Variables[ 2] = mcv0part->Py();
2364  fCandidateMCV0Variables[ 3] = mcv0part->Pz();
2365  fCandidateMCV0Variables[ 4] = mcv0part->GetPdgCode();
2366  fCandidateMCV0Variables[ 5] = pdgmotherv0;
2369 
2370  if(fWriteMCVariableTree && fWriteEachVariableTree && mcv0part->Pt()>0.4 && fabs(mcv0part->Eta())<1.0 )
2371  fMCV0VariablesTree->Fill();
2372 }
2373 
2374 
2377  //
2379  //
2380 
2381  fCEvents = new TH1F("fCEvents","conter",18,-0.5,17.5);
2382  fCEvents->SetStats(kTRUE);
2383  fCEvents->GetXaxis()->SetBinLabel(1,"X1");
2384  fCEvents->GetXaxis()->SetBinLabel(2,"Analyzed events");
2385  fCEvents->GetXaxis()->SetBinLabel(3,"AliAODVertex exists");
2386  fCEvents->GetXaxis()->SetBinLabel(4,"TriggerOK");
2387  fCEvents->GetXaxis()->SetBinLabel(5,"IsEventSelected");
2388  fCEvents->GetXaxis()->SetBinLabel(6,"CascadesHF exists");
2389  fCEvents->GetXaxis()->SetBinLabel(7,"MCarray exists");
2390  fCEvents->GetXaxis()->SetBinLabel(8,"MCheader exists");
2391  fCEvents->GetXaxis()->SetBinLabel(9,"triggerClass!=CINT1");
2392  fCEvents->GetXaxis()->SetBinLabel(10,"triggerMask!=kAnyINT");
2393  fCEvents->GetXaxis()->SetBinLabel(11,"triggerMask!=kAny");
2394  fCEvents->GetXaxis()->SetBinLabel(12,"vtxTitle.Contains(Z)");
2395  fCEvents->GetXaxis()->SetBinLabel(13,"vtxTitle.Contains(3D)");
2396  fCEvents->GetXaxis()->SetBinLabel(14,"vtxTitle.Doesn'tContain(Z-3D)");
2397  fCEvents->GetXaxis()->SetBinLabel(15,Form("zVtx<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
2398  fCEvents->GetXaxis()->SetBinLabel(16,"!IsEventSelected");
2399  fCEvents->GetXaxis()->SetBinLabel(17,"triggerMask!=kAnyINT || triggerClass!=CINT1");
2400  fCEvents->GetXaxis()->SetBinLabel(18,Form("zVtxMC<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
2401  //fCEvents->GetXaxis()->SetTitle("");
2402  fCEvents->GetYaxis()->SetTitle("counts");
2403 
2404  fHTrigger = new TH1F("fHTrigger","counter",18,-0.5,17.5);
2405  fHTrigger->SetStats(kTRUE);
2406  fHTrigger->GetXaxis()->SetBinLabel(1,"X1");
2407  fHTrigger->GetXaxis()->SetBinLabel(2,"kMB");
2408  fHTrigger->GetXaxis()->SetBinLabel(3,"kSemiCentral");
2409  fHTrigger->GetXaxis()->SetBinLabel(4,"kCentral");
2410  fHTrigger->GetXaxis()->SetBinLabel(5,"kINT7");
2411  fHTrigger->GetXaxis()->SetBinLabel(6,"kEMC7");
2412  //fHTrigger->GetXaxis()->SetBinLabel(7,"Space");
2413  fHTrigger->GetXaxis()->SetBinLabel(8,"kMB|kSemiCentral|kCentral");
2414  fHTrigger->GetXaxis()->SetBinLabel(9,"kINT7|kEMC7");
2415  fHTrigger->GetXaxis()->SetBinLabel(11,"kMB&kSemiCentral");
2416  fHTrigger->GetXaxis()->SetBinLabel(12,"kMB&kCentral");
2417  fHTrigger->GetXaxis()->SetBinLabel(13,"kINT7&kEMC7");
2418 
2419  fHCentrality = new TH1F("fHCentrality","conter",100,0.,100.);
2420 
2421 
2422  fOutput->Add(fCEvents);
2423  fOutput->Add(fHTrigger);
2424  fOutput->Add(fHCentrality);
2425 
2426  return;
2427 }
2428 //__________________________________________________________________________
2430 {
2431  //
2433  //
2434 
2435  //------------------------------------------------
2436  // Basic histogram
2437  //------------------------------------------------
2438  Int_t bins_base[3]= {10,100 ,10};
2439  Double_t xmin_base[3]={1.1,0 ,0.00};
2440  Double_t xmax_base[3]={3.1,10. ,100};
2441  fHistoEleLambdaMass = new THnSparseF("fHistoEleLambdaMass","",3,bins_base,xmin_base,xmax_base);
2443  fHistoEleLambdaMassRS = new THnSparseF("fHistoEleLambdaMassRS","",3,bins_base,xmin_base,xmax_base);
2445  fHistoEleLambdaMassWS = new THnSparseF("fHistoEleLambdaMassWS","",3,bins_base,xmin_base,xmax_base);
2447  fHistoEleLambdaMassRSMix = new THnSparseF("fHistoEleLambdaMassRSMix","",3,bins_base,xmin_base,xmax_base);
2449  fHistoEleLambdaMassWSMix = new THnSparseF("fHistoEleLambdaMassWSMix","",3,bins_base,xmin_base,xmax_base);
2451  fHistoEleLambdaMassRSSide = new THnSparseF("fHistoEleLambdaMassRSSide","",3,bins_base,xmin_base,xmax_base);
2453  fHistoEleLambdaMassWSSide = new THnSparseF("fHistoEleLambdaMassWSSide","",3,bins_base,xmin_base,xmax_base);
2455  fHistoEleLambdaMassvsElePtRS = new THnSparseF("fHistoEleLambdaMassvsElePtRS","",3,bins_base,xmin_base,xmax_base);
2457  fHistoEleLambdaMassvsElePtWS = new THnSparseF("fHistoEleLambdaMassvsElePtWS","",3,bins_base,xmin_base,xmax_base);
2459  fHistoEleLambdaMassvsElePtRSMix = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix","",3,bins_base,xmin_base,xmax_base);
2461  fHistoEleLambdaMassvsElePtWSMix = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix","",3,bins_base,xmin_base,xmax_base);
2463  fHistoEleLambdaMassvsElePtRSSide = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide","",3,bins_base,xmin_base,xmax_base);
2465  fHistoEleLambdaMassvsElePtWSSide = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide","",3,bins_base,xmin_base,xmax_base);
2467  fHistoEleLambdaMassvsElePtRS1 = new THnSparseF("fHistoEleLambdaMassvsElePtRS1","",3,bins_base,xmin_base,xmax_base);
2469  fHistoEleLambdaMassvsElePtWS1 = new THnSparseF("fHistoEleLambdaMassvsElePtWS1","",3,bins_base,xmin_base,xmax_base);
2471  fHistoEleLambdaMassvsElePtRSMix1 = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix1","",3,bins_base,xmin_base,xmax_base);
2473  fHistoEleLambdaMassvsElePtWSMix1 = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix1","",3,bins_base,xmin_base,xmax_base);
2475  fHistoEleLambdaMassvsElePtRSSide1 = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide1","",3,bins_base,xmin_base,xmax_base);
2477  fHistoEleLambdaMassvsElePtWSSide1 = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide1","",3,bins_base,xmin_base,xmax_base);
2479  fHistoEleLambdaMassvsElePtRS2 = new THnSparseF("fHistoEleLambdaMassvsElePtRS2","",3,bins_base,xmin_base,xmax_base);
2481  fHistoEleLambdaMassvsElePtWS2 = new THnSparseF("fHistoEleLambdaMassvsElePtWS2","",3,bins_base,xmin_base,xmax_base);
2483  fHistoEleLambdaMassvsElePtRSMix2 = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix2","",3,bins_base,xmin_base,xmax_base);
2485  fHistoEleLambdaMassvsElePtWSMix2 = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix2","",3,bins_base,xmin_base,xmax_base);
2487  fHistoEleLambdaMassvsElePtRSSide2 = new THnSparseF("fHistoEleLambdaMassvsElePtRSSide2","",3,bins_base,xmin_base,xmax_base);
2489  fHistoEleLambdaMassvsElePtWSSide2 = new THnSparseF("fHistoEleLambdaMassvsElePtWSSide2","",3,bins_base,xmin_base,xmax_base);
2491 
2492  fHistoEleLambdaMassMCS = new THnSparseF("fHistoEleLambdaMassMCS","",3,bins_base,xmin_base,xmax_base);
2494  fHistoEleLambdaMassMCGen = new THnSparseF("fHistoEleLambdaMassMCGen","",3,bins_base,xmin_base,xmax_base);
2496  fHistoEleLambdaMassvsElePtMCS = new THnSparseF("fHistoEleLambdaMassvsElePtMCS","",3,bins_base,xmin_base,xmax_base);
2498  fHistoEleLambdaMassvsElePtMCGen = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen","",3,bins_base,xmin_base,xmax_base);
2500  fHistoEleLambdaMassvsElePtMCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtMCS1","",3,bins_base,xmin_base,xmax_base);
2502  fHistoEleLambdaMassvsElePtMCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen1","",3,bins_base,xmin_base,xmax_base);
2504  fHistoEleLambdaMassvsElePtMCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtMCS2","",3,bins_base,xmin_base,xmax_base);
2506  fHistoEleLambdaMassvsElePtMCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen2","",3,bins_base,xmin_base,xmax_base);
2508 
2509  fHistoElePtRS = new TH2F("fHistoElePtRS","",100,0,10,10,0,100);
2510  fOutputAll->Add(fHistoElePtRS);
2511  fHistoElePtWS = new TH2F("fHistoElePtWS","",100,0.,10.,10,0,100);
2512  fOutputAll->Add(fHistoElePtWS);
2513  fHistoElePtRSMix = new TH2F("fHistoElePtRSMix","",100,0.,10.,10,0,100);
2515  fHistoElePtWSMix = new TH2F("fHistoElePtWSMix","",100,0.,10.,10,0,100);
2517  fHistoElePtMCS = new TH2F("fHistoElePtMCS","",100,0,10,10,0,100);
2518  fOutputAll->Add(fHistoElePtMCS);
2519  fHistoElePtMCGen = new TH2F("fHistoElePtMCGen","",100,0,10,10,0,100);
2521 
2522  Int_t bins_eleptvseta[3]= {50,20 ,10};
2523  Double_t xmin_eleptvseta[3]={0.,-1. ,0.0};
2524  Double_t xmax_eleptvseta[3]={5.,1. ,100};
2525 
2526  fHistoElePtvsEtaRS = new THnSparseF("fHistoElePtvsEtaRS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2528  fHistoElePtvsEtaWS = new THnSparseF("fHistoElePtvsEtaWS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2530  fHistoElePtvsEtaRSMix = new THnSparseF("fHistoElePtvsEtaRSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2532  fHistoElePtvsEtaWSMix = new THnSparseF("fHistoElePtvsEtaWSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2534  fHistoElePtvsEtaMCS = new THnSparseF("fHistoElePtvsEtaMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2536  fHistoElePtvsEtaMCGen = new THnSparseF("fHistoElePtvsEtaMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2538 
2539  Int_t bins_eleptvslambdapt[3]= {50,20 ,10};
2540  Double_t xmin_eleptvslambdapt[3]={0.,0. ,0.0};
2541  Double_t xmax_eleptvslambdapt[3]={5.,5. ,100};
2542 
2543  fHistoElePtvsLambdaPtRS = new THnSparseF("fHistoElePtvsLambdaPtRS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2545  fHistoElePtvsLambdaPtWS = new THnSparseF("fHistoElePtvsLambdaPtWS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2547  fHistoElePtvsLambdaPtRSMix = new THnSparseF("fHistoElePtvsLambdaPtRSMix","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2549  fHistoElePtvsLambdaPtWSMix = new THnSparseF("fHistoElePtvsLambdaPtWSMix","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2551  fHistoElePtvsLambdaPtMCS = new THnSparseF("fHistoElePtvsLambdaPtMCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2553  fHistoElePtvsLambdaPtMCGen = new THnSparseF("fHistoElePtvsLambdaPtMCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2555  fHistoElePtvsLambdaPtMCLcGen = new THnSparseF("fHistoElePtvsLambdaPtMCLcGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2557 
2558  Int_t bins_eleptvslambdaptvslcpt[4]= {50,20,10,10};
2559  Double_t xmin_eleptvslambdaptvslcpt[4]={0.,0.,0.,0.0};
2560  Double_t xmax_eleptvslambdaptvslcpt[4]={5.,5.,10.,100};
2561  fHistoElePtvsLambdaPtvsLcPtMCS = new THnSparseF("fHistoElePtvsLambdaPtvsLcPtMCS","",4,bins_eleptvslambdaptvslcpt,xmin_eleptvslambdaptvslcpt,xmax_eleptvslambdaptvslcpt);
2563  fHistoElePtvsLambdaPtvsLcPtMCGen = new THnSparseF("fHistoElePtvsLambdaPtvsLcPtMCGen","",4,bins_eleptvslambdaptvslcpt,xmin_eleptvslambdaptvslcpt,xmax_eleptvslambdaptvslcpt);
2565 
2566  Int_t bins_eleptvsd0[3]= {50 ,50 ,10};
2567  Double_t xmin_eleptvsd0[3]={0.,-0.2 ,0.0};
2568  Double_t xmax_eleptvsd0[3]={5.,0.2 ,100};
2569 
2570  fHistoElePtvsd0RS = new THnSparseF("fHistoElePtvsd0RS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2572  fHistoElePtvsd0WS = new THnSparseF("fHistoElePtvsd0WS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2574  fHistoElePtvsd0RSMix = new THnSparseF("fHistoElePtvsd0RSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2576  fHistoElePtvsd0WSMix = new THnSparseF("fHistoElePtvsd0WSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2578  fHistoElePtvsd0MCS = new THnSparseF("fHistoElePtvsd0MCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2580  fHistoElePtvsd0PromptMCS = new THnSparseF("fHistoElePtvsd0PromptMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2582  fHistoElePtvsd0BFeeddownMCS = new THnSparseF("fHistoElePtvsd0BFeeddownMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2584 
2585 
2586  //Feeddown from Xic0
2587  fHistoEleLambdaMassFeeddownXic0MCS = new THnSparseF("fHistoEleLambdaMassFeeddownXic0MCS","",3,bins_base,xmin_base,xmax_base);
2589  fHistoEleLambdaMassFeeddownXic0MCGen = new THnSparseF("fHistoEleLambdaMassFeeddownXic0MCGen","",3,bins_base,xmin_base,xmax_base);
2591  fHistoEleLambdaMassvsElePtFeeddownXic0MCS = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS","",3,bins_base,xmin_base,xmax_base);
2593  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen","",3,bins_base,xmin_base,xmax_base);
2595  fHistoEleLambdaMassvsElePtFeeddownXic0MCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS1","",3,bins_base,xmin_base,xmax_base);
2597  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1","",3,bins_base,xmin_base,xmax_base);
2599  fHistoEleLambdaMassvsElePtFeeddownXic0MCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS2","",3,bins_base,xmin_base,xmax_base);
2601  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2","",3,bins_base,xmin_base,xmax_base);
2603  fHistoElePtFeeddownXic0MCS = new TH2F("fHistoElePtFeeddownXic0MCS","",100,0,10,10,0,100);
2605  fHistoElePtFeeddownXic0MCGen = new TH2F("fHistoElePtFeeddownXic0MCGen","",100,0,10,10,0,100);
2607  fHistoElePtvsEtaFeeddownXic0MCS = new THnSparseF("fHistoElePtvsEtaFeeddownXic0MCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2609  fHistoElePtvsEtaFeeddownXic0MCGen = new THnSparseF("fHistoElePtvsEtaFeeddownXic0MCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2611  fHistoElePtvsLambdaPtFeeddownXic0MCS = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXic0MCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2613  fHistoElePtvsLambdaPtFeeddownXic0MCGen = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXic0MCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2615 
2616  //Feeddown from XicPlus
2617  fHistoEleLambdaMassFeeddownXicPlusMCS = new THnSparseF("fHistoEleLambdaMassFeeddownXicPlusMCS","",3,bins_base,xmin_base,xmax_base);
2619  fHistoEleLambdaMassFeeddownXicPlusMCGen = new THnSparseF("fHistoEleLambdaMassFeeddownXicPlusMCGen","",3,bins_base,xmin_base,xmax_base);
2621  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS","",3,bins_base,xmin_base,xmax_base);
2623  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen","",3,bins_base,xmin_base,xmax_base);
2625  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1","",3,bins_base,xmin_base,xmax_base);
2627  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1","",3,bins_base,xmin_base,xmax_base);
2629  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2","",3,bins_base,xmin_base,xmax_base);
2631  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2 = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2","",3,bins_base,xmin_base,xmax_base);
2633  fHistoElePtFeeddownXicPlusMCS = new TH2F("fHistoElePtFeeddownXicPlusMCS","",100,0,10,10,0,100);
2635  fHistoElePtFeeddownXicPlusMCGen = new TH2F("fHistoElePtFeeddownXicPlusMCGen","",100,0,10,10,0,100);
2637  fHistoElePtvsEtaFeeddownXicPlusMCS = new THnSparseF("fHistoElePtvsEtaFeeddownXicPlusMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2639  fHistoElePtvsEtaFeeddownXicPlusMCGen = new THnSparseF("fHistoElePtvsEtaFeeddownXicPlusMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2641  fHistoElePtvsLambdaPtFeeddownXicPlusMCS = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXicPlusMCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2643  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXicPlusMCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2645 
2646  //------------------------------------------------
2647  // checking histograms
2648  //------------------------------------------------
2649  fHistoBachPt = new TH1F("fHistoBachPt","Bachelor p_{T}",100,0.0,5.0);
2650  fOutputAll->Add(fHistoBachPt);
2651  fHistoBachPtMCS = new TH1F("fHistoBachPtMCS","Bachelor p_{T}",100,0.0,5.0);
2653  fHistoBachPtMCGen = new TH1F("fHistoBachPtMCGen","Bachelor p_{T}",100,0.0,5.0);
2655  fHistod0Bach = new TH1F("fHistod0Bach","Bachelor d_{0}",100,-0.5,0.5);
2656  fOutputAll->Add(fHistod0Bach);
2657  fHistoLambdaMassvsPt=new TH2F("fHistoLambdaMassvsPt","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
2659  fHistoLambdaMassvsPtMCS=new TH2F("fHistoLambdaMassvsPtMCS","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
2661  fHistoLambdaMassvsPtMCGen=new TH2F("fHistoLambdaMassvsPtMCGen","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
2663  fHistoK0sMassvsPt=new TH2F("fHistoK0sMassvsPt","K0s mass",100,0.497-0.05,0.497+0.05,20,0.,10.);
2665 
2666  fHistoElectronTPCPID=new TH2F("fHistoElectronTPCPID","",50,0.,5.,50,-20.,20.);
2668  fHistoElectronTOFPID=new TH2F("fHistoElectronTOFPID","",50,0.,5.,50,-20.,20.);
2670  fHistoElectronTPCSelPID=new TH2F("fHistoElectronTPCSelPID","",50,0.,5.,50,-20.,20.);
2672  fHistoElectronTOFSelPID=new TH2F("fHistoElectronTOFSelPID","",50,0.,5.,50,-20.,20.);
2674  fHistoElectronTPCPIDSelTOF=new TH2F("fHistoElectronTPCPIDSelTOF","",10,0.,5.,500,-10.,10.);
2676  fHistoElectronTPCPIDSelTOFSmallEta=new TH2F("fHistoElectronTPCPIDSelTOFSmallEta","",10,0.,5.,500,-10.,10.);
2678  fHistoElectronTPCPIDSelTOFLargeEta=new TH2F("fHistoElectronTPCPIDSelTOFLargeEta","",10,0.,5.,500,-10.,10.);
2680 
2681  for(Int_t i=0;i<8;i++){
2682  fHistoElectronTPCPIDSelTOFEtaDep[i]=new TH2F(Form("fHistoElectronTPCPIDSelTOFEtaDep[%d]",i),"",10,0.,5.,500,-10.,10.);
2684  }
2685  fHistoElectronQovPtvsPhi=new TH2F("fHistoElectronQovPtvsPhi","",70,0.,7.,50,-2.,2.);
2687  fHistoLambdaQovPtvsPhi=new TH2F("fHistoLambdaQovPtvsPhi","",70,0.,7.,50,-2.,2.);
2689 
2690  Int_t bins_lcmcgen[3]= {40 ,20 ,10};
2691  Double_t xmin_lcmcgen[3]={0.,-1.0 ,0.0};
2692  Double_t xmax_lcmcgen[3]={20.,1.0 ,100};
2693  fHistoLcMCGen = new THnSparseF("fHistoLcMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
2694  fOutputAll->Add(fHistoLcMCGen);
2695  fHistoLcMCGen1 = new THnSparseF("fHistoLcMCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
2696  fOutputAll->Add(fHistoLcMCGen1);
2697  fHistoLcMCGen2 = new THnSparseF("fHistoLcMCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
2698  fOutputAll->Add(fHistoLcMCGen2);
2699  fHistoFeedDownXic0MCGen = new THnSparseF("fHistoFeedDownXic0MCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
2701  fHistoFeedDownXic0MCGen1 = new THnSparseF("fHistoFeedDownXic0MCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
2703  fHistoFeedDownXic0MCGen2 = new THnSparseF("fHistoFeedDownXic0MCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
2705  fHistoFeedDownXicPlusMCGen = new THnSparseF("fHistoFeedDownXicPlusMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
2707  fHistoFeedDownXicPlusMCGen1 = new THnSparseF("fHistoFeedDownXicPlusMCGen1","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
2709  fHistoFeedDownXicPlusMCGen2 = new THnSparseF("fHistoFeedDownXicPlusMCGen2","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
2711 
2712  Int_t bins_elemcgen[3]= {100 ,20 ,10};
2713  Double_t xmin_elemcgen[3]={0.,-1.0 ,0.0};
2714  Double_t xmax_elemcgen[3]={10.,1.0 ,100};
2715  fHistoElectronMCGen = new THnSparseF("fHistoElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2717  fHistoLcElectronMCGen = new THnSparseF("fHistoLcElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2719  fHistoLcElectronMCGen1 = new THnSparseF("fHistoLcElectronMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2721  fHistoLcElectronMCGen2 = new THnSparseF("fHistoLcElectronMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2723  fHistoElectronFeedDownXic0MCGen = new THnSparseF("fHistoElectronFeedDownXic0MCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2725  fHistoElectronFeedDownXic0MCGen1 = new THnSparseF("fHistoElectronFeedDownXic0MCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2727  fHistoElectronFeedDownXic0MCGen2 = new THnSparseF("fHistoElectronFeedDownXic0MCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2729  fHistoElectronFeedDownXicPlusMCGen = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2731  fHistoElectronFeedDownXicPlusMCGen1 = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2733  fHistoElectronFeedDownXicPlusMCGen2 = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2735 
2736  Int_t bins_lambdamcgen[3]= {50 ,20 ,10};
2737  Double_t xmin_lambdamcgen[3]={0.,-1.0 ,0.0};
2738  Double_t xmax_lambdamcgen[3]={10.,1.0 ,100};
2739  fHistoLambdaMCGen = new THnSparseF("fHistoLambdaMCGen","",3,bins_lambdamcgen,xmin_lambdamcgen,xmax_lambdamcgen);
2741 
2742  fHistonEvtvsRunNumber=new TH1F("fHistonEvtvsRunNumber","",20000,-0.5,19999.5);
2744  fHistonElevsRunNumber=new TH1F("fHistonElevsRunNumber","",20000,-0.5,19999.5);
2746  fHistonLambdavsRunNumber=new TH1F("fHistonLambdavsRunNumber","",20000,-0.5,19999.5);
2748 
2749  for(Int_t ih=0;ih<17;ih++){
2750  Int_t bins_eleptvscutvars[3];
2751  Double_t xmin_eleptvscutvars[3];
2752  Double_t xmax_eleptvscutvars[3];
2753 
2754  bins_eleptvscutvars[0] = 50;//electron pT bin
2755  xmin_eleptvscutvars[0] = 0.;
2756  xmax_eleptvscutvars[0] = 5.;
2757  bins_eleptvscutvars[2] = 10;//centrality bin
2758  xmin_eleptvscutvars[2] = 0.;
2759  xmax_eleptvscutvars[2] = 100.;
2760 
2761  if(ih==0 || ih==1){
2762  //0: TPC Ncluster 1: TPC ncluster PID
2763  bins_eleptvscutvars[1] = 40;
2764  xmin_eleptvscutvars[1] = 0.;
2765  xmax_eleptvscutvars[1] = 160.;
2766  }else if(ih==2 || ih==3){
2767  //2: nSigma(TPC,e) 3: nSigma(TOF,e)
2768  bins_eleptvscutvars[1] = 20;
2769  xmin_eleptvscutvars[1] = -5.;
2770  xmax_eleptvscutvars[1] = 5.;
2771  }else if(ih==4){
2772  //4: eta
2773  bins_eleptvscutvars[1] = 30;
2774  xmin_eleptvscutvars[1] = -1.5;
2775  xmax_eleptvscutvars[1] = 1.5;
2776  }else if(ih==5){
2777  //5: nITS cluster
2778  bins_eleptvscutvars[1] = 7;
2779  xmin_eleptvscutvars[1] = -0.5;
2780  xmax_eleptvscutvars[1] = 6.5;
2781  }else if(ih==6){
2782  //6: Lambda mass
2783  bins_eleptvscutvars[1] = 50;
2784  xmin_eleptvscutvars[1] = 1.1156-0.03;
2785  xmax_eleptvscutvars[1] = 1.1156+0.03;
2786  }else if(ih==7){
2787  //7: Rfid Lambda
2788  bins_eleptvscutvars[1] = 20;
2789  xmin_eleptvscutvars[1] = 0.;
2790  xmax_eleptvscutvars[1] = 5.;
2791  }else if(ih==8){
2792  //10: Dca V0
2793  bins_eleptvscutvars[1] = 20;
2794  xmin_eleptvscutvars[1] = 0.;
2795  xmax_eleptvscutvars[1] = 2.;
2796  }else if(ih==9 || ih==10 ){
2797  //9: DCA V0pr to prim 10: DCA V0pi to prim
2798  bins_eleptvscutvars[1] = 20;
2799  xmin_eleptvscutvars[1] = 0.;
2800  xmax_eleptvscutvars[1] = 0.5;
2801  }else if(ih==11){
2802  //11: CosPAv0
2803  bins_eleptvscutvars[1] = 20;
2804  xmin_eleptvscutvars[1] = 0.95;
2805  xmax_eleptvscutvars[1] = 1.0;
2806  }else if(ih==12){
2807  //12:K0s masss
2808  bins_eleptvscutvars[1] = 50;
2809  xmin_eleptvscutvars[1] = 0.497-0.03;
2810  xmax_eleptvscutvars[1] = 0.497+0.03;
2811  }else if(ih==13 || ih==14){
2812  //13: nSigmaTPC(pr), nSigma(pi)
2813  bins_eleptvscutvars[1] = 20;
2814  xmin_eleptvscutvars[1] = -5;
2815  xmax_eleptvscutvars[1] = 5;
2816  }else if(ih==15){
2817  //15: eta
2818  bins_eleptvscutvars[1] = 30;
2819  xmin_eleptvscutvars[1] = -1.5;
2820  xmax_eleptvscutvars[1] = 1.5;
2821  }else if(ih==16){
2822  //16: Opening angle
2823  bins_eleptvscutvars[1] = 20;
2824  xmin_eleptvscutvars[1] = 0.;
2825  xmax_eleptvscutvars[1] = 3.141592/2;
2826  }
2827 
2828  fHistoElePtvsCutVarsRS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsRS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
2830  fHistoElePtvsCutVarsWS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsWS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
2832  fHistoElePtvsCutVarsMCS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsMCS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
2834  }
2835 
2836  return;
2837 }
2838 
2839 //________________________________________________________________________
2840 AliAODRecoCascadeHF* AliAnalysisTaskSELc2eleLambdafromAODtracks::MakeCascadeHF(AliAODv0 *v0, AliAODTrack *part, AliAODEvent * aod, AliAODVertex *secVert)
2841 {
2845 
2846  if(!v0) return 0x0;
2847  if(!part) return 0x0;
2848  if(!aod) return 0x0;
2849 
2850  //------------------------------------------------
2851  // PrimaryVertex
2852  //------------------------------------------------
2853  AliAODVertex *primVertexAOD;
2854  Bool_t unsetvtx = kFALSE;
2856  primVertexAOD = CallPrimaryVertex(v0,part,aod);
2857  if(!primVertexAOD){
2858  primVertexAOD = fVtx1;
2859  }else{
2860  unsetvtx = kTRUE;
2861  }
2862  }else{
2863  primVertexAOD = fVtx1;
2864  }
2865  if(!primVertexAOD) return 0x0;
2866  Double_t posprim[3]; primVertexAOD->GetXYZ(posprim);
2867 
2868  //------------------------------------------------
2869  // DCA between tracks
2870  //------------------------------------------------
2871  AliESDtrack *esdtrack = new AliESDtrack((AliVTrack*)part);
2872 
2873  AliNeutralTrackParam *trackV0=NULL;
2874  const AliVTrack *trackVV0 = dynamic_cast<const AliVTrack*>(v0);
2875  if(trackVV0) trackV0 = new AliNeutralTrackParam(trackVV0);
2876 
2877  Double_t xdummy, ydummy;
2878  Double_t dca = esdtrack->GetDCA(trackV0,fBzkG,xdummy,ydummy);
2879 
2880 
2881  //------------------------------------------------
2882  // Propagate all tracks to the secondary vertex and calculate momentum there
2883  //------------------------------------------------
2884 
2885  Double_t d0z0bach[2],covd0z0bach[3];
2886  if(sqrt(pow(secVert->GetX(),2)+pow(secVert->GetY(),2))<1.){
2887  part->PropagateToDCA(secVert,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
2888  trackV0->PropagateToDCA(secVert,fBzkG,kVeryBig);
2889  }else{
2890  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
2891  trackV0->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig);
2892  }
2893  Double_t momv0_new[3]={-9999,-9999,-9999.};
2894  trackV0->GetPxPyPz(momv0_new);
2895 
2896  Double_t px[2],py[2],pz[2];
2897  px[0] = part->Px(); py[0] = part->Py(); pz[0] = part->Pz();
2898  px[1] = momv0_new[0]; py[1] = momv0_new[1]; pz[1] = momv0_new[2];
2899 
2900  //------------------------------------------------
2901  // d0
2902  //------------------------------------------------
2903  Double_t d0[3],d0err[3];
2904 
2905  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
2906  d0[0]= d0z0bach[0];
2907  d0err[0] = TMath::Sqrt(covd0z0bach[0]);
2908 
2909  Double_t d0z0v0[2],covd0z0v0[3];
2910  trackV0->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0v0,covd0z0v0);
2911  d0[1]= d0z0v0[0];
2912  d0err[1] = TMath::Sqrt(covd0z0v0[0]);
2913 
2914  //------------------------------------------------
2915  // Create AliAODRecoCascadeHF
2916  //------------------------------------------------
2917  Short_t charge = part->Charge();
2918  AliAODRecoCascadeHF *theCascade = new AliAODRecoCascadeHF(secVert,charge,px,py,pz,d0,d0err,dca);
2919  if(!theCascade)
2920  {
2921  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
2922  if(esdtrack) delete esdtrack;
2923  if(trackV0) delete trackV0;
2924  return 0x0;
2925  }
2926  theCascade->SetOwnPrimaryVtx(primVertexAOD);
2927  UShort_t id[2]={(UShort_t)part->GetID(),(UShort_t)trackV0->GetID()};
2928  theCascade->SetProngIDs(2,id);
2929 
2930  theCascade->GetSecondaryVtx()->AddDaughter(part);
2931  theCascade->GetSecondaryVtx()->AddDaughter(v0);
2932 
2933  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
2934  if(esdtrack) delete esdtrack;
2935  if(trackV0) delete trackV0;
2936 
2937  return theCascade;
2938 }
2939 
2940 //________________________________________________________________________
2941 AliAODVertex* AliAnalysisTaskSELc2eleLambdafromAODtracks::CallPrimaryVertex(AliAODv0 *v0, AliAODTrack *trk, AliAODEvent* aod)
2942 {
2943  //
2946  //
2947 
2948  TObjArray *TrackArray = new TObjArray(3);
2949 
2950  AliESDtrack *cptrk1 = new AliESDtrack((AliVTrack*)trk);
2951  TrackArray->AddAt(cptrk1,0);
2952 
2953  AliESDtrack *cascptrack = new AliESDtrack((AliVTrack*)v0->GetDaughter(0));
2954  TrackArray->AddAt(cascptrack,1);
2955  AliESDtrack *cascntrack = new AliESDtrack((AliVTrack*)v0->GetDaughter(1));
2956  TrackArray->AddAt(cascntrack,2);
2957 
2958  AliAODVertex *newvert = PrimaryVertex(TrackArray,aod);
2959 
2960  for(Int_t i=0;i<3;i++)
2961  {
2962  AliESDtrack *tesd = (AliESDtrack*)TrackArray->UncheckedAt(i);
2963  delete tesd;
2964  }
2965  TrackArray->Clear();
2966  delete TrackArray;
2967 
2968  return newvert;
2969 }
2970 
2971 //________________________________________________________________________
2972 AliAODVertex* AliAnalysisTaskSELc2eleLambdafromAODtracks::PrimaryVertex(const TObjArray *trkArray,
2973  AliVEvent *event)
2974 {
2975  //
2978  //
2979 
2980  Bool_t fRecoPrimVtxSkippingTrks = kTRUE;
2981  Bool_t fRmTrksFromPrimVtx = kFALSE;
2982 
2983  AliESDVertex *vertexESD = 0;
2984  AliAODVertex *vertexAOD = 0;
2985 
2986  //vertexESD = new AliESDVertex(*fV1);
2987 
2988 
2989  if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) {
2990  // primary vertex from the input event
2991 
2992  vertexESD = new AliESDVertex(*fV1);
2993 
2994  } else {
2995  // primary vertex specific to this candidate
2996 
2997  Int_t nTrks = trkArray->GetEntriesFast();
2998  AliVertexerTracks *vertexer = new AliVertexerTracks(event->GetMagneticField());
2999 
3000  if(fRecoPrimVtxSkippingTrks) {
3001  // recalculating the vertex
3002 
3003  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraint")) {
3004  Float_t diamondcovxy[3];
3005  event->GetDiamondCovXY(diamondcovxy);
3006  Double_t pos[3]={event->GetDiamondX(),event->GetDiamondY(),0.};
3007  Double_t cov[6]={diamondcovxy[0],diamondcovxy[1],diamondcovxy[2],0.,0.,10.*10.};
3008  AliESDVertex *diamond = new AliESDVertex(pos,cov,1.,1);
3009  vertexer->SetVtxStart(diamond);
3010  delete diamond; diamond=NULL;
3011  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraintOnlyFitter"))
3012  vertexer->SetOnlyFitter();
3013  }
3014  Int_t skipped[1000];
3015  Int_t nTrksToSkip=0,id;
3016  AliExternalTrackParam *t = 0;
3017  for(Int_t i=0; i<nTrks; i++) {
3018  t = (AliExternalTrackParam*)trkArray->UncheckedAt(i);
3019  id = (Int_t)t->GetID();
3020  if(id<0) continue;
3021  skipped[nTrksToSkip++] = id;
3022  }
3023  // TEMPORARY FIX
3024  // For AOD, skip also tracks without covariance matrix
3025  Double_t covtest[21];
3026  for(Int_t j=0; j<event->GetNumberOfTracks(); j++) {
3027  AliVTrack *vtrack = (AliVTrack*)event->GetTrack(j);
3028  if(!vtrack->GetCovarianceXYZPxPyPz(covtest)) {
3029  id = (Int_t)vtrack->GetID();
3030  if(id<0) continue;
3031  skipped[nTrksToSkip++] = id;
3032  }
3033  }
3034  for(Int_t ijk=nTrksToSkip; ijk<1000; ijk++) skipped[ijk]=-1;
3035  //
3036  vertexer->SetSkipTracks(nTrksToSkip,skipped);
3037  vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(event);
3038 
3039  } else if(fRmTrksFromPrimVtx && nTrks>0) {
3040  // removing the prongs tracks
3041 
3042  TObjArray rmArray(nTrks);
3043  UShort_t *rmId = new UShort_t[nTrks];
3044  AliESDtrack *esdTrack = 0;
3045  AliESDtrack *t = 0;
3046  for(Int_t i=0; i<nTrks; i++) {
3047  t = (AliESDtrack*)trkArray->UncheckedAt(i);
3048  esdTrack = new AliESDtrack(*t);
3049  rmArray.AddLast(esdTrack);
3050  if(esdTrack->GetID()>=0) {
3051  rmId[i]=(UShort_t)esdTrack->GetID();
3052  } else {
3053  rmId[i]=9999;
3054  }
3055  }
3056  Float_t diamondxy[2]={static_cast<Float_t>(event->GetDiamondX()),static_cast<Float_t>(event->GetDiamondY())};
3057  vertexESD = vertexer->RemoveTracksFromVertex(fV1,&rmArray,rmId,diamondxy);
3058  delete [] rmId; rmId=NULL;
3059  rmArray.Delete();
3060 
3061  }
3062 
3063  delete vertexer; vertexer=NULL;
3064  if(!vertexESD) return vertexAOD;
3065  if(vertexESD->GetNContributors()<=0) {
3066  //AliDebug(2,"vertexing failed");
3067  delete vertexESD; vertexESD=NULL;
3068  return vertexAOD;
3069  }
3070 
3071 
3072  }
3073 
3074  // convert to AliAODVertex
3075  Double_t pos[3],cov[6],chi2perNDF;
3076  vertexESD->GetXYZ(pos); // position
3077  vertexESD->GetCovMatrix(cov); //covariance matrix
3078  chi2perNDF = vertexESD->GetChi2toNDF();
3079  delete vertexESD; vertexESD=NULL;
3080 
3081  vertexAOD = new AliAODVertex(pos,cov,chi2perNDF);
3082 
3083  return vertexAOD;
3084 }
3085 
3086 //________________________________________________________________________
3087 AliAODVertex* AliAnalysisTaskSELc2eleLambdafromAODtracks::ReconstructSecondaryVertex(AliAODv0 *v0, AliAODTrack *part, AliAODEvent * aod)
3088 {
3089  //
3090  // Reconstruct secondary vertex from trkArray (Copied from AliAnalysisVertexingHF)
3091  // Currently only returns Primary vertex (can we reconstruct secondary vertex from e - v0??)
3092  //
3093 
3094  AliAODVertex *primVertexAOD;
3095  Bool_t unsetvtx = kFALSE;
3097  primVertexAOD = CallPrimaryVertex(v0,part,aod);
3098  if(!primVertexAOD){
3099  primVertexAOD = fVtx1;
3100  }else{
3101  unsetvtx = kTRUE;
3102  }
3103  }else{
3104  primVertexAOD = fVtx1;
3105  }
3106  if(!primVertexAOD) return 0x0;
3107 
3108  AliESDVertex * vertexESD = new AliESDVertex(*fV1);
3109 
3110  Double_t pos[3],cov[6],chi2perNDF;
3111  vertexESD->GetXYZ(pos); // position
3112  vertexESD->GetCovMatrix(cov); //covariance matrix
3113  chi2perNDF = vertexESD->GetChi2toNDF();
3114  delete vertexESD; vertexESD=NULL;
3115 
3116  AliAODVertex *secVert = new AliAODVertex(pos,cov,chi2perNDF);
3117 
3118  return secVert;
3119 }
3120 //________________________________________________________________________
3121 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)
3122 {
3123  //
3124  // Match to MC
3125  //
3126  for(Int_t i=0;i<100;i++){
3127  pdgarray_ele[i] = -9999;
3128  labelarray_ele[i] = -9999;
3129  pdgarray_v0[i] = -9999;
3130  labelarray_v0[i] = -9999;
3131  }
3132  ngen_ele = 0;
3133  ngen_v0 = 0;
3134 
3135  AliVTrack *trk = dynamic_cast<AliVTrack*>(elobj->GetBachelor());
3136  if(!trk) return -1;
3137  Int_t labEle = trk->GetLabel();
3138  if(labEle<0) return -1;
3139  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
3140  if(!mcetrk) return -1;
3141  labelarray_ele[0] = labEle;
3142  pdgarray_ele[0] = mcetrk->GetPdgCode();
3143  ngen_ele ++;
3144 
3145  AliAODMCParticle *mcprimele=0;
3146  mcprimele = mcetrk;
3147  while(mcprimele->GetMother()>=0) {
3148  Int_t labprim_ele=mcprimele->GetMother();
3149  AliAODMCParticle *tmcprimele = (AliAODMCParticle*)mcArray->At(labprim_ele);
3150  if(!tmcprimele) {
3151  break;
3152  }
3153 
3154  mcprimele = tmcprimele;
3155  pdgarray_ele[ngen_ele] = mcprimele->GetPdgCode();
3156  labelarray_ele[ngen_ele] = labprim_ele;
3157  ngen_ele ++;
3158  if(ngen_ele==100) break;
3159  }
3160 
3161  AliAODv0 *theV0 = dynamic_cast<AliAODv0*>(elobj->Getv0());
3162  if(!theV0) return -1;
3163  Int_t pdgdgv0[2]={2212,211};
3164  Int_t labV0 = theV0->MatchToMC(3122,mcArray,2,pdgdgv0); // the V0
3165  if(labV0<0) return -1;
3166  AliAODMCParticle *mcv0 = (AliAODMCParticle*)mcArray->At(labV0);
3167  if(!mcv0) return -1;
3168  labelarray_v0[0] = labV0;
3169  pdgarray_v0[0] = mcv0->GetPdgCode();
3170  ngen_v0 ++;
3171 
3172  AliAODMCParticle *mcprimv0=0;
3173  mcprimv0 = mcv0;
3174  while(mcprimv0->GetMother()>=0) {
3175  Int_t labprim_v0=mcprimv0->GetMother();
3176  AliAODMCParticle *tmcprimv0 = (AliAODMCParticle*)mcArray->At(labprim_v0);
3177  if(!tmcprimv0) {
3178  break;
3179  }
3180 
3181  mcprimv0 = tmcprimv0;
3182  pdgarray_v0[ngen_v0] = mcprimv0->GetPdgCode();
3183  labelarray_v0[ngen_v0] = labprim_v0;
3184  ngen_v0 ++;
3185  if(ngen_v0==100) break;
3186  }
3187 
3188  Bool_t same_flag = kFALSE;
3189  Int_t matchedlabel=-9999;
3190  for(Int_t iemc=0;iemc<ngen_ele;iemc++){
3191  for(Int_t ivmc=0;ivmc<ngen_v0;ivmc++){
3192  if(labelarray_ele[iemc]==labelarray_v0[ivmc]){
3193  same_flag = kTRUE;
3194  matchedlabel = labelarray_ele[iemc];
3195  break;
3196  }
3197  }
3198  if(same_flag) break;
3199  }
3200 
3201  return matchedlabel;
3202 
3203 }
3204 //________________________________________________________________________
3205 void AliAnalysisTaskSELc2eleLambdafromAODtracks::SelectTrack( const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks,Bool_t *seleFlags, TClonesArray *mcArray)
3206 {
3207  //
3208  // Select good tracks using fAnalCuts (AliRDHFCuts object) and return the array of their ids
3209  //
3210 
3211  if(trkEntries==0) return;
3212 
3213  nSeleTrks=0;
3214  for(Int_t i=0; i<trkEntries; i++) {
3215  seleFlags[i] = kFALSE;
3216 
3217  AliVTrack *track;
3218  track = (AliVTrack*)event->GetTrack(i);
3219 
3220  if(track->GetID()<0) continue;
3221  Double_t covtest[21];
3222  if(!track->GetCovarianceXYZPxPyPz(covtest)) continue;
3223 
3224  AliAODTrack *aodt = (AliAODTrack*)track;
3225  Double_t nsigma_tpcele = -9999;
3226  Double_t nsigma_tofele = -9999;
3227  if(fAnalCuts->GetIsUsePID()){
3228  nsigma_tpcele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(aodt,AliPID::kElectron);
3229  nsigma_tofele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(aodt,AliPID::kElectron);
3230  }
3231 
3232  if(!fAnalCuts) continue;
3233  if(fAnalCuts->SingleTrkCutsNoPID(aodt,fVtx1)){
3234  fHistoElectronTPCPID->Fill(aodt->Pt(),nsigma_tpcele);
3235  fHistoElectronTOFPID->Fill(aodt->Pt(),nsigma_tofele);
3236  if(fabs(nsigma_tofele)<3.){
3237  fHistoElectronTPCPIDSelTOF->Fill(aodt->Pt(),nsigma_tpcele);
3238  Double_t eleeta = aodt->Eta();
3239  if(fabs(eleeta)<0.6)
3240  fHistoElectronTPCPIDSelTOFSmallEta->Fill(aodt->Pt(),nsigma_tpcele);
3241  if(fabs(eleeta)>0.6 && fabs(eleeta)<0.8)
3242  fHistoElectronTPCPIDSelTOFLargeEta->Fill(aodt->Pt(),nsigma_tpcele);
3243  if(eleeta>-0.8 && eleeta<-0.6){
3244  fHistoElectronTPCPIDSelTOFEtaDep[0]->Fill(aodt->Pt(),nsigma_tpcele);
3245  }else if(eleeta>-0.6&&eleeta<-0.4){
3246  fHistoElectronTPCPIDSelTOFEtaDep[1]->Fill(aodt->Pt(),nsigma_tpcele);
3247  }else if(eleeta>-0.4&&eleeta<-0.2){
3248  fHistoElectronTPCPIDSelTOFEtaDep[2]->Fill(aodt->Pt(),nsigma_tpcele);
3249  }else if(eleeta>-0.2&&eleeta<0.0){
3250  fHistoElectronTPCPIDSelTOFEtaDep[3]->Fill(aodt->Pt(),nsigma_tpcele);
3251  }else if(eleeta>0.0&&eleeta<0.2){
3252  fHistoElectronTPCPIDSelTOFEtaDep[4]->Fill(aodt->Pt(),nsigma_tpcele);
3253  }else if(eleeta>0.2&&eleeta<0.4){
3254  fHistoElectronTPCPIDSelTOFEtaDep[5]->Fill(aodt->Pt(),nsigma_tpcele);
3255  }else if(eleeta>0.4&&eleeta<0.6){
3256  fHistoElectronTPCPIDSelTOFEtaDep[6]->Fill(aodt->Pt(),nsigma_tpcele);
3257  }else if(eleeta>0.6&&eleeta<0.8){
3258  fHistoElectronTPCPIDSelTOFEtaDep[7]->Fill(aodt->Pt(),nsigma_tpcele);
3259  }
3260  }
3261  }
3262  if(fAnalCuts->SingleTrkCuts(aodt,fVtx1)){
3263  seleFlags[i]=kTRUE;
3264  nSeleTrks++;
3265  fHistoElectronTPCSelPID->Fill(aodt->Pt(),nsigma_tpcele);
3266  fHistoElectronTOFSelPID->Fill(aodt->Pt(),nsigma_tofele);
3267  FillElectronROOTObjects(aodt,mcArray);
3268  }
3269 
3270  } // end loop on tracks
3271 }
3272 //________________________________________________________________________
3273 void AliAnalysisTaskSELc2eleLambdafromAODtracks::SelectV0( const AliVEvent *event,Int_t nV0s,Int_t &nSeleV0, Bool_t *seleV0Flags, TClonesArray *mcArray)
3274 {
3275  //
3276  // Select good V0 using fAnalCuts (AliRDHFCuts object) and return the array of their ids
3277  //
3278 
3279  nSeleV0 = 0;
3280  for(Int_t iv0=0;iv0<nV0s;iv0++)
3281  {
3282  seleV0Flags[iv0] = kFALSE;
3283  AliAODv0 *v0 = ((AliAODEvent*)event)->GetV0(iv0);
3284 
3285  if(!fAnalCuts) continue;
3286  if(fAnalCuts->SingleV0Cuts(v0,fVtx1)){
3287  seleV0Flags[iv0] = kTRUE;
3288  nSeleV0++;
3289 
3290  FillV0ROOTObjects(v0, mcArray);
3291  }
3292  }
3293 }
3294 //_________________________________________________________________
3296  //
3297  // check in which of the pools the current event falls
3298  //
3299 
3300  Int_t theBinZ=TMath::BinarySearch(fNzVtxBins,fZvtxBins,zvert);
3301  if(theBinZ<0 || theBinZ>=fNzVtxBins) return -1;
3302  Int_t theBinM=TMath::BinarySearch(fNCentBins,fCentBins,mult);
3303  if(theBinM<0 || theBinM>=fNCentBins) return -1;
3304  return fNCentBins*theBinZ+theBinM;
3305 }
3306 //_________________________________________________________________
3308  //
3309  // delete the contets of the pool
3310  //
3311  if(poolIndex<0 || poolIndex>=fNOfPools) return;
3312  delete fEventBuffer[poolIndex];
3313  fEventBuffer[poolIndex]=new TTree(Form("EventBuffer_%d",poolIndex), "Temporary buffer for event mixing");
3314 
3315  fEventBuffer[poolIndex]->Branch("zVertex", &fVtxZ);
3316  fEventBuffer[poolIndex]->Branch("centrality", &fCentrality);
3317  fEventBuffer[poolIndex]->Branch("eventInfo", "TObjString",&fEventInfo);
3318  fEventBuffer[poolIndex]->Branch("v1array", "TObjArray", &fV0Tracks1);
3319  fEventBuffer[poolIndex]->Branch("v2array", "TObjArray", &fV0Tracks2);
3320 
3321  return;
3322 }
3323 //_________________________________________________________________
3325 {
3326  //
3327  // perform mixed event analysis
3328  //
3329 
3330  if(poolIndex<0 || poolIndex>fNzVtxBins*fNCentBins) return;
3331  if(fEventBuffer[poolIndex]->GetEntries()<fNumberOfEventsForMixing) return;
3332 
3333  Int_t nEle = fElectronTracks->GetEntries();
3334  Int_t nEvents=fEventBuffer[poolIndex]->GetEntries();
3335 
3336  TObjArray* v1array=0x0;
3337  TObjArray* v2array=0x0;
3338  Float_t zVertex,cent;
3339  TObjString* eventInfo=0x0;
3340  fEventBuffer[poolIndex]->SetBranchAddress("eventInfo",&eventInfo);
3341  fEventBuffer[poolIndex]->SetBranchAddress("zVertex", &zVertex);
3342  fEventBuffer[poolIndex]->SetBranchAddress("centrality", &cent);
3343  fEventBuffer[poolIndex]->SetBranchAddress("v1array", &v1array);
3344  fEventBuffer[poolIndex]->SetBranchAddress("v2array", &v2array);
3345  for (Int_t i=0; i<nEle; i++)
3346  {
3347  TLorentzVector* trke=(TLorentzVector*) fElectronTracks->At(i);
3348  if(!trke)continue;
3349 
3350  for(Int_t iEv=0; iEv<fNumberOfEventsForMixing; iEv++){
3351  fEventBuffer[poolIndex]->GetEvent(iEv + nEvents - fNumberOfEventsForMixing);
3352 
3353  TObjArray* v1array1=(TObjArray*)v1array->Clone();
3354  Int_t nV01=v1array1->GetEntries();
3355  for(Int_t iTr1=0; iTr1<nV01; iTr1++){
3356  TLorentzVector* v01=(TLorentzVector*)v1array1->At(iTr1);
3357  if(!v01) continue;
3358  FillMixROOTObjects(trke,v01,1);
3359  }//v0 loop
3360 
3361  TObjArray* v2array1=(TObjArray*)v2array->Clone();
3362  Int_t nV02=v2array1->GetEntries();
3363  for(Int_t iTr2=0; iTr2<nV02; iTr2++){
3364  TLorentzVector* v02=(TLorentzVector*)v2array1->At(iTr2);
3365  if(!v02) continue;
3366  FillMixROOTObjects(trke,v02,-1);
3367  }//v0 loop
3368 
3369  delete v1array1;
3370  delete v2array1;
3371  }//event loop
3372 
3373  }//track loop
3374 }
3375 //_________________________________________________________________
3377 {
3378  //
3379  // Analyze AliAODmcparticle
3380  //
3381 
3382  Int_t nmcpart = mcArray->GetEntriesFast();
3383  for(Int_t i=0;i<nmcpart;i++)
3384  {
3385  AliAODMCParticle *mcpart = (AliAODMCParticle*) mcArray->At(i);
3386  if(TMath::Abs(mcpart->GetPdgCode())==4122){
3387  //cout<<"Lambdac"<<endl;
3388  Bool_t e_flag = kFALSE;
3389  Bool_t lam_flag = kFALSE;
3390  AliAODMCParticle *mcepart = 0;
3391  AliAODMCParticle *mcv0part = 0;
3392  for(Int_t idau=mcpart->GetFirstDaughter();idau<mcpart->GetLastDaughter()+1;idau++)
3393  {
3394  if(idau<0) break;
3395  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
3396  if(!mcdau) continue;
3397  if(TMath::Abs(mcdau->GetPdgCode())==11){
3398  e_flag = kTRUE;
3399  mcepart = mcdau;
3400  }
3401  if(TMath::Abs(mcdau->GetPdgCode())==3122){
3402  lam_flag = kTRUE;
3403  mcv0part = mcdau;
3404  }
3405  }
3406 
3407  Int_t decaytype = -9999;
3408  if(e_flag && lam_flag) decaytype = 0;
3409 
3410  FillMCROOTObjects(mcpart,mcepart,mcv0part,decaytype);
3411  }
3412  if(TMath::Abs(mcpart->GetPdgCode())==4132){
3413  //cout<<"Lambdac"<<endl;
3414  Bool_t e_flag = kFALSE;
3415  Bool_t xi_flag = kFALSE;
3416  Bool_t lam_flag = kFALSE;
3417  AliAODMCParticle *mcepart = 0;
3418  AliAODMCParticle *mccascpart = 0;
3419  AliAODMCParticle *mcv0part = 0;
3420  for(Int_t idau=mcpart->GetFirstDaughter();idau<mcpart->GetLastDaughter()+1;idau++)
3421  {
3422  if(idau<0) break;
3423  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
3424  if(!mcdau) continue;
3425  if(TMath::Abs(mcdau->GetPdgCode())==11){
3426  e_flag = kTRUE;
3427  mcepart = mcdau;
3428  }
3429  if(TMath::Abs(mcdau->GetPdgCode())==3312){
3430  xi_flag = kTRUE;
3431  mccascpart = mcdau;
3432  for(Int_t idauxi=mccascpart->GetFirstDaughter();idauxi<mccascpart->GetLastDaughter()+1;idauxi++)
3433  {
3434  if(idauxi<0) break;
3435  AliAODMCParticle *mcdauxi = (AliAODMCParticle*) mcArray->At(idauxi);
3436  if(!mcdauxi) continue;
3437  if(TMath::Abs(mcdauxi->GetPdgCode())==3122){
3438  lam_flag = kTRUE;
3439  mcv0part = mcdauxi;
3440  }
3441  }
3442  }
3443  }
3444  Int_t decaytype = -9999;
3445  if(e_flag && xi_flag && lam_flag) decaytype = 1;
3446 
3447  FillMCROOTObjects(mcpart,mcepart,mcv0part,decaytype);
3448  }
3449  if(TMath::Abs(mcpart->GetPdgCode())==4232){
3450  //cout<<"Lambdac"<<endl;
3451  Bool_t e_flag = kFALSE;
3452  Bool_t xi_flag = kFALSE;
3453  Bool_t lam_flag = kFALSE;
3454  AliAODMCParticle *mcepart = 0;
3455  AliAODMCParticle *mccascpart = 0;
3456  AliAODMCParticle *mcv0part = 0;
3457  for(Int_t idau=mcpart->GetFirstDaughter();idau<mcpart->GetLastDaughter()+1;idau++)
3458  {
3459  if(idau<0) break;
3460  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
3461  if(!mcdau) continue;
3462  if(TMath::Abs(mcdau->GetPdgCode())==11){
3463  e_flag = kTRUE;
3464  mcepart = mcdau;
3465  }
3466  if(TMath::Abs(mcdau->GetPdgCode())==3322){
3467  xi_flag = kTRUE;
3468  mccascpart = mcdau;
3469  for(Int_t idauxi=mccascpart->GetFirstDaughter();idauxi<mccascpart->GetLastDaughter()+1;idauxi++)
3470  {
3471  if(idauxi<0) break;
3472  AliAODMCParticle *mcdauxi = (AliAODMCParticle*) mcArray->At(idauxi);
3473  if(!mcdauxi) continue;
3474  if(TMath::Abs(mcdauxi->GetPdgCode())==3122){
3475  lam_flag = kTRUE;
3476  mcv0part = mcdauxi;
3477  }
3478  }
3479  }
3480  }
3481  Int_t decaytype = -9999;
3482  if(e_flag && xi_flag && lam_flag) decaytype = 2;
3483 
3484  FillMCROOTObjects(mcpart,mcepart,mcv0part,decaytype);
3485  }
3486 
3487  if(TMath::Abs(mcpart->GetPdgCode())==11 && mcpart->GetStatus()==1){
3488  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
3489  Float_t etamin, etamax;
3490  esdcuts->GetEtaRange(etamin,etamax);
3491  if(fabs(mcpart->Eta())<etamax){
3492  fHistoBachPtMCGen->Fill(mcpart->Pt());
3493  }
3494  FillMCEleROOTObjects(mcpart, mcArray);
3495  }
3496  if(TMath::Abs(mcpart->GetPdgCode())==3122){
3497  Double_t etamin, etamax, rapmin, rapmax;
3498  fAnalCuts->GetProdV0EtaRange(etamin,etamax);
3499  fAnalCuts->GetProdV0RapRange(rapmin,rapmax);
3500 
3501  if((fabs(mcpart->Y())<rapmax) && (fabs(mcpart->Eta())<etamax)){
3502  fHistoLambdaMassvsPtMCGen->Fill(1.115683, mcpart->Pt());
3503  }
3504  FillMCV0ROOTObjects(mcpart, mcArray);
3505  }
3506  }
3507  return;
3508 }
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 * fHistoEleLambdaMassvsElePtRSMix
! e-Lambda mass vs elept spectra right sign (mixed event)
TH2F * fHistoElectronTOFSelPID
! TOF electron PID after selection
TH2F * fHistoElePtRSMix
! e spectra right sign (mixed event)
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Bool_t fIsMB
Reconstruct primary vertex excluding candidate tracks.
TObjArray * fElectronTracks
unique event id for mixed event check
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 * 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 * fHistoEleLambdaMassRSMix
! e-Lambda mass spectra right sign (mixed event)
Int_t fNzVtxBins
maximum number of events to be used in event mixing
THnSparse * fHistoEleLambdaMassvsElePtWSMix1
! e-Lambda mass vs elept spectra wrong sign (mixed event)
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
Float_t * fCandidateMCEleVariables
! variables to be written to the tree
void FillMCROOTObjects(AliAODMCParticle *part, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype)
void FillMCV0ROOTObjects(AliAODMCParticle *mcv0part, TClonesArray *mcArray)
THnSparse * fHistoElePtvsd0RSMix
! e pt-d0 spectra (right-sign, mix)
AliAODv0 * Getv0() const
THnSparse * fHistoEleLambdaMassvsElePtRSSide1
! e-Lambda mass vs elept spectra right sign (mixed event)
TList * fOutputAll
! User Output slot 3 //analysis histograms
THnSparse * fHistoEleLambdaMassvsElePtRS
! e-Lambda mass vs elept spectra right sign
TH2F * fHistoElePtFeeddownXicPlusMCS
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassFeeddownXic0MCGen
! EFficiency calculation numerator
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 * fHistoElePtvsd0PromptMCS
! e pt-d0 spectra (right-sign)
THnSparse * fHistoEleLambdaMassFeeddownXicPlusMCS
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2
! EFficiency calculation numerator
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 * 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
AliAODPidHF * GetPidHF() const
Definition: AliRDHFCuts.h:231
Bool_t fWriteMCVariableTree
flag to decide whether to write the candidate variables on a tree variables
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCS1
! EFficiency calculation numerator
THnSparse * fHistoElePtvsEtaMCGen
! e spectra efficiency denominator
THnSparse * fHistoElectronMCGen
! electron in mcArray (only from charmed baryon)
THnSparse * fHistoElePtvsd0BFeeddownMCS
! e pt-d0 spectra (right-sign)
const Double_t etamin
THnSparse * fHistoEleLambdaMassvsElePtWSMix2
! e-Lambda mass vs elept spectra wrong sign (mixed event)
void SelectTrack(const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks, Bool_t *seleFlags, TClonesArray *mcArray)
Bool_t fWriteEachVariableTree
flag to decide whether to write the candidate variables on a tree variables
Float_t * fCandidateMCV0Variables
! variables to be written to the tree
void FillElectronROOTObjects(AliAODTrack *trk, TClonesArray *mcArray)
TH2F * fHistoElectronTPCPIDSelTOFLargeEta
! TPC electron PID after TOF 3 sigma cut (0.8>|eta|>0.6)
THnSparse * fHistoEleLambdaMassRSSide
! e-Lambda mass spectra right sign (mixed event)
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCGen
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCS2
! EFficiency calculation numerator
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 * fHistoElePtvsCutVarsRS[17]
! e pt- cut variables (Right-sign)
THnSparse * fHistoElePtvsLambdaPtWSMix
! e-Xi spectra (wrong-sign, mix)
AliESDtrackCuts * GetTrackCuts() const
Definition: AliRDHFCuts.h:245
void SetProngIDs(Int_t nIDs, UShort_t *id)
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassvsElePtMCS
! EFficiency calculation numerator
TH2F * fHistoElePtFeeddownXic0MCS
! EFficiency calculation numerator
THnSparse * fHistoElePtvsd0WSMix
! e pt-d0 spectra (wrong-sign, mix)
AliPIDResponse * GetPidResponse() const
Definition: AliAODPidHF.h:160
TTree * fMCV0VariablesTree
! tree of the candidate variables after track selection on output slot 4
TH2F * fHistoElectronTPCPIDSelTOF
! TPC electron PID after TOF 3 sigma cut
THnSparse * fHistoEleLambdaMassFeeddownXicPlusMCGen
! EFficiency calculation numerator
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
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
THnSparse * fHistoElePtvsEtaFeeddownXic0MCGen
! e spectra efficiency numerator
THnSparse * fHistoEleLambdaMassvsElePtRS2
! e-Lambda mass vs elept spectra right sign
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 * fHistoElePtvsEtaFeeddownXic0MCS
! e spectra efficiency numerator
Float_t * fCandidateEleVariables
! variables to be written to the tree
AliNormalizationCounter * fCounter
! Counter for normalization
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
Float_t nEvents[nProd]
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
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)
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
THnSparse * fHistoEleLambdaMassvsElePtMCGen
! EFficiency calculation denominator
void FillMixROOTObjects(TLorentzVector *et, TLorentzVector *ev, Int_t charge)
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)
Bool_t IsEventRejectedDueToTrigger() const
Definition: AliRDHFCuts.h:295
TH1F * fHistoBachPtMCS
! Bachelor pT histogram (efficiency numerator)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999)
THnSparse * fHistoEleLambdaMassvsElePtWSSide2
! e-Lambda mass vs elept spectra wrong sign (mixed event)
AliAODVertex * ReconstructSecondaryVertex(AliAODv0 *casc, AliAODTrack *trk, AliAODEvent *aod)
TH2F * fHistoElectronTPCSelPID
! TPC electron PID after selection
THnSparse * fHistoEleLambdaMassvsElePtRSSide2
! e-Lambda mass vs elept spectra right sign (mixed event)
THnSparse * fHistoEleLambdaMassvsElePtWS
! e-Lambda mass vs elept spectra wrong sign
Float_t * fCandidateV0Variables
! variables to be written to the tree
TTree * fEleVariablesTree
! tree of the candidate variables after track selection on output slot 4
TH2F * fHistoElectronTPCPIDSelTOFEtaDep[8]
! TPC electron PID after TOF 3 sigma cut (0.8>|eta|>0.6)
THnSparse * fHistoEleLambdaMassvsElePtMCGen1
! EFficiency calculation denominator
THnSparse * fHistoElePtvsLambdaPtvsLcPtMCS
! e-Xi spectra efficiency numerator
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2
! EFficiency calculation numerator
AliAODRecoCascadeHF * MakeCascadeHF(AliAODv0 *casc, AliAODTrack *trk, AliAODEvent *aod, AliAODVertex *vert)
Bool_t SingleTrkCuts(AliAODTrack *trk, AliAODVertex *vert)
THnSparse * fHistoEleLambdaMassvsElePtMCS2
! EFficiency calculation numerator