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