AliPhysics  b11e70a (b11e70a)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskSEXic2eleXifromAODtracks.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 // Xic->eXi analysis code
21 //
22 // Input: AOD
23 // Output: TTree or THnSparse (mass vs pT vs Centrality)
24 //
25 //-------------------------------------------------------------------------
26 //
27 // Authors: Y.S Watanabe(a)
28 // (a) CNS, the University of Tokyo
29 // Contatcs: wyosuke@cns.s.u-tokyo.ac.jp
30 //-------------------------------------------------------------------------
31 
32 #include <TSystem.h>
33 #include <TParticle.h>
34 #include <TParticlePDG.h>
35 #include <TH1F.h>
36 #include <TH1F.h>
37 #include <TH2F.h>
38 #include <THnSparse.h>
39 #include <TLorentzVector.h>
40 #include <TTree.h>
41 #include "TROOT.h"
42 #include <TDatabasePDG.h>
43 #include <AliAnalysisDataSlot.h>
44 #include <AliAnalysisDataContainer.h>
45 #include "AliStack.h"
46 #include "AliMCEvent.h"
47 #include "AliAnalysisManager.h"
48 #include "AliAODMCHeader.h"
49 #include "AliAODHandler.h"
50 #include "AliLog.h"
51 #include "AliExternalTrackParam.h"
52 #include "AliAODVertex.h"
53 #include "AliESDVertex.h"
54 #include "AliAODRecoDecay.h"
55 #include "AliAODRecoDecayHF.h"
56 #include "AliAODRecoCascadeHF.h"
57 #include "AliESDtrack.h"
58 #include "AliAODTrack.h"
59 #include "AliAODv0.h"
60 #include "AliAODcascade.h"
61 #include "AliAODMCParticle.h"
62 #include "AliAnalysisTaskSE.h"
64 #include "AliPIDResponse.h"
65 #include "AliPIDCombined.h"
66 #include "AliTOFPIDResponse.h"
67 #include "AliAODPidHF.h"
68 #include "AliInputEventHandler.h"
69 #include "AliESDtrackCuts.h"
70 #include "AliNeutralTrackParam.h"
71 #include "AliKFParticle.h"
72 #include "AliKFVertex.h"
73 #include "AliExternalTrackParam.h"
74 #include "AliESDtrack.h"
75 #include "AliCentrality.h"
76 #include "AliVertexerTracks.h"
77 #include "AliEventPoolManager.h"
79 
80 using std::cout;
81 using std::endl;
82 
86 
87 //__________________________________________________________________________
89  AliAnalysisTaskSE(),
90  fUseMCInfo(kFALSE),
91  fOutput(0),
92  fOutputAll(0),
93  fListCuts(0),
94  fCEvents(0),
95  fHTrigger(0),
96  fHCentrality(0),
97  fAnalCuts(0),
98  fIsEventSelected(kFALSE),
99  fWriteVariableTree(kFALSE),
100  fWriteEachVariableTree(kFALSE),
101  fWriteMCVariableTree(kFALSE),
102  fVariablesTree(0),
103  fEleVariablesTree(0),
104  fCascVariablesTree(0),
105  fMCVariablesTree(0),
106  fMCEleVariablesTree(0),
107  fMCCascVariablesTree(0),
108  fMCGenPairVariablesTree(0),
109  fCorrelationVariablesTree(0),
110  fReconstructPrimVert(kFALSE),
111  fIsMB(kFALSE),
112  fIsSemi(kFALSE),
113  fIsCent(kFALSE),
114  fIsINT7(kFALSE),
115  fIsEMC7(kFALSE),
116  fCandidateVariables(),
117  fCandidateEleVariables(),
118  fCandidateCascVariables(),
119  fCandidateMCVariables(),
120  fCandidateMCEleVariables(),
121  fCandidateMCCascVariables(),
122  fCandidateMCGenPairVariables(),
123  fCorrelationVariables(),
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  fMCEventType(-9999),
134  fMCDoPairAnalysis(kFALSE),
135  fHistoEleXiMass(0),
136  fHistoEleXiMassRS(0),
137  fHistoEleXiMassWS(0),
138  fHistoEleXiMassRSMix(0),
139  fHistoEleXiMassWSMix(0),
140  fHistoEleXiMassRSSide(0),
141  fHistoEleXiMassWSSide(0),
142  fHistoEleXiMassRS1(0),
143  fHistoEleXiMassWS1(0),
144  fHistoEleXiMassRSMix1(0),
145  fHistoEleXiMassWSMix1(0),
146  fHistoEleXiMassRSSide1(0),
147  fHistoEleXiMassWSSide1(0),
148  fHistoEleXiMassRS2(0),
149  fHistoEleXiMassWS2(0),
150  fHistoEleXiMassRSMix2(0),
151  fHistoEleXiMassWSMix2(0),
152  fHistoEleXiMassRSSide2(0),
153  fHistoEleXiMassWSSide2(0),
154  fHistoEleXiMassAway(0),
155  fHistoEleXiMassRSAway(0),
156  fHistoEleXiMassWSAway(0),
157  fHistoEleXiMassRSMixAway(0),
158  fHistoEleXiMassWSMixAway(0),
159  fHistoEleXiMassRSSideAway(0),
160  fHistoEleXiMassWSSideAway(0),
161  fHistoEleXiMassRS1Away(0),
162  fHistoEleXiMassWS1Away(0),
163  fHistoEleXiMassRSMix1Away(0),
164  fHistoEleXiMassWSMix1Away(0),
165  fHistoEleXiMassRSSide1Away(0),
166  fHistoEleXiMassWSSide1Away(0),
167  fHistoEleXiMassRS2Away(0),
168  fHistoEleXiMassWS2Away(0),
169  fHistoEleXiMassRSMix2Away(0),
170  fHistoEleXiMassWSMix2Away(0),
171  fHistoEleXiMassRSSide2Away(0),
172  fHistoEleXiMassWSSide2Away(0),
173  fHistoEleXiMassvsElePtRS(0),
174  fHistoEleXiMassvsElePtWS(0),
175  fHistoEleXiMassvsElePtRSMix(0),
176  fHistoEleXiMassvsElePtWSMix(0),
177  fHistoEleXiMassvsElePtRSSide(0),
178  fHistoEleXiMassvsElePtWSSide(0),
179  fHistoEleXiMassvsElePtRS1(0),
180  fHistoEleXiMassvsElePtWS1(0),
181  fHistoEleXiMassvsElePtRSMix1(0),
182  fHistoEleXiMassvsElePtWSMix1(0),
183  fHistoEleXiMassvsElePtRSSide1(0),
184  fHistoEleXiMassvsElePtWSSide1(0),
185  fHistoEleXiMassvsElePtRS2(0),
186  fHistoEleXiMassvsElePtWS2(0),
187  fHistoEleXiMassvsElePtRSMix2(0),
188  fHistoEleXiMassvsElePtWSMix2(0),
189  fHistoEleXiMassvsElePtRSSide2(0),
190  fHistoEleXiMassvsElePtWSSide2(0),
191  fHistoElePtRS(0),
192  fHistoElePtWS(0),
193  fHistoElePtRSMix(0),
194  fHistoElePtWSMix(0),
195  fHistoEleXiMassMCS(0),
196  fHistoEleXiMassMCS1(0),
197  fHistoEleXiMassMCS2(0),
198  fHistoEleXiMassXibMCS(0),
199  fHistoEleXiMassXibMCS1(0),
200  fHistoEleXiMassXibMCS2(0),
201  fHistoEleXiMassPromptMCS(0),
202  fHistoEleXiMassPromptMCS1(0),
203  fHistoEleXiMassPromptMCS2(0),
204  fHistoEleXiMassBFeeddownMCS(0),
205  fHistoEleXiMassBFeeddownMCS1(0),
206  fHistoEleXiMassBFeeddownMCS2(0),
207  fHistoEleXiMassMCGen(0),
208  fHistoEleXiMassvsElePtMCS(0),
209  fHistoEleXiMassvsElePtMCGen(0),
210  fHistoEleXiMassvsElePtMCS1(0),
211  fHistoEleXiMassvsElePtMCGen1(0),
212  fHistoEleXiMassvsElePtMCS2(0),
213  fHistoEleXiMassvsElePtMCGen2(0),
214  fHistoElePtMCS(0),
215  fHistoElePtMCGen(0),
216  fHistoElePtvsEtaRS(0),
217  fHistoElePtvsEtaWS(0),
218  fHistoElePtvsEtaRSMix(0),
219  fHistoElePtvsEtaWSMix(0),
220  fHistoElePtvsEtaMCS(0),
221  fHistoElePtvsEtaMCGen(0),
222  fHistoElePtvsXiPtRS(0),
223  fHistoElePtvsXiPtWS(0),
224  fHistoElePtvsXiPtRSMix(0),
225  fHistoElePtvsXiPtWSMix(0),
226  fHistoElePtvsXiPtMCS(0),
227  fHistoElePtvsXiPtvsXicPtMCS(0),
228  fHistoElePtvsXiPtMCGen(0),
229  fHistoElePtvsXiPtvsXicPtMCGen(0),
230  fHistoElePtvsXiPtMCXicGen(0),
231  fHistoElePtvsd0RS(0),
232  fHistoElePtvsd0WS(0),
233  fHistoElePtvsd0RSMix(0),
234  fHistoElePtvsd0WSMix(0),
235  fHistoElePtvsd0MCS(0),
236  fHistoElePtvsd0PromptMCS(0),
237  fHistoElePtvsd0BFeeddownMCS(0),
238  fHistoBachPt(0),
239  fHistoBachPtMCS(0),
240  fHistoBachPtMCGen(0),
241  fHistod0Bach(0),
242  fHistoXiMassvsPt(0),
243  fHistoXiMassvsPtMCS(0),
244  fHistoXiMassvsPtMCGen(0),
245  fHistoOmegaMassvsPt(0),
246  fHistoElectronTPCPID(0),
247  fHistoElectronTOFPID(0),
248  fHistoElectronTPCSelPID(0),
249  fHistoElectronTOFSelPID(0),
250  fHistoElectronTPCPIDSelTOF(0),
251  fHistoElectronTOFPIDSelTPC(0),
252  fHistoElectronTPCPIDSelTOFSmallEta(0),
253  fHistoElectronTPCPIDSelTOFLargeEta(0),
254  fHistoMassConversionsMin(0),
255  fHistoMassConversionsSameSignMin(0),
256  fHistoElectronQovPtvsPhi(0),
257  fHistoXiQovPtvsPhi(0),
258  fHistoXicMCGen(0),
259  fHistoXicMCGen1(0),
260  fHistoXicMCGen2(0),
261  fHistoXicMCS(0),
262  fHistoXicMCS1(0),
263  fHistoXicMCS2(0),
264  fHistoXibMCGen(0),
265  fHistoXibMCGenWithXic(0),
266  fHistoXibMCS(0),
267  fHistoXicElectronMCGen(0),
268  fHistoXicElectronMCGen1(0),
269  fHistoXicElectronMCGen2(0),
270  fHistoXicElectronMCS(0),
271  fHistoXicElectronMCS1(0),
272  fHistoXicElectronMCS2(0),
273  fHistoElectronMCGen(0),
274  fHistoBottomElectronMCGen(0),
275  fHistoCharmElectronMCGen(0),
276  fHistoXiMCGen(0),
277  fHistoLambdaPtvsDl(0),
278  fHistoLambdaPtvsDlSide(0),
279  fHistoLambdaPtvsDlMCS(0),
280  fHistoLambdaPtvsDR(0),
281  fHistoLambdaPtvsDRSide(0),
282  fHistoLambdaPtvsDRMCS(0),
283  fHistoEleXiPtvsRapidityRS(0),
284  fHistoEleXiPtvsRapidityWS(0),
285  fHistoEleXiPtvsRapidityMCS(0),
286  fHistoResponseElePt(0),
287  fHistoResponseXiPt(0),
288  fHistoResponseEleXiPt(0),
289  fHistoResponseXiPtvsEleXiPt(0),
290  fHistoResponseXiPtXib(0),
291  fHistoResponseEleXiPtXib(0),
292  fHistoResponseMcGenXibPtvsXicPt(0),
293  fHistoPi0MCGen(0),
294  fHistoElectronPi0Total(0),
295  fHistoElectronPi0Tag(0),
296  fHistoEtaMCGen(0),
297  fHistoElectronEtaTotal(0),
298  fHistoElectronEtaTag(0),
299  fCounter(0),
300  fHistonEvtvsRunNumber(0),
301  fHistonElevsRunNumber(0),
302  fHistonXivsRunNumber(0),
303  fHistoMCEventType(0),
304  fHistoMCXic0Decays(0),
305  fHistoMCDeltaPhiccbar(0),
306  fHistoMCNccbar(0),
307  fGTI(0),fGTIndex(0), fTrackBuffSize(19000),
308  fHistodPhiSdEtaSElectronProtonR125RS(0),
309  fHistodPhiSdEtaSElectronProtonR125WS(0),
310  fHistodPhiSdEtaSElectronProtonR125RSMix(0),
311  fHistodPhiSdEtaSElectronProtonR125WSMix(0),
312  fHistodPhiSdEtaSElectronPionR125RS(0),
313  fHistodPhiSdEtaSElectronPionR125WS(0),
314  fHistodPhiSdEtaSElectronPionR125RSMix(0),
315  fHistodPhiSdEtaSElectronPionR125WSMix(0),
316  fHistodPhiSdEtaSElectronBachelorR125RS(0),
317  fHistodPhiSdEtaSElectronBachelorR125WS(0),
318  fHistodPhiSdEtaSElectronBachelorR125RSMix(0),
319  fHistodPhiSdEtaSElectronBachelorR125WSMix(0),
320  fDoEventMixing(0),
321  fMixWithoutConversionFlag(kFALSE),
322  fNumberOfEventsForMixing (5),
323  fNzVtxBins (0),
324  fNCentBins (0),
325  fNOfPools(1),
326  fEventBuffer(0x0),
327  fEventInfo(0x0),
328  fElectronTracks(0x0),
329  fCascadeTracks1(0x0),
330  fCascadeTracks2(0x0),
331  fElectronCutVarsArray(0x0),
332  fCascadeCutVarsArray1(0x0),
333  fCascadeCutVarsArray2(0x0)
334 {
335  //
336  // Default Constructor.
337  //
338  for(Int_t i=0;i<23;i++){
339  fHistoElePtvsCutVarsRS[i] = 0;
340  fHistoElePtvsCutVarsWS[i] = 0;
342  }
343  for(Int_t i=0;i<8;i++){
345  }
346 }
347 
348 //___________________________________________________________________________
351  Bool_t writeVariableTree) :
352  AliAnalysisTaskSE(name),
353  fUseMCInfo(kFALSE),
354  fOutput(0),
355  fOutputAll(0),
356  fListCuts(0),
357  fCEvents(0),
358  fHTrigger(0),
359  fHCentrality(0),
360  fAnalCuts(analCuts),
361  fIsEventSelected(kFALSE),
362  fWriteVariableTree(writeVariableTree),
363  fWriteEachVariableTree(kFALSE),
364  fWriteMCVariableTree(kFALSE),
365  fVariablesTree(0),
366  fEleVariablesTree(0),
367  fCascVariablesTree(0),
368  fMCVariablesTree(0),
369  fMCEleVariablesTree(0),
370  fMCCascVariablesTree(0),
371  fMCGenPairVariablesTree(0),
372  fCorrelationVariablesTree(0),
373  fReconstructPrimVert(kFALSE),
374  fIsMB(kFALSE),
375  fIsSemi(kFALSE),
376  fIsCent(kFALSE),
377  fIsINT7(kFALSE),
378  fIsEMC7(kFALSE),
379  fCandidateVariables(),
380  fCandidateEleVariables(),
381  fCandidateCascVariables(),
382  fCandidateMCVariables(),
383  fCandidateMCEleVariables(),
384  fCandidateMCCascVariables(),
385  fCandidateMCGenPairVariables(),
386  fCorrelationVariables(),
387  fVtx1(0),
388  fV1(0),
389  fVtxZ(0),
390  fBzkG(0),
391  fCentrality(0),
392  fRunNumber(0),
393  fTriggerCheck(0),
394  fUseCentralityV0M(kFALSE),
395  fEvNumberCounter(0),
396  fMCEventType(-9999),
397  fMCDoPairAnalysis(kFALSE),
398  fHistoEleXiMass(0),
399  fHistoEleXiMassRS(0),
400  fHistoEleXiMassWS(0),
401  fHistoEleXiMassRSMix(0),
402  fHistoEleXiMassWSMix(0),
403  fHistoEleXiMassRSSide(0),
404  fHistoEleXiMassWSSide(0),
405  fHistoEleXiMassRS1(0),
406  fHistoEleXiMassWS1(0),
407  fHistoEleXiMassRSMix1(0),
408  fHistoEleXiMassWSMix1(0),
409  fHistoEleXiMassRSSide1(0),
410  fHistoEleXiMassWSSide1(0),
411  fHistoEleXiMassRS2(0),
412  fHistoEleXiMassWS2(0),
413  fHistoEleXiMassRSMix2(0),
414  fHistoEleXiMassWSMix2(0),
415  fHistoEleXiMassRSSide2(0),
416  fHistoEleXiMassWSSide2(0),
417  fHistoEleXiMassAway(0),
418  fHistoEleXiMassRSAway(0),
419  fHistoEleXiMassWSAway(0),
420  fHistoEleXiMassRSMixAway(0),
421  fHistoEleXiMassWSMixAway(0),
422  fHistoEleXiMassRSSideAway(0),
423  fHistoEleXiMassWSSideAway(0),
424  fHistoEleXiMassRS1Away(0),
425  fHistoEleXiMassWS1Away(0),
426  fHistoEleXiMassRSMix1Away(0),
427  fHistoEleXiMassWSMix1Away(0),
428  fHistoEleXiMassRSSide1Away(0),
429  fHistoEleXiMassWSSide1Away(0),
430  fHistoEleXiMassRS2Away(0),
431  fHistoEleXiMassWS2Away(0),
432  fHistoEleXiMassRSMix2Away(0),
433  fHistoEleXiMassWSMix2Away(0),
434  fHistoEleXiMassRSSide2Away(0),
435  fHistoEleXiMassWSSide2Away(0),
436  fHistoEleXiMassvsElePtRS(0),
437  fHistoEleXiMassvsElePtWS(0),
438  fHistoEleXiMassvsElePtRSMix(0),
439  fHistoEleXiMassvsElePtWSMix(0),
440  fHistoEleXiMassvsElePtRSSide(0),
441  fHistoEleXiMassvsElePtWSSide(0),
442  fHistoEleXiMassvsElePtRS1(0),
443  fHistoEleXiMassvsElePtWS1(0),
444  fHistoEleXiMassvsElePtRSMix1(0),
445  fHistoEleXiMassvsElePtWSMix1(0),
446  fHistoEleXiMassvsElePtRSSide1(0),
447  fHistoEleXiMassvsElePtWSSide1(0),
448  fHistoEleXiMassvsElePtRS2(0),
449  fHistoEleXiMassvsElePtWS2(0),
450  fHistoEleXiMassvsElePtRSMix2(0),
451  fHistoEleXiMassvsElePtWSMix2(0),
452  fHistoEleXiMassvsElePtRSSide2(0),
453  fHistoEleXiMassvsElePtWSSide2(0),
454  fHistoElePtRS(0),
455  fHistoElePtWS(0),
456  fHistoElePtRSMix(0),
457  fHistoElePtWSMix(0),
458  fHistoEleXiMassMCS(0),
459  fHistoEleXiMassMCS1(0),
460  fHistoEleXiMassMCS2(0),
461  fHistoEleXiMassXibMCS(0),
462  fHistoEleXiMassXibMCS1(0),
463  fHistoEleXiMassXibMCS2(0),
464  fHistoEleXiMassPromptMCS(0),
465  fHistoEleXiMassPromptMCS1(0),
466  fHistoEleXiMassPromptMCS2(0),
467  fHistoEleXiMassBFeeddownMCS(0),
468  fHistoEleXiMassBFeeddownMCS1(0),
469  fHistoEleXiMassBFeeddownMCS2(0),
470  fHistoEleXiMassMCGen(0),
471  fHistoEleXiMassvsElePtMCS(0),
472  fHistoEleXiMassvsElePtMCGen(0),
473  fHistoEleXiMassvsElePtMCS1(0),
474  fHistoEleXiMassvsElePtMCGen1(0),
475  fHistoEleXiMassvsElePtMCS2(0),
476  fHistoEleXiMassvsElePtMCGen2(0),
477  fHistoElePtMCS(0),
478  fHistoElePtMCGen(0),
479  fHistoElePtvsEtaRS(0),
480  fHistoElePtvsEtaWS(0),
481  fHistoElePtvsEtaRSMix(0),
482  fHistoElePtvsEtaWSMix(0),
483  fHistoElePtvsEtaMCS(0),
484  fHistoElePtvsEtaMCGen(0),
485  fHistoElePtvsXiPtRS(0),
486  fHistoElePtvsXiPtWS(0),
487  fHistoElePtvsXiPtRSMix(0),
488  fHistoElePtvsXiPtWSMix(0),
489  fHistoElePtvsXiPtMCS(0),
490  fHistoElePtvsXiPtvsXicPtMCS(0),
491  fHistoElePtvsXiPtMCGen(0),
492  fHistoElePtvsXiPtvsXicPtMCGen(0),
493  fHistoElePtvsXiPtMCXicGen(0),
494  fHistoElePtvsd0RS(0),
495  fHistoElePtvsd0WS(0),
496  fHistoElePtvsd0RSMix(0),
497  fHistoElePtvsd0WSMix(0),
498  fHistoElePtvsd0MCS(0),
499  fHistoElePtvsd0PromptMCS(0),
500  fHistoElePtvsd0BFeeddownMCS(0),
501  fHistoBachPt(0),
502  fHistoBachPtMCS(0),
503  fHistoBachPtMCGen(0),
504  fHistod0Bach(0),
505  fHistoXiMassvsPt(0),
506  fHistoXiMassvsPtMCS(0),
507  fHistoXiMassvsPtMCGen(0),
508  fHistoOmegaMassvsPt(0),
509  fHistoElectronTPCPID(0),
510  fHistoElectronTOFPID(0),
511  fHistoElectronTPCSelPID(0),
512  fHistoElectronTOFSelPID(0),
513  fHistoElectronTPCPIDSelTOF(0),
514  fHistoElectronTOFPIDSelTPC(0),
515  fHistoElectronTPCPIDSelTOFSmallEta(0),
516  fHistoElectronTPCPIDSelTOFLargeEta(0),
517  fHistoMassConversionsMin(0),
518  fHistoMassConversionsSameSignMin(0),
519  fHistoElectronQovPtvsPhi(0),
520  fHistoXiQovPtvsPhi(0),
521  fHistoXicMCGen(0),
522  fHistoXicMCGen1(0),
523  fHistoXicMCGen2(0),
524  fHistoXicMCS(0),
525  fHistoXicMCS1(0),
526  fHistoXicMCS2(0),
527  fHistoXibMCGen(0),
528  fHistoXibMCGenWithXic(0),
529  fHistoXibMCS(0),
530  fHistoXicElectronMCGen(0),
531  fHistoXicElectronMCGen1(0),
532  fHistoXicElectronMCGen2(0),
533  fHistoXicElectronMCS(0),
534  fHistoXicElectronMCS1(0),
535  fHistoXicElectronMCS2(0),
536  fHistoElectronMCGen(0),
537  fHistoBottomElectronMCGen(0),
538  fHistoCharmElectronMCGen(0),
539  fHistoXiMCGen(0),
540  fHistoLambdaPtvsDl(0),
541  fHistoLambdaPtvsDlSide(0),
542  fHistoLambdaPtvsDlMCS(0),
543  fHistoLambdaPtvsDR(0),
544  fHistoLambdaPtvsDRSide(0),
545  fHistoLambdaPtvsDRMCS(0),
546  fHistoEleXiPtvsRapidityRS(0),
547  fHistoEleXiPtvsRapidityWS(0),
548  fHistoEleXiPtvsRapidityMCS(0),
549  fHistoResponseElePt(0),
550  fHistoResponseXiPt(0),
551  fHistoResponseEleXiPt(0),
552  fHistoResponseXiPtvsEleXiPt(0),
553  fHistoResponseXiPtXib(0),
554  fHistoResponseEleXiPtXib(0),
555  fHistoResponseMcGenXibPtvsXicPt(0),
556  fHistoPi0MCGen(0),
557  fHistoElectronPi0Total(0),
558  fHistoElectronPi0Tag(0),
559  fHistoEtaMCGen(0),
560  fHistoElectronEtaTotal(0),
561  fHistoElectronEtaTag(0),
562  fCounter(0),
563  fHistonEvtvsRunNumber(0),
564  fHistonElevsRunNumber(0),
565  fHistonXivsRunNumber(0),
566  fHistoMCEventType(0),
567  fHistoMCXic0Decays(0),
568  fHistoMCDeltaPhiccbar(0),
569  fHistoMCNccbar(0),
570  fGTI(0),fGTIndex(0), fTrackBuffSize(19000),
571  fHistodPhiSdEtaSElectronProtonR125RS(0),
572  fHistodPhiSdEtaSElectronProtonR125WS(0),
573  fHistodPhiSdEtaSElectronProtonR125RSMix(0),
574  fHistodPhiSdEtaSElectronProtonR125WSMix(0),
575  fHistodPhiSdEtaSElectronPionR125RS(0),
576  fHistodPhiSdEtaSElectronPionR125WS(0),
577  fHistodPhiSdEtaSElectronPionR125RSMix(0),
578  fHistodPhiSdEtaSElectronPionR125WSMix(0),
579  fHistodPhiSdEtaSElectronBachelorR125RS(0),
580  fHistodPhiSdEtaSElectronBachelorR125WS(0),
581  fHistodPhiSdEtaSElectronBachelorR125RSMix(0),
582  fHistodPhiSdEtaSElectronBachelorR125WSMix(0),
583  fDoEventMixing(0),
584  fMixWithoutConversionFlag(kFALSE),
585  fNumberOfEventsForMixing (5),
586  fNzVtxBins (0),
587  fNCentBins (0),
588  fNOfPools(1),
589  fEventBuffer(0x0),
590  fEventInfo(0x0),
591  fElectronTracks(0x0),
592  fCascadeTracks1(0x0),
593  fCascadeTracks2(0x0),
594  fElectronCutVarsArray(0x0),
595  fCascadeCutVarsArray1(0x0),
596  fCascadeCutVarsArray2(0x0)
597 {
598  //
599  // Constructor. Initialization of Inputs and Outputs
600  //
601  Info("AliAnalysisTaskSEXic2eleXifromAODtracks","Calling Constructor");
602 
603  for(Int_t i=0;i<23;i++){
604  fHistoElePtvsCutVarsRS[i] = 0;
605  fHistoElePtvsCutVarsWS[i] = 0;
607  }
608  for(Int_t i=0;i<8;i++){
610  }
611 
612  DefineOutput(1,TList::Class()); //conters
613  DefineOutput(2,TList::Class());
614  DefineOutput(3,TList::Class()); //conters
615  DefineOutput(4,TTree::Class()); //My private output
616  DefineOutput(5,TTree::Class()); //My private output
617  DefineOutput(6,TTree::Class()); //My private output
618  DefineOutput(7,TTree::Class()); //My private output
619  DefineOutput(8,AliNormalizationCounter::Class());
620  DefineOutput(9,TTree::Class()); //My private output
621  DefineOutput(10,TTree::Class()); //My private output
622  DefineOutput(11,TTree::Class()); //My private output
623  DefineOutput(12,TTree::Class()); //My private output
624 }
625 
626 //___________________________________________________________________________
628  //
629  // destructor
630  //
631  Info("~AliAnalysisTaskSEXic2eleXifromAODtracks","Calling Destructor");
632 
633  if (fOutput) {
634  delete fOutput;
635  fOutput = 0;
636  }
637 
638  if (fOutputAll) {
639  delete fOutputAll;
640  fOutputAll = 0;
641  }
642 
643  if (fListCuts) {
644  delete fListCuts;
645  fListCuts = 0;
646  }
647 
648 
649  if (fAnalCuts) {
650  delete fAnalCuts;
651  fAnalCuts = 0;
652  }
653 
654  if (fVariablesTree) {
655  delete fVariablesTree;
656  fVariablesTree = 0;
657  }
658  if (fEleVariablesTree) {
659  delete fEleVariablesTree;
660  fEleVariablesTree = 0;
661  }
662  if (fCascVariablesTree) {
663  delete fCascVariablesTree;
664  fCascVariablesTree = 0;
665  }
666  if (fMCVariablesTree) {
667  delete fMCVariablesTree;
668  fMCVariablesTree = 0;
669  }
670  if (fMCEleVariablesTree) {
671  delete fMCEleVariablesTree;
673  }
674  if (fMCCascVariablesTree) {
675  delete fMCCascVariablesTree;
677  }
681  }
685  }
686  if(fCounter){
687  delete fCounter;
688  fCounter = 0;
689  }
690 
691  if(fElectronTracks) fElectronTracks->Delete();
692  delete fElectronTracks;
693  if(fCascadeTracks1) fCascadeTracks1->Delete();
694  delete fCascadeTracks1;
695  if(fCascadeTracks2) fCascadeTracks2->Delete();
696  delete fCascadeTracks2;
697  if(fEventBuffer){
698  for(Int_t i=0; i<fNOfPools; i++) delete fEventBuffer[i];
699  delete fEventBuffer;
700  }
701  delete fEventInfo;
702 
704  delete fElectronCutVarsArray;
706  delete fCascadeCutVarsArray1;
708  delete fCascadeCutVarsArray2;
709 
710  if (fGTI)
711  delete[] fGTI;
712  fGTI=0;
713  if (fGTIndex)
714  delete[] fGTIndex;
715  fGTIndex=0;
716 }
717 
718 //_________________________________________________
720  //
721  // Initialization
722  //
723  //
724 
725  fIsEventSelected=kFALSE;
726 
727  if (fDebug > 1) AliInfo("Init");
728 
729  fListCuts = new TList();
730  fListCuts->SetOwner();
731  fListCuts->SetName("ListCuts");
733  PostData(2,fListCuts);
734 
735  return;
736 }
737 
738 //_________________________________________________
740 {
741  //
742  // UserExec
743  //
744 
745  if (!fInputEvent) {
746  AliError("NO EVENT FOUND!");
747  return;
748  }
749  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
750 
751  fCEvents->Fill(1);
753 
754  //------------------------------------------------
755  // First check if the event has proper B
756  //------------------------------------------------
757  fBzkG = (Double_t)aodEvent->GetMagneticField();
758  AliKFParticle::SetField(fBzkG);
759  if (TMath::Abs(fBzkG)<0.001) {
760  return;
761  }
762  fCEvents->Fill(2);
763 
766 
767  //------------------------------------------------
768  // MC analysis setting
769  //------------------------------------------------
770  TClonesArray *mcArray = 0;
771  AliAODMCHeader *mcHeader=0;
772  if (fUseMCInfo) {
773  // MC array need for maching
774  mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
775  if (!mcArray) {
776  AliError("Could not find Monte-Carlo in AOD");
777  return;
778  }
779  fCEvents->Fill(6); // in case of MC events
780 
781  // load MC header
782  mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
783  if (!mcHeader) {
784  AliError("AliAnalysisTaskSEXic2eleXifromAODtracks::UserExec: MC header branch not found!\n");
785  return;
786  }
787  fCEvents->Fill(7); // in case of MC events
788 
789  Double_t zMCVertex = mcHeader->GetVtxZ();
790  if (TMath::Abs(zMCVertex) > fAnalCuts->GetMaxVtxZ()) {
791  AliDebug(2,Form("Event rejected: abs(zVtxMC)=%f > fAnalCuts->GetMaxVtxZ()=%f",zMCVertex,fAnalCuts->GetMaxVtxZ()));
792  return;
793  } else {
794  fCEvents->Fill(17); // in case of MC events
795  }
796  if ((TMath::Abs(zMCVertex) < fAnalCuts->GetMaxVtxZ()) && (!fAnalCuts->IsEventRejectedDuePhysicsSelection()) && (!fAnalCuts->IsEventRejectedDueToTrigger())) {
797  Bool_t selevt = MakeMCAnalysis(mcArray);
798  if(!selevt) return;
799  }
800  }
801 
802  //------------------------------------------------
803  // Event selection
804  //------------------------------------------------
805  fVtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
806  if (!fVtx1) return;
807 
808  Double_t pos[3],cov[6];
809  fVtx1->GetXYZ(pos);
810  fVtx1->GetCovarianceMatrix(cov);
811  fV1 = new AliESDVertex(pos,cov,100.,100,fVtx1->GetName());
812  fVtxZ = pos[2];
813 
814  Bool_t fIsTriggerNotOK = fAnalCuts->IsEventRejectedDueToTrigger();
815  Bool_t fIsPhysSelNotOK = fAnalCuts->IsEventRejectedDuePhysicsSelection();
816  Bool_t fIsNoVertex = fAnalCuts->IsEventRejectedDueToNotRecoVertex();
817  if(!fIsTriggerNotOK && !fIsPhysSelNotOK && !fIsNoVertex && fabs(fVtx1->GetZ())<fAnalCuts->GetMaxVtxZ()) fCEvents->Fill(3);
818  if(!fIsEventSelected) {
819  delete fV1;
820  return;
821  }
822  fCEvents->Fill(4);
823 
824  fIsMB=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kMB)==(AliVEvent::kMB);
825  fIsSemi=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kSemiCentral)==(AliVEvent::kSemiCentral);
826  fIsCent=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kCentral)==(AliVEvent::kCentral);
827  fIsINT7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kINT7)==(AliVEvent::kINT7);
828  fIsEMC7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kEMC7)==(AliVEvent::kEMC7);
830  if(fIsMB) fHTrigger->Fill(1);
831  if(fIsSemi) fHTrigger->Fill(2);
832  if(fIsCent) fHTrigger->Fill(3);
833  if(fIsINT7) fHTrigger->Fill(4);
834  if(fIsEMC7) fHTrigger->Fill(5);
835  if(fIsMB|fIsSemi|fIsCent) fHTrigger->Fill(7);
836  if(fIsINT7|fIsEMC7) fHTrigger->Fill(8);
837  if(fIsMB&fIsSemi) fHTrigger->Fill(10);
838  if(fIsMB&fIsCent) fHTrigger->Fill(11);
839  if(fIsINT7&fIsEMC7) fHTrigger->Fill(12);
840 
841  if(fUseCentralityV0M){
842  AliCentrality *cent = aodEvent->GetCentrality();
843  fCentrality = cent->GetCentralityPercentile("V0M");
844  }else{
845  fCentrality = 1.;
846  }
847  if(fCentrality<0.||fCentrality>100.-0.0000001) {
848  delete fV1;
849  return;
850  }
851  fHCentrality->Fill(fCentrality);
852  fRunNumber = aodEvent->GetRunNumber();
853 
854  Int_t runnumber_offset = 0;
855  Int_t runnumber = aodEvent->GetRunNumber();
856  if(runnumber<=131000&&runnumber>=114000){
857  runnumber_offset = 114000;//lhc10bcde
858  }else if(runnumber<=196000&&runnumber>=195000){
859  runnumber_offset = 195000;//lhc13bc
860  }else if(runnumber<=170593&&runnumber>=167902){
861  runnumber_offset = 167902;//lhc11h
862  }
863  fHistonEvtvsRunNumber->Fill(runnumber-runnumber_offset,1.);
864 
865  //------------------------------------------------
866  // Check if the event has v0 candidate
867  //------------------------------------------------
868  //Int_t nv0 = aodEvent->GetNumberOfV0s();
869  fCEvents->Fill(5);
870 
871 
872  //------------------------------------------------
873  // Main analysis done in this function
874  //------------------------------------------------
877  MakeAnalysis(aodEvent,mcArray);
878 
879 
880  PostData(1,fOutput);
881  PostData(3,fOutputAll);
882  PostData(4,fVariablesTree);
883  PostData(5,fEleVariablesTree);
884  PostData(6,fCascVariablesTree);
885  PostData(7,fMCVariablesTree);
886  PostData(8,fCounter);
887  PostData(9,fMCEleVariablesTree);
888  PostData(10,fMCCascVariablesTree);
889  PostData(11,fMCGenPairVariablesTree);
890  PostData(12,fCorrelationVariablesTree);
891 
892  fIsEventSelected=kFALSE;
893 
894  delete fV1;
895  return;
896 }
897 
898 //________________________________________ terminate ___________________________
900 {
901  // The Terminate() function is the last function to be called during
902  // a query. It always runs on the client, it can be used to present
903  // the results graphically or save the results to file.
904 
905  //AliInfo("Terminate","");
906  AliAnalysisTaskSE::Terminate();
907 
908  fOutput = dynamic_cast<TList*> (GetOutputData(1));
909  if (!fOutput) {
910  AliError("fOutput not available");
911  return;
912  }
913 
914  fOutputAll = dynamic_cast<TList*> (GetOutputData(3));
915  if (!fOutputAll) {
916  AliError("fOutputAll not available");
917  return;
918  }
919 
920  return;
921 }
922 
923 //___________________________________________________________________________
925 {
926  //
927  // UserCreateOutputObject
928  //
929  //AliInfo(Form("CreateOutputObjects of task %s\n", GetName()));
930 
931  //------------------------------------------------
932  // output object setting
933  //------------------------------------------------
934  fOutput = new TList();
935  fOutput->SetOwner();
936  fOutput->SetName("chist0");
937  DefineGeneralHistograms(); // define general histograms
938  PostData(1,fOutput);
939 
940  fOutputAll = new TList();
941  fOutputAll->SetOwner();
942  fOutputAll->SetName("anahisto");
943  DefineAnalysisHistograms(); // define general histograms
944  PostData(3,fOutputAll);
945 
947  PostData(4,fVariablesTree);
948 
950  PostData(5,fEleVariablesTree);
951 
953  PostData(6,fCascVariablesTree);
954 
956  PostData(7,fMCVariablesTree);
957 
959  PostData(9,fMCEleVariablesTree);
960 
962  PostData(10,fMCCascVariablesTree);
963 
965  PostData(11,fMCGenPairVariablesTree);
966 
968  PostData(12,fCorrelationVariablesTree);
969 
970 
971  //Counter for Normalization
972  TString normName="NormalizationCounter";
973  AliAnalysisDataContainer *cont = GetOutputSlot(8)->GetContainer();
974  if(cont)normName=(TString)cont->GetName();
975  fCounter = new AliNormalizationCounter(normName.Data());
976  fCounter->Init();
977  PostData(8,fCounter);
978 
979  if(fDoEventMixing){
980  fElectronTracks = new TObjArray();
981  fElectronTracks->SetOwner();
982  fCascadeTracks1 = new TObjArray();
983  fCascadeTracks1->SetOwner();
984  fCascadeTracks2 = new TObjArray();
985  fCascadeTracks2->SetOwner();
986  fElectronCutVarsArray = new TObjArray();
987  fElectronCutVarsArray->SetOwner();
988  fCascadeCutVarsArray1 = new TObjArray();
989  fCascadeCutVarsArray1->SetOwner();
990  fCascadeCutVarsArray2 = new TObjArray();
991  fCascadeCutVarsArray2->SetOwner();
992 
994  fEventBuffer = new TTree*[fNOfPools];
995  for(Int_t i=0; i<fNOfPools; i++){
996  fEventBuffer[i]=new TTree(Form("EventBuffer_%d",i), "Temporary buffer for event mixing");
997  fEventBuffer[i]->Branch("zVertex", &fVtxZ);
998  fEventBuffer[i]->Branch("centrality", &fCentrality);
999  fEventBuffer[i]->Branch("eventInfo", "TObjString",&fEventInfo);
1000  fEventBuffer[i]->Branch("c1array", "TObjArray", &fCascadeTracks1);
1001  fEventBuffer[i]->Branch("c2array", "TObjArray", &fCascadeTracks2);
1002  fEventBuffer[i]->Branch("c1varsarray", "TObjArray", &fCascadeCutVarsArray1);
1003  fEventBuffer[i]->Branch("c2varsarray", "TObjArray", &fCascadeCutVarsArray2);
1004  }
1005  }
1006 
1007  fGTI = new AliAODTrack *[fTrackBuffSize]; // Array of pointers
1008  fGTIndex = new Int_t [fTrackBuffSize]; // Array of index
1009 
1010  return;
1011 }
1012 
1013 //-------------------------------------------------------------------------------
1016  AliAODEvent *aodEvent, TClonesArray *mcArray
1017  )
1018 {
1019  //
1020  // Main Analysis part
1021  //
1022  //------------------------------------------------
1023  // Select good track before hand to save time
1024  //------------------------------------------------
1025  if(fDoEventMixing && fElectronTracks) fElectronTracks->Delete();
1026  if(fDoEventMixing && fCascadeTracks1) fCascadeTracks1->Delete();
1027  if(fDoEventMixing && fCascadeTracks2) fCascadeTracks2->Delete();
1028  if(fDoEventMixing && fCascadeCutVarsArray1) fCascadeCutVarsArray1->Delete();
1029  if(fDoEventMixing && fCascadeCutVarsArray2) fCascadeCutVarsArray2->Delete();
1030 
1031  ResetGlobalTrackReference();
1032  // ..and set it
1033  for (Int_t iTrack=0;iTrack<aodEvent->GetNumberOfTracks();iTrack++){
1034  // cast needed since the event now returns AliVTrack instead of AliAODTrack
1035  AliAODTrack *track = dynamic_cast<AliAODTrack *>(aodEvent->GetTrack(iTrack));
1036  if (!track) continue;
1037 
1038  // Store the reference of the global tracks
1039  StoreGlobalTrackReference(track,iTrack);
1040  }
1041 
1042 
1043  Int_t nCascs= aodEvent->GetNumberOfCascades();
1044  Int_t nTracks= aodEvent->GetNumberOfTracks();
1045 
1046  Bool_t seleTrkFlags[nTracks];
1047  Int_t nSeleTrks=0;
1048  SelectTrack(aodEvent,nTracks,nSeleTrks,seleTrkFlags,mcArray);
1049 
1050  Bool_t seleCascFlags[nCascs];
1051  Int_t nSeleCasc=0;
1052  SelectCascade(aodEvent,nCascs,nSeleCasc,seleCascFlags,mcArray);
1053 
1054  Int_t runnumber_offset = 0;
1055  Int_t runnumber = aodEvent->GetRunNumber();
1056  if(runnumber<=131000&&runnumber>=114000){
1057  runnumber_offset = 114000;//lhc10bcde
1058  }else if(runnumber<=196000&&runnumber>=195000){
1059  runnumber_offset = 195000;//lhc13bc
1060  }else if(runnumber<=170593&&runnumber>=167902){
1061  runnumber_offset = 167902;//lhc11h
1062  }
1063  fHistonElevsRunNumber->Fill(runnumber-runnumber_offset,nSeleTrks);
1064  fHistonXivsRunNumber->Fill(runnumber-runnumber_offset,nSeleCasc);
1065 
1066  //------------------------------------------------
1067  // Cascade loop
1068  //------------------------------------------------
1069  for (Int_t icasc = 0; icasc<nCascs; icasc++) {
1070  if(!seleCascFlags[icasc]) continue;
1071  AliAODcascade *casc = aodEvent->GetCascade(icasc);
1072  if(!casc) continue;
1073 
1074  AliAODTrack *cptrack = (AliAODTrack*)(casc->GetDaughter(0));
1075  AliAODTrack *cntrack = (AliAODTrack*)(casc->GetDaughter(1));
1076  AliAODTrack *cbtrack = (AliAODTrack*)(casc->GetDecayVertexXi()->GetDaughter(0));
1077 
1078  //------------------------------------------------
1079  // track loop
1080  //------------------------------------------------
1081  for (Int_t itrk = 0; itrk<nTracks; itrk++) {
1082  if(!seleTrkFlags[itrk]) continue;
1083  AliAODTrack *trk = (AliAODTrack*)aodEvent->GetTrack(itrk);
1084  //if(trk->GetID()<0) continue;
1085 
1086  //if(!fAnalCuts->SelectWithRoughCuts(v0,trk)) continue;
1087 
1088  //TPC only track (BIT 7) does not have PID information
1089  //In addition to that, TPC only tracks does not have good DCA resolution
1090  //(according to femtoscopy code)
1091  AliAODTrack *trkpid = 0;
1092  if(fAnalCuts->GetProdAODFilterBit()==7){
1093  trkpid = fGTI[-trk->GetID()-1];
1094  }else{
1095  trkpid = trk;
1096  }
1097 
1098  Int_t cpid = cptrack->GetID();
1099  Int_t cnid = cntrack->GetID();
1100  Int_t cbid = cbtrack->GetID();
1101  Int_t lpid = trkpid->GetID();
1102  if((cpid==lpid)||(cnid==lpid)||(cbid==lpid)) continue;
1103 
1104  AliAODVertex *secVert = ReconstructSecondaryVertex(casc,trk,aodEvent);//Fake, prim vertex is just used as secondary vertex. place holder for future
1105  if(!secVert) continue;
1106 
1107  AliAODRecoCascadeHF *exobj = MakeCascadeHF(casc,trk,trkpid,aodEvent,secVert);
1108  if(!exobj) {
1109  continue;
1110  }
1111 
1112  FillROOTObjects(exobj, casc,trk,trkpid,aodEvent,mcArray);
1113 
1114  exobj->GetSecondaryVtx()->RemoveDaughters();
1115  exobj->UnsetOwnPrimaryVtx();
1116  delete exobj;exobj=NULL;
1117  delete secVert;
1118  }
1119  }
1120 
1121  if(fDoEventMixing){
1122  fEventInfo->SetString(Form("Ev%d_esd%d_E%d_C%d",AliAnalysisManager::GetAnalysisManager()->GetNcalls(),((AliAODHeader*)aodEvent->GetHeader())->GetEventNumberESDFile(),fElectronTracks->GetEntries(),fCascadeTracks1->GetEntries()+fCascadeTracks2->GetEntries()));
1123  Int_t ind=GetPoolIndex(fVtxZ,fCentrality);
1124  if(ind>=0 && ind<fNOfPools){
1125  if(fEventBuffer[ind]->GetEntries() >= fNumberOfEventsForMixing){
1126  DoEventMixingWithPools(ind);
1127  if(fEventBuffer[ind]->GetEntries() >= 20*fNumberOfEventsForMixing){
1128  ResetPool(ind);
1129  }
1130  }
1131  fEventBuffer[ind]->Fill();
1132  }
1133  }
1134 }
1135 
1136 
1139 {
1140  //
1141  // Define tree variables
1142  //
1143 
1144  const char* nameoutput = GetOutputSlot(4)->GetContainer()->GetName();
1145  fVariablesTree = new TTree(nameoutput,"Candidates variables tree");
1146  Int_t nVar = 92;
1147  fCandidateVariables = new Float_t [nVar];
1148  TString * fCandidateVariableNames = new TString[nVar];
1149 
1150  fCandidateVariableNames[ 0]="Centrality";
1151  fCandidateVariableNames[ 1]="InvMassEleXi";
1152  fCandidateVariableNames[ 2]="EleXiPt";
1153  fCandidateVariableNames[ 3]="EleXiPx";
1154  fCandidateVariableNames[ 4]="EleXiPy";
1155  fCandidateVariableNames[ 5]="EleXiPz";
1156  fCandidateVariableNames[ 6]="ElePx";
1157  fCandidateVariableNames[ 7]="ElePy";
1158  fCandidateVariableNames[ 8]="ElePz";
1159  fCandidateVariableNames[ 9]="XiPx";
1160  fCandidateVariableNames[10]="XiPy";
1161  fCandidateVariableNames[11]="XiPz";
1162  fCandidateVariableNames[12]="XiCharge";
1163  fCandidateVariableNames[13]="MassXi";
1164  fCandidateVariableNames[14]="MassLambda";
1165  fCandidateVariableNames[15]="Eled0";
1166  fCandidateVariableNames[16]="Xid0";
1167  fCandidateVariableNames[17]="nSigmaTPCele";
1168  fCandidateVariableNames[18]="nSigmaTOFele";
1169  fCandidateVariableNames[19]="nSigmaTPCpr_etrk";
1170  fCandidateVariableNames[20]="nSigmaTOFpr_etrk";
1171  fCandidateVariableNames[21]="nSigmaTPCka_etrk";
1172  fCandidateVariableNames[22]="nSigmaTOFka_etrk";
1173  fCandidateVariableNames[23]="nSigmaTPCv0pr";
1174  fCandidateVariableNames[24]="nSigmaTOFv0pr";
1175  fCandidateVariableNames[25]="nSigmaTPCv0pi";
1176  fCandidateVariableNames[26]="nSigmaTOFv0pi";
1177  fCandidateVariableNames[27]="nSigmaTPCbachpi";
1178  fCandidateVariableNames[28]="nSigmaTOFbachpi";
1179  fCandidateVariableNames[29]="EleCharge";
1180  fCandidateVariableNames[30]="Mixing";
1181  fCandidateVariableNames[31]="DcaXiDaughters";
1182  fCandidateVariableNames[32]="DcaV0Daughters";
1183  fCandidateVariableNames[33]="DecayLengthXi";
1184  fCandidateVariableNames[34]="CosPointingAngleXi";
1185  fCandidateVariableNames[35]="DcaV0toPrimVertex";
1186  fCandidateVariableNames[36]="DcaPostoPrimVertex";
1187  fCandidateVariableNames[37]="DcaNegtoPrimVertex";
1188  fCandidateVariableNames[38]="DcaBachtoPrimVertex";
1189  fCandidateVariableNames[39]="DecayLengthV0";
1190  fCandidateVariableNames[40]="CosPointingAngleV0";
1191 
1192  fCandidateVariableNames[41]="mcpdgxic";
1193  fCandidateVariableNames[42]="mclabxic";
1194  fCandidateVariableNames[43]="mcxicpx";
1195  fCandidateVariableNames[44]="mcxicpy";
1196  fCandidateVariableNames[45]="mcxicpz";
1197  fCandidateVariableNames[46]="mcelepx";
1198  fCandidateVariableNames[47]="mcelepy";
1199  fCandidateVariableNames[48]="mcelepz";
1200  fCandidateVariableNames[49]="mccascpx";
1201  fCandidateVariableNames[50]="mccascpy";
1202  fCandidateVariableNames[51]="mccascpz";
1203 
1204  fCandidateVariableNames[52]="mcpdgele";
1205  fCandidateVariableNames[53]="mcpdgcasc";
1206  fCandidateVariableNames[54]="mcpdgmomele";
1207  fCandidateVariableNames[55]="mcpdgmomcasc";
1208  fCandidateVariableNames[56]="mcpdggrmomele";
1209  fCandidateVariableNames[57]="mcpdggrmomcasc";
1210  fCandidateVariableNames[58]="mcngenele";
1211  fCandidateVariableNames[59]="mcngencasc";
1212 
1213  fCandidateVariableNames[60]="nSigmaTPCpi_etrk";
1214  fCandidateVariableNames[61]="nSigmaTOFpi_etrk";
1215 
1216  fCandidateVariableNames[62]="V0PosPx";
1217  fCandidateVariableNames[63]="V0PosPy";
1218  fCandidateVariableNames[64]="V0PosPz";
1219  fCandidateVariableNames[65]="V0NegPx";
1220  fCandidateVariableNames[66]="V0NegPy";
1221  fCandidateVariableNames[67]="V0NegPz";
1222  fCandidateVariableNames[68]="V0VertX";
1223  fCandidateVariableNames[69]="V0VertY";
1224  fCandidateVariableNames[70]="V0VertZ";
1225  fCandidateVariableNames[71]="BachPx";
1226  fCandidateVariableNames[72]="BachPy";
1227  fCandidateVariableNames[73]="BachPz";
1228  fCandidateVariableNames[74]="XiVertX";
1229  fCandidateVariableNames[75]="XiVertY";
1230  fCandidateVariableNames[76]="XiVertZ";
1231  fCandidateVariableNames[77]="PrimVertX";
1232  fCandidateVariableNames[78]="PrimVertY";
1233  fCandidateVariableNames[79]="PrimVertZ";
1234 
1235  fCandidateVariableNames[80]="MassOmega";
1236 
1237  fCandidateVariableNames[81]= "EleITSMatch";
1238  fCandidateVariableNames[82]= "BachITSMatch";
1239  fCandidateVariableNames[83]= "V0PosITSMatch";
1240  fCandidateVariableNames[84]= "V0NegITSMatch";
1241 
1242  fCandidateVariableNames[85]= "TPCNclsF";
1243  fCandidateVariableNames[86]= "TPCNcls";
1244  fCandidateVariableNames[87]= "TPCNclsS";
1245  fCandidateVariableNames[88]= "IsXiPeakReagion";
1246 
1247 
1248  fCandidateVariableNames[89]="MagneticField";
1249  fCandidateVariableNames[90]="EvNumber";
1250  fCandidateVariableNames[91]="RunNumber";
1251 
1252  for (Int_t ivar=0; ivar<nVar; ivar++) {
1253  fVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1254  }
1255 
1256  return;
1257 }
1258 
1260 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillROOTObjects(AliAODRecoCascadeHF *exobj, AliAODcascade *casc, AliAODTrack *trk, AliAODTrack *trkpid, AliAODEvent *event, TClonesArray *mcArray)
1261 {
1262  //
1263  // Fill histograms or tree depending on fWriteVariableTree
1264  //
1265  if(!trk) return;
1266  if(!trkpid) return;
1267  if(!casc) return;
1268 
1269  for(Int_t i=0;i<92;i++){
1270  fCandidateVariables[i] = -9999.;
1271  }
1272 
1273 
1274  AliAODTrack *cptrack = (AliAODTrack*)(casc->GetDaughter(0));
1275  AliAODTrack *cntrack = (AliAODTrack*)(casc->GetDaughter(1));
1276  AliAODTrack *cbtrack = (AliAODTrack*)(casc->GetDecayVertexXi()->GetDaughter(0));
1277 // if(cptrack->Charge()<0 && cntrack->Charge()>0){
1278 // cptrack = (AliAODTrack*)(casc->GetDaughter(1));
1279 // cntrack = (AliAODTrack*)(casc->GetDaughter(0));
1280 // }
1281 // Double_t d0z0[2],covd0z0[3];
1282 // cptrack->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);//propagate to primary vertex for debugging
1283 // cntrack->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);//propagate to primary vertex for debugging
1284 // cbtrack->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);//propagate to primary vertex for debugging
1285 
1286  Double_t pxe = exobj->PxProng(0);
1287  Double_t pye = exobj->PyProng(0);
1288  Double_t pze = exobj->PzProng(0);
1289  Double_t mome = sqrt(pxe*pxe+pye*pye+pze*pze);
1290  Double_t Ee = sqrt(mome*mome+0.000510998928*0.000510998928);
1291  Double_t pxv = exobj->PxProng(1);
1292  Double_t pyv = exobj->PyProng(1);
1293  Double_t pzv = exobj->PzProng(1);
1294  Double_t momv = sqrt(pxv*pxv+pyv*pyv+pzv*pzv);
1295  Double_t Ev = sqrt(momv*momv+1.32171*1.32171);
1296  Double_t cosoa = (pxe*pxv+pye*pyv+pze*pzv)/mome/momv;
1297  Double_t Esum = Ee + Ev;
1298 
1299  Double_t uxe = pxe/mome;
1300  Double_t uye = pye/mome;
1301  Double_t uze = pze/mome;
1302  Double_t lf = -2.*(pxv*uxe+pyv*uye+pzv*uze);
1303  Double_t pxv_flip = pxv + lf * uxe;
1304  Double_t pyv_flip = pyv + lf * uye;
1305  Double_t pzv_flip = pzv + lf * uze;
1306  Double_t pxsum_flip = pxe + pxv_flip;
1307  Double_t pysum_flip = pye + pyv_flip;
1308  Double_t pzsum_flip = pze + pzv_flip;
1309  Double_t mexi_flip = sqrt(Esum*Esum-pxsum_flip*pxsum_flip-pysum_flip*pysum_flip-pzsum_flip*pzsum_flip);
1310  Double_t ptexi_flip = sqrt(pxsum_flip*pxsum_flip+pysum_flip*pysum_flip);
1311 
1312  Double_t minmass_ee = 9999.;
1313  Bool_t isconv = fAnalCuts->TagConversions(trk,fGTIndex,(AliAODEvent*)event,event->GetNumberOfTracks(),minmass_ee);
1314  Double_t minmasslike_ee = 9999.;
1315  Bool_t isconv_like = fAnalCuts->TagConversionsSameSign(trk,fGTIndex,(AliAODEvent*)event,event->GetNumberOfTracks(),minmasslike_ee);
1316 
1317 
1318  Double_t posVtx[3] = {0.,0.,0.};
1319  fVtx1->GetXYZ(posVtx);
1320 
1322  UInt_t pdgdg[2]={11,3312};
1323  fCandidateVariables[ 1] = exobj->InvMass(2,pdgdg);
1324  fCandidateVariables[ 2] = exobj->Pt();
1325  fCandidateVariables[ 3] = exobj->Px();
1326  fCandidateVariables[ 4] = exobj->Py();
1327  fCandidateVariables[ 5] = exobj->Pz();
1328  fCandidateVariables[ 6] = exobj->PxProng(0);
1329  fCandidateVariables[ 7] = exobj->PyProng(0);
1330  fCandidateVariables[ 8] = exobj->PzProng(0);
1331  fCandidateVariables[ 9] = exobj->PxProng(1);
1332  fCandidateVariables[10] = exobj->PyProng(1);
1333  fCandidateVariables[11] = exobj->PzProng(1);
1334  fCandidateVariables[12] = casc->ChargeXi();
1335  fCandidateVariables[13] = casc->MassXi();
1336  if(casc->ChargeXi()<0)
1337  fCandidateVariables[14] = casc->MassLambda();
1338  else
1339  fCandidateVariables[14] = casc->MassAntiLambda();
1340  fCandidateVariables[15] = exobj->Getd0Prong(0);
1341  fCandidateVariables[16] = exobj->Getd0Prong(1);
1342 
1343  Double_t nSigmaTPCele = -9999.;
1344  Double_t nSigmaTOFele = -9999.;
1345  if(fAnalCuts->GetIsUsePID())
1346  {
1347  nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kElectron);
1348  nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kElectron);
1349  fCandidateVariables[17] = nSigmaTPCele;
1350  fCandidateVariables[18] = nSigmaTOFele;
1351 
1352  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kProton);
1353  Double_t nSigmaTOFpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kProton);
1354  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kKaon);
1355  Double_t nSigmaTOFka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kKaon);
1356  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kPion);
1357  Double_t nSigmaTOFpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kPion);
1358  fCandidateVariables[19] = nSigmaTPCpr_etrk;
1359  fCandidateVariables[20] = nSigmaTOFpr_etrk;
1360  fCandidateVariables[21] = nSigmaTPCka_etrk;
1361  fCandidateVariables[22] = nSigmaTOFka_etrk;
1362  fCandidateVariables[60] = nSigmaTPCpi_etrk;
1363  fCandidateVariables[61] = nSigmaTOFpi_etrk;
1364  }
1365 
1366  Double_t nSigmaTPCv0pr=-9999.;
1367  Double_t nSigmaTOFv0pr=-9999.;
1368  Double_t nSigmaTPCv0pi=-9999.;
1369  Double_t nSigmaTOFv0pi=-9999.;
1370  Double_t nSigmaTPCbachpi=-9999.;
1371  Double_t nSigmaTOFbachpi=-9999.;
1373  {
1374  if(casc->ChargeXi()>0){
1375  nSigmaTPCv0pr = fAnalCuts->GetPidCascPr()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
1376  nSigmaTOFv0pr = fAnalCuts->GetPidCascPr()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kProton);
1377  nSigmaTPCv0pi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
1378  nSigmaTOFv0pi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kPion);
1379  nSigmaTPCbachpi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTPC(cbtrack,AliPID::kPion);
1380  nSigmaTOFbachpi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTOF(cbtrack,AliPID::kPion);
1381  }else{
1382  nSigmaTPCv0pr = fAnalCuts->GetPidCascPr()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
1383  nSigmaTOFv0pr = fAnalCuts->GetPidCascPr()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kProton);
1384  nSigmaTPCv0pi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
1385  nSigmaTOFv0pi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kPion);
1386  nSigmaTPCbachpi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTPC(cbtrack,AliPID::kPion);
1387  nSigmaTOFbachpi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTOF(cbtrack,AliPID::kPion);
1388  }
1389  fCandidateVariables[23] = nSigmaTPCv0pr;
1390  fCandidateVariables[24] = nSigmaTOFv0pr;
1391  fCandidateVariables[25] = nSigmaTPCv0pi;
1392  fCandidateVariables[26] = nSigmaTOFv0pi;
1393  fCandidateVariables[27] = nSigmaTPCbachpi;
1394  fCandidateVariables[28] = nSigmaTOFbachpi;
1395  }
1396  fCandidateVariables[29] = trk->Charge();
1397  fCandidateVariables[30] = 0;
1398  fCandidateVariables[31] = casc->DcaXiDaughters();
1399  fCandidateVariables[32] = casc->DcaV0Daughters();
1400  fCandidateVariables[33] = casc->DecayLengthXi(posVtx[0],posVtx[1],posVtx[2]);
1401  fCandidateVariables[34] = casc->CosPointingAngleXi(posVtx[0],posVtx[1],posVtx[2]);
1402  fCandidateVariables[35] = casc->DcaV0ToPrimVertex();
1403  fCandidateVariables[36] = casc->DcaPosToPrimVertex();
1404  fCandidateVariables[37] = casc->DcaNegToPrimVertex();
1405  fCandidateVariables[38] = casc->DcaBachToPrimVertex();
1406  fCandidateVariables[39] = casc->DecayLengthV0();
1407  fCandidateVariables[40] = casc->CosPointingAngle(casc->GetDecayVertexXi());
1408 
1409  AliAODMCParticle *mcxic = 0;
1410  AliAODMCParticle *mcele = 0;
1411  AliAODMCParticle *mccasc = 0;
1412  Int_t mclabxic = 0;
1413  Int_t mcpdgele_array[100];
1414  Int_t mcpdgcasc_array[100];
1415  Int_t mclabelele_array[100];
1416  Int_t mclabelcasc_array[100];
1417  Int_t mcngen_ele = -9999;
1418  Int_t mcngen_casc = -9999;
1419 
1420  if(fUseMCInfo && mcArray){
1421  mclabxic = MatchToMC(exobj,mcArray,mcpdgele_array, mcpdgcasc_array,mclabelele_array,mclabelcasc_array,mcngen_ele,mcngen_casc);
1422 
1423  if(mclabxic>-1){
1424  mcxic = (AliAODMCParticle*) mcArray->At(mclabxic);
1425  if(mclabelele_array[0]>=0)
1426  mcele = (AliAODMCParticle*) mcArray->At(mclabelele_array[0]);
1427  if(mclabelcasc_array[0]>=0)
1428  mccasc = (AliAODMCParticle*) mcArray->At(mclabelcasc_array[0]);
1429  if(mcxic){
1430  fCandidateVariables[41] = mcxic->GetPdgCode();
1431  fCandidateVariables[42] = mcxic->Label();
1432  fCandidateVariables[43] = mcxic->Px();
1433  fCandidateVariables[44] = mcxic->Py();
1434  fCandidateVariables[45] = mcxic->Pz();
1435  }
1436  if(mcele){
1437  fCandidateVariables[46] = mcele->Px();
1438  fCandidateVariables[47] = mcele->Py();
1439  fCandidateVariables[48] = mcele->Pz();
1440  }
1441  if(mccasc){
1442  fCandidateVariables[49] = mccasc->Px();
1443  fCandidateVariables[50] = mccasc->Py();
1444  fCandidateVariables[51] = mccasc->Pz();
1445  }
1446  }
1447  fCandidateVariables[52] = mcpdgele_array[0];
1448  fCandidateVariables[53] = mcpdgcasc_array[0];
1449  fCandidateVariables[54] = mcpdgele_array[1];
1450  fCandidateVariables[55] = mcpdgcasc_array[1];
1451  fCandidateVariables[56] = mcpdgele_array[2];
1452  fCandidateVariables[57] = mcpdgcasc_array[2];
1453  fCandidateVariables[58] = mcngen_ele;
1454  fCandidateVariables[59] = mcngen_casc;
1455  }
1456  fCandidateVariables[62] = casc->MomPosX();
1457  fCandidateVariables[63] = casc->MomPosY();
1458  fCandidateVariables[64] = casc->MomPosZ();
1459  fCandidateVariables[65] = casc->MomNegX();
1460  fCandidateVariables[66] = casc->MomNegY();
1461  fCandidateVariables[67] = casc->MomNegZ();
1462  fCandidateVariables[68] = casc->DecayVertexV0X();
1463  fCandidateVariables[69] = casc->DecayVertexV0Y();
1464  fCandidateVariables[70] = casc->DecayVertexV0Z();
1465  fCandidateVariables[71] = casc->MomBachX();
1466  fCandidateVariables[72] = casc->MomBachY();
1467  fCandidateVariables[73] = casc->MomBachZ();
1468  fCandidateVariables[74] = casc->DecayVertexXiX();
1469  fCandidateVariables[75] = casc->DecayVertexXiY();
1470  fCandidateVariables[76] = casc->DecayVertexXiZ();
1471  fCandidateVariables[77] = fVtx1->GetX();
1472  fCandidateVariables[78] = fVtx1->GetY();
1473  fCandidateVariables[79] = fVtx1->GetZ();
1474 
1475  fCandidateVariables[80] = casc->MassOmega();
1476 
1477  if(trk) fCandidateVariables[81] = trk->GetITSClusterMap();
1478  if(cbtrack) fCandidateVariables[82] = cbtrack->GetITSClusterMap();
1479  if(cptrack) fCandidateVariables[83] = cptrack->GetITSClusterMap();
1480  if(cntrack) fCandidateVariables[84] = cntrack->GetITSClusterMap();
1481 
1482  fCandidateVariables[85] = trk->GetTPCNclsF();
1483  fCandidateVariables[86] = trk->GetTPCNcls();
1484  fCandidateVariables[87] = trk->GetTPCnclsS();
1486 
1487  fCandidateVariables[89] = fBzkG;
1490 
1491 
1492  if(fWriteVariableTree)
1493  fVariablesTree->Fill();
1494 
1495  Double_t dphis_ele_pr, detas_ele_pr,dphis_ele_pi, detas_ele_pi, dphis_ele_bach, detas_ele_bach;
1496  dphis_ele_pr = 9999.;detas_ele_pr = 9999.;dphis_ele_pi = 9999.;detas_ele_pi = 9999.;dphis_ele_bach=9999.;detas_ele_bach=9999.;
1497  //fAnalCuts->GetdPhiSdEtaSR125(trk,cptrack,cntrack,cbtrack,fBzkG,posVtx, dphis_ele_pr,detas_ele_pr,dphis_ele_pi,detas_ele_pi, dphis_ele_bach, detas_ele_bach);
1498 
1499 
1500  Double_t cont[4];
1501  cont[0] = exobj->InvMass(2,pdgdg);
1502  cont[1] = exobj->Pt();
1503  cont[2] = exobj->Getd0Prong(0)*trk->Charge();
1504  cont[3] = fCentrality;
1505  fHistoEleXiMass->Fill(cont);
1506 
1507  Double_t cont_flip[4];
1508  cont_flip[0] = mexi_flip;
1509  cont_flip[1] = ptexi_flip;
1510  cont_flip[2] = 0.0;
1511  cont_flip[3] = fCentrality;
1512 
1513  Double_t cont2[3];
1514  cont2[0] = exobj->InvMass(2,pdgdg);
1515  cont2[1] = trk->Pt();
1516  cont2[2] = fCentrality;
1517 
1518  Double_t cont_eleptvseta[3];
1519  cont_eleptvseta[0] = trk->Pt();
1520  cont_eleptvseta[1] = trk->Eta();
1521  cont_eleptvseta[2] = fCentrality;
1522 
1523  Double_t cont_eleptvsxipt[3];
1524  cont_eleptvsxipt[0] = trk->Pt();
1525  cont_eleptvsxipt[1] = sqrt(casc->MomXiX()*casc->MomXiX()+casc->MomXiY()*casc->MomXiY());
1526  cont_eleptvsxipt[2] = fCentrality;
1527 
1528  Double_t cont_eleptvsd0[3];
1529  cont_eleptvsd0[0] = trk->Pt();
1530  cont_eleptvsd0[1] = exobj->Getd0Prong(0)*trk->Charge();
1531  cont_eleptvsd0[2] = fCentrality;
1532 
1533  Double_t exobj_mass = exobj->InvMass(2,pdgdg);
1534  Double_t exobj_px = exobj->Px();
1535  Double_t exobj_py = exobj->Py();
1536  Double_t exobj_pz = exobj->Pz();
1537  Double_t exobj_E = sqrt(exobj_mass*exobj_mass+exobj_px*exobj_px+exobj_py*exobj_py+exobj_pz*exobj_pz);
1538  Double_t exobj_rap = 0.5*log((exobj_E+exobj_pz)/(exobj_E-exobj_pz));
1539 
1540  //
1541  // Old strategy only look at mass and pairpt
1542  //
1544  {
1545  if(trk->Charge()*casc->ChargeXi()<0){
1546  fHistoEleXiMassRS->Fill(cont);
1547  if(trk->Charge()>0) fHistoEleXiMassRS1->Fill(cont);
1548  else fHistoEleXiMassRS2->Fill(cont);
1549  fHistoEleXiMassvsElePtRS->Fill(cont2);
1550  if(trk->Charge()>0) fHistoEleXiMassvsElePtRS1->Fill(cont2);
1551  else fHistoEleXiMassvsElePtRS2->Fill(cont2);
1552  if(cont[0]<2.5){
1553  fHistoEleXiPtvsRapidityRS->Fill(exobj->Pt(),exobj_rap);
1554  fHistoElePtRS->Fill(trk->Pt(),fCentrality);
1555  fHistoElePtvsEtaRS->Fill(cont_eleptvseta);
1556  fHistoElePtvsXiPtRS->Fill(cont_eleptvsxipt);
1557  fHistoElePtvsd0RS->Fill(cont_eleptvsd0);
1558  for(Int_t ih=0;ih<23;ih++){
1559  Double_t cont_eleptvscutvars[3];
1560  cont_eleptvscutvars[0] = exobj->Pt();
1561  cont_eleptvscutvars[2] = fCentrality;
1562 
1563  if(ih==0){
1564  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1565  }else if(ih==1){
1566  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1567  }else if(ih==2){
1568  cont_eleptvscutvars[1] = nSigmaTPCele;
1569  }else if(ih==3){
1570  cont_eleptvscutvars[1] = nSigmaTOFele;
1571  }else if(ih==4){
1572  cont_eleptvscutvars[1] = trk->Eta();
1573  }else if(ih==5){
1574  cont_eleptvscutvars[1] = trk->GetITSNcls();
1575  }else if(ih==6){
1576  if(casc->ChargeXi()<0)
1577  cont_eleptvscutvars[1] = casc->MassLambda();
1578  else
1579  cont_eleptvscutvars[1] = casc->MassAntiLambda();
1580  }else if(ih==7){
1581  cont_eleptvscutvars[1] = casc->MassXi();
1582  }else if(ih==8){
1583  Double_t lPosV0[3];
1584  lPosV0[0] = casc->DecayVertexV0X();
1585  lPosV0[1] = casc->DecayVertexV0Y();
1586  lPosV0[2] = casc->DecayVertexV0Z();
1587  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1588  }else if(ih==9){
1589  Double_t lPosXi[3];
1590  lPosXi[0] = casc->DecayVertexXiX();
1591  lPosXi[1] = casc->DecayVertexXiY();
1592  lPosXi[2] = casc->DecayVertexXiZ();
1593  cont_eleptvscutvars[1] = TMath::Sqrt(lPosXi[0]*lPosXi[0]+lPosXi[1]*lPosXi[1]);
1594  }else if(ih==10){
1595  cont_eleptvscutvars[1] = casc->DcaV0Daughters();
1596  }else if(ih==11){
1597  cont_eleptvscutvars[1] = casc->DcaXiDaughters();
1598  }else if(ih==12){
1599  cont_eleptvscutvars[1] = casc->DcaBachToPrimVertex();
1600  }else if(ih==13){
1601  if(casc->ChargeXi()<0.)
1602  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1603  else
1604  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1605  }else if(ih==14){
1606  if(casc->ChargeXi()>0.)
1607  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1608  else
1609  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1610  }else if(ih==15){
1611  cont_eleptvscutvars[1] = casc->CosPointingAngle(casc->GetDecayVertexXi());
1612  }else if(ih==16){
1613  cont_eleptvscutvars[1] = casc->CosPointingAngleXi(posVtx[0],posVtx[1],posVtx[2]);
1614  }else if(ih==17){
1615  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1616  }else if(ih==18){
1617  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1618  }else if(ih==19){
1619  cont_eleptvscutvars[1] = nSigmaTPCbachpi;
1620  }else if(ih==20){
1621  cont_eleptvscutvars[1] = casc->Eta();
1622  }else if(ih==21){
1623  cont_eleptvscutvars[1] = 0.5*TMath::Log((sqrt(casc->Ptot2Xi())+casc->MomXiZ())/(sqrt(casc->Ptot2Xi())-casc->MomXiZ()));
1624  }else if(ih==22){
1625  Double_t xipx = exobj->PxProng(1);
1626  Double_t xipy = exobj->PyProng(1);
1627  Double_t xipz = exobj->PzProng(1);
1628  Double_t epx = exobj->PxProng(0);
1629  Double_t epy = exobj->PyProng(0);
1630  Double_t epz = exobj->PzProng(0);
1631  cont_eleptvscutvars[1] = acos((xipx*epx+xipy*epy+xipz*epz)/sqrt(xipx*xipx+xipy*xipy+xipz*xipz)/sqrt(epx*epx+epy*epy+epz*epz));
1632  }else{
1633  cont_eleptvscutvars[1] = -9999.;
1634  }
1635 
1636  fHistoElePtvsCutVarsRS[ih]->Fill(cont_eleptvscutvars);
1637  }
1638  }
1639  if(fUseMCInfo){
1640  if(mcxic){
1641  Int_t pdgcode = mcxic->GetPdgCode();
1642  cont2[1] = mcele->Pt();
1643  if(abs(pdgcode)==4132 && abs(mcpdgele_array[1])==4132 && abs(mcpdgcasc_array[1])==4132){
1644  Int_t labmotherxic = mcxic->GetMother();
1645  Bool_t isbottomfd = kFALSE;
1646  if(labmotherxic>=0)
1647  {
1648  AliAODMCParticle *motherxic = (AliAODMCParticle*)mcArray->At(labmotherxic);
1649  Int_t pdgmotherxic = motherxic->GetPdgCode();
1650  if(TMath::Abs(pdgmotherxic)==511||TMath::Abs(pdgmotherxic)==521||TMath::Abs(pdgmotherxic)==5122||TMath::Abs(pdgmotherxic)==5132||TMath::Abs(pdgmotherxic)==5232||TMath::Abs(pdgmotherxic)==5332){
1651  isbottomfd = kTRUE;
1652  }
1653  }
1654 
1655  fHistoEleXiMassMCS->Fill(cont);
1656  if(trk->Charge()>0) fHistoEleXiMassMCS1->Fill(cont);
1657  else fHistoEleXiMassMCS2->Fill(cont);
1658 
1659  if(isbottomfd){
1660  fHistoEleXiMassBFeeddownMCS->Fill(cont);
1661  if(trk->Charge()>0) fHistoEleXiMassBFeeddownMCS1->Fill(cont);
1662  else fHistoEleXiMassBFeeddownMCS2->Fill(cont);
1663  }else{
1664  fHistoEleXiMassPromptMCS->Fill(cont);
1665  if(trk->Charge()>0) fHistoEleXiMassPromptMCS1->Fill(cont);
1666  else fHistoEleXiMassPromptMCS2->Fill(cont);
1667  }
1668 
1669  fHistoEleXiMassvsElePtMCS->Fill(cont2);
1670  if(trk->Charge()>0) fHistoEleXiMassvsElePtMCS1->Fill(cont2);
1671  else fHistoEleXiMassvsElePtMCS2->Fill(cont2);
1672  if(cont[0]<2.5){
1673  fHistoEleXiPtvsRapidityMCS->Fill(exobj->Pt(),exobj_rap);
1674  fHistoElePtMCS->Fill(mcele->Pt(),fCentrality);
1675  fHistoElePtvsEtaMCS->Fill(cont_eleptvseta);
1676  fHistoElePtvsXiPtMCS->Fill(cont_eleptvsxipt);
1677  fHistoElePtvsd0MCS->Fill(cont_eleptvsd0);
1678 
1679  Double_t cont_xic[3];
1680  cont_xic[0] = mcxic->Pt();
1681  cont_xic[1] = mcxic->Y();
1682  cont_xic[2] = fCentrality;
1683  fHistoXicMCS->Fill(cont_xic);
1684  if(trk->Charge()>0) fHistoXicMCS1->Fill(cont_xic);
1685  else fHistoXicMCS2->Fill(cont_xic);
1686 
1687  Double_t cont_mcele[3];
1688  cont_mcele[0] = mcele->Pt();
1689  cont_mcele[1] = mcele->Eta();
1690  cont_mcele[2] = fCentrality;
1691  fHistoXicElectronMCS->Fill(cont_mcele);
1692  if(trk->Charge()>0) fHistoXicElectronMCS1->Fill(cont_mcele);
1693  else fHistoXicElectronMCS2->Fill(cont_mcele);
1694 
1695  fHistoResponseElePt->Fill(mcxic->Pt(),trk->Pt());
1696  fHistoResponseXiPt->Fill(mcxic->Pt(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1697  fHistoResponseEleXiPt->Fill(mcxic->Pt(),exobj->Pt());
1698  fHistoResponseXiPtvsEleXiPt->Fill(exobj->Pt(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1699 
1700  Double_t cont_eleptvsxiptvsxicpt[4];
1701  cont_eleptvsxiptvsxicpt[0] = cont_eleptvsxipt[0];
1702  cont_eleptvsxiptvsxicpt[1] = cont_eleptvsxipt[1];
1703  cont_eleptvsxiptvsxicpt[2] = mcxic->Pt();
1704  cont_eleptvsxiptvsxicpt[3] = cont_eleptvsxipt[2];
1705  fHistoElePtvsXiPtvsXicPtMCS->Fill(cont_eleptvsxiptvsxicpt);
1706 
1707  if(isbottomfd){
1708  fHistoElePtvsd0BFeeddownMCS->Fill(cont_eleptvsd0);
1709  }else{
1710  fHistoElePtvsd0PromptMCS->Fill(cont_eleptvsd0);
1711  }
1712 
1713  for(Int_t ih=0;ih<23;ih++){
1714  Double_t cont_eleptvscutvars[3];
1715  cont_eleptvscutvars[0] = exobj->Pt();
1716  cont_eleptvscutvars[2] = fCentrality;
1717 
1718  if(ih==0){
1719  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1720  }else if(ih==1){
1721  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1722  }else if(ih==2){
1723  cont_eleptvscutvars[1] = nSigmaTPCele;
1724  }else if(ih==3){
1725  cont_eleptvscutvars[1] = nSigmaTOFele;
1726  }else if(ih==4){
1727  cont_eleptvscutvars[1] = trk->Eta();
1728  }else if(ih==5){
1729  cont_eleptvscutvars[1] = trk->GetITSNcls();
1730  }else if(ih==6){
1731  if(casc->ChargeXi()<0)
1732  cont_eleptvscutvars[1] = casc->MassLambda();
1733  else
1734  cont_eleptvscutvars[1] = casc->MassAntiLambda();
1735  }else if(ih==7){
1736  cont_eleptvscutvars[1] = casc->MassXi();
1737  }else if(ih==8){
1738  Double_t lPosV0[3];
1739  lPosV0[0] = casc->DecayVertexV0X();
1740  lPosV0[1] = casc->DecayVertexV0Y();
1741  lPosV0[2] = casc->DecayVertexV0Z();
1742  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1743  }else if(ih==9){
1744  Double_t lPosXi[3];
1745  lPosXi[0] = casc->DecayVertexXiX();
1746  lPosXi[1] = casc->DecayVertexXiY();
1747  lPosXi[2] = casc->DecayVertexXiZ();
1748  cont_eleptvscutvars[1] = TMath::Sqrt(lPosXi[0]*lPosXi[0]+lPosXi[1]*lPosXi[1]);
1749  }else if(ih==10){
1750  cont_eleptvscutvars[1] = casc->DcaV0Daughters();
1751  }else if(ih==11){
1752  cont_eleptvscutvars[1] = casc->DcaXiDaughters();
1753  }else if(ih==12){
1754  cont_eleptvscutvars[1] = casc->DcaBachToPrimVertex();
1755  }else if(ih==13){
1756  if(casc->ChargeXi()<0.)
1757  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1758  else
1759  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1760  }else if(ih==14){
1761  if(casc->ChargeXi()>0.)
1762  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1763  else
1764  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1765  }else if(ih==15){
1766  cont_eleptvscutvars[1] = casc->CosPointingAngle(casc->GetDecayVertexXi());
1767  }else if(ih==16){
1768  cont_eleptvscutvars[1] = casc->CosPointingAngleXi(posVtx[0],posVtx[1],posVtx[2]);
1769  }else if(ih==17){
1770  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1771  }else if(ih==18){
1772  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1773  }else if(ih==19){
1774  cont_eleptvscutvars[1] = nSigmaTPCbachpi;
1775  }else if(ih==20){
1776  cont_eleptvscutvars[1] = casc->Eta();
1777  }else if(ih==21){
1778  cont_eleptvscutvars[1] = 0.5*TMath::Log((sqrt(casc->Ptot2Xi())+casc->MomXiZ())/(sqrt(casc->Ptot2Xi())-casc->MomXiZ()));
1779  }else if(ih==22){
1780  Double_t xipx = exobj->PxProng(1);
1781  Double_t xipy = exobj->PyProng(1);
1782  Double_t xipz = exobj->PzProng(1);
1783  Double_t epx = exobj->PxProng(0);
1784  Double_t epy = exobj->PyProng(0);
1785  Double_t epz = exobj->PzProng(0);
1786  cont_eleptvscutvars[1] = acos((xipx*epx+xipy*epy+xipz*epz)/sqrt(xipx*xipx+xipy*xipy+xipz*xipz)/sqrt(epx*epx+epy*epy+epz*epz));
1787  }else{
1788  cont_eleptvscutvars[1] = -9999.;
1789  }
1790 
1791  fHistoElePtvsCutVarsMCS[ih]->Fill(cont_eleptvscutvars);
1792  }
1793  }
1794  }
1795  }
1796  }
1797  fHistodPhiSdEtaSElectronProtonR125RS->Fill(dphis_ele_pr,detas_ele_pr);
1798  fHistodPhiSdEtaSElectronPionR125RS->Fill(dphis_ele_pi,detas_ele_pi);
1799  fHistodPhiSdEtaSElectronBachelorR125RS->Fill(dphis_ele_bach,detas_ele_bach);
1800  }else{
1801  fHistoEleXiMassWS->Fill(cont);
1802  if(trk->Charge()>0) fHistoEleXiMassWS1->Fill(cont);
1803  else fHistoEleXiMassWS2->Fill(cont);
1804  fHistoEleXiMassvsElePtWS->Fill(cont2);
1805  if(trk->Charge()>0) fHistoEleXiMassvsElePtWS1->Fill(cont2);
1806  else fHistoEleXiMassvsElePtWS2->Fill(cont2);
1807  if(cont[0]<2.5){
1808  fHistoEleXiPtvsRapidityWS->Fill(exobj->Pt(),exobj_rap);
1809  fHistoElePtWS->Fill(trk->Pt(),fCentrality);
1810  fHistoElePtvsEtaWS->Fill(cont_eleptvseta);
1811  fHistoElePtvsXiPtWS->Fill(cont_eleptvsxipt);
1812  fHistoElePtvsd0WS->Fill(cont_eleptvsd0);
1813 
1814  for(Int_t ih=0;ih<23;ih++){
1815  Double_t cont_eleptvscutvars[3];
1816  cont_eleptvscutvars[0] = exobj->Pt();
1817  cont_eleptvscutvars[2] = fCentrality;
1818 
1819  if(ih==0){
1820  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1821  }else if(ih==1){
1822  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1823  }else if(ih==2){
1824  cont_eleptvscutvars[1] = nSigmaTPCele;
1825  }else if(ih==3){
1826  cont_eleptvscutvars[1] = nSigmaTOFele;
1827  }else if(ih==4){
1828  cont_eleptvscutvars[1] = trk->Eta();
1829  }else if(ih==5){
1830  cont_eleptvscutvars[1] = trk->GetITSNcls();
1831  }else if(ih==6){
1832  if(casc->ChargeXi()<0)
1833  cont_eleptvscutvars[1] = casc->MassLambda();
1834  else
1835  cont_eleptvscutvars[1] = casc->MassAntiLambda();
1836  }else if(ih==7){
1837  cont_eleptvscutvars[1] = casc->MassXi();
1838  }else if(ih==8){
1839  Double_t lPosV0[3];
1840  lPosV0[0] = casc->DecayVertexV0X();
1841  lPosV0[1] = casc->DecayVertexV0Y();
1842  lPosV0[2] = casc->DecayVertexV0Z();
1843  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1844  }else if(ih==9){
1845  Double_t lPosXi[3];
1846  lPosXi[0] = casc->DecayVertexXiX();
1847  lPosXi[1] = casc->DecayVertexXiY();
1848  lPosXi[2] = casc->DecayVertexXiZ();
1849  cont_eleptvscutvars[1] = TMath::Sqrt(lPosXi[0]*lPosXi[0]+lPosXi[1]*lPosXi[1]);
1850  }else if(ih==10){
1851  cont_eleptvscutvars[1] = casc->DcaV0Daughters();
1852  }else if(ih==11){
1853  cont_eleptvscutvars[1] = casc->DcaXiDaughters();
1854  }else if(ih==12){
1855  cont_eleptvscutvars[1] = casc->DcaBachToPrimVertex();
1856  }else if(ih==13){
1857  if(casc->ChargeXi()<0.)
1858  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1859  else
1860  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1861  }else if(ih==14){
1862  if(casc->ChargeXi()>0.)
1863  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1864  else
1865  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1866  }else if(ih==15){
1867  cont_eleptvscutvars[1] = casc->CosPointingAngle(casc->GetDecayVertexXi());
1868  }else if(ih==16){
1869  cont_eleptvscutvars[1] = casc->CosPointingAngleXi(posVtx[0],posVtx[1],posVtx[2]);
1870  }else if(ih==17){
1871  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1872  }else if(ih==18){
1873  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1874  }else if(ih==19){
1875  cont_eleptvscutvars[1] = nSigmaTPCbachpi;
1876  }else if(ih==20){
1877  cont_eleptvscutvars[1] = casc->Eta();
1878  }else if(ih==21){
1879  cont_eleptvscutvars[1] = 0.5*TMath::Log((sqrt(casc->Ptot2Xi())+casc->MomXiZ())/(sqrt(casc->Ptot2Xi())-casc->MomXiZ()));
1880  }else if(ih==22){
1881  Double_t xipx = exobj->PxProng(1);
1882  Double_t xipy = exobj->PyProng(1);
1883  Double_t xipz = exobj->PzProng(1);
1884  Double_t epx = exobj->PxProng(0);
1885  Double_t epy = exobj->PyProng(0);
1886  Double_t epz = exobj->PzProng(0);
1887  cont_eleptvscutvars[1] = acos((xipx*epx+xipy*epy+xipz*epz)/sqrt(xipx*xipx+xipy*xipy+xipz*xipz)/sqrt(epx*epx+epy*epy+epz*epz));
1888  }else{
1889  cont_eleptvscutvars[1] = -9999.;
1890  }
1891 
1892  fHistoElePtvsCutVarsWS[ih]->Fill(cont_eleptvscutvars);
1893  }
1894  }
1895  if(fUseMCInfo){
1896  if(mcxic){
1897  Int_t pdgcode = mcxic->GetPdgCode();
1898  Double_t cont_xib[3];
1899  cont_xib[0] = mcxic->Pt();
1900  cont_xib[1] = mcxic->Y();
1901  cont_xib[2] = fCentrality;
1902 
1903  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgcasc_array[1])==4132 && abs(mcpdgcasc_array[2])==5132){
1904  fHistoEleXiMassXibMCS->Fill(cont);
1905  if(trk->Charge()>0) fHistoEleXiMassXibMCS1->Fill(cont);
1906  else fHistoEleXiMassXibMCS2->Fill(cont);
1907  fHistoXibMCS->Fill(cont_xib);
1908  fHistoResponseXiPtXib->Fill(mcxic->Pt(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1909  fHistoResponseEleXiPtXib->Fill(mcxic->Pt(),exobj->Pt());
1910  }
1911  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgcasc_array[1])==4232 && abs(mcpdgcasc_array[2])==5132){
1912  fHistoEleXiMassXibMCS->Fill(cont);
1913  if(trk->Charge()>0) fHistoEleXiMassXibMCS1->Fill(cont);
1914  else fHistoEleXiMassXibMCS2->Fill(cont);
1915  fHistoXibMCS->Fill(cont_xib);
1916  fHistoResponseXiPtXib->Fill(mcxic->Pt(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1917  fHistoResponseEleXiPtXib->Fill(mcxic->Pt(),exobj->Pt());
1918  }
1919  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgcasc_array[1])==4132 && abs(mcpdgcasc_array[2])==5232){
1920  fHistoEleXiMassXibMCS->Fill(cont);
1921  if(trk->Charge()>0) fHistoEleXiMassXibMCS1->Fill(cont);
1922  else fHistoEleXiMassXibMCS2->Fill(cont);
1923  fHistoXibMCS->Fill(cont_xib);
1924  fHistoResponseXiPtXib->Fill(mcxic->Pt(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1925  fHistoResponseEleXiPtXib->Fill(mcxic->Pt(),exobj->Pt());
1926  }
1927  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgcasc_array[1])==4232 && abs(mcpdgcasc_array[2])==5232){
1928  fHistoEleXiMassXibMCS->Fill(cont);
1929  if(trk->Charge()>0) fHistoEleXiMassXibMCS1->Fill(cont);
1930  else fHistoEleXiMassXibMCS2->Fill(cont);
1931  fHistoXibMCS->Fill(cont_xib);
1932  fHistoResponseXiPtXib->Fill(mcxic->Pt(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1933  fHistoResponseEleXiPtXib->Fill(mcxic->Pt(),exobj->Pt());
1934  }
1935  }
1936  }
1937  fHistodPhiSdEtaSElectronProtonR125WS->Fill(dphis_ele_pr,detas_ele_pr);
1938  fHistodPhiSdEtaSElectronPionR125WS->Fill(dphis_ele_pi,detas_ele_pi);
1939  fHistodPhiSdEtaSElectronBachelorR125WS->Fill(dphis_ele_bach,detas_ele_bach);
1940  }
1941 
1942  }
1943 
1944  //if( exobj->InvMass(2,pdgdg)<10. && cosoa < 0. && fAnalCuts->IsPeakRegion(casc))
1945  if( mexi_flip <10. && cosoa < 0. && fAnalCuts->IsPeakRegion(casc))
1946  {
1947  if(trk->Charge()*casc->ChargeXi()<0){
1948  fHistoEleXiMassRSAway->Fill(cont_flip);
1949  if(trk->Charge()>0) fHistoEleXiMassRS1Away->Fill(cont_flip);
1950  else fHistoEleXiMassRS2Away->Fill(cont_flip);
1951  }else{
1952  fHistoEleXiMassWSAway->Fill(cont_flip);
1953  if(trk->Charge()>0) fHistoEleXiMassWS1Away->Fill(cont_flip);
1954  else fHistoEleXiMassWS2Away->Fill(cont_flip);
1955  }
1956  }
1957 
1959  {
1960  if(trk->Charge()*casc->ChargeXi()<0){
1961  fHistoEleXiMassRSSide->Fill(cont);
1962  if(trk->Charge()>0) fHistoEleXiMassRSSide1->Fill(cont);
1963  else fHistoEleXiMassRSSide2->Fill(cont);
1964  fHistoEleXiMassvsElePtRSSide->Fill(cont2);
1965  if(trk->Charge()>0) fHistoEleXiMassvsElePtRSSide1->Fill(cont2);
1966  else fHistoEleXiMassvsElePtRSSide2->Fill(cont2);
1967  }else{
1968  fHistoEleXiMassWSSide->Fill(cont);
1969  if(trk->Charge()>0) fHistoEleXiMassWSSide1->Fill(cont);
1970  else fHistoEleXiMassWSSide2->Fill(cont);
1971  fHistoEleXiMassvsElePtWSSide->Fill(cont2);
1972  if(trk->Charge()>0) fHistoEleXiMassvsElePtWSSide1->Fill(cont2);
1973  else fHistoEleXiMassvsElePtWSSide2->Fill(cont2);
1974  }
1975  }
1976 
1977  //if( exobj->InvMass(2,pdgdg)<10. && cosoa < 0. && fAnalCuts->IsSideBand(casc))
1978  if( mexi_flip< 10. && cosoa < 0. && fAnalCuts->IsSideBand(casc))
1979  {
1980  if(trk->Charge()*casc->ChargeXi()<0){
1981  fHistoEleXiMassRSSideAway->Fill(cont_flip);
1982  if(trk->Charge()>0) fHistoEleXiMassRSSide1Away->Fill(cont_flip);
1983  else fHistoEleXiMassRSSide2Away->Fill(cont_flip);
1984  }else{
1985  fHistoEleXiMassWSSideAway->Fill(cont_flip);
1986  if(trk->Charge()>0) fHistoEleXiMassWSSide1Away->Fill(cont_flip);
1987  else fHistoEleXiMassWSSide2Away->Fill(cont_flip);
1988  }
1989  }
1990 
1991  //
1992  // New strategy: Fully analyze correlation
1993  //
1994  for(Int_t iv=0;iv<13;iv++){
1995  fCorrelationVariables[iv] = -9999.;
1996  }
1997 
1998  fCorrelationVariables[0] = sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2));
1999  fCorrelationVariables[1] = trk->Pt();
2000  fCorrelationVariables[2] = fAnalCuts->DeltaPhi(casc,trk);
2001  fCorrelationVariables[3] = fAnalCuts->DeltaEta(casc,trk);
2002  fCorrelationVariables[5] = exobj->Getd0Prong(0);
2003  if(!fUseMCInfo) fCorrelationVariables[6] = 0;
2004  else fCorrelationVariables[6] = 1;
2005  if(trk->Charge()>0){
2006  if(casc->ChargeXi()<0) fCorrelationVariables[7] = 0;
2007  else fCorrelationVariables[7] = 2;
2008  }else if(trk->Charge()<0){
2009  if(casc->ChargeXi()<0) fCorrelationVariables[7] = 1;
2010  else fCorrelationVariables[7] = 3;
2011  }
2012  fCorrelationVariables[8] = (Int_t)isconv + 2 * (Int_t)isconv_like;
2014  fCorrelationVariables[11] = exobj->Pt();
2015  fCorrelationVariables[12] = exobj->InvMass(2,pdgdg);
2016 
2017  if(fUseMCInfo && FromSemileptonicDecays(mcpdgele_array)>0){
2018  if(mcxic){
2019  Int_t pdgcode = mcxic->GetPdgCode();
2020  if(abs(pdgcode)==4132 && abs(mcpdgele_array[1])==4132 && abs(mcpdgcasc_array[1])==4132){
2021  fCorrelationVariables[9] = 1;
2022  }
2023  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgcasc_array[1])==4132 && abs(mcpdgcasc_array[2])==5132){
2024  fCorrelationVariables[9] = 11;
2025  }
2026  if(abs(pdgcode)==5132 && abs(mcpdgele_array[1])==5132 && abs(mcpdgcasc_array[1])==4232 && abs(mcpdgcasc_array[2])==5132){
2027  fCorrelationVariables[9] = 12;
2028  }
2029  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgcasc_array[1])==4132 && abs(mcpdgcasc_array[2])==5232){
2030  fCorrelationVariables[9] = 13;
2031  }
2032  if(abs(pdgcode)==5232 && abs(mcpdgele_array[1])==5232 && abs(mcpdgcasc_array[1])==4232 && abs(mcpdgcasc_array[2])==5232){
2033  fCorrelationVariables[9] = 14;
2034  }
2035  }
2036  if(fCorrelationVariables[9]<0){
2037  Bool_t lam_from_bottom = HaveBottomInHistory(mcpdgcasc_array);
2038  Bool_t lam_from_charm = HaveCharmInHistory(mcpdgcasc_array);
2039  if(FromSemileptonicDecays(mcpdgele_array)==1){
2040  if(lam_from_bottom) fCorrelationVariables[9] = 1011;
2041  else if(lam_from_charm) fCorrelationVariables[9] = 1012;
2042  else fCorrelationVariables[9] = 1013;
2043  }
2044  if(FromSemileptonicDecays(mcpdgele_array)==2){
2045  if(lam_from_bottom) fCorrelationVariables[9] = 1014;
2046  else if(lam_from_charm) fCorrelationVariables[9] = 1015;
2047  else fCorrelationVariables[9] = 1016;
2048  }
2049  if(FromSemileptonicDecays(mcpdgele_array)==1 && HaveBottomInHistory(mcpdgele_array)){
2050  if(lam_from_bottom) fCorrelationVariables[9] = 1017;
2051  else if(lam_from_charm) fCorrelationVariables[9] = 1018;
2052  else fCorrelationVariables[9] = 1019;
2053  }
2054  }
2055  }
2056 
2058  {
2059  fCorrelationVariablesTree->Fill();
2060  }
2061 
2062 
2063  return;
2064 }
2065 
2067 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillMixROOTObjects(TLorentzVector *trke, TLorentzVector *casc, TVector *elevars, TVector *cascvars, Int_t chargexi)
2068 {
2069  //
2070  // Fill histograms or tree depending on fWriteVariableTree
2071  //
2072  if(!trke) return;
2073  if(!casc) return;
2074 
2075 
2076  for(Int_t i=0;i<90;i++){
2077  fCandidateVariables[i] = -9999.;
2078  }
2079 
2080  Double_t pxe = trke->Px();
2081  Double_t pye = trke->Py();
2082  Double_t pze = trke->Pz();
2083  Double_t mome = sqrt(pxe*pxe+pye*pye+pze*pze);
2084  Double_t Ee = sqrt(mome*mome+0.000510998928*0.000510998928);
2085 
2086  Double_t pxv = casc->Px();
2087  Double_t pyv = casc->Py();
2088  Double_t pzv = casc->Pz();
2089  Double_t momv = sqrt(pxv*pxv+pyv*pyv+pzv*pzv);
2090  Double_t Ev = sqrt(momv*momv+1.32171*1.32171);
2091 
2092  Double_t cosoa = (pxe*pxv+pye*pyv+pze*pzv)/mome/momv;
2093 
2094  Double_t pxsum = pxe + pxv;
2095  Double_t pysum = pye + pyv;
2096  Double_t pzsum = pze + pzv;
2097  Double_t Esum = Ee + Ev;
2098  Double_t mexi = sqrt(Esum*Esum-pxsum*pxsum-pysum*pysum-pzsum*pzsum);
2099 
2100  Double_t uxe = pxe/mome;
2101  Double_t uye = pye/mome;
2102  Double_t uze = pze/mome;
2103  Double_t lf = -2.*(pxv*uxe+pyv*uye+pzv*uze);
2104  Double_t pxv_flip = pxv + lf * uxe;
2105  Double_t pyv_flip = pyv + lf * uye;
2106  Double_t pzv_flip = pzv + lf * uze;
2107  Double_t pxsum_flip = pxe + pxv_flip;
2108  Double_t pysum_flip = pye + pyv_flip;
2109  Double_t pzsum_flip = pze + pzv_flip;
2110  Double_t mexi_flip = sqrt(Esum*Esum-pxsum_flip*pxsum_flip-pysum_flip*pysum_flip-pzsum_flip*pzsum_flip);
2111  Double_t ptexi_flip = sqrt(pxsum_flip*pxsum_flip+pysum_flip*pysum_flip);
2112 
2113  Double_t posVtx[3] = {0.,0.,0.};
2114  fVtx1->GetXYZ(posVtx);
2115 
2117  UInt_t pdgdg[2]={11,3312};
2118  fCandidateVariables[ 1] = mexi;
2119  fCandidateVariables[ 2] = sqrt(pxsum*pxsum+pysum*pysum);
2120  fCandidateVariables[ 3] = pxsum;
2121  fCandidateVariables[ 4] = pysum;
2122  fCandidateVariables[ 5] = pzsum;
2123  fCandidateVariables[ 6] = pxe;
2124  fCandidateVariables[ 7] = pye;
2125  fCandidateVariables[ 8] = pze;
2126  fCandidateVariables[ 9] = pxv;
2127  fCandidateVariables[10] = pyv;
2128  fCandidateVariables[11] = pzv;
2129  fCandidateVariables[12] = chargexi;
2130  fCandidateVariables[13] = casc->M();
2131  fCandidateVariables[29] = trke->T();
2132  fCandidateVariables[30] = 1;//mixing
2133  fCandidateVariables[77] = fVtx1->GetX();
2134  fCandidateVariables[78] = fVtx1->GetY();
2135  fCandidateVariables[79] = fVtx1->GetZ();
2137 
2138  if(fWriteVariableTree)
2139  fVariablesTree->Fill();
2140 
2141  Double_t cont[4];
2142  cont[0] = mexi;
2143  cont[1] = sqrt(pxsum*pxsum+pysum*pysum);
2144  cont[2] = 0.0;
2145  cont[3] = fCentrality;
2146 
2147  Double_t cont_flip[4];
2148  cont_flip[0] = mexi_flip;
2149  cont_flip[1] = ptexi_flip;
2150  cont_flip[2] = 0.0;
2151  cont_flip[3] = fCentrality;
2152 
2153  Double_t cont2[3];
2154  cont2[0] = mexi;
2155  cont2[1] = sqrt(pxe*pxe+pye*pye);
2156  cont2[2] = fCentrality;
2157 
2158  Double_t cont_eleptvseta[3];
2159  cont_eleptvseta[0] = trke->Pt();
2160  cont_eleptvseta[1] = trke->Eta();
2161  cont_eleptvseta[2] = fCentrality;
2162 
2163  Double_t cont_eleptvsxipt[3];
2164  cont_eleptvsxipt[0] = trke->Pt();
2165  cont_eleptvsxipt[1] = casc->Pt();
2166  cont_eleptvsxipt[2] = fCentrality;
2167 
2168  Double_t cont_eleptvsd0[3];
2169  cont_eleptvsd0[0] = trke->Pt();
2170  cont_eleptvsd0[1] = 0.;
2171  cont_eleptvsd0[2] = fCentrality;
2172 
2173  Double_t xyzR125_ele[3], xyzR125_pr[3], xyzR125_pi[3], xyzR125_bach[3];
2174  xyzR125_ele[0] = (*elevars)[0];
2175  xyzR125_ele[1] = (*elevars)[1];
2176  xyzR125_ele[2] = (*elevars)[2];
2177  xyzR125_pr[0] = (*cascvars)[0];
2178  xyzR125_pr[1] = (*cascvars)[1];
2179  xyzR125_pr[2] = (*cascvars)[2];
2180  xyzR125_pi[0] = (*cascvars)[3];
2181  xyzR125_pi[1] = (*cascvars)[4];
2182  xyzR125_pi[2] = (*cascvars)[5];
2183  xyzR125_bach[0] = (*cascvars)[6];
2184  xyzR125_bach[1] = (*cascvars)[7];
2185  xyzR125_bach[2] = (*cascvars)[8];
2186 
2187  Double_t rdhfcutvars[12];
2188  rdhfcutvars[0] = xyzR125_ele[0];
2189  rdhfcutvars[1] = xyzR125_ele[1];
2190  rdhfcutvars[2] = xyzR125_ele[2];
2191  rdhfcutvars[3] = xyzR125_pr[0];
2192  rdhfcutvars[4] = xyzR125_pr[1];
2193  rdhfcutvars[5] = xyzR125_pr[2];
2194  rdhfcutvars[6] = xyzR125_pi[0];
2195  rdhfcutvars[7] = xyzR125_pi[1];
2196  rdhfcutvars[8] = xyzR125_pi[2];
2197  rdhfcutvars[9] = xyzR125_bach[0];
2198  rdhfcutvars[10] = xyzR125_bach[1];
2199  rdhfcutvars[11] = xyzR125_bach[2];
2200 
2201  Double_t dphis_ele_pr = fAnalCuts->dPhiSR125(xyzR125_ele,xyzR125_pr);
2202  Double_t detas_ele_pr = fAnalCuts->dEtaSR125(xyzR125_ele,xyzR125_pr);
2203  Double_t dphis_ele_pi = fAnalCuts->dPhiSR125(xyzR125_ele,xyzR125_pi);
2204  Double_t detas_ele_pi = fAnalCuts->dEtaSR125(xyzR125_ele,xyzR125_pi);
2205  Double_t dphis_ele_bach = fAnalCuts->dPhiSR125(xyzR125_ele,xyzR125_bach);
2206  Double_t detas_ele_bach = fAnalCuts->dEtaSR125(xyzR125_ele,xyzR125_bach);
2207 
2208  //if(mexi<10. && cosoa>0. && fAnalCuts->IsPeakRegion(casc))
2209  if(fAnalCuts->IsSelected(trke,casc,rdhfcutvars,AliRDHFCuts::kCandidate) && fAnalCuts->IsPeakRegion(casc))
2210  {
2211  if(((int)trke->T())*chargexi<0){
2212  fHistoEleXiMassRSMix->Fill(cont);
2213  if(trke->T()>0) fHistoEleXiMassRSMix1->Fill(cont);
2214  else fHistoEleXiMassRSMix2->Fill(cont);
2215  fHistoEleXiMassvsElePtRSMix->Fill(cont2);
2216  if(trke->T()>0) fHistoEleXiMassvsElePtRSMix1->Fill(cont2);
2217  else fHistoEleXiMassvsElePtRSMix2->Fill(cont2);
2218  if(cont[0]<2.5){
2219  fHistoElePtRSMix->Fill(trke->Pt(),fCentrality);
2220  fHistoElePtvsEtaRSMix->Fill(cont_eleptvseta);
2221  fHistoElePtvsXiPtRSMix->Fill(cont_eleptvsxipt);
2222  fHistoElePtvsd0RSMix->Fill(cont_eleptvsd0);
2223  }
2224  fHistodPhiSdEtaSElectronProtonR125RSMix->Fill(dphis_ele_pr,detas_ele_pr);
2225  fHistodPhiSdEtaSElectronPionR125RSMix->Fill(dphis_ele_pi,detas_ele_pi);
2226  fHistodPhiSdEtaSElectronBachelorR125RSMix->Fill(dphis_ele_bach,detas_ele_bach);
2227  }else{
2228  fHistoEleXiMassWSMix->Fill(cont);
2229  if(trke->T()>0) fHistoEleXiMassWSMix1->Fill(cont);
2230  else fHistoEleXiMassWSMix2->Fill(cont);
2231  fHistoEleXiMassvsElePtWSMix->Fill(cont2);
2232  if(trke->T()>0) fHistoEleXiMassvsElePtWSMix1->Fill(cont2);
2233  else fHistoEleXiMassvsElePtWSMix2->Fill(cont2);
2234  if(cont[0]<2.5){
2235  fHistoElePtWSMix->Fill(trke->Pt(),fCentrality);
2236  fHistoElePtvsEtaWSMix->Fill(cont_eleptvseta);
2237  fHistoElePtvsXiPtWSMix->Fill(cont_eleptvsxipt);
2238  fHistoElePtvsd0WSMix->Fill(cont_eleptvsd0);
2239  }
2240  fHistodPhiSdEtaSElectronProtonR125WSMix->Fill(dphis_ele_pr,detas_ele_pr);
2241  fHistodPhiSdEtaSElectronPionR125WSMix->Fill(dphis_ele_pi,detas_ele_pi);
2242  fHistodPhiSdEtaSElectronBachelorR125WSMix->Fill(dphis_ele_bach,detas_ele_bach);
2243  }
2244  }
2245 
2246  //if(mexi < 10. && cosoa<0. && fAnalCuts->IsPeakRegion(casc))
2247  if(mexi_flip < 10. && cosoa<0. && fAnalCuts->IsPeakRegion(casc))
2248  {
2249  if(((int)trke->T())*chargexi<0){
2250  fHistoEleXiMassRSMixAway->Fill(cont_flip);
2251  if(trke->T()>0) fHistoEleXiMassRSMix1Away->Fill(cont_flip);
2252  else fHistoEleXiMassRSMix2Away->Fill(cont_flip);
2253  }else{
2254  fHistoEleXiMassWSMixAway->Fill(cont_flip);
2255  if(trke->T()>0) fHistoEleXiMassWSMix1Away->Fill(cont_flip);
2256  else fHistoEleXiMassWSMix2Away->Fill(cont_flip);
2257  }
2258  }
2259 
2260  //
2261  // New strategy: Fully analyze correlation
2262  //
2263  for(Int_t iv=0;iv<13;iv++){
2264  fCorrelationVariables[iv] = -9999.;
2265  }
2266 
2267  fCorrelationVariables[0] = casc->Pt();
2268  fCorrelationVariables[1] = trke->Pt();
2269  fCorrelationVariables[2] = TVector2::Phi_mpi_pi(casc->Phi()-trke->Phi());
2270  fCorrelationVariables[3] = casc->Eta()-trke->Eta();
2271  fCorrelationVariables[5] = (*elevars)[5];
2272  fCorrelationVariables[6] = 2;
2273  if(trke->T()>0){
2274  if(chargexi<0) fCorrelationVariables[7] = 0;
2275  else fCorrelationVariables[7] = 2;
2276  }else if(trke->T()<0){
2277  if(chargexi<0) fCorrelationVariables[7] = 1;
2278  else fCorrelationVariables[7] = 3;
2279  }
2280  fCorrelationVariables[8] = (*elevars)[6];
2281  fCorrelationVariables[9] = (*elevars)[7];
2282  fCorrelationVariables[10] = fCentrality;
2283  fCorrelationVariables[11] = sqrt(pxsum*pxsum+pysum*pysum);
2284  fCorrelationVariables[12] = mexi;
2285 
2286  if(fAnalCuts->IsSelected(trke,casc,rdhfcutvars,AliRDHFCuts::kCandidate) && fAnalCuts->IsPeakRegion(casc))
2287  {
2288  fCorrelationVariablesTree->Fill();
2289  }
2290 
2291 
2292  return;
2293 }
2294 
2297 {
2298  //
2299  // Define electron tree variables
2300  //
2301 
2302  const char* nameoutput = GetOutputSlot(5)->GetContainer()->GetName();
2303  fEleVariablesTree = new TTree(nameoutput,"electron variables tree");
2304  Int_t nVar = 26;
2305  fCandidateEleVariables = new Float_t [nVar];
2306  TString * fCandidateVariableNames = new TString[nVar];
2307 
2308  fCandidateVariableNames[ 0]="ElePx";
2309  fCandidateVariableNames[ 1]="ElePy";
2310  fCandidateVariableNames[ 2]="ElePz";
2311  fCandidateVariableNames[ 3]="TPCChi2overNDF";
2312  fCandidateVariableNames[ 4]="ITSNcls";
2313  fCandidateVariableNames[ 5]="TPCNcls";
2314  fCandidateVariableNames[ 6]="TPCNclsPID";
2315  fCandidateVariableNames[ 7]="TPCNclsRatio";
2316  fCandidateVariableNames[ 8]="d0R";
2317  fCandidateVariableNames[ 9]="d0Z";
2318  fCandidateVariableNames[10]="ITSClusterMap";
2319  fCandidateVariableNames[11]="nSigmaTPCele";
2320  fCandidateVariableNames[12]="nSigmaTOFele";
2321  fCandidateVariableNames[13]="nSigmaTPCpi";
2322  fCandidateVariableNames[14]="nSigmaTPCka";
2323  fCandidateVariableNames[15]="nSigmaTPCpr";
2324  fCandidateVariableNames[16]="EvNumber";
2325  fCandidateVariableNames[17]="EleCharge";
2326  fCandidateVariableNames[18]="ElePdgCode";
2327  fCandidateVariableNames[19]="EleMotherPdgCode";
2328  fCandidateVariableNames[20]="mcelepx";
2329  fCandidateVariableNames[21]="mcelepy";
2330  fCandidateVariableNames[22]="mcelepz";
2331  fCandidateVariableNames[23]="Centrality";
2332  fCandidateVariableNames[24]="PrimVertZ";
2333  fCandidateVariableNames[25]="RunNumber";
2334 
2335  for (Int_t ivar=0; ivar<nVar; ivar++) {
2336  fEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2337  }
2338 
2339  return;
2340 }
2342 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillElectronROOTObjects(AliAODTrack *trk, AliAODTrack *trkpid, Int_t convtype, Int_t mcetype, AliAODEvent *event, TClonesArray *mcArray)
2343 {
2344  //
2345  // Fill histograms or tree depending on fWriteVariableTree
2346  //
2347 
2348  if(!trk) return;
2349 
2350  fHistoBachPt->Fill(trk->Pt());
2351  fHistoElectronQovPtvsPhi->Fill(trk->Phi(),(Double_t)trk->Charge()/trk->Pt());
2352 
2353  Double_t d0z0[2],covd0z0[3];
2354  trk->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);
2355 
2356  if(fDoEventMixing){
2357  Double_t pv[3];
2358  pv[0] = fVtx1->GetX();
2359  pv[1] = fVtx1->GetY();
2360  pv[2] = fVtx1->GetZ();
2361  Double_t xyzR125[3] = {9999.,9999.,9999.};
2362  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.) fAnalCuts->SetSftPosR125(trk,fBzkG,pv,xyzR125);
2363  TVector *varvec = new TVector(8);
2364  (*varvec)[0] = xyzR125[0];
2365  (*varvec)[1] = xyzR125[1];
2366  (*varvec)[2] = xyzR125[2];
2367  (*varvec)[3] = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kElectron);
2368  (*varvec)[4] = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kElectron);
2369  (*varvec)[5] = d0z0[0];
2370  (*varvec)[6] = convtype;
2371  (*varvec)[7] = mcetype;
2372  fElectronTracks->AddLast(new TLorentzVector(trk->Px(),trk->Py(),trk->Pz(),trk->Charge()));
2373  fElectronCutVarsArray->AddLast(varvec);
2374  }
2375 
2376 
2377  Int_t pdgEle = -9999;
2378  Int_t pdgEleMother = -9999;
2379  Float_t mcepx = -9999;
2380  Float_t mcepy = -9999;
2381  Float_t mcepz = -9999;
2382  if(fUseMCInfo)
2383  {
2384  Int_t labEle = trk->GetLabel();
2385  if(labEle<0) return;
2386  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
2387  if(!mcetrk) return;
2388  pdgEle = mcetrk->GetPdgCode();
2389  mcepx = mcetrk->Px();
2390  mcepy = mcetrk->Py();
2391  mcepz = mcetrk->Pz();
2392  }
2393 
2394 
2395  if(!fWriteEachVariableTree) return;
2396 
2397 
2398  for(Int_t i=0;i<26;i++){
2399  fCandidateEleVariables[i] = -9999.;
2400  }
2401 
2402  fCandidateEleVariables[ 0] = trk->Px();
2403  fCandidateEleVariables[ 1] = trk->Py();
2404  fCandidateEleVariables[ 2] = trk->Pz();
2405  fCandidateEleVariables[ 3] = trk->Chi2perNDF();
2406  fCandidateEleVariables[ 4] = trk->GetITSNcls();
2407  fCandidateEleVariables[ 5] = trk->GetTPCncls();
2408  fCandidateEleVariables[ 6] = trk->GetTPCsignalN();
2409  if(trk->GetTPCNclsF()>0)
2410  fCandidateEleVariables[ 7] = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
2411 
2412  fCandidateEleVariables[ 8] = d0z0[0];
2413  fCandidateEleVariables[ 9] = d0z0[1];
2414  Int_t itsmap = trk->GetITSClusterMap();
2415  Int_t bit1 = 1;
2416  Int_t bit2 = 2;
2417  Bool_t spdfirst = (itsmap & bit1) == bit1;
2418  Bool_t spdsecond = (itsmap & bit2) == bit2;
2419  fCandidateEleVariables[10] = ((Int_t)spdfirst) + 2 * ((Int_t)spdsecond);
2420 
2421  if(fAnalCuts->GetIsUsePID())
2422  {
2423  Double_t nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
2424  Double_t nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
2425  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
2426  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
2427  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
2428  fCandidateEleVariables[11] = nSigmaTPCele;
2429  fCandidateEleVariables[12] = nSigmaTOFele;
2430  fCandidateEleVariables[13] = nSigmaTPCpi_etrk;
2431  fCandidateEleVariables[14] = nSigmaTPCka_etrk;
2432  fCandidateEleVariables[15] = nSigmaTPCpr_etrk;
2433  }
2435  fCandidateEleVariables[17] = trk->Charge();
2436  fCandidateEleVariables[18] = pdgEle;
2437  fCandidateEleVariables[19] = pdgEleMother;
2438  fCandidateEleVariables[20] = mcepx;
2439  fCandidateEleVariables[21] = mcepy;
2440  fCandidateEleVariables[22] = mcepz;
2444 
2445  fHistod0Bach->Fill(d0z0[0]);
2446 
2447  fEleVariablesTree->Fill();
2448 }
2451 {
2452  //
2453  // Define V0 tree variables
2454  //
2455 
2456  const char* nameoutput = GetOutputSlot(6)->GetContainer()->GetName();
2457  fCascVariablesTree = new TTree(nameoutput,"cascade variables tree");
2458  Int_t nVar = 26;
2459  fCandidateCascVariables = new Float_t [nVar];
2460  TString * fCandidateVariableNames = new TString[nVar];
2461 
2462  fCandidateVariableNames[ 0]="Centrality";
2463  fCandidateVariableNames[ 1]="InvMassXi";
2464  fCandidateVariableNames[ 2]="XiPx";
2465  fCandidateVariableNames[ 3]="XiPy";
2466  fCandidateVariableNames[ 4]="XiPz";
2467  fCandidateVariableNames[ 5]="InvMassLambda";
2468  fCandidateVariableNames[ 6]="DcaXiDaughters";
2469  fCandidateVariableNames[ 7]="DcaV0Daughters";
2470  fCandidateVariableNames[ 8]="DecayLengthXi";
2471  fCandidateVariableNames[ 9]="CosPointingAngleXi";
2472  fCandidateVariableNames[10]="DcaV0toPrimVertex";
2473  fCandidateVariableNames[11]="DcaPostoPrimVertex";
2474  fCandidateVariableNames[12]="DcaNegtoPrimVertex";
2475  fCandidateVariableNames[13]="DcaBachtoPrimVertex";
2476  fCandidateVariableNames[14]="DecayLengthV0";
2477  fCandidateVariableNames[15]="CosPointingAngleV0";
2478  fCandidateVariableNames[16]="XiCharge";
2479  fCandidateVariableNames[17]="XiPdgCode";
2480  fCandidateVariableNames[18]="XiMotherPdgCode";
2481  fCandidateVariableNames[19]="mcxipx";
2482  fCandidateVariableNames[20]="mcxipy";
2483  fCandidateVariableNames[21]="mcxipz";
2484  fCandidateVariableNames[22]="labcasc";
2485  fCandidateVariableNames[23]="RunNumber";
2486  fCandidateVariableNames[24]="PrimVertZ";
2487  fCandidateVariableNames[25]="EvNumber";
2488 
2489  for (Int_t ivar=0; ivar<nVar; ivar++) {
2490  fCascVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateCascVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2491  }
2492 
2493  return;
2494 }
2495 
2497 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillCascROOTObjects(AliAODcascade *casc, TClonesArray *mcArray)
2498 {
2499  //
2500  // Fill histograms or tree depending on fWriteVariableTree (tree not implemented yet)
2501  //
2502  if(!casc) return;
2503  AliAODTrack *cptrack = (AliAODTrack*)(casc->GetDaughter(0));
2504  AliAODTrack *cntrack = (AliAODTrack*)(casc->GetDaughter(1));
2505  AliAODTrack *cbtrack = (AliAODTrack*)(casc->GetDecayVertexXi()->GetDaughter(0));
2506  if(!cptrack) return;
2507  if(!cntrack) return;
2508  if(!cbtrack) return;
2509 
2510  fHistoXiMassvsPt->Fill(casc->MassXi(),sqrt(casc->MomXiX()*casc->MomXiX()+casc->MomXiY()*casc->MomXiY()));
2511  fHistoOmegaMassvsPt->Fill(casc->MassOmega(),sqrt(casc->MomXiX()*casc->MomXiX()+casc->MomXiY()*casc->MomXiY()));
2512  Double_t momxix = casc->MomXiX();
2513  Double_t momxiy = casc->MomXiY();
2514  Double_t phi_alice = atan2(momxiy,momxix);
2515  if(phi_alice<0.) phi_alice += 2 * M_PI;
2516  fHistoXiQovPtvsPhi->Fill(phi_alice,(Double_t)casc->ChargeXi()/sqrt(momxix*momxix+momxiy*momxiy));
2517 
2518  Double_t mlamPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
2519  Double_t posVtx[3] = {0.,0.,0.};
2520  fVtx1->GetXYZ(posVtx);
2521  Double_t ptotlam = TMath::Sqrt(pow(casc->Px(),2)+pow(casc->Py(),2)+pow(casc->Pz(),2));
2522  Double_t dl = sqrt(pow(casc->DecayVertexV0X()-posVtx[0],2)+pow(casc->DecayVertexV0Y()-posVtx[1],2)+pow(casc->DecayVertexV0Z()-posVtx[2],2));
2523  Double_t v0propdl = dl*mlamPDG/ptotlam;
2524  if(fAnalCuts->IsPeakRegion(casc)){
2525  fHistoLambdaPtvsDl->Fill(casc->Pt(),v0propdl);
2526  fHistoLambdaPtvsDR->Fill(casc->Pt(),dl);
2527  }
2528  if(fAnalCuts->IsSideBand(casc)){
2529  fHistoLambdaPtvsDlSide->Fill(casc->Pt(),v0propdl);
2530  fHistoLambdaPtvsDRSide->Fill(casc->Pt(),dl);
2531  }
2532 
2533  Int_t xipdgcode = -9999;
2534  Int_t ximotherpdgcode = -9999;
2535  Float_t mcxipx = -9999.;
2536  Float_t mcxipy = -9999.;
2537  Float_t mcxipz = -9999.;
2538  Int_t labcasc = -9999.;
2539  if(fUseMCInfo){
2540  Int_t pdgDgcasc[2]={211,3122};
2541  Int_t pdgDgv0[2]={2212,211};
2542  labcasc = MatchToMCCascade(casc,3312,pdgDgcasc,pdgDgv0,mcArray); // the cascade
2543  if(labcasc<0) return;
2544 
2545  fHistoXiMassvsPtMCS->Fill(casc->MassXi(),sqrt(casc->MomXiX()*casc->MomXiX()+casc->MomXiY()*casc->MomXiY()));
2546 
2547  AliAODMCParticle *mccasctrk = (AliAODMCParticle*)mcArray->At(labcasc);
2548  if(!mccasctrk) return;
2549 
2550  fHistoLambdaPtvsDlMCS->Fill(casc->Pt(),v0propdl);
2551  fHistoLambdaPtvsDRMCS->Fill(casc->Pt(),dl);
2552 
2553  Bool_t hfxi_flag = kFALSE;
2554  xipdgcode = mccasctrk->GetPdgCode();
2555  Int_t labcascmother = mccasctrk->GetMother();
2556  if(labcascmother>=0){
2557  AliAODMCParticle *mothercasc = (AliAODMCParticle*)mcArray->At(labcascmother);
2558  if(mothercasc){
2559  ximotherpdgcode = mothercasc->GetPdgCode();
2560  if(abs(ximotherpdgcode)>4000&&abs(ximotherpdgcode)<4400){
2561  hfxi_flag = kTRUE;
2562  }
2563  }
2564  }
2565  if(!hfxi_flag) return;
2566  mcxipx = mccasctrk->Px();
2567  mcxipy = mccasctrk->Py();
2568  mcxipz = mccasctrk->Pz();
2569  }
2570 
2571 
2572  Double_t xyz[3], pxpypz[3], cv[21]; Short_t sign;
2573  xyz[0]=casc->DecayVertexXiX();
2574  xyz[1]=casc->DecayVertexXiY();
2575  xyz[2]=casc->DecayVertexXiZ();
2576  pxpypz[0]=casc->MomXiX();
2577  pxpypz[1]=casc->MomXiY();
2578  pxpypz[2]=casc->MomXiZ();
2579  casc->GetCovarianceXYZPxPyPz(cv);
2580  sign=casc->ChargeXi();
2581  AliExternalTrackParam *trackCasc = new AliExternalTrackParam(xyz,pxpypz,cv,sign);
2582  trackCasc->PropagateToDCA(fVtx1,fBzkG,kVeryBig);
2583  Double_t momcasc_new[3]={-9999,-9999,-9999.};
2584  trackCasc->GetPxPyPz(momcasc_new);
2585 
2586  if(fDoEventMixing){
2587  TLorentzVector *lv = new TLorentzVector();
2588  lv->SetXYZM(momcasc_new[0],momcasc_new[1],momcasc_new[2],casc->MassXi());
2589  Double_t xyzR125pr[3]={9999.,9999.,9999.};
2590  Double_t xyzR125pi[3]={9999.,9999.,9999.};
2591  Double_t xyzR125bach[3]={9999.,9999.,9999.};
2592  if(casc->ChargeXi()>0){
2593  fCascadeTracks1->AddLast(lv);
2594  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.){
2595  fAnalCuts->SetSftPosR125(cptrack,fBzkG,posVtx,xyzR125pr);
2596  fAnalCuts->SetSftPosR125(cntrack,fBzkG,posVtx,xyzR125pi);
2597  fAnalCuts->SetSftPosR125(cbtrack,fBzkG,posVtx,xyzR125bach);
2598  }
2599  TVector *varvec = new TVector(9);
2600  (*varvec)[0] = xyzR125pr[0];
2601  (*varvec)[1] = xyzR125pr[1];
2602  (*varvec)[2] = xyzR125pr[2];
2603  (*varvec)[3] = xyzR125pi[0];
2604  (*varvec)[4] = xyzR125pi[1];
2605  (*varvec)[5] = xyzR125pi[2];
2606  (*varvec)[6] = xyzR125bach[0];
2607  (*varvec)[7] = xyzR125bach[1];
2608  (*varvec)[8] = xyzR125bach[2];
2609  fCascadeCutVarsArray1->AddLast(varvec);
2610  }else{
2611  fCascadeTracks2->AddLast(lv);
2612  if(fAnalCuts->GetCuts()[2]>0. || fAnalCuts->GetCuts()[3]>0.){
2613  fAnalCuts->SetSftPosR125(cntrack,fBzkG,posVtx,xyzR125pr);
2614  fAnalCuts->SetSftPosR125(cptrack,fBzkG,posVtx,xyzR125pi);
2615  fAnalCuts->SetSftPosR125(cbtrack,fBzkG,posVtx,xyzR125bach);
2616  }
2617  TVector *varvec = new TVector(9);
2618  (*varvec)[0] = xyzR125pr[0];
2619  (*varvec)[1] = xyzR125pr[1];
2620  (*varvec)[2] = xyzR125pr[2];
2621  (*varvec)[3] = xyzR125pi[0];
2622  (*varvec)[4] = xyzR125pi[1];
2623  (*varvec)[5] = xyzR125pi[2];
2624  (*varvec)[6] = xyzR125bach[0];
2625  (*varvec)[7] = xyzR125bach[1];
2626  (*varvec)[8] = xyzR125bach[2];
2627  fCascadeCutVarsArray2->AddLast(varvec);
2628  }
2629  }
2630 
2631  if(!fWriteEachVariableTree) return;
2632 
2633  for(Int_t i=0;i<26;i++){
2634  fCandidateCascVariables[i] = -9999.;
2635  }
2636 
2638  fCandidateCascVariables[ 1] = casc->MassXi();
2639  fCandidateCascVariables[ 2] = momcasc_new[0];//casc->MomXiX();
2640  fCandidateCascVariables[ 3] = momcasc_new[1];//casc->MomXiY();
2641  fCandidateCascVariables[ 4] = momcasc_new[2];//casc->MomXiZ();
2642  if(casc->ChargeXi()<0)
2643  fCandidateCascVariables[ 5] = casc->MassLambda();
2644  else
2645  fCandidateCascVariables[ 5] = casc->MassAntiLambda();
2646 
2647  fCandidateCascVariables[ 6] = casc->DcaXiDaughters();
2648  fCandidateCascVariables[ 7] = casc->DcaV0Daughters();
2649  fCandidateCascVariables[ 8] = casc->DecayLengthXi(posVtx[0],posVtx[1],posVtx[2]);
2650  fCandidateCascVariables[ 9] = casc->CosPointingAngleXi(posVtx[0],posVtx[1],posVtx[2]);
2651  fCandidateCascVariables[10] = casc->DcaV0ToPrimVertex();
2652  fCandidateCascVariables[11] = casc->DcaPosToPrimVertex();
2653  fCandidateCascVariables[12] = casc->DcaNegToPrimVertex();
2654  fCandidateCascVariables[13] = casc->DcaBachToPrimVertex();
2655  fCandidateCascVariables[14] = casc->DecayLengthV0();
2656  fCandidateCascVariables[15] = casc->CosPointingAngle(casc->GetDecayVertexXi());
2657  fCandidateCascVariables[16] = casc->ChargeXi();
2658  fCandidateCascVariables[17] = xipdgcode;
2659  fCandidateCascVariables[18] = ximotherpdgcode;
2660  fCandidateCascVariables[19] = mcxipx;
2661  fCandidateCascVariables[20] = mcxipy;
2662  fCandidateCascVariables[21] = mcxipz;
2663  fCandidateCascVariables[22] = labcasc;
2667 
2668 
2669  fCascVariablesTree->Fill();
2670 }
2673 {
2674  //
2675  // Define electron tree variables
2676  //
2677 
2678  const char* nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
2679  fMCVariablesTree = new TTree(nameoutput,"MC variables tree");
2680  Int_t nVar = 16;
2681  fCandidateMCVariables = new Float_t [nVar];
2682  TString * fCandidateVariableNames = new TString[nVar];
2683 
2684  fCandidateVariableNames[ 0]="Centrality";
2685  fCandidateVariableNames[ 1]="DecayType";
2686  fCandidateVariableNames[ 2]="XicPx";
2687  fCandidateVariableNames[ 3]="XicPy";
2688  fCandidateVariableNames[ 4]="XicPz";
2689  fCandidateVariableNames[ 5]="ElePx";
2690  fCandidateVariableNames[ 6]="ElePy";
2691  fCandidateVariableNames[ 7]="ElePz";
2692  fCandidateVariableNames[ 8]="CascPx";
2693  fCandidateVariableNames[ 9]="CascPy";
2694  fCandidateVariableNames[10]="CascPz";
2695  fCandidateVariableNames[11]="PdgCode";
2696  fCandidateVariableNames[12]="ElePdgCode";
2697  fCandidateVariableNames[13]="CascPdgCode";
2698  fCandidateVariableNames[14]="RunNumber";
2699  fCandidateVariableNames[15]="EvNumber";
2700 
2701  for (Int_t ivar=0; ivar<nVar; ivar++) {
2702  fMCVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2703  }
2704  return;
2705 }
2707 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillMCROOTObjects(AliAODMCParticle *mcpart, AliAODMCParticle *mcepart, AliAODMCParticle *mccascpart, Int_t decaytype)
2708 {
2709  //
2710  // Fill histograms or tree depending on fWriteMCVariableTree
2711  //
2712  if(!mcpart) return;
2713  if(!mcepart) return;
2714  if(!mccascpart) return;
2715 
2716  for(Int_t i=0;i<14;i++){
2717  fCandidateMCVariables[i] = -9999.;
2718  }
2719 
2721  fCandidateMCVariables[ 1] = decaytype;
2722  fCandidateMCVariables[ 2] = mcpart->Px();
2723  fCandidateMCVariables[ 3] = mcpart->Py();
2724  fCandidateMCVariables[ 4] = mcpart->Pz();
2725  fCandidateMCVariables[ 5] = mcepart->Px();
2726  fCandidateMCVariables[ 6] = mcepart->Py();
2727  fCandidateMCVariables[ 7] = mcepart->Pz();
2728  fCandidateMCVariables[ 8] = mccascpart->Px();
2729  fCandidateMCVariables[ 9] = mccascpart->Py();
2730  fCandidateMCVariables[10] = mccascpart->Pz();
2731  fCandidateMCVariables[11] = mcpart->GetPdgCode();
2732  fCandidateMCVariables[12] = mcepart->GetPdgCode();
2733  fCandidateMCVariables[13] = mccascpart->GetPdgCode();
2736 
2737  Double_t epx = mcepart->Px();
2738  Double_t epy = mcepart->Py();
2739  Double_t epz = mcepart->Pz();
2740  Double_t eE = sqrt(epx*epx+epy*epy+epz*epz+0.000511*0.000511);
2741  Double_t cascpx = mccascpart->Px();
2742  Double_t cascpy = mccascpart->Py();
2743  Double_t cascpz = mccascpart->Pz();
2744  Double_t cascE = sqrt(cascpx*cascpx+cascpy*cascpy+cascpz*cascpz+1.32171*1.32171);
2745 
2746  Double_t InvMassEleXi = sqrt(pow(eE+cascE,2)-pow(epx+cascpx,2)-pow(epy+cascpy,2)-pow(epz+cascpz,2));
2747 
2748  Double_t cont[4];
2749  cont[0] = InvMassEleXi;
2750  cont[1] = mcpart->Pt();
2751  cont[2] = 0.0;
2752  cont[3] = fCentrality;
2753  Double_t cont2[3];
2754  cont2[0] = InvMassEleXi;
2755  cont2[1] = mcepart->Pt();
2756  cont2[2] = fCentrality;
2757  Double_t cont_eleptvseta[3];
2758  cont_eleptvseta[0] = mcepart->Pt();
2759  cont_eleptvseta[1] = mcepart->Eta();
2760  cont_eleptvseta[2] = fCentrality;
2761  Double_t cont_eleptvsxipt[3];
2762  cont_eleptvsxipt[0] = mcepart->Pt();
2763  cont_eleptvsxipt[1] = mccascpart->Pt();
2764  cont_eleptvsxipt[2] = fCentrality;
2765  Double_t cont_eleptvsxiptvsxicpt[4];
2766  cont_eleptvsxiptvsxicpt[0] = mcepart->Pt();
2767  cont_eleptvsxiptvsxicpt[1] = mccascpart->Pt();
2768  cont_eleptvsxiptvsxicpt[2] = mcpart->Pt();
2769  cont_eleptvsxiptvsxicpt[3] = fCentrality;
2770 
2771  Double_t contmc[3];
2772  contmc[0] = mcpart->Pt();
2773  contmc[1] = mcpart->Y();
2774  contmc[2] = fCentrality;
2775  Double_t contmcele[3];
2776  contmcele[0] = mcepart->Pt();
2777  contmcele[1] = mcepart->Eta();
2778  contmcele[2] = fCentrality;
2779 
2780 
2781  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
2782  Float_t etamin, etamax;
2783  esdcuts->GetEtaRange(etamin,etamax);
2784 
2785  if(decaytype==0){
2786  fHistoXicMCGen->Fill(contmc);
2787  if(mcpart->GetPdgCode()>0) fHistoXicMCGen1->Fill(contmc);//4132 is particle
2788  if(mcpart->GetPdgCode()<0) fHistoXicMCGen2->Fill(contmc);//-4132 is anti-particle
2789  fHistoXicElectronMCGen->Fill(contmcele);
2790  if(mcepart->GetPdgCode()<0) fHistoXicElectronMCGen1->Fill(contmcele);//-11 is positron
2791  if(mcepart->GetPdgCode()>0) fHistoXicElectronMCGen2->Fill(contmcele);//11 is electron
2792  fHistoEleXiMassMCGen->Fill(cont);
2793  if(fabs(mcepart->Eta())<etamax){
2794  fHistoEleXiMassvsElePtMCGen->Fill(cont2);
2795  if(mcepart->GetPdgCode()<0) fHistoEleXiMassvsElePtMCGen1->Fill(cont2);//-11 is positron
2796  if(mcepart->GetPdgCode()>0) fHistoEleXiMassvsElePtMCGen2->Fill(cont2);//11 is electron
2797  if(InvMassEleXi<2.5){
2798  fHistoElePtMCGen->Fill(mcepart->Pt(),fCentrality);
2799  fHistoElePtvsEtaMCGen->Fill(cont_eleptvseta);
2800  fHistoElePtvsXiPtMCGen->Fill(cont_eleptvsxipt);
2801  }
2802  }
2803  if(fabs(mcpart->Y())<0.7){
2804  if(InvMassEleXi<2.5){
2805  fHistoElePtvsXiPtMCXicGen->Fill(cont_eleptvsxipt);
2806  fHistoElePtvsXiPtvsXicPtMCGen->Fill(cont_eleptvsxiptvsxicpt);
2807  }
2808  }
2809  }else if(decaytype==10){
2810  fHistoXibMCGen->Fill(contmc);
2811  }
2812 
2814  fMCVariablesTree->Fill();
2815 }
2818 {
2819  //
2820  // Define mc gen electron tree variables
2821  //
2822 
2823  const char* nameoutput = GetOutputSlot(9)->GetContainer()->GetName();
2824  fMCEleVariablesTree = new TTree(nameoutput,"MC Ele variables tree");
2825  Int_t nVar = 8;
2826  fCandidateMCEleVariables = new Float_t [nVar];
2827  TString * fCandidateVariableNames = new TString[nVar];
2828 
2829  fCandidateVariableNames[ 0]="Centrality";
2830  fCandidateVariableNames[ 1]="ElePx";
2831  fCandidateVariableNames[ 2]="ElePy";
2832  fCandidateVariableNames[ 3]="ElePz";
2833  fCandidateVariableNames[ 4]="ElePdgCode";
2834  fCandidateVariableNames[ 5]="EleMotherPdgCode";
2835  fCandidateVariableNames[ 6]="RunNumber";
2836  fCandidateVariableNames[ 7]="EvNumber";
2837 
2838  for (Int_t ivar=0; ivar<nVar; ivar++) {
2839  fMCEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2840  }
2841  return;
2842 }
2844 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
2845 {
2846  //
2847  // Fill tree depending on fWriteMCVariableTree
2848  //
2849  if(!mcepart) return;
2850 
2851  Int_t pdgarray_ele[100], labelarray_ele[100], ngen_ele;
2852  GetMCDecayHistory(mcepart,mcArray,pdgarray_ele,labelarray_ele,ngen_ele);
2853  Bool_t ele_from_bottom = HaveBottomInHistory(pdgarray_ele);
2854  Bool_t ele_from_charm = HaveCharmInHistory(pdgarray_ele);
2855  Int_t semi_flag = FromSemileptonicDecays(pdgarray_ele);
2856 
2857  Double_t contmc[3];
2858  contmc[0] = mcepart->Pt();
2859  contmc[1] = mcepart->Eta();
2860  contmc[2] = fCentrality;
2861 
2862  if(semi_flag==1 && !ele_from_bottom){
2863  fHistoCharmElectronMCGen->Fill(contmc);
2864  }
2865  if(semi_flag==1 && ele_from_bottom){
2866  fHistoBottomElectronMCGen->Fill(contmc);
2867  }
2868  if(semi_flag==2 ){
2869  fHistoBottomElectronMCGen->Fill(contmc);
2870  }
2871 
2872 
2873  Bool_t hfe_flag = kFALSE;
2874  Int_t labemother = mcepart->GetMother();
2875  Int_t pdgmotherele = -9999;
2876  if(labemother>=0){
2877  AliAODMCParticle *motherele = (AliAODMCParticle*)mcArray->At(labemother);
2878  pdgmotherele = motherele->GetPdgCode();
2879  if(abs(pdgmotherele)>4000&&abs(pdgmotherele)<4400){
2880  hfe_flag = kTRUE;
2881  }
2882  }
2883  if(!hfe_flag) return;
2884 
2885  fHistoElectronMCGen->Fill(contmc);
2886 
2887  for(Int_t i=0;i<8;i++){
2888  fCandidateMCEleVariables[i] = -9999.;
2889  }
2890 
2892  fCandidateMCEleVariables[ 1] = mcepart->Px();
2893  fCandidateMCEleVariables[ 2] = mcepart->Py();
2894  fCandidateMCEleVariables[ 3] = mcepart->Pz();
2895  fCandidateMCEleVariables[ 4] = mcepart->GetPdgCode();
2896  fCandidateMCEleVariables[ 5] = pdgmotherele;
2899 
2900  // This function makes output too heavy (do not use if you have output size limitation)
2901  //if(fWriteMCVariableTree && fWriteEachVariableTree && mcepart->Pt()>0.4 && fabs(mcepart->Eta())<1.0)
2902  //fMCEleVariablesTree->Fill();
2903 }
2906 {
2907  //
2908  // Define Mc cascade tree variables
2909  //
2910 
2911  const char* nameoutput = GetOutputSlot(10)->GetContainer()->GetName();
2912  fMCCascVariablesTree = new TTree(nameoutput,"MC cascade variables tree");
2913  Int_t nVar = 8;
2914  fCandidateMCCascVariables = new Float_t [nVar];
2915  TString * fCandidateVariableNames = new TString[nVar];
2916 
2917  fCandidateVariableNames[ 0]="Centrality";
2918  fCandidateVariableNames[ 1]="CascPx";
2919  fCandidateVariableNames[ 2]="CascPy";
2920  fCandidateVariableNames[ 3]="CascPz";
2921  fCandidateVariableNames[ 4]="CascPdgCode";
2922  fCandidateVariableNames[ 5]="CascMotherPdgCode";
2923  fCandidateVariableNames[ 6]="RunNumber";
2924  fCandidateVariableNames[ 7]="EvNumber";
2925 
2926  for (Int_t ivar=0; ivar<nVar; ivar++) {
2927  fMCCascVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCCascVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2928  }
2929  return;
2930 }
2932 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillMCCascROOTObjects(AliAODMCParticle *mccascpart, TClonesArray *mcArray)
2933 {
2934  //
2935  // Fill histograms or tree depending on fWriteMCVariableTree
2936  //
2937  if(!mccascpart) return;
2938 
2939  for(Int_t i=0;i<8;i++){
2940  fCandidateMCCascVariables[i] = -9999.;
2941  }
2942 
2943  Bool_t hfxi_flag = kFALSE;
2944  Int_t labcascmother = mccascpart->GetMother();
2945  Int_t pdgmothercasc = -9999;
2946  if(labcascmother>=0){
2947  AliAODMCParticle *mothercasc = (AliAODMCParticle*)mcArray->At(labcascmother);
2948  if(mothercasc){
2949  pdgmothercasc = mothercasc->GetPdgCode();
2950  if(abs(pdgmothercasc)>4000&&abs(pdgmothercasc)<4400){
2951  hfxi_flag = kTRUE;
2952  }
2953  }
2954  }
2955  if(!hfxi_flag) return;
2956 
2957  Double_t contmc[3];
2958  contmc[0] = mccascpart->Pt();
2959  contmc[1] = mccascpart->Eta();
2960  contmc[2] = fCentrality;
2961  fHistoXiMCGen->Fill(contmc);
2962 
2964  fCandidateMCCascVariables[ 1] = mccascpart->Px();
2965  fCandidateMCCascVariables[ 2] = mccascpart->Py();
2966  fCandidateMCCascVariables[ 3] = mccascpart->Pz();
2967  fCandidateMCCascVariables[ 4] = mccascpart->GetPdgCode();
2968  fCandidateMCCascVariables[ 5] = pdgmothercasc;
2971 
2972  // This function makes output too heavy (do not use if you have output size limitation)
2973  //if(fWriteMCVariableTree && fWriteEachVariableTree && mccascpart->Pt()>0.4 && fabs(mccascpart->Eta())<1.0)
2974  //fMCCascVariablesTree->Fill();
2975 }
2976 
2979  //
2980  // This is to define general histograms
2981  //
2982 
2983  fCEvents = new TH1F("fCEvents","conter",18,-0.5,17.5);
2984  fCEvents->SetStats(kTRUE);
2985  fCEvents->GetXaxis()->SetBinLabel(1,"X1");
2986  fCEvents->GetXaxis()->SetBinLabel(2,"Analyzed events");
2987  fCEvents->GetXaxis()->SetBinLabel(3,"AliAODVertex exists");
2988  fCEvents->GetXaxis()->SetBinLabel(4,"TriggerOK");
2989  fCEvents->GetXaxis()->SetBinLabel(5,"IsEventSelected");
2990  fCEvents->GetXaxis()->SetBinLabel(6,"CascadesHF exists");
2991  fCEvents->GetXaxis()->SetBinLabel(7,"MCarray exists");
2992  fCEvents->GetXaxis()->SetBinLabel(8,"MCheader exists");
2993  fCEvents->GetXaxis()->SetBinLabel(9,"triggerClass!=CINT1");
2994  fCEvents->GetXaxis()->SetBinLabel(10,"triggerMask!=kAnyINT");
2995  fCEvents->GetXaxis()->SetBinLabel(11,"triggerMask!=kAny");
2996  fCEvents->GetXaxis()->SetBinLabel(12,"vtxTitle.Contains(Z)");
2997  fCEvents->GetXaxis()->SetBinLabel(13,"vtxTitle.Contains(3D)");
2998  fCEvents->GetXaxis()->SetBinLabel(14,"vtxTitle.Doesn'tContain(Z-3D)");
2999  fCEvents->GetXaxis()->SetBinLabel(15,Form("zVtx<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
3000  fCEvents->GetXaxis()->SetBinLabel(16,"!IsEventSelected");
3001  fCEvents->GetXaxis()->SetBinLabel(17,"triggerMask!=kAnyINT || triggerClass!=CINT1");
3002  fCEvents->GetXaxis()->SetBinLabel(18,Form("zVtxMC<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
3003  //fCEvents->GetXaxis()->SetTitle("");
3004  fCEvents->GetYaxis()->SetTitle("counts");
3005 
3006  fHTrigger = new TH1F("fHTrigger","counter",18,-0.5,17.5);
3007  fHTrigger->SetStats(kTRUE);
3008  fHTrigger->GetXaxis()->SetBinLabel(1,"X1");
3009  fHTrigger->GetXaxis()->SetBinLabel(2,"kMB");
3010  fHTrigger->GetXaxis()->SetBinLabel(3,"kSemiCentral");
3011  fHTrigger->GetXaxis()->SetBinLabel(4,"kCentral");
3012  fHTrigger->GetXaxis()->SetBinLabel(5,"kINT7");
3013  fHTrigger->GetXaxis()->SetBinLabel(6,"kEMC7");
3014  //fHTrigger->GetXaxis()->SetBinLabel(7,"Space");
3015  fHTrigger->GetXaxis()->SetBinLabel(8,"kMB|kSemiCentral|kCentral");
3016  fHTrigger->GetXaxis()->SetBinLabel(9,"kINT7|kEMC7");
3017  fHTrigger->GetXaxis()->SetBinLabel(11,"kMB&kSemiCentral");
3018  fHTrigger->GetXaxis()->SetBinLabel(12,"kMB&kCentral");
3019  fHTrigger->GetXaxis()->SetBinLabel(13,"kINT7&kEMC7");
3020 
3021  fHCentrality = new TH1F("fHCentrality","conter",100,0.,100.);
3022 
3023 
3024  fOutput->Add(fCEvents);
3025  fOutput->Add(fHTrigger);
3026  fOutput->Add(fHCentrality);
3027 
3028  return;
3029 }
3030 //__________________________________________________________________________
3032 {
3033  //
3034  // Define analyis histograms
3035  //
3036 
3037  //------------------------------------------------
3038  // Basic histogram
3039  //------------------------------------------------
3040  Int_t bins_base[4]= {22 ,100 , 100 ,10};
3041  Double_t xmin_base[4]={1.3,0 , -0.5 ,0.00};
3042  Double_t xmax_base[4]={5.7,20. , 0.5 ,100};
3043 
3044  fHistoEleXiMass = new THnSparseF("fHistoEleXiMass","",4,bins_base,xmin_base,xmax_base);
3046  fHistoEleXiMassRS = new THnSparseF("fHistoEleXiMassRS","",4,bins_base,xmin_base,xmax_base);
3048  fHistoEleXiMassWS = new THnSparseF("fHistoEleXiMassWS","",4,bins_base,xmin_base,xmax_base);
3050  fHistoEleXiMassRSMix = new THnSparseF("fHistoEleXiMassRSMix","",4,bins_base,xmin_base,xmax_base);
3052  fHistoEleXiMassWSMix = new THnSparseF("fHistoEleXiMassWSMix","",4,bins_base,xmin_base,xmax_base);
3054  fHistoEleXiMassRSSide = new THnSparseF("fHistoEleXiMassRSSide","",4,bins_base,xmin_base,xmax_base);
3056  fHistoEleXiMassWSSide = new THnSparseF("fHistoEleXiMassWSSide","",4,bins_base,xmin_base,xmax_base);
3058  fHistoEleXiMassRS1 = new THnSparseF("fHistoEleXiMassRS1","",4,bins_base,xmin_base,xmax_base);
3060  fHistoEleXiMassWS1 = new THnSparseF("fHistoEleXiMassWS1","",4,bins_base,xmin_base,xmax_base);
3062  fHistoEleXiMassRSMix1 = new THnSparseF("fHistoEleXiMassRSMix1","",4,bins_base,xmin_base,xmax_base);
3064  fHistoEleXiMassWSMix1 = new THnSparseF("fHistoEleXiMassWSMix1","",4,bins_base,xmin_base,xmax_base);
3066  fHistoEleXiMassRSSide1 = new THnSparseF("fHistoEleXiMassRSSide1","",4,bins_base,xmin_base,xmax_base);
3068  fHistoEleXiMassWSSide1 = new THnSparseF("fHistoEleXiMassWSSide1","",4,bins_base,xmin_base,xmax_base);
3070  fHistoEleXiMassRS2 = new THnSparseF("fHistoEleXiMassRS2","",4,bins_base,xmin_base,xmax_base);
3072  fHistoEleXiMassWS2 = new THnSparseF("fHistoEleXiMassWS2","",4,bins_base,xmin_base,xmax_base);
3074  fHistoEleXiMassRSMix2 = new THnSparseF("fHistoEleXiMassRSMix2","",4,bins_base,xmin_base,xmax_base);
3076  fHistoEleXiMassWSMix2 = new THnSparseF("fHistoEleXiMassWSMix2","",4,bins_base,xmin_base,xmax_base);
3078  fHistoEleXiMassRSSide2 = new THnSparseF("fHistoEleXiMassRSSide2","",4,bins_base,xmin_base,xmax_base);
3080  fHistoEleXiMassWSSide2 = new THnSparseF("fHistoEleXiMassWSSide2","",4,bins_base,xmin_base,xmax_base);
3082 
3083  fHistoEleXiMassRSAway = new THnSparseF("fHistoEleXiMassRSAway","",4,bins_base,xmin_base,xmax_base);
3085  fHistoEleXiMassWSAway = new THnSparseF("fHistoEleXiMassWSAway","",4,bins_base,xmin_base,xmax_base);
3087  fHistoEleXiMassRSMixAway = new THnSparseF("fHistoEleXiMassRSMixAway","",4,bins_base,xmin_base,xmax_base);
3089  fHistoEleXiMassWSMixAway = new THnSparseF("fHistoEleXiMassWSMixAway","",4,bins_base,xmin_base,xmax_base);
3091  fHistoEleXiMassRSSideAway = new THnSparseF("fHistoEleXiMassRSSideAway","",4,bins_base,xmin_base,xmax_base);
3093  fHistoEleXiMassWSSideAway = new THnSparseF("fHistoEleXiMassWSSideAway","",4,bins_base,xmin_base,xmax_base);
3095  fHistoEleXiMassRS1Away = new THnSparseF("fHistoEleXiMassRS1Away","",4,bins_base,xmin_base,xmax_base);
3097  fHistoEleXiMassWS1Away = new THnSparseF("fHistoEleXiMassWS1Away","",4,bins_base,xmin_base,xmax_base);
3099  fHistoEleXiMassRSMix1Away = new THnSparseF("fHistoEleXiMassRSMix1Away","",4,bins_base,xmin_base,xmax_base);
3101  fHistoEleXiMassWSMix1Away = new THnSparseF("fHistoEleXiMassWSMix1Away","",4,bins_base,xmin_base,xmax_base);
3103  fHistoEleXiMassRSSide1Away = new THnSparseF("fHistoEleXiMassRSSide1Away","",4,bins_base,xmin_base,xmax_base);
3105  fHistoEleXiMassWSSide1Away = new THnSparseF("fHistoEleXiMassWSSide1Away","",4,bins_base,xmin_base,xmax_base);
3107  fHistoEleXiMassRS2Away = new THnSparseF("fHistoEleXiMassRS2Away","",4,bins_base,xmin_base,xmax_base);
3109  fHistoEleXiMassWS2Away = new THnSparseF("fHistoEleXiMassWS2Away","",4,bins_base,xmin_base,xmax_base);
3111  fHistoEleXiMassRSMix2Away = new THnSparseF("fHistoEleXiMassRSMix2Away","",4,bins_base,xmin_base,xmax_base);
3113  fHistoEleXiMassWSMix2Away = new THnSparseF("fHistoEleXiMassWSMix2Away","",4,bins_base,xmin_base,xmax_base);
3115  fHistoEleXiMassRSSide2Away = new THnSparseF("fHistoEleXiMassRSSide2Away","",4,bins_base,xmin_base,xmax_base);
3117  fHistoEleXiMassWSSide2Away = new THnSparseF("fHistoEleXiMassWSSide2Away","",4,bins_base,xmin_base,xmax_base);
3119 
3120  Int_t bins_base_elept[3]= {10 ,100 ,10};
3121  Double_t xmin_base_elept[3]={1.3,0 ,0.00};
3122  Double_t xmax_base_elept[3]={3.3,10. ,100};
3123 
3124  fHistoEleXiMassvsElePtRS = new THnSparseF("fHistoEleXiMassvsElePtRS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3126  fHistoEleXiMassvsElePtWS = new THnSparseF("fHistoEleXiMassvsElePtWS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3128  fHistoEleXiMassvsElePtRSMix = new THnSparseF("fHistoEleXiMassvsElePtRSMix","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3130  fHistoEleXiMassvsElePtWSMix = new THnSparseF("fHistoEleXiMassvsElePtWSMix","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3132  fHistoEleXiMassvsElePtRSSide = new THnSparseF("fHistoEleXiMassvsElePtRSSide","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3134  fHistoEleXiMassvsElePtWSSide = new THnSparseF("fHistoEleXiMassvsElePtWSSide","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3136  fHistoEleXiMassvsElePtRS1 = new THnSparseF("fHistoEleXiMassvsElePtRS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3138  fHistoEleXiMassvsElePtWS1 = new THnSparseF("fHistoEleXiMassvsElePtWS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3140  fHistoEleXiMassvsElePtRSMix1 = new THnSparseF("fHistoEleXiMassvsElePtRSMix1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3142  fHistoEleXiMassvsElePtWSMix1 = new THnSparseF("fHistoEleXiMassvsElePtWSMix1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3144  fHistoEleXiMassvsElePtRSSide1 = new THnSparseF("fHistoEleXiMassvsElePtRSSide1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3146  fHistoEleXiMassvsElePtWSSide1 = new THnSparseF("fHistoEleXiMassvsElePtWSSide1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3148  fHistoEleXiMassvsElePtRS2 = new THnSparseF("fHistoEleXiMassvsElePtRS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3150  fHistoEleXiMassvsElePtWS2 = new THnSparseF("fHistoEleXiMassvsElePtWS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3152  fHistoEleXiMassvsElePtRSMix2 = new THnSparseF("fHistoEleXiMassvsElePtRSMix2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3154  fHistoEleXiMassvsElePtWSMix2 = new THnSparseF("fHistoEleXiMassvsElePtWSMix2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3156  fHistoEleXiMassvsElePtRSSide2 = new THnSparseF("fHistoEleXiMassvsElePtRSSide2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3158  fHistoEleXiMassvsElePtWSSide2 = new THnSparseF("fHistoEleXiMassvsElePtWSSide2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3160 
3161  fHistoElePtRS=new TH2F("fHistoElePtRS","Right-sign e pt",100,0.,10.,10,0.,100.);
3162  fOutputAll->Add(fHistoElePtRS);
3163  fHistoElePtWS=new TH2F("fHistoElePtWS","Wrong-sign e pt",100,0.,10.,10,0.,100.);
3164  fOutputAll->Add(fHistoElePtWS);
3165  fHistoElePtRSMix=new TH2F("fHistoElePtRSMix","Right-sign e pt",100,0.,10.,10,0.,100.);
3167  fHistoElePtWSMix=new TH2F("fHistoElePtWSMix","Wrong-sign e pt",100,0.,10.,10,0.,100.);
3169 
3170  fHistoEleXiMassMCS = new THnSparseF("fHistoEleXiMassMCS","",4,bins_base,xmin_base,xmax_base);
3172  fHistoEleXiMassMCS1 = new THnSparseF("fHistoEleXiMassMCS1","",4,bins_base,xmin_base,xmax_base);
3174  fHistoEleXiMassMCS2 = new THnSparseF("fHistoEleXiMassMCS2","",4,bins_base,xmin_base,xmax_base);
3176  fHistoEleXiMassXibMCS = new THnSparseF("fHistoEleXiMassXibMCS","",4,bins_base,xmin_base,xmax_base);
3178  fHistoEleXiMassXibMCS1 = new THnSparseF("fHistoEleXiMassXibMCS1","",4,bins_base,xmin_base,xmax_base);
3180  fHistoEleXiMassXibMCS2 = new THnSparseF("fHistoEleXiMassXibMCS2","",4,bins_base,xmin_base,xmax_base);
3182  fHistoEleXiMassPromptMCS = new THnSparseF("fHistoEleXiMassPromptMCS","",4,bins_base,xmin_base,xmax_base);
3184  fHistoEleXiMassPromptMCS1 = new THnSparseF("fHistoEleXiMassPromptMCS1","",4,bins_base,xmin_base,xmax_base);
3186  fHistoEleXiMassPromptMCS2 = new THnSparseF("fHistoEleXiMassPromptMCS2","",4,bins_base,xmin_base,xmax_base);
3188  fHistoEleXiMassBFeeddownMCS = new THnSparseF("fHistoEleXiMassBFeeddownMCS","",4,bins_base,xmin_base,xmax_base);
3190  fHistoEleXiMassBFeeddownMCS1 = new THnSparseF("fHistoEleXiMassBFeeddownMCS1","",4,bins_base,xmin_base,xmax_base);
3192  fHistoEleXiMassBFeeddownMCS2 = new THnSparseF("fHistoEleXiMassBFeeddownMCS2","",4,bins_base,xmin_base,xmax_base);
3194  fHistoEleXiMassMCGen = new THnSparseF("fHistoEleXiMassMCGen","",4,bins_base,xmin_base,xmax_base);
3196  fHistoEleXiMassvsElePtMCS = new THnSparseF("fHistoEleXiMassvsElePtMCS","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3198  fHistoEleXiMassvsElePtMCGen = new THnSparseF("fHistoEleXiMassvsElePtMCGen","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3200  fHistoEleXiMassvsElePtMCS1 = new THnSparseF("fHistoEleXiMassvsElePtMCS1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3202  fHistoEleXiMassvsElePtMCGen1 = new THnSparseF("fHistoEleXiMassvsElePtMCGen1","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3204  fHistoEleXiMassvsElePtMCS2 = new THnSparseF("fHistoEleXiMassvsElePtMCS2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3206  fHistoEleXiMassvsElePtMCGen2 = new THnSparseF("fHistoEleXiMassvsElePtMCGen2","",3,bins_base_elept,xmin_base_elept,xmax_base_elept);
3208  fHistoElePtMCS=new TH2F("fHistoElePtMCS","MC S e pt",100,0.,10.,10,0.,100.);
3209  fOutputAll->Add(fHistoElePtMCS);
3210  fHistoElePtMCGen=new TH2F("fHistoElePtMCGen","MC Gen e pt",100,0.,10.,10,0.,100.);
3212 
3213  Int_t bins_eleptvseta[3]= {50,20 ,10};
3214  Double_t xmin_eleptvseta[3]={0.,-1. ,0.0};
3215  Double_t xmax_eleptvseta[3]={5.,1. ,100};
3216 
3217  fHistoElePtvsEtaRS = new THnSparseF("fHistoElePtvsEtaRS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3219  fHistoElePtvsEtaWS = new THnSparseF("fHistoElePtvsEtaWS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3221  fHistoElePtvsEtaRSMix = new THnSparseF("fHistoElePtvsEtaRSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3223  fHistoElePtvsEtaWSMix = new THnSparseF("fHistoElePtvsEtaWSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3225  fHistoElePtvsEtaMCS = new THnSparseF("fHistoElePtvsEtaMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3227  fHistoElePtvsEtaMCGen = new THnSparseF("fHistoElePtvsEtaMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
3229 
3230  Int_t bins_eleptvsxipt[3]= {50,20 ,10};
3231  Double_t xmin_eleptvsxipt[3]={0.,0. ,0.0};
3232  Double_t xmax_eleptvsxipt[3]={5.,5. ,100};
3233 
3234  fHistoElePtvsXiPtRS = new THnSparseF("fHistoElePtvsXiPtRS","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
3236  fHistoElePtvsXiPtWS = new THnSparseF("fHistoElePtvsXiPtWS","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
3238  fHistoElePtvsXiPtRSMix = new THnSparseF("fHistoElePtvsXiPtRSMix","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
3240  fHistoElePtvsXiPtWSMix = new THnSparseF("fHistoElePtvsXiPtWSMix","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
3242  fHistoElePtvsXiPtMCS = new THnSparseF("fHistoElePtvsXiPtMCS","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
3244  fHistoElePtvsXiPtMCGen = new THnSparseF("fHistoElePtvsXiPtMCGen","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
3246  fHistoElePtvsXiPtMCXicGen = new THnSparseF("fHistoElePtvsXiPtMCXicGen","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
3248 
3249  Int_t bins_eleptvsxiptvsxicpt[4]= {50,20,10,10};
3250  Double_t xmin_eleptvsxiptvsxicpt[4]={0.,0.,0.,0.0};
3251  Double_t xmax_eleptvsxiptvsxicpt[4]={5.,5.,10.,100};
3252  fHistoElePtvsXiPtvsXicPtMCS = new THnSparseF("fHistoElePtvsXiPtvsXicPtMCS","",4,bins_eleptvsxiptvsxicpt,xmin_eleptvsxiptvsxicpt,xmax_eleptvsxiptvsxicpt);
3254  fHistoElePtvsXiPtvsXicPtMCGen = new THnSparseF("fHistoElePtvsXiPtvsXicPtMCGen","",4,bins_eleptvsxiptvsxicpt,xmin_eleptvsxiptvsxicpt,xmax_eleptvsxiptvsxicpt);
3256 
3257  Int_t bins_eleptvsd0[3]= {50 ,50 ,10};
3258  Double_t xmin_eleptvsd0[3]={0.,-0.2 ,0.0};
3259  Double_t xmax_eleptvsd0[3]={5.,0.2 ,100};
3260 
3261  fHistoElePtvsd0RS = new THnSparseF("fHistoElePtvsd0RS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3263  fHistoElePtvsd0WS = new THnSparseF("fHistoElePtvsd0WS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3265  fHistoElePtvsd0RSMix = new THnSparseF("fHistoElePtvsd0RSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3267  fHistoElePtvsd0WSMix = new THnSparseF("fHistoElePtvsd0WSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3269  fHistoElePtvsd0MCS = new THnSparseF("fHistoElePtvsd0MCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3271  fHistoElePtvsd0PromptMCS = new THnSparseF("fHistoElePtvsd0PromptMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3273  fHistoElePtvsd0BFeeddownMCS = new THnSparseF("fHistoElePtvsd0BFeeddownMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
3275 
3276  //------------------------------------------------
3277  // checking histograms
3278  //------------------------------------------------
3279  fHistoBachPt = new TH1F("fHistoBachPt","Bachelor p_{T}",100,0.0,5.0);
3280  fOutputAll->Add(fHistoBachPt);
3281  fHistoBachPtMCS = new TH1F("fHistoBachPtMCS","Bachelor p_{T}",100,0.0,5.0);
3283  fHistoBachPtMCGen = new TH1F("fHistoBachPtMCGen","Bachelor p_{T}",100,0.0,5.0);
3285  fHistod0Bach = new TH1F("fHistod0Bach","Bachelor d_{0}",100,-0.5,0.5);
3286  fOutputAll->Add(fHistod0Bach);
3287  fHistoXiMassvsPt=new TH2F("fHistoXiMassvsPt","Xi mass",100,1.32-0.05,1.32+0.05,20,0.,10.);
3289  fHistoXiMassvsPtMCS=new TH2F("fHistoXiMassvsPtMCS","Xi mass",100,1.32-0.05,1.32+0.05,20,0.,10.);
3291  fHistoXiMassvsPtMCGen=new TH2F("fHistoXiMassvsPtMCGen","Xi mass",100,1.32-0.05,1.32+0.05,20,0.,10.);
3293  fHistoOmegaMassvsPt=new TH2F("fHistoOmegaMassvsPt","Omega mass",100,1.67-0.05,1.67+0.05,20,0.,10.);
3295 
3296  fHistoElectronTPCPID=new TH2F("fHistoElectronTPCPID","",50,0.,5.,50,-20.,20.);
3298  fHistoElectronTOFPID=new TH2F("fHistoElectronTOFPID","",50,0.,5.,50,-20.,20.);
3300  fHistoElectronTPCSelPID=new TH2F("fHistoElectronTPCSelPID","",50,0.,5.,50,-20.,20.);
3302  fHistoElectronTOFSelPID=new TH2F("fHistoElectronTOFSelPID","",50,0.,5.,50,-20.,20.);
3304  fHistoElectronTPCPIDSelTOF=new TH2F("fHistoElectronTPCPIDSelTOF","",10,0.,5.,500,-10.,10.);
3306  fHistoElectronTOFPIDSelTPC=new TH2F("fHistoElectronTOFPIDSelTPC","",10,0.,5.,500,-10.,10.);
3308  fHistoElectronTPCPIDSelTOFSmallEta=new TH2F("fHistoElectronTPCPIDSelTOFSmallEta","",10,0.,5.,500,-10.,10.);
3310  fHistoElectronTPCPIDSelTOFLargeEta=new TH2F("fHistoElectronTPCPIDSelTOFLargeEta","",10,0.,5.,500,-10.,10.);
3312  fHistoMassConversionsMin=new TH1F("fHistoMassConversionsMin","",500,0,0.5);
3314  fHistoMassConversionsSameSignMin=new TH1F("fHistoMassConversionsSameSignMin","",500,0,0.5);
3316 
3317  for(Int_t i=0;i<8;i++){
3318  fHistoElectronTPCPIDSelTOFEtaDep[i]=new TH2F(Form("fHistoElectronTPCPIDSelTOFEtaDep[%d]",i),"",10,0.,5.,500,-10.,10.);
3320  }
3321 
3322  fHistoElectronQovPtvsPhi=new TH2F("fHistoElectronQovPtvsPhi","",70,0.,7.,50,-2.,2.);
3324  fHistoXiQovPtvsPhi=new TH2F("fHistoXiQovPtvsPhi","",70,0.,7.,50,-2.,2.);
3326 
3327  Int_t bins_xicmcgen[3]= {100 ,20 ,10};
3328  Double_t xmin_xicmcgen[3]={0.,-1.0 ,0.0};
3329  Double_t xmax_xicmcgen[3]={20.,1.0 ,100};
3330  fHistoXicMCGen = new THnSparseF("fHistoXicMCGen","",3,bins_xicmcgen,xmin_xicmcgen,xmax_xicmcgen);
3331  fOutputAll->Add(fHistoXicMCGen);
3332  fHistoXicMCGen1 = new THnSparseF("fHistoXicMCGen1","",3,bins_xicmcgen,xmin_xicmcgen,xmax_xicmcgen);
3334  fHistoXicMCGen2 = new THnSparseF("fHistoXicMCGen2","",3,bins_xicmcgen,xmin_xicmcgen,xmax_xicmcgen);
3336  fHistoXicMCS = new THnSparseF("fHistoXicMCS","",3,bins_xicmcgen,xmin_xicmcgen,xmax_xicmcgen);
3337  fOutputAll->Add(fHistoXicMCS);
3338  fHistoXicMCS1 = new THnSparseF("fHistoXicMCS1","",3,bins_xicmcgen,xmin_xicmcgen,xmax_xicmcgen);
3339  fOutputAll->Add(fHistoXicMCS1);
3340  fHistoXicMCS2 = new THnSparseF("fHistoXicMCS2","",3,bins_xicmcgen,xmin_xicmcgen,xmax_xicmcgen);
3341  fOutputAll->Add(fHistoXicMCS2);
3342 
3343  Int_t bins_xibmcgen[3]= {100 ,20 ,10};
3344  Double_t xmin_xibmcgen[3]={0.,-1.0 ,0.0};
3345  Double_t xmax_xibmcgen[3]={50.,1.0 ,100};
3346  fHistoXibMCGen = new THnSparseF("fHistoXibMCGen","",3,bins_xibmcgen,xmin_xibmcgen,xmax_xibmcgen);
3347  fOutputAll->Add(fHistoXibMCGen);
3348  fHistoXibMCS = new THnSparseF("fHistoXibMCS","",3,bins_xibmcgen,xmin_xibmcgen,xmax_xibmcgen);
3349  fOutputAll->Add(fHistoXibMCS);
3350 
3351  Int_t bins_xibmcgen_withxic[3]= {50 ,100 ,100};
3352  Double_t xmin_xibmcgen_withxic[3]={0.,-5.,-5.};
3353  Double_t xmax_xibmcgen_withxic[3]={50.,5.,5.};
3354  fHistoXibMCGenWithXic = new THnSparseF("fHistoXibMCGenWithXic","",3,bins_xibmcgen_withxic,xmin_xibmcgen_withxic,xmax_xibmcgen_withxic);
3356 
3357  Int_t bins_elemcgen[3]= {100 ,20 ,10};
3358  Double_t xmin_elemcgen[3]={0.,-1.0 ,0.0};
3359  Double_t xmax_elemcgen[3]={10.,1.0 ,100};
3360  fHistoElectronMCGen = new THnSparseF("fHistoElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3362  fHistoBottomElectronMCGen = new THnSparseF("fHistoBottomElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3364  fHistoCharmElectronMCGen = new THnSparseF("fHistoCharmElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3366  fHistoXicElectronMCGen = new THnSparseF("fHistoXicElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3368  fHistoXicElectronMCGen1 = new THnSparseF("fHistoXicElectronMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3370  fHistoXicElectronMCGen2 = new THnSparseF("fHistoXicElectronMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3372  fHistoXicElectronMCS = new THnSparseF("fHistoXicElectronMCS","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3374  fHistoXicElectronMCS1 = new THnSparseF("fHistoXicElectronMCS1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3376  fHistoXicElectronMCS2 = new THnSparseF("fHistoXicElectronMCS2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
3378 
3379  Int_t bins_ximcgen[3]= {50 ,20 ,10};
3380  Double_t xmin_ximcgen[3]={0.,-1.0 ,0.0};
3381  Double_t xmax_ximcgen[3]={10.,1.0 ,100};
3382  fHistoXiMCGen = new THnSparseF("fHistoXiMCGen","",3,bins_ximcgen,xmin_ximcgen,xmax_ximcgen);
3383  fOutputAll->Add(fHistoXiMCGen);
3384 
3385  fHistoLambdaPtvsDl=new TH2F("fHistoLambdaPtvsDl","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3387  fHistoLambdaPtvsDlSide=new TH2F("fHistoLambdaPtvsDlSide","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3389  fHistoLambdaPtvsDlMCS=new TH2F("fHistoLambdaPtvsDlMCS","Lambda pt vs dl",20,0.,10.,20,0.,40.);
3391  fHistoLambdaPtvsDR=new TH2F("fHistoLambdaPtvsDR","Lambda pt vs dl",20,0.,10.,80,0.,160.);
3393  fHistoLambdaPtvsDRSide=new TH2F("fHistoLambdaPtvsDRSide","Lambda pt vs dl",20,0.,10.,80,0.,160.);
3395  fHistoLambdaPtvsDRMCS=new TH2F("fHistoLambdaPtvsDRMCS","Lambda pt vs dl",20,0.,10.,80,0.,160.);
3397 
3398  fHistoEleXiPtvsRapidityRS=new TH2F("fHistoEleXiPtvsRapidityRS","EleXi pt vs rap",20,0.,20.,40,-2.,2.);
3400  fHistoEleXiPtvsRapidityWS=new TH2F("fHistoEleXiPtvsRapidityWS","EleXi pt vs rap",20,0.,20.,40,-2.,2.);
3402  fHistoEleXiPtvsRapidityMCS=new TH2F("fHistoEleXiPtvsRapidityMCS","EleXi pt vs rap",20,0.,20.,40,-2.,2.);
3404 
3405  fHistoResponseElePt = new TH2D("fHistoResponseElePt","",100,0.,20.,100,0.,10.);
3407  fHistoResponseXiPt = new TH2D("fHistoResponseXiPt","",100,0.,20.,100,0.,20.);
3409  fHistoResponseEleXiPt = new TH2D("fHistoResponseEleXiPt","",100,0.,20.,100,0.,20.);
3411  fHistoResponseXiPtvsEleXiPt = new TH2D("fHistoResponseXiPtvsEleXiPt","",100,0.,20.,100,0.,20.);
3413  fHistoResponseXiPtXib = new TH2D("fHistoResponseXiPtXib","",100,0.,50.,100,0.,20.);
3415  fHistoResponseEleXiPtXib = new TH2D("fHistoResponseEleXiPtXib","",100,0.,50.,100,0.,20.);
3417  fHistoResponseMcGenXibPtvsXicPt = new TH2D("fHistoResponseMcGenXibPtvsXicPt","",100,0.,50.,100,0.,20.);
3419 
3420 
3421  fHistonEvtvsRunNumber=new TH1F("fHistonEvtvsRunNumber","",20000,-0.5,19999.5);
3423  fHistonElevsRunNumber=new TH1F("fHistonElevsRunNumber","",20000,-0.5,19999.5);
3425  fHistonXivsRunNumber=new TH1F("fHistonXivsRunNumber","",20000,-0.5,19999.5);
3427  fHistoMCEventType=new TH1F("fHistoMCEventType","",4,-0.5,3.5);
3429  fHistoMCXic0Decays=new TH1F("fHistoMCXic0Decays","",4,0.5,4.5);
3431  fHistoMCDeltaPhiccbar=new TH1F("fHistoMCDeltaPhiccbar","",100,0.,3.2);
3433  fHistoMCNccbar=new TH1F("fHistoMCNccbar","",100,-0.5,99.5);
3434  fOutputAll->Add(fHistoMCNccbar);
3435 
3436  fHistodPhiSdEtaSElectronProtonR125RS = new TH2D("fHistodPhiSdEtaSElectronProtonR125RS","",50,0.,0.2,50,0.,0.2);
3438  fHistodPhiSdEtaSElectronProtonR125WS = new TH2D("fHistodPhiSdEtaSElectronProtonR125WS","",50,0.,0.2,50,0.,0.2);
3440  fHistodPhiSdEtaSElectronProtonR125RSMix = new TH2D("fHistodPhiSdEtaSElectronProtonR125RSMix","",50,0.,0.2,50,0.,0.2);
3442  fHistodPhiSdEtaSElectronProtonR125WSMix = new TH2D("fHistodPhiSdEtaSElectronProtonR125WSMix","",50,0.,0.2,50,0.,0.2);
3444  fHistodPhiSdEtaSElectronPionR125RS = new TH2D("fHistodPhiSdEtaSElectronPionR125RS","",50,0.,0.2,50,0.,0.2);
3446  fHistodPhiSdEtaSElectronPionR125WS = new TH2D("fHistodPhiSdEtaSElectronPionR125WS","",50,0.,0.2,50,0.,0.2);
3448  fHistodPhiSdEtaSElectronPionR125RSMix = new TH2D("fHistodPhiSdEtaSElectronPionR125RSMix","",50,0.,0.2,50,0.,0.2);
3450  fHistodPhiSdEtaSElectronPionR125WSMix = new TH2D("fHistodPhiSdEtaSElectronPionR125WSMix","",50,0.,0.2,50,0.,0.2);
3452  fHistodPhiSdEtaSElectronBachelorR125RS = new TH2D("fHistodPhiSdEtaSElectronBachelorR125RS","",50,0.,0.2,50,0.,0.2);
3454  fHistodPhiSdEtaSElectronBachelorR125WS = new TH2D("fHistodPhiSdEtaSElectronBachelorR125WS","",50,0.,0.2,50,0.,0.2);
3456  fHistodPhiSdEtaSElectronBachelorR125RSMix = new TH2D("fHistodPhiSdEtaSElectronBachelorR125RSMix","",50,0.,0.2,50,0.,0.2);
3458  fHistodPhiSdEtaSElectronBachelorR125WSMix = new TH2D("fHistodPhiSdEtaSElectronBachelorR125WSMix","",50,0.,0.2,50,0.,0.2);
3460 
3461  for(Int_t ih=0;ih<23;ih++){
3462  Int_t bins_eleptvscutvars[3];
3463  Double_t xmin_eleptvscutvars[3];
3464  Double_t xmax_eleptvscutvars[3];
3465 
3466  bins_eleptvscutvars[0] = 20;//electron pT bin
3467  xmin_eleptvscutvars[0] = 0.;
3468  xmax_eleptvscutvars[0] = 20.;
3469  bins_eleptvscutvars[2] = 10;//centrality bin
3470  xmin_eleptvscutvars[2] = 0.;
3471  xmax_eleptvscutvars[2] = 100.;
3472 
3473  if(ih==0 || ih==1){
3474  //0: TPC Ncluster 1: TPC ncluster PID
3475  bins_eleptvscutvars[1] = 40;
3476  xmin_eleptvscutvars[1] = 0.;
3477  xmax_eleptvscutvars[1] = 160.;
3478  }else if(ih==2 || ih==3){
3479  //2: nSigma(TPC,e) 3: nSigma(TOF,e)
3480  bins_eleptvscutvars[1] = 20;
3481  xmin_eleptvscutvars[1] = -5.;
3482  xmax_eleptvscutvars[1] = 5.;
3483  }else if(ih==4){
3484  //4: eta
3485  bins_eleptvscutvars[1] = 30;
3486  xmin_eleptvscutvars[1] = -1.5;
3487  xmax_eleptvscutvars[1] = 1.5;
3488  }else if(ih==5){
3489  //5: nITS cluster
3490  bins_eleptvscutvars[1] = 7;
3491  xmin_eleptvscutvars[1] = -0.5;
3492  xmax_eleptvscutvars[1] = 6.5;
3493  }else if(ih==6){
3494  //6: Lambda mass
3495  bins_eleptvscutvars[1] = 50;
3496  xmin_eleptvscutvars[1] = 1.1156-0.03;
3497  xmax_eleptvscutvars[1] = 1.1156+0.03;
3498  }else if(ih==7){
3499  //7: Xi mass
3500  bins_eleptvscutvars[1] = 50;
3501  xmin_eleptvscutvars[1] = 1.32-0.03;
3502  xmax_eleptvscutvars[1] = 1.32+0.03;
3503  }else if(ih==8 || ih==9){
3504  //8: Rfid Lambda, 9: Rfid Xi
3505  bins_eleptvscutvars[1] = 20;
3506  xmin_eleptvscutvars[1] = 0.;
3507  xmax_eleptvscutvars[1] = 5.;
3508  }else if(ih==10 || ih==11){
3509  //11: DCA Xi, 10: Dca V0
3510  bins_eleptvscutvars[1] = 20;
3511  xmin_eleptvscutvars[1] = 0.;
3512  xmax_eleptvscutvars[1] = 2.;
3513  }else if(ih==12 || ih==13 || ih==14){
3514  //12: DCA Bachto prim, 13: DCA V0pr to prim 14: DCA V0pi to prim
3515  bins_eleptvscutvars[1] = 20;
3516  xmin_eleptvscutvars[1] = 0.;
3517  xmax_eleptvscutvars[1] = 0.5;
3518  }else if(ih==15 || ih==16){
3519  //16: CosPAXi, 15: CosPAv0
3520  bins_eleptvscutvars[1] = 20;
3521  xmin_eleptvscutvars[1] = 0.95;
3522  xmax_eleptvscutvars[1] = 1.0;
3523  }else if(ih==17 || ih==18 || ih==19){
3524  //17: nSigma(TPC, bach) 18: nSigma(TPC, v0pr), 19: nSigma(TPC,v0pi)
3525  bins_eleptvscutvars[1] = 20;
3526  xmin_eleptvscutvars[1] = -5.;
3527  xmax_eleptvscutvars[1] = 5.;
3528  }else if(ih==20 || ih==21){
3529  //20: V0 eta 21: Xi eta
3530  bins_eleptvscutvars[1] = 30;
3531  xmin_eleptvscutvars[1] = -1.5;
3532  xmax_eleptvscutvars[1] = 1.5;
3533  }else if(ih==22){
3534  //20: Opening angle
3535  bins_eleptvscutvars[1] = 20;
3536  xmin_eleptvscutvars[1] = 0.;
3537  xmax_eleptvscutvars[1] = 3.141592/2;
3538  }
3539 
3540  fHistoElePtvsCutVarsRS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsRS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
3542  fHistoElePtvsCutVarsWS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsWS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
3544  fHistoElePtvsCutVarsMCS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsMCS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
3546  }
3547 
3548  Int_t bins_eletag[3]= {20 ,40 ,10};
3549  Double_t xmin_eletag[3]={0.,0. ,0.0};
3550  Double_t xmax_eletag[3]={10.,20 ,100};
3551  fHistoElectronPi0Total = new THnSparseF("fHistoElectronPi0Total","",3,bins_eletag,xmin_eletag,xmax_eletag);
3553  fHistoElectronPi0Tag = new THnSparseF("fHistoElectronPi0Tag","",3,bins_eletag,xmin_eletag,xmax_eletag);
3555  fHistoElectronEtaTotal = new THnSparseF("fHistoElectronEtaTotal","",3,bins_eletag,xmin_eletag,xmax_eletag);
3557  fHistoElectronEtaTag = new THnSparseF("fHistoElectronEtaTag","",3,bins_eletag,xmin_eletag,xmax_eletag);
3559 
3560  fHistoPi0MCGen = new TH1F("fHistoPi0MCGen","",100,0.,20.);
3561  fOutputAll->Add(fHistoPi0MCGen);
3562  fHistoEtaMCGen = new TH1F("fHistoEtaMCGen","",100,0.,20.);
3563  fOutputAll->Add(fHistoEtaMCGen);
3564 
3565  return;
3566 }
3567 
3568 //________________________________________________________________________
3569 AliAODRecoCascadeHF* AliAnalysisTaskSEXic2eleXifromAODtracks::MakeCascadeHF(AliAODcascade *casc, AliAODTrack *part, AliAODTrack *partpid, AliAODEvent * aod, AliAODVertex *secVert)
3570 {
3571  //
3572  // Create AliAODRecoCascadeHF object from the argument
3573  //
3574 
3575  if(!casc) return 0x0;
3576  if(!part) return 0x0;
3577  if(!aod) return 0x0;
3578 
3579  //------------------------------------------------
3580  // PrimaryVertex
3581  //------------------------------------------------
3582  AliAODVertex *primVertexAOD;
3583  Bool_t unsetvtx = kFALSE;
3585  primVertexAOD = CallPrimaryVertex(casc,part,aod);
3586  if(!primVertexAOD){
3587  primVertexAOD = fVtx1;
3588  }else{
3589  unsetvtx = kTRUE;
3590  }
3591  }else{
3592  primVertexAOD = fVtx1;
3593  }
3594  if(!primVertexAOD) return 0x0;
3595  Double_t posprim[3]; primVertexAOD->GetXYZ(posprim);
3596 
3597  //------------------------------------------------
3598  // DCA between tracks
3599  //------------------------------------------------
3600  AliESDtrack *esdtrack = new AliESDtrack((AliVTrack*)partpid);
3601 
3602  Double_t xyz[3], pxpypz[3], cv[21]; Short_t sign;
3603  xyz[0]=casc->DecayVertexXiX();
3604  xyz[1]=casc->DecayVertexXiY();
3605  xyz[2]=casc->DecayVertexXiZ();
3606  pxpypz[0]=casc->MomXiX();
3607  pxpypz[1]=casc->MomXiY();
3608  pxpypz[2]=casc->MomXiZ();
3609  casc->GetCovarianceXYZPxPyPz(cv);
3610  sign=casc->ChargeXi();
3611  AliExternalTrackParam *trackCasc = new AliExternalTrackParam(xyz,pxpypz,cv,sign);
3612 
3613  Double_t xdummy, ydummy;
3614  Double_t dca = esdtrack->GetDCA(trackCasc,fBzkG,xdummy,ydummy);
3615 
3616 
3617  //------------------------------------------------
3618  // Propagate all tracks to the secondary vertex and calculate momentum there
3619  //------------------------------------------------
3620 
3621  Double_t d0z0bach[2],covd0z0bach[3];
3622  if(sqrt(pow(secVert->GetX(),2)+pow(secVert->GetY(),2))<1.){
3623  part->PropagateToDCA(secVert,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
3624  trackCasc->PropagateToDCA(secVert,fBzkG,kVeryBig);
3625  }else{
3626  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
3627  trackCasc->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig);
3628  }
3629  Double_t momcasc_new[3]={-9999,-9999,-9999.};
3630  trackCasc->GetPxPyPz(momcasc_new);
3631 
3632  Double_t px[2],py[2],pz[2];
3633  px[0] = part->Px(); py[0] = part->Py(); pz[0] = part->Pz();
3634  px[1] = momcasc_new[0]; py[1] = momcasc_new[1]; pz[1] = momcasc_new[2];
3635 
3636  //------------------------------------------------
3637  // d0
3638  //------------------------------------------------
3639  Double_t d0[3],d0err[3];
3640 
3641  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
3642  d0[0]= d0z0bach[0];
3643  d0err[0] = TMath::Sqrt(covd0z0bach[0]);
3644 
3645  Double_t d0z0casc[2],covd0z0casc[3];
3646  trackCasc->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0casc,covd0z0casc);
3647  d0[1]= d0z0casc[0];
3648  d0err[1] = TMath::Sqrt(covd0z0casc[0]);
3649 
3650  //------------------------------------------------
3651  // Create AliAODRecoCascadeHF
3652  //------------------------------------------------
3653  Short_t charge = part->Charge();
3654  AliAODRecoCascadeHF *theCascade = new AliAODRecoCascadeHF(secVert,charge,px,py,pz,d0,d0err,dca);
3655  if(!theCascade)
3656  {
3657  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
3658  if(esdtrack) delete esdtrack;
3659  if(trackCasc) delete trackCasc;
3660  return 0x0;
3661  }
3662  theCascade->SetOwnPrimaryVtx(primVertexAOD);
3663  UShort_t id[2]={(UShort_t)part->GetID(),(UShort_t)trackCasc->GetID()};
3664  theCascade->SetProngIDs(2,id);
3665 
3666  theCascade->GetSecondaryVtx()->AddDaughter(part);
3667  theCascade->GetSecondaryVtx()->AddDaughter(casc);
3668  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
3669  if(esdtrack) delete esdtrack;
3670  if(trackCasc) delete trackCasc;
3671 
3672  return theCascade;
3673 }
3674 
3675 //________________________________________________________________________
3676 AliAODVertex* AliAnalysisTaskSEXic2eleXifromAODtracks::CallPrimaryVertex(AliAODcascade *casc, AliAODTrack *trk, AliAODEvent* aod)
3677 {
3678  //
3679  // Make an array of tracks which should not be used in primary vertex calculation and
3680  // Call PrimaryVertex function
3681  //
3682 
3683  TObjArray *TrackArray = new TObjArray(3);
3684 
3685  AliESDtrack *cptrk1 = new AliESDtrack((AliVTrack*)trk);
3686  TrackArray->AddAt(cptrk1,0);
3687 
3688  AliESDtrack *cascptrack = new AliESDtrack((AliVTrack*)casc->GetDaughter(0));
3689  TrackArray->AddAt(cascptrack,1);
3690  AliESDtrack *cascntrack = new AliESDtrack((AliVTrack*)casc->GetDaughter(1));
3691  TrackArray->AddAt(cascntrack,2);
3692  AliESDtrack *cascbtrack = new AliESDtrack((AliVTrack*)casc->GetDecayVertexXi()->GetDaughter(0));
3693  TrackArray->AddAt(cascbtrack,3);
3694 
3695  AliAODVertex *newvert = PrimaryVertex(TrackArray,aod);
3696 
3697  for(Int_t i=0;i<4;i++)
3698  {
3699  AliESDtrack *tesd = (AliESDtrack*)TrackArray->UncheckedAt(i);
3700  delete tesd;
3701  }
3702  TrackArray->Clear();
3703  delete TrackArray;
3704 
3705  return newvert;
3706 }
3707 
3708 //________________________________________________________________________
3709 AliAODVertex* AliAnalysisTaskSEXic2eleXifromAODtracks::PrimaryVertex(const TObjArray *trkArray,
3710  AliVEvent *event)
3711 {
3712  //
3713  //Used only for pp
3714  //copied from AliAnalysisVertexingHF (except for the following 3 lines)
3715  //
3716 
3717  Bool_t fRecoPrimVtxSkippingTrks = kTRUE;
3718  Bool_t fRmTrksFromPrimVtx = kFALSE;
3719 
3720  AliESDVertex *vertexESD = 0;
3721  AliAODVertex *vertexAOD = 0;
3722 
3723  //vertexESD = new AliESDVertex(*fV1);
3724 
3725 
3726  if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) {
3727  // primary vertex from the input event
3728 
3729  vertexESD = new AliESDVertex(*fV1);
3730 
3731  } else {
3732  // primary vertex specific to this candidate
3733 
3734  Int_t nTrks = trkArray->GetEntriesFast();
3735  AliVertexerTracks *vertexer = new AliVertexerTracks(event->GetMagneticField());
3736 
3737  if(fRecoPrimVtxSkippingTrks) {
3738  // recalculating the vertex
3739 
3740  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraint")) {
3741  Float_t diamondcovxy[3];
3742  event->GetDiamondCovXY(diamondcovxy);
3743  Double_t pos[3]={event->GetDiamondX(),event->GetDiamondY(),0.};
3744  Double_t cov[6]={diamondcovxy[0],diamondcovxy[1],diamondcovxy[2],0.,0.,10.*10.};
3745  AliESDVertex *diamond = new AliESDVertex(pos,cov,1.,1);
3746  vertexer->SetVtxStart(diamond);
3747  delete diamond; diamond=NULL;
3748  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraintOnlyFitter"))
3749  vertexer->SetOnlyFitter();
3750  }
3751  Int_t skipped[1000];
3752  Int_t nTrksToSkip=0,id;
3753  AliExternalTrackParam *t = 0;
3754  for(Int_t i=0; i<nTrks; i++) {
3755  t = (AliExternalTrackParam*)trkArray->UncheckedAt(i);
3756  id = (Int_t)t->GetID();
3757  if(id<0) continue;
3758  skipped[nTrksToSkip++] = id;
3759  }
3760  // TEMPORARY FIX
3761  // For AOD, skip also tracks without covariance matrix
3762  Double_t covtest[21];
3763  for(Int_t j=0; j<event->GetNumberOfTracks(); j++) {
3764  AliVTrack *vtrack = (AliVTrack*)event->GetTrack(j);
3765  if(!vtrack->GetCovarianceXYZPxPyPz(covtest)) {
3766  id = (Int_t)vtrack->GetID();
3767  if(id<0) continue;
3768  skipped[nTrksToSkip++] = id;
3769  }
3770  }
3771  for(Int_t ijk=nTrksToSkip; ijk<1000; ijk++) skipped[ijk]=-1;
3772  //
3773  vertexer->SetSkipTracks(nTrksToSkip,skipped);
3774  vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(event);
3775 
3776  } else if(fRmTrksFromPrimVtx && nTrks>0) {
3777  // removing the prongs tracks
3778 
3779  TObjArray rmArray(nTrks);
3780  UShort_t *rmId = new UShort_t[nTrks];
3781  AliESDtrack *esdTrack = 0;
3782  AliESDtrack *t = 0;
3783  for(Int_t i=0; i<nTrks; i++) {
3784  t = (AliESDtrack*)trkArray->UncheckedAt(i);
3785  esdTrack = new AliESDtrack(*t);
3786  rmArray.AddLast(esdTrack);
3787  if(esdTrack->GetID()>=0) {
3788  rmId[i]=(UShort_t)esdTrack->GetID();
3789  } else {
3790  rmId[i]=9999;
3791  }
3792  }
3793  Float_t diamondxy[2]={static_cast<Float_t>(event->GetDiamondX()),static_cast<Float_t>(event->GetDiamondY())};
3794  vertexESD = vertexer->RemoveTracksFromVertex(fV1,&rmArray,rmId,diamondxy);
3795  delete [] rmId; rmId=NULL;
3796  rmArray.Delete();
3797 
3798  }
3799 
3800  delete vertexer; vertexer=NULL;
3801  if(!vertexESD) return vertexAOD;
3802  if(vertexESD->GetNContributors()<=0) {
3803  //AliDebug(2,"vertexing failed");
3804  delete vertexESD; vertexESD=NULL;
3805  return vertexAOD;
3806  }
3807 
3808 
3809  }
3810 
3811  // convert to AliAODVertex
3812  Double_t pos[3],cov[6],chi2perNDF;
3813  vertexESD->GetXYZ(pos); // position
3814  vertexESD->GetCovMatrix(cov); //covariance matrix
3815  chi2perNDF = vertexESD->GetChi2toNDF();
3816  delete vertexESD; vertexESD=NULL;
3817 
3818  vertexAOD = new AliAODVertex(pos,cov,chi2perNDF);
3819 
3820  return vertexAOD;
3821 }
3822 
3823 //________________________________________________________________________
3824 AliAODVertex* AliAnalysisTaskSEXic2eleXifromAODtracks::ReconstructSecondaryVertex(AliAODcascade *casc, AliAODTrack *part, AliAODEvent * aod)
3825 {
3826  //
3827  // Reconstruct secondary vertex from trkArray (Copied from AliAnalysisVertexingHF)
3828  //
3829 
3830  AliAODVertex *primVertexAOD;
3831  Bool_t unsetvtx = kFALSE;
3833  primVertexAOD = CallPrimaryVertex(casc,part,aod);
3834  if(!primVertexAOD){
3835  primVertexAOD = fVtx1;
3836  }else{
3837  unsetvtx = kTRUE;
3838  }
3839  }else{
3840  primVertexAOD = fVtx1;
3841  }
3842  if(!primVertexAOD) return 0x0;
3843 
3844  AliESDVertex * vertexESD = new AliESDVertex(*fV1);
3845 
3846  Double_t pos[3],cov[6],chi2perNDF;
3847  vertexESD->GetXYZ(pos); // position
3848  vertexESD->GetCovMatrix(cov); //covariance matrix
3849  chi2perNDF = vertexESD->GetChi2toNDF();
3850  delete vertexESD; vertexESD=NULL;
3851 
3852  AliAODVertex *secVert = new AliAODVertex(pos,cov,chi2perNDF);
3853 
3854  return secVert;
3855 }
3856 //________________________________________________________________________
3857 Int_t AliAnalysisTaskSEXic2eleXifromAODtracks::MatchToMC(AliAODRecoCascadeHF *exobj, TClonesArray *mcArray, Int_t *pdgarray_ele, Int_t *pdgarray_casc, Int_t *labelarray_ele, Int_t *labelarray_casc, Int_t &ngen_ele, Int_t &ngen_casc)
3858 {
3859  //
3860  // Match to MC
3861  //
3862  for(Int_t i=0;i<100;i++){
3863  pdgarray_ele[i] = -9999;
3864  labelarray_ele[i] = -9999;
3865  pdgarray_casc[i] = -9999;
3866  labelarray_casc[i] = -9999;
3867  }
3868  ngen_ele = 0;
3869  ngen_casc = 0;
3870 
3871  AliVTrack *trk = dynamic_cast<AliVTrack*>(exobj->GetBachelor());
3872  if(!trk) return -1;
3873  Int_t labEle = trk->GetLabel();
3874  if(labEle<0) return -1;
3875  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
3876  if(!mcetrk) return -1;
3877  labelarray_ele[0] = labEle;
3878  pdgarray_ele[0] = mcetrk->GetPdgCode();
3879  ngen_ele ++;
3880 
3881  AliAODMCParticle *mcprimele=0;
3882  mcprimele = mcetrk;
3883  while(mcprimele->GetMother()>=0) {
3884  Int_t labprim_ele=mcprimele->GetMother();
3885  AliAODMCParticle *tmcprimele = (AliAODMCParticle*)mcArray->At(labprim_ele);
3886  if(!tmcprimele) {
3887  break;
3888  }
3889 
3890  mcprimele = tmcprimele;
3891  pdgarray_ele[ngen_ele] = mcprimele->GetPdgCode();
3892  labelarray_ele[ngen_ele] = labprim_ele;
3893  ngen_ele ++;
3894  if(ngen_ele==100) break;
3895  }
3896 
3897  AliAODcascade *theCascade = dynamic_cast<AliAODcascade*>(exobj->GetCascade());
3898  if(!theCascade) return -1;
3899 
3900  Int_t pdgDgcasc[2]={211,3122};
3901  Int_t pdgDgv0[2]={2212,211};
3902  Int_t labcasc = MatchToMCCascade(theCascade,3312,pdgDgcasc,pdgDgv0,mcArray); // the cascade
3903  if(labcasc<0) return -1;
3904 
3905  AliAODMCParticle *mccasc = (AliAODMCParticle*)mcArray->At(labcasc);
3906  if(!mccasc) return -1;
3907  labelarray_casc[0] = labcasc;
3908  pdgarray_casc[0] = mccasc->GetPdgCode();
3909  ngen_casc ++;
3910 
3911  AliAODMCParticle *mcprimcasc=0;
3912  mcprimcasc = mccasc;
3913  while(mcprimcasc->GetMother()>=0) {
3914  Int_t labprim_casc=mcprimcasc->GetMother();
3915  AliAODMCParticle *tmcprimcasc = (AliAODMCParticle*)mcArray->At(labprim_casc);
3916  if(!tmcprimcasc) {
3917  break;
3918  }
3919 
3920  mcprimcasc = tmcprimcasc;
3921  pdgarray_casc[ngen_casc] = mcprimcasc->GetPdgCode();
3922  labelarray_casc[ngen_casc] = labprim_casc;
3923  ngen_casc ++;
3924  if(ngen_casc==100) break;
3925  }
3926 
3927  Bool_t same_flag = kFALSE;
3928  Int_t matchedlabel=-9999;
3929  for(Int_t iemc=0;iemc<ngen_ele;iemc++){
3930  for(Int_t ivmc=0;ivmc<ngen_casc;ivmc++){
3931  if(labelarray_ele[iemc]==labelarray_casc[ivmc]){
3932  same_flag = kTRUE;
3933  matchedlabel = labelarray_ele[iemc];
3934  break;
3935  }
3936  }
3937  if(same_flag) break;
3938  }
3939 
3940  return matchedlabel;
3941 
3942 }
3943 //________________________________________________________________________
3944 Int_t AliAnalysisTaskSEXic2eleXifromAODtracks::MatchToMCCascade(AliAODcascade *theCascade, Int_t pdgabscasc, Int_t *pdgDgcasc, Int_t *pdgDgv0, TClonesArray *mcArray) const // the cascade
3945 {
3946  //
3947  // Matching to MC of cascade
3948  //
3949 
3950  AliAODTrack *cptrack = (AliAODTrack*) theCascade->GetDaughter(0);
3951  if(!cptrack) return -1;
3952  Int_t label_p = TMath::Abs(cptrack->GetLabel());
3953  if(label_p<0) return -1;
3954  AliAODTrack *cntrack = (AliAODTrack*) theCascade->GetDaughter(1);
3955  if(!cntrack) return -1;
3956  Int_t label_n = TMath::Abs(cntrack->GetLabel());
3957  if(label_n<0) return -1;
3958  Int_t labv0 = theCascade->MatchToMC(pdgDgcasc[1],mcArray,2,pdgDgv0);
3959  if(labv0<0) return -1;
3960  AliAODMCParticle *mcpartv0= (AliAODMCParticle*) mcArray->At(labv0);
3961 
3962  AliAODTrack *cbtrack = (AliAODTrack*) theCascade->GetDecayVertexXi()->GetDaughter(0);
3963  if(!cbtrack) return -1;
3964 
3965  Int_t label_b = TMath::Abs(cbtrack->GetLabel());
3966  if(label_b<0) return -1;
3967 
3968  AliAODMCParticle *mcpartb= (AliAODMCParticle*) mcArray->At(label_b);
3969  Int_t pdgb = TMath::Abs(mcpartb->GetPdgCode());
3970  if(pdgb!=pdgDgcasc[0]) return -1;
3971 
3972  AliAODMCParticle *mcmotherv0=mcpartv0;
3973  Bool_t isFromXiv0 = kFALSE;
3974  Int_t labxiv0 = mcmotherv0->GetMother();
3975  if(labxiv0<0) return -1;
3976  mcmotherv0 = (AliAODMCParticle*) mcArray->At(labxiv0);
3977  if(mcmotherv0){
3978  Int_t pdg = TMath::Abs(mcmotherv0 ->GetPdgCode());
3979  if(pdg==pdgabscasc){
3980  isFromXiv0 = kTRUE;
3981  }
3982  }
3983  if(!isFromXiv0) return -1;
3984 
3985  AliAODMCParticle *mcmotherb=mcpartb;
3986  Bool_t isFromXib = kFALSE;
3987  Int_t labxib = mcmotherb->GetMother();
3988  if(labxib<0) return -1;
3989  mcmotherb = (AliAODMCParticle*) mcArray->At(labxib);
3990  if(mcmotherb){
3991  Int_t pdg = TMath::Abs(mcmotherb ->GetPdgCode());
3992  if(pdg==pdgabscasc){
3993  isFromXib = kTRUE;
3994  }
3995  }
3996  if(!isFromXib) return -1;
3997 
3998  if(labxiv0!=labxib) return -1;//Bachelor and V0 should come from the same Xi
3999 
4000  return labxib;
4001 }
4002 //________________________________________________________________________
4003 void AliAnalysisTaskSEXic2eleXifromAODtracks::SelectTrack( const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks,Bool_t *seleFlags, TClonesArray *mcArray)
4004 {
4005  //
4006  // Select good tracks using fAnalCuts (AliRDHFCuts object) and return the array of their ids
4007  //
4008 
4009  //const Int_t entries = event->GetNumberOfTracks();
4010  if(trkEntries==0) return;
4011 
4012  nSeleTrks=0;
4013  for(Int_t i=0; i<trkEntries; i++) {
4014  seleFlags[i] = kFALSE;
4015 
4016  AliVTrack *track;
4017  track = (AliVTrack*)event->GetTrack(i);
4018 
4019  //if(track->GetID()<0) continue;
4020  Double_t covtest[21];
4021  if(!track->GetCovarianceXYZPxPyPz(covtest)) continue;
4022 
4023  if(!fAnalCuts) continue;
4024 
4025  AliAODTrack *aodt = (AliAODTrack*)track;
4026 
4028  Int_t filterbit = fAnalCuts->GetProdAODFilterBit();
4029  if(filterbit==7){
4030  if(!aodt->TestFilterBit(BIT(filterbit))) continue;
4031  }else{
4032  if(!aodt->TestFilterMask(BIT(filterbit))) continue;
4033  }
4034  }
4035 
4036  AliAODTrack *aodtpid = 0;
4037  if(fAnalCuts->GetProdAODFilterBit()==7){
4038  aodtpid = fGTI[-aodt->GetID()-1];
4039  }else{
4040  aodtpid = aodt;
4041  }
4042 
4043  Double_t nsigma_tpcele = -9999;
4044  Double_t nsigma_tofele = -9999;
4045  if(fAnalCuts->GetIsUsePID()){
4046  nsigma_tpcele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(aodtpid,AliPID::kElectron);
4047  nsigma_tofele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(aodtpid,AliPID::kElectron);
4048  }
4049 
4050  if(fAnalCuts->SingleTrkCutsNoPID(aodt,aodtpid,fVtx1)){
4051  fHistoElectronTPCPID->Fill(aodt->Pt(),nsigma_tpcele);
4052  fHistoElectronTOFPID->Fill(aodt->Pt(),nsigma_tofele);
4053  if(fabs(nsigma_tofele)<3.){
4054  fHistoElectronTPCPIDSelTOF->Fill(aodt->Pt(),nsigma_tpcele);
4055  Double_t eleeta = aodt->Eta();
4056  if(fabs(eleeta)<0.6)
4057  fHistoElectronTPCPIDSelTOFSmallEta->Fill(aodt->Pt(),nsigma_tpcele);
4058  if(fabs(eleeta)>0.6 && fabs(eleeta)<0.8)
4059  fHistoElectronTPCPIDSelTOFLargeEta->Fill(aodt->Pt(),nsigma_tpcele);
4060  if(eleeta>-0.8 && eleeta<-0.6){
4061  fHistoElectronTPCPIDSelTOFEtaDep[0]->Fill(aodt->Pt(),nsigma_tpcele);
4062  }else if(eleeta>-0.6&&eleeta<-0.4){
4063  fHistoElectronTPCPIDSelTOFEtaDep[1]->Fill(aodt->Pt(),nsigma_tpcele);
4064  }else if(eleeta>-0.4&&eleeta<-0.2){
4065  fHistoElectronTPCPIDSelTOFEtaDep[2]->Fill(aodt->Pt(),nsigma_tpcele);
4066  }else if(eleeta>-0.2&&eleeta<0.0){
4067  fHistoElectronTPCPIDSelTOFEtaDep[3]->Fill(aodt->Pt(),nsigma_tpcele);
4068  }else if(eleeta>0.0&&eleeta<0.2){
4069  fHistoElectronTPCPIDSelTOFEtaDep[4]->Fill(aodt->Pt(),nsigma_tpcele);
4070  }else if(eleeta>0.2&&eleeta<0.4){
4071  fHistoElectronTPCPIDSelTOFEtaDep[5]->Fill(aodt->Pt(),nsigma_tpcele);
4072  }else if(eleeta>0.4&&eleeta<0.6){
4073  fHistoElectronTPCPIDSelTOFEtaDep[6]->Fill(aodt->Pt(),nsigma_tpcele);
4074  }else if(eleeta>0.6&&eleeta<0.8){
4075  fHistoElectronTPCPIDSelTOFEtaDep[7]->Fill(aodt->Pt(),nsigma_tpcele);
4076  }
4077  }
4078  if(nsigma_tpcele>-0.5&&nsigma_tpcele<3.){
4079  fHistoElectronTOFPIDSelTPC->Fill(aodt->Pt(),nsigma_tofele);
4080  }
4081  }
4082  if(fAnalCuts->SingleTrkCuts(aodt,aodtpid,fVtx1)){
4083  seleFlags[i]=kTRUE;
4084  nSeleTrks++;
4085  fHistoElectronTPCSelPID->Fill(aodt->Pt(),nsigma_tpcele);
4086  fHistoElectronTOFSelPID->Fill(aodt->Pt(),nsigma_tofele);
4087 
4088  Double_t minmass_ee = 9999.;
4089  Double_t minmasslike_ee = 9999.;
4090  Bool_t isconv = fAnalCuts->TagConversions(aodt,fGTIndex,(AliAODEvent*)event,event->GetNumberOfTracks(),minmass_ee);
4091  Bool_t isconv_like = fAnalCuts->TagConversionsSameSign(aodt,fGTIndex,(AliAODEvent*)event,event->GetNumberOfTracks(),minmasslike_ee);
4092  Int_t mcetype = -9999;
4093 
4094  if(fUseMCInfo)
4095  {
4096  Int_t labEle = aodt->GetLabel();
4097  if(labEle<0){
4098  seleFlags[i]=kFALSE;
4099  continue;
4100  }
4101  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
4102  if(!mcetrk){
4103  seleFlags[i]=kFALSE;
4104  continue;
4105  }
4106  Int_t pdgEle = mcetrk->GetPdgCode();
4107  if(abs(pdgEle)!=11){
4108  seleFlags[i]=kFALSE;
4109  continue;
4110  }
4111 
4112  Int_t pdgarray_ele[100], labelarray_ele[100], ngen_ele;
4113  GetMCDecayHistory(mcetrk,mcArray,pdgarray_ele,labelarray_ele,ngen_ele);
4114 
4115  Int_t hfe_flag = 0;
4116  Bool_t gamma_flag = kFALSE;
4117  Bool_t pi0_flag = kFALSE;
4118  Bool_t eta_flag = kFALSE;
4119  Double_t pt_pi0 = -9999.;
4120  Double_t pt_eta = -9999.;
4121  if(abs(pdgarray_ele[0])>400&&abs(pdgarray_ele[0])<440){
4122  hfe_flag = 1;
4123  }
4124  if(abs(pdgarray_ele[0])>4000&&abs(pdgarray_ele[0])<4400){
4125  hfe_flag = 1;
4126  }
4127  if(abs(pdgarray_ele[0])>500&&abs(pdgarray_ele[0])<540){
4128  hfe_flag = 2;
4129  }
4130  if(abs(pdgarray_ele[0])>5000&&abs(pdgarray_ele[0])<5400){
4131  hfe_flag = 2;
4132  }
4133  if(abs(pdgarray_ele[0])==22){
4134  gamma_flag = kTRUE;
4135  }
4136  if(!gamma_flag){
4137  fHistoBachPtMCS->Fill(aodt->Pt());
4138  }
4139  if((abs(pdgarray_ele[0])==22) && (abs(pdgarray_ele[1])==111)){
4140  pi0_flag = kTRUE;
4141  AliAODMCParticle *mctrkm = (AliAODMCParticle*)mcArray->At(labelarray_ele[1]);
4142  pt_pi0 = mctrkm->Pt();
4143  }
4144  if(abs(pdgarray_ele[0])==111){
4145  pi0_flag = kTRUE;
4146  AliAODMCParticle *mctrkm = (AliAODMCParticle*)mcArray->At(labelarray_ele[0]);
4147  pt_pi0 = mctrkm->Pt();
4148  }
4149  if((abs(pdgarray_ele[0])==22) && (abs(pdgarray_ele[1])==221)){
4150  eta_flag = kTRUE;
4151  AliAODMCParticle *mctrkm = (AliAODMCParticle*)mcArray->At(labelarray_ele[1]);
4152  pt_eta = mctrkm->Pt();
4153  }
4154  if(abs(pdgarray_ele[0])==221){
4155  eta_flag = kTRUE;
4156  AliAODMCParticle *mctrkm = (AliAODMCParticle*)mcArray->At(labelarray_ele[0]);
4157  pt_eta = mctrkm->Pt();
4158  }
4159 
4160  if(pi0_flag){
4161  Double_t cont_pi0[3];
4162  cont_pi0[0] = aodt->Pt();
4163  cont_pi0[1] = pt_pi0;
4164  cont_pi0[2] = fCentrality;
4165  fHistoElectronPi0Total->Fill(cont_pi0);
4166  if(isconv) fHistoElectronPi0Tag->Fill(cont_pi0);
4167  }
4168 
4169  if(eta_flag){
4170  Double_t cont_eta[3];
4171  cont_eta[0] = aodt->Pt();
4172  cont_eta[1] = pt_eta;
4173  cont_eta[2] = fCentrality;
4174  fHistoElectronEtaTotal->Fill(cont_eta);
4175  if(isconv) fHistoElectronEtaTag->Fill(cont_eta);
4176  }
4177 
4178  if(hfe_flag==0){
4179  seleFlags[i]=kFALSE;
4180  continue;
4181  }
4182 
4183  if(hfe_flag==1){
4184  mcetype = 1013;
4185  }
4186  if(hfe_flag==2){
4187  mcetype = 1016;
4188  }
4189  if(hfe_flag==1 && HaveBottomInHistory(pdgarray_ele)){
4190  mcetype = 1019;
4191  }
4192  }
4193 
4194  if(fMixWithoutConversionFlag && isconv){
4195  //seleFlags[i]=kFALSE;
4196  continue;
4197  }
4198 
4199  FillElectronROOTObjects(aodt,aodtpid,(Int_t)isconv + 2 * (Int_t)isconv_like,mcetype,(AliAODEvent*)event,mcArray);
4200 
4201 // Double_t minmass = 9999.;
4202 // Bool_t isconv = fAnalCuts->TagConversions(aodt,fGTIndex,(AliAODEvent*)event,trkEntries,minmass);
4203 // fHistoMassConversionsMin->Fill(minmass);
4204 // if(isconv) seleFlags[i] = kFALSE;
4205 
4206 // if(fMixWithoutConversionFlag){
4207 // if(seleFlags[i]) FillElectronROOTObjects(aodt,mcArray);
4208 // }else{
4209 // FillElectronROOTObjects(aodt,mcArray);
4210 // }
4211 
4212 // Double_t minmasslike = 9999.;
4213 // fAnalCuts->TagConversionsSameSign(aodt,fGTIndex,(AliAODEvent*)event,trkEntries,minmasslike);
4214 // fHistoMassConversionsSameSignMin->Fill(minmasslike);
4215  }
4216  } // end loop on tracks
4217 }
4218 //________________________________________________________________________
4219 void AliAnalysisTaskSEXic2eleXifromAODtracks::SelectCascade( const AliVEvent *event,Int_t nCascs,Int_t &nSeleCasc, Bool_t *seleCascFlags, TClonesArray *mcArray)
4220 {
4221  //
4222  // Select good Casc using fAnalCuts (AliRDHFCuts object) and return the array of their ids
4223  //
4224 
4225  Double_t primVtx[3];
4226  fVtx1->GetXYZ(primVtx);
4227 
4228  nSeleCasc = 0;
4229  for(Int_t icasc=0;icasc<nCascs;icasc++)
4230  {
4231  seleCascFlags[icasc] = kFALSE;
4232  AliAODcascade *casc = ((AliAODEvent*)event)->GetCascade(icasc);
4233 
4234  if(!fAnalCuts) continue;
4235  if(fAnalCuts->SingleCascadeCuts(casc,primVtx)){
4236  seleCascFlags[icasc] = kTRUE;
4237  nSeleCasc++;
4238 
4239  FillCascROOTObjects(casc,mcArray);
4240  }
4241  }
4242 }
4243 //_________________________________________________________________
4244 Int_t AliAnalysisTaskSEXic2eleXifromAODtracks::GetPoolIndex(Double_t zvert, Double_t mult){
4245  //
4246  // check in which of the pools the current event falls
4247  //
4248 
4249  Int_t theBinZ=TMath::BinarySearch(fNzVtxBins,fZvtxBins,zvert);
4250  if(theBinZ<0 || theBinZ>=fNzVtxBins) return -1;
4251  Int_t theBinM=TMath::BinarySearch(fNCentBins,fCentBins,mult);
4252  if(theBinM<0 || theBinM>=fNCentBins) return -1;
4253  return fNCentBins*theBinZ+theBinM;
4254 }
4255 //_________________________________________________________________
4257  //
4258  // delete the contets of the pool
4259  //
4260  if(poolIndex<0 || poolIndex>=fNOfPools) return;
4261  delete fEventBuffer[poolIndex];
4262  fEventBuffer[poolIndex]=new TTree(Form("EventBuffer_%d",poolIndex), "Temporary buffer for event mixing");
4263 
4264  fEventBuffer[poolIndex]->Branch("zVertex", &fVtxZ);
4265  fEventBuffer[poolIndex]->Branch("centrality", &fCentrality);
4266  fEventBuffer[poolIndex]->Branch("eventInfo", "TObjString",&fEventInfo);
4267  fEventBuffer[poolIndex]->Branch("c1array", "TObjArray", &fCascadeTracks1);
4268  fEventBuffer[poolIndex]->Branch("c2array", "TObjArray", &fCascadeTracks2);
4269  fEventBuffer[poolIndex]->Branch("c1varsarray", "TObjArray", &fCascadeCutVarsArray1);
4270  fEventBuffer[poolIndex]->Branch("c2varsarray", "TObjArray", &fCascadeCutVarsArray2);
4271 
4272  return;
4273 }
4274 //_________________________________________________________________
4276 {
4277  //
4278  // perform mixed event analysis
4279  //
4280 
4281  if(poolIndex<0 || poolIndex>fNzVtxBins*fNCentBins) return;
4282  if(fEventBuffer[poolIndex]->GetEntries()<fNumberOfEventsForMixing) return;
4283 
4284  Int_t nEle = fElectronTracks->GetEntries();
4285  Int_t nEvents=fEventBuffer[poolIndex]->GetEntries();
4286 
4287  TObjArray* c1array=0x0;
4288  TObjArray* c2array=0x0;
4289  TObjArray* c1varsarray=0x0;
4290  TObjArray* c2varsarray=0x0;
4291  Float_t zVertex,cent;
4292  TObjString* eventInfo=0x0;
4293  fEventBuffer[poolIndex]->SetBranchAddress("zVertex", &zVertex);
4294  fEventBuffer[poolIndex]->SetBranchAddress("eventInfo",&eventInfo);
4295  fEventBuffer[poolIndex]->SetBranchAddress("centrality", &cent);
4296  fEventBuffer[poolIndex]->SetBranchAddress("c1array", &c1array);
4297  fEventBuffer[poolIndex]->SetBranchAddress("c2array", &c2array);
4298  fEventBuffer[poolIndex]->SetBranchAddress("c1varsarray", &c1varsarray);
4299  fEventBuffer[poolIndex]->SetBranchAddress("c2varsarray", &c2varsarray);
4300  for (Int_t i=0; i<nEle; i++)
4301  {
4302  TLorentzVector* trke=(TLorentzVector*) fElectronTracks->At(i);
4303  if(!trke)continue;
4304  TVector *elevarsarray = (TVector*)fElectronCutVarsArray->At(i);
4305 
4306  for(Int_t iEv=0; iEv<fNumberOfEventsForMixing; iEv++){
4307  fEventBuffer[poolIndex]->GetEvent(iEv + nEvents - fNumberOfEventsForMixing);
4308  //TObjArray* c1array1=(TObjArray*)c1array->Clone();
4309  Int_t nCascs1=c1array->GetEntries();
4310  //Float_t zVertex1=zVertex;
4311  //Float_t mult1=cent;
4312 // Int_t evId1,esdId1,ne1,nv1;
4313 // sscanf((eventInfo->String()).Data(),"Ev%d_esd%d_E%d_C%d",&evId1,&esdId1,&ne1,&nv1);
4314 // if(nv1!=(nCascs1+nCascs2)){
4315 // printf("AliAnalysisTaskSEXic2eleXifromAODtracks::DoMixingWithPools ERROR: read event does not match to the stored one\n");
4316 // delete c1array1;
4317 // delete c2array1;
4318 // continue;
4319 // }
4320  for(Int_t iTr1=0; iTr1<nCascs1; iTr1++){
4321  TLorentzVector* casc1=(TLorentzVector*) c1array->At(iTr1);
4322  if(!casc1) continue;
4323  TVector *cascvarsarray = (TVector*) c1varsarray->At(iTr1);
4324  FillMixROOTObjects(trke,casc1,elevarsarray,cascvarsarray,1);
4325  }//casc loop
4326 
4327  //TObjArray* c2array1=(TObjArray*)c2array->Clone();
4328  Int_t nCascs2=c2array->GetEntries();
4329  for(Int_t iTr2=0; iTr2<nCascs2; iTr2++){
4330  TLorentzVector* casc2=(TLorentzVector*) c2array->At(iTr2);
4331  if(!casc2) continue;
4332  TVector *cascvarsarray = (TVector*) c2varsarray->At(iTr2);
4333  FillMixROOTObjects(trke,casc2,elevarsarray,cascvarsarray,-1);
4334  }//casc loop
4335 
4336  //delete c1array1;
4337  //delete c2array1;
4338  }//event loop
4339  }//track loop
4340 }
4341 //_________________________________________________________________
4343 {
4344  //
4345  // Analyze AliAODmcparticle
4346  //
4347 
4348  Int_t nmcpart = mcArray->GetEntriesFast();
4349 
4350  Int_t mcevttype = 0;
4351  Int_t nccbar = 0;
4352  Bool_t sigmaevent = kFALSE;
4353  if(fMCEventType==1 || fMCEventType==2 || fMCEventType==11 || fMCEventType==12){
4354  //1: c quark event
4355  //2: b quark event
4356  //11: near side c-cbar event
4357  //12: away side c-cbar event
4358  Int_t ncquark = 0;
4359  Int_t ncbarquark = 0;
4360  Double_t phi_c = -9999.;
4361  Double_t phi_cbar = -9999.;
4362  for(Int_t i=0;i<nmcpart;i++)
4363  {
4364  AliAODMCParticle *mcpart = (AliAODMCParticle*) mcArray->At(i);
4365  if(TMath::Abs(mcpart->GetPdgCode())==4){
4366  if(fabs(mcpart->Y())<1.5){
4367  if(mcpart->GetPdgCode()==4){
4368  phi_c = mcpart->Phi();
4369  ncquark++;
4370  }
4371  if(mcpart->GetPdgCode()==-4){
4372  phi_cbar = mcpart->Phi();
4373  ncbarquark++;
4374  }
4375  if(mcevttype==0){
4376  mcevttype = 1;
4377  }else if(mcevttype==1){
4378  mcevttype = 1;
4379  }else if(mcevttype==2){
4380  mcevttype = 3;
4381  }else if(mcevttype==3){
4382  mcevttype = 3;
4383  }
4384  nccbar++;
4385  }
4386  }
4387  if(TMath::Abs(mcpart->GetPdgCode())==5){
4388  if(!mcpart->IsPhysicalPrimary()) continue;
4389  if(fabs(mcpart->Y())<1.5){
4390  if(mcevttype==0){
4391  mcevttype = 2;
4392  }else if(mcevttype==1){
4393  mcevttype = 3;
4394  }else if(mcevttype==2){
4395  mcevttype = 2;
4396  }else if(mcevttype==3){
4397  mcevttype = 3;
4398  }
4399  }
4400  }
4401  }
4402 
4403  if(fMCEventType==1||fMCEventType==11||fMCEventType==12){
4404  if((mcevttype==2)||(mcevttype==0)||(mcevttype==3)) return kFALSE;
4405  }else if(fMCEventType==2){
4406  if((mcevttype==1)||(mcevttype==0)||(mcevttype==3)) return kFALSE;
4407  }
4408 
4409  if(fMCEventType>10){
4410  if(ncquark!=1) return kFALSE;
4411  if(ncbarquark!=1) return kFALSE;
4412  Double_t dphi = fabs(phi_c - phi_cbar);
4413  if(dphi>2*M_PI) dphi -= 2*M_PI;
4414  if(dphi>M_PI) dphi = 2*M_PI-dphi;
4415  if(fMCEventType==11 && dphi>M_PI/3.) return kFALSE;
4416  if(fMCEventType==12 && dphi<2*M_PI/3.) return kFALSE;
4417  fHistoMCDeltaPhiccbar->Fill(dphi);
4418  }
4419 
4420  fHistoMCEventType->Fill(mcevttype);
4421  fHistoMCNccbar->Fill(nccbar);
4422  }
4423 
4424  for(Int_t i=0;i<nmcpart;i++)
4425  {
4426  AliAODMCParticle *mcpart = (AliAODMCParticle*) mcArray->At(i);
4427  if(TMath::Abs(mcpart->GetPdgCode())==4132){
4428  Bool_t e_flag = kFALSE;
4429  Bool_t xi_flag = kFALSE;
4430  AliAODMCParticle *mcepart = 0;
4431  AliAODMCParticle *mccascpart = 0;
4432  for(Int_t idau=mcpart->GetFirstDaughter();idau<mcpart->GetLastDaughter()+1;idau++)
4433  {
4434  if(idau<0) break;
4435  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
4436  if(!mcdau) continue;
4437  if(TMath::Abs(mcdau->GetPdgCode())==11){
4438  e_flag = kTRUE;
4439  mcepart = mcdau;
4440  }
4441  if(TMath::Abs(mcdau->GetPdgCode())==3312){
4442  xi_flag = kTRUE;
4443  mccascpart = mcdau;
4444  }
4445  }
4446 
4447  Int_t decaytype = -9999;
4448  if(e_flag && xi_flag) decaytype = 0;
4449 
4450  if(e_flag&&xi_flag)
4451  fHistoMCXic0Decays->Fill(1);
4452  if(!e_flag&&xi_flag)
4453  fHistoMCXic0Decays->Fill(2);
4454  if(e_flag&&!xi_flag)
4455  fHistoMCXic0Decays->Fill(3);
4456  if(!e_flag&&!xi_flag)
4457  fHistoMCXic0Decays->Fill(4);
4458 
4459  FillMCROOTObjects(mcpart,mcepart,mccascpart,decaytype);
4460  }
4461  if(TMath::Abs(mcpart->GetPdgCode())==5132 || TMath::Abs(mcpart->GetPdgCode())==5232){
4462  Bool_t e_flag = kFALSE;
4463  Bool_t xic_flag = kFALSE;
4464  AliAODMCParticle *mcepart = 0;
4465  AliAODMCParticle *mcxicpart = 0;
4466  AliAODMCParticle *mccascpart = 0;
4467  for(Int_t idau=mcpart->GetFirstDaughter();idau<mcpart->GetLastDaughter()+1;idau++)
4468  {
4469  if(idau<0) break;
4470  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
4471  if(!mcdau) continue;
4472  if(TMath::Abs(mcdau->GetPdgCode())==11){
4473  e_flag = kTRUE;
4474  mcepart = mcdau;
4475  }
4476  if(TMath::Abs(mcdau->GetPdgCode())==4132 || TMath::Abs(mcdau->GetPdgCode())==4232 ){
4477  xic_flag = kTRUE;
4478  mcxicpart = mcdau;
4479  }
4480  }
4481 
4482  Bool_t xi_flag = kFALSE;
4483  if(e_flag && xic_flag){
4484  for(Int_t idau=mcxicpart->GetFirstDaughter();idau<mcxicpart->GetLastDaughter()+1;idau++)
4485  {
4486  if(idau<0) break;
4487  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
4488  if(!mcdau) continue;
4489  if(TMath::Abs(mcdau->GetPdgCode())==3312){
4490  xi_flag = kTRUE;
4491  mccascpart = mcdau;
4492  }
4493  }
4494  }
4495 
4496  if(xic_flag){
4497  Double_t contmc_withxic[3];
4498  contmc_withxic[0] = mcpart->Pt();
4499  contmc_withxic[1] = mcpart->Y();
4500  contmc_withxic[2] = mcxicpart->Y();
4501  if(fabs(mcxicpart->Y())<1.){
4502  fHistoResponseMcGenXibPtvsXicPt->Fill(mcpart->Pt(),mcxicpart->Pt());
4503  }
4504  fHistoXibMCGenWithXic->Fill(contmc_withxic);
4505  }
4506 
4507  Int_t decaytype = -9999;
4508  if(e_flag && xic_flag && xi_flag) decaytype = 10;
4509  FillMCROOTObjects(mcpart,mcepart,mccascpart,decaytype);
4510  }
4511  if(TMath::Abs(mcpart->GetPdgCode())==11 && mcpart->GetStatus()==1){
4512  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
4513  Float_t etamin, etamax;
4514  esdcuts->GetEtaRange(etamin,etamax);
4515  if(fabs(mcpart->Eta())<etamax){
4516  Bool_t gamma_flag = kFALSE;
4517  Int_t labmother = mcpart->GetMother();
4518  if(labmother>=0){
4519  AliAODMCParticle *mcmother = (AliAODMCParticle*) mcArray->At(labmother);
4520  Int_t pdgmother = mcmother->GetPdgCode();
4521  if(TMath::Abs(pdgmother)==22) gamma_flag = kTRUE;
4522  }
4523  if(!gamma_flag) fHistoBachPtMCGen->Fill(mcpart->Pt());
4524  }
4525  FillMCEleROOTObjects(mcpart, mcArray);
4526  }
4527  if(TMath::Abs(mcpart->GetPdgCode())==3312){
4528  Double_t etamin, etamax, rapmin, rapmax;
4529  fAnalCuts->GetProdCascEtaRange(etamin,etamax);
4530  fAnalCuts->GetProdCascRapRange(rapmin,rapmax);
4531 
4532  if((fabs(mcpart->Y())<rapmax) && (fabs(mcpart->Eta())<etamax)){
4533  fHistoXiMassvsPtMCGen->Fill(1.32171, mcpart->Pt());
4534  }
4535  FillMCCascROOTObjects(mcpart, mcArray);
4536  }
4537 
4538  if(TMath::Abs(mcpart->GetPdgCode())==111){
4539  if(fabs(mcpart->Y())<0.5){
4540  fHistoPi0MCGen->Fill(mcpart->Pt());
4541  }
4542  }
4543  if(TMath::Abs(mcpart->GetPdgCode())==221){
4544  if(fabs(mcpart->Y())<0.5){
4545  fHistoEtaMCGen->Fill(mcpart->Pt());
4546  }
4547  }
4548  }
4549 
4550  if(fMCDoPairAnalysis)
4551  {
4552  for(Int_t i=0;i<nmcpart;i++)
4553  {
4554  AliAODMCParticle *mcparte = (AliAODMCParticle*) mcArray->At(i);
4555  if(!mcparte) continue;
4556  if(TMath::Abs(mcparte->GetPdgCode())!=11) continue;
4557  if(mcparte->GetStatus()!=1) continue;
4558  if(mcparte->Pt()<0.4) continue;//Apply rough cuts
4559  if(fabs(mcparte->Eta())>0.8) continue;//Apply rough cuts
4560  for(Int_t j=0;j<nmcpart;j++)
4561  {
4562  AliAODMCParticle *mcpartv = (AliAODMCParticle*) mcArray->At(j);
4563  if(!mcpartv) continue;
4564  if(TMath::Abs(mcpartv->GetPdgCode())!=3312) continue;
4565  if(mcpartv->Pt()<0.4) continue;//Apply rough cuts
4566  if(fabs(mcpartv->Eta())>0.8) continue;//Apply rough cuts
4567  if(mcpartv->GetNDaughters()!=2) continue;//Apply rough cuts
4568 
4569  FillMCGenPairROOTObjects(mcparte,mcpartv,mcArray);
4570  }
4571  }
4572  return kFALSE;
4573  }
4574 
4575  return kTRUE;
4576 }
4577 
4580 {
4581  //
4582  // Define mc pair tree variables
4583  //
4584 
4585  const char* nameoutput = GetOutputSlot(11)->GetContainer()->GetName();
4586  fMCGenPairVariablesTree = new TTree(nameoutput,"MC pair variables tree");
4587  Int_t nVar = 38;
4588  fCandidateMCGenPairVariables = new Float_t [nVar];
4589  TString * fCandidateVariableNames = new TString[nVar];
4590 
4591  fCandidateVariableNames[ 0] = "InvMassEleXi";
4592  fCandidateVariableNames[ 1] = "EleXiPx";
4593  fCandidateVariableNames[ 2] = "EleXiPy";
4594  fCandidateVariableNames[ 3] = "EleXiPz";
4595  fCandidateVariableNames[ 4] = "ElePdgCode";
4596  fCandidateVariableNames[ 5] = "ElePx";
4597  fCandidateVariableNames[ 6] = "ElePy";
4598  fCandidateVariableNames[ 7] = "ElePz";
4599  fCandidateVariableNames[ 8] = "XiPdgCode";
4600  fCandidateVariableNames[ 9] = "XiPx";
4601  fCandidateVariableNames[10] = "XiPy";
4602  fCandidateVariableNames[11] = "XiPz";
4603  fCandidateVariableNames[12] = "SameFlag";
4604  fCandidateVariableNames[13] = "EleNGeneration";
4605  fCandidateVariableNames[14] = "EleGen1PDG";
4606  fCandidateVariableNames[15] = "EleGen2PDG";
4607  fCandidateVariableNames[16] = "EleGen3PDG";
4608  fCandidateVariableNames[17] = "EleGen4PDG";
4609  fCandidateVariableNames[18] = "EleGen5PDG";
4610  fCandidateVariableNames[19] = "EleGen6PDG";
4611  fCandidateVariableNames[20] = "EleGen7PDG";
4612  fCandidateVariableNames[21] = "EleGen8PDG";
4613  fCandidateVariableNames[22] = "EleGen9PDG";
4614  fCandidateVariableNames[23] = "EleGen10PDG";
4615  fCandidateVariableNames[24] = "ElePrimPDG";
4616  fCandidateVariableNames[25] = "XiNGeneration";
4617  fCandidateVariableNames[26] = "XiGen1PDG";
4618  fCandidateVariableNames[27] = "XiGen2PDG";
4619  fCandidateVariableNames[28] = "XiGen3PDG";
4620  fCandidateVariableNames[29] = "XiGen4PDG";
4621  fCandidateVariableNames[30] = "XiGen5PDG";
4622  fCandidateVariableNames[31] = "XiGen6PDG";
4623  fCandidateVariableNames[32] = "XiGen7PDG";
4624  fCandidateVariableNames[33] = "XiGen8PDG";
4625  fCandidateVariableNames[34] = "XiGen9PDG";
4626  fCandidateVariableNames[35] = "XiGen10PDG";
4627  fCandidateVariableNames[36] = "XiPrimPDG";
4628  fCandidateVariableNames[37] = "MatchedPDG";
4629 
4630  for (Int_t ivar=0; ivar<nVar; ivar++) {
4631  fMCGenPairVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCGenPairVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
4632  }
4633  return;
4634 }
4635 
4637 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillMCGenPairROOTObjects(AliAODMCParticle *mcparte, AliAODMCParticle *mcpartv, TClonesArray *mcArray)
4638 {
4639  //
4640  // Fill histograms or mc pair analysis tree
4641  //
4642  for(Int_t i=0;i<38;i++){
4643  fCandidateMCGenPairVariables[i] = -9999.;
4644  }
4645 
4646  TLorentzVector vele, vxi, vexi;
4647  vele.SetXYZM(mcparte->Px(),mcparte->Py(),mcparte->Pz(),0.000510998928);
4648  vxi.SetXYZM(mcpartv->Px(),mcpartv->Py(),mcpartv->Pz(),1.32171);
4649  vexi = vele + vxi;
4650 
4651  Int_t pdgarray_ele[100], labelarray_ele[100], ngen_ele;
4652  Int_t pdgarray_xi[100], labelarray_xi[100], ngen_xi;
4653  GetMCDecayHistory(mcparte,mcArray,pdgarray_ele,labelarray_ele,ngen_ele);
4654  GetMCDecayHistory(mcpartv,mcArray,pdgarray_xi,labelarray_xi,ngen_xi);
4655 
4656  Bool_t same_flag = kFALSE;
4657  Int_t matched_pdg = -999999;
4658  for(Int_t iemc=0;iemc<ngen_ele;iemc++){
4659  for(Int_t ivmc=0;ivmc<ngen_xi;ivmc++){
4660  if(labelarray_ele[iemc]==labelarray_xi[ivmc]){
4661  same_flag = kTRUE;
4662  matched_pdg = pdgarray_ele[iemc];
4663  break;
4664  }
4665  }
4666  if(same_flag) break;
4667  }
4668  Int_t pdgprim_ele = pdgarray_ele[ngen_ele-1];
4669  Int_t pdgprim_xi = pdgarray_xi[ngen_xi-1];
4670 
4671  fCandidateMCGenPairVariables[ 0] = vexi.M();
4672  fCandidateMCGenPairVariables[ 1] = vexi.Px();
4673  fCandidateMCGenPairVariables[ 2] = vexi.Py();
4674  fCandidateMCGenPairVariables[ 3] = vexi.Pz();
4675  fCandidateMCGenPairVariables[ 4] = mcparte->GetPdgCode();
4676  fCandidateMCGenPairVariables[ 5] = vele.Px();
4677  fCandidateMCGenPairVariables[ 6] = vele.Py();
4678  fCandidateMCGenPairVariables[ 7] = vele.Pz();
4679  fCandidateMCGenPairVariables[ 8] = mcpartv->GetPdgCode();
4680  fCandidateMCGenPairVariables[ 9] = vxi.Px();
4681  fCandidateMCGenPairVariables[10] = vxi.Py();
4682  fCandidateMCGenPairVariables[11] = vxi.Pz();
4683  fCandidateMCGenPairVariables[12] = (Float_t)same_flag;
4684  fCandidateMCGenPairVariables[13] = (Float_t)ngen_ele;
4685  fCandidateMCGenPairVariables[14] = (Float_t)pdgarray_ele[0];
4686  fCandidateMCGenPairVariables[15] = (Float_t)pdgarray_ele[1];
4687  fCandidateMCGenPairVariables[16] = (Float_t)pdgarray_ele[2];
4688  fCandidateMCGenPairVariables[17] = (Float_t)pdgarray_ele[3];
4689  fCandidateMCGenPairVariables[18] = (Float_t)pdgarray_ele[4];
4690  fCandidateMCGenPairVariables[19] = (Float_t)pdgarray_ele[5];
4691  fCandidateMCGenPairVariables[20] = (Float_t)pdgarray_ele[6];
4692  fCandidateMCGenPairVariables[21] = (Float_t)pdgarray_ele[7];
4693  fCandidateMCGenPairVariables[22] = (Float_t)pdgarray_ele[8];
4694  fCandidateMCGenPairVariables[23] = (Float_t)pdgarray_ele[9];
4695  fCandidateMCGenPairVariables[24] = (Float_t)pdgarray_ele[ngen_ele-1];
4696  fCandidateMCGenPairVariables[25] = (Float_t)ngen_xi;
4697  fCandidateMCGenPairVariables[26] = (Float_t)pdgarray_xi[0];
4698  fCandidateMCGenPairVariables[27] = (Float_t)pdgarray_xi[1];
4699  fCandidateMCGenPairVariables[28] = (Float_t)pdgarray_xi[2];
4700  fCandidateMCGenPairVariables[29] = (Float_t)pdgarray_xi[3];
4701  fCandidateMCGenPairVariables[30] = (Float_t)pdgarray_xi[4];
4702  fCandidateMCGenPairVariables[31] = (Float_t)pdgarray_xi[5];
4703  fCandidateMCGenPairVariables[32] = (Float_t)pdgarray_xi[6];
4704  fCandidateMCGenPairVariables[33] = (Float_t)pdgarray_xi[7];
4705  fCandidateMCGenPairVariables[34] = (Float_t)pdgarray_xi[8];
4706  fCandidateMCGenPairVariables[35] = (Float_t)pdgarray_xi[9];
4707  fCandidateMCGenPairVariables[36] = (Float_t)pdgarray_xi[ngen_xi-1];
4708  fCandidateMCGenPairVariables[37] = (Float_t) matched_pdg;
4709 
4710  fMCGenPairVariablesTree->Fill();
4711 }
4712 
4715 {
4716  //
4717  // Define mc pair tree variables
4718  //
4719 
4720  const char* nameoutput = GetOutputSlot(12)->GetContainer()->GetName();
4721  fCorrelationVariablesTree = new TTree(nameoutput,"Correlation variables tree");
4722  Int_t nVar = 13;
4723  fCorrelationVariables = new Float_t [nVar];
4724  TString * fCandidateVariableNames = new TString[nVar];
4725 
4726  fCandidateVariableNames[0] = "XiPt";
4727  fCandidateVariableNames[1] = "ElePt";
4728  fCandidateVariableNames[2] = "DeltaPhi";
4729  fCandidateVariableNames[3] = "DeltaEta";
4730  fCandidateVariableNames[4] = "V0ProperDecayLength";
4731  fCandidateVariableNames[5] = "Eled0";
4732  fCandidateVariableNames[6] = "FGMixMC";
4733  fCandidateVariableNames[7] = "SignType";
4734  fCandidateVariableNames[8] = "Convtype";
4735  fCandidateVariableNames[9] = "MCType";
4736  fCandidateVariableNames[10] = "Centrality";
4737  fCandidateVariableNames[11] = "EleXiPt";
4738  fCandidateVariableNames[12] = "EleXiMass";
4739 
4740 
4741  for (Int_t ivar=0; ivar<nVar; ivar++) {
4742  fCorrelationVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCorrelationVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
4743  }
4744  return;
4745 }
4746 
4748 void AliAnalysisTaskSEXic2eleXifromAODtracks::GetMCDecayHistory(AliAODMCParticle *mcpart, TClonesArray *mcArray, Int_t *pdgarray, Int_t *labelarray, Int_t &ngen)
4749 {
4750 //
4751 // MC decay history
4752 //
4753 
4754  for(Int_t i=0;i<100;i++){
4755  pdgarray[i] = -9999;
4756  labelarray[i] = -9999;
4757  }
4758  ngen = 0;
4759 
4760  AliAODMCParticle *mcprim = mcpart;
4761  while(mcprim->GetMother()>=0) {
4762  Int_t lab_prim=mcprim->GetMother();
4763 
4764  AliAODMCParticle *tmcprim = (AliAODMCParticle*)mcArray->At(lab_prim);
4765  if(!tmcprim) {
4766  break;
4767  }
4768  if((TMath::Abs(tmcprim->GetPdgCode())<10) || (TMath::Abs(tmcprim->GetPdgCode())==21)) break;
4769 
4770  mcprim = tmcprim;
4771 
4772  pdgarray[ngen] = mcprim->GetPdgCode();
4773  labelarray[ngen] = lab_prim;
4774 
4775  ngen ++;
4776  if(ngen == 100) break;
4777  }
4778 }
4779 //________________________________________________________________________
4781  //
4782  // Stores the pointer to the global track
4783  // copied from femtoscopy/k0analysis/plamanalysis
4784  //
4785 
4786  // Check that the id is positive
4787  if(track->GetID()<0){
4788  // printf("Warning: track has negative ID: %d\n",track->GetID());
4789  return;
4790  }
4791 
4792  // Check id is not too big for buffer
4793  if(track->GetID()>=fTrackBuffSize){
4794  printf("Warning: track ID too big for buffer: ID: %d, buffer %d\n"
4795  ,track->GetID(),fTrackBuffSize);
4796  return;
4797  }
4798 
4799  // Warn if we overwrite a track
4800  if(fGTI[track->GetID()]){
4801  // Seems like there are FilterMap 0 tracks
4802  // that have zero TPCNcls, don't store these!
4803  if( (!track->GetFilterMap()) &&
4804  (!track->GetTPCNcls()) )
4805  return;
4806 
4807  // Imagine the other way around,
4808  // the zero map zero clusters track
4809  // is stored and the good one wants
4810  // to be added. We ommit the warning
4811  // and just overwrite the 'bad' track
4812  if( fGTI[track->GetID()]->GetFilterMap() ||
4813  fGTI[track->GetID()]->GetTPCNcls() ){
4814  // If we come here, there's a problem
4815  printf("Warning! global track info already there!");
4816  printf(" TPCNcls track1 %u track2 %u",
4817  (fGTI[track->GetID()])->GetTPCNcls(),track->GetTPCNcls());
4818  printf(" FilterMap track1 %u track2 %u\n",
4819  (fGTI[track->GetID()])->GetFilterMap(),track->GetFilterMap());
4820  }
4821  } // Two tracks same id
4822 
4823  // // There are tracks with filter bit 0,
4824  // // do they have TPCNcls stored?
4825  // if(!track->GetFilterMap()){
4826  // printf("Filter map is zero, TPCNcls: %u\n"
4827  // ,track->GetTPCNcls());
4828  // }
4829 
4830  // Assign the pointer
4831  (fGTI[track->GetID()]) = track;
4832  (fGTIndex[track->GetID()]) = index;
4833 }
4834 //________________________________________________________________________
4836  // Sets all the pointers to zero. To be called at
4837  // the beginning or end of an event
4838  for(UShort_t i=0;i<fTrackBuffSize;i++){
4839  fGTI[i]=0;
4840  fGTIndex[i]=-9999;
4841  }
4842 }
4843 //________________________________________________________________________
4845  //
4846  // Check the mother
4847  //
4848  if(abs(history[1])==411) return 1;
4849  if(abs(history[1])==421) return 1;
4850  if(abs(history[1])==431) return 1;
4851  if(abs(history[1])==4122) return 1;
4852  if(abs(history[1])==4132) return 1;
4853  if(abs(history[1])==4232) return 1;
4854  if(abs(history[1])==4332) return 1;
4855 
4856  if(abs(history[1])==511) return 2;
4857  if(abs(history[1])==521) return 2;
4858  if(abs(history[1])==531) return 2;
4859  if(abs(history[1])==5122) return 2;
4860  if(abs(history[1])==5132) return 2;
4861  if(abs(history[1])==5232) return 2;
4862  if(abs(history[1])==5332) return 2;
4863 
4864  return 0;
4865 }
4866 //________________________________________________________________________
4868  //
4869  // Check if the particle is from charm hadrons
4870  //
4871  for(Int_t ih=0;ih<10;ih++){
4872  if(abs(history[ih])==411) return kTRUE;
4873  if(abs(history[ih])==421) return kTRUE;
4874  if(abs(history[ih])==431) return kTRUE;
4875  if(abs(history[ih])==4122) return kTRUE;
4876  if(abs(history[ih])==4132) return kTRUE;
4877  if(abs(history[ih])==4232) return kTRUE;
4878  if(abs(history[ih])==4332) return kTRUE;
4879  }
4880  return kFALSE;
4881 }
4882 //________________________________________________________________________
4884  //
4885  // Check if the particle is from Bottom hadrons
4886  //
4887  for(Int_t ih=0;ih<10;ih++){
4888  if(abs(history[ih])==511) return kTRUE;
4889  if(abs(history[ih])==521) return kTRUE;
4890  if(abs(history[ih])==531) return kTRUE;
4891  if(abs(history[ih])==5122) return kTRUE;
4892  if(abs(history[ih])==5132) return kTRUE;
4893  if(abs(history[ih])==5232) return kTRUE;
4894  if(abs(history[ih])==5332) return kTRUE;
4895  }
4896  return kFALSE;
4897 }
Int_t charge
THnSparse * fHistoEleXiMassvsElePtWS2
! e-Xi mass spectra (wrong-sign)
Int_t pdg
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
TH2F * fHistoLambdaPtvsDl
! Lambda proper life time distribution
THnSparse * fHistoElePtvsXiPtMCGen
! e-Xi spectra efficiency denominator
THnSparse * fHistoEleXiMassBFeeddownMCS1
! e-Xi mass spectra (Efficiency numerator)
Bool_t IsEventRejectedDueToNotRecoVertex() const
Definition: AliRDHFCuts.h:299
Bool_t SingleCascadeCuts(AliAODcascade *casc, Double_t *vert)
THnSparse * fHistoEleXiMassRSMixAway
! e-Xi mass spectra (right-sign)
Bool_t fMCDoPairAnalysis
MC eventtype to analyze 1: ccbar 2: bbbar.
Double_t dEtaSR125(Double_t *postrack1, Double_t *postrack2)
TH1F * fHistoBachPtMCGen
! Bachelor pT histogram (efficiency denominator)
TH2D * fHistoResponseEleXiPt
! Response function e-Xi pT <- XicPt
THnSparse * fHistoElePtvsd0RS
! e pt-d0 spectra (right-sign)
THnSparse * fHistoEleXiMassWSMix2
! e-Xi mass spectra (wrong-sign)
TH2F * fHistoElectronTPCPIDSelTOFEtaDep[8]
! TPC electron PID after TOF 3 sigma cut Eta dep
Float_t * fCorrelationVariables
! Correlation variables to be written to the tree
THnSparse * fHistoEleXiMassWSSideAway
! e-Xi mass spectra (wrong-sign)
THnSparse * fHistoEleXiMassRSMix1
! e-Xi mass spectra (right-sign)
Bool_t fWriteMCVariableTree
flag to decide whether to write the candidate variables on a tree variables
Int_t MatchToMCCascade(AliAODcascade *theCascade, Int_t pdgabscasc, Int_t *pdgDgcasc, Int_t *pdgDgv0, TClonesArray *mcArray) const
Float_t * fCandidateCascVariables
! variables to be written to the tree
THnSparse * fHistoEleXiMassvsElePtRSSide1
! e-Xi mass-ept spectra (right-sign)
TH2D * fHistoResponseEleXiPtXib
! Response function Xi pT <- True ept
THnSparse * fHistoEleXiMassRSAway
! e-Xi mass spectra (right-sign)
TH2F * fHistoLambdaPtvsDR
! Lambda decay length distribution
THnSparse * fHistoEleXiMassRSMix2
! e-Xi mass spectra (right-sign)
THnSparse * fHistoElePtvsXiPtRSMix
! e-Xi spectra (right-sign, mix)
THnSparse * fHistoEleXiMassMCS2
! e-Xi mass spectra (Efficiency numerator)
TH2D * fHistodPhiSdEtaSElectronProtonR125RSMix
! dPhiS vs dEtaS R125 RS Mix
Float_t * fCandidateMCVariables
! variables to be written to the tree
TH2D * fHistoResponseXiPtXib
! Response function Xi pT <- True ept
THnSparse * fHistoCharmElectronMCGen
! electron in mcArray (only from charmed baryon)
void SelectTrack(const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks, Bool_t *seleFlags, TClonesArray *mcArray)
THnSparse * fHistoElePtvsCutVarsRS[23]
! e pt- cut variables (Right-sign)
THnSparse * fHistoEleXiMassRSSideAway
! e-Xi mass spectra (right-sign)
void FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
TList * fOutputAll
! User Output slot 3 //analysis histograms
THnSparse * fHistoElePtvsd0MCS
! e pt-d0 spectra (right-sign)
TH2F * fHistoLambdaPtvsDRMCS
! Lambda decay length distribution (mc)
THnSparse * fHistoEleXiMassvsElePtRS2
! e-Xi mass spectra (right-sign)
THnSparse * fHistoElePtvsd0PromptMCS
! e pt-d0 spectra (right-sign)
TH2D * fHistodPhiSdEtaSElectronBachelorR125WSMix
! dPhiS vs dEtaS R125 WS Mix
THnSparse * fHistoElePtvsXiPtvsXicPtMCS
! e-Xi spectra efficiency numerator
THnSparse * fHistoEleXiMassWSSide
! e-Xi mass spectra (wrong-sign)
TTree * fMCCascVariablesTree
! tree of the candidate variables after track selection on output slot 4
const Float_t * GetCuts() const
Definition: AliRDHFCuts.h:238
void FillROOTObjects(AliAODRecoCascadeHF *elobj, AliAODcascade *casc, AliAODTrack *trk, AliAODTrack *trkpid, AliAODEvent *event, TClonesArray *mcArray)
THnSparse * fHistoEleXiMassWSMixAway
! e-Xi mass spectra (wrong-sign)
THnSparse * fHistoEleXiMassvsElePtMCGen
! e-Xi mass-ept spectra (Efficiency denominator)
THnSparse * fHistoElectronMCGen
! electron in mcArray (only from charmed baryon)
THnSparse * fHistoEleXiMassvsElePtRS
! e-Xi mass spectra (right-sign)
THnSparse * fHistoEleXiMassvsElePtMCS1
! e-Xi mass-ept spectra (Efficiency numerator)
TH2D * fHistodPhiSdEtaSElectronPionR125RSMix
! dPhiS vs dEtaS R125 RS Mix
THnSparse * fHistoEleXiMassRS
! e-Xi mass spectra (right-sign)
THnSparse * fHistoElePtvsEtaWSMix
! e spectra (wrong-sign, mix)
Bool_t TagConversionsSameSign(AliAODTrack *etrk, Int_t *id2index, AliAODEvent *evt, Int_t ntrk, Double_t &minmass)
THnSparse * fHistoEleXiMassvsElePtRSMix2
! e-Xi mass-ept spectra (right-sign)
Int_t MatchToMC(AliAODRecoCascadeHF *elobj, TClonesArray *mcArray, Int_t *pdgarray_ele, Int_t *pdgarray_casc, Int_t *labelarray_ele, Int_t *labelarray_casc, Int_t &ngen_ele, Int_t &ngen_casc)
THnSparse * fHistoElePtvsXiPtWSMix
! e-Xi spectra (wrong-sign, mix)
TTree * fCascVariablesTree
! tree of the candidate variables after track selection on output slot 4
THnSparse * fHistoEleXiMassvsElePtWSMix2
! e-Xi mass-ept spectra (wrong-sign)
virtual void UserCreateOutputObjects()
Implementation of interface methods.
THnSparse * fHistoElectronEtaTotal
! Number of electrons from eta
THnSparse * fHistoElePtvsd0WS
! e pt-d0 spectra (wrong-sign)
Float_t * fCandidateEleVariables
! variables to be written to the tree
Bool_t TagConversions(AliAODTrack *etrk, Int_t *id2index, AliAODEvent *evt, Int_t ntrk, Double_t &minmass)
TTree * fMCEleVariablesTree
! tree of the candidate variables after track selection on output slot 4
Double_t GetMaxVtxZ() const
Definition: AliRDHFCuts.h:241
THnSparse * fHistoElectronPi0Total
! Number of electrons from pi0
THnSparse * fHistoEleXiMassvsElePtWSSide
! e-Xi mass-ept spectra (wrong-sign)
TObjArray * fCascadeCutVarsArray2
array of RDHF cut information
void FillMCROOTObjects(AliAODMCParticle *part, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype)
THnSparse * fHistoEleXiMassPromptMCS1
! e-Xi mass spectra (Efficiency numerator)
THnSparse * fHistoElePtvsEtaMCGen
! e spectra efficiency denominator
THnSparse * fHistoEleXiMassMCGen
! e-Xi mass spectra (Efficiency denominator)
AliAODPidHF * GetPidHF() const
Definition: AliRDHFCuts.h:231
THnSparse * fHistoElePtvsEtaMCS
! e spectra efficiency numerator
TTree * fMCVariablesTree
! tree of the candidate variables after track selection on output slot 4
THnSparse * fHistoEleXiMassWS
! e-Xi mass spectra (wrong-sign)
THnSparse * fHistoElePtvsXiPtMCS
! e-Xi spectra efficiency numerator
TH2F * fHistoElectronTOFPIDSelTPC
! TOF electron PID after TPC cut
THnSparse * fHistoElePtvsCutVarsWS[23]
! e pt- cut variables (Wrong-sign)
THnSparse * fHistoEleXiMassXibMCS2
! e-Xi mass spectra (Efficiency numerator)
const Double_t etamin
TH2D * fHistodPhiSdEtaSElectronProtonR125WSMix
! dPhiS vs dEtaS R125 WS Mix
THnSparse * fHistoEleXiMassPromptMCS
! e-Xi mass spectra (Efficiency numerator)
TH1F * fHistoBachPtMCS
! Bachelor pT histogram (efficiency numerator)
void MakeAnalysis(AliAODEvent *aod, TClonesArray *mcArray)
AliAODVertex * PrimaryVertex(const TObjArray *trkArray, AliVEvent *event)
THnSparse * fHistoEleXiMassRSSide2
! e-Xi mass spectra (right-sign)
TH2F * fHistoLambdaPtvsDlMCS
! Lambda proper life time distribution (mc)
THnSparse * fHistoEleXiMassvsElePtMCS
! e-Xi mass-ept spectra (Efficiency numerator)
THnSparse * fHistoEleXiMassvsElePtMCS2
! e-Xi mass-ept spectra (Efficiency numerator)
void FillMCCascROOTObjects(AliAODMCParticle *mccpart, TClonesArray *mcArray)
void FillMCGenPairROOTObjects(AliAODMCParticle *mcparte, AliAODMCParticle *mcpartv, TClonesArray *mcArray)
THnSparse * fHistoElePtvsCutVarsMCS[23]
! e pt- cut variables (MCS)
THnSparse * fHistoXiMCGen
! Xi in mcArray (only from charmed baryon)
THnSparse * fHistoBottomElectronMCGen
! electron in mcArray (only from charmed baryon)
THnSparse * fHistoElePtvsXiPtRS
! e-Xi spectra (right-sign)
const UShort_t fTrackBuffSize
Array of integers to keep the index of tpc only track.
THnSparse * fHistoEleXiMassvsElePtRSMix1
! e-Xi mass-ept spectra (right-sign)
THnSparse * fHistoEleXiMassvsElePtWSMix1
! e-Xi mass-ept spectra (wrong-sign)
THnSparse * fHistoEleXiMassvsElePtMCGen1
! e-Xi mass-ept spectra (Efficiency denominator)
TH2F * fHistoElePtMCS
! e spectra (Efficiency numerator)
THnSparse * fHistoEleXiMassWSMix1Away
! e-Xi mass spectra (wrong-sign)
void SetSftPosR125(AliAODTrack *track, Double_t bfield, Double_t priVtx[3], Double_t *XSftR125)
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
TH2F * fHistoElectronTOFSelPID
! TOF electron PID after selection
Float_t * fCandidateMCCascVariables
! variables to be written to the tree
Float_t * fCandidateMCGenPairVariables
! variables to be written to the tree
AliAODTrack * GetBachelor() const
Float_t * fCandidateMCEleVariables
! variables to be written to the tree
THnSparse * fHistoEleXiMassMCS
! e-Xi mass spectra (Efficiency numerator)
TObjArray * fCascadeTracks2
array of xi+compatible tracks
TTree * fEleVariablesTree
flag to decide whether to write the candidate variables on a tree variables
AliESDtrackCuts * GetTrackCuts() const
Definition: AliRDHFCuts.h:246
TObjArray * fElectronTracks
unique event id for mixed event check
TH1F * fCEvents
! Histogram to check selected events
void SetProngIDs(Int_t nIDs, UShort_t *id)
TH2F * fHistoElectronTPCPIDSelTOFSmallEta
! TPC electron PID after TOF 3 sigma cut (|eta|<0.6)
Definition: