AliPhysics  5dd2c10 (5dd2c10)
 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  fReconstructPrimVert(kFALSE),
109  fIsMB(kFALSE),
110  fIsSemi(kFALSE),
111  fIsCent(kFALSE),
112  fIsINT7(kFALSE),
113  fIsEMC7(kFALSE),
114  fCandidateVariables(),
115  fCandidateEleVariables(),
116  fCandidateCascVariables(),
117  fCandidateMCVariables(),
118  fCandidateMCEleVariables(),
119  fCandidateMCCascVariables(),
120  fVtx1(0),
121  fV1(0),
122  fVtxZ(0),
123  fBzkG(0),
124  fCentrality(0),
125  fRunNumber(0),
126  fTriggerCheck(0),
127  fUseCentralityV0M(kFALSE),
128  fEvNumberCounter(0),
129  fHistoEleXiMass(0),
130  fHistoEleXiMassRS(0),
131  fHistoEleXiMassWS(0),
132  fHistoEleXiMassRSMix(0),
133  fHistoEleXiMassWSMix(0),
134  fHistoEleXiMassRSSide(0),
135  fHistoEleXiMassWSSide(0),
136  fHistoEleXiMassvsElePtRS(0),
137  fHistoEleXiMassvsElePtWS(0),
138  fHistoEleXiMassvsElePtRSMix(0),
139  fHistoEleXiMassvsElePtWSMix(0),
140  fHistoEleXiMassvsElePtRSSide(0),
141  fHistoEleXiMassvsElePtWSSide(0),
142  fHistoEleXiMassvsElePtRS1(0),
143  fHistoEleXiMassvsElePtWS1(0),
144  fHistoEleXiMassvsElePtRSMix1(0),
145  fHistoEleXiMassvsElePtWSMix1(0),
146  fHistoEleXiMassvsElePtRSSide1(0),
147  fHistoEleXiMassvsElePtWSSide1(0),
148  fHistoEleXiMassvsElePtRS2(0),
149  fHistoEleXiMassvsElePtWS2(0),
150  fHistoEleXiMassvsElePtRSMix2(0),
151  fHistoEleXiMassvsElePtWSMix2(0),
152  fHistoEleXiMassvsElePtRSSide2(0),
153  fHistoEleXiMassvsElePtWSSide2(0),
154  fHistoElePtRS(0),
155  fHistoElePtWS(0),
156  fHistoElePtRSMix(0),
157  fHistoElePtWSMix(0),
158  fHistoEleXiMassMCS(0),
159  fHistoEleXiMassMCGen(0),
160  fHistoEleXiMassvsElePtMCS(0),
161  fHistoEleXiMassvsElePtMCGen(0),
162  fHistoEleXiMassvsElePtMCS1(0),
163  fHistoEleXiMassvsElePtMCGen1(0),
164  fHistoEleXiMassvsElePtMCS2(0),
165  fHistoEleXiMassvsElePtMCGen2(0),
166  fHistoElePtMCS(0),
167  fHistoElePtMCGen(0),
168  fHistoElePtvsEtaRS(0),
169  fHistoElePtvsEtaWS(0),
170  fHistoElePtvsEtaRSMix(0),
171  fHistoElePtvsEtaWSMix(0),
172  fHistoElePtvsEtaMCS(0),
173  fHistoElePtvsEtaMCGen(0),
174  fHistoElePtvsXiPtRS(0),
175  fHistoElePtvsXiPtWS(0),
176  fHistoElePtvsXiPtRSMix(0),
177  fHistoElePtvsXiPtWSMix(0),
178  fHistoElePtvsXiPtMCS(0),
179  fHistoElePtvsXiPtvsXicPtMCS(0),
180  fHistoElePtvsXiPtMCGen(0),
181  fHistoElePtvsXiPtvsXicPtMCGen(0),
182  fHistoElePtvsXiPtMCXicGen(0),
183  fHistoElePtvsd0RS(0),
184  fHistoElePtvsd0WS(0),
185  fHistoElePtvsd0RSMix(0),
186  fHistoElePtvsd0WSMix(0),
187  fHistoElePtvsd0MCS(0),
188  fHistoElePtvsd0PromptMCS(0),
189  fHistoElePtvsd0BFeeddownMCS(0),
190  fHistoBachPt(0),
191  fHistoBachPtMCS(0),
192  fHistoBachPtMCGen(0),
193  fHistod0Bach(0),
194  fHistoXiMassvsPt(0),
195  fHistoXiMassvsPtMCS(0),
196  fHistoXiMassvsPtMCGen(0),
197  fHistoOmegaMassvsPt(0),
198  fHistoElectronTPCPID(0),
199  fHistoElectronTOFPID(0),
200  fHistoElectronTPCSelPID(0),
201  fHistoElectronTOFSelPID(0),
202  fHistoElectronTPCPIDSelTOF(0),
203  fHistoElectronTOFPIDSelTPC(0),
204  fHistoElectronTPCPIDSelTOFSmallEta(0),
205  fHistoElectronTPCPIDSelTOFLargeEta(0),
206  fHistoElectronQovPtvsPhi(0),
207  fHistoXiQovPtvsPhi(0),
208  fHistoXicMCGen(0),
209  fHistoXicMCGen1(0),
210  fHistoXicMCGen2(0),
211  fHistoXicElectronMCGen(0),
212  fHistoXicElectronMCGen1(0),
213  fHistoXicElectronMCGen2(0),
214  fHistoElectronMCGen(0),
215  fHistoXiMCGen(0),
216  fCounter(0),
217  fHistonEvtvsRunNumber(0),
218  fHistonElevsRunNumber(0),
219  fHistonXivsRunNumber(0),
220  fDoEventMixing(0),
221  fNumberOfEventsForMixing (5),
222  fNzVtxBins (0),
223  fNCentBins (0),
224  fNOfPools(1),
225  fEventBuffer(0x0),
226  fEventInfo(0x0),
227  fElectronTracks(0x0),
228  fCascadeTracks1(0x0),
229  fCascadeTracks2(0x0)
230 {
231  //
232  // Default Constructor.
233  //
234  for(Int_t i=0;i<23;i++){
235  fHistoElePtvsCutVarsRS[i] = 0;
236  fHistoElePtvsCutVarsWS[i] = 0;
238  }
239  for(Int_t i=0;i<8;i++){
241  }
242 }
243 
244 //___________________________________________________________________________
247  Bool_t writeVariableTree) :
248  AliAnalysisTaskSE(name),
249  fUseMCInfo(kFALSE),
250  fOutput(0),
251  fOutputAll(0),
252  fListCuts(0),
253  fCEvents(0),
254  fHTrigger(0),
255  fHCentrality(0),
256  fAnalCuts(analCuts),
257  fIsEventSelected(kFALSE),
258  fWriteVariableTree(writeVariableTree),
259  fWriteEachVariableTree(kFALSE),
260  fWriteMCVariableTree(kFALSE),
261  fVariablesTree(0),
262  fEleVariablesTree(0),
263  fCascVariablesTree(0),
264  fMCVariablesTree(0),
265  fMCEleVariablesTree(0),
266  fMCCascVariablesTree(0),
267  fReconstructPrimVert(kFALSE),
268  fIsMB(kFALSE),
269  fIsSemi(kFALSE),
270  fIsCent(kFALSE),
271  fIsINT7(kFALSE),
272  fIsEMC7(kFALSE),
273  fCandidateVariables(),
274  fCandidateEleVariables(),
275  fCandidateCascVariables(),
276  fCandidateMCVariables(),
277  fCandidateMCEleVariables(),
278  fCandidateMCCascVariables(),
279  fVtx1(0),
280  fV1(0),
281  fVtxZ(0),
282  fBzkG(0),
283  fCentrality(0),
284  fRunNumber(0),
285  fTriggerCheck(0),
286  fUseCentralityV0M(kFALSE),
287  fEvNumberCounter(0),
288  fHistoEleXiMass(0),
289  fHistoEleXiMassRS(0),
290  fHistoEleXiMassWS(0),
291  fHistoEleXiMassRSMix(0),
292  fHistoEleXiMassWSMix(0),
293  fHistoEleXiMassRSSide(0),
294  fHistoEleXiMassWSSide(0),
295  fHistoEleXiMassvsElePtRS(0),
296  fHistoEleXiMassvsElePtWS(0),
297  fHistoEleXiMassvsElePtRSMix(0),
298  fHistoEleXiMassvsElePtWSMix(0),
299  fHistoEleXiMassvsElePtRSSide(0),
300  fHistoEleXiMassvsElePtWSSide(0),
301  fHistoEleXiMassvsElePtRS1(0),
302  fHistoEleXiMassvsElePtWS1(0),
303  fHistoEleXiMassvsElePtRSMix1(0),
304  fHistoEleXiMassvsElePtWSMix1(0),
305  fHistoEleXiMassvsElePtRSSide1(0),
306  fHistoEleXiMassvsElePtWSSide1(0),
307  fHistoEleXiMassvsElePtRS2(0),
308  fHistoEleXiMassvsElePtWS2(0),
309  fHistoEleXiMassvsElePtRSMix2(0),
310  fHistoEleXiMassvsElePtWSMix2(0),
311  fHistoEleXiMassvsElePtRSSide2(0),
312  fHistoEleXiMassvsElePtWSSide2(0),
313  fHistoElePtRS(0),
314  fHistoElePtWS(0),
315  fHistoElePtRSMix(0),
316  fHistoElePtWSMix(0),
317  fHistoEleXiMassMCS(0),
318  fHistoEleXiMassMCGen(0),
319  fHistoEleXiMassvsElePtMCS(0),
320  fHistoEleXiMassvsElePtMCGen(0),
321  fHistoEleXiMassvsElePtMCS1(0),
322  fHistoEleXiMassvsElePtMCGen1(0),
323  fHistoEleXiMassvsElePtMCS2(0),
324  fHistoEleXiMassvsElePtMCGen2(0),
325  fHistoElePtMCS(0),
326  fHistoElePtMCGen(0),
327  fHistoElePtvsEtaRS(0),
328  fHistoElePtvsEtaWS(0),
329  fHistoElePtvsEtaRSMix(0),
330  fHistoElePtvsEtaWSMix(0),
331  fHistoElePtvsEtaMCS(0),
332  fHistoElePtvsEtaMCGen(0),
333  fHistoElePtvsXiPtRS(0),
334  fHistoElePtvsXiPtWS(0),
335  fHistoElePtvsXiPtRSMix(0),
336  fHistoElePtvsXiPtWSMix(0),
337  fHistoElePtvsXiPtMCS(0),
338  fHistoElePtvsXiPtvsXicPtMCS(0),
339  fHistoElePtvsXiPtMCGen(0),
340  fHistoElePtvsXiPtvsXicPtMCGen(0),
341  fHistoElePtvsXiPtMCXicGen(0),
342  fHistoElePtvsd0RS(0),
343  fHistoElePtvsd0WS(0),
344  fHistoElePtvsd0RSMix(0),
345  fHistoElePtvsd0WSMix(0),
346  fHistoElePtvsd0MCS(0),
347  fHistoElePtvsd0PromptMCS(0),
348  fHistoElePtvsd0BFeeddownMCS(0),
349  fHistoBachPt(0),
350  fHistoBachPtMCS(0),
351  fHistoBachPtMCGen(0),
352  fHistod0Bach(0),
353  fHistoXiMassvsPt(0),
354  fHistoXiMassvsPtMCS(0),
355  fHistoXiMassvsPtMCGen(0),
356  fHistoOmegaMassvsPt(0),
357  fHistoElectronTPCPID(0),
358  fHistoElectronTOFPID(0),
359  fHistoElectronTPCSelPID(0),
360  fHistoElectronTOFSelPID(0),
361  fHistoElectronTPCPIDSelTOF(0),
362  fHistoElectronTOFPIDSelTPC(0),
363  fHistoElectronTPCPIDSelTOFSmallEta(0),
364  fHistoElectronTPCPIDSelTOFLargeEta(0),
365  fHistoElectronQovPtvsPhi(0),
366  fHistoXiQovPtvsPhi(0),
367  fHistoXicMCGen(0),
368  fHistoXicMCGen1(0),
369  fHistoXicMCGen2(0),
370  fHistoXicElectronMCGen(0),
371  fHistoXicElectronMCGen1(0),
372  fHistoXicElectronMCGen2(0),
373  fHistoElectronMCGen(0),
374  fHistoXiMCGen(0),
375  fCounter(0),
376  fHistonEvtvsRunNumber(0),
377  fHistonElevsRunNumber(0),
378  fHistonXivsRunNumber(0),
379  fDoEventMixing(0),
380  fNumberOfEventsForMixing (5),
381  fNzVtxBins (0),
382  fNCentBins (0),
383  fNOfPools(1),
384  fEventBuffer(0x0),
385  fEventInfo(0x0),
386  fElectronTracks(0x0),
387  fCascadeTracks1(0x0),
388  fCascadeTracks2(0x0)
389 {
390  //
391  // Constructor. Initialization of Inputs and Outputs
392  //
393  Info("AliAnalysisTaskSEXic2eleXifromAODtracks","Calling Constructor");
394 
395  for(Int_t i=0;i<23;i++){
396  fHistoElePtvsCutVarsRS[i] = 0;
397  fHistoElePtvsCutVarsWS[i] = 0;
399  }
400  for(Int_t i=0;i<8;i++){
402  }
403 
404  DefineOutput(1,TList::Class()); //conters
405  DefineOutput(2,TList::Class());
406  DefineOutput(3,TList::Class()); //conters
407  DefineOutput(4,TTree::Class()); //My private output
408  DefineOutput(5,TTree::Class()); //My private output
409  DefineOutput(6,TTree::Class()); //My private output
410  DefineOutput(7,TTree::Class()); //My private output
411  DefineOutput(8,AliNormalizationCounter::Class());
412  DefineOutput(9,TTree::Class()); //My private output
413  DefineOutput(10,TTree::Class()); //My private output
414 }
415 
416 //___________________________________________________________________________
418  //
419  // destructor
420  //
421  Info("~AliAnalysisTaskSEXic2eleXifromAODtracks","Calling Destructor");
422 
423  if (fOutput) {
424  delete fOutput;
425  fOutput = 0;
426  }
427 
428  if (fOutputAll) {
429  delete fOutputAll;
430  fOutputAll = 0;
431  }
432 
433  if (fListCuts) {
434  delete fListCuts;
435  fListCuts = 0;
436  }
437 
438 
439  if (fAnalCuts) {
440  delete fAnalCuts;
441  fAnalCuts = 0;
442  }
443 
444  if (fVariablesTree) {
445  delete fVariablesTree;
446  fVariablesTree = 0;
447  }
448  if (fEleVariablesTree) {
449  delete fEleVariablesTree;
450  fEleVariablesTree = 0;
451  }
452  if (fCascVariablesTree) {
453  delete fCascVariablesTree;
454  fCascVariablesTree = 0;
455  }
456  if (fMCVariablesTree) {
457  delete fMCVariablesTree;
458  fMCVariablesTree = 0;
459  }
460  if (fMCEleVariablesTree) {
461  delete fMCEleVariablesTree;
463  }
464  if (fMCCascVariablesTree) {
465  delete fMCCascVariablesTree;
467  }
468  if(fCounter){
469  delete fCounter;
470  fCounter = 0;
471  }
472 
473  if(fElectronTracks) fElectronTracks->Delete();
474  delete fElectronTracks;
475  if(fCascadeTracks1) fCascadeTracks1->Delete();
476  delete fCascadeTracks1;
477  if(fCascadeTracks2) fCascadeTracks2->Delete();
478  delete fCascadeTracks2;
479  if(fEventBuffer){
480  for(Int_t i=0; i<fNOfPools; i++) delete fEventBuffer[i];
481  delete fEventBuffer;
482  }
483  delete fEventInfo;
484 }
485 
486 //_________________________________________________
488  //
489  // Initialization
490  //
491  //
492 
493  fIsEventSelected=kFALSE;
494 
495  if (fDebug > 1) AliInfo("Init");
496 
497  fListCuts = new TList();
498  fListCuts->SetOwner();
499  fListCuts->SetName("ListCuts");
501  PostData(2,fListCuts);
502 
503  return;
504 }
505 
506 //_________________________________________________
508 {
509  //
510  // UserExec
511  //
512 
513  if (!fInputEvent) {
514  AliError("NO EVENT FOUND!");
515  return;
516  }
517  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
518 
519  fCEvents->Fill(1);
521 
522  //------------------------------------------------
523  // First check if the event has proper B
524  //------------------------------------------------
525  fBzkG = (Double_t)aodEvent->GetMagneticField();
526  AliKFParticle::SetField(fBzkG);
527  if (TMath::Abs(fBzkG)<0.001) {
528  return;
529  }
530  fCEvents->Fill(2);
531 
534 
535  //------------------------------------------------
536  // MC analysis setting
537  //------------------------------------------------
538  TClonesArray *mcArray = 0;
539  AliAODMCHeader *mcHeader=0;
540  if (fUseMCInfo) {
541  // MC array need for maching
542  mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
543  if (!mcArray) {
544  AliError("Could not find Monte-Carlo in AOD");
545  return;
546  }
547  fCEvents->Fill(6); // in case of MC events
548 
549  // load MC header
550  mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
551  if (!mcHeader) {
552  AliError("AliAnalysisTaskSEXic2eleXifromAODtracks::UserExec: MC header branch not found!\n");
553  return;
554  }
555  fCEvents->Fill(7); // in case of MC events
556 
557  Double_t zMCVertex = mcHeader->GetVtxZ();
558  if (TMath::Abs(zMCVertex) > fAnalCuts->GetMaxVtxZ()) {
559  AliDebug(2,Form("Event rejected: abs(zVtxMC)=%f > fAnalCuts->GetMaxVtxZ()=%f",zMCVertex,fAnalCuts->GetMaxVtxZ()));
560  return;
561  } else {
562  fCEvents->Fill(17); // in case of MC events
563  }
564  if ((TMath::Abs(zMCVertex) < fAnalCuts->GetMaxVtxZ()) && (!fAnalCuts->IsEventRejectedDuePhysicsSelection()) && (!fAnalCuts->IsEventRejectedDueToTrigger())) {
565  MakeMCAnalysis(mcArray);
566  }
567  }
568 
569  //------------------------------------------------
570  // Event selection
571  //------------------------------------------------
572  fVtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
573  if (!fVtx1) return;
574 
575  Double_t pos[3],cov[6];
576  fVtx1->GetXYZ(pos);
577  fVtx1->GetCovarianceMatrix(cov);
578  fV1 = new AliESDVertex(pos,cov,100.,100,fVtx1->GetName());
579  fVtxZ = pos[2];
580 
581  Bool_t fIsTriggerNotOK = fAnalCuts->IsEventRejectedDueToTrigger();
582  Bool_t fIsPhysSelNotOK = fAnalCuts->IsEventRejectedDuePhysicsSelection();
583  Bool_t fIsNoVertex = fAnalCuts->IsEventRejectedDueToNotRecoVertex();
584  if(!fIsTriggerNotOK && !fIsPhysSelNotOK && !fIsNoVertex && fabs(fVtx1->GetZ())<fAnalCuts->GetMaxVtxZ()) fCEvents->Fill(3);
585  if(!fIsEventSelected) {
586  delete fV1;
587  return;
588  }
589  fCEvents->Fill(4);
590 
591  fIsMB=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kMB)==(AliVEvent::kMB);
592  fIsSemi=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kSemiCentral)==(AliVEvent::kSemiCentral);
593  fIsCent=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kCentral)==(AliVEvent::kCentral);
594  fIsINT7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kINT7)==(AliVEvent::kINT7);
595  fIsEMC7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kEMC7)==(AliVEvent::kEMC7);
597  if(fIsMB) fHTrigger->Fill(1);
598  if(fIsSemi) fHTrigger->Fill(2);
599  if(fIsCent) fHTrigger->Fill(3);
600  if(fIsINT7) fHTrigger->Fill(4);
601  if(fIsEMC7) fHTrigger->Fill(5);
602  if(fIsMB|fIsSemi|fIsCent) fHTrigger->Fill(7);
603  if(fIsINT7|fIsEMC7) fHTrigger->Fill(8);
604  if(fIsMB&fIsSemi) fHTrigger->Fill(10);
605  if(fIsMB&fIsCent) fHTrigger->Fill(11);
606  if(fIsINT7&fIsEMC7) fHTrigger->Fill(12);
607 
608  if(fUseCentralityV0M){
609  AliCentrality *cent = aodEvent->GetCentrality();
610  fCentrality = cent->GetCentralityPercentile("V0M");
611  }else{
612  fCentrality = 1.;
613  }
614  if(fCentrality<0.||fCentrality>100.-0.0000001) {
615  delete fV1;
616  return;
617  }
618  fHCentrality->Fill(fCentrality);
619  fRunNumber = aodEvent->GetRunNumber();
620 
621  Int_t runnumber_offset = 0;
622  Int_t runnumber = aodEvent->GetRunNumber();
623  if(runnumber<=131000&&runnumber>=114000){
624  runnumber_offset = 114000;//lhc10bcde
625  }else if(runnumber<=196000&&runnumber>=195000){
626  runnumber_offset = 195000;//lhc13bc
627  }else if(runnumber<=170593&&runnumber>=167902){
628  runnumber_offset = 167902;//lhc11h
629  }
630  fHistonEvtvsRunNumber->Fill(runnumber-runnumber_offset,1.);
631 
632  //------------------------------------------------
633  // Check if the event has v0 candidate
634  //------------------------------------------------
635  //Int_t nv0 = aodEvent->GetNumberOfV0s();
636  fCEvents->Fill(5);
637 
638 
639  //------------------------------------------------
640  // Main analysis done in this function
641  //------------------------------------------------
642  MakeAnalysis(aodEvent,mcArray);
643 
644 
645  PostData(1,fOutput);
646  PostData(3,fOutputAll);
647  PostData(4,fVariablesTree);
648  PostData(5,fEleVariablesTree);
649  PostData(6,fCascVariablesTree);
650  PostData(7,fMCVariablesTree);
651  PostData(8,fCounter);
652  PostData(9,fMCEleVariablesTree);
653  PostData(10,fMCCascVariablesTree);
654 
655  fIsEventSelected=kFALSE;
656 
657  delete fV1;
658  return;
659 }
660 
661 //________________________________________ terminate ___________________________
663 {
664  // The Terminate() function is the last function to be called during
665  // a query. It always runs on the client, it can be used to present
666  // the results graphically or save the results to file.
667 
668  //AliInfo("Terminate","");
669  AliAnalysisTaskSE::Terminate();
670 
671  fOutput = dynamic_cast<TList*> (GetOutputData(1));
672  if (!fOutput) {
673  AliError("fOutput not available");
674  return;
675  }
676 
677  fOutputAll = dynamic_cast<TList*> (GetOutputData(3));
678  if (!fOutputAll) {
679  AliError("fOutputAll not available");
680  return;
681  }
682 
683  return;
684 }
685 
686 //___________________________________________________________________________
688 {
689  //
690  // UserCreateOutputObject
691  //
692  //AliInfo(Form("CreateOutputObjects of task %s\n", GetName()));
693 
694  //------------------------------------------------
695  // output object setting
696  //------------------------------------------------
697  fOutput = new TList();
698  fOutput->SetOwner();
699  fOutput->SetName("chist0");
700  DefineGeneralHistograms(); // define general histograms
701  PostData(1,fOutput);
702 
703  fOutputAll = new TList();
704  fOutputAll->SetOwner();
705  fOutputAll->SetName("anahisto");
706  DefineAnalysisHistograms(); // define general histograms
707  PostData(3,fOutputAll);
708 
710  PostData(4,fVariablesTree);
711 
713  PostData(5,fEleVariablesTree);
714 
716  PostData(6,fCascVariablesTree);
717 
719  PostData(7,fMCVariablesTree);
720 
722  PostData(9,fMCEleVariablesTree);
723 
725  PostData(10,fMCCascVariablesTree);
726 
727  //Counter for Normalization
728  TString normName="NormalizationCounter";
729  AliAnalysisDataContainer *cont = GetOutputSlot(8)->GetContainer();
730  if(cont)normName=(TString)cont->GetName();
731  fCounter = new AliNormalizationCounter(normName.Data());
732  fCounter->Init();
733  PostData(8,fCounter);
734 
735  if(fDoEventMixing){
736  fElectronTracks = new TObjArray();
737  fElectronTracks->SetOwner();
738  fCascadeTracks1 = new TObjArray();
739  fCascadeTracks1->SetOwner();
740  fCascadeTracks2 = new TObjArray();
741  fCascadeTracks2->SetOwner();
742 
744  fEventBuffer = new TTree*[fNOfPools];
745  for(Int_t i=0; i<fNOfPools; i++){
746  fEventBuffer[i]=new TTree(Form("EventBuffer_%d",i), "Temporary buffer for event mixing");
747  fEventBuffer[i]->Branch("zVertex", &fVtxZ);
748  fEventBuffer[i]->Branch("centrality", &fCentrality);
749  fEventBuffer[i]->Branch("eventInfo", "TObjString",&fEventInfo);
750  fEventBuffer[i]->Branch("c1array", "TObjArray", &fCascadeTracks1);
751  fEventBuffer[i]->Branch("c2array", "TObjArray", &fCascadeTracks2);
752  }
753  }
754 
755 
756  return;
757 }
758 
759 //-------------------------------------------------------------------------------
761 (
762  AliAODEvent *aodEvent, TClonesArray *mcArray
763  )
764 {
765  //
766  // Main Analysis part
767  //
768  //------------------------------------------------
769  // Select good track before hand to save time
770  //------------------------------------------------
771  if(fDoEventMixing && fElectronTracks) fElectronTracks->Delete();
772  if(fDoEventMixing && fCascadeTracks1) fCascadeTracks1->Delete();
773  if(fDoEventMixing && fCascadeTracks2) fCascadeTracks2->Delete();
774 
775  Int_t nCascs= aodEvent->GetNumberOfCascades();
776  Int_t nTracks= aodEvent->GetNumberOfTracks();
777 
778  Bool_t seleTrkFlags[nTracks];
779  Int_t nSeleTrks=0;
780  SelectTrack(aodEvent,nTracks,nSeleTrks,seleTrkFlags,mcArray);
781 
782  Bool_t seleCascFlags[nCascs];
783  Int_t nSeleCasc=0;
784  SelectCascade(aodEvent,nCascs,nSeleCasc,seleCascFlags,mcArray);
785 
786  Int_t runnumber_offset = 0;
787  Int_t runnumber = aodEvent->GetRunNumber();
788  if(runnumber<=131000&&runnumber>=114000){
789  runnumber_offset = 114000;//lhc10bcde
790  }else if(runnumber<=196000&&runnumber>=195000){
791  runnumber_offset = 195000;//lhc13bc
792  }else if(runnumber<=170593&&runnumber>=167902){
793  runnumber_offset = 167902;//lhc11h
794  }
795  fHistonElevsRunNumber->Fill(runnumber-runnumber_offset,nSeleTrks);
796  fHistonXivsRunNumber->Fill(runnumber-runnumber_offset,nSeleCasc);
797 
798  //------------------------------------------------
799  // Cascade loop
800  //------------------------------------------------
801  for (Int_t icasc = 0; icasc<nCascs; icasc++) {
802  if(!seleCascFlags[icasc]) continue;
803  AliAODcascade *casc = aodEvent->GetCascade(icasc);
804  if(!casc) continue;
805 
806  AliAODTrack *cptrack = (AliAODTrack*)(casc->GetDaughter(0));
807  AliAODTrack *cntrack = (AliAODTrack*)(casc->GetDaughter(1));
808  AliAODTrack *cbtrack = (AliAODTrack*)(casc->GetDecayVertexXi()->GetDaughter(0));
809 
810  //------------------------------------------------
811  // track loop
812  //------------------------------------------------
813  for (Int_t itrk = 0; itrk<nTracks; itrk++) {
814  if(!seleTrkFlags[itrk]) continue;
815  AliAODTrack *trk = (AliAODTrack*)aodEvent->GetTrack(itrk);
816  if(trk->GetID()<0) continue;
817 
818  Int_t cpid = cptrack->GetID();
819  Int_t cnid = cntrack->GetID();
820  Int_t cbid = cbtrack->GetID();
821  Int_t lpid = trk->GetID();
822  if((cpid==lpid)||(cnid==lpid)||(cbid==lpid)) continue;
823 
824  //if(!fAnalCuts->SelectWithRoughCuts(v0,trk)) continue;
825 
826  AliAODVertex *secVert = ReconstructSecondaryVertex(casc,trk,aodEvent);//Fake, prim vertex is just used as secondary vertex. place holder for future
827  if(!secVert) continue;
828 
829  AliAODRecoCascadeHF *exobj = MakeCascadeHF(casc,trk,aodEvent,secVert);
830  if(!exobj) {
831  continue;
832  }
833 
834  FillROOTObjects(exobj, casc,trk,mcArray);
835 
836  exobj->GetSecondaryVtx()->RemoveDaughters();
837  exobj->UnsetOwnPrimaryVtx();
838  delete exobj;exobj=NULL;
839  delete secVert;
840  }
841  }
842 
843  if(fDoEventMixing){
844  fEventInfo->SetString(Form("Ev%d_esd%d_E%d_C%d",AliAnalysisManager::GetAnalysisManager()->GetNcalls(),((AliAODHeader*)aodEvent->GetHeader())->GetEventNumberESDFile(),fElectronTracks->GetEntries(),fCascadeTracks1->GetEntries()+fCascadeTracks2->GetEntries()));
845  Int_t ind=GetPoolIndex(fVtxZ,fCentrality);
846  if(ind>=0 && ind<fNOfPools){
847  if(fEventBuffer[ind]->GetEntries() >= fNumberOfEventsForMixing){
848  DoEventMixingWithPools(ind);
849  if(fEventBuffer[ind]->GetEntries() >= 20*fNumberOfEventsForMixing){
850  ResetPool(ind);
851  }
852  }
853  fEventBuffer[ind]->Fill();
854  }
855  }
856 }
857 
858 
861 {
862  //
863  // Define tree variables
864  //
865 
866  const char* nameoutput = GetOutputSlot(4)->GetContainer()->GetName();
867  fVariablesTree = new TTree(nameoutput,"Candidates variables tree");
868  Int_t nVar = 90;
869  fCandidateVariables = new Float_t [nVar];
870  TString * fCandidateVariableNames = new TString[nVar];
871 
872  fCandidateVariableNames[ 0]="Centrality";
873  fCandidateVariableNames[ 1]="InvMassEleXi";
874  fCandidateVariableNames[ 2]="EleXiPt";
875  fCandidateVariableNames[ 3]="EleXiPx";
876  fCandidateVariableNames[ 4]="EleXiPy";
877  fCandidateVariableNames[ 5]="EleXiPz";
878  fCandidateVariableNames[ 6]="ElePx";
879  fCandidateVariableNames[ 7]="ElePy";
880  fCandidateVariableNames[ 8]="ElePz";
881  fCandidateVariableNames[ 9]="XiPx";
882  fCandidateVariableNames[10]="XiPy";
883  fCandidateVariableNames[11]="XiPz";
884  fCandidateVariableNames[12]="XiCharge";
885  fCandidateVariableNames[13]="MassXi";
886  fCandidateVariableNames[14]="MassLambda";
887  fCandidateVariableNames[15]="Eled0";
888  fCandidateVariableNames[16]="Xid0";
889  fCandidateVariableNames[17]="nSigmaTPCele";
890  fCandidateVariableNames[18]="nSigmaTOFele";
891  fCandidateVariableNames[19]="nSigmaTPCpr_etrk";
892  fCandidateVariableNames[20]="nSigmaTOFpr_etrk";
893  fCandidateVariableNames[21]="nSigmaTPCka_etrk";
894  fCandidateVariableNames[22]="nSigmaTOFka_etrk";
895  fCandidateVariableNames[23]="nSigmaTPCv0pr";
896  fCandidateVariableNames[24]="nSigmaTOFv0pr";
897  fCandidateVariableNames[25]="nSigmaTPCv0pi";
898  fCandidateVariableNames[26]="nSigmaTOFv0pi";
899  fCandidateVariableNames[27]="nSigmaTPCbachpi";
900  fCandidateVariableNames[28]="nSigmaTOFbachpi";
901  fCandidateVariableNames[29]="EleCharge";
902  fCandidateVariableNames[30]="Mixing";
903  fCandidateVariableNames[31]="DcaXiDaughters";
904  fCandidateVariableNames[32]="DcaV0Daughters";
905  fCandidateVariableNames[33]="DecayLengthXi";
906  fCandidateVariableNames[34]="CosPointingAngleXi";
907  fCandidateVariableNames[35]="DcaV0toPrimVertex";
908  fCandidateVariableNames[36]="DcaPostoPrimVertex";
909  fCandidateVariableNames[37]="DcaNegtoPrimVertex";
910  fCandidateVariableNames[38]="DcaBachtoPrimVertex";
911  fCandidateVariableNames[39]="DecayLengthV0";
912  fCandidateVariableNames[40]="CosPointingAngleV0";
913 
914  fCandidateVariableNames[41]="mcpdgxic";
915  fCandidateVariableNames[42]="mclabxic";
916  fCandidateVariableNames[43]="mcxicpx";
917  fCandidateVariableNames[44]="mcxicpy";
918  fCandidateVariableNames[45]="mcxicpz";
919  fCandidateVariableNames[46]="mcelepx";
920  fCandidateVariableNames[47]="mcelepy";
921  fCandidateVariableNames[48]="mcelepz";
922  fCandidateVariableNames[49]="mccascpx";
923  fCandidateVariableNames[50]="mccascpy";
924  fCandidateVariableNames[51]="mccascpz";
925 
926  fCandidateVariableNames[52]="mcpdgele";
927  fCandidateVariableNames[53]="mcpdgcasc";
928  fCandidateVariableNames[54]="mcpdgmomele";
929  fCandidateVariableNames[55]="mcpdgmomcasc";
930  fCandidateVariableNames[56]="mcpdggrmomele";
931  fCandidateVariableNames[57]="mcpdggrmomcasc";
932  fCandidateVariableNames[58]="mcngenele";
933  fCandidateVariableNames[59]="mcngencasc";
934 
935  fCandidateVariableNames[60]="nSigmaTPCpi_etrk";
936  fCandidateVariableNames[61]="nSigmaTOFpi_etrk";
937 
938  fCandidateVariableNames[62]="V0PosPx";
939  fCandidateVariableNames[63]="V0PosPy";
940  fCandidateVariableNames[64]="V0PosPz";
941  fCandidateVariableNames[65]="V0NegPx";
942  fCandidateVariableNames[66]="V0NegPy";
943  fCandidateVariableNames[67]="V0NegPz";
944  fCandidateVariableNames[68]="V0VertX";
945  fCandidateVariableNames[69]="V0VertY";
946  fCandidateVariableNames[70]="V0VertZ";
947  fCandidateVariableNames[71]="BachPx";
948  fCandidateVariableNames[72]="BachPy";
949  fCandidateVariableNames[73]="BachPz";
950  fCandidateVariableNames[74]="XiVertX";
951  fCandidateVariableNames[75]="XiVertY";
952  fCandidateVariableNames[76]="XiVertZ";
953  fCandidateVariableNames[77]="PrimVertX";
954  fCandidateVariableNames[78]="PrimVertY";
955  fCandidateVariableNames[79]="PrimVertZ";
956 
957  fCandidateVariableNames[80]="MassOmega";
958 
959  fCandidateVariableNames[81]= "EleITSMatch";
960  fCandidateVariableNames[82]= "BachITSMatch";
961  fCandidateVariableNames[83]= "V0PosITSMatch";
962  fCandidateVariableNames[84]= "V0NegITSMatch";
963 
964  fCandidateVariableNames[85]= "TPCNclsF";
965  fCandidateVariableNames[86]= "TPCNcls";
966  fCandidateVariableNames[87]= "TPCNclsS";
967  fCandidateVariableNames[88]= "IsXiPeakReagion";
968 
969 
970  fCandidateVariableNames[89]="EvNumber";
971 
972  for (Int_t ivar=0; ivar<nVar; ivar++) {
973  fVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
974  }
975 
976  return;
977 }
978 
980 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillROOTObjects(AliAODRecoCascadeHF *exobj, AliAODcascade *casc, AliAODTrack *trk, TClonesArray *mcArray)
981 {
982  //
983  // Fill histograms or tree depending on fWriteVariableTree
984  //
985  if(!trk) return;
986  if(!casc) return;
987 
988  for(Int_t i=0;i<90;i++){
989  fCandidateVariables[i] = -9999.;
990  }
991 
992 
993  AliAODTrack *cptrack = (AliAODTrack*)(casc->GetDaughter(0));
994  AliAODTrack *cntrack = (AliAODTrack*)(casc->GetDaughter(1));
995  AliAODTrack *cbtrack = (AliAODTrack*)(casc->GetDecayVertexXi()->GetDaughter(0));
996  if(cptrack->Charge()<0 && cntrack->Charge()>0){
997  cptrack = (AliAODTrack*)(casc->GetDaughter(1));
998  cntrack = (AliAODTrack*)(casc->GetDaughter(0));
999  }
1000 // Double_t d0z0[2],covd0z0[3];
1001 // cptrack->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);//propagate to primary vertex for debugging
1002 // cntrack->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);//propagate to primary vertex for debugging
1003 // cbtrack->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);//propagate to primary vertex for debugging
1004 
1005  Double_t posVtx[3] = {0.,0.,0.};
1006  fVtx1->GetXYZ(posVtx);
1007 
1008 
1010  UInt_t pdgdg[2]={11,3312};
1011  fCandidateVariables[ 1] = exobj->InvMass(2,pdgdg);
1012  fCandidateVariables[ 2] = exobj->Pt();
1013  fCandidateVariables[ 3] = exobj->Px();
1014  fCandidateVariables[ 4] = exobj->Py();
1015  fCandidateVariables[ 5] = exobj->Pz();
1016  fCandidateVariables[ 6] = exobj->PxProng(0);
1017  fCandidateVariables[ 7] = exobj->PyProng(0);
1018  fCandidateVariables[ 8] = exobj->PzProng(0);
1019  fCandidateVariables[ 9] = exobj->PxProng(1);
1020  fCandidateVariables[10] = exobj->PyProng(1);
1021  fCandidateVariables[11] = exobj->PzProng(1);
1022  fCandidateVariables[12] = casc->ChargeXi();
1023  fCandidateVariables[13] = casc->MassXi();
1024  if(casc->ChargeXi()<0)
1025  fCandidateVariables[14] = casc->MassLambda();
1026  else
1027  fCandidateVariables[14] = casc->MassAntiLambda();
1028  fCandidateVariables[15] = exobj->Getd0Prong(0);
1029  fCandidateVariables[16] = exobj->Getd0Prong(1);
1030 
1031  Double_t nSigmaTPCele = -9999.;
1032  Double_t nSigmaTOFele = -9999.;
1033  if(fAnalCuts->GetIsUsePID())
1034  {
1035  nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
1036  nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
1037  fCandidateVariables[17] = nSigmaTPCele;
1038  fCandidateVariables[18] = nSigmaTOFele;
1039 
1040  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
1041  Double_t nSigmaTOFpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kProton);
1042  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
1043  Double_t nSigmaTOFka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kKaon);
1044  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
1045  Double_t nSigmaTOFpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kPion);
1046  fCandidateVariables[19] = nSigmaTPCpr_etrk;
1047  fCandidateVariables[20] = nSigmaTOFpr_etrk;
1048  fCandidateVariables[21] = nSigmaTPCka_etrk;
1049  fCandidateVariables[22] = nSigmaTOFka_etrk;
1050  fCandidateVariables[60] = nSigmaTPCpi_etrk;
1051  fCandidateVariables[61] = nSigmaTOFpi_etrk;
1052  }
1053 
1054  Double_t nSigmaTPCv0pr=-9999.;
1055  Double_t nSigmaTOFv0pr=-9999.;
1056  Double_t nSigmaTPCv0pi=-9999.;
1057  Double_t nSigmaTOFv0pi=-9999.;
1058  Double_t nSigmaTPCbachpi=-9999.;
1059  Double_t nSigmaTOFbachpi=-9999.;
1061  {
1062  if(casc->ChargeXi()>0){
1063  nSigmaTPCv0pr = fAnalCuts->GetPidCascPr()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
1064  nSigmaTOFv0pr = fAnalCuts->GetPidCascPr()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kProton);
1065  nSigmaTPCv0pi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
1066  nSigmaTOFv0pi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kPion);
1067  nSigmaTPCbachpi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTPC(cbtrack,AliPID::kPion);
1068  nSigmaTOFbachpi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTOF(cbtrack,AliPID::kPion);
1069  }else{
1070  nSigmaTPCv0pr = fAnalCuts->GetPidCascPr()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
1071  nSigmaTOFv0pr = fAnalCuts->GetPidCascPr()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kProton);
1072  nSigmaTPCv0pi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
1073  nSigmaTOFv0pi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kPion);
1074  nSigmaTPCbachpi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTPC(cbtrack,AliPID::kPion);
1075  nSigmaTOFbachpi = fAnalCuts->GetPidCascPi()->GetPidResponse()->NumberOfSigmasTOF(cbtrack,AliPID::kPion);
1076  }
1077  fCandidateVariables[23] = nSigmaTPCv0pr;
1078  fCandidateVariables[24] = nSigmaTOFv0pr;
1079  fCandidateVariables[25] = nSigmaTPCv0pi;
1080  fCandidateVariables[26] = nSigmaTOFv0pi;
1081  fCandidateVariables[27] = nSigmaTPCbachpi;
1082  fCandidateVariables[28] = nSigmaTOFbachpi;
1083  }
1084  fCandidateVariables[29] = trk->Charge();
1085  fCandidateVariables[30] = 0;
1086  fCandidateVariables[31] = casc->DcaXiDaughters();
1087  fCandidateVariables[32] = casc->DcaV0Daughters();
1088  fCandidateVariables[33] = casc->DecayLengthXi(posVtx[0],posVtx[1],posVtx[2]);
1089  fCandidateVariables[34] = casc->CosPointingAngleXi(posVtx[0],posVtx[1],posVtx[2]);
1090  fCandidateVariables[35] = casc->DcaV0ToPrimVertex();
1091  fCandidateVariables[36] = casc->DcaPosToPrimVertex();
1092  fCandidateVariables[37] = casc->DcaNegToPrimVertex();
1093  fCandidateVariables[38] = casc->DcaBachToPrimVertex();
1094  fCandidateVariables[39] = casc->DecayLengthV0();
1095  fCandidateVariables[40] = casc->CosPointingAngle(casc->GetDecayVertexXi());
1096 
1097  AliAODMCParticle *mcxic = 0;
1098  AliAODMCParticle *mcele = 0;
1099  AliAODMCParticle *mccasc = 0;
1100  Int_t mclabxic = 0;
1101  Int_t mcpdgele_array[100];
1102  Int_t mcpdgcasc_array[100];
1103  Int_t mclabelele_array[100];
1104  Int_t mclabelcasc_array[100];
1105  Int_t mcngen_ele = -9999;
1106  Int_t mcngen_casc = -9999;
1107 
1108  if(fUseMCInfo && mcArray){
1109 
1110  mclabxic = MatchToMC(exobj,mcArray,mcpdgele_array, mcpdgcasc_array,mclabelele_array,mclabelcasc_array,mcngen_ele,mcngen_casc);
1111 
1112  if(mclabxic>-1){
1113  mcxic = (AliAODMCParticle*) mcArray->At(mclabxic);
1114  if(mclabelele_array[0]>=0)
1115  mcele = (AliAODMCParticle*) mcArray->At(mclabelele_array[0]);
1116  if(mclabelcasc_array[0]>=0)
1117  mccasc = (AliAODMCParticle*) mcArray->At(mclabelcasc_array[0]);
1118  if(mcxic){
1119  fCandidateVariables[41] = mcxic->GetPdgCode();
1120  fCandidateVariables[42] = mcxic->Label();
1121  fCandidateVariables[43] = mcxic->Px();
1122  fCandidateVariables[44] = mcxic->Py();
1123  fCandidateVariables[45] = mcxic->Pz();
1124  }
1125  if(mcele){
1126  fCandidateVariables[46] = mcele->Px();
1127  fCandidateVariables[47] = mcele->Py();
1128  fCandidateVariables[48] = mcele->Pz();
1129  }
1130  if(mccasc){
1131  fCandidateVariables[49] = mccasc->Px();
1132  fCandidateVariables[50] = mccasc->Py();
1133  fCandidateVariables[51] = mccasc->Pz();
1134  }
1135  }
1136  fCandidateVariables[52] = mcpdgele_array[0];
1137  fCandidateVariables[53] = mcpdgcasc_array[0];
1138  fCandidateVariables[54] = mcpdgele_array[1];
1139  fCandidateVariables[55] = mcpdgcasc_array[1];
1140  fCandidateVariables[56] = mcpdgele_array[2];
1141  fCandidateVariables[57] = mcpdgcasc_array[2];
1142  fCandidateVariables[58] = mcngen_ele;
1143  fCandidateVariables[59] = mcngen_casc;
1144  }
1145  fCandidateVariables[62] = casc->MomPosX();
1146  fCandidateVariables[63] = casc->MomPosY();
1147  fCandidateVariables[64] = casc->MomPosZ();
1148  fCandidateVariables[65] = casc->MomNegX();
1149  fCandidateVariables[66] = casc->MomNegY();
1150  fCandidateVariables[67] = casc->MomNegZ();
1151  fCandidateVariables[68] = casc->DecayVertexV0X();
1152  fCandidateVariables[69] = casc->DecayVertexV0Y();
1153  fCandidateVariables[70] = casc->DecayVertexV0Z();
1154  fCandidateVariables[71] = casc->MomBachX();
1155  fCandidateVariables[72] = casc->MomBachY();
1156  fCandidateVariables[73] = casc->MomBachZ();
1157  fCandidateVariables[74] = casc->DecayVertexXiX();
1158  fCandidateVariables[75] = casc->DecayVertexXiY();
1159  fCandidateVariables[76] = casc->DecayVertexXiZ();
1160  fCandidateVariables[77] = fVtx1->GetX();
1161  fCandidateVariables[78] = fVtx1->GetY();
1162  fCandidateVariables[79] = fVtx1->GetZ();
1163 
1164  fCandidateVariables[80] = casc->MassOmega();
1165 
1166  if(trk) fCandidateVariables[81] = trk->GetITSClusterMap();
1167  if(cbtrack) fCandidateVariables[82] = cbtrack->GetITSClusterMap();
1168  if(cptrack) fCandidateVariables[83] = cptrack->GetITSClusterMap();
1169  if(cntrack) fCandidateVariables[84] = cntrack->GetITSClusterMap();
1170 
1171  fCandidateVariables[85] = trk->GetTPCNclsF();
1172  fCandidateVariables[86] = trk->GetTPCNcls();
1173  fCandidateVariables[87] = trk->GetTPCnclsS();
1175 
1177 
1178  if(fWriteVariableTree)
1179  fVariablesTree->Fill();
1180 
1181  Double_t cont[3];
1182  cont[0] = exobj->InvMass(2,pdgdg);
1183  cont[1] = exobj->Pt();
1184  cont[2] = fCentrality;
1185  fHistoEleXiMass->Fill(cont);
1186 
1187  Double_t cont2[3];
1188  cont2[0] = exobj->InvMass(2,pdgdg);
1189  cont2[1] = trk->Pt();
1190  cont2[2] = fCentrality;
1191 
1192  Double_t cont_eleptvseta[3];
1193  cont_eleptvseta[0] = trk->Pt();
1194  cont_eleptvseta[1] = trk->Eta();
1195  cont_eleptvseta[2] = fCentrality;
1196 
1197  Double_t cont_eleptvsxipt[3];
1198  cont_eleptvsxipt[0] = trk->Pt();
1199  cont_eleptvsxipt[1] = sqrt(casc->MomXiX()*casc->MomXiX()+casc->MomXiY()*casc->MomXiY());
1200  cont_eleptvsxipt[2] = fCentrality;
1201 
1202  Double_t cont_eleptvsd0[3];
1203  cont_eleptvsd0[0] = trk->Pt();
1204  cont_eleptvsd0[1] = exobj->Getd0Prong(0)*trk->Charge();
1205  cont_eleptvsd0[2] = fCentrality;
1206 
1208  {
1209  if(trk->Charge()*casc->ChargeXi()<0){
1210  fHistoEleXiMassRS->Fill(cont);
1211  fHistoEleXiMassvsElePtRS->Fill(cont2);
1212  if(trk->Charge()>0) fHistoEleXiMassvsElePtRS1->Fill(cont2);
1213  else fHistoEleXiMassvsElePtRS2->Fill(cont2);
1214  if(cont[0]<2.5){
1215  fHistoElePtRS->Fill(trk->Pt(),fCentrality);
1216  fHistoElePtvsEtaRS->Fill(cont_eleptvseta);
1217  fHistoElePtvsXiPtRS->Fill(cont_eleptvsxipt);
1218  fHistoElePtvsd0RS->Fill(cont_eleptvsd0);
1219  for(Int_t ih=0;ih<23;ih++){
1220  Double_t cont_eleptvscutvars[3];
1221  cont_eleptvscutvars[0] = trk->Pt();
1222  cont_eleptvscutvars[2] = fCentrality;
1223 
1224  if(ih==0){
1225  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1226  }else if(ih==1){
1227  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1228  }else if(ih==2){
1229  cont_eleptvscutvars[1] = nSigmaTPCele;
1230  }else if(ih==3){
1231  cont_eleptvscutvars[1] = nSigmaTOFele;
1232  }else if(ih==4){
1233  cont_eleptvscutvars[1] = trk->Eta();
1234  }else if(ih==5){
1235  cont_eleptvscutvars[1] = trk->GetITSNcls();
1236  }else if(ih==6){
1237  if(casc->ChargeXi()<0)
1238  cont_eleptvscutvars[1] = casc->MassLambda();
1239  else
1240  cont_eleptvscutvars[1] = casc->MassAntiLambda();
1241  }else if(ih==7){
1242  cont_eleptvscutvars[1] = casc->MassXi();
1243  }else if(ih==8){
1244  Double_t lPosV0[3];
1245  lPosV0[0] = casc->DecayVertexV0X();
1246  lPosV0[1] = casc->DecayVertexV0Y();
1247  lPosV0[2] = casc->DecayVertexV0Z();
1248  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1249  }else if(ih==9){
1250  Double_t lPosXi[3];
1251  lPosXi[0] = casc->DecayVertexXiX();
1252  lPosXi[1] = casc->DecayVertexXiY();
1253  lPosXi[2] = casc->DecayVertexXiZ();
1254  cont_eleptvscutvars[1] = TMath::Sqrt(lPosXi[0]*lPosXi[0]+lPosXi[1]*lPosXi[1]);
1255  }else if(ih==10){
1256  cont_eleptvscutvars[1] = casc->DcaV0Daughters();
1257  }else if(ih==11){
1258  cont_eleptvscutvars[1] = casc->DcaXiDaughters();
1259  }else if(ih==12){
1260  cont_eleptvscutvars[1] = casc->DcaBachToPrimVertex();
1261  }else if(ih==13){
1262  if(casc->ChargeXi()<0.)
1263  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1264  else
1265  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1266  }else if(ih==14){
1267  if(casc->ChargeXi()>0.)
1268  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1269  else
1270  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1271  }else if(ih==15){
1272  cont_eleptvscutvars[1] = casc->CosPointingAngle(casc->GetDecayVertexXi());
1273  }else if(ih==16){
1274  cont_eleptvscutvars[1] = casc->CosPointingAngleXi(posVtx[0],posVtx[1],posVtx[2]);
1275  }else if(ih==17){
1276  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1277  }else if(ih==18){
1278  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1279  }else if(ih==19){
1280  cont_eleptvscutvars[1] = nSigmaTPCbachpi;
1281  }else if(ih==20){
1282  cont_eleptvscutvars[1] = casc->Eta();
1283  }else if(ih==21){
1284  cont_eleptvscutvars[1] = 0.5*TMath::Log((sqrt(casc->Ptot2Xi())+casc->MomXiZ())/(sqrt(casc->Ptot2Xi())-casc->MomXiZ()));
1285  }else if(ih==22){
1286  Double_t xipx = exobj->PxProng(1);
1287  Double_t xipy = exobj->PyProng(1);
1288  Double_t xipz = exobj->PzProng(1);
1289  Double_t epx = exobj->PxProng(0);
1290  Double_t epy = exobj->PyProng(0);
1291  Double_t epz = exobj->PzProng(0);
1292  cont_eleptvscutvars[1] = acos((xipx*epx+xipy*epy+xipz*epz)/sqrt(xipx*xipx+xipy*xipy+xipz*xipz)/sqrt(epx*epx+epy*epy+epz*epz));
1293  }else{
1294  cont_eleptvscutvars[1] = -9999.;
1295  }
1296 
1297  fHistoElePtvsCutVarsRS[ih]->Fill(cont_eleptvscutvars);
1298  }
1299  }
1300  }else{
1301  fHistoEleXiMassWS->Fill(cont);
1302  fHistoEleXiMassvsElePtWS->Fill(cont2);
1303  if(trk->Charge()>0) fHistoEleXiMassvsElePtWS1->Fill(cont2);
1304  else fHistoEleXiMassvsElePtWS2->Fill(cont2);
1305  if(cont[0]<2.5){
1306  fHistoElePtWS->Fill(trk->Pt(),fCentrality);
1307  fHistoElePtvsEtaWS->Fill(cont_eleptvseta);
1308  fHistoElePtvsXiPtWS->Fill(cont_eleptvsxipt);
1309  fHistoElePtvsd0WS->Fill(cont_eleptvsd0);
1310 
1311  for(Int_t ih=0;ih<23;ih++){
1312  Double_t cont_eleptvscutvars[3];
1313  cont_eleptvscutvars[0] = trk->Pt();
1314  cont_eleptvscutvars[2] = fCentrality;
1315 
1316  if(ih==0){
1317  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1318  }else if(ih==1){
1319  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1320  }else if(ih==2){
1321  cont_eleptvscutvars[1] = nSigmaTPCele;
1322  }else if(ih==3){
1323  cont_eleptvscutvars[1] = nSigmaTOFele;
1324  }else if(ih==4){
1325  cont_eleptvscutvars[1] = trk->Eta();
1326  }else if(ih==5){
1327  cont_eleptvscutvars[1] = trk->GetITSNcls();
1328  }else if(ih==6){
1329  if(casc->ChargeXi()<0)
1330  cont_eleptvscutvars[1] = casc->MassLambda();
1331  else
1332  cont_eleptvscutvars[1] = casc->MassAntiLambda();
1333  }else if(ih==7){
1334  cont_eleptvscutvars[1] = casc->MassXi();
1335  }else if(ih==8){
1336  Double_t lPosV0[3];
1337  lPosV0[0] = casc->DecayVertexV0X();
1338  lPosV0[1] = casc->DecayVertexV0Y();
1339  lPosV0[2] = casc->DecayVertexV0Z();
1340  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1341  }else if(ih==9){
1342  Double_t lPosXi[3];
1343  lPosXi[0] = casc->DecayVertexXiX();
1344  lPosXi[1] = casc->DecayVertexXiY();
1345  lPosXi[2] = casc->DecayVertexXiZ();
1346  cont_eleptvscutvars[1] = TMath::Sqrt(lPosXi[0]*lPosXi[0]+lPosXi[1]*lPosXi[1]);
1347  }else if(ih==10){
1348  cont_eleptvscutvars[1] = casc->DcaV0Daughters();
1349  }else if(ih==11){
1350  cont_eleptvscutvars[1] = casc->DcaXiDaughters();
1351  }else if(ih==12){
1352  cont_eleptvscutvars[1] = casc->DcaBachToPrimVertex();
1353  }else if(ih==13){
1354  if(casc->ChargeXi()<0.)
1355  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1356  else
1357  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1358  }else if(ih==14){
1359  if(casc->ChargeXi()>0.)
1360  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1361  else
1362  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1363  }else if(ih==15){
1364  cont_eleptvscutvars[1] = casc->CosPointingAngle(casc->GetDecayVertexXi());
1365  }else if(ih==16){
1366  cont_eleptvscutvars[1] = casc->CosPointingAngleXi(posVtx[0],posVtx[1],posVtx[2]);
1367  }else if(ih==17){
1368  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1369  }else if(ih==18){
1370  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1371  }else if(ih==19){
1372  cont_eleptvscutvars[1] = nSigmaTPCbachpi;
1373  }else if(ih==20){
1374  cont_eleptvscutvars[1] = casc->Eta();
1375  }else if(ih==21){
1376  cont_eleptvscutvars[1] = 0.5*TMath::Log((sqrt(casc->Ptot2Xi())+casc->MomXiZ())/(sqrt(casc->Ptot2Xi())-casc->MomXiZ()));
1377  }else if(ih==22){
1378  Double_t xipx = exobj->PxProng(1);
1379  Double_t xipy = exobj->PyProng(1);
1380  Double_t xipz = exobj->PzProng(1);
1381  Double_t epx = exobj->PxProng(0);
1382  Double_t epy = exobj->PyProng(0);
1383  Double_t epz = exobj->PzProng(0);
1384  cont_eleptvscutvars[1] = acos((xipx*epx+xipy*epy+xipz*epz)/sqrt(xipx*xipx+xipy*xipy+xipz*xipz)/sqrt(epx*epx+epy*epy+epz*epz));
1385  }else{
1386  cont_eleptvscutvars[1] = -9999.;
1387  }
1388 
1389  fHistoElePtvsCutVarsWS[ih]->Fill(cont_eleptvscutvars);
1390  }
1391  }
1392  }
1393 
1394  if(fUseMCInfo){
1395  if(mcxic){
1396  Int_t pdgcode = mcxic->GetPdgCode();
1397  cont2[1] = mcele->Pt();
1398  if(abs(pdgcode)==4132 && abs(mcpdgele_array[1])==4132 && abs(mcpdgcasc_array[1])==4132){
1399  fHistoEleXiMassMCS->Fill(cont);
1400  fHistoEleXiMassvsElePtMCS->Fill(cont2);
1401  if(trk->Charge()>0) fHistoEleXiMassvsElePtMCS1->Fill(cont2);
1402  else fHistoEleXiMassvsElePtMCS2->Fill(cont2);
1403  if(cont[0]<2.5){
1404  fHistoElePtMCS->Fill(mcele->Pt(),fCentrality);
1405  fHistoElePtvsEtaMCS->Fill(cont_eleptvseta);
1406  fHistoElePtvsXiPtMCS->Fill(cont_eleptvsxipt);
1407  fHistoElePtvsd0MCS->Fill(cont_eleptvsd0);
1408 
1409  Double_t cont_eleptvsxiptvsxicpt[4];
1410  cont_eleptvsxiptvsxicpt[0] = cont_eleptvsxipt[0];
1411  cont_eleptvsxiptvsxicpt[1] = cont_eleptvsxipt[1];
1412  cont_eleptvsxiptvsxicpt[2] = mcxic->Pt();
1413  cont_eleptvsxiptvsxicpt[3] = cont_eleptvsxipt[2];
1414  fHistoElePtvsXiPtvsXicPtMCS->Fill(cont_eleptvsxiptvsxicpt);
1415 
1416  Int_t labmotherxic = mcxic->GetMother();
1417  if(labmotherxic>=0){
1418  AliAODMCParticle *motherxic = (AliAODMCParticle*)mcArray->At(labmotherxic);
1419  Int_t pdgmotherxic = motherxic->GetPdgCode();
1420  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){
1421  fHistoElePtvsd0BFeeddownMCS->Fill(cont_eleptvsd0);
1422  }else{
1423  fHistoElePtvsd0PromptMCS->Fill(cont_eleptvsd0);
1424  }
1425  }else{
1426  fHistoElePtvsd0PromptMCS->Fill(cont_eleptvsd0);
1427  }
1428 
1429  for(Int_t ih=0;ih<23;ih++){
1430  Double_t cont_eleptvscutvars[3];
1431  cont_eleptvscutvars[0] = trk->Pt();
1432  cont_eleptvscutvars[2] = fCentrality;
1433 
1434  if(ih==0){
1435  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1436  }else if(ih==1){
1437  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1438  }else if(ih==2){
1439  cont_eleptvscutvars[1] = nSigmaTPCele;
1440  }else if(ih==3){
1441  cont_eleptvscutvars[1] = nSigmaTOFele;
1442  }else if(ih==4){
1443  cont_eleptvscutvars[1] = trk->Eta();
1444  }else if(ih==5){
1445  cont_eleptvscutvars[1] = trk->GetITSNcls();
1446  }else if(ih==6){
1447  if(casc->ChargeXi()<0)
1448  cont_eleptvscutvars[1] = casc->MassLambda();
1449  else
1450  cont_eleptvscutvars[1] = casc->MassAntiLambda();
1451  }else if(ih==7){
1452  cont_eleptvscutvars[1] = casc->MassXi();
1453  }else if(ih==8){
1454  Double_t lPosV0[3];
1455  lPosV0[0] = casc->DecayVertexV0X();
1456  lPosV0[1] = casc->DecayVertexV0Y();
1457  lPosV0[2] = casc->DecayVertexV0Z();
1458  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1459  }else if(ih==9){
1460  Double_t lPosXi[3];
1461  lPosXi[0] = casc->DecayVertexXiX();
1462  lPosXi[1] = casc->DecayVertexXiY();
1463  lPosXi[2] = casc->DecayVertexXiZ();
1464  cont_eleptvscutvars[1] = TMath::Sqrt(lPosXi[0]*lPosXi[0]+lPosXi[1]*lPosXi[1]);
1465  }else if(ih==10){
1466  cont_eleptvscutvars[1] = casc->DcaV0Daughters();
1467  }else if(ih==11){
1468  cont_eleptvscutvars[1] = casc->DcaXiDaughters();
1469  }else if(ih==12){
1470  cont_eleptvscutvars[1] = casc->DcaBachToPrimVertex();
1471  }else if(ih==13){
1472  if(casc->ChargeXi()<0.)
1473  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1474  else
1475  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1476  }else if(ih==14){
1477  if(casc->ChargeXi()>0.)
1478  cont_eleptvscutvars[1] = casc->DcaPosToPrimVertex();
1479  else
1480  cont_eleptvscutvars[1] = casc->DcaNegToPrimVertex();
1481  }else if(ih==15){
1482  cont_eleptvscutvars[1] = casc->CosPointingAngle(casc->GetDecayVertexXi());
1483  }else if(ih==16){
1484  cont_eleptvscutvars[1] = casc->CosPointingAngleXi(posVtx[0],posVtx[1],posVtx[2]);
1485  }else if(ih==17){
1486  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1487  }else if(ih==18){
1488  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1489  }else if(ih==19){
1490  cont_eleptvscutvars[1] = nSigmaTPCbachpi;
1491  }else if(ih==20){
1492  cont_eleptvscutvars[1] = casc->Eta();
1493  }else if(ih==21){
1494  cont_eleptvscutvars[1] = 0.5*TMath::Log((sqrt(casc->Ptot2Xi())+casc->MomXiZ())/(sqrt(casc->Ptot2Xi())-casc->MomXiZ()));
1495  }else if(ih==22){
1496  Double_t xipx = exobj->PxProng(1);
1497  Double_t xipy = exobj->PyProng(1);
1498  Double_t xipz = exobj->PzProng(1);
1499  Double_t epx = exobj->PxProng(0);
1500  Double_t epy = exobj->PyProng(0);
1501  Double_t epz = exobj->PzProng(0);
1502  cont_eleptvscutvars[1] = acos((xipx*epx+xipy*epy+xipz*epz)/sqrt(xipx*xipx+xipy*xipy+xipz*xipz)/sqrt(epx*epx+epy*epy+epz*epz));
1503  }else{
1504  cont_eleptvscutvars[1] = -9999.;
1505  }
1506 
1507  fHistoElePtvsCutVarsMCS[ih]->Fill(cont_eleptvscutvars);
1508  }
1509  }
1510  }
1511  }
1512  }
1513  }
1514 
1516  {
1517  if(trk->Charge()*casc->ChargeXi()<0){
1518  fHistoEleXiMassRSSide->Fill(cont);
1519  fHistoEleXiMassvsElePtRSSide->Fill(cont2);
1520  if(trk->Charge()>0) fHistoEleXiMassvsElePtRSSide1->Fill(cont2);
1521  else fHistoEleXiMassvsElePtRSSide2->Fill(cont2);
1522  }else{
1523  fHistoEleXiMassWSSide->Fill(cont);
1524  fHistoEleXiMassvsElePtWSSide->Fill(cont2);
1525  if(trk->Charge()>0) fHistoEleXiMassvsElePtWSSide1->Fill(cont2);
1526  else fHistoEleXiMassvsElePtWSSide2->Fill(cont2);
1527  }
1528  }
1529 
1530  return;
1531 }
1532 
1534 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillMixROOTObjects(TLorentzVector *trke, TLorentzVector *casc, Int_t chargexi)
1535 {
1536  //
1537  // Fill histograms or tree depending on fWriteVariableTree
1538  //
1539  if(!trke) return;
1540  if(!casc) return;
1541 
1542 
1543  for(Int_t i=0;i<89;i++){
1544  fCandidateVariables[i] = -9999.;
1545  }
1546 
1547  Double_t pxe = trke->Px();
1548  Double_t pye = trke->Py();
1549  Double_t pze = trke->Pz();
1550  Double_t mome = sqrt(pxe*pxe+pye*pye+pze*pze);
1551  Double_t Ee = sqrt(mome*mome+0.000510998928*0.000510998928);
1552 
1553  Double_t pxv = casc->Px();
1554  Double_t pyv = casc->Py();
1555  Double_t pzv = casc->Pz();
1556  Double_t momv = sqrt(pxv*pxv+pyv*pyv+pzv*pzv);
1557  Double_t Ev = sqrt(momv*momv+1.32171*1.32171);
1558 
1559  Double_t cosoa = (pxe*pxv+pye*pyv+pze*pzv)/mome/momv;
1560 
1561  Double_t pxsum = pxe + pxv;
1562  Double_t pysum = pye + pyv;
1563  Double_t pzsum = pze + pzv;
1564  Double_t Esum = Ee + Ev;
1565 
1566  Double_t mexi = sqrt(Esum*Esum-pxsum*pxsum-pysum*pysum-pzsum*pzsum);
1567 
1568  Double_t posVtx[3] = {0.,0.,0.};
1569  fVtx1->GetXYZ(posVtx);
1570 
1572  UInt_t pdgdg[2]={11,3312};
1573  fCandidateVariables[ 1] = mexi;
1574  fCandidateVariables[ 2] = sqrt(pxsum*pxsum+pysum*pysum);
1575  fCandidateVariables[ 3] = pxsum;
1576  fCandidateVariables[ 4] = pysum;
1577  fCandidateVariables[ 5] = pzsum;
1578  fCandidateVariables[ 6] = pxe;
1579  fCandidateVariables[ 7] = pye;
1580  fCandidateVariables[ 8] = pze;
1581  fCandidateVariables[ 9] = pxv;
1582  fCandidateVariables[10] = pyv;
1583  fCandidateVariables[11] = pzv;
1584  fCandidateVariables[12] = chargexi;
1585  fCandidateVariables[13] = casc->M();
1586  fCandidateVariables[29] = trke->T();
1587  fCandidateVariables[30] = 1;//mixing
1588  fCandidateVariables[77] = fVtx1->GetX();
1589  fCandidateVariables[78] = fVtx1->GetY();
1590  fCandidateVariables[79] = fVtx1->GetZ();
1592 
1593  if(fWriteVariableTree)
1594  fVariablesTree->Fill();
1595 
1596 
1597  if(cosoa>0. && fAnalCuts->IsPeakRegion(casc))
1598  {
1599  Double_t cont[3];
1600  cont[0] = mexi;
1601  cont[1] = sqrt(pxsum*pxsum+pysum*pysum);
1602  cont[2] = fCentrality;
1603  fHistoEleXiMass->Fill(cont);
1604 
1605  Double_t cont2[3];
1606  cont2[0] = mexi;
1607  cont2[1] = sqrt(pxe*pxe+pye*pye);
1608  cont2[2] = fCentrality;
1609 
1610  Double_t cont_eleptvseta[3];
1611  cont_eleptvseta[0] = trke->Pt();
1612  cont_eleptvseta[1] = trke->Eta();
1613  cont_eleptvseta[2] = fCentrality;
1614 
1615  Double_t cont_eleptvsxipt[3];
1616  cont_eleptvsxipt[0] = trke->Pt();
1617  cont_eleptvsxipt[1] = casc->Pt();
1618  cont_eleptvsxipt[2] = fCentrality;
1619 
1620  Double_t cont_eleptvsd0[3];
1621  cont_eleptvsd0[0] = trke->Pt();
1622  cont_eleptvsd0[1] = 0.;
1623  cont_eleptvsd0[2] = fCentrality;
1624 
1625  if(((int)trke->T())*chargexi<0){
1626  fHistoEleXiMassRSMix->Fill(cont);
1627  fHistoEleXiMassvsElePtRSMix->Fill(cont2);
1628  if(trke->T()>0) fHistoEleXiMassvsElePtRSMix1->Fill(cont2);
1629  else fHistoEleXiMassvsElePtRSMix2->Fill(cont2);
1630  if(cont[0]<2.5){
1631  fHistoElePtRSMix->Fill(trke->Pt(),fCentrality);
1632  fHistoElePtvsEtaRSMix->Fill(cont_eleptvseta);
1633  fHistoElePtvsXiPtRSMix->Fill(cont_eleptvsxipt);
1634  fHistoElePtvsd0RSMix->Fill(cont_eleptvsd0);
1635  }
1636  }else{
1637  fHistoEleXiMassWSMix->Fill(cont);
1638  fHistoEleXiMassvsElePtWSMix->Fill(cont2);
1639  if(trke->T()>0) fHistoEleXiMassvsElePtWSMix1->Fill(cont2);
1640  else fHistoEleXiMassvsElePtWSMix2->Fill(cont2);
1641  if(cont[0]<2.5){
1642  fHistoElePtWSMix->Fill(trke->Pt(),fCentrality);
1643  fHistoElePtvsEtaWSMix->Fill(cont_eleptvseta);
1644  fHistoElePtvsXiPtWSMix->Fill(cont_eleptvsxipt);
1645  fHistoElePtvsd0WSMix->Fill(cont_eleptvsd0);
1646  }
1647  }
1648  }
1649 
1650  return;
1651 }
1652 
1655 {
1656  //
1657  // Define electron tree variables
1658  //
1659 
1660  const char* nameoutput = GetOutputSlot(5)->GetContainer()->GetName();
1661  fEleVariablesTree = new TTree(nameoutput,"electron variables tree");
1662  Int_t nVar = 26;
1663  fCandidateEleVariables = new Float_t [nVar];
1664  TString * fCandidateVariableNames = new TString[nVar];
1665 
1666  fCandidateVariableNames[ 0]="ElePx";
1667  fCandidateVariableNames[ 1]="ElePy";
1668  fCandidateVariableNames[ 2]="ElePz";
1669  fCandidateVariableNames[ 3]="TPCChi2overNDF";
1670  fCandidateVariableNames[ 4]="ITSNcls";
1671  fCandidateVariableNames[ 5]="TPCNcls";
1672  fCandidateVariableNames[ 6]="TPCNclsPID";
1673  fCandidateVariableNames[ 7]="TPCNclsRatio";
1674  fCandidateVariableNames[ 8]="d0R";
1675  fCandidateVariableNames[ 9]="d0Z";
1676  fCandidateVariableNames[10]="ITSClusterMap";
1677  fCandidateVariableNames[11]="nSigmaTPCele";
1678  fCandidateVariableNames[12]="nSigmaTOFele";
1679  fCandidateVariableNames[13]="nSigmaTPCpi";
1680  fCandidateVariableNames[14]="nSigmaTPCka";
1681  fCandidateVariableNames[15]="nSigmaTPCpr";
1682  fCandidateVariableNames[16]="EvNumber";
1683  fCandidateVariableNames[17]="EleCharge";
1684  fCandidateVariableNames[18]="ElePdgCode";
1685  fCandidateVariableNames[19]="EleMotherPdgCode";
1686  fCandidateVariableNames[20]="mcelepx";
1687  fCandidateVariableNames[21]="mcelepy";
1688  fCandidateVariableNames[22]="mcelepz";
1689  fCandidateVariableNames[23]="Centrality";
1690  fCandidateVariableNames[24]="PrimVertZ";
1691  fCandidateVariableNames[25]="RunNumber";
1692 
1693  for (Int_t ivar=0; ivar<nVar; ivar++) {
1694  fEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1695  }
1696 
1697  return;
1698 }
1700 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillElectronROOTObjects(AliAODTrack *trk, TClonesArray *mcArray)
1701 {
1702  //
1703  // Fill histograms or tree depending on fWriteVariableTree
1704  //
1705 
1706  if(!trk) return;
1707 
1708  fHistoBachPt->Fill(trk->Pt());
1709  fHistoElectronQovPtvsPhi->Fill(trk->Phi(),(Double_t)trk->Charge()/trk->Pt());
1710 
1711  if(fDoEventMixing){
1712  fElectronTracks->AddLast(new TLorentzVector(trk->Px(),trk->Py(),trk->Pz(),trk->Charge()));
1713  }
1714 
1715  if(!fWriteEachVariableTree) return;
1716 
1717  Int_t pdgEle = -9999;
1718  Int_t pdgEleMother = -9999;
1719  Float_t mcepx = -9999;
1720  Float_t mcepy = -9999;
1721  Float_t mcepz = -9999;
1722  if(fUseMCInfo)
1723  {
1724  Int_t labEle = trk->GetLabel();
1725  if(labEle<0) return;
1726  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
1727  if(!mcetrk) return;
1728  pdgEle = mcetrk->GetPdgCode();
1729  if(abs(pdgEle)!=11) return;
1730 
1731  fHistoBachPtMCS->Fill(trk->Pt());
1732 
1733  Bool_t hfe_flag = kFALSE;
1734  Int_t labemother = mcetrk->GetMother();
1735  if(labemother>=0){
1736  AliAODMCParticle *motherele = (AliAODMCParticle*)mcArray->At(labemother);
1737  if(!motherele) return;
1738  pdgEleMother = motherele->GetPdgCode();
1739  if(abs(pdgEleMother)>4000&&abs(pdgEleMother)<4400){
1740  hfe_flag = kTRUE;
1741  }
1742  }
1743  if(!hfe_flag) return;
1744  mcepx = mcetrk->Px();
1745  mcepy = mcetrk->Py();
1746  mcepz = mcetrk->Pz();
1747  }
1748 
1749 
1750  for(Int_t i=0;i<26;i++){
1751  fCandidateEleVariables[i] = -9999.;
1752  }
1753 
1754  fCandidateEleVariables[ 0] = trk->Px();
1755  fCandidateEleVariables[ 1] = trk->Py();
1756  fCandidateEleVariables[ 2] = trk->Pz();
1757  fCandidateEleVariables[ 3] = trk->Chi2perNDF();
1758  fCandidateEleVariables[ 4] = trk->GetITSNcls();
1759  fCandidateEleVariables[ 5] = trk->GetTPCncls();
1760  fCandidateEleVariables[ 6] = trk->GetTPCsignalN();
1761  if(trk->GetTPCNclsF()>0)
1762  fCandidateEleVariables[ 7] = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
1763 
1764  Double_t d0z0[2],covd0z0[3];
1765  trk->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);
1766 
1767  fCandidateEleVariables[ 8] = d0z0[0];
1768  fCandidateEleVariables[ 9] = d0z0[1];
1769  Int_t itsmap = trk->GetITSClusterMap();
1770  Int_t bit1 = 1;
1771  Int_t bit2 = 2;
1772  Bool_t spdfirst = (itsmap & bit1) == bit1;
1773  Bool_t spdsecond = (itsmap & bit2) == bit2;
1774  fCandidateEleVariables[10] = ((Int_t)spdfirst) + 2 * ((Int_t)spdsecond);
1775 
1776  if(fAnalCuts->GetIsUsePID())
1777  {
1778  Double_t nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
1779  Double_t nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
1780  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
1781  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
1782  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
1783  fCandidateEleVariables[11] = nSigmaTPCele;
1784  fCandidateEleVariables[12] = nSigmaTOFele;
1785  fCandidateEleVariables[13] = nSigmaTPCpi_etrk;
1786  fCandidateEleVariables[14] = nSigmaTPCka_etrk;
1787  fCandidateEleVariables[15] = nSigmaTPCpr_etrk;
1788  }
1790  fCandidateEleVariables[17] = trk->Charge();
1791  fCandidateEleVariables[18] = pdgEle;
1792  fCandidateEleVariables[19] = pdgEleMother;
1793  fCandidateEleVariables[20] = mcepx;
1794  fCandidateEleVariables[21] = mcepy;
1795  fCandidateEleVariables[22] = mcepz;
1799 
1800  fHistod0Bach->Fill(d0z0[0]);
1801 
1802  fEleVariablesTree->Fill();
1803 }
1806 {
1807  //
1808  // Define V0 tree variables
1809  //
1810 
1811  const char* nameoutput = GetOutputSlot(6)->GetContainer()->GetName();
1812  fCascVariablesTree = new TTree(nameoutput,"cascade variables tree");
1813  Int_t nVar = 25;
1814  fCandidateCascVariables = new Float_t [nVar];
1815  TString * fCandidateVariableNames = new TString[nVar];
1816 
1817  fCandidateVariableNames[ 0]="Centrality";
1818  fCandidateVariableNames[ 1]="InvMassXi";
1819  fCandidateVariableNames[ 2]="XiPx";
1820  fCandidateVariableNames[ 3]="XiPy";
1821  fCandidateVariableNames[ 4]="XiPz";
1822  fCandidateVariableNames[ 5]="InvMassLambda";
1823  fCandidateVariableNames[ 6]="DcaXiDaughters";
1824  fCandidateVariableNames[ 7]="DcaV0Daughters";
1825  fCandidateVariableNames[ 8]="DecayLengthXi";
1826  fCandidateVariableNames[ 9]="CosPointingAngleXi";
1827  fCandidateVariableNames[10]="DcaV0toPrimVertex";
1828  fCandidateVariableNames[11]="DcaPostoPrimVertex";
1829  fCandidateVariableNames[12]="DcaNegtoPrimVertex";
1830  fCandidateVariableNames[13]="DcaBachtoPrimVertex";
1831  fCandidateVariableNames[14]="DecayLengthV0";
1832  fCandidateVariableNames[15]="CosPointingAngleV0";
1833  fCandidateVariableNames[16]="XiCharge";
1834  fCandidateVariableNames[17]="XiPdgCode";
1835  fCandidateVariableNames[18]="XiMotherPdgCode";
1836  fCandidateVariableNames[19]="mcxipx";
1837  fCandidateVariableNames[20]="mcxipy";
1838  fCandidateVariableNames[21]="mcxipz";
1839  fCandidateVariableNames[22]="RunNumber";
1840  fCandidateVariableNames[23]="PrimVertZ";
1841  fCandidateVariableNames[24]="EvNumber";
1842 
1843  for (Int_t ivar=0; ivar<nVar; ivar++) {
1844  fCascVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateCascVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1845  }
1846 
1847  return;
1848 }
1849 
1851 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillCascROOTObjects(AliAODcascade *casc, TClonesArray *mcArray)
1852 {
1853  //
1854  // Fill histograms or tree depending on fWriteVariableTree (tree not implemented yet)
1855  //
1856  if(!casc) return;
1857  fHistoXiMassvsPt->Fill(casc->MassXi(),sqrt(casc->MomXiX()*casc->MomXiX()+casc->MomXiY()*casc->MomXiY()));
1858  fHistoOmegaMassvsPt->Fill(casc->MassOmega(),sqrt(casc->MomXiX()*casc->MomXiX()+casc->MomXiY()*casc->MomXiY()));
1859  Double_t momxix = casc->MomXiX();
1860  Double_t momxiy = casc->MomXiY();
1861  Double_t phi_alice = atan2(momxiy,momxix);
1862  if(phi_alice<0.) phi_alice += 2 * M_PI;
1863  fHistoXiQovPtvsPhi->Fill(phi_alice,(Double_t)casc->ChargeXi()/sqrt(momxix*momxix+momxiy*momxiy));
1864 
1865  Int_t xipdgcode = -9999;
1866  Int_t ximotherpdgcode = -9999;
1867  Float_t mcxipx = -9999.;
1868  Float_t mcxipy = -9999.;
1869  Float_t mcxipz = -9999.;
1870  if(fUseMCInfo){
1871  Int_t pdgDgcasc[2]={211,3122};
1872  Int_t pdgDgv0[2]={2212,211};
1873  Int_t labcasc = MatchToMCCascade(casc,3312,pdgDgcasc,pdgDgv0,mcArray); // the cascade
1874  if(labcasc<0) return;
1875 
1876  fHistoXiMassvsPtMCS->Fill(casc->MassXi(),sqrt(casc->MomXiX()*casc->MomXiX()+casc->MomXiY()*casc->MomXiY()));
1877 
1878  AliAODMCParticle *mccasctrk = (AliAODMCParticle*)mcArray->At(labcasc);
1879  if(!mccasctrk) return;
1880 
1881  Bool_t hfxi_flag = kFALSE;
1882  xipdgcode = mccasctrk->GetPdgCode();
1883  Int_t labcascmother = mccasctrk->GetMother();
1884  if(labcascmother>=0){
1885  AliAODMCParticle *mothercasc = (AliAODMCParticle*)mcArray->At(labcascmother);
1886  if(mothercasc){
1887  ximotherpdgcode = mothercasc->GetPdgCode();
1888  if(abs(ximotherpdgcode)>4000&&abs(ximotherpdgcode)<4400){
1889  hfxi_flag = kTRUE;
1890  }
1891  }
1892  }
1893  if(!hfxi_flag) return;
1894  mcxipx = mccasctrk->Px();
1895  mcxipy = mccasctrk->Py();
1896  mcxipz = mccasctrk->Pz();
1897  }
1898 
1899 
1900  Double_t xyz[3], pxpypz[3], cv[21]; Short_t sign;
1901  xyz[0]=casc->DecayVertexXiX();
1902  xyz[1]=casc->DecayVertexXiY();
1903  xyz[2]=casc->DecayVertexXiZ();
1904  pxpypz[0]=casc->MomXiX();
1905  pxpypz[1]=casc->MomXiY();
1906  pxpypz[2]=casc->MomXiZ();
1907  casc->GetCovarianceXYZPxPyPz(cv);
1908  sign=casc->ChargeXi();
1909  AliExternalTrackParam *trackCasc = new AliExternalTrackParam(xyz,pxpypz,cv,sign);
1910  trackCasc->PropagateToDCA(fVtx1,fBzkG,kVeryBig);
1911  Double_t momcasc_new[3]={-9999,-9999,-9999.};
1912  trackCasc->GetPxPyPz(momcasc_new);
1913 
1914  if(fDoEventMixing){
1915  TLorentzVector *lv = new TLorentzVector();
1916  lv->SetXYZM(momcasc_new[0],momcasc_new[1],momcasc_new[2],casc->MassXi());
1917  if(casc->ChargeXi()>0)
1918  fCascadeTracks1->AddLast(lv);
1919  else
1920  fCascadeTracks2->AddLast(lv);
1921  }
1922 
1923  if(!fWriteEachVariableTree) return;
1924 
1925  for(Int_t i=0;i<25;i++){
1926  fCandidateCascVariables[i] = -9999.;
1927  }
1928  Double_t posVtx[3] = {0.,0.,0.};
1929  fVtx1->GetXYZ(posVtx);
1930 
1932  fCandidateCascVariables[ 1] = casc->MassXi();
1933  fCandidateCascVariables[ 2] = momcasc_new[0];//casc->MomXiX();
1934  fCandidateCascVariables[ 3] = momcasc_new[1];//casc->MomXiY();
1935  fCandidateCascVariables[ 4] = momcasc_new[2];//casc->MomXiZ();
1936  if(casc->ChargeXi()<0)
1937  fCandidateCascVariables[ 5] = casc->MassLambda();
1938  else
1939  fCandidateCascVariables[ 5] = casc->MassAntiLambda();
1940 
1941  fCandidateCascVariables[ 6] = casc->DcaXiDaughters();
1942  fCandidateCascVariables[ 7] = casc->DcaV0Daughters();
1943  fCandidateCascVariables[ 8] = casc->DecayLengthXi(posVtx[0],posVtx[1],posVtx[2]);
1944  fCandidateCascVariables[ 9] = casc->CosPointingAngleXi(posVtx[0],posVtx[1],posVtx[2]);
1945  fCandidateCascVariables[10] = casc->DcaV0ToPrimVertex();
1946  fCandidateCascVariables[11] = casc->DcaPosToPrimVertex();
1947  fCandidateCascVariables[12] = casc->DcaNegToPrimVertex();
1948  fCandidateCascVariables[13] = casc->DcaBachToPrimVertex();
1949  fCandidateCascVariables[14] = casc->DecayLengthV0();
1950  fCandidateCascVariables[15] = casc->CosPointingAngle(casc->GetDecayVertexXi());
1951  fCandidateCascVariables[16] = casc->ChargeXi();
1952  fCandidateCascVariables[17] = xipdgcode;
1953  fCandidateCascVariables[18] = ximotherpdgcode;
1954  fCandidateCascVariables[19] = mcxipx;
1955  fCandidateCascVariables[20] = mcxipy;
1956  fCandidateCascVariables[21] = mcxipz;
1960 
1961 
1962  fCascVariablesTree->Fill();
1963 }
1966 {
1967  //
1968  // Define electron tree variables
1969  //
1970 
1971  const char* nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
1972  fMCVariablesTree = new TTree(nameoutput,"MC variables tree");
1973  Int_t nVar = 16;
1974  fCandidateMCVariables = new Float_t [nVar];
1975  TString * fCandidateVariableNames = new TString[nVar];
1976 
1977  fCandidateVariableNames[ 0]="Centrality";
1978  fCandidateVariableNames[ 1]="DecayType";
1979  fCandidateVariableNames[ 2]="XicPx";
1980  fCandidateVariableNames[ 3]="XicPy";
1981  fCandidateVariableNames[ 4]="XicPz";
1982  fCandidateVariableNames[ 5]="ElePx";
1983  fCandidateVariableNames[ 6]="ElePy";
1984  fCandidateVariableNames[ 7]="ElePz";
1985  fCandidateVariableNames[ 8]="CascPx";
1986  fCandidateVariableNames[ 9]="CascPy";
1987  fCandidateVariableNames[10]="CascPz";
1988  fCandidateVariableNames[11]="PdgCode";
1989  fCandidateVariableNames[12]="ElePdgCode";
1990  fCandidateVariableNames[13]="CascPdgCode";
1991  fCandidateVariableNames[14]="RunNumber";
1992  fCandidateVariableNames[15]="EvNumber";
1993 
1994  for (Int_t ivar=0; ivar<nVar; ivar++) {
1995  fMCVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1996  }
1997  return;
1998 }
2000 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillMCROOTObjects(AliAODMCParticle *mcpart, AliAODMCParticle *mcepart, AliAODMCParticle *mccascpart, Int_t decaytype)
2001 {
2002  //
2003  // Fill histograms or tree depending on fWriteMCVariableTree
2004  //
2005  if(!mcpart) return;
2006  if(!mcepart) return;
2007  if(!mccascpart) return;
2008 
2009  for(Int_t i=0;i<14;i++){
2010  fCandidateMCVariables[i] = -9999.;
2011  }
2012 
2014  fCandidateMCVariables[ 1] = decaytype;
2015  fCandidateMCVariables[ 2] = mcpart->Px();
2016  fCandidateMCVariables[ 3] = mcpart->Py();
2017  fCandidateMCVariables[ 4] = mcpart->Pz();
2018  fCandidateMCVariables[ 5] = mcepart->Px();
2019  fCandidateMCVariables[ 6] = mcepart->Py();
2020  fCandidateMCVariables[ 7] = mcepart->Pz();
2021  fCandidateMCVariables[ 8] = mccascpart->Px();
2022  fCandidateMCVariables[ 9] = mccascpart->Py();
2023  fCandidateMCVariables[10] = mccascpart->Pz();
2024  fCandidateMCVariables[11] = mcpart->GetPdgCode();
2025  fCandidateMCVariables[12] = mcepart->GetPdgCode();
2026  fCandidateMCVariables[13] = mccascpart->GetPdgCode();
2029 
2030  Double_t epx = mcepart->Px();
2031  Double_t epy = mcepart->Py();
2032  Double_t epz = mcepart->Pz();
2033  Double_t eE = sqrt(epx*epx+epy*epy+epz*epz+0.000511*0.000511);
2034  Double_t cascpx = mccascpart->Px();
2035  Double_t cascpy = mccascpart->Py();
2036  Double_t cascpz = mccascpart->Pz();
2037  Double_t cascE = sqrt(cascpx*cascpx+cascpy*cascpy+cascpz*cascpz+1.32171*1.32171);
2038 
2039  Double_t InvMassEleXi = sqrt(pow(eE+cascE,2)-pow(epx+cascpx,2)-pow(epy+cascpy,2)-pow(epz+cascpz,2));
2040 
2041  Double_t cont[3];
2042  cont[0] = InvMassEleXi;
2043  cont[1] = mcpart->Pt();
2044  cont[2] = fCentrality;
2045  Double_t cont2[3];
2046  cont2[0] = InvMassEleXi;
2047  cont2[1] = mcepart->Pt();
2048  cont2[2] = fCentrality;
2049  Double_t cont_eleptvseta[3];
2050  cont_eleptvseta[0] = mcepart->Pt();
2051  cont_eleptvseta[1] = mcepart->Eta();
2052  cont_eleptvseta[2] = fCentrality;
2053  Double_t cont_eleptvsxipt[3];
2054  cont_eleptvsxipt[0] = mcepart->Pt();
2055  cont_eleptvsxipt[1] = mccascpart->Pt();
2056  cont_eleptvsxipt[2] = fCentrality;
2057  Double_t cont_eleptvsxiptvsxicpt[4];
2058  cont_eleptvsxiptvsxicpt[0] = mcepart->Pt();
2059  cont_eleptvsxiptvsxicpt[1] = mccascpart->Pt();
2060  cont_eleptvsxiptvsxicpt[2] = mcpart->Pt();
2061  cont_eleptvsxiptvsxicpt[3] = fCentrality;
2062 
2063  Double_t contmc[3];
2064  contmc[0] = mcpart->Pt();
2065  contmc[1] = mcpart->Y();
2066  contmc[2] = fCentrality;
2067  Double_t contmcele[3];
2068  contmcele[0] = mcepart->Pt();
2069  contmcele[1] = mcepart->Eta();
2070  contmcele[2] = fCentrality;
2071 
2072 
2073  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
2074  Float_t etamin, etamax;
2075  esdcuts->GetEtaRange(etamin,etamax);
2076 
2077  if(decaytype==0){
2078  fHistoXicMCGen->Fill(contmc);
2079  if(mcpart->GetPdgCode()>0) fHistoXicMCGen1->Fill(contmc);//4132 is particle
2080  if(mcpart->GetPdgCode()<0) fHistoXicMCGen2->Fill(contmc);//-4132 is anti-particle
2081  fHistoXicElectronMCGen->Fill(contmcele);
2082  if(mcepart->GetPdgCode()<0) fHistoXicElectronMCGen1->Fill(contmcele);//-11 is positron
2083  if(mcepart->GetPdgCode()>0) fHistoXicElectronMCGen2->Fill(contmcele);//11 is electron
2084  fHistoEleXiMassMCGen->Fill(cont);
2085  if(fabs(mcepart->Eta())<etamax){
2086  fHistoEleXiMassvsElePtMCGen->Fill(cont2);
2087  if(mcepart->GetPdgCode()<0) fHistoEleXiMassvsElePtMCGen1->Fill(cont2);//-11 is positron
2088  if(mcepart->GetPdgCode()>0) fHistoEleXiMassvsElePtMCGen2->Fill(cont2);//11 is electron
2089  if(InvMassEleXi<2.5){
2090  fHistoElePtMCGen->Fill(mcepart->Pt(),fCentrality);
2091  fHistoElePtvsEtaMCGen->Fill(cont_eleptvseta);
2092  fHistoElePtvsXiPtMCGen->Fill(cont_eleptvsxipt);
2093  }
2094  }
2095  if(fabs(mcpart->Y())<0.7){
2096  if(InvMassEleXi<2.5){
2097  fHistoElePtvsXiPtMCXicGen->Fill(cont_eleptvsxipt);
2098  fHistoElePtvsXiPtvsXicPtMCGen->Fill(cont_eleptvsxiptvsxicpt);
2099  }
2100  }
2101  }
2102 
2104  fMCVariablesTree->Fill();
2105 }
2108 {
2109  //
2110  // Define mc gen electron tree variables
2111  //
2112 
2113  const char* nameoutput = GetOutputSlot(9)->GetContainer()->GetName();
2114  fMCEleVariablesTree = new TTree(nameoutput,"MC Ele variables tree");
2115  Int_t nVar = 8;
2116  fCandidateMCEleVariables = new Float_t [nVar];
2117  TString * fCandidateVariableNames = new TString[nVar];
2118 
2119  fCandidateVariableNames[ 0]="Centrality";
2120  fCandidateVariableNames[ 1]="ElePx";
2121  fCandidateVariableNames[ 2]="ElePy";
2122  fCandidateVariableNames[ 3]="ElePz";
2123  fCandidateVariableNames[ 4]="ElePdgCode";
2124  fCandidateVariableNames[ 5]="EleMotherPdgCode";
2125  fCandidateVariableNames[ 6]="RunNumber";
2126  fCandidateVariableNames[ 7]="EvNumber";
2127 
2128  for (Int_t ivar=0; ivar<nVar; ivar++) {
2129  fMCEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2130  }
2131  return;
2132 }
2134 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
2135 {
2136  //
2137  // Fill tree depending on fWriteMCVariableTree
2138  //
2139  if(!mcepart) return;
2140 
2141 
2142  Bool_t hfe_flag = kFALSE;
2143  Int_t labemother = mcepart->GetMother();
2144  Int_t pdgmotherele = -9999;
2145  if(labemother>=0){
2146  AliAODMCParticle *motherele = (AliAODMCParticle*)mcArray->At(labemother);
2147  pdgmotherele = motherele->GetPdgCode();
2148  if(abs(pdgmotherele)>4000&&abs(pdgmotherele)<4400){
2149  hfe_flag = kTRUE;
2150  }
2151  }
2152  if(!hfe_flag) return;
2153 
2154  Double_t contmc[3];
2155  contmc[0] = mcepart->Pt();
2156  contmc[1] = mcepart->Eta();
2157  contmc[2] = fCentrality;
2158  fHistoElectronMCGen->Fill(contmc);
2159 
2160  for(Int_t i=0;i<8;i++){
2161  fCandidateMCEleVariables[i] = -9999.;
2162  }
2163 
2165  fCandidateMCEleVariables[ 1] = mcepart->Px();
2166  fCandidateMCEleVariables[ 2] = mcepart->Py();
2167  fCandidateMCEleVariables[ 3] = mcepart->Pz();
2168  fCandidateMCEleVariables[ 4] = mcepart->GetPdgCode();
2169  fCandidateMCEleVariables[ 5] = pdgmotherele;
2172 
2173  // This function makes output too heavy (do not use if you have output size limitation)
2174  //if(fWriteMCVariableTree && fWriteEachVariableTree && mcepart->Pt()>0.4 && fabs(mcepart->Eta())<1.0)
2175  //fMCEleVariablesTree->Fill();
2176 }
2179 {
2180  //
2181  // Define Mc cascade tree variables
2182  //
2183 
2184  const char* nameoutput = GetOutputSlot(10)->GetContainer()->GetName();
2185  fMCCascVariablesTree = new TTree(nameoutput,"MC cascade variables tree");
2186  Int_t nVar = 8;
2187  fCandidateMCCascVariables = new Float_t [nVar];
2188  TString * fCandidateVariableNames = new TString[nVar];
2189 
2190  fCandidateVariableNames[ 0]="Centrality";
2191  fCandidateVariableNames[ 1]="CascPx";
2192  fCandidateVariableNames[ 2]="CascPy";
2193  fCandidateVariableNames[ 3]="CascPz";
2194  fCandidateVariableNames[ 4]="CascPdgCode";
2195  fCandidateVariableNames[ 5]="CascMotherPdgCode";
2196  fCandidateVariableNames[ 6]="RunNumber";
2197  fCandidateVariableNames[ 7]="EvNumber";
2198 
2199  for (Int_t ivar=0; ivar<nVar; ivar++) {
2200  fMCCascVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCCascVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2201  }
2202  return;
2203 }
2205 void AliAnalysisTaskSEXic2eleXifromAODtracks::FillMCCascROOTObjects(AliAODMCParticle *mccascpart, TClonesArray *mcArray)
2206 {
2207  //
2208  // Fill histograms or tree depending on fWriteMCVariableTree
2209  //
2210  if(!mccascpart) return;
2211 
2212  for(Int_t i=0;i<8;i++){
2213  fCandidateMCCascVariables[i] = -9999.;
2214  }
2215 
2216  Bool_t hfxi_flag = kFALSE;
2217  Int_t labcascmother = mccascpart->GetMother();
2218  Int_t pdgmothercasc = -9999;
2219  if(labcascmother>=0){
2220  AliAODMCParticle *mothercasc = (AliAODMCParticle*)mcArray->At(labcascmother);
2221  if(mothercasc){
2222  pdgmothercasc = mothercasc->GetPdgCode();
2223  if(abs(pdgmothercasc)>4000&&abs(pdgmothercasc)<4400){
2224  hfxi_flag = kTRUE;
2225  }
2226  }
2227  }
2228  if(!hfxi_flag) return;
2229 
2230  Double_t contmc[3];
2231  contmc[0] = mccascpart->Pt();
2232  contmc[1] = mccascpart->Eta();
2233  contmc[2] = fCentrality;
2234  fHistoXiMCGen->Fill(contmc);
2235 
2237  fCandidateMCCascVariables[ 1] = mccascpart->Px();
2238  fCandidateMCCascVariables[ 2] = mccascpart->Py();
2239  fCandidateMCCascVariables[ 3] = mccascpart->Pz();
2240  fCandidateMCCascVariables[ 4] = mccascpart->GetPdgCode();
2241  fCandidateMCCascVariables[ 5] = pdgmothercasc;
2244 
2245  // This function makes output too heavy (do not use if you have output size limitation)
2246  //if(fWriteMCVariableTree && fWriteEachVariableTree && mccascpart->Pt()>0.4 && fabs(mccascpart->Eta())<1.0)
2247  //fMCCascVariablesTree->Fill();
2248 }
2249 
2252  //
2253  // This is to define general histograms
2254  //
2255 
2256  fCEvents = new TH1F("fCEvents","conter",18,-0.5,17.5);
2257  fCEvents->SetStats(kTRUE);
2258  fCEvents->GetXaxis()->SetBinLabel(1,"X1");
2259  fCEvents->GetXaxis()->SetBinLabel(2,"Analyzed events");
2260  fCEvents->GetXaxis()->SetBinLabel(3,"AliAODVertex exists");
2261  fCEvents->GetXaxis()->SetBinLabel(4,"TriggerOK");
2262  fCEvents->GetXaxis()->SetBinLabel(5,"IsEventSelected");
2263  fCEvents->GetXaxis()->SetBinLabel(6,"CascadesHF exists");
2264  fCEvents->GetXaxis()->SetBinLabel(7,"MCarray exists");
2265  fCEvents->GetXaxis()->SetBinLabel(8,"MCheader exists");
2266  fCEvents->GetXaxis()->SetBinLabel(9,"triggerClass!=CINT1");
2267  fCEvents->GetXaxis()->SetBinLabel(10,"triggerMask!=kAnyINT");
2268  fCEvents->GetXaxis()->SetBinLabel(11,"triggerMask!=kAny");
2269  fCEvents->GetXaxis()->SetBinLabel(12,"vtxTitle.Contains(Z)");
2270  fCEvents->GetXaxis()->SetBinLabel(13,"vtxTitle.Contains(3D)");
2271  fCEvents->GetXaxis()->SetBinLabel(14,"vtxTitle.Doesn'tContain(Z-3D)");
2272  fCEvents->GetXaxis()->SetBinLabel(15,Form("zVtx<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
2273  fCEvents->GetXaxis()->SetBinLabel(16,"!IsEventSelected");
2274  fCEvents->GetXaxis()->SetBinLabel(17,"triggerMask!=kAnyINT || triggerClass!=CINT1");
2275  fCEvents->GetXaxis()->SetBinLabel(18,Form("zVtxMC<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
2276  //fCEvents->GetXaxis()->SetTitle("");
2277  fCEvents->GetYaxis()->SetTitle("counts");
2278 
2279  fHTrigger = new TH1F("fHTrigger","counter",18,-0.5,17.5);
2280  fHTrigger->SetStats(kTRUE);
2281  fHTrigger->GetXaxis()->SetBinLabel(1,"X1");
2282  fHTrigger->GetXaxis()->SetBinLabel(2,"kMB");
2283  fHTrigger->GetXaxis()->SetBinLabel(3,"kSemiCentral");
2284  fHTrigger->GetXaxis()->SetBinLabel(4,"kCentral");
2285  fHTrigger->GetXaxis()->SetBinLabel(5,"kINT7");
2286  fHTrigger->GetXaxis()->SetBinLabel(6,"kEMC7");
2287  //fHTrigger->GetXaxis()->SetBinLabel(7,"Space");
2288  fHTrigger->GetXaxis()->SetBinLabel(8,"kMB|kSemiCentral|kCentral");
2289  fHTrigger->GetXaxis()->SetBinLabel(9,"kINT7|kEMC7");
2290  fHTrigger->GetXaxis()->SetBinLabel(11,"kMB&kSemiCentral");
2291  fHTrigger->GetXaxis()->SetBinLabel(12,"kMB&kCentral");
2292  fHTrigger->GetXaxis()->SetBinLabel(13,"kINT7&kEMC7");
2293 
2294  fHCentrality = new TH1F("fHCentrality","conter",100,0.,100.);
2295 
2296 
2297  fOutput->Add(fCEvents);
2298  fOutput->Add(fHTrigger);
2299  fOutput->Add(fHCentrality);
2300 
2301  return;
2302 }
2303 //__________________________________________________________________________
2305 {
2306  //
2307  // Define analyis histograms
2308  //
2309 
2310  //------------------------------------------------
2311  // Basic histogram
2312  //------------------------------------------------
2313  Int_t bins_base[3]= {10 ,100 ,10};
2314  Double_t xmin_base[3]={1.3,0 ,0.00};
2315  Double_t xmax_base[3]={3.3,10. ,100};
2316 
2317  fHistoEleXiMass = new THnSparseF("fHistoEleXiMass","",3,bins_base,xmin_base,xmax_base);
2319  fHistoEleXiMassRS = new THnSparseF("fHistoEleXiMassRS","",3,bins_base,xmin_base,xmax_base);
2321  fHistoEleXiMassWS = new THnSparseF("fHistoEleXiMassWS","",3,bins_base,xmin_base,xmax_base);
2323  fHistoEleXiMassRSMix = new THnSparseF("fHistoEleXiMassRSMix","",3,bins_base,xmin_base,xmax_base);
2325  fHistoEleXiMassWSMix = new THnSparseF("fHistoEleXiMassWSMix","",3,bins_base,xmin_base,xmax_base);
2327  fHistoEleXiMassRSSide = new THnSparseF("fHistoEleXiMassRSSide","",3,bins_base,xmin_base,xmax_base);
2329  fHistoEleXiMassWSSide = new THnSparseF("fHistoEleXiMassWSSide","",3,bins_base,xmin_base,xmax_base);
2331 
2332  fHistoEleXiMassvsElePtRS = new THnSparseF("fHistoEleXiMassvsElePtRS","",3,bins_base,xmin_base,xmax_base);
2334  fHistoEleXiMassvsElePtWS = new THnSparseF("fHistoEleXiMassvsElePtWS","",3,bins_base,xmin_base,xmax_base);
2336  fHistoEleXiMassvsElePtRSMix = new THnSparseF("fHistoEleXiMassvsElePtRSMix","",3,bins_base,xmin_base,xmax_base);
2338  fHistoEleXiMassvsElePtWSMix = new THnSparseF("fHistoEleXiMassvsElePtWSMix","",3,bins_base,xmin_base,xmax_base);
2340  fHistoEleXiMassvsElePtRSSide = new THnSparseF("fHistoEleXiMassvsElePtRSSide","",3,bins_base,xmin_base,xmax_base);
2342  fHistoEleXiMassvsElePtWSSide = new THnSparseF("fHistoEleXiMassvsElePtWSSide","",3,bins_base,xmin_base,xmax_base);
2344  fHistoEleXiMassvsElePtRS1 = new THnSparseF("fHistoEleXiMassvsElePtRS1","",3,bins_base,xmin_base,xmax_base);
2346  fHistoEleXiMassvsElePtWS1 = new THnSparseF("fHistoEleXiMassvsElePtWS1","",3,bins_base,xmin_base,xmax_base);
2348  fHistoEleXiMassvsElePtRSMix1 = new THnSparseF("fHistoEleXiMassvsElePtRSMix1","",3,bins_base,xmin_base,xmax_base);
2350  fHistoEleXiMassvsElePtWSMix1 = new THnSparseF("fHistoEleXiMassvsElePtWSMix1","",3,bins_base,xmin_base,xmax_base);
2352  fHistoEleXiMassvsElePtRSSide1 = new THnSparseF("fHistoEleXiMassvsElePtRSSide1","",3,bins_base,xmin_base,xmax_base);
2354  fHistoEleXiMassvsElePtWSSide1 = new THnSparseF("fHistoEleXiMassvsElePtWSSide1","",3,bins_base,xmin_base,xmax_base);
2356  fHistoEleXiMassvsElePtRS2 = new THnSparseF("fHistoEleXiMassvsElePtRS2","",3,bins_base,xmin_base,xmax_base);
2358  fHistoEleXiMassvsElePtWS2 = new THnSparseF("fHistoEleXiMassvsElePtWS2","",3,bins_base,xmin_base,xmax_base);
2360  fHistoEleXiMassvsElePtRSMix2 = new THnSparseF("fHistoEleXiMassvsElePtRSMix2","",3,bins_base,xmin_base,xmax_base);
2362  fHistoEleXiMassvsElePtWSMix2 = new THnSparseF("fHistoEleXiMassvsElePtWSMix2","",3,bins_base,xmin_base,xmax_base);
2364  fHistoEleXiMassvsElePtRSSide2 = new THnSparseF("fHistoEleXiMassvsElePtRSSide2","",3,bins_base,xmin_base,xmax_base);
2366  fHistoEleXiMassvsElePtWSSide2 = new THnSparseF("fHistoEleXiMassvsElePtWSSide2","",3,bins_base,xmin_base,xmax_base);
2368 
2369  fHistoElePtRS=new TH2F("fHistoElePtRS","Right-sign e pt",100,0.,10.,10,0.,100.);
2370  fOutputAll->Add(fHistoElePtRS);
2371  fHistoElePtWS=new TH2F("fHistoElePtWS","Wrong-sign e pt",100,0.,10.,10,0.,100.);
2372  fOutputAll->Add(fHistoElePtWS);
2373  fHistoElePtRSMix=new TH2F("fHistoElePtRSMix","Right-sign e pt",100,0.,10.,10,0.,100.);
2375  fHistoElePtWSMix=new TH2F("fHistoElePtWSMix","Wrong-sign e pt",100,0.,10.,10,0.,100.);
2377 
2378  fHistoEleXiMassMCS = new THnSparseF("fHistoEleXiMassMCS","",3,bins_base,xmin_base,xmax_base);
2380  fHistoEleXiMassMCGen = new THnSparseF("fHistoEleXiMassMCGen","",3,bins_base,xmin_base,xmax_base);
2382  fHistoEleXiMassvsElePtMCS = new THnSparseF("fHistoEleXiMassvsElePtMCS","",3,bins_base,xmin_base,xmax_base);
2384  fHistoEleXiMassvsElePtMCGen = new THnSparseF("fHistoEleXiMassvsElePtMCGen","",3,bins_base,xmin_base,xmax_base);
2386  fHistoEleXiMassvsElePtMCS1 = new THnSparseF("fHistoEleXiMassvsElePtMCS1","",3,bins_base,xmin_base,xmax_base);
2388  fHistoEleXiMassvsElePtMCGen1 = new THnSparseF("fHistoEleXiMassvsElePtMCGen1","",3,bins_base,xmin_base,xmax_base);
2390  fHistoEleXiMassvsElePtMCS2 = new THnSparseF("fHistoEleXiMassvsElePtMCS2","",3,bins_base,xmin_base,xmax_base);
2392  fHistoEleXiMassvsElePtMCGen2 = new THnSparseF("fHistoEleXiMassvsElePtMCGen2","",3,bins_base,xmin_base,xmax_base);
2394  fHistoElePtMCS=new TH2F("fHistoElePtMCS","MC S e pt",100,0.,10.,10,0.,100.);
2395  fOutputAll->Add(fHistoElePtMCS);
2396  fHistoElePtMCGen=new TH2F("fHistoElePtMCGen","MC Gen e pt",100,0.,10.,10,0.,100.);
2398 
2399  Int_t bins_eleptvseta[3]= {50,20 ,10};
2400  Double_t xmin_eleptvseta[3]={0.,-1. ,0.0};
2401  Double_t xmax_eleptvseta[3]={5.,1. ,100};
2402 
2403  fHistoElePtvsEtaRS = new THnSparseF("fHistoElePtvsEtaRS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2405  fHistoElePtvsEtaWS = new THnSparseF("fHistoElePtvsEtaWS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2407  fHistoElePtvsEtaRSMix = new THnSparseF("fHistoElePtvsEtaRSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2409  fHistoElePtvsEtaWSMix = new THnSparseF("fHistoElePtvsEtaWSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2411  fHistoElePtvsEtaMCS = new THnSparseF("fHistoElePtvsEtaMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2413  fHistoElePtvsEtaMCGen = new THnSparseF("fHistoElePtvsEtaMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2415 
2416  Int_t bins_eleptvsxipt[3]= {50,20 ,10};
2417  Double_t xmin_eleptvsxipt[3]={0.,0. ,0.0};
2418  Double_t xmax_eleptvsxipt[3]={5.,5. ,100};
2419 
2420  fHistoElePtvsXiPtRS = new THnSparseF("fHistoElePtvsXiPtRS","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
2422  fHistoElePtvsXiPtWS = new THnSparseF("fHistoElePtvsXiPtWS","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
2424  fHistoElePtvsXiPtRSMix = new THnSparseF("fHistoElePtvsXiPtRSMix","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
2426  fHistoElePtvsXiPtWSMix = new THnSparseF("fHistoElePtvsXiPtWSMix","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
2428  fHistoElePtvsXiPtMCS = new THnSparseF("fHistoElePtvsXiPtMCS","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
2430  fHistoElePtvsXiPtMCGen = new THnSparseF("fHistoElePtvsXiPtMCGen","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
2432  fHistoElePtvsXiPtMCXicGen = new THnSparseF("fHistoElePtvsXiPtMCXicGen","",3,bins_eleptvsxipt,xmin_eleptvsxipt,xmax_eleptvsxipt);
2434 
2435  Int_t bins_eleptvsxiptvsxicpt[4]= {50,20,10,10};
2436  Double_t xmin_eleptvsxiptvsxicpt[4]={0.,0.,0.,0.0};
2437  Double_t xmax_eleptvsxiptvsxicpt[4]={5.,5.,10.,100};
2438  fHistoElePtvsXiPtvsXicPtMCS = new THnSparseF("fHistoElePtvsXiPtvsXicPtMCS","",4,bins_eleptvsxiptvsxicpt,xmin_eleptvsxiptvsxicpt,xmax_eleptvsxiptvsxicpt);
2440  fHistoElePtvsXiPtvsXicPtMCGen = new THnSparseF("fHistoElePtvsXiPtvsXicPtMCGen","",4,bins_eleptvsxiptvsxicpt,xmin_eleptvsxiptvsxicpt,xmax_eleptvsxiptvsxicpt);
2442 
2443  Int_t bins_eleptvsd0[3]= {50 ,50 ,10};
2444  Double_t xmin_eleptvsd0[3]={0.,-0.2 ,0.0};
2445  Double_t xmax_eleptvsd0[3]={5.,0.2 ,100};
2446 
2447  fHistoElePtvsd0RS = new THnSparseF("fHistoElePtvsd0RS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2449  fHistoElePtvsd0WS = new THnSparseF("fHistoElePtvsd0WS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2451  fHistoElePtvsd0RSMix = new THnSparseF("fHistoElePtvsd0RSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2453  fHistoElePtvsd0WSMix = new THnSparseF("fHistoElePtvsd0WSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2455  fHistoElePtvsd0MCS = new THnSparseF("fHistoElePtvsd0MCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2457  fHistoElePtvsd0PromptMCS = new THnSparseF("fHistoElePtvsd0PromptMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2459  fHistoElePtvsd0BFeeddownMCS = new THnSparseF("fHistoElePtvsd0BFeeddownMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2461 
2462  //------------------------------------------------
2463  // checking histograms
2464  //------------------------------------------------
2465  fHistoBachPt = new TH1F("fHistoBachPt","Bachelor p_{T}",100,0.0,5.0);
2466  fOutputAll->Add(fHistoBachPt);
2467  fHistoBachPtMCS = new TH1F("fHistoBachPtMCS","Bachelor p_{T}",100,0.0,5.0);
2469  fHistoBachPtMCGen = new TH1F("fHistoBachPtMCGen","Bachelor p_{T}",100,0.0,5.0);
2471  fHistod0Bach = new TH1F("fHistod0Bach","Bachelor d_{0}",100,-0.5,0.5);
2472  fOutputAll->Add(fHistod0Bach);
2473  fHistoXiMassvsPt=new TH2F("fHistoXiMassvsPt","Xi mass",100,1.32-0.05,1.32+0.05,20,0.,10.);
2475  fHistoXiMassvsPtMCS=new TH2F("fHistoXiMassvsPtMCS","Xi mass",100,1.32-0.05,1.32+0.05,20,0.,10.);
2477  fHistoXiMassvsPtMCGen=new TH2F("fHistoXiMassvsPtMCGen","Xi mass",100,1.32-0.05,1.32+0.05,20,0.,10.);
2479  fHistoOmegaMassvsPt=new TH2F("fHistoOmegaMassvsPt","Omega mass",100,1.67-0.05,1.67+0.05,20,0.,10.);
2481 
2482  fHistoElectronTPCPID=new TH2F("fHistoElectronTPCPID","",50,0.,5.,50,-20.,20.);
2484  fHistoElectronTOFPID=new TH2F("fHistoElectronTOFPID","",50,0.,5.,50,-20.,20.);
2486  fHistoElectronTPCSelPID=new TH2F("fHistoElectronTPCSelPID","",50,0.,5.,50,-20.,20.);
2488  fHistoElectronTOFSelPID=new TH2F("fHistoElectronTOFSelPID","",50,0.,5.,50,-20.,20.);
2490  fHistoElectronTPCPIDSelTOF=new TH2F("fHistoElectronTPCPIDSelTOF","",10,0.,5.,500,-10.,10.);
2492  fHistoElectronTOFPIDSelTPC=new TH2F("fHistoElectronTOFPIDSelTPC","",10,0.,5.,500,-10.,10.);
2494  fHistoElectronTPCPIDSelTOFSmallEta=new TH2F("fHistoElectronTPCPIDSelTOFSmallEta","",10,0.,5.,500,-10.,10.);
2496  fHistoElectronTPCPIDSelTOFLargeEta=new TH2F("fHistoElectronTPCPIDSelTOFLargeEta","",10,0.,5.,500,-10.,10.);
2498 
2499  for(Int_t i=0;i<8;i++){
2500  fHistoElectronTPCPIDSelTOFEtaDep[i]=new TH2F(Form("fHistoElectronTPCPIDSelTOFEtaDep[%d]",i),"",10,0.,5.,500,-10.,10.);
2502  }
2503 
2504  fHistoElectronQovPtvsPhi=new TH2F("fHistoElectronQovPtvsPhi","",70,0.,7.,50,-2.,2.);
2506  fHistoXiQovPtvsPhi=new TH2F("fHistoXiQovPtvsPhi","",70,0.,7.,50,-2.,2.);
2508 
2509  Int_t bins_xicmcgen[3]= {40 ,20 ,10};
2510  Double_t xmin_xicmcgen[3]={0.,-1.0 ,0.0};
2511  Double_t xmax_xicmcgen[3]={20.,1.0 ,100};
2512  fHistoXicMCGen = new THnSparseF("fHistoXicMCGen","",3,bins_xicmcgen,xmin_xicmcgen,xmax_xicmcgen);
2513  fOutputAll->Add(fHistoXicMCGen);
2514  fHistoXicMCGen1 = new THnSparseF("fHistoXicMCGen1","",3,bins_xicmcgen,xmin_xicmcgen,xmax_xicmcgen);
2516  fHistoXicMCGen2 = new THnSparseF("fHistoXicMCGen2","",3,bins_xicmcgen,xmin_xicmcgen,xmax_xicmcgen);
2518 
2519  Int_t bins_elemcgen[3]= {100 ,20 ,10};
2520  Double_t xmin_elemcgen[3]={0.,-1.0 ,0.0};
2521  Double_t xmax_elemcgen[3]={10.,1.0 ,100};
2522  fHistoElectronMCGen = new THnSparseF("fHistoElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2524  fHistoXicElectronMCGen = new THnSparseF("fHistoXicElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2526  fHistoXicElectronMCGen1 = new THnSparseF("fHistoXicElectronMCGen1","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2528  fHistoXicElectronMCGen2 = new THnSparseF("fHistoXicElectronMCGen2","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2530 
2531  Int_t bins_ximcgen[3]= {50 ,20 ,10};
2532  Double_t xmin_ximcgen[3]={0.,-1.0 ,0.0};
2533  Double_t xmax_ximcgen[3]={10.,1.0 ,100};
2534  fHistoXiMCGen = new THnSparseF("fHistoXiMCGen","",3,bins_ximcgen,xmin_ximcgen,xmax_ximcgen);
2535  fOutputAll->Add(fHistoXiMCGen);
2536 
2537  fHistonEvtvsRunNumber=new TH1F("fHistonEvtvsRunNumber","",20000,-0.5,19999.5);
2539  fHistonElevsRunNumber=new TH1F("fHistonElevsRunNumber","",20000,-0.5,19999.5);
2541  fHistonXivsRunNumber=new TH1F("fHistonXivsRunNumber","",20000,-0.5,19999.5);
2543 
2544  for(Int_t ih=0;ih<23;ih++){
2545  Int_t bins_eleptvscutvars[3];
2546  Double_t xmin_eleptvscutvars[3];
2547  Double_t xmax_eleptvscutvars[3];
2548 
2549  bins_eleptvscutvars[0] = 50;//electron pT bin
2550  xmin_eleptvscutvars[0] = 0.;
2551  xmax_eleptvscutvars[0] = 5.;
2552  bins_eleptvscutvars[2] = 10;//centrality bin
2553  xmin_eleptvscutvars[2] = 0.;
2554  xmax_eleptvscutvars[2] = 100.;
2555 
2556  if(ih==0 || ih==1){
2557  //0: TPC Ncluster 1: TPC ncluster PID
2558  bins_eleptvscutvars[1] = 40;
2559  xmin_eleptvscutvars[1] = 0.;
2560  xmax_eleptvscutvars[1] = 160.;
2561  }else if(ih==2 || ih==3){
2562  //2: nSigma(TPC,e) 3: nSigma(TOF,e)
2563  bins_eleptvscutvars[1] = 20;
2564  xmin_eleptvscutvars[1] = -5.;
2565  xmax_eleptvscutvars[1] = 5.;
2566  }else if(ih==4){
2567  //4: eta
2568  bins_eleptvscutvars[1] = 30;
2569  xmin_eleptvscutvars[1] = -1.5;
2570  xmax_eleptvscutvars[1] = 1.5;
2571  }else if(ih==5){
2572  //5: nITS cluster
2573  bins_eleptvscutvars[1] = 7;
2574  xmin_eleptvscutvars[1] = -0.5;
2575  xmax_eleptvscutvars[1] = 6.5;
2576  }else if(ih==6){
2577  //6: Lambda mass
2578  bins_eleptvscutvars[1] = 50;
2579  xmin_eleptvscutvars[1] = 1.1156-0.03;
2580  xmax_eleptvscutvars[1] = 1.1156+0.03;
2581  }else if(ih==7){
2582  //7: Xi mass
2583  bins_eleptvscutvars[1] = 50;
2584  xmin_eleptvscutvars[1] = 1.32-0.03;
2585  xmax_eleptvscutvars[1] = 1.32+0.03;
2586  }else if(ih==8 || ih==9){
2587  //8: Rfid Lambda, 9: Rfid Xi
2588  bins_eleptvscutvars[1] = 20;
2589  xmin_eleptvscutvars[1] = 0.;
2590  xmax_eleptvscutvars[1] = 5.;
2591  }else if(ih==10 || ih==11){
2592  //11: DCA Xi, 10: Dca V0
2593  bins_eleptvscutvars[1] = 20;
2594  xmin_eleptvscutvars[1] = 0.;
2595  xmax_eleptvscutvars[1] = 2.;
2596  }else if(ih==12 || ih==13 || ih==14){
2597  //12: DCA Bachto prim, 13: DCA V0pr to prim 14: DCA V0pi to prim
2598  bins_eleptvscutvars[1] = 20;
2599  xmin_eleptvscutvars[1] = 0.;
2600  xmax_eleptvscutvars[1] = 0.5;
2601  }else if(ih==15 || ih==16){
2602  //16: CosPAXi, 15: CosPAv0
2603  bins_eleptvscutvars[1] = 20;
2604  xmin_eleptvscutvars[1] = 0.95;
2605  xmax_eleptvscutvars[1] = 1.0;
2606  }else if(ih==17 || ih==18 || ih==19){
2607  //17: nSigma(TPC, bach) 18: nSigma(TPC, v0pr), 19: nSigma(TPC,v0pi)
2608  bins_eleptvscutvars[1] = 20;
2609  xmin_eleptvscutvars[1] = -5.;
2610  xmax_eleptvscutvars[1] = 5.;
2611  }else if(ih==20 || ih==21){
2612  //20: V0 eta 21: Xi eta
2613  bins_eleptvscutvars[1] = 30;
2614  xmin_eleptvscutvars[1] = -1.5;
2615  xmax_eleptvscutvars[1] = 1.5;
2616  }else if(ih==22){
2617  //20: Opening angle
2618  bins_eleptvscutvars[1] = 20;
2619  xmin_eleptvscutvars[1] = 0.;
2620  xmax_eleptvscutvars[1] = 3.141592/2;
2621  }
2622 
2623  fHistoElePtvsCutVarsRS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsRS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
2625  fHistoElePtvsCutVarsWS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsWS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
2627  fHistoElePtvsCutVarsMCS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsMCS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
2629  }
2630 
2631  return;
2632 }
2633 
2634 //________________________________________________________________________
2635 AliAODRecoCascadeHF* AliAnalysisTaskSEXic2eleXifromAODtracks::MakeCascadeHF(AliAODcascade *casc, AliAODTrack *part, AliAODEvent * aod, AliAODVertex *secVert)
2636 {
2637  //
2638  // Create AliAODRecoCascadeHF object from the argument
2639  //
2640 
2641  if(!casc) return 0x0;
2642  if(!part) return 0x0;
2643  if(!aod) return 0x0;
2644 
2645  //------------------------------------------------
2646  // PrimaryVertex
2647  //------------------------------------------------
2648  AliAODVertex *primVertexAOD;
2649  Bool_t unsetvtx = kFALSE;
2651  primVertexAOD = CallPrimaryVertex(casc,part,aod);
2652  if(!primVertexAOD){
2653  primVertexAOD = fVtx1;
2654  }else{
2655  unsetvtx = kTRUE;
2656  }
2657  }else{
2658  primVertexAOD = fVtx1;
2659  }
2660  if(!primVertexAOD) return 0x0;
2661  Double_t posprim[3]; primVertexAOD->GetXYZ(posprim);
2662 
2663  //------------------------------------------------
2664  // DCA between tracks
2665  //------------------------------------------------
2666  AliESDtrack *esdtrack = new AliESDtrack((AliVTrack*)part);
2667 
2668  Double_t xyz[3], pxpypz[3], cv[21]; Short_t sign;
2669  xyz[0]=casc->DecayVertexXiX();
2670  xyz[1]=casc->DecayVertexXiY();
2671  xyz[2]=casc->DecayVertexXiZ();
2672  pxpypz[0]=casc->MomXiX();
2673  pxpypz[1]=casc->MomXiY();
2674  pxpypz[2]=casc->MomXiZ();
2675  casc->GetCovarianceXYZPxPyPz(cv);
2676  sign=casc->ChargeXi();
2677  AliExternalTrackParam *trackCasc = new AliExternalTrackParam(xyz,pxpypz,cv,sign);
2678 
2679  Double_t xdummy, ydummy;
2680  Double_t dca = esdtrack->GetDCA(trackCasc,fBzkG,xdummy,ydummy);
2681 
2682 
2683  //------------------------------------------------
2684  // Propagate all tracks to the secondary vertex and calculate momentum there
2685  //------------------------------------------------
2686 
2687  Double_t d0z0bach[2],covd0z0bach[3];
2688  if(sqrt(pow(secVert->GetX(),2)+pow(secVert->GetY(),2))<1.){
2689  part->PropagateToDCA(secVert,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
2690  trackCasc->PropagateToDCA(secVert,fBzkG,kVeryBig);
2691  }else{
2692  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
2693  trackCasc->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig);
2694  }
2695  Double_t momcasc_new[3]={-9999,-9999,-9999.};
2696  trackCasc->GetPxPyPz(momcasc_new);
2697 
2698  Double_t px[2],py[2],pz[2];
2699  px[0] = part->Px(); py[0] = part->Py(); pz[0] = part->Pz();
2700  px[1] = momcasc_new[0]; py[1] = momcasc_new[1]; pz[1] = momcasc_new[2];
2701 
2702  //------------------------------------------------
2703  // d0
2704  //------------------------------------------------
2705  Double_t d0[3],d0err[3];
2706 
2707  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
2708  d0[0]= d0z0bach[0];
2709  d0err[0] = TMath::Sqrt(covd0z0bach[0]);
2710 
2711  Double_t d0z0casc[2],covd0z0casc[3];
2712  trackCasc->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0casc,covd0z0casc);
2713  d0[1]= d0z0casc[0];
2714  d0err[1] = TMath::Sqrt(covd0z0casc[0]);
2715 
2716  //------------------------------------------------
2717  // Create AliAODRecoCascadeHF
2718  //------------------------------------------------
2719  Short_t charge = part->Charge();
2720  AliAODRecoCascadeHF *theCascade = new AliAODRecoCascadeHF(secVert,charge,px,py,pz,d0,d0err,dca);
2721  if(!theCascade)
2722  {
2723  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
2724  if(esdtrack) delete esdtrack;
2725  if(trackCasc) delete trackCasc;
2726  return 0x0;
2727  }
2728  theCascade->SetOwnPrimaryVtx(primVertexAOD);
2729  UShort_t id[2]={(UShort_t)part->GetID(),(UShort_t)trackCasc->GetID()};
2730  theCascade->SetProngIDs(2,id);
2731 
2732  theCascade->GetSecondaryVtx()->AddDaughter(part);
2733  theCascade->GetSecondaryVtx()->AddDaughter(casc);
2734  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
2735  if(esdtrack) delete esdtrack;
2736  if(trackCasc) delete trackCasc;
2737 
2738  return theCascade;
2739 }
2740 
2741 //________________________________________________________________________
2742 AliAODVertex* AliAnalysisTaskSEXic2eleXifromAODtracks::CallPrimaryVertex(AliAODcascade *casc, AliAODTrack *trk, AliAODEvent* aod)
2743 {
2744  //
2745  // Make an array of tracks which should not be used in primary vertex calculation and
2746  // Call PrimaryVertex function
2747  //
2748 
2749  TObjArray *TrackArray = new TObjArray(3);
2750 
2751  AliESDtrack *cptrk1 = new AliESDtrack((AliVTrack*)trk);
2752  TrackArray->AddAt(cptrk1,0);
2753 
2754  AliESDtrack *cascptrack = new AliESDtrack((AliVTrack*)casc->GetDaughter(0));
2755  TrackArray->AddAt(cascptrack,1);
2756  AliESDtrack *cascntrack = new AliESDtrack((AliVTrack*)casc->GetDaughter(1));
2757  TrackArray->AddAt(cascntrack,2);
2758  AliESDtrack *cascbtrack = new AliESDtrack((AliVTrack*)casc->GetDecayVertexXi()->GetDaughter(0));
2759  TrackArray->AddAt(cascbtrack,3);
2760 
2761  AliAODVertex *newvert = PrimaryVertex(TrackArray,aod);
2762 
2763  for(Int_t i=0;i<4;i++)
2764  {
2765  AliESDtrack *tesd = (AliESDtrack*)TrackArray->UncheckedAt(i);
2766  delete tesd;
2767  }
2768  TrackArray->Clear();
2769  delete TrackArray;
2770 
2771  return newvert;
2772 }
2773 
2774 //________________________________________________________________________
2775 AliAODVertex* AliAnalysisTaskSEXic2eleXifromAODtracks::PrimaryVertex(const TObjArray *trkArray,
2776  AliVEvent *event)
2777 {
2778  //
2779  //Used only for pp
2780  //copied from AliAnalysisVertexingHF (except for the following 3 lines)
2781  //
2782 
2783  Bool_t fRecoPrimVtxSkippingTrks = kTRUE;
2784  Bool_t fRmTrksFromPrimVtx = kFALSE;
2785 
2786  AliESDVertex *vertexESD = 0;
2787  AliAODVertex *vertexAOD = 0;
2788 
2789  //vertexESD = new AliESDVertex(*fV1);
2790 
2791 
2792  if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) {
2793  // primary vertex from the input event
2794 
2795  vertexESD = new AliESDVertex(*fV1);
2796 
2797  } else {
2798  // primary vertex specific to this candidate
2799 
2800  Int_t nTrks = trkArray->GetEntriesFast();
2801  AliVertexerTracks *vertexer = new AliVertexerTracks(event->GetMagneticField());
2802 
2803  if(fRecoPrimVtxSkippingTrks) {
2804  // recalculating the vertex
2805 
2806  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraint")) {
2807  Float_t diamondcovxy[3];
2808  event->GetDiamondCovXY(diamondcovxy);
2809  Double_t pos[3]={event->GetDiamondX(),event->GetDiamondY(),0.};
2810  Double_t cov[6]={diamondcovxy[0],diamondcovxy[1],diamondcovxy[2],0.,0.,10.*10.};
2811  AliESDVertex *diamond = new AliESDVertex(pos,cov,1.,1);
2812  vertexer->SetVtxStart(diamond);
2813  delete diamond; diamond=NULL;
2814  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraintOnlyFitter"))
2815  vertexer->SetOnlyFitter();
2816  }
2817  Int_t skipped[1000];
2818  Int_t nTrksToSkip=0,id;
2819  AliExternalTrackParam *t = 0;
2820  for(Int_t i=0; i<nTrks; i++) {
2821  t = (AliExternalTrackParam*)trkArray->UncheckedAt(i);
2822  id = (Int_t)t->GetID();
2823  if(id<0) continue;
2824  skipped[nTrksToSkip++] = id;
2825  }
2826  // TEMPORARY FIX
2827  // For AOD, skip also tracks without covariance matrix
2828  Double_t covtest[21];
2829  for(Int_t j=0; j<event->GetNumberOfTracks(); j++) {
2830  AliVTrack *vtrack = (AliVTrack*)event->GetTrack(j);
2831  if(!vtrack->GetCovarianceXYZPxPyPz(covtest)) {
2832  id = (Int_t)vtrack->GetID();
2833  if(id<0) continue;
2834  skipped[nTrksToSkip++] = id;
2835  }
2836  }
2837  for(Int_t ijk=nTrksToSkip; ijk<1000; ijk++) skipped[ijk]=-1;
2838  //
2839  vertexer->SetSkipTracks(nTrksToSkip,skipped);
2840  vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(event);
2841 
2842  } else if(fRmTrksFromPrimVtx && nTrks>0) {
2843  // removing the prongs tracks
2844 
2845  TObjArray rmArray(nTrks);
2846  UShort_t *rmId = new UShort_t[nTrks];
2847  AliESDtrack *esdTrack = 0;
2848  AliESDtrack *t = 0;
2849  for(Int_t i=0; i<nTrks; i++) {
2850  t = (AliESDtrack*)trkArray->UncheckedAt(i);
2851  esdTrack = new AliESDtrack(*t);
2852  rmArray.AddLast(esdTrack);
2853  if(esdTrack->GetID()>=0) {
2854  rmId[i]=(UShort_t)esdTrack->GetID();
2855  } else {
2856  rmId[i]=9999;
2857  }
2858  }
2859  Float_t diamondxy[2]={static_cast<Float_t>(event->GetDiamondX()),static_cast<Float_t>(event->GetDiamondY())};
2860  vertexESD = vertexer->RemoveTracksFromVertex(fV1,&rmArray,rmId,diamondxy);
2861  delete [] rmId; rmId=NULL;
2862  rmArray.Delete();
2863 
2864  }
2865 
2866  delete vertexer; vertexer=NULL;
2867  if(!vertexESD) return vertexAOD;
2868  if(vertexESD->GetNContributors()<=0) {
2869  //AliDebug(2,"vertexing failed");
2870  delete vertexESD; vertexESD=NULL;
2871  return vertexAOD;
2872  }
2873 
2874 
2875  }
2876 
2877  // convert to AliAODVertex
2878  Double_t pos[3],cov[6],chi2perNDF;
2879  vertexESD->GetXYZ(pos); // position
2880  vertexESD->GetCovMatrix(cov); //covariance matrix
2881  chi2perNDF = vertexESD->GetChi2toNDF();
2882  delete vertexESD; vertexESD=NULL;
2883 
2884  vertexAOD = new AliAODVertex(pos,cov,chi2perNDF);
2885 
2886  return vertexAOD;
2887 }
2888 
2889 //________________________________________________________________________
2890 AliAODVertex* AliAnalysisTaskSEXic2eleXifromAODtracks::ReconstructSecondaryVertex(AliAODcascade *casc, AliAODTrack *part, AliAODEvent * aod)
2891 {
2892  //
2893  // Reconstruct secondary vertex from trkArray (Copied from AliAnalysisVertexingHF)
2894  //
2895 
2896  AliAODVertex *primVertexAOD;
2897  Bool_t unsetvtx = kFALSE;
2899  primVertexAOD = CallPrimaryVertex(casc,part,aod);
2900  if(!primVertexAOD){
2901  primVertexAOD = fVtx1;
2902  }else{
2903  unsetvtx = kTRUE;
2904  }
2905  }else{
2906  primVertexAOD = fVtx1;
2907  }
2908  if(!primVertexAOD) return 0x0;
2909 
2910  AliESDVertex * vertexESD = new AliESDVertex(*fV1);
2911 
2912  Double_t pos[3],cov[6],chi2perNDF;
2913  vertexESD->GetXYZ(pos); // position
2914  vertexESD->GetCovMatrix(cov); //covariance matrix
2915  chi2perNDF = vertexESD->GetChi2toNDF();
2916  delete vertexESD; vertexESD=NULL;
2917 
2918  AliAODVertex *secVert = new AliAODVertex(pos,cov,chi2perNDF);
2919 
2920  return secVert;
2921 }
2922 //________________________________________________________________________
2923 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)
2924 {
2925  //
2926  // Match to MC
2927  //
2928  for(Int_t i=0;i<100;i++){
2929  pdgarray_ele[i] = -9999;
2930  labelarray_ele[i] = -9999;
2931  pdgarray_casc[i] = -9999;
2932  labelarray_casc[i] = -9999;
2933  }
2934  ngen_ele = 0;
2935  ngen_casc = 0;
2936 
2937  AliVTrack *trk = dynamic_cast<AliVTrack*>(exobj->GetBachelor());
2938  if(!trk) return -1;
2939  Int_t labEle = trk->GetLabel();
2940  if(labEle<0) return -1;
2941  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
2942  if(!mcetrk) return -1;
2943  labelarray_ele[0] = labEle;
2944  pdgarray_ele[0] = mcetrk->GetPdgCode();
2945  ngen_ele ++;
2946 
2947  AliAODMCParticle *mcprimele=0;
2948  mcprimele = mcetrk;
2949  while(mcprimele->GetMother()>=0) {
2950  Int_t labprim_ele=mcprimele->GetMother();
2951  AliAODMCParticle *tmcprimele = (AliAODMCParticle*)mcArray->At(labprim_ele);
2952  if(!tmcprimele) {
2953  break;
2954  }
2955 
2956  mcprimele = tmcprimele;
2957  pdgarray_ele[ngen_ele] = mcprimele->GetPdgCode();
2958  labelarray_ele[ngen_ele] = labprim_ele;
2959  ngen_ele ++;
2960  if(ngen_ele==100) break;
2961  }
2962 
2963  AliAODcascade *theCascade = dynamic_cast<AliAODcascade*>(exobj->GetCascade());
2964  if(!theCascade) return -1;
2965 
2966  Int_t pdgDgcasc[2]={211,3122};
2967  Int_t pdgDgv0[2]={2212,211};
2968  Int_t labcasc = MatchToMCCascade(theCascade,3312,pdgDgcasc,pdgDgv0,mcArray); // the cascade
2969  if(labcasc<0) return -1;
2970 
2971  AliAODMCParticle *mccasc = (AliAODMCParticle*)mcArray->At(labcasc);
2972  if(!mccasc) return -1;
2973  labelarray_casc[0] = labcasc;
2974  pdgarray_casc[0] = mccasc->GetPdgCode();
2975  ngen_casc ++;
2976 
2977  AliAODMCParticle *mcprimcasc=0;
2978  mcprimcasc = mccasc;
2979  while(mcprimcasc->GetMother()>=0) {
2980  Int_t labprim_casc=mcprimcasc->GetMother();
2981  AliAODMCParticle *tmcprimcasc = (AliAODMCParticle*)mcArray->At(labprim_casc);
2982  if(!tmcprimcasc) {
2983  break;
2984  }
2985 
2986  mcprimcasc = tmcprimcasc;
2987  pdgarray_casc[ngen_casc] = mcprimcasc->GetPdgCode();
2988  labelarray_casc[ngen_casc] = labprim_casc;
2989  ngen_casc ++;
2990  if(ngen_casc==100) break;
2991  }
2992 
2993  Bool_t same_flag = kFALSE;
2994  Int_t matchedlabel=-9999;
2995  for(Int_t iemc=0;iemc<ngen_ele;iemc++){
2996  for(Int_t ivmc=0;ivmc<ngen_casc;ivmc++){
2997  if(labelarray_ele[iemc]==labelarray_casc[ivmc]){
2998  same_flag = kTRUE;
2999  matchedlabel = labelarray_ele[iemc];
3000  break;
3001  }
3002  }
3003  if(same_flag) break;
3004  }
3005 
3006  return matchedlabel;
3007 
3008 }
3009 //________________________________________________________________________
3010 Int_t AliAnalysisTaskSEXic2eleXifromAODtracks::MatchToMCCascade(AliAODcascade *theCascade, Int_t pdgabscasc, Int_t *pdgDgcasc, Int_t *pdgDgv0, TClonesArray *mcArray) const // the cascade
3011 {
3012  //
3013  // Matching to MC of cascade
3014  //
3015 
3016  AliAODTrack *cptrack = (AliAODTrack*) theCascade->GetDaughter(0);
3017  if(!cptrack) return -1;
3018  Int_t label_p = cptrack->GetLabel();
3019  if(label_p<0) return -1;
3020  AliAODTrack *cntrack = (AliAODTrack*) theCascade->GetDaughter(1);
3021  if(!cntrack) return -1;
3022  Int_t label_n = cntrack->GetLabel();
3023  if(label_n<0) return -1;
3024  Int_t labv0 = theCascade->MatchToMC(pdgDgcasc[1],mcArray,2,pdgDgv0);
3025  if(labv0<0) return -1;
3026  AliAODMCParticle *mcpartv0= (AliAODMCParticle*) mcArray->At(labv0);
3027 
3028  AliAODTrack *cbtrack = (AliAODTrack*) theCascade->GetDecayVertexXi()->GetDaughter(0);
3029  if(!cbtrack) return -1;
3030 
3031  Int_t label_b = cbtrack->GetLabel();
3032  if(label_b<0) return -1;
3033 
3034  AliAODMCParticle *mcpartb= (AliAODMCParticle*) mcArray->At(label_b);
3035  Int_t pdgb = TMath::Abs(mcpartb->GetPdgCode());
3036  if(pdgb!=pdgDgcasc[0]) return -1;
3037 
3038  AliAODMCParticle *mcmotherv0=mcpartv0;
3039  Bool_t isFromXiv0 = kFALSE;
3040  Int_t labxiv0 = mcmotherv0->GetMother();
3041  if(labxiv0<0) return -1;
3042  mcmotherv0 = (AliAODMCParticle*) mcArray->At(labxiv0);
3043  if(mcmotherv0){
3044  Int_t pdg = TMath::Abs(mcmotherv0 ->GetPdgCode());
3045  if(pdg==pdgabscasc){
3046  isFromXiv0 = kTRUE;
3047  }
3048  }
3049  if(!isFromXiv0) return -1;
3050 
3051  AliAODMCParticle *mcmotherb=mcpartb;
3052  Bool_t isFromXib = kFALSE;
3053  Int_t labxib = mcmotherb->GetMother();
3054  if(labxib<0) return -1;
3055  mcmotherb = (AliAODMCParticle*) mcArray->At(labxib);
3056  if(mcmotherb){
3057  Int_t pdg = TMath::Abs(mcmotherb ->GetPdgCode());
3058  if(pdg==pdgabscasc){
3059  isFromXib = kTRUE;
3060  }
3061  }
3062  if(!isFromXib) return -1;
3063 
3064  if(labxiv0!=labxib) return -1;//Bachelor and V0 should come from the same Xi
3065 
3066  return labxib;
3067 }
3068 //________________________________________________________________________
3069 void AliAnalysisTaskSEXic2eleXifromAODtracks::SelectTrack( const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks,Bool_t *seleFlags, TClonesArray *mcArray)
3070 {
3071  //
3072  // Select good tracks using fAnalCuts (AliRDHFCuts object) and return the array of their ids
3073  //
3074 
3075  //const Int_t entries = event->GetNumberOfTracks();
3076  if(trkEntries==0) return;
3077 
3078  nSeleTrks=0;
3079  for(Int_t i=0; i<trkEntries; i++) {
3080  seleFlags[i] = kFALSE;
3081 
3082  AliVTrack *track;
3083  track = (AliVTrack*)event->GetTrack(i);
3084 
3085  if(track->GetID()<0) continue;
3086  Double_t covtest[21];
3087  if(!track->GetCovarianceXYZPxPyPz(covtest)) continue;
3088 
3089  AliAODTrack *aodt = (AliAODTrack*)track;
3090  Double_t nsigma_tpcele = -9999;
3091  Double_t nsigma_tofele = -9999;
3092  if(fAnalCuts->GetIsUsePID()){
3093  nsigma_tpcele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(aodt,AliPID::kElectron);
3094  nsigma_tofele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(aodt,AliPID::kElectron);
3095  }
3096 
3097  if(!fAnalCuts) continue;
3098  if(fAnalCuts->SingleTrkCutsNoPID(aodt,fVtx1)){
3099  fHistoElectronTPCPID->Fill(aodt->Pt(),nsigma_tpcele);
3100  fHistoElectronTOFPID->Fill(aodt->Pt(),nsigma_tofele);
3101  if(fabs(nsigma_tofele)<3.){
3102  fHistoElectronTPCPIDSelTOF->Fill(aodt->Pt(),nsigma_tpcele);
3103  Double_t eleeta = aodt->Eta();
3104  if(fabs(eleeta)<0.6)
3105  fHistoElectronTPCPIDSelTOFSmallEta->Fill(aodt->Pt(),nsigma_tpcele);
3106  if(fabs(eleeta)>0.6 && fabs(eleeta)<0.8)
3107  fHistoElectronTPCPIDSelTOFLargeEta->Fill(aodt->Pt(),nsigma_tpcele);
3108  if(eleeta>-0.8 && eleeta<-0.6){
3109  fHistoElectronTPCPIDSelTOFEtaDep[0]->Fill(aodt->Pt(),nsigma_tpcele);
3110  }else if(eleeta>-0.6&&eleeta<-0.4){
3111  fHistoElectronTPCPIDSelTOFEtaDep[1]->Fill(aodt->Pt(),nsigma_tpcele);
3112  }else if(eleeta>-0.4&&eleeta<-0.2){
3113  fHistoElectronTPCPIDSelTOFEtaDep[2]->Fill(aodt->Pt(),nsigma_tpcele);
3114  }else if(eleeta>-0.2&&eleeta<0.0){
3115  fHistoElectronTPCPIDSelTOFEtaDep[3]->Fill(aodt->Pt(),nsigma_tpcele);
3116  }else if(eleeta>0.0&&eleeta<0.2){
3117  fHistoElectronTPCPIDSelTOFEtaDep[4]->Fill(aodt->Pt(),nsigma_tpcele);
3118  }else if(eleeta>0.2&&eleeta<0.4){
3119  fHistoElectronTPCPIDSelTOFEtaDep[5]->Fill(aodt->Pt(),nsigma_tpcele);
3120  }else if(eleeta>0.4&&eleeta<0.6){
3121  fHistoElectronTPCPIDSelTOFEtaDep[6]->Fill(aodt->Pt(),nsigma_tpcele);
3122  }else if(eleeta>0.6&&eleeta<0.8){
3123  fHistoElectronTPCPIDSelTOFEtaDep[7]->Fill(aodt->Pt(),nsigma_tpcele);
3124  }
3125  }
3126  if(nsigma_tpcele>-0.5&&nsigma_tpcele<3.){
3127  fHistoElectronTOFPIDSelTPC->Fill(aodt->Pt(),nsigma_tofele);
3128  }
3129  }
3130  if(fAnalCuts->SingleTrkCuts(aodt,fVtx1)){
3131  seleFlags[i]=kTRUE;
3132  nSeleTrks++;
3133  fHistoElectronTPCSelPID->Fill(aodt->Pt(),nsigma_tpcele);
3134  fHistoElectronTOFSelPID->Fill(aodt->Pt(),nsigma_tofele);
3135  FillElectronROOTObjects(aodt,mcArray);
3136  }
3137  } // end loop on tracks
3138 }
3139 //________________________________________________________________________
3140 void AliAnalysisTaskSEXic2eleXifromAODtracks::SelectCascade( const AliVEvent *event,Int_t nCascs,Int_t &nSeleCasc, Bool_t *seleCascFlags, TClonesArray *mcArray)
3141 {
3142  //
3143  // Select good Casc using fAnalCuts (AliRDHFCuts object) and return the array of their ids
3144  //
3145 
3146  Double_t primVtx[3];
3147  fVtx1->GetXYZ(primVtx);
3148 
3149  nSeleCasc = 0;
3150  for(Int_t icasc=0;icasc<nCascs;icasc++)
3151  {
3152  seleCascFlags[icasc] = kFALSE;
3153  AliAODcascade *casc = ((AliAODEvent*)event)->GetCascade(icasc);
3154 
3155  if(!fAnalCuts) continue;
3156  if(fAnalCuts->SingleCascadeCuts(casc,primVtx)){
3157  seleCascFlags[icasc] = kTRUE;
3158  nSeleCasc++;
3159 
3160  FillCascROOTObjects(casc,mcArray);
3161  }
3162  }
3163 }
3164 //_________________________________________________________________
3165 Int_t AliAnalysisTaskSEXic2eleXifromAODtracks::GetPoolIndex(Double_t zvert, Double_t mult){
3166  //
3167  // check in which of the pools the current event falls
3168  //
3169 
3170  Int_t theBinZ=TMath::BinarySearch(fNzVtxBins,fZvtxBins,zvert);
3171  if(theBinZ<0 || theBinZ>=fNzVtxBins) return -1;
3172  Int_t theBinM=TMath::BinarySearch(fNCentBins,fCentBins,mult);
3173  if(theBinM<0 || theBinM>=fNCentBins) return -1;
3174  return fNCentBins*theBinZ+theBinM;
3175 }
3176 //_________________________________________________________________
3178  //
3179  // delete the contets of the pool
3180  //
3181  if(poolIndex<0 || poolIndex>=fNOfPools) return;
3182  delete fEventBuffer[poolIndex];
3183  fEventBuffer[poolIndex]=new TTree(Form("EventBuffer_%d",poolIndex), "Temporary buffer for event mixing");
3184 
3185  fEventBuffer[poolIndex]->Branch("zVertex", &fVtxZ);
3186  fEventBuffer[poolIndex]->Branch("centrality", &fCentrality);
3187  fEventBuffer[poolIndex]->Branch("eventInfo", "TObjString",&fEventInfo);
3188  fEventBuffer[poolIndex]->Branch("c1array", "TObjArray", &fCascadeTracks1);
3189  fEventBuffer[poolIndex]->Branch("c2array", "TObjArray", &fCascadeTracks2);
3190 
3191  return;
3192 }
3193 //_________________________________________________________________
3195 {
3196  //
3197  // perform mixed event analysis
3198  //
3199 
3200  if(poolIndex<0 || poolIndex>fNzVtxBins*fNCentBins) return;
3201  if(fEventBuffer[poolIndex]->GetEntries()<fNumberOfEventsForMixing) return;
3202 
3203  Int_t nEle = fElectronTracks->GetEntries();
3204  Int_t nEvents=fEventBuffer[poolIndex]->GetEntries();
3205 
3206  TObjArray* c1array=0x0;
3207  TObjArray* c2array=0x0;
3208  Float_t zVertex,cent;
3209  TObjString* eventInfo=0x0;
3210  fEventBuffer[poolIndex]->SetBranchAddress("zVertex", &zVertex);
3211  fEventBuffer[poolIndex]->SetBranchAddress("eventInfo",&eventInfo);
3212  fEventBuffer[poolIndex]->SetBranchAddress("centrality", &cent);
3213  fEventBuffer[poolIndex]->SetBranchAddress("c1array", &c1array);
3214  fEventBuffer[poolIndex]->SetBranchAddress("c2array", &c2array);
3215  for (Int_t i=0; i<nEle; i++)
3216  {
3217  TLorentzVector* trke=(TLorentzVector*) fElectronTracks->At(i);
3218  if(!trke)continue;
3219 
3220  for(Int_t iEv=0; iEv<fNumberOfEventsForMixing; iEv++){
3221  fEventBuffer[poolIndex]->GetEvent(iEv + nEvents - fNumberOfEventsForMixing);
3222  TObjArray* c1array1=(TObjArray*)c1array->Clone();
3223  Int_t nCascs1=c1array1->GetEntries();
3224  //Float_t zVertex1=zVertex;
3225  //Float_t mult1=cent;
3226 // Int_t evId1,esdId1,ne1,nv1;
3227 // sscanf((eventInfo->String()).Data(),"Ev%d_esd%d_E%d_C%d",&evId1,&esdId1,&ne1,&nv1);
3228 // if(nv1!=(nCascs1+nCascs2)){
3229 // printf("AliAnalysisTaskSEXic2eleXifromAODtracks::DoMixingWithPools ERROR: read event does not match to the stored one\n");
3230 // delete c1array1;
3231 // delete c2array1;
3232 // continue;
3233 // }
3234  for(Int_t iTr1=0; iTr1<nCascs1; iTr1++){
3235  TLorentzVector* casc1=(TLorentzVector*) c1array1->At(iTr1);
3236  if(!casc1) continue;
3237  FillMixROOTObjects(trke,casc1,1);
3238  }//casc loop
3239 
3240  TObjArray* c2array1=(TObjArray*)c2array->Clone();
3241  Int_t nCascs2=c2array1->GetEntries();
3242  for(Int_t iTr2=0; iTr2<nCascs2; iTr2++){
3243  TLorentzVector* casc2=(TLorentzVector*) c2array1->At(iTr2);
3244  if(!casc2) continue;
3245  FillMixROOTObjects(trke,casc2,-1);
3246  }//casc loop
3247 
3248  delete c1array1;
3249  delete c2array1;
3250  }//event loop
3251  }//track loop
3252 }
3253 //_________________________________________________________________
3255 {
3256  //
3257  // Analyze AliAODmcparticle
3258  //
3259 
3260  Int_t nmcpart = mcArray->GetEntriesFast();
3261  for(Int_t i=0;i<nmcpart;i++)
3262  {
3263  AliAODMCParticle *mcpart = (AliAODMCParticle*) mcArray->At(i);
3264  if(TMath::Abs(mcpart->GetPdgCode())==4132){
3265  Bool_t e_flag = kFALSE;
3266  Bool_t xi_flag = kFALSE;
3267  AliAODMCParticle *mcepart = 0;
3268  AliAODMCParticle *mccascpart = 0;
3269  for(Int_t idau=mcpart->GetFirstDaughter();idau<mcpart->GetLastDaughter()+1;idau++)
3270  {
3271  if(idau<0) break;
3272  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
3273  if(!mcdau) continue;
3274  if(TMath::Abs(mcdau->GetPdgCode())==11){
3275  e_flag = kTRUE;
3276  mcepart = mcdau;
3277  }
3278  if(TMath::Abs(mcdau->GetPdgCode())==3312){
3279  xi_flag = kTRUE;
3280  mccascpart = mcdau;
3281  }
3282  }
3283 
3284  Int_t decaytype = -9999;
3285  if(e_flag && xi_flag) decaytype = 0;
3286 
3287  FillMCROOTObjects(mcpart,mcepart,mccascpart,decaytype);
3288  }
3289  if(TMath::Abs(mcpart->GetPdgCode())==11 && mcpart->GetStatus()==1){
3290  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
3291  Float_t etamin, etamax;
3292  esdcuts->GetEtaRange(etamin,etamax);
3293  if(fabs(mcpart->Eta())<etamax){
3294  fHistoBachPtMCGen->Fill(mcpart->Pt());
3295  }
3296  FillMCEleROOTObjects(mcpart, mcArray);
3297  }
3298  if(TMath::Abs(mcpart->GetPdgCode())==3312){
3299  Double_t etamin, etamax, rapmin, rapmax;
3300  fAnalCuts->GetProdCascEtaRange(etamin,etamax);
3301  fAnalCuts->GetProdCascRapRange(rapmin,rapmax);
3302 
3303  if((fabs(mcpart->Y())<rapmax) && (fabs(mcpart->Eta())<etamax)){
3304  fHistoXiMassvsPtMCGen->Fill(1.32171, mcpart->Pt());
3305  }
3306  FillMCCascROOTObjects(mcpart, mcArray);
3307  }
3308  }
3309  return;
3310 }
Int_t charge
THnSparse * fHistoEleXiMassvsElePtWS2
! e-Xi mass spectra (wrong-sign)
Int_t pdg
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
THnSparse * fHistoElePtvsXiPtMCGen
! e-Xi spectra efficiency denominator
Bool_t IsEventRejectedDueToNotRecoVertex() const
Definition: AliRDHFCuts.h:298
Bool_t SingleCascadeCuts(AliAODcascade *casc, Double_t *vert)
TH1F * fHistoBachPtMCGen
! Bachelor pT histogram (efficiency denominator)
THnSparse * fHistoElePtvsd0RS
! e pt-d0 spectra (right-sign)
TH2F * fHistoElectronTPCPIDSelTOFEtaDep[8]
! TPC electron PID after TOF 3 sigma cut Eta dep
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 * fHistoElePtvsXiPtRSMix
! e-Xi spectra (right-sign, mix)
Float_t * fCandidateMCVariables
! variables to be written to the tree
void SelectTrack(const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks, Bool_t *seleFlags, TClonesArray *mcArray)
THnSparse * fHistoElePtvsCutVarsRS[23]
! e pt- cut variables (Right-sign)
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 * 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 * fHistoEleXiMassvsElePtMCS
! e-Xi mass-ept spectra (Efficiency numerator)
THnSparse * fHistoEleXiMassvsElePtMCS2
! e-Xi mass-ept spectra (Efficiency numerator)
void FillMCCascROOTObjects(AliAODMCParticle *mccpart, 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)
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
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
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)
void FillCascROOTObjects(AliAODcascade *casc, TClonesArray *mcArray)
Bool_t IsEventSelected(AliVEvent *event)
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)
Bool_t fIsMB
Reconstruct primary vertex excluding candidate tracks.
THnSparse * fHistoElePtvsEtaRSMix
! e spectra (right-sign, mix)
THnSparse * fHistoEleXiMassvsElePtRSMix
! e-Xi mass-ept spectra (right-sign)
const Double_t etamax
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 * 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)
TH2F * fHistoElectronTPCSelPID
! TPC electron PID after selection
void FillMixROOTObjects(TLorentzVector *et, TLorentzVector *ev, Int_t charge)
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)
THnSparse * fHistoElePtvsXiPtMCXicGen
! e-Xi spectra efficiency denominator
THnSparse * fHistoElePtvsXiPtvsXicPtMCGen
! e-Xi spectra efficiency numerator
TTree * fVariablesTree
flag to decide whether to write the candidate variables on a tree variables