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