AliPhysics  master (3d17d9d)
AliAnalysisTaskSEXicZero2XiPifromAODtracks.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 // XicZero2XiPi analysis code
21 //
22 // Input: AOD
23 // Output: TTree or THnSparse (mass vs pT vs Centrality)
24 //
25 // Cuts:
26 // TTree: very loose cut
27 // THnSparse: One THnSparse is created per cut. One cut is specified by
28 // an array of bits, each bit corresponds to a cut in "Cut" function.
29 //
30 //-------------------------------------------------------------------------
31 //
32 // Authors: Y.S Watanabe(a)
33 // (a) CNS, the University of Tokyo
34 // Contatcs: wyosuke@cns.s.u-tokyo.ac.jp
35 //
36 // Modified by Jianhui Zhu, zjh@mail.ccnu.edu.cn
37 //
38 //-------------------------------------------------------------------------
39 
40 #include <TSystem.h>
41 #include <TParticle.h>
42 #include <TParticlePDG.h>
43 #include <THnSparse.h>
44 #include <TH1F.h>
45 #include <TH2F.h>
46 #include <TLorentzVector.h>
47 #include <TTree.h>
48 #include "TROOT.h"
49 #include <TDatabasePDG.h>
50 #include <AliAnalysisDataSlot.h>
51 #include <AliAnalysisDataContainer.h>
52 #include "AliMCEvent.h"
53 #include "AliAnalysisManager.h"
54 #include "AliAODMCHeader.h"
55 #include "AliAODHandler.h"
56 #include "AliLog.h"
57 #include "AliExternalTrackParam.h"
58 #include "AliAODVertex.h"
59 #include "AliESDVertex.h"
60 #include "AliAODRecoDecay.h"
61 #include "AliAODRecoDecayHF.h"
62 #include "AliAODRecoCascadeHF.h"
63 #include "AliESDtrack.h"
64 #include "AliAODTrack.h"
65 #include "AliAODv0.h"
66 #include "AliAODcascade.h"
67 #include "AliAODMCParticle.h"
68 #include "AliAnalysisTaskSE.h"
69 #include "AliPIDResponse.h"
70 #include "AliPIDCombined.h"
71 #include "AliAODPidHF.h"
72 #include "AliInputEventHandler.h"
73 #include "AliESDtrackCuts.h"
74 #include "AliNeutralTrackParam.h"
75 #include "AliKFParticle.h"
76 #include "AliKFVertex.h"
77 #include "AliExternalTrackParam.h"
78 #include "AliCentrality.h"
79 #include "AliVertexerTracks.h"
81 
82 using std::cout;
83 using std::endl;
84 
88 
89 //__________________________________________________________________________
92  fUseMCInfo(kFALSE),
93  fFillSignalOnly(kFALSE),
94  fFillBkgOnly(kFALSE),
95  fOutput(0),
96  fOutputAll(0),
97  fListCuts(0),
98  fCEvents(0),
99  fHTrigger(0),
100  fHCentrality(0),
101  fHSelectedCascadePerEv(0),
102  fHSelectedTracksPerEv(0),
103  fAnalCuts(0),
104  fIsEventSelected(kFALSE),
105  fWriteVariableTree(kFALSE),
106  fAnaOmegacZero(kFALSE),
107  fVariablesTree(0),
108  fReconstructPrimVert(kFALSE),
109  fIsMB(kFALSE),
110  fIsSemi(kFALSE),
111  fIsCent(kFALSE),
112  fIsINT7(kFALSE),
113  fIsEMC7(kFALSE),
114  fCandidateVariables(0),
115  fVtx1(0),
116  fV1(0),
117  fBzkG(0),
118  fCentrality(0),
119  fTriggerCheck(0),
120  fHistoXicMass(0),
121  fHistoDcaPiCasc(0),
122  fHistoCascDcaXiDaughters(0),
123  fHistoCascDcaV0Daughters(0),
124  fHistoCascDcaV0ToPrimVertex(0),
125  fHistoCascDcaPosToPrimVertex(0),
126  fHistoCascDcaNegToPrimVertex(0),
127  fHistoCascDcaBachToPrimVertex(0),
128  fHistoCascCosPAXiPrim(0),
129  fHistoXiPt(0),
130  fHistoPiPt(0),
131  fHistoPid0(0),
132  fHistonSigmaTPCpi(0),
133  fHistonSigmaTOFpi(0),
134  fHistoProbPion(0),
135  fHistoXiMassvsPtRef(0),
136  fHistoXiMassvsPtRef2(0),
137  fHistoXiMassvsPtRef3(0),
138  fHistoXiMassvsPtRef4(0),
139  fHistoXiMassvsPtRef5(0),
140  fHistoXiMassvsPtRef6(0),
141  fHistoPiPtRef(0)
142 {
143  //
144  // Default Constructor.
145  //
146 }
147 
148 //___________________________________________________________________________
151  Bool_t writeVariableTree,
152  Bool_t anaOmegacZero) :
153  AliAnalysisTaskSE(name),
154  fUseMCInfo(kFALSE),
155  fFillSignalOnly(kFALSE),
156  fFillBkgOnly(kFALSE),
157  fOutput(0),
158  fOutputAll(0),
159  fListCuts(0),
160  fCEvents(0),
161  fHTrigger(0),
162  fHCentrality(0),
165  fAnalCuts(analCuts),
166  fIsEventSelected(kFALSE),
167  fWriteVariableTree(writeVariableTree),
168  fAnaOmegacZero(anaOmegacZero),
169  fVariablesTree(0),
170  fReconstructPrimVert(kFALSE),
171  fIsMB(kFALSE),
172  fIsSemi(kFALSE),
173  fIsCent(kFALSE),
174  fIsINT7(kFALSE),
175  fIsEMC7(kFALSE),
177  fVtx1(0),
178  fV1(0),
179  fBzkG(0),
180  fCentrality(0),
181  fTriggerCheck(0),
182  fHistoXicMass(0),
183  //fHistoDcaPi1Pi2(0),
184  fHistoDcaPiCasc(0),
185  //fHistoLikeDecayLength(0),
186  //fHistoLikeDecayLengthXY(0),
187  //fHistoXicCosPAXY(0),
188  fHistoXiMass(0),
196  fHistoXiPt(0),
197  fHistoPiPt(0),
198  fHistoPid0(0),
201  fHistoProbPion(0),
208  fHistoPiPtRef(0)
209 {
210  //
211  // Constructor. Initialization of Inputs and Outputs
212  //
213  Info("AliAnalysisTaskSEXicZero2XiPifromAODtracks","Calling Constructor");
214 
215  DefineOutput(1,TList::Class());
216  DefineOutput(2,TList::Class());
217  if(writeVariableTree){
218  DefineOutput(3,TTree::Class());
219  }else{
220  DefineOutput(3,TList::Class());
221  }
222 }
223 
224 //___________________________________________________________________________
226  //
227  // destructor
228  //
229  Info("~AliAnalysisTaskSEXicZero2XiPifromAODtracks","Calling Destructor");
230 
231 
232  if (fOutput) {
233  delete fOutput;
234  fOutput = 0;
235  }
236 
237  if (fOutputAll) {
238  delete fOutputAll;
239  fOutputAll = 0;
240  }
241 
242  if (fListCuts) {
243  delete fListCuts;
244  fListCuts = 0;
245  }
246 
247 
248  if (fAnalCuts) {
249  delete fAnalCuts;
250  fAnalCuts = 0;
251  }
252 
253  if (fVariablesTree) {
254  delete fVariablesTree;
255  fVariablesTree = 0;
256  }
257 
259  delete fCandidateVariables;
261  }
262 
263 }
264 
265 //_________________________________________________
267  //
268  // Initialization
269  //
270  //
271 
272  //Copied from $ALICE_ROOT/PWGHF/vertexingHF/ConfigVertexingHF.C
273 
274  fIsEventSelected=kFALSE;
275 
276  if (fDebug > 1) AliInfo("Init");
277 
278  fListCuts = new TList();
279  fListCuts->SetOwner();
280  fListCuts->SetName("ListCuts");
282  PostData(2,fListCuts);
283 
284  return;
285 }
286 
287 //_________________________________________________
289 {
290  //
291  // UserExec code
292  //
293  if (!fInputEvent) {
294  AliError("NO EVENT FOUND!");
295  return;
296  }
297  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
298 
299 
300  fCEvents->Fill(1);
301  //------------------------------------------------
302  // First check if the event has proper vertex and B
303  //------------------------------------------------
304  fVtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
305  if (!fVtx1) return;
306 
307  Double_t pos[3],cov[6];
308  fVtx1->GetXYZ(pos);
309  fVtx1->GetCovarianceMatrix(cov);
310  fV1 = new AliESDVertex(pos,cov,100.,100,fVtx1->GetName());
311 
312  fBzkG = (Double_t)aodEvent->GetMagneticField();
313  AliKFParticle::SetField(fBzkG);
314  if (TMath::Abs(fBzkG)<0.001) {
315  delete fV1;
316  return;
317  }
318  fCEvents->Fill(2);
319 
320  //------------------------------------------------
321  // Event selection
322  //------------------------------------------------
323  Bool_t fIsTriggerNotOK = fAnalCuts->IsEventRejectedDueToTrigger();
324  if(!fIsTriggerNotOK) fCEvents->Fill(3);
325 
327  if(!fIsEventSelected) {
328  //cout<<"Why: "<<fAnalCuts->GetWhyRejection()<<endl;
329  delete fV1;
330  return;
331  }
332 
333  //cout<<fabs(aodEvent->GetPrimaryVertex()->GetZ()-aodEvent->GetPrimaryVertexSPD()->GetZ())<<endl;
334 
335  fCEvents->Fill(4);
336 
337  fIsMB=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kMB)==(AliVEvent::kMB);
338  fIsSemi=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kSemiCentral)==(AliVEvent::kSemiCentral);
339  fIsCent=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kCentral)==(AliVEvent::kCentral);
340  fIsINT7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kINT7)==(AliVEvent::kINT7);
341  fIsEMC7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kEMC7)==(AliVEvent::kEMC7);
343  if(fIsMB) fHTrigger->Fill(1);
344  if(fIsSemi) fHTrigger->Fill(2);
345  if(fIsCent) fHTrigger->Fill(3);
346  if(fIsINT7) fHTrigger->Fill(4);
347  if(fIsEMC7) fHTrigger->Fill(5);
348  if(fIsMB|fIsSemi|fIsCent) fHTrigger->Fill(7);
349  if(fIsINT7|fIsEMC7) fHTrigger->Fill(8);
350  if(fIsMB&fIsSemi) fHTrigger->Fill(10);
351  if(fIsMB&fIsCent) fHTrigger->Fill(11);
352  if(fIsINT7&fIsEMC7) fHTrigger->Fill(12);
353 
354  AliCentrality *cent = aodEvent->GetCentrality();
355  fCentrality = cent->GetCentralityPercentile("V0M");
356  fHCentrality->Fill(fCentrality);
357 
358  //------------------------------------------------
359  // Check if the event has cascade candidate
360  //------------------------------------------------
361  Int_t ncasc = aodEvent->GetNumberOfCascades();
362  Int_t nselecasc = 0.;
363  for(Int_t ic=0;ic<ncasc;ic++){
364  AliAODcascade *casc = aodEvent->GetCascade(ic);
365  if(!fAnalCuts) continue;
366  if(fAnalCuts->SingleCascadeCuts(casc,pos,fAnaOmegacZero)) nselecasc++;
367  }
368 
369  if(nselecasc==0){
370  delete fV1;
371  return;
372  }
373 
374  fCEvents->Fill(5);
375 
376  //------------------------------------------------
377  // MC analysis setting
378  //------------------------------------------------
379 
380  TClonesArray *mcArray = 0;
381  AliAODMCHeader *mcHeader=0;
382  if (fUseMCInfo) {
383  // MC array need for maching
384  mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
385  if (!mcArray) {
386  AliError("Could not find Monte-Carlo in AOD");
387  delete fV1;
388  return;
389  }
390  fCEvents->Fill(6); // in case of MC events
391 
392  // load MC header
393  mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
394  if (!mcHeader) {
395  AliError("AliAnalysisTaskSEXicZero2XiPifromAODtracks::UserExec: MC header branch not found!\n");
396  delete fV1;
397  return;
398  }
399  fCEvents->Fill(7); // in case of MC events
400 
401  Double_t zMCVertex = mcHeader->GetVtxZ();
402  if (TMath::Abs(zMCVertex) > fAnalCuts->GetMaxVtxZ()) {
403  AliDebug(2,Form("Event rejected: abs(zVtxMC)=%f > fAnalCuts->GetMaxVtxZ()=%f",zMCVertex,fAnalCuts->GetMaxVtxZ()));
404  delete fV1;
405  return;
406  } else {
407  fCEvents->Fill(17); // in case of MC events
408  }
409  }
410 
411  //------------------------------------------------
412  // Main analysis done in this function
413  //------------------------------------------------
414  MakeAnalysis(aodEvent, mcArray);
415 
416  PostData(1,fOutput);
417  if(fWriteVariableTree){
418  PostData(3,fVariablesTree);
419  }else{
420  PostData(3,fOutputAll);
421  }
422 
423  fIsEventSelected=kFALSE;
424 
425  delete fV1;
426  return;
427 }
428 
429 //________________________________________ terminate ___________________________
431 {
432  // The Terminate() function is the last function to be called during
433  // a query. It always runs on the client, it can be used to present
434  // the results graphically or save the results to file.
435 
436  //AliInfo("Terminate","");
437  AliAnalysisTaskSE::Terminate();
438 
439  fOutput = dynamic_cast<TList*> (GetOutputData(1));
440  if (!fOutput) {
441  AliError("fOutput not available");
442  return;
443  }
444 
445  if(!fWriteVariableTree){
446  fOutputAll = dynamic_cast<TList*> (GetOutputData(3));
447  if (!fOutputAll) {
448  AliError("fOutputAll not available");
449  return;
450  }
451  }
452 
453  return;
454 }
455 
456 //___________________________________________________________________________
458 {
459  //
460  // UserCreateOutputObjects
461  //
462 
463  AliInfo(Form("CreateOutputObjects of task %s\n", GetName()));
464 
465  //------------------------------------------------
466  // output object setting
467  //------------------------------------------------
468  fOutput = new TList();
469  fOutput->SetOwner();
470  fOutput->SetName("chist0");
471  DefineGeneralHistograms(); // define general histograms
472  PostData(1,fOutput);
473 
475  if (fWriteVariableTree) {
476  PostData(3,fVariablesTree);
477  }else{
478  fOutputAll = new TList();
479  fOutputAll->SetOwner();
480  fOutputAll->SetName("anahisto");
481  //DefineAnalysisHistograms(); // define general histograms
482  PostData(3,fOutputAll);
483  }
484 
485 
486  return;
487 }
488 
489 //________________________________________________________________________
491 {
492  //
493  // Main analysis part called from UserExec
494  //
495 
496  Int_t nCascades= aodEvent->GetNumberOfCascades();
497  if (nCascades==0) {
498  return;
499  }
500  Int_t nTracks= aodEvent->GetNumberOfTracks();
501  if (nTracks==0) {
502  return;
503  }
504 
505  //------------------------------------------------
506  // Select good track before hand to save time
507  //------------------------------------------------
508  Bool_t seleTrkFlags[nTracks];
509  Int_t nSeleTrks=0;
510  SelectTrack(aodEvent,nTracks,nSeleTrks,seleTrkFlags);
511  Bool_t seleCascFlags[nCascades];
512  Int_t nSeleCasc=0;
513  SelectCascade(aodEvent,nCascades,nSeleCasc,seleCascFlags);
514 
515  Int_t usedmclab[20];//Used Xic Label: Assuming there are less than 20 Xic/evt
516  Int_t nusedmclab[20];//Number of times the Xic label is used: Assuming there are less than 20 Xic/evt
517  for(Int_t i=0;i<20;i++) {
518  usedmclab[i]=-9999;
519  nusedmclab[i]=0;
520  }
521 
522  //------------------------------------------------
523  // Cascade loop
524  //------------------------------------------------
525  Int_t counterSelectedCascades = 0;
526  for (Int_t icasc = 0; icasc<nCascades; icasc++) {
527  if(!seleCascFlags[icasc]) continue;
528  AliAODcascade *casc = aodEvent->GetCascade(icasc);
529  if(!casc) continue;
530 
531  AliAODTrack *cptrack = (AliAODTrack*)(casc->GetDaughter(0));
532  AliAODTrack *cntrack = (AliAODTrack*)(casc->GetDaughter(1));
533  AliAODTrack *cbtrack = (AliAODTrack*)(casc->GetDecayVertexXi()->GetDaughter(0));
534  if(!cptrack || !cntrack || !cbtrack) continue;
535 
536  Int_t cpid = cptrack->GetID();
537  Int_t cnid = cntrack->GetID();
538  Int_t cbid = cbtrack->GetID();
539 
540  if(cptrack->Charge()==0) continue;
541  if(cntrack->Charge()==0) continue;
542  if(cbtrack->Charge()==0) continue;
543 
544  Short_t charge_casc = cptrack->Charge() + cntrack->Charge() + cbtrack->Charge();
545  counterSelectedCascades+=1;
546  Int_t counterSelectedTracks = 0;
547  //------------------------------------------------
548  // Track1 loop
549  //------------------------------------------------
550  for (Int_t itrk1 = 0; itrk1<nTracks; itrk1++) {
551  if(!seleTrkFlags[itrk1]) continue;
552  AliAODTrack *trk1 = (AliAODTrack*)aodEvent->GetTrack(itrk1);
553  if(!trk1||trk1->GetID()<0) continue;
554  Int_t lpid1 = trk1->GetID();
555  if((cpid==lpid1)||(cnid==lpid1)||(cbid==lpid1)) continue;
556  Short_t charge_like1 = trk1->Charge();
557  Bool_t ok_charge = kFALSE;
558  if((charge_casc==-1)&&(charge_like1==1)) ok_charge = kTRUE;
559  if((charge_casc==1)&&(charge_like1==-1)) ok_charge = kTRUE;
560  if(!ok_charge) continue;
561 
562  counterSelectedTracks+=1;
563 
564  AliAODVertex *secVert = ReconstructSecondaryVertex(casc,trk1,aodEvent);//Fake, prim vertex is just used as secondary vertex. place holder for future
565  if(!secVert) continue;
566 
567  AliAODRecoCascadeHF *exobj = MakeCascadeHF(casc,trk1,aodEvent,secVert);
568  if(!exobj) {
569  delete secVert;
570  continue;
571  }
572  AliAODMCParticle *mcxic = 0;
573  AliAODMCParticle *mcdaughter1 = 0;
574  AliAODMCParticle *mcdaughterxi = 0;
575  Int_t mclabxic = 0;
576  Int_t mclabomegac = 0;
577  Int_t nmclabxic = 0;
578  Int_t nmclabomegac = 0;
579  Bool_t isXic = kFALSE;
580  if(fUseMCInfo)
581  {
582  Int_t pdgDg[2]={211,3312};
583  Int_t pdgDg_O[2]={211,3334};
584  Int_t pdgDgcasc[2]={211,3122};
585  Int_t pdgDgcasc_O[2]={321,3122};
586  Int_t pdgDgv0[2]={2212,211};
587  mclabxic = MatchtoMC(exobj,4132,3312,pdgDg,pdgDgcasc,pdgDgv0,mcArray);
588  mclabomegac = MatchtoMC(exobj,4332,3334,pdgDg_O,pdgDgcasc_O,pdgDgv0,mcArray);
589  if(mclabxic>-1){
590  mcxic = (AliAODMCParticle*) mcArray->At(mclabxic);
591  for(Int_t ia=0;ia<20;ia++){
592  if(usedmclab[ia]==mclabxic){
593  nusedmclab[ia]++;
594  nmclabxic = nusedmclab[ia];
595  break;
596  }
597  if(usedmclab[ia]==-9999){
598  usedmclab[ia]=mclabxic;
599  nusedmclab[ia]++;
600  nmclabxic = nusedmclab[ia];
601  break;
602  }
603  }
604  isXic=kTRUE;
605  for(Int_t idau=mcxic->GetDaughterFirst();idau<mcxic->GetDaughterLast()+1;idau++)
606  {
607  //cout<<idau<<endl;
608  if(idau<0) break;
609  AliAODMCParticle *mcpart = (AliAODMCParticle*) mcArray->At(idau);
610  Int_t pdgcode = TMath::Abs(mcpart->GetPdgCode());
611  if(pdgcode==211){
612  mcdaughter1 = mcpart;
613  } else if(pdgcode==3312){
614  mcdaughterxi = mcpart;
615  }
616  }
617  }
618  }
619 
620  FillROOTObjects(exobj,casc,trk1,mcxic,mcdaughter1,mcdaughterxi, nmclabxic,isXic);
621 
622  exobj->GetSecondaryVtx()->RemoveDaughters();
623  exobj->UnsetOwnPrimaryVtx();
624  delete exobj;exobj=NULL;
625  delete secVert;
626 
627 
628  }//trk1
629  fHSelectedTracksPerEv->Fill(counterSelectedTracks);
630  }//casc
631  fHSelectedCascadePerEv->Fill(counterSelectedCascades);
632  return;
633 }
634 //________________________________________________________________________
635 /* THIS IS WITHOUT VERTEXING
636 void AliAnalysisTaskSEXicZero2XiPifromAODtracks::FillROOTObjects(AliAODcascade *cascade, AliAODTrack *part1)
637 {
638  //
639  // Fill histogram or Tree depending on fWriteVariableTree flag
640  //
641 
642  //AliAODTrack *part1 = xicobj->GetBachelor1();
643  //AliAODTrack *part2 = xicobj->GetBachelor2();
644  //AliAODcascade *casc = xicobj->GetCascade();
645 
646  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
647  Double_t mPiPDG = TDatabasePDG::Instance()->GetParticle(211)->Mass();
648 
649  Double_t p2Pi = part1->Px()*part1->Px()+part1->Py()*part1->Py()+part1->Pz()*part1->Pz();
650  Double_t p2Xi = cascade->Px()*cascade->Px()+ cascade->Py()*cascade->Py()+cascade->Pz()*cascade->Pz();
651 
652  Double_t energysum = TMath::Sqrt(mPiPDG*mPiPDG+p2Pi)+TMath::Sqrt(mxiPDG*mxiPDG+p2Xi);
653  Double_t Pxtot = part1->Px()+cascade->Px();
654  Double_t Pytot = part1->Py()+cascade->Py();
655  Double_t Pztot = part1->Pz()+cascade->Pz();
656  Double_t p2 = Pxtot*Pxtot + Pytot*Pytot + Pztot*Pztot;
657  Double_t invMass2 = energysum*energysum - p2;
658  Double_t massXiC = TMath::Sqrt(invMass2);
659 
660  fCandidateVariables[ 0] = massXiC;//xicobj->InvMassPiXiPi();
661  fCandidateVariables[ 1] = Pxtot;//xicobj->Px();
662  fCandidateVariables[ 2] = Pytot;//xicobj->Py();
663  fCandidateVariables[ 3] = Pztot;//xicobj->Pz();
664  fCandidateVariables[ 4] = part1->Px();
665  fCandidateVariables[ 5] = part1->Py();
666  fCandidateVariables[ 6] = part1->Pz();
667  fCandidateVariables[ 7] = 0;
668  fCandidateVariables[ 8] = 0;
669  fCandidateVariables[ 9] = 0;
670  fCandidateVariables[10] = cascade->MassXi();
671  fCandidateVariables[11] = cascade->MomXiX();
672  fCandidateVariables[12] = cascade->MomXiY();
673  fCandidateVariables[13] = cascade->MomXiZ();
674  fCandidateVariables[14] = cascade->MassLambda();
675  fCandidateVariables[15] = cascade->MassAntiLambda();
676 
677  fCandidateVariables[16] = fCentrality;
678  fCandidateVariables[17] = fVtx1->GetX();
679  fCandidateVariables[18] = fVtx1->GetY();
680  fCandidateVariables[19] = fVtx1->GetZ();
681  fCandidateVariables[20] = 0;//xicobj->GetOwnPrimaryVtx()->GetX();
682  fCandidateVariables[21] = 0;//xicobj->GetOwnPrimaryVtx()->GetY();
683  fCandidateVariables[22] = 0;//xicobj->GetOwnPrimaryVtx()->GetZ();
684 
685  fCandidateVariables[23] = 0;//xicobj->CascDcaXiDaughters();
686  fCandidateVariables[24] = 0;//xicobj->CascDcaV0Daughters();
687  Double_t primvert[3];
688  fVtx1->GetXYZ(primvert);
689  Double_t ptotxi = TMath::Sqrt(pow(cascade->MomXiX(),2)+pow(cascade->MomXiY(),2)+pow(cascade->MomXiZ(),2));
690  Double_t properdl = cascade->DecayLengthXi(primvert[0],primvert[1],primvert[2])*mxiPDG/ptotxi;
691  fCandidateVariables[25] = properdl;//xicobj->CascDecayLength();
692  fCandidateVariables[26] = cascade->CosPointingAngleXi(primvert[0],primvert[1],primvert[2]);//xicobj->CascCosPointingAngle();
693  fCandidateVariables[27] = cascade->DcaV0ToPrimVertex();//xicobj->CascDcaV0ToPrimVertex();
694  fCandidateVariables[28] = cascade->DcaPosToPrimVertex();//xicobj->CascDcaPosToPrimVertex();
695  fCandidateVariables[29] = cascade->DcaNegToPrimVertex();//xicobj->CascDcaNegToPrimVertex();
696  fCandidateVariables[30] = cascade->DcaBachToPrimVertex();//xicobj->CascDcaBachToPrimVertex();
697  Double_t lPosXi[3];
698  lPosXi[0] = cascade->DecayVertexXiX();
699  lPosXi[1] = cascade->DecayVertexXiY();
700  lPosXi[2] = cascade->DecayVertexXiZ();
701  fCandidateVariables[31] = 0;//xicobj->CascDecayLengthV0();
702  fCandidateVariables[32] = cascade->CosPointingAngle(lPosXi);//xicobj->CascCosPointingAngleV0();
703 
704  //Double_t dca[3];
705  //xicobj->GetDCAs(dca);
706  fCandidateVariables[33] = 0;//dca[0];
707  fCandidateVariables[34] = 0;//dca[1];
708  fCandidateVariables[35] = 0;//dca[2];
709  fCandidateVariables[36] = 0;//xicobj->Getd0Prong(0);
710  fCandidateVariables[37] = 0;//xicobj->Getd0Prong(2);
711  fCandidateVariables[38] = 0;//xicobj->Getd0Prong(1);
712 
713  fCandidateVariables[39] = 0;//xicobj->DecayLength();
714  fCandidateVariables[40] = 0;//xicobj->DecayLengthXY();
715  fCandidateVariables[41] = 0;//xicobj->XicCosPointingAngle();
716 
717  Double_t nSigmaTPCpi1=-9999.;
718  Double_t nSigmaTPCpi2=-9999.;
719  Double_t nSigmaTOFpi1=-9999.;
720  Double_t nSigmaTOFpi2=-9999.;
721  Double_t probPion1=-9999.;
722  Double_t probPion2=-9999.;
723 
724  if(fAnalCuts->GetIsUsePID())
725  {
726  nSigmaTPCpi1 = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(part1,AliPID::kPion);
727  fCandidateVariables[42] = nSigmaTPCpi1;
728  //nSigmaTPCpi2 = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(part2,AliPID::kPion);
729  fCandidateVariables[43] = nSigmaTPCpi2;
730  nSigmaTOFpi1 = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(part1,AliPID::kPion);
731  fCandidateVariables[44] = nSigmaTOFpi1;
732  // nSigmaTOFpi2 = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(part2,AliPID::kPion);
733  fCandidateVariables[45] = nSigmaTOFpi2;
734 
735  if(fAnalCuts->GetPidHF()->GetUseCombined()){
736  probPion1 = fAnalCuts->GetPionProbabilityTPCTOF(part1);
737  // probPion2 = fAnalCuts->GetPionProbabilityTPCTOF(part2);
738  }
739  fCandidateVariables[46] = probPion1;
740  fCandidateVariables[47] = probPion2;
741  }
742  fCandidateVariables[48] = -9999;
743  fCandidateVariables[49] = -9999;
744  fCandidateVariables[50] = -9999;
745  fCandidateVariables[51] = -9999;
746  fCandidateVariables[52] = -9999;
747  fCandidateVariables[53] = -9999;
748  fCandidateVariables[54] = -9999;
749  fCandidateVariables[55] = -9999;
750  fCandidateVariables[56] = -9999;
751  fCandidateVariables[57] = -9999;
752  fCandidateVariables[65] = -9999;
753  fCandidateVariables[66] = -9999;
754  fCandidateVariables[67] = -9999;
755  fCandidateVariables[68] = -9999;
756  fCandidateVariables[69] = -9999;
757  fCandidateVariables[70] = -9999;
758  fCandidateVariables[71] = -9999;
759  fCandidateVariables[72] = -9999;
760  fCandidateVariables[73] = -9999;
761  fCandidateVariables[74] = -9999;
762  fCandidateVariables[75] = -9999;
763  fCandidateVariables[76] = -9999;*/
764 
765  /* if(fUseMCInfo){
766  if(mcpart){
767  fCandidateVariables[48] = mcpart->Label();
768  fCandidateVariables[49] = mcnused;
769  fCandidateVariables[50] = mcpart->GetPdgCode();
770  fCandidateVariables[54] = mcpart->Pt();
771  if(mcdaughter1&&mcdaughter2&&mcdaughterxi){
772  Double_t mcprimvertx = mcpart->Xv();
773  Double_t mcprimverty = mcpart->Yv();
774  Double_t mcsecvertx = mcdaughter1->Xv();
775  Double_t mcsecverty = mcdaughter1->Yv();
776  Double_t recosecvertx = xicobj->GetSecondaryVtx()->GetX();
777  Double_t recosecverty = xicobj->GetSecondaryVtx()->GetY();
778  fCandidateVariables[51] = TMath::Sqrt((mcsecvertx-mcprimvertx)*(mcsecvertx-mcprimvertx)+(mcsecverty-mcprimverty)*(mcsecverty-mcprimverty));
779  fCandidateVariables[52] = TMath::Sqrt((recosecvertx-mcprimvertx)*(recosecvertx-mcprimvertx)+(recosecverty-mcprimverty)*(recosecverty-mcprimverty));
780  Double_t vecx_vert = recosecvertx-mcprimvertx;
781  Double_t vecy_vert = recosecverty-mcprimverty;
782  Double_t vecl_vert = TMath::Sqrt(vecx_vert*vecx_vert+vecy_vert*vecy_vert);
783  Double_t vecx_mom = xicobj->Px();
784  Double_t vecy_mom = xicobj->Py();
785  Double_t vecl_mom = xicobj->Pt();
786  if(vecl_vert>0.&&vecl_mom>0.)
787  fCandidateVariables[53] = (vecx_vert*vecx_mom+vecy_vert*vecy_mom)/vecl_vert/vecl_mom;
788  fCandidateVariables[55] = mcdaughter1->Pt();
789  fCandidateVariables[56] = mcdaughter2->Pt();
790  fCandidateVariables[57] = mcdaughterxi->Pt();
791  fCandidateVariables[65] = mcpart->Px();
792  fCandidateVariables[66] = mcpart->Py();
793  fCandidateVariables[67] = mcpart->Pz();
794  fCandidateVariables[68] = mcdaughter1->Px();
795  fCandidateVariables[69] = mcdaughter1->Py();
796  fCandidateVariables[70] = mcdaughter1->Pz();
797  fCandidateVariables[71] = mcdaughter2->Px();
798  fCandidateVariables[72] = mcdaughter2->Py();
799  fCandidateVariables[73] = mcdaughter2->Pz();
800  fCandidateVariables[74] = mcdaughterxi->Px();
801  fCandidateVariables[75] = mcdaughterxi->Py();
802  fCandidateVariables[76] = mcdaughterxi->Pz();
803  }
804  }
805  }*/
806 /* fCandidateVariables[58] = cascade->Px();
807  fCandidateVariables[59] = cascade->Py();
808  fCandidateVariables[60] = cascade->Pz();
809  fCandidateVariables[61] = -9999.;
810  fCandidateVariables[62] = -9999.;
811  fCandidateVariables[63] = -9999.;
812  if(TMath::Abs(cascade->MassLambda()-1.115683)<0.02){
813  fCandidateVariables[61] = cascade->MomPosX();
814  fCandidateVariables[62] = cascade->MomPosY();
815  fCandidateVariables[63] = cascade->MomPosZ();
816  }else{
817  fCandidateVariables[61] = cascade->MomNegX();
818  fCandidateVariables[62] = cascade->MomNegY();
819  fCandidateVariables[63] = cascade->MomNegZ();
820  }
821  fCandidateVariables[64] = 0;//xicobj->BachelorsCosPointingAngle();
822 
823  fCandidateVariables[77] = cascade->DecayVertexV0X();
824  fCandidateVariables[78] = cascade->DecayVertexV0Y();
825  fCandidateVariables[79] = cascade->DecayVertexV0Z();
826  fCandidateVariables[80] = cascade->DecayVertexXiX();
827  fCandidateVariables[81] = cascade->DecayVertexXiY();
828  fCandidateVariables[82] = cascade->DecayVertexXiZ();
829  fCandidateVariables[83] = 0;//xicobj->GetSecondaryVtx()->GetX();
830  fCandidateVariables[84] = 0;//xicobj->GetSecondaryVtx()->GetY();
831  fCandidateVariables[85] = 0;//xicobj->GetSecondaryVtx()->GetZ();
832  fCandidateVariables[86] = massXiC-cascade->MassXi();
833 
834  if(fWriteVariableTree)
835  fVariablesTree->Fill();*/
836  /*else{
837  if(fAnalCuts->IsSelected(xicobj,AliRDHFCuts::kCandidate))
838  {
839  Double_t cont[3];
840  cont[0] = xicobj->InvMassPiXiPi();
841  cont[1] = xicobj->Pt();
842  cont[2] = fCentrality;
843  fHistoXicMass->Fill(cont);
844 
845  fHistoDcaPi1Pi2->Fill(dca[2]);
846  fHistoDcaPiCasc->Fill(dca[0]);
847  fHistoDcaPiCasc->Fill(dca[1]);
848  fHistoLikeDecayLength->Fill(xicobj->DecayLength());
849  fHistoLikeDecayLengthXY->Fill(xicobj->DecayLengthXY());
850  fHistoXicCosPAXY->Fill(xicobj->XicCosPointingAngle());
851  fHistoXiMass->Fill(xicobj->CascMassXi());
852  fHistoCascDcaXiDaughters->Fill(xicobj->CascDcaXiDaughters());
853  fHistoCascDcaV0Daughters->Fill(xicobj->CascDcaV0Daughters());
854  fHistoCascDcaV0ToPrimVertex->Fill(xicobj->CascDcaV0ToPrimVertex());
855  fHistoCascDcaPosToPrimVertex->Fill(xicobj->CascDcaPosToPrimVertex());
856  fHistoCascDcaNegToPrimVertex->Fill(xicobj->CascDcaNegToPrimVertex());
857  fHistoCascDcaBachToPrimVertex->Fill(xicobj->CascDcaBachToPrimVertex());
858  fHistoCascCosPAXiPrim->Fill(xicobj->CascCosPointingAngle());
859  fHistoXiPt->Fill(xicobj->PtProng(1));
860  fHistoPiPt->Fill(xicobj->PtProng(0));
861  fHistoPiPt->Fill(xicobj->PtProng(2));
862  fHistoPid0->Fill(xicobj->Getd0Prong(0));
863  fHistoPid0->Fill(xicobj->Getd0Prong(2));
864  fHistonSigmaTPCpi->Fill(nSigmaTPCpi1);
865  fHistonSigmaTPCpi->Fill(nSigmaTPCpi2);
866  fHistonSigmaTOFpi->Fill(nSigmaTOFpi1);
867  fHistonSigmaTOFpi->Fill(nSigmaTOFpi2);
868  fHistoProbPion->Fill(probPion1);
869  fHistoProbPion->Fill(probPion2);
870  }
871 
872  }*/
873 // return;
874 //}
875 
876 //________________________________________________________________________
877 void AliAnalysisTaskSEXicZero2XiPifromAODtracks::FillROOTObjects(AliAODRecoCascadeHF *xicobj, AliAODcascade *casc, AliAODTrack *part1, AliAODMCParticle *mcpart, AliAODMCParticle *mcdaughter1, AliAODMCParticle *mcdaughterxi, Int_t mcnused, Bool_t isXic)
878 {
879  //
880  // Fill histogram or Tree depending on fWriteVariableTree flag
881  //
882 
883  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
884  Double_t mPiPDG = TDatabasePDG::Instance()->GetParticle(211)->Mass();
885  Double_t mOmegaPDG = TDatabasePDG::Instance()->GetParticle(3334)->Mass();
886 
887  UInt_t pdgdg[2]={211,3312};
888  UInt_t pdgdg_O[2]={211,3334};
889 
890  Double_t posVtx[3] = {0.,0.,0.};
891  fVtx1->GetXYZ(posVtx);
892 
893  Double_t nSigmaTPCpi1=-9999.;
894  Double_t nSigmaTOFpi1=-9999.;
895  Double_t probPion1=-9999.;
896  Double_t nSigmaTPCkaon=-9999.;
897  Double_t nSigmaTOFkaon=-9999.;
898 
899  Double_t PDGmassLambda = 1.115683;
900  Double_t PDGmassXi = 1.32171;
901  Double_t PDGmassOmega = 1.67245;
902  Double_t PDGmassXic = 2.47085;
903  Double_t PDGmassOmegac = 2.6952;
904 
905  AliAODTrack *KaonInCasc = (AliAODTrack*)(casc->GetDecayVertexXi()->GetDaughter(0));
906 
907  nSigmaTPCpi1 = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(part1,AliPID::kPion);
908  nSigmaTOFpi1 = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(part1,AliPID::kPion);
909 
910  nSigmaTPCkaon = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(KaonInCasc,AliPID::kKaon);
911  nSigmaTOFkaon = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(KaonInCasc,AliPID::kKaon);
912 
913  Double_t massXic= xicobj->InvMass(2,pdgdg);
914  Double_t massOmegac = xicobj->InvMass(2,pdgdg_O);
915 
916  if( TMath::Abs(casc->MassLambda()-PDGmassLambda) > 0.015 && TMath::Abs(casc->MassAntiLambda()-PDGmassLambda) > 0.015 ) return;
917  if (!fAnaOmegacZero && TMath::Abs(casc->MassXi()-PDGmassXi) > 0.015 ) return;
918  if (fAnaOmegacZero && TMath::Abs(casc->MassOmega()-PDGmassOmega) > 0.015 ) return;
919  if ( (!fAnaOmegacZero && TMath::Abs(massXic-PDGmassXic) > 0.5) || (fAnaOmegacZero && TMath::Abs(massOmegac-PDGmassOmegac) > 0.5) ) return;
920  if (nSigmaTPCpi1<-4 || nSigmaTPCpi1>4 || nSigmaTOFpi1<-4 || nSigmaTOFpi1>4) return;
921  if (fAnaOmegacZero && (nSigmaTPCkaon<-4 || nSigmaTPCkaon>4 || nSigmaTOFkaon<-4 || nSigmaTOFkaon>4)) return;
922 
923  if ((fUseMCInfo && fFillSignalOnly && !fFillBkgOnly && !isXic) || (fUseMCInfo && !fFillSignalOnly && fFillBkgOnly && isXic)) return;
924  else {
925 
926  fCandidateVariables[ 1] = xicobj->Px();
927  fCandidateVariables[ 2] = xicobj->Py();
928  fCandidateVariables[ 3] = xicobj->Pz();
929  fCandidateVariables[ 4] = part1->Px();
930  fCandidateVariables[ 5] = part1->Py();
931  fCandidateVariables[ 6] = part1->Pz();
932  fCandidateVariables[ 7] = 0;
933  fCandidateVariables[ 8] = 0;
934  fCandidateVariables[ 9] = 0;
935  fCandidateVariables[14] = casc->MassLambda();
936  fCandidateVariables[15] = casc->MassAntiLambda();
937  fCandidateVariables[26] = casc->CosPointingAngleXi(posVtx[0],posVtx[1],posVtx[2]);
938  fCandidateVariables[32] = casc->CosPointingAngle(casc->GetDecayVertexXi());
939  if(fAnalCuts->GetIsUsePID())
940  {
941  fCandidateVariables[42] = nSigmaTPCpi1;
942  fCandidateVariables[43] = 0;
943  fCandidateVariables[44] = nSigmaTOFpi1;
944  fCandidateVariables[45] = 0;
945 
947  probPion1 = fAnalCuts->GetPionProbabilityTPCTOF(part1);
948  }
949  fCandidateVariables[46] = probPion1;
950  fCandidateVariables[47] = 0;
951  }
952 
953  if (!fAnaOmegacZero) {
954  fCandidateVariables[ 0] = massXic;
955  fCandidateVariables[10] = casc->MassXi();
956  fCandidateVariables[11] = casc->MomXiX();
957  fCandidateVariables[12] = casc->MomXiY();
958  fCandidateVariables[13] = casc->MomXiZ();
959 
961  fCandidateVariables[17] = fVtx1->GetX();
962  fCandidateVariables[18] = fVtx1->GetY();
963  fCandidateVariables[19] = fVtx1->GetZ();
964  fCandidateVariables[20] = xicobj->GetOwnPrimaryVtx()->GetX();
965  fCandidateVariables[21] = xicobj->GetOwnPrimaryVtx()->GetY();
966  fCandidateVariables[22] = xicobj->GetOwnPrimaryVtx()->GetZ();
967 
968  fCandidateVariables[23] = casc->DcaXiDaughters();
969  fCandidateVariables[24] = casc->DcaV0Daughters();
970  fCandidateVariables[25] = casc->DecayLengthXi(posVtx[0],posVtx[1],posVtx[2]);
971  fCandidateVariables[27] = casc->DcaV0ToPrimVertex();
972  fCandidateVariables[28] = casc->DcaPosToPrimVertex();
973  fCandidateVariables[29] = casc->DcaNegToPrimVertex();
974  fCandidateVariables[30] = casc->DcaBachToPrimVertex();
975  fCandidateVariables[31] = casc->DecayLengthV0();
976 
977  Double_t dca[3];
978  // xicobj->GetDCAs(dca);
979  fCandidateVariables[33] = 0;//dca[0];
980  fCandidateVariables[34] = 0;//dca[1];
981  fCandidateVariables[35] = 0;//dca[2];
982  fCandidateVariables[36] = xicobj->Getd0Prong(0);
983  fCandidateVariables[37] = 0; //xicobj->Getd0Prong(2);
984  fCandidateVariables[38] = xicobj->Getd0Prong(1);
985 
986  fCandidateVariables[39] = xicobj->DecayLength();
987  fCandidateVariables[40] = xicobj->DecayLengthXY();
988  fCandidateVariables[41] = 0; //xicobj->XicCosPointingAngle();
989 
990  fCandidateVariables[48] = -9999;
991  fCandidateVariables[49] = -9999;
992  fCandidateVariables[50] = -9999;
993  fCandidateVariables[51] = -9999;
994  fCandidateVariables[52] = -9999;
995  fCandidateVariables[53] = -9999;
996  fCandidateVariables[54] = -9999;
997  fCandidateVariables[55] = -9999;
998  fCandidateVariables[56] = -9999;
999  fCandidateVariables[57] = -9999;
1000  fCandidateVariables[65] = -9999;
1001  fCandidateVariables[66] = -9999;
1002  fCandidateVariables[67] = -9999;
1003  fCandidateVariables[68] = -9999;
1004  fCandidateVariables[69] = -9999;
1005  fCandidateVariables[70] = -9999;
1006  fCandidateVariables[71] = -9999;
1007  fCandidateVariables[72] = -9999;
1008  fCandidateVariables[73] = -9999;
1009  fCandidateVariables[74] = -9999;
1010  fCandidateVariables[75] = -9999;
1011  fCandidateVariables[76] = -9999;
1012 
1013  if(fUseMCInfo){
1014  if(mcpart){
1015  fCandidateVariables[48] = mcpart->Label();
1016  fCandidateVariables[49] = mcnused;
1017  fCandidateVariables[50] = mcpart->GetPdgCode();
1018  fCandidateVariables[54] = mcpart->Pt();
1019  if(mcdaughter1&&mcdaughterxi){
1020  Double_t mcprimvertx = mcpart->Xv();
1021  Double_t mcprimverty = mcpart->Yv();
1022  Double_t mcsecvertx = mcdaughter1->Xv();
1023  Double_t mcsecverty = mcdaughter1->Yv();
1024  Double_t recosecvertx = xicobj->GetSecondaryVtx()->GetX();
1025  Double_t recosecverty = xicobj->GetSecondaryVtx()->GetY();
1026  fCandidateVariables[51] = TMath::Sqrt((mcsecvertx-mcprimvertx)*(mcsecvertx-mcprimvertx)+(mcsecverty-mcprimverty)*(mcsecverty-mcprimverty));
1027  fCandidateVariables[52] = TMath::Sqrt((recosecvertx-mcprimvertx)*(recosecvertx-mcprimvertx)+(recosecverty-mcprimverty)*(recosecverty-mcprimverty));
1028  Double_t vecx_vert = recosecvertx-mcprimvertx;
1029  Double_t vecy_vert = recosecverty-mcprimverty;
1030  Double_t vecl_vert = TMath::Sqrt(vecx_vert*vecx_vert+vecy_vert*vecy_vert);
1031  Double_t vecx_mom = xicobj->Px();
1032  Double_t vecy_mom = xicobj->Py();
1033  Double_t vecl_mom = xicobj->Pt();
1034  if(vecl_vert>0.&&vecl_mom>0.)
1035  fCandidateVariables[53] = (vecx_vert*vecx_mom+vecy_vert*vecy_mom)/vecl_vert/vecl_mom;
1036  fCandidateVariables[55] = mcdaughter1->Pt();
1037  fCandidateVariables[56] = 0; //mcdaughter2->Pt();
1038  fCandidateVariables[57] = mcdaughterxi->Pt();
1039  fCandidateVariables[65] = mcpart->Px();
1040  fCandidateVariables[66] = mcpart->Py();
1041  fCandidateVariables[67] = mcpart->Pz();
1042  fCandidateVariables[68] = mcdaughter1->Px();
1043  fCandidateVariables[69] = mcdaughter1->Py();
1044  fCandidateVariables[70] = mcdaughter1->Pz();
1045  fCandidateVariables[71] = 0; //mcdaughter2->Px();
1046  fCandidateVariables[72] = 0; //mcdaughter2->Py();
1047  fCandidateVariables[73] = 0; //mcdaughter2->Pz();
1048  fCandidateVariables[74] = mcdaughterxi->Px();
1049  fCandidateVariables[75] = mcdaughterxi->Py();
1050  fCandidateVariables[76] = mcdaughterxi->Pz();
1051  }
1052  }
1053  }
1054  fCandidateVariables[58] = casc->Px();
1055  fCandidateVariables[59] = casc->Py();
1056  fCandidateVariables[60] = casc->Pz();
1057  fCandidateVariables[61] = -9999.;
1058  fCandidateVariables[62] = -9999.;
1059  fCandidateVariables[63] = -9999.;
1060  if(TMath::Abs(casc->MassLambda()-1.115683)<0.02){
1061  fCandidateVariables[61] = casc->MomPosX();
1062  fCandidateVariables[62] = casc->MomPosY();
1063  fCandidateVariables[63] = casc->MomPosZ();
1064  }else{
1065  fCandidateVariables[61] = casc->MomNegX();
1066  fCandidateVariables[62] = casc->MomNegY();
1067  fCandidateVariables[63] = casc->MomNegZ();
1068  }
1069  fCandidateVariables[64] = 0; //xicobj->BachelorsCosPointingAngle();
1070 
1071  fCandidateVariables[77] = casc->DecayVertexV0X();
1072  fCandidateVariables[78] = casc->DecayVertexV0Y();
1073  fCandidateVariables[79] = casc->DecayVertexV0Z();
1074  fCandidateVariables[80] = casc->DecayVertexXiX();
1075  fCandidateVariables[81] = casc->DecayVertexXiY();
1076  fCandidateVariables[82] = casc->DecayVertexXiZ();
1077  fCandidateVariables[83] = xicobj->GetSecondaryVtx()->GetX();
1078  fCandidateVariables[84] = xicobj->GetSecondaryVtx()->GetY();
1079  fCandidateVariables[85] = xicobj->GetSecondaryVtx()->GetZ();
1080  fCandidateVariables[86] = xicobj->InvMass(2,pdgdg)-casc->MassXi();
1081 
1082  fCandidateVariables[87] = part1->GetTPCClusterInfo(2,1);
1083  AliAODTrack *ptrack = (AliAODTrack*) (casc->GetDaughter(0));
1084  AliAODTrack *ntrack = (AliAODTrack*) (casc->GetDaughter(1));
1085  AliAODTrack *btrack = (AliAODTrack*) (casc->GetDecayVertexXi()->GetDaughter(0));
1086 
1087  fCandidateVariables[88] = btrack->GetTPCClusterInfo(2,1);
1088  fCandidateVariables[89] = ptrack->GetTPCClusterInfo(2,1);
1089  fCandidateVariables[90] = ntrack->GetTPCClusterInfo(2,1);
1090  fCandidateVariables[91] = xicobj->CosThetaStar(0, 4132, 211, 3312);
1091  fCandidateVariables[92] = xicobj->CosThetaStar(1, 4132, 211, 3312);
1092  }
1093 // fCandidateVariables[91] = casc->CosThetaStar(0, 4132, 211, 3312);
1094 // fCandidateVariables[92] = casc->CosThetaStar(1, 4132, 3312, 211);
1095  if (fAnaOmegacZero) {
1096  fCandidateVariables[91] = xicobj->CosThetaStar(0, 4332, 211, 3334);
1097  fCandidateVariables[92] = xicobj->CosThetaStar(1, 4332, 211, 3334);
1098  fCandidateVariables[93] = casc->MassOmega();
1099  fCandidateVariables[94] = massOmegac;
1100  fCandidateVariables[95] = nSigmaTPCkaon;
1101  fCandidateVariables[96] = nSigmaTOFkaon;
1102  }
1103  }//close if to check the mc fill only signal
1104  if(fWriteVariableTree) fVariablesTree->Fill();
1105  //this is commented at the moment because modifications to the AliAODRecoCascadeHF are needed.
1106  //However, this part is not used for a first look with trees and it is useful only when first set of cuts is defined
1107  /*
1108  else {
1109  if(fAnalCuts->IsSelected(xicobj,AliRDHFCuts::kCandidate))
1110  {
1111  Double_t cont[3];
1112  cont[0] = xicobj->InvMass(2,pdgdg);
1113  cont[1] = xicobj->Pt();
1114  cont[2] = fCentrality;
1115  fHistoXicMass->Fill(cont);
1116 
1117  //This is commented because the dca is not calculated at the moment.
1118  fHistoDcaPiCasc->Fill(dca[0]);
1119  fHistoDcaPiCasc->Fill(dca[1]);
1120 
1121  fHistoXiMass->Fill(casc->MassXi());
1122  fHistoCascDcaXiDaughters->Fill(xicobj->CascDcaXiDaughters());
1123  fHistoCascDcaV0Daughters->Fill(xicobj->CascDcaV0Daughters());
1124  fHistoCascDcaV0ToPrimVertex->Fill(xicobj->CascDcaV0ToPrimVertex());
1125  fHistoCascDcaPosToPrimVertex->Fill(xicobj->CascDcaPosToPrimVertex());
1126  fHistoCascDcaNegToPrimVertex->Fill(xicobj->CascDcaNegToPrimVertex());
1127  fHistoCascDcaBachToPrimVertex->Fill(xicobj->CascDcaBachToPrimVertex());
1128  fHistoCascCosPAXiPrim->Fill(xicobj->CascCosPointingAngle());
1129  fHistoXiPt->Fill(xicobj->PtProng(1));
1130  fHistoPiPt->Fill(xicobj->PtProng(0));
1131  fHistoPid0->Fill(xicobj->Getd0Prong(0));
1132 
1133  Double_t nSigmaTPCpi1=-9999.;
1134  Double_t nSigmaTPCpi2=-9999.;
1135  Double_t nSigmaTOFpi1=-9999.;
1136  Double_t nSigmaTOFpi2=-9999.;
1137  Double_t probPion1=-9999.;
1138  Double_t probPion2=-9999.;
1139 
1140  if(fAnalCuts->GetIsUsePID())
1141  {
1142  nSigmaTPCpi1 = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(part1,AliPID::kPion);
1143 
1144  nSigmaTOFpi1 = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(part1,AliPID::kPion);
1145 
1146 
1147  if(fAnalCuts->GetPidHF()->GetUseCombined()){
1148  probPion1 = fAnalCuts->GetPionProbabilityTPCTOF(part1);
1149  }
1150  }
1151 
1152  fHistonSigmaTPCpi->Fill(nSigmaTPCpi1);
1153  fHistonSigmaTOFpi->Fill(nSigmaTOFpi1);
1154  fHistoProbPion->Fill(probPion1);
1155  }
1156  }*/
1157 
1158 }
1159 
1160 //________________________________________________________________________
1161 
1163 {
1164  //
1165  // This is to define tree variables
1166  //
1167  const char* nameoutput = GetOutputSlot(3)->GetContainer()->GetName();
1168  fVariablesTree = new TTree(nameoutput,"Candidates variables tree");
1169  Int_t nVar = 97;
1170  fCandidateVariables = new Float_t [nVar];
1171  TString * fCandidateVariableNames = new TString[nVar];
1172 
1173  fCandidateVariableNames[ 0]="InvMassXic";
1174  if (!fAnaOmegacZero) {
1175  fCandidateVariableNames[ 1]="XicPx";
1176  fCandidateVariableNames[ 2]="XicPy";
1177  fCandidateVariableNames[ 3]="XicPz";
1178  fCandidateVariableNames[26]="CascCosPointingAngleXi";
1179  }
1180  if (fAnaOmegacZero) {
1181  fCandidateVariableNames[ 1]="OmegacPx";
1182  fCandidateVariableNames[ 2]="OmegacPy";
1183  fCandidateVariableNames[ 3]="OmegacPz";
1184  fCandidateVariableNames[26]="CascCosPointingAngleOmega";
1185  }
1186  fCandidateVariableNames[ 4]="Pi1Px";
1187  fCandidateVariableNames[ 5]="Pi1Py";
1188  fCandidateVariableNames[ 6]="Pi1Pz";
1189  fCandidateVariableNames[ 7]="Pi2Px";
1190  fCandidateVariableNames[ 8]="Pi2Py";
1191  fCandidateVariableNames[ 9]="Pi2Pz";
1192  fCandidateVariableNames[10]="MassXi";
1193  fCandidateVariableNames[11]="XiPx";
1194  fCandidateVariableNames[12]="XiPy";
1195  fCandidateVariableNames[13]="XiPz";
1196  fCandidateVariableNames[14]="MassLambda";
1197  fCandidateVariableNames[15]="MassAntiLambda";
1198 
1199  fCandidateVariableNames[16]="Centrality";
1200  fCandidateVariableNames[17]="PrimVtxX";
1201  fCandidateVariableNames[18]="PrimVtxY";
1202  fCandidateVariableNames[19]="PrimVtxZ";
1203  fCandidateVariableNames[20]="NewPrimVtxX";
1204  fCandidateVariableNames[21]="NewPrimVtxY";
1205  fCandidateVariableNames[22]="NewPrimVtxZ";
1206 
1207  fCandidateVariableNames[23]="CascDcaXiDaughters";
1208  fCandidateVariableNames[24]="CascDcaV0Daughters";
1209  fCandidateVariableNames[25]="CascDecayLengthXi";
1210  fCandidateVariableNames[27]="CascDcaV0ToPrimVertex";
1211  fCandidateVariableNames[28]="CascDcaPosToPrimVertex";
1212  fCandidateVariableNames[29]="CascDcaNegToPrimVertex";
1213  fCandidateVariableNames[30]="CascDcaBachToPrimVertex";
1214  fCandidateVariableNames[31]="CascDecayLengthV0";
1215  fCandidateVariableNames[32]="CascCosPointingAngleV0";
1216 
1217  fCandidateVariableNames[33]="DcaPi1Casc";
1218  fCandidateVariableNames[34]="DcaPi2Casc";
1219  fCandidateVariableNames[35]="DcaPi1Pi2";
1220 
1221  fCandidateVariableNames[36]="Pi1d0";
1222  fCandidateVariableNames[37]="Pi2d0";
1223  fCandidateVariableNames[38]="Cascd0";
1224 
1225  fCandidateVariableNames[39]="DecayLength";
1226  fCandidateVariableNames[40]="DecayLengthXY";
1227  fCandidateVariableNames[41]="XicCosPAXY";
1228 
1229  fCandidateVariableNames[42]="nSigmaTPCpi1";
1230  fCandidateVariableNames[43]="nSigmaTPCpi2";
1231  fCandidateVariableNames[44]="nSigmaTOFpi1";
1232  fCandidateVariableNames[45]="nSigmaTOFpi2";
1233  fCandidateVariableNames[46]="probPion1";
1234  fCandidateVariableNames[47]="probPion2";
1235 
1236  fCandidateVariableNames[48]="mcxicID";
1237  fCandidateVariableNames[49]="mcnused";
1238  fCandidateVariableNames[50]="mcpdgcode";
1239  fCandidateVariableNames[51]="mcdecaylength";
1240  fCandidateVariableNames[52]="mcdecaylength_secsmear";
1241  fCandidateVariableNames[53]="mcxiccospaxy";
1242  fCandidateVariableNames[54]="mcxicpt";
1243  fCandidateVariableNames[55]="mcpi1pt";
1244  fCandidateVariableNames[56]="mcpi2pt";
1245  fCandidateVariableNames[57]="mcxipt";
1246 
1247  fCandidateVariableNames[58]="LambdaPx";
1248  fCandidateVariableNames[59]="LambdaPy";
1249  fCandidateVariableNames[60]="LambdaPz";
1250  fCandidateVariableNames[61]="ProtonPx";
1251  fCandidateVariableNames[62]="ProtonPy";
1252  fCandidateVariableNames[63]="ProtonPz";
1253  fCandidateVariableNames[64]="BachelorsCosPAXY";
1254 
1255  fCandidateVariableNames[65]="mcxicpx";
1256  fCandidateVariableNames[66]="mcxicpy";
1257  fCandidateVariableNames[67]="mcxicpz";
1258  fCandidateVariableNames[68]="mcpi1px";
1259  fCandidateVariableNames[69]="mcpi1py";
1260  fCandidateVariableNames[70]="mcpi1pz";
1261  fCandidateVariableNames[71]="mcpi2px";
1262  fCandidateVariableNames[72]="mcpi2py";
1263  fCandidateVariableNames[73]="mcpi2pz";
1264  fCandidateVariableNames[74]="mcxipx";
1265  fCandidateVariableNames[75]="mcxipy";
1266  fCandidateVariableNames[76]="mcxipz";
1267 
1268  fCandidateVariableNames[77]="LambdaVertX";
1269  fCandidateVariableNames[78]="LambdaVertY";
1270  fCandidateVariableNames[79]="LambdaVertZ";
1271  fCandidateVariableNames[80]="XiVertX";
1272  fCandidateVariableNames[81]="XiVertY";
1273  fCandidateVariableNames[82]="XiVertZ";
1274  fCandidateVariableNames[83]="XicVertX";
1275  fCandidateVariableNames[84]="XicVertY";
1276  fCandidateVariableNames[85]="XicVertZ";
1277  fCandidateVariableNames[86]="DeltaMass";
1278 
1279  fCandidateVariableNames[87]="TPCClsP1";
1280  fCandidateVariableNames[88]="TPCClsCascBach";
1281  fCandidateVariableNames[89]="TPCClsV0trkPos";
1282  fCandidateVariableNames[90]="TPCClsV0trkNeg";
1283  fCandidateVariableNames[91]="CascCosThetaStarPi1";
1284  if (!fAnaOmegacZero) {
1285  fCandidateVariableNames[92]="CascCosThetaStarXi";
1286  }
1287  if (fAnaOmegacZero) {
1288  fCandidateVariableNames[92]="CascCosThetaStarOmega";
1289  }
1290  fCandidateVariableNames[93]="MassOmega";
1291  fCandidateVariableNames[94]="InvMassOmegac";
1292  fCandidateVariableNames[95]="nSigmaTPCkaon";
1293  fCandidateVariableNames[96]="nSigmaTOFkaon";
1294 
1295  for (Int_t ivar=0; ivar<nVar; ivar++) {
1296  fVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1297  }
1298 
1299  return;
1300 }
1301 //__________________________________________________________________________
1303  //
1304  // This is to define general histograms
1305  //
1306 
1307  fCEvents = new TH1F("fCEvents","counter",18,-0.5,17.5);
1308  fCEvents->SetStats(kTRUE);
1309  fCEvents->GetXaxis()->SetBinLabel(1,"X1");
1310  fCEvents->GetXaxis()->SetBinLabel(2,"Analyzed events");
1311  fCEvents->GetXaxis()->SetBinLabel(3,"AliAODVertex exists");
1312  fCEvents->GetXaxis()->SetBinLabel(4,"TriggerOK");
1313  fCEvents->GetXaxis()->SetBinLabel(5,"IsEventSelected");
1314  fCEvents->GetXaxis()->SetBinLabel(6,"CascadesHF exists");
1315  fCEvents->GetXaxis()->SetBinLabel(7,"MCarray exists");
1316  fCEvents->GetXaxis()->SetBinLabel(8,"MCheader exists");
1317  fCEvents->GetXaxis()->SetBinLabel(9,"triggerClass!=CINT1");
1318  fCEvents->GetXaxis()->SetBinLabel(10,"triggerMask!=kAnyINT");
1319  fCEvents->GetXaxis()->SetBinLabel(11,"triggerMask!=kAny");
1320  fCEvents->GetXaxis()->SetBinLabel(12,"vtxTitle.Contains(Z)");
1321  fCEvents->GetXaxis()->SetBinLabel(13,"vtxTitle.Contains(3D)");
1322  fCEvents->GetXaxis()->SetBinLabel(14,"vtxTitle.Doesn'tContain(Z-3D)");
1323  fCEvents->GetXaxis()->SetBinLabel(15,Form("zVtx<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
1324  fCEvents->GetXaxis()->SetBinLabel(16,"!IsEventSelected");
1325  fCEvents->GetXaxis()->SetBinLabel(17,"triggerMask!=kAnyINT || triggerClass!=CINT1");
1326  fCEvents->GetXaxis()->SetBinLabel(18,Form("zVtxMC<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
1327  //fCEvents->GetXaxis()->SetTitle("");
1328  fCEvents->GetYaxis()->SetTitle("counts");
1329 
1330  fHTrigger = new TH1F("fHTrigger","counter",18,-0.5,17.5);
1331  fHTrigger->SetStats(kTRUE);
1332  fHTrigger->GetXaxis()->SetBinLabel(1,"X1");
1333  fHTrigger->GetXaxis()->SetBinLabel(2,"kMB");
1334  fHTrigger->GetXaxis()->SetBinLabel(3,"kSemiCentral");
1335  fHTrigger->GetXaxis()->SetBinLabel(4,"kCentral");
1336  fHTrigger->GetXaxis()->SetBinLabel(5,"kINT7");
1337  fHTrigger->GetXaxis()->SetBinLabel(6,"kEMC7");
1338  //fHTrigger->GetXaxis()->SetBinLabel(7,"Space");
1339  fHTrigger->GetXaxis()->SetBinLabel(8,"kMB|kSemiCentral|kCentral");
1340  fHTrigger->GetXaxis()->SetBinLabel(9,"kINT7|kEMC7");
1341  fHTrigger->GetXaxis()->SetBinLabel(11,"kMB&kSemiCentral");
1342  fHTrigger->GetXaxis()->SetBinLabel(12,"kMB&kCentral");
1343  fHTrigger->GetXaxis()->SetBinLabel(13,"kINT7&kEMC7");
1344 
1345  fHCentrality = new TH1F("fHCentrality","counter",100,0.,100.);
1346 
1347  fHSelectedCascadePerEv = new TH1F("fHSelectedCascadePerEv", "fHSelectedCascadePerEv", 50, 0, 50.);
1348 
1349  fHSelectedTracksPerEv = new TH1F("fHSelectedTracksPerEv", "fHSelectedTracksPerEv", 100, 0, 100.);
1350 
1351 
1352  Double_t binx[101];
1353  for(Int_t ib=0;ib<101;ib++){
1354  binx[ib] = 1.322-0.05 + 0.1/100.*(Double_t)ib ;
1355  }
1356  Double_t biny[21]={0.0,0.60,0.80,0.90,1.00,1.1,1.2,1.3,1.4,1.5,1.7,1.9,2.2,2.6,3.1,3.9,4.9,6.0,7.2,8.5,10.};
1357  fHistoXiMassvsPtRef = new TH2F("fHistoXiMassvsPtRef","Reference #Xi spectrum",100,binx,20,biny);
1358  fHistoXiMassvsPtRef2 = new TH2F("fHistoXiMassvsPtRef2","Reference #Xi spectrum",100,binx,20,biny);
1359  fHistoXiMassvsPtRef3 = new TH2F("fHistoXiMassvsPtRef3","Reference #Xi spectrum",100,binx,20,biny);
1360  fHistoXiMassvsPtRef4 = new TH2F("fHistoXiMassvsPtRef4","Reference #Xi spectrum",100,binx,20,biny);
1361  fHistoXiMassvsPtRef5 = new TH2F("fHistoXiMassvsPtRef5","Reference #Xi spectrum",100,binx,20,biny);
1362  fHistoXiMassvsPtRef6 = new TH2F("fHistoXiMassvsPtRef6","Reference #Xi spectrum",100,binx,20,biny);
1363  fHistoPiPtRef = new TH1F("fHistoPiPtRef","Reference #pi spectrum",20,0.,10.);
1364 
1365  fOutput->Add(fCEvents);
1366  fOutput->Add(fHTrigger);
1367  fOutput->Add(fHCentrality);
1376  fOutput->Add(fHistoPiPtRef);
1377 
1378  return;
1379 }
1380 
1381 //__________________________________________________________________________
1382 /*
1383 void AliAnalysisTaskSEXicZero2XiPifromAODtracks::DefineAnalysisHistograms()
1384 {
1385  //
1386  // Define histograms
1387  //
1388 
1389  //------------------------------------------------
1390  // Basic histograms
1391  //------------------------------------------------
1392  Int_t bins_base[3]= {80 ,20 ,10};
1393  Double_t xmin_base[3]={2.468-0.2,0 ,0.00};
1394  Double_t xmax_base[3]={2.468+0.2,20. ,100};
1395  fHistoXicMass = new THnSparseF("fHistoXicMass","",3,bins_base,xmin_base,xmax_base);
1396  fOutputAll->Add(fHistoXicMass);
1397 
1398  //------------------------------------------------
1399  // Checking histograms
1400  //------------------------------------------------
1401  fHistoDcaPi1Pi2 = new TH1F("fHistoDcaPi1Pi2","DCA (#pi_{1}-#pi_{2})",100,0.0,1.0);
1402  fOutputAll->Add(fHistoDcaPi1Pi2);
1403  fHistoDcaPiCasc = new TH1F("fHistoDcaPiCasc","DCA (#pi-#Xi)",100,0.0,1.0);
1404  fOutputAll->Add(fHistoDcaPiCasc);
1405  fHistoLikeDecayLength = new TH1F("fHistoLikeDecayLength","Decay Length (#pi-#pi)",100,0.,0.2);
1406  fOutputAll->Add(fHistoLikeDecayLength);
1407  fHistoLikeDecayLengthXY = new TH1F("fHistoLikeDecayLengthXY","Decay Length (#pi-#pi)",100,0.,0.2);
1408  fOutputAll->Add(fHistoLikeDecayLengthXY);
1409  fHistoXicCosPAXY = new TH1F("fHistoXicCosPAXY","#Xi_{c} cos(pa) ",100,-1.0,1.0);
1410  fOutputAll->Add(fHistoXicCosPAXY);
1411  fHistoXiMass=new TH1F("fHistoXiMass","#Xi^{-} Mass",100,1.322-0.05,1.322+0.05);
1412  fOutputAll->Add(fHistoXiMass);
1413  fHistoCascDcaXiDaughters=new TH1F("fHistoCascDcaXiDaughters","DCA #Xi daughters ",100,0.0,1.0);
1414  fOutputAll->Add(fHistoCascDcaXiDaughters);
1415  fHistoCascDcaV0Daughters=new TH1F("fHistoCascDcaV0Daughters","DCA #Xi daughters ",100,0.0,1.0);
1416  fOutputAll->Add(fHistoCascDcaV0Daughters);
1417  fHistoCascDcaV0ToPrimVertex=new TH1F("fHistoCascDcaV0ToPrimVertex","DCA V0 daughters ",100,0.0,1.0);
1418  fOutputAll->Add(fHistoCascDcaV0ToPrimVertex);
1419  fHistoCascDcaPosToPrimVertex=new TH1F("fHistoCascDcaPosToPrimVertex","DCA Pos-Prim ",100,0.0,1.0);
1420  fOutputAll->Add(fHistoCascDcaPosToPrimVertex);
1421  fHistoCascDcaNegToPrimVertex=new TH1F("fHistoCascDcaNegToPrimVertex","DCA Neg-Prim ",100,0.0,1.0);
1422  fOutputAll->Add(fHistoCascDcaNegToPrimVertex);
1423  fHistoCascDcaBachToPrimVertex=new TH1F("fHistoCascDcaBachToPrimVertex","DCA Bach-Prim ",100,0.0,1.0);
1424  fOutputAll->Add(fHistoCascDcaBachToPrimVertex);
1425  fHistoCascCosPAXiPrim=new TH1F("fHistoCascCosPAXiPrim","#Xi CosPA (prim)",100,0.8,1.0);
1426  fOutputAll->Add(fHistoCascCosPAXiPrim);
1427  fHistoXiPt=new TH1F("fHistoXiPt","#Xi^{-} p_{T}",100,0.,10.);
1428  fOutputAll->Add(fHistoXiPt);
1429  fHistoPiPt=new TH1F("fHistoPiPt","#pi p_{T}",100,0.,10);
1430  fOutputAll->Add(fHistoPiPt);
1431  fHistoPid0=new TH1F("fHistoPid0","#pi d_{0}",100,-0.1,0.1);
1432  fOutputAll->Add(fHistoPid0);
1433  fHistonSigmaTPCpi=new TH1F("fHistonSigmaTPCpi","n#sigma (TPC, pion)",100,-10.,10.);
1434  fOutputAll->Add(fHistonSigmaTPCpi);
1435  fHistonSigmaTOFpi=new TH1F("fHistonSigmaTOFpi","n#sigma (TOF, pion)",100,-10.,10.);
1436  fOutputAll->Add(fHistonSigmaTOFpi);
1437  fHistoProbPion=new TH1F("fHistoProbPion","Bayse Prob",100,0.0,1.);
1438  fOutputAll->Add(fHistoProbPion);
1439 
1440  return;
1441 }
1442 */
1443 //________________________________________________________________________
1444 void AliAnalysisTaskSEXicZero2XiPifromAODtracks::SelectTrack( const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks,Bool_t *seleFlags)
1445 {
1446  //
1447  // Select good tracks using fAnalCuts (AliRDHFCuts object) and return the array of their ids
1448  //
1449 
1450  //const Int_t entries = event->GetNumberOfTracks();
1451  if(trkEntries==0) return;
1452 
1453  nSeleTrks=0;
1454  for(Int_t i=0; i<trkEntries; i++) {
1455  seleFlags[i] = kFALSE;
1456 
1457  AliVTrack *track;
1458  track = (AliVTrack*)event->GetTrack(i);
1459 
1460  if(track->GetID()<0) continue;
1461  Double_t covtest[21];
1462  if(!track->GetCovarianceXYZPxPyPz(covtest)) continue;
1463 
1464  AliAODTrack *aodt = (AliAODTrack*)track;
1465 
1466  if(!fAnalCuts) continue;
1467  if(fAnalCuts->SingleTrkCuts(aodt)){
1468  seleFlags[i]=kTRUE;
1469  nSeleTrks++;
1470  fHistoPiPtRef->Fill(aodt->Pt());
1471  }
1472  } // end loop on tracks
1473 }
1474 
1475 //________________________________________________________________________
1476 void AliAnalysisTaskSEXicZero2XiPifromAODtracks::SelectCascade( const AliVEvent *event,Int_t nCascades,Int_t &nSeleCasc, Bool_t *seleCascFlags)
1477 {
1478  //
1479  // Select good cascade using fAnalCuts (AliRDHFCuts object) and return the array of their ids
1480  //
1481 
1482  Double_t primVtx[3];
1483  fVtx1->GetXYZ(primVtx);
1484 
1485  nSeleCasc = 0;
1486  for(Int_t icasc=0;icasc<nCascades;icasc++)
1487  {
1488  seleCascFlags[icasc] = kFALSE;
1489  AliAODcascade *casc = ((AliAODEvent*)event)->GetCascade(icasc);
1490 
1491  if(!fAnalCuts) continue;
1492  if(fAnalCuts->SingleCascadeCuts(casc,primVtx,fAnaOmegacZero)){
1493  seleCascFlags[icasc] = kTRUE;
1494  nSeleCasc++;
1495  }
1496  if(fAnalCuts->SingleCascadeCutsRef(casc,primVtx,fAnaOmegacZero))
1497  {
1498  Double_t rapxi = casc->RapXi();
1499  if(rapxi>-1.5&&rapxi<-1.0){
1500  fHistoXiMassvsPtRef2->Fill(casc->MassXi(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1501  }
1502  if(rapxi>-1.0&&rapxi<-0.5){
1503  fHistoXiMassvsPtRef3->Fill(casc->MassXi(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1504  }
1505  if(rapxi>-0.5&&rapxi<0.0){
1506  fHistoXiMassvsPtRef->Fill(casc->MassXi(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1507  }
1508  if(rapxi>0.0&&rapxi<0.5){
1509  fHistoXiMassvsPtRef4->Fill(casc->MassXi(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1510  }
1511  if(rapxi>0.5&&rapxi<1.0){
1512  fHistoXiMassvsPtRef5->Fill(casc->MassXi(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1513  }
1514  if(rapxi>1.0&&rapxi<1.5){
1515  fHistoXiMassvsPtRef6->Fill(casc->MassXi(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1516  }
1517  }
1518  }
1519 }
1520 
1521 //________________________________________________________________________
1522 //________________________________________________________________________
1523 AliAODRecoCascadeHF* AliAnalysisTaskSEXicZero2XiPifromAODtracks::MakeCascadeHF(AliAODcascade *casc, AliAODTrack *part, AliAODEvent * aod, AliAODVertex *secVert)
1524 {
1525  //
1526  // Create AliAODRecoCascadeHF object from the argument
1527  //
1528 
1529  if(!casc) return 0x0;
1530  if(!part) return 0x0;
1531  if(!aod) return 0x0;
1532 
1533  //------------------------------------------------
1534  // PrimaryVertex
1535  //------------------------------------------------
1536  AliAODVertex *primVertexAOD;
1537  Bool_t unsetvtx = kFALSE;
1539  primVertexAOD = CallPrimaryVertex(casc,part,aod);
1540  if(!primVertexAOD){
1541  primVertexAOD = fVtx1;
1542  }else{
1543  unsetvtx = kTRUE;
1544  }
1545  }else{
1546  primVertexAOD = fVtx1;
1547  }
1548  if(!primVertexAOD) return 0x0;
1549  Double_t posprim[3]; primVertexAOD->GetXYZ(posprim);
1550 
1551  //------------------------------------------------
1552  // DCA between tracks
1553  //------------------------------------------------
1554  AliESDtrack *esdtrack = new AliESDtrack((AliVTrack*)part);
1555 
1556  Double_t xyz[3], pxpypz[3], cv[21]; Short_t sign;
1557  xyz[0]=casc->DecayVertexXiX();
1558  xyz[1]=casc->DecayVertexXiY();
1559  xyz[2]=casc->DecayVertexXiZ();
1560  pxpypz[0]=casc->MomXiX();
1561  pxpypz[1]=casc->MomXiY();
1562  pxpypz[2]=casc->MomXiZ();
1563  casc->GetCovarianceXYZPxPyPz(cv);
1564  sign=casc->ChargeXi();
1565  AliExternalTrackParam *trackCasc = new AliExternalTrackParam(xyz,pxpypz,cv,sign);
1566 
1567  Double_t xdummy, ydummy;
1568  Double_t dca = esdtrack->GetDCA(trackCasc,fBzkG,xdummy,ydummy);
1569 
1570 
1571  //------------------------------------------------
1572  // Propagate all tracks to the secondary vertex and calculate momentum there
1573  //------------------------------------------------
1574 
1575  Double_t d0z0bach[2],covd0z0bach[3];
1576  if(sqrt(pow(secVert->GetX(),2)+pow(secVert->GetY(),2))<1.){
1577  part->PropagateToDCA(secVert,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
1578  trackCasc->PropagateToDCA(secVert,fBzkG,kVeryBig);
1579  }else{
1580  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
1581  trackCasc->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig);
1582  }
1583  Double_t momcasc_new[3]={-9999,-9999,-9999.};
1584  trackCasc->GetPxPyPz(momcasc_new);
1585 
1586  Double_t px[2],py[2],pz[2];
1587  px[0] = part->Px(); py[0] = part->Py(); pz[0] = part->Pz();
1588  px[1] = momcasc_new[0]; py[1] = momcasc_new[1]; pz[1] = momcasc_new[2];
1589 
1590  //------------------------------------------------
1591  // d0
1592  //------------------------------------------------
1593  Double_t d0[2],d0err[2];
1594 
1595  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
1596  d0[0]= d0z0bach[0];
1597  d0err[0] = TMath::Sqrt(covd0z0bach[0]);
1598 
1599  Double_t d0z0casc[2],covd0z0casc[3];
1600  trackCasc->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0casc,covd0z0casc);
1601  d0[1]= d0z0casc[0];
1602  d0err[1] = TMath::Sqrt(covd0z0casc[0]);
1603 
1604  //------------------------------------------------
1605  // Create AliAODRecoCascadeHF
1606  //------------------------------------------------
1607  Short_t charge = part->Charge()+trackCasc->Charge(); //ho aggiunto al carica del cascade... e'corretto?
1608  AliAODRecoCascadeHF *theCascade = new AliAODRecoCascadeHF(secVert,charge,px,py,pz,d0,d0err,dca);
1609  if(!theCascade)
1610  {
1611  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
1612  if(esdtrack) delete esdtrack;
1613  if(trackCasc) delete trackCasc;
1614  return 0x0;
1615  }
1616  theCascade->SetOwnPrimaryVtx(primVertexAOD);
1617  UShort_t id[2]={(UShort_t)part->GetID(),(UShort_t)trackCasc->GetID()};
1618  theCascade->SetProngIDs(2,id);
1619 
1620  theCascade->GetSecondaryVtx()->AddDaughter(part);
1621  theCascade->GetSecondaryVtx()->AddDaughter(casc);
1622 
1623  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
1624  if(esdtrack) delete esdtrack;
1625  if(trackCasc) delete trackCasc;
1626 
1627  return theCascade;
1628 }
1629 
1630 //________________________________________________________________________
1631 AliAODVertex* AliAnalysisTaskSEXicZero2XiPifromAODtracks::CallPrimaryVertex(AliAODcascade *casc, AliAODTrack *trk, AliAODEvent* aod)
1632 {
1633  //
1634  // Make an array of tracks which should not be used in primary vertex calculation and
1635  // Call PrimaryVertex function
1636  //
1637 
1638  TObjArray *TrackArray = new TObjArray(3);
1639 
1640  AliESDtrack *cptrk1 = new AliESDtrack((AliVTrack*)trk);
1641  TrackArray->AddAt(cptrk1,0);
1642 
1643  AliESDtrack *cascptrack = new AliESDtrack((AliVTrack*)casc->GetDaughter(0));
1644  TrackArray->AddAt(cascptrack,1);
1645  AliESDtrack *cascntrack = new AliESDtrack((AliVTrack*)casc->GetDaughter(1));
1646  TrackArray->AddAt(cascntrack,2);
1647  AliESDtrack *cascbtrack = new AliESDtrack((AliVTrack*)casc->GetDecayVertexXi()->GetDaughter(0));
1648  TrackArray->AddAt(cascbtrack,3);
1649 
1650  AliAODVertex *newvert = PrimaryVertex(TrackArray,aod);
1651 
1652  for(Int_t i=0;i<4;i++)
1653  {
1654  AliESDtrack *tesd = (AliESDtrack*)TrackArray->UncheckedAt(i);
1655  delete tesd;
1656  }
1657  TrackArray->Clear();
1658  delete TrackArray;
1659 
1660  return newvert;
1661 }
1662 
1663 //________________________________________________________________________
1665  AliVEvent *event)
1666 {
1667  //
1668  //Used only for pp
1669  //copied from AliAnalysisVertexingHF (except for the following 3 lines)
1670  //
1671 
1672  Bool_t fRecoPrimVtxSkippingTrks = kTRUE;
1673  Bool_t fRmTrksFromPrimVtx = kFALSE;
1674 
1675  AliESDVertex *vertexESD = 0;
1676  AliAODVertex *vertexAOD = 0;
1677 
1678  //vertexESD = new AliESDVertex(*fV1);
1679 
1680 
1681  if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) {
1682  // primary vertex from the input event
1683 
1684  vertexESD = new AliESDVertex(*fV1);
1685 
1686  } else {
1687  // primary vertex specific to this candidate
1688 
1689  Int_t nTrks = trkArray->GetEntriesFast();
1690  AliVertexerTracks *vertexer = new AliVertexerTracks(event->GetMagneticField());
1691 
1692  if(fRecoPrimVtxSkippingTrks) {
1693  // recalculating the vertex
1694 
1695  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraint")) {
1696  Float_t diamondcovxy[3];
1697  event->GetDiamondCovXY(diamondcovxy);
1698  Double_t pos[3]={event->GetDiamondX(),event->GetDiamondY(),0.};
1699  Double_t cov[6]={diamondcovxy[0],diamondcovxy[1],diamondcovxy[2],0.,0.,10.*10.};
1700  AliESDVertex *diamond = new AliESDVertex(pos,cov,1.,1);
1701  vertexer->SetVtxStart(diamond);
1702  delete diamond; diamond=NULL;
1703  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraintOnlyFitter"))
1704  vertexer->SetOnlyFitter();
1705  }
1706  Int_t skipped[1000];
1707  Int_t nTrksToSkip=0,id;
1708  AliExternalTrackParam *t = 0;
1709  for(Int_t i=0; i<nTrks; i++) {
1710  t = (AliExternalTrackParam*)trkArray->UncheckedAt(i);
1711  id = (Int_t)t->GetID();
1712  if(id<0) continue;
1713  skipped[nTrksToSkip++] = id;
1714  }
1715  // TEMPORARY FIX
1716  // For AOD, skip also tracks without covariance matrix
1717  Double_t covtest[21];
1718  for(Int_t j=0; j<event->GetNumberOfTracks(); j++) {
1719  AliVTrack *vtrack = (AliVTrack*)event->GetTrack(j);
1720  if(!vtrack->GetCovarianceXYZPxPyPz(covtest)) {
1721  id = (Int_t)vtrack->GetID();
1722  if(id<0) continue;
1723  skipped[nTrksToSkip++] = id;
1724  }
1725  }
1726  for(Int_t ijk=nTrksToSkip; ijk<1000; ijk++) skipped[ijk]=-1;
1727  //
1728  vertexer->SetSkipTracks(nTrksToSkip,skipped);
1729  vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(event);
1730 
1731  } else if(fRmTrksFromPrimVtx && nTrks>0) {
1732  // removing the prongs tracks
1733 
1734  TObjArray rmArray(nTrks);
1735  UShort_t *rmId = new UShort_t[nTrks];
1736  AliESDtrack *esdTrack = 0;
1737  AliESDtrack *t = 0;
1738  for(Int_t i=0; i<nTrks; i++) {
1739  t = (AliESDtrack*)trkArray->UncheckedAt(i);
1740  esdTrack = new AliESDtrack(*t);
1741  rmArray.AddLast(esdTrack);
1742  if(esdTrack->GetID()>=0) {
1743  rmId[i]=(UShort_t)esdTrack->GetID();
1744  } else {
1745  rmId[i]=9999;
1746  }
1747  }
1748  Float_t diamondxy[2]={static_cast<Float_t>(event->GetDiamondX()),static_cast<Float_t>(event->GetDiamondY())};
1749  vertexESD = vertexer->RemoveTracksFromVertex(fV1,&rmArray,rmId,diamondxy);
1750  delete [] rmId; rmId=NULL;
1751  rmArray.Delete();
1752 
1753  }
1754 
1755  delete vertexer; vertexer=NULL;
1756  if(!vertexESD) return vertexAOD;
1757  if(vertexESD->GetNContributors()<=0) {
1758  //AliDebug(2,"vertexing failed");
1759  delete vertexESD; vertexESD=NULL;
1760  return vertexAOD;
1761  }
1762 
1763 
1764  }
1765 
1766  // convert to AliAODVertex
1767  Double_t pos[3],cov[6],chi2perNDF;
1768  vertexESD->GetXYZ(pos); // position
1769  vertexESD->GetCovMatrix(cov); //covariance matrix
1770  chi2perNDF = vertexESD->GetChi2toNDF();
1771  delete vertexESD; vertexESD=NULL;
1772 
1773  vertexAOD = new AliAODVertex(pos,cov,chi2perNDF);
1774 
1775  return vertexAOD;
1776 }
1777 
1778 //________________________________________________________________________
1779 AliAODVertex* AliAnalysisTaskSEXicZero2XiPifromAODtracks::ReconstructSecondaryVertex(AliAODcascade *casc, AliAODTrack *part, AliAODEvent * aod)
1780 {
1781  //
1782  // Reconstruct secondary vertex from trkArray (Copied from AliAnalysisVertexingHF)
1783  //
1784 
1785  AliAODVertex *primVertexAOD;
1786  Bool_t unsetvtx = kFALSE;
1788  primVertexAOD = CallPrimaryVertex(casc,part,aod);
1789  if(!primVertexAOD){
1790  primVertexAOD = fVtx1;
1791  }else{
1792  unsetvtx = kTRUE;
1793  }
1794  }else{
1795  primVertexAOD = fVtx1;
1796  }
1797  if(!primVertexAOD) return 0x0;
1798 
1799  AliESDVertex * vertexESD = new AliESDVertex(*fV1);
1800 
1801  Double_t pos[3],cov[6],chi2perNDF;
1802  vertexESD->GetXYZ(pos); // position
1803  vertexESD->GetCovMatrix(cov); //covariance matrix
1804  chi2perNDF = vertexESD->GetChi2toNDF();
1805  delete vertexESD; vertexESD=NULL;
1806 
1807  AliAODVertex *secVert = new AliAODVertex(pos,cov,chi2perNDF);
1808 
1809  return secVert;
1810 }
1811 //________________________________________________________________________
1812 Int_t AliAnalysisTaskSEXicZero2XiPifromAODtracks::MatchtoMC(AliAODRecoCascadeHF *exobj, Int_t pdgabs, Int_t pdgabscasc, Int_t *pdgDg,Int_t *pdgDgcasc,Int_t *pdgDgv0, TClonesArray *mcArray)
1813 {
1814  AliAODcascade *theCascade = dynamic_cast<AliAODcascade*>(exobj->GetCascade());
1815  if(!theCascade) return -1;
1816 
1817  AliAODTrack *trk = dynamic_cast<AliAODTrack*>(exobj->GetBachelor()); // the bachelor
1818  if (!trk) return -1;
1819 
1820  Int_t labcasc = MatchToMCCascade(theCascade,pdgabscasc,pdgDgcasc,pdgDgv0,mcArray);
1821 
1822  if(labcasc<0) return -1;
1823  Int_t labtrk = trk->GetLabel();
1824  if(labtrk<0) return -1;
1825 
1826  Int_t dgLabels[10]={0,0,0,0,0,0,0,0,0,0};
1827 
1828  dgLabels[0] = labtrk;
1829  dgLabels[1] = labcasc;
1830 
1831  Int_t finalLabel = MatchToMCXicZero(pdgabs,mcArray,dgLabels,2,2,pdgDg);
1832  return finalLabel;
1833 }
1834 //________________________________________________________________________
1835 Int_t AliAnalysisTaskSEXicZero2XiPifromAODtracks::MatchToMCCascade(AliAODcascade *theCascade, Int_t pdgabscasc, Int_t *pdgDgcasc, Int_t *pdgDgv0, TClonesArray *mcArray) // the cascade
1836 {
1837  AliAODTrack *cptrack = (AliAODTrack*) theCascade->GetDaughter(0);
1838  if(!cptrack) return -1;
1839  Int_t label_p = cptrack->GetLabel();
1840  if(label_p<0) return -1;
1841  AliAODTrack *cntrack = (AliAODTrack*) theCascade->GetDaughter(1);
1842  if(!cntrack) return -1;
1843  Int_t label_n = cntrack->GetLabel();
1844  if(label_n<0) return -1;
1845  Int_t labv0 = theCascade->MatchToMC(pdgDgcasc[1],mcArray,2,pdgDgv0);
1846  if(labv0<0) return -1;
1847  AliAODMCParticle *mcpartv0= (AliAODMCParticle*) mcArray->At(labv0);
1848 
1849  AliAODTrack *cbtrack = (AliAODTrack*) theCascade->GetDecayVertexXi()->GetDaughter(0);
1850  if(!cbtrack) return -1;
1851 
1852  Int_t label_b = cbtrack->GetLabel();
1853  if(label_b<0) return -1;
1854 
1855  AliAODMCParticle *mcpartb= (AliAODMCParticle*) mcArray->At(label_b);
1856  Int_t pdgb = TMath::Abs(mcpartb->GetPdgCode());
1857  if(pdgb!=pdgDgcasc[0]) return -1;
1858 
1859  AliAODMCParticle *mcmotherv0=mcpartv0;
1860  Bool_t isFromXiv0 = kFALSE;
1861  Int_t labxiv0 = mcmotherv0->GetMother();
1862  if(labxiv0<0) return -1;
1863  mcmotherv0 = (AliAODMCParticle*) mcArray->At(labxiv0);
1864  if(mcmotherv0){
1865  Int_t pdg = TMath::Abs(mcmotherv0 ->GetPdgCode());
1866  if(pdg==pdgabscasc){
1867  isFromXiv0 = kTRUE;
1868  }
1869  }
1870  if(!isFromXiv0) return -1;
1871 
1872  AliAODMCParticle *mcmotherb=mcpartb;
1873  Bool_t isFromXib = kFALSE;
1874  Int_t labxib = mcmotherb->GetMother();
1875  if(labxib<0) return -1;
1876  mcmotherb = (AliAODMCParticle*) mcArray->At(labxib);
1877  if(mcmotherb){
1878  Int_t pdg = TMath::Abs(mcmotherb ->GetPdgCode());
1879  if(pdg==pdgabscasc){
1880  isFromXib = kTRUE;
1881  }
1882  }
1883  if(!isFromXib) return -1;
1884 
1885  if(labxiv0!=labxib) return -1;//Bachelor and V0 should come from the same Xi
1886 
1887  return labxib;
1888 }
1889 //----------------------------------------------------------------------------
1891  Int_t dgLabels[10],Int_t ndg,
1892  Int_t ndgCk, const Int_t *pdgDg)
1893 {
1900 
1901  Int_t labMom[10]={0,0,0,0,0,0,0,0,0,0};
1902  Int_t i,j,lab,labMother,pdgMother,pdgPart;
1903  AliAODMCParticle *part=0;
1904  AliAODMCParticle *mother=0;
1905  Bool_t pdgUsed[10]={kFALSE,kFALSE,kFALSE,kFALSE,kFALSE,kFALSE,kFALSE,kFALSE,kFALSE,kFALSE};
1906 
1907  // loop on daughter labels
1908  for(i=0; i<ndg; i++) {
1909  labMom[i]=-1;
1910  lab = TMath::Abs(dgLabels[i]);
1911  if(lab<0) {
1912  printf("daughter with negative label %d\n",lab);
1913  return -1;
1914  }
1915  part = (AliAODMCParticle*)mcArray->At(lab);
1916  if(!part) {
1917  printf("no MC particle\n");
1918  return -1;
1919  }
1920 
1921  // check the PDG of the daughter, if requested
1922  if(ndgCk>0) {
1923  pdgPart=TMath::Abs(part->GetPdgCode());
1924  for(j=0; j<ndg; j++) {
1925  if(!pdgUsed[j] && pdgPart==pdgDg[j]) {
1926  pdgUsed[j]=kTRUE;
1927  break;
1928  }
1929  }
1930  }
1931 
1932  mother = part;
1933  while(mother->GetMother()>=0) {
1934  labMother=mother->GetMother();
1935  mother = (AliAODMCParticle*)mcArray->At(labMother);
1936  if(!mother) {
1937  printf("no MC mother particle\n");
1938  break;
1939  }
1940  pdgMother = TMath::Abs(mother->GetPdgCode());
1941  if(pdgMother==pdgabs) {
1942  labMom[i]=labMother;
1943  break;
1944  } else if(pdgMother>pdgabs || pdgMother<10) {
1945  break;
1946  }
1947  }
1948  if(labMom[i]==-1) return -1; // mother PDG not ok for this daughter
1949  } // end loop on daughters
1950 
1951  // check if the candidate is signal
1952  labMother=labMom[0];
1953  // all labels have to be the same and !=-1
1954  for(i=0; i<ndg; i++) {
1955  if(labMom[i]==-1) return -1;
1956  if(labMom[i]!=labMother) return -1;
1957  }
1958 
1959  // check that all daughter PDGs are matched
1960  if(ndgCk>0) {
1961  for(i=0; i<ndg; i++) {
1962  if(pdgUsed[i]==kFALSE) return -1;
1963  }
1964  }
1965 
1966  return labMother;
1967 }
Int_t charge
Int_t MatchToMCCascade(AliAODcascade *theCascade, Int_t pdgabscasc, Int_t *pdgDgcasc, Int_t *pdgDgv0, TClonesArray *mcArray)
Int_t pdg
double Double_t
Definition: External.C:58
Definition: External.C:236
AliRDHFCutsXicZerotoXiPifromAODtracks * fAnalCuts
histogram to check centrality
void FillROOTObjects(AliAODRecoCascadeHF *xicobj, AliAODcascade *casc, AliAODTrack *part1, AliAODMCParticle *mcpart, AliAODMCParticle *mcdaughter1, AliAODMCParticle *mcdaughterxi, Int_t mcnused, Bool_t isXiC)
Bool_t GetUseCombined()
Definition: AliAODPidHF.h:178
char Char_t
Definition: External.C:18
TH1F * fHistoCascDcaNegToPrimVertex
! DCA of negative track to primary vertex
Bool_t SingleCascadeCuts(AliAODcascade *casc, Double_t *vert, Bool_t anaOmegacZero)
TH1F * fHistoCascDcaPosToPrimVertex
! DCA of positive track to primary vertex
Double_t GetMaxVtxZ() const
Definition: AliRDHFCuts.h:274
AliAODPidHF * GetPidHF() const
Definition: AliRDHFCuts.h:264
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
AliAODVertex * CallPrimaryVertex(AliAODcascade *casc, AliAODTrack *trk, AliAODEvent *evt)
float Float_t
Definition: External.C:68
void SelectTrack(const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks, Bool_t *seleFlags)
Bool_t SingleCascadeCutsRef(AliAODcascade *casc, Double_t *vert, Bool_t anaOmegaZero)
void SelectCascade(const AliVEvent *event, Int_t nCascades, Int_t &nSeleCasc, Bool_t *seleCascFlags)
AliAODVertex * ReconstructSecondaryVertex(AliAODcascade *casc, AliAODTrack *trk, AliAODEvent *aod)
AliAODTrack * GetBachelor() const
AliAODVertex * GetOwnPrimaryVtx() const
virtual void UserCreateOutputObjects()
Implementation of interface methods.
void SetProngIDs(Int_t nIDs, UShort_t *id)
AliPIDResponse * GetPidResponse() const
Definition: AliAODPidHF.h:173
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)
short Short_t
Definition: External.C:23
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
AliAODcascade * GetCascade() const
Double_t DecayLengthXY() const
Bool_t IsEventSelected(AliVEvent *event)
AliAODRecoCascadeHF * MakeCascadeHF(AliAODcascade *casc, AliAODTrack *trk, AliAODEvent *aod, AliAODVertex *vert)
TTree * fVariablesTree
flag to decide whether to write the candidate variables on a tree variables
TH1F * fHistoCascDcaBachToPrimVertex
! DCA of bachelor track to primary vertex
unsigned short UShort_t
Definition: External.C:28
Bool_t GetIsUsePID() const
Definition: AliRDHFCuts.h:287
const char Option_t
Definition: External.C:48
Bool_t fIsMB
Reconstruct primary vertex excluding candidate tracks.
Bool_t IsEventRejectedDueToTrigger() const
Definition: AliRDHFCuts.h:343
bool Bool_t
Definition: External.C:53
AliAODVertex * PrimaryVertex(const TObjArray *trkArray, AliVEvent *event)
Double_t DecayLength() const
TH1F * fHistoCascCosPAXiPrim
! Cosine pointing angle of Xi to primary vertex
Int_t MatchToMCXicZero(Int_t pdgabs, TClonesArray *mcArray, Int_t dgLabels[10], Int_t ndg, Int_t ndgCk, const Int_t *pdgDg)
Int_t MatchtoMC(AliAODRecoCascadeHF *exobj, Int_t pdgabs, Int_t pdgabscasc, Int_t *pdgDg, Int_t *pdgDgcasc, Int_t *pdgDgv0, TClonesArray *mcArray)
TList * fOutputAll
! User output slot 3 // Analysis histos