AliPhysics  fde8a9f (fde8a9f)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskSEXicPlus2XiPiPifromAODtracks.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 // XicPlus2XiPiPi 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 
37 #include <TSystem.h>
38 #include <TParticle.h>
39 #include <TParticlePDG.h>
40 #include <THnSparse.h>
41 #include <TH1F.h>
42 #include <TH2F.h>
43 #include <TLorentzVector.h>
44 #include <TTree.h>
45 #include "TROOT.h"
46 #include <TDatabasePDG.h>
47 #include <AliAnalysisDataSlot.h>
48 #include <AliAnalysisDataContainer.h>
49 #include "AliStack.h"
50 #include "AliMCEvent.h"
51 #include "AliAnalysisManager.h"
52 #include "AliAODMCHeader.h"
53 #include "AliAODHandler.h"
54 #include "AliLog.h"
55 #include "AliExternalTrackParam.h"
56 #include "AliAODVertex.h"
57 #include "AliESDVertex.h"
58 #include "AliAODRecoDecay.h"
59 #include "AliAODRecoDecayHF.h"
61 #include "AliESDtrack.h"
62 #include "AliAODTrack.h"
63 #include "AliAODv0.h"
64 #include "AliAODcascade.h"
65 #include "AliAODMCParticle.h"
66 #include "AliAnalysisTaskSE.h"
68 #include "AliPIDResponse.h"
69 #include "AliPIDCombined.h"
70 #include "AliAODPidHF.h"
71 #include "AliInputEventHandler.h"
72 #include "AliESDtrackCuts.h"
73 #include "AliNeutralTrackParam.h"
74 #include "AliKFParticle.h"
75 #include "AliKFVertex.h"
76 #include "AliExternalTrackParam.h"
77 #include "AliCentrality.h"
78 #include "AliVertexerTracks.h"
79 
80 using std::cout;
81 using std::endl;
82 
86 
87 //__________________________________________________________________________
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  fVariablesTree(0),
101  fReconstructPrimVert(kFALSE),
102  fIsMB(kFALSE),
103  fIsSemi(kFALSE),
104  fIsCent(kFALSE),
105  fIsINT7(kFALSE),
106  fIsEMC7(kFALSE),
107  fCandidateVariables(),
108  fVtx1(0),
109  fV1(0),
110  fBzkG(0),
111  fCentrality(0),
112  fTriggerCheck(0),
113  fHistoXicMass(0),
114  fHistoDcaPi1Pi2(0),
115  fHistoDcaPiCasc(0),
116  fHistoLikeDecayLength(0),
117  fHistoLikeDecayLengthXY(0),
118  fHistoXicCosPAXY(0),
119  fHistoXiMass(0),
120  fHistoCascDcaXiDaughters(0),
121  fHistoCascDcaV0Daughters(0),
122  fHistoCascDcaV0ToPrimVertex(0),
123  fHistoCascDcaPosToPrimVertex(0),
124  fHistoCascDcaNegToPrimVertex(0),
125  fHistoCascDcaBachToPrimVertex(0),
126  fHistoCascCosPAXiPrim(0),
127  fHistoXiPt(0),
128  fHistoPiPt(0),
129  fHistoPid0(0),
130  fHistonSigmaTPCpi(0),
131  fHistonSigmaTOFpi(0),
132  fHistoProbPion(0),
133  fHistoXiMassvsPtRef(0),
134  fHistoXiMassvsPtRef2(0),
135  fHistoXiMassvsPtRef3(0),
136  fHistoXiMassvsPtRef4(0),
137  fHistoXiMassvsPtRef5(0),
138  fHistoXiMassvsPtRef6(0),
139  fHistoPiPtRef(0)
140 {
141  //
142  // Default Constructor.
143  //
144 }
145 
146 //___________________________________________________________________________
149  Bool_t writeVariableTree) :
150  AliAnalysisTaskSE(name),
151  fUseMCInfo(kFALSE),
152  fOutput(0),
153  fOutputAll(0),
154  fListCuts(0),
155  fCEvents(0),
156  fHTrigger(0),
157  fHCentrality(0),
158  fAnalCuts(analCuts),
159  fIsEventSelected(kFALSE),
160  fWriteVariableTree(writeVariableTree),
161  fVariablesTree(0),
162  fReconstructPrimVert(kFALSE),
163  fIsMB(kFALSE),
164  fIsSemi(kFALSE),
165  fIsCent(kFALSE),
166  fIsINT7(kFALSE),
167  fIsEMC7(kFALSE),
168  fCandidateVariables(),
169  fVtx1(0),
170  fV1(0),
171  fBzkG(0),
172  fCentrality(0),
173  fTriggerCheck(0),
174  fHistoXicMass(0),
175  fHistoDcaPi1Pi2(0),
176  fHistoDcaPiCasc(0),
177  fHistoLikeDecayLength(0),
178  fHistoLikeDecayLengthXY(0),
179  fHistoXicCosPAXY(0),
180  fHistoXiMass(0),
181  fHistoCascDcaXiDaughters(0),
182  fHistoCascDcaV0Daughters(0),
183  fHistoCascDcaV0ToPrimVertex(0),
184  fHistoCascDcaPosToPrimVertex(0),
185  fHistoCascDcaNegToPrimVertex(0),
186  fHistoCascDcaBachToPrimVertex(0),
187  fHistoCascCosPAXiPrim(0),
188  fHistoXiPt(0),
189  fHistoPiPt(0),
190  fHistoPid0(0),
191  fHistonSigmaTPCpi(0),
192  fHistonSigmaTOFpi(0),
193  fHistoProbPion(0),
194  fHistoXiMassvsPtRef(0),
195  fHistoXiMassvsPtRef2(0),
196  fHistoXiMassvsPtRef3(0),
197  fHistoXiMassvsPtRef4(0),
198  fHistoXiMassvsPtRef5(0),
199  fHistoXiMassvsPtRef6(0),
200  fHistoPiPtRef(0)
201 {
202  //
203  // Constructor. Initialization of Inputs and Outputs
204  //
205  Info("AliAnalysisTaskSEXicPlus2XiPiPifromAODtracks","Calling Constructor");
206 
207  DefineOutput(1,TList::Class());
208  DefineOutput(2,TList::Class());
209  if(writeVariableTree){
210  DefineOutput(3,TTree::Class());
211  }else{
212  DefineOutput(3,TList::Class());
213  }
214 }
215 
216 //___________________________________________________________________________
218  //
219  // destructor
220  //
221  Info("~AliAnalysisTaskSEXicPlus2XiPiPifromAODtracks","Calling Destructor");
222 
223 
224  if (fOutput) {
225  delete fOutput;
226  fOutput = 0;
227  }
228 
229  if (fOutputAll) {
230  delete fOutputAll;
231  fOutputAll = 0;
232  }
233 
234  if (fListCuts) {
235  delete fListCuts;
236  fListCuts = 0;
237  }
238 
239 
240  if (fAnalCuts) {
241  delete fAnalCuts;
242  fAnalCuts = 0;
243  }
244 
245  if (fVariablesTree) {
246  delete fVariablesTree;
247  fVariablesTree = 0;
248  }
249 
251  delete fCandidateVariables;
253  }
254 
255 }
256 
257 //_________________________________________________
259  //
260  // Initialization
261  //
262  //
263 
264  //Copied from $ALICE_ROOT/PWGHF/vertexingHF/ConfigVertexingHF.C
265 
266  fIsEventSelected=kFALSE;
267 
268  if (fDebug > 1) AliInfo("Init");
269 
270  fListCuts = new TList();
271  fListCuts->SetOwner();
272  fListCuts->SetName("ListCuts");
274  PostData(2,fListCuts);
275 
276  return;
277 }
278 
279 //_________________________________________________
281 {
282  //
283  // UserExec code
284  //
285 
286  if (!fInputEvent) {
287  AliError("NO EVENT FOUND!");
288  return;
289  }
290  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
291 
292 
293  fCEvents->Fill(1);
294  //------------------------------------------------
295  // First check if the event has proper vertex and B
296  //------------------------------------------------
297  fVtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
298  if (!fVtx1) return;
299 
300  Double_t pos[3],cov[6];
301  fVtx1->GetXYZ(pos);
302  fVtx1->GetCovarianceMatrix(cov);
303  fV1 = new AliESDVertex(pos,cov,100.,100,fVtx1->GetName());
304 
305  fBzkG = (Double_t)aodEvent->GetMagneticField();
306  AliKFParticle::SetField(fBzkG);
307  if (TMath::Abs(fBzkG)<0.001) {
308  delete fV1;
309  return;
310  }
311  fCEvents->Fill(2);
312 
313  //------------------------------------------------
314  // Event selection
315  //------------------------------------------------
316  Bool_t fIsTriggerNotOK = fAnalCuts->IsEventRejectedDueToTrigger();
317  if(!fIsTriggerNotOK) fCEvents->Fill(3);
318 
320  if(!fIsEventSelected) {
321  //cout<<"Why: "<<fAnalCuts->GetWhyRejection()<<endl;
322  delete fV1;
323  return;
324  }
325 
326  //cout<<fabs(aodEvent->GetPrimaryVertex()->GetZ()-aodEvent->GetPrimaryVertexSPD()->GetZ())<<endl;
327 
328  fCEvents->Fill(4);
329 
330  fIsMB=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kMB)==(AliVEvent::kMB);
331  fIsSemi=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kSemiCentral)==(AliVEvent::kSemiCentral);
332  fIsCent=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kCentral)==(AliVEvent::kCentral);
333  fIsINT7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kINT7)==(AliVEvent::kINT7);
334  fIsEMC7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kEMC7)==(AliVEvent::kEMC7);
336  if(fIsMB) fHTrigger->Fill(1);
337  if(fIsSemi) fHTrigger->Fill(2);
338  if(fIsCent) fHTrigger->Fill(3);
339  if(fIsINT7) fHTrigger->Fill(4);
340  if(fIsEMC7) fHTrigger->Fill(5);
341  if(fIsMB|fIsSemi|fIsCent) fHTrigger->Fill(7);
342  if(fIsINT7|fIsEMC7) fHTrigger->Fill(8);
343  if(fIsMB&fIsSemi) fHTrigger->Fill(10);
344  if(fIsMB&fIsCent) fHTrigger->Fill(11);
345  if(fIsINT7&fIsEMC7) fHTrigger->Fill(12);
346 
347  AliCentrality *cent = aodEvent->GetCentrality();
348  fCentrality = cent->GetCentralityPercentile("V0M");
349  fHCentrality->Fill(fCentrality);
350 
351  //------------------------------------------------
352  // Check if the event has cascade candidate
353  //------------------------------------------------
354  Int_t ncasc = aodEvent->GetNumberOfCascades();
355  Int_t nselecasc = 0.;
356  for(Int_t ic=0;ic<ncasc;ic++){
357  AliAODcascade *casc = aodEvent->GetCascade(ic);
358  if(!fAnalCuts) continue;
359  if(fAnalCuts->SingleCascadeCuts(casc,pos)) nselecasc++;
360  }
361 
362  if(nselecasc==0){
363  delete fV1;
364  return;
365  }
366 
367  fCEvents->Fill(5);
368 
369  //------------------------------------------------
370  // MC analysis setting
371  //------------------------------------------------
372  TClonesArray *mcArray = 0;
373  AliAODMCHeader *mcHeader=0;
374  if (fUseMCInfo) {
375  // MC array need for maching
376  mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
377  if (!mcArray) {
378  AliError("Could not find Monte-Carlo in AOD");
379  delete fV1;
380  return;
381  }
382  fCEvents->Fill(6); // in case of MC events
383 
384  // load MC header
385  mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
386  if (!mcHeader) {
387  AliError("AliAnalysisTaskSEXicPlus2XiPiPifromAODtracks::UserExec: MC header branch not found!\n");
388  delete fV1;
389  return;
390  }
391  fCEvents->Fill(7); // in case of MC events
392 
393  Double_t zMCVertex = mcHeader->GetVtxZ();
394  if (TMath::Abs(zMCVertex) > fAnalCuts->GetMaxVtxZ()) {
395  AliDebug(2,Form("Event rejected: abs(zVtxMC)=%f > fAnalCuts->GetMaxVtxZ()=%f",zMCVertex,fAnalCuts->GetMaxVtxZ()));
396  delete fV1;
397  return;
398  } else {
399  fCEvents->Fill(17); // in case of MC events
400  }
401  }
402 
403  //------------------------------------------------
404  // Main analysis done in this function
405  //------------------------------------------------
406  MakeAnalysis(aodEvent, mcArray);
407 
408  PostData(1,fOutput);
409  if(fWriteVariableTree){
410  PostData(3,fVariablesTree);
411  }else{
412  PostData(3,fOutputAll);
413  }
414 
415  fIsEventSelected=kFALSE;
416 
417  delete fV1;
418  return;
419 }
420 
421 //________________________________________ terminate ___________________________
423 {
424  // The Terminate() function is the last function to be called during
425  // a query. It always runs on the client, it can be used to present
426  // the results graphically or save the results to file.
427 
428  //AliInfo("Terminate","");
429  AliAnalysisTaskSE::Terminate();
430 
431  fOutput = dynamic_cast<TList*> (GetOutputData(1));
432  if (!fOutput) {
433  AliError("fOutput not available");
434  return;
435  }
436 
437  if(!fWriteVariableTree){
438  fOutputAll = dynamic_cast<TList*> (GetOutputData(3));
439  if (!fOutputAll) {
440  AliError("fOutputAll not available");
441  return;
442  }
443  }
444 
445  return;
446 }
447 
448 //___________________________________________________________________________
450 {
451  //
452  // UserCreateOutputObjects
453  //
454 
455  AliInfo(Form("CreateOutputObjects of task %s\n", GetName()));
456 
457  //------------------------------------------------
458  // output object setting
459  //------------------------------------------------
460  fOutput = new TList();
461  fOutput->SetOwner();
462  fOutput->SetName("chist0");
463  DefineGeneralHistograms(); // define general histograms
464  PostData(1,fOutput);
465 
467  if (fWriteVariableTree) {
468  PostData(3,fVariablesTree);
469  }else{
470  fOutputAll = new TList();
471  fOutputAll->SetOwner();
472  fOutputAll->SetName("anahisto");
473  DefineAnalysisHistograms(); // define general histograms
474  PostData(3,fOutputAll);
475  }
476 
477 
478  return;
479 }
480 
481 //________________________________________________________________________
483 (
484  AliAODEvent *aodEvent, TClonesArray *mcArray
485  )
486 {
487  //
488  // Main analysis part called from UserExec
489  //
490 
491  Int_t nCascades= aodEvent->GetNumberOfCascades();
492  if (nCascades==0) {
493  return;
494  }
495  Int_t nTracks= aodEvent->GetNumberOfTracks();
496  if (nTracks==0) {
497  return;
498  }
499 
500  //------------------------------------------------
501  // Select good track before hand to save time
502  //------------------------------------------------
503  Bool_t seleTrkFlags[nTracks];
504  Int_t nSeleTrks=0;
505  SelectTrack(aodEvent,nTracks,nSeleTrks,seleTrkFlags);
506  Bool_t seleCascFlags[nCascades];
507  Int_t nSeleCasc=0;
508  SelectCascade(aodEvent,nCascades,nSeleCasc,seleCascFlags);
509 
510  Int_t usedmclab[20];//Used Xic Label: Assuming there are less than 20 Xic/evt
511  Int_t nusedmclab[20];//Number of times the Xic label is used: Assuming there are less than 20 Xic/evt
512  for(Int_t i=0;i<20;i++) {
513  usedmclab[i]=-9999;
514  nusedmclab[i]=0;
515  }
516 
517  //------------------------------------------------
518  // Cascade loop
519  //------------------------------------------------
520  for (Int_t icasc = 0; icasc<nCascades; icasc++) {
521  if(!seleCascFlags[icasc]) continue;
522  AliAODcascade *casc = aodEvent->GetCascade(icasc);
523  if(!casc) continue;
524 
525  AliAODTrack *cptrack = (AliAODTrack*)(casc->GetDaughter(0));
526  AliAODTrack *cntrack = (AliAODTrack*)(casc->GetDaughter(1));
527  AliAODTrack *cbtrack = (AliAODTrack*)(casc->GetDecayVertexXi()->GetDaughter(0));
528  if(!cptrack || !cntrack || !cbtrack) continue;
529 
530  Int_t cpid = cptrack->GetID();
531  Int_t cnid = cntrack->GetID();
532  Int_t cbid = cbtrack->GetID();
533 
534  if(cptrack->Charge()==0) continue;
535  if(cntrack->Charge()==0) continue;
536  if(cbtrack->Charge()==0) continue;
537 
538  Short_t charge_casc = cptrack->Charge() + cntrack->Charge() + cbtrack->Charge();
539 
540  //------------------------------------------------
541  // Track1 loop
542  //------------------------------------------------
543  for (Int_t itrk1 = 0; itrk1<nTracks-1; itrk1++) {
544  if(!seleTrkFlags[itrk1]) continue;
545  AliAODTrack *trk1 = (AliAODTrack*)aodEvent->GetTrack(itrk1);
546  if(!trk1||trk1->GetID()<0) continue;
547 
548  //------------------------------------------------
549  // Track2 loop
550  //------------------------------------------------
551  for (Int_t itrk2 = itrk1+1; itrk2<nTracks; itrk2++) {
552  if(!seleTrkFlags[itrk2]) continue;
553  AliAODTrack *trk2 = (AliAODTrack*)aodEvent->GetTrack(itrk2);
554  if(!trk2||trk2->GetID()<0) continue;
555 
556  if(!SelectLikeSign(trk1,trk2)) continue;
557 
558  Int_t lpid1 = trk1->GetID();
559  Int_t lpid2 = trk2->GetID();
560  if((cpid==lpid1)||(cpid==lpid2)||(cnid==lpid1)||(cnid==lpid2)||(cbid==lpid1)||(cbid==lpid2)) continue;
561 
562 
563  Short_t charge_like1 = trk1->Charge();
564  Short_t charge_like2 = trk2->Charge();
565  Bool_t ok_charge = kFALSE;
566  if((charge_casc==-1)&&(charge_like1==1)&&(charge_like2==1)) ok_charge = kTRUE;
567  if((charge_casc==1)&&(charge_like1==-1)&&(charge_like2==-1)) ok_charge = kTRUE;
568  if(!ok_charge) continue;
569 
570  //------------------------------------------------
571  // Roughly select good candidates to speed up
572  //------------------------------------------------
573  if(!fAnalCuts->SelectWithRoughCuts(casc,trk1,trk2)) continue;
574 
575  //------------------------------------------------
576  // Secondary vertex calculation
577  //------------------------------------------------
578  Double_t dispersion;
579  AliAODVertex *secVert = CallReconstructSecondaryVertex(trk1,trk2,dispersion);
580  if(!secVert) continue;
581 
582  AliAODRecoCascadeHF3Prong *xicobj = MakeCascadeHF3Prong(casc,trk1,trk2,aodEvent,secVert,dispersion);
583  if(!xicobj) {
584  delete secVert;
585  continue;
586  }
587  AliAODMCParticle *mcxic = 0;
588  AliAODMCParticle *mcdaughter1 = 0;
589  AliAODMCParticle *mcdaughter2 = 0;
590  AliAODMCParticle *mcdaughterxi = 0;
591  Int_t mclabxic = 0;
592  Int_t nmclabxic = 0;
593  if(fUseMCInfo)
594  {
595  Int_t pdgDg[3]={211,3312,211};
596  Int_t pdgDgcasc[2]={211,3122};
597  Int_t pdgDgv0[2]={2212,211};
598  mclabxic = xicobj->MatchToMC(4232,pdgDg[1],pdgDg,pdgDgcasc,pdgDgv0,mcArray);
599  if(mclabxic>-1){
600  mcxic = (AliAODMCParticle*) mcArray->At(mclabxic);
601  for(Int_t ia=0;ia<20;ia++){
602  if(usedmclab[ia]==mclabxic){
603  nusedmclab[ia]++;
604  nmclabxic = nusedmclab[ia];
605  break;
606  }
607  if(usedmclab[ia]==-9999){
608  usedmclab[ia]=mclabxic;
609  nusedmclab[ia]++;
610  nmclabxic = nusedmclab[ia];
611  break;
612  }
613  }
614 
615  Int_t pi_counter = 0;
616  for(Int_t idau=mcxic->GetFirstDaughter();idau<mcxic->GetLastDaughter()+1;idau++)
617  {
618  //cout<<idau<<endl;
619  if(idau<0) break;
620  AliAODMCParticle *mcpart = (AliAODMCParticle*) mcArray->At(idau);
621  Int_t pdgcode = TMath::Abs(mcpart->GetPdgCode());
622  if(pdgcode==211 && pi_counter==0){
623  mcdaughter1 = mcpart;
624  pi_counter=1;
625  }else if(pdgcode==211 && pi_counter==1){
626  mcdaughter2 = mcpart;
627  pi_counter=2;
628  }else if(pdgcode==3312){
629  mcdaughterxi = mcpart;
630  }
631  }
632  //cout<<"pointer: "<<mcdaughter1<<" "<<mcdaughter2<<" "<<mcdaughterxi<<endl;
633  //cout<<"1: "<<mcdaughter1->GetPdgCode()<<endl;
634  //cout<<"2: "<<mcdaughter2->GetPdgCode()<<endl;
635  //cout<<"3: "<<mcdaughterxi->GetPdgCode()<<endl;
636 
637  }
638  }
639 
640  FillROOTObjects(xicobj,mcxic,mcdaughter1,mcdaughter2,mcdaughterxi,nmclabxic);
641 
642  xicobj->GetSecondaryVtx()->RemoveDaughters();
643  xicobj->UnsetOwnPrimaryVtx();
644  delete xicobj;xicobj=NULL;
645  delete secVert;
646 
647  }//trk2
648  }//trk1
649  }//casc
650 }
651 
652 //________________________________________________________________________
653 void AliAnalysisTaskSEXicPlus2XiPiPifromAODtracks::FillROOTObjects(AliAODRecoCascadeHF3Prong *xicobj, AliAODMCParticle *mcpart, AliAODMCParticle *mcdaughter1, AliAODMCParticle *mcdaughter2, AliAODMCParticle *mcdaughterxi, Int_t mcnused)
654 {
655  //
656  // Fill histogram or Tree depending on fWriteVariableTree flag
657  //
658 
659  AliAODTrack *part1 = xicobj->GetBachelor1();
660  AliAODTrack *part2 = xicobj->GetBachelor2();
661  AliAODcascade *casc = xicobj->GetCascade();
662 
663  fCandidateVariables[ 0] = xicobj->InvMassPiXiPi();
664  fCandidateVariables[ 1] = xicobj->Px();
665  fCandidateVariables[ 2] = xicobj->Py();
666  fCandidateVariables[ 3] = xicobj->Pz();
667  fCandidateVariables[ 4] = part1->Px();
668  fCandidateVariables[ 5] = part1->Py();
669  fCandidateVariables[ 6] = part1->Pz();
670  fCandidateVariables[ 7] = part2->Px();
671  fCandidateVariables[ 8] = part2->Py();
672  fCandidateVariables[ 9] = part2->Pz();
673  fCandidateVariables[10] = casc->MassXi();
674  fCandidateVariables[11] = casc->MomXiX();
675  fCandidateVariables[12] = casc->MomXiY();
676  fCandidateVariables[13] = casc->MomXiZ();
677  fCandidateVariables[14] = casc->MassLambda();
678  fCandidateVariables[15] = casc->MassAntiLambda();
679 
681  fCandidateVariables[17] = fVtx1->GetX();
682  fCandidateVariables[18] = fVtx1->GetY();
683  fCandidateVariables[19] = fVtx1->GetZ();
684  fCandidateVariables[20] = xicobj->GetOwnPrimaryVtx()->GetX();
685  fCandidateVariables[21] = xicobj->GetOwnPrimaryVtx()->GetY();
686  fCandidateVariables[22] = xicobj->GetOwnPrimaryVtx()->GetZ();
687 
688  fCandidateVariables[23] = xicobj->CascDcaXiDaughters();
689  fCandidateVariables[24] = xicobj->CascDcaV0Daughters();
690  fCandidateVariables[25] = xicobj->CascDecayLength();
696  fCandidateVariables[31] = xicobj->CascDecayLengthV0();
698 
699  Double_t dca[3];
700  xicobj->GetDCAs(dca);
701  fCandidateVariables[33] = dca[0];
702  fCandidateVariables[34] = dca[1];
703  fCandidateVariables[35] = dca[2];
704  fCandidateVariables[36] = xicobj->Getd0Prong(0);
705  fCandidateVariables[37] = xicobj->Getd0Prong(2);
706  fCandidateVariables[38] = xicobj->Getd0Prong(1);
707 
708  fCandidateVariables[39] = xicobj->DecayLength();
709  fCandidateVariables[40] = xicobj->DecayLengthXY();
711 
712  Double_t nSigmaTPCpi1=-9999.;
713  Double_t nSigmaTPCpi2=-9999.;
714  Double_t nSigmaTOFpi1=-9999.;
715  Double_t nSigmaTOFpi2=-9999.;
716  Double_t probPion1=-9999.;
717  Double_t probPion2=-9999.;
718 
719  if(fAnalCuts->GetIsUsePID())
720  {
721  nSigmaTPCpi1 = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(part1,AliPID::kPion);
722  fCandidateVariables[42] = nSigmaTPCpi1;
723  nSigmaTPCpi2 = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(part2,AliPID::kPion);
724  fCandidateVariables[43] = nSigmaTPCpi2;
725  nSigmaTOFpi1 = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(part1,AliPID::kPion);
726  fCandidateVariables[44] = nSigmaTOFpi1;
727  nSigmaTOFpi2 = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(part2,AliPID::kPion);
728  fCandidateVariables[45] = nSigmaTOFpi2;
729 
731  probPion1 = fAnalCuts->GetPionProbabilityTPCTOF(part1);
732  probPion2 = fAnalCuts->GetPionProbabilityTPCTOF(part2);
733  }
734  fCandidateVariables[46] = probPion1;
735  fCandidateVariables[47] = probPion2;
736  }
737  fCandidateVariables[48] = -9999;
738  fCandidateVariables[49] = -9999;
739  fCandidateVariables[50] = -9999;
740  fCandidateVariables[51] = -9999;
741  fCandidateVariables[52] = -9999;
742  fCandidateVariables[53] = -9999;
743  fCandidateVariables[54] = -9999;
744  fCandidateVariables[55] = -9999;
745  fCandidateVariables[56] = -9999;
746  fCandidateVariables[57] = -9999;
747  fCandidateVariables[65] = -9999;
748  fCandidateVariables[66] = -9999;
749  fCandidateVariables[67] = -9999;
750  fCandidateVariables[68] = -9999;
751  fCandidateVariables[69] = -9999;
752  fCandidateVariables[70] = -9999;
753  fCandidateVariables[71] = -9999;
754  fCandidateVariables[72] = -9999;
755  fCandidateVariables[73] = -9999;
756  fCandidateVariables[74] = -9999;
757  fCandidateVariables[75] = -9999;
758  fCandidateVariables[76] = -9999;
759 
760  if(fUseMCInfo){
761  if(mcpart){
762  fCandidateVariables[48] = mcpart->Label();
763  fCandidateVariables[49] = mcnused;
764  fCandidateVariables[50] = mcpart->GetPdgCode();
765  fCandidateVariables[54] = mcpart->Pt();
766  if(mcdaughter1&&mcdaughter2&&mcdaughterxi){
767  Double_t mcprimvertx = mcpart->Xv();
768  Double_t mcprimverty = mcpart->Yv();
769  Double_t mcsecvertx = mcdaughter1->Xv();
770  Double_t mcsecverty = mcdaughter1->Yv();
771  Double_t recosecvertx = xicobj->GetSecondaryVtx()->GetX();
772  Double_t recosecverty = xicobj->GetSecondaryVtx()->GetY();
773  fCandidateVariables[51] = TMath::Sqrt((mcsecvertx-mcprimvertx)*(mcsecvertx-mcprimvertx)+(mcsecverty-mcprimverty)*(mcsecverty-mcprimverty));
774  fCandidateVariables[52] = TMath::Sqrt((recosecvertx-mcprimvertx)*(recosecvertx-mcprimvertx)+(recosecverty-mcprimverty)*(recosecverty-mcprimverty));
775  Double_t vecx_vert = recosecvertx-mcprimvertx;
776  Double_t vecy_vert = recosecverty-mcprimverty;
777  Double_t vecl_vert = TMath::Sqrt(vecx_vert*vecx_vert+vecy_vert*vecy_vert);
778  Double_t vecx_mom = xicobj->Px();
779  Double_t vecy_mom = xicobj->Py();
780  Double_t vecl_mom = xicobj->Pt();
781  if(vecl_vert>0.&&vecl_mom>0.)
782  fCandidateVariables[53] = (vecx_vert*vecx_mom+vecy_vert*vecy_mom)/vecl_vert/vecl_mom;
783  fCandidateVariables[55] = mcdaughter1->Pt();
784  fCandidateVariables[56] = mcdaughter2->Pt();
785  fCandidateVariables[57] = mcdaughterxi->Pt();
786  fCandidateVariables[65] = mcpart->Px();
787  fCandidateVariables[66] = mcpart->Py();
788  fCandidateVariables[67] = mcpart->Pz();
789  fCandidateVariables[68] = mcdaughter1->Px();
790  fCandidateVariables[69] = mcdaughter1->Py();
791  fCandidateVariables[70] = mcdaughter1->Pz();
792  fCandidateVariables[71] = mcdaughter2->Px();
793  fCandidateVariables[72] = mcdaughter2->Py();
794  fCandidateVariables[73] = mcdaughter2->Pz();
795  fCandidateVariables[74] = mcdaughterxi->Px();
796  fCandidateVariables[75] = mcdaughterxi->Py();
797  fCandidateVariables[76] = mcdaughterxi->Pz();
798  }
799  }
800  }
801  fCandidateVariables[58] = casc->Px();
802  fCandidateVariables[59] = casc->Py();
803  fCandidateVariables[60] = casc->Pz();
804  fCandidateVariables[61] = -9999.;
805  fCandidateVariables[62] = -9999.;
806  fCandidateVariables[63] = -9999.;
807  if(TMath::Abs(casc->MassLambda()-1.115683)<0.02){
808  fCandidateVariables[61] = casc->MomPosX();
809  fCandidateVariables[62] = casc->MomPosY();
810  fCandidateVariables[63] = casc->MomPosZ();
811  }else{
812  fCandidateVariables[61] = casc->MomNegX();
813  fCandidateVariables[62] = casc->MomNegY();
814  fCandidateVariables[63] = casc->MomNegZ();
815  }
817 
818  fCandidateVariables[77] = casc->DecayVertexV0X();
819  fCandidateVariables[78] = casc->DecayVertexV0Y();
820  fCandidateVariables[79] = casc->DecayVertexV0Z();
821  fCandidateVariables[80] = casc->DecayVertexXiX();
822  fCandidateVariables[81] = casc->DecayVertexXiY();
823  fCandidateVariables[82] = casc->DecayVertexXiZ();
824  fCandidateVariables[83] = xicobj->GetSecondaryVtx()->GetX();
825  fCandidateVariables[84] = xicobj->GetSecondaryVtx()->GetY();
826  fCandidateVariables[85] = xicobj->GetSecondaryVtx()->GetZ();
827 
828  if(fUseMCInfo){
829  }
830 
831 
832 
834  fVariablesTree->Fill();
835  else{
837  {
838  Double_t cont[3];
839  cont[0] = xicobj->InvMassPiXiPi();
840  cont[1] = xicobj->Pt();
841  cont[2] = fCentrality;
842  fHistoXicMass->Fill(cont);
843 
844  fHistoDcaPi1Pi2->Fill(dca[2]);
845  fHistoDcaPiCasc->Fill(dca[0]);
846  fHistoDcaPiCasc->Fill(dca[1]);
847  fHistoLikeDecayLength->Fill(xicobj->DecayLength());
848  fHistoLikeDecayLengthXY->Fill(xicobj->DecayLengthXY());
849  fHistoXicCosPAXY->Fill(xicobj->XicCosPointingAngle());
850  fHistoXiMass->Fill(xicobj->CascMassXi());
858  fHistoXiPt->Fill(xicobj->PtProng(1));
859  fHistoPiPt->Fill(xicobj->PtProng(0));
860  fHistoPiPt->Fill(xicobj->PtProng(2));
861  fHistoPid0->Fill(xicobj->Getd0Prong(0));
862  fHistoPid0->Fill(xicobj->Getd0Prong(2));
863  fHistonSigmaTPCpi->Fill(nSigmaTPCpi1);
864  fHistonSigmaTPCpi->Fill(nSigmaTPCpi2);
865  fHistonSigmaTOFpi->Fill(nSigmaTOFpi1);
866  fHistonSigmaTOFpi->Fill(nSigmaTOFpi2);
867  fHistoProbPion->Fill(probPion1);
868  fHistoProbPion->Fill(probPion2);
869  }
870 
871  }
872  return;
873 }
874 
875 //________________________________________________________________________
877 {
878  //
879  // This is to define tree variables
880  //
881  const char* nameoutput = GetOutputSlot(3)->GetContainer()->GetName();
882  fVariablesTree = new TTree(nameoutput,"Candidates variables tree");
883  Int_t nVar = 86;
885  TString * fCandidateVariableNames = new TString[nVar];
886 
887  fCandidateVariableNames[ 0]="InvMassXic";
888  fCandidateVariableNames[ 1]="XicPx";
889  fCandidateVariableNames[ 2]="XicPy";
890  fCandidateVariableNames[ 3]="XicPz";
891  fCandidateVariableNames[ 4]="Pi1Px";
892  fCandidateVariableNames[ 5]="Pi1Py";
893  fCandidateVariableNames[ 6]="Pi1Pz";
894  fCandidateVariableNames[ 7]="Pi2Px";
895  fCandidateVariableNames[ 8]="Pi2Py";
896  fCandidateVariableNames[ 9]="Pi2Pz";
897  fCandidateVariableNames[10]="MassXi";
898  fCandidateVariableNames[11]="XiPx";
899  fCandidateVariableNames[12]="XiPy";
900  fCandidateVariableNames[13]="XiPz";
901  fCandidateVariableNames[14]="MassLambda";
902  fCandidateVariableNames[15]="MassAntiLambda";
903 
904  fCandidateVariableNames[16]="Centrality";
905  fCandidateVariableNames[17]="PrimVtxX";
906  fCandidateVariableNames[18]="PrimVtxY";
907  fCandidateVariableNames[19]="PrimVtxZ";
908  fCandidateVariableNames[20]="NewPrimVtxX";
909  fCandidateVariableNames[21]="NewPrimVtxY";
910  fCandidateVariableNames[22]="NewPrimVtxZ";
911 
912  fCandidateVariableNames[23]="CascDcaXiDaughters";
913  fCandidateVariableNames[24]="CascDcaV0Daughters";
914  fCandidateVariableNames[25]="CascDecayLengthXi";
915  fCandidateVariableNames[26]="CascCosPointingAngleXi";
916  fCandidateVariableNames[27]="CascDcaV0ToPrimVertex";
917  fCandidateVariableNames[28]="CascDcaPosToPrimVertex";
918  fCandidateVariableNames[29]="CascDcaNegToPrimVertex";
919  fCandidateVariableNames[30]="CascDcaBachToPrimVertex";
920  fCandidateVariableNames[31]="CascDecayLengthV0";
921  fCandidateVariableNames[32]="CascCosPointingAngleV0";
922 
923  fCandidateVariableNames[33]="DcaPi1Casc";
924  fCandidateVariableNames[34]="DcaPi2Casc";
925  fCandidateVariableNames[35]="DcaPi1Pi2";
926 
927  fCandidateVariableNames[36]="Pi1d0";
928  fCandidateVariableNames[37]="Pi2d0";
929  fCandidateVariableNames[38]="Cascd0";
930 
931  fCandidateVariableNames[39]="DecayLength";
932  fCandidateVariableNames[40]="DecayLengthXY";
933  fCandidateVariableNames[41]="XicCosPAXY";
934 
935  fCandidateVariableNames[42]="nSigmaTPCpi1";
936  fCandidateVariableNames[43]="nSigmaTPCpi2";
937  fCandidateVariableNames[44]="nSigmaTOFpi1";
938  fCandidateVariableNames[45]="nSigmaTOFpi2";
939  fCandidateVariableNames[46]="probPion1";
940  fCandidateVariableNames[47]="probPion2";
941 
942  fCandidateVariableNames[48]="mcxicID";
943  fCandidateVariableNames[49]="mcnused";
944  fCandidateVariableNames[50]="mcpdgcode";
945  fCandidateVariableNames[51]="mcdecaylength";
946  fCandidateVariableNames[52]="mcdecaylength_secsmear";
947  fCandidateVariableNames[53]="mcxiccospaxy";
948  fCandidateVariableNames[54]="mcxicpt";
949  fCandidateVariableNames[55]="mcpi1pt";
950  fCandidateVariableNames[56]="mcpi2pt";
951  fCandidateVariableNames[57]="mcxipt";
952 
953  fCandidateVariableNames[58]="LambdaPx";
954  fCandidateVariableNames[59]="LambdaPy";
955  fCandidateVariableNames[60]="LambdaPz";
956  fCandidateVariableNames[61]="ProtonPx";
957  fCandidateVariableNames[62]="ProtonPy";
958  fCandidateVariableNames[63]="ProtonPz";
959  fCandidateVariableNames[64]="BachelorsCosPAXY";
960 
961  fCandidateVariableNames[65]="mcxicpx";
962  fCandidateVariableNames[66]="mcxicpy";
963  fCandidateVariableNames[67]="mcxicpz";
964  fCandidateVariableNames[68]="mcpi1px";
965  fCandidateVariableNames[69]="mcpi1py";
966  fCandidateVariableNames[70]="mcpi1pz";
967  fCandidateVariableNames[71]="mcpi2px";
968  fCandidateVariableNames[72]="mcpi2py";
969  fCandidateVariableNames[73]="mcpi2pz";
970  fCandidateVariableNames[74]="mcxipx";
971  fCandidateVariableNames[75]="mcxipy";
972  fCandidateVariableNames[76]="mcxipz";
973 
974  fCandidateVariableNames[77]="LambdaVertX";
975  fCandidateVariableNames[78]="LambdaVertY";
976  fCandidateVariableNames[79]="LambdaVertZ";
977  fCandidateVariableNames[80]="XiVertX";
978  fCandidateVariableNames[81]="XiVertY";
979  fCandidateVariableNames[82]="XiVertZ";
980  fCandidateVariableNames[83]="XicVertX";
981  fCandidateVariableNames[84]="XicVertY";
982  fCandidateVariableNames[85]="XicVertZ";
983 
984 
985  for (Int_t ivar=0; ivar<nVar; ivar++) {
986  fVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
987  }
988 
989  return;
990 }
991 
992 //__________________________________________________________________________
994  //
995  // This is to define general histograms
996  //
997 
998  fCEvents = new TH1F("fCEvents","conter",18,-0.5,17.5);
999  fCEvents->SetStats(kTRUE);
1000  fCEvents->GetXaxis()->SetBinLabel(1,"X1");
1001  fCEvents->GetXaxis()->SetBinLabel(2,"Analyzed events");
1002  fCEvents->GetXaxis()->SetBinLabel(3,"AliAODVertex exists");
1003  fCEvents->GetXaxis()->SetBinLabel(4,"TriggerOK");
1004  fCEvents->GetXaxis()->SetBinLabel(5,"IsEventSelected");
1005  fCEvents->GetXaxis()->SetBinLabel(6,"CascadesHF exists");
1006  fCEvents->GetXaxis()->SetBinLabel(7,"MCarray exists");
1007  fCEvents->GetXaxis()->SetBinLabel(8,"MCheader exists");
1008  fCEvents->GetXaxis()->SetBinLabel(9,"triggerClass!=CINT1");
1009  fCEvents->GetXaxis()->SetBinLabel(10,"triggerMask!=kAnyINT");
1010  fCEvents->GetXaxis()->SetBinLabel(11,"triggerMask!=kAny");
1011  fCEvents->GetXaxis()->SetBinLabel(12,"vtxTitle.Contains(Z)");
1012  fCEvents->GetXaxis()->SetBinLabel(13,"vtxTitle.Contains(3D)");
1013  fCEvents->GetXaxis()->SetBinLabel(14,"vtxTitle.Doesn'tContain(Z-3D)");
1014  fCEvents->GetXaxis()->SetBinLabel(15,Form("zVtx<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
1015  fCEvents->GetXaxis()->SetBinLabel(16,"!IsEventSelected");
1016  fCEvents->GetXaxis()->SetBinLabel(17,"triggerMask!=kAnyINT || triggerClass!=CINT1");
1017  fCEvents->GetXaxis()->SetBinLabel(18,Form("zVtxMC<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
1018  //fCEvents->GetXaxis()->SetTitle("");
1019  fCEvents->GetYaxis()->SetTitle("counts");
1020 
1021  fHTrigger = new TH1F("fHTrigger","counter",18,-0.5,17.5);
1022  fHTrigger->SetStats(kTRUE);
1023  fHTrigger->GetXaxis()->SetBinLabel(1,"X1");
1024  fHTrigger->GetXaxis()->SetBinLabel(2,"kMB");
1025  fHTrigger->GetXaxis()->SetBinLabel(3,"kSemiCentral");
1026  fHTrigger->GetXaxis()->SetBinLabel(4,"kCentral");
1027  fHTrigger->GetXaxis()->SetBinLabel(5,"kINT7");
1028  fHTrigger->GetXaxis()->SetBinLabel(6,"kEMC7");
1029  //fHTrigger->GetXaxis()->SetBinLabel(7,"Space");
1030  fHTrigger->GetXaxis()->SetBinLabel(8,"kMB|kSemiCentral|kCentral");
1031  fHTrigger->GetXaxis()->SetBinLabel(9,"kINT7|kEMC7");
1032  fHTrigger->GetXaxis()->SetBinLabel(11,"kMB&kSemiCentral");
1033  fHTrigger->GetXaxis()->SetBinLabel(12,"kMB&kCentral");
1034  fHTrigger->GetXaxis()->SetBinLabel(13,"kINT7&kEMC7");
1035 
1036  fHCentrality = new TH1F("fHCentrality","conter",100,0.,100.);
1037 
1038  Double_t binx[101];
1039  for(Int_t ib=0;ib<101;ib++){
1040  binx[ib] = 1.322-0.05 + 0.1/100.*(Double_t)ib ;
1041  }
1042  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.};
1043  fHistoXiMassvsPtRef = new TH2F("fHistoXiMassvsPtRef","Reference #Xi spectrum",100,binx,20,biny);
1044  fHistoXiMassvsPtRef2 = new TH2F("fHistoXiMassvsPtRef2","Reference #Xi spectrum",100,binx,20,biny);
1045  fHistoXiMassvsPtRef3 = new TH2F("fHistoXiMassvsPtRef3","Reference #Xi spectrum",100,binx,20,biny);
1046  fHistoXiMassvsPtRef4 = new TH2F("fHistoXiMassvsPtRef4","Reference #Xi spectrum",100,binx,20,biny);
1047  fHistoXiMassvsPtRef5 = new TH2F("fHistoXiMassvsPtRef5","Reference #Xi spectrum",100,binx,20,biny);
1048  fHistoXiMassvsPtRef6 = new TH2F("fHistoXiMassvsPtRef6","Reference #Xi spectrum",100,binx,20,biny);
1049  fHistoPiPtRef = new TH1F("fHistoPiPtRef","Reference #pi spectrum",20,0.,10.);
1050 
1051  fOutput->Add(fCEvents);
1052  fOutput->Add(fHTrigger);
1053  fOutput->Add(fHCentrality);
1060  fOutput->Add(fHistoPiPtRef);
1061 
1062  return;
1063 }
1064 
1065 //__________________________________________________________________________
1067 {
1068  //
1069  // Define histograms
1070  //
1071 
1072  //------------------------------------------------
1073  // Basic histograms
1074  //------------------------------------------------
1075  Int_t bins_base[3]= {80 ,20 ,10};
1076  Double_t xmin_base[3]={2.468-0.2,0 ,0.00};
1077  Double_t xmax_base[3]={2.468+0.2,20. ,100};
1078  fHistoXicMass = new THnSparseF("fHistoXicMass","",3,bins_base,xmin_base,xmax_base);
1079  fOutputAll->Add(fHistoXicMass);
1080 
1081  //------------------------------------------------
1082  // Checking histograms
1083  //------------------------------------------------
1084  fHistoDcaPi1Pi2 = new TH1F("fHistoDcaPi1Pi2","DCA (#pi_{1}-#pi_{2})",100,0.0,1.0);
1086  fHistoDcaPiCasc = new TH1F("fHistoDcaPiCasc","DCA (#pi-#Xi)",100,0.0,1.0);
1088  fHistoLikeDecayLength = new TH1F("fHistoLikeDecayLength","Decay Length (#pi-#pi)",100,0.,0.2);
1090  fHistoLikeDecayLengthXY = new TH1F("fHistoLikeDecayLengthXY","Decay Length (#pi-#pi)",100,0.,0.2);
1092  fHistoXicCosPAXY = new TH1F("fHistoXicCosPAXY","#Xi_{c} cos(pa) ",100,-1.0,1.0);
1094  fHistoXiMass=new TH1F("fHistoXiMass","#Xi^{-} Mass",100,1.322-0.05,1.322+0.05);
1095  fOutputAll->Add(fHistoXiMass);
1096  fHistoCascDcaXiDaughters=new TH1F("fHistoCascDcaXiDaughters","DCA #Xi daughters ",100,0.0,1.0);
1098  fHistoCascDcaV0Daughters=new TH1F("fHistoCascDcaV0Daughters","DCA #Xi daughters ",100,0.0,1.0);
1100  fHistoCascDcaV0ToPrimVertex=new TH1F("fHistoCascDcaV0ToPrimVertex","DCA V0 daughters ",100,0.0,1.0);
1102  fHistoCascDcaPosToPrimVertex=new TH1F("fHistoCascDcaPosToPrimVertex","DCA Pos-Prim ",100,0.0,1.0);
1104  fHistoCascDcaNegToPrimVertex=new TH1F("fHistoCascDcaNegToPrimVertex","DCA Neg-Prim ",100,0.0,1.0);
1106  fHistoCascDcaBachToPrimVertex=new TH1F("fHistoCascDcaBachToPrimVertex","DCA Bach-Prim ",100,0.0,1.0);
1108  fHistoCascCosPAXiPrim=new TH1F("fHistoCascCosPAXiPrim","#Xi CosPA (prim)",100,0.8,1.0);
1110  fHistoXiPt=new TH1F("fHistoXiPt","#Xi^{-} p_{T}",100,0.,10.);
1111  fOutputAll->Add(fHistoXiPt);
1112  fHistoPiPt=new TH1F("fHistoPiPt","#pi p_{T}",100,0.,10);
1113  fOutputAll->Add(fHistoPiPt);
1114  fHistoPid0=new TH1F("fHistoPid0","#pi d_{0}",100,-0.1,0.1);
1115  fOutputAll->Add(fHistoPid0);
1116  fHistonSigmaTPCpi=new TH1F("fHistonSigmaTPCpi","n#sigma (TPC, pion)",100,-10.,10.);
1118  fHistonSigmaTOFpi=new TH1F("fHistonSigmaTOFpi","n#sigma (TOF, pion)",100,-10.,10.);
1120  fHistoProbPion=new TH1F("fHistoProbPion","Bayse Prob",100,0.0,1.);
1121  fOutputAll->Add(fHistoProbPion);
1122 
1123  return;
1124 }
1125 
1126 //________________________________________________________________________
1127 void AliAnalysisTaskSEXicPlus2XiPiPifromAODtracks::SelectTrack( const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks,Bool_t *seleFlags)
1128 {
1129  //
1130  // Select good tracks using fAnalCuts (AliRDHFCuts object) and return the array of their ids
1131  //
1132 
1133  //const Int_t entries = event->GetNumberOfTracks();
1134  if(trkEntries==0) return;
1135 
1136  nSeleTrks=0;
1137  for(Int_t i=0; i<trkEntries; i++) {
1138  seleFlags[i] = kFALSE;
1139 
1140  AliVTrack *track;
1141  track = (AliVTrack*)event->GetTrack(i);
1142 
1143  if(track->GetID()<0) continue;
1144  Double_t covtest[21];
1145  if(!track->GetCovarianceXYZPxPyPz(covtest)) continue;
1146 
1147  AliAODTrack *aodt = (AliAODTrack*)track;
1148 
1149  if(!fAnalCuts) continue;
1150  if(fAnalCuts->SingleTrkCuts(aodt)){
1151  seleFlags[i]=kTRUE;
1152  nSeleTrks++;
1153  fHistoPiPtRef->Fill(aodt->Pt());
1154  }
1155  } // end loop on tracks
1156 }
1157 
1158 //________________________________________________________________________
1159 void AliAnalysisTaskSEXicPlus2XiPiPifromAODtracks::SelectCascade( const AliVEvent *event,Int_t nCascades,Int_t &nSeleCasc, Bool_t *seleCascFlags)
1160 {
1161  //
1162  // Select good cascade using fAnalCuts (AliRDHFCuts object) and return the array of their ids
1163  //
1164 
1165  Double_t primVtx[3];
1166  fVtx1->GetXYZ(primVtx);
1167 
1168  nSeleCasc = 0;
1169  for(Int_t icasc=0;icasc<nCascades;icasc++)
1170  {
1171  seleCascFlags[icasc] = kFALSE;
1172  AliAODcascade *casc = ((AliAODEvent*)event)->GetCascade(icasc);
1173 
1174  if(!fAnalCuts) continue;
1175  if(fAnalCuts->SingleCascadeCuts(casc,primVtx)){
1176  seleCascFlags[icasc] = kTRUE;
1177  nSeleCasc++;
1178  }
1179  if(fAnalCuts->SingleCascadeCutsRef(casc,primVtx))
1180  {
1181  Double_t rapxi = casc->RapXi();
1182  if(rapxi>-1.5&&rapxi<-1.0){
1183  fHistoXiMassvsPtRef2->Fill(casc->MassXi(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1184  }
1185  if(rapxi>-1.0&&rapxi<-0.5){
1186  fHistoXiMassvsPtRef3->Fill(casc->MassXi(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1187  }
1188  if(rapxi>-0.5&&rapxi<0.0){
1189  fHistoXiMassvsPtRef->Fill(casc->MassXi(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1190  }
1191  if(rapxi>0.0&&rapxi<0.5){
1192  fHistoXiMassvsPtRef4->Fill(casc->MassXi(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1193  }
1194  if(rapxi>0.5&&rapxi<1.0){
1195  fHistoXiMassvsPtRef5->Fill(casc->MassXi(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1196  }
1197  if(rapxi>1.0&&rapxi<1.5){
1198  fHistoXiMassvsPtRef6->Fill(casc->MassXi(),sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)));
1199  }
1200  }
1201  }
1202 }
1203 
1204 //________________________________________________________________________
1206 {
1207  //
1208  // Select LikeSign tracks
1209  //
1210 
1211  if(trk1->Charge()!=trk2->Charge()) return kFALSE;
1212  if(trk1->GetID()==trk2->GetID()) return kFALSE;
1213  return kTRUE;
1214 }
1215 
1216 //________________________________________________________________________
1217 AliAODVertex* AliAnalysisTaskSEXicPlus2XiPiPifromAODtracks::CallPrimaryVertex(AliAODcascade *casc, AliAODTrack *trk1, AliAODTrack *trk2, AliAODEvent* aod)
1218 {
1219  //
1220  // Make an array of tracks which should not be used in primary vertex calculation and
1221  // Call PrimaryVertex function
1222  //
1223 
1224  TObjArray *twoTrackArrayPlusXi = new TObjArray(5);
1225 
1226  AliESDtrack *cptrk1 = new AliESDtrack((AliVTrack*)trk1);
1227  twoTrackArrayPlusXi->AddAt(cptrk1,0);
1228  AliESDtrack *cptrk2 = new AliESDtrack((AliVTrack*)trk2);
1229  twoTrackArrayPlusXi->AddAt(cptrk2,1);
1230 
1231  AliESDtrack *cascptrack = new AliESDtrack((AliVTrack*)casc->GetDaughter(0));
1232  twoTrackArrayPlusXi->AddAt(cascptrack,2);
1233  AliESDtrack *cascntrack = new AliESDtrack((AliVTrack*)casc->GetDaughter(1));
1234  twoTrackArrayPlusXi->AddAt(cascntrack,3);
1235  AliESDtrack *cascbtrack = new AliESDtrack((AliVTrack*)casc->GetDecayVertexXi()->GetDaughter(0));
1236  twoTrackArrayPlusXi->AddAt(cascbtrack,4);
1237 
1238  AliAODVertex *newvert = PrimaryVertex(twoTrackArrayPlusXi,aod);
1239 
1240  for(Int_t i=0;i<5;i++)
1241  {
1242  AliESDtrack *tesd = (AliESDtrack*)twoTrackArrayPlusXi->UncheckedAt(i);
1243  delete tesd;
1244  }
1245  twoTrackArrayPlusXi->Clear();
1246  delete twoTrackArrayPlusXi;
1247 
1248  return newvert;
1249 }
1250 
1251 //________________________________________________________________________
1252 AliAODVertex* AliAnalysisTaskSEXicPlus2XiPiPifromAODtracks::CallReconstructSecondaryVertex(AliAODTrack *trk1, AliAODTrack *trk2, Double_t &dispersion)
1253 {
1254  //
1255  // Make an array of tracks which I want to use for vertex calculation and call ReconstructSecondaryVertex
1256  //
1257 
1258  TObjArray *trkArray;
1259  trkArray= new TObjArray(2);
1260 
1261  AliESDtrack *cptrk1 = new AliESDtrack((AliVTrack*)trk1);
1262  trkArray->AddAt(cptrk1,0);
1263  AliESDtrack *cptrk2 = new AliESDtrack((AliVTrack*)trk2);
1264  trkArray->AddAt(cptrk2,1);
1265 
1266  Double_t xdummy, ydummy;
1267  Double_t dcap1p2 = cptrk1->GetDCA(cptrk2,fBzkG,xdummy,ydummy);
1268 
1269  AliAODVertex *secvertex=0;
1270  if(dcap1p2<fAnalCuts->GetProdLikeSignDcaMax()){
1271  secvertex = ReconstructSecondaryVertex(trkArray,dispersion);
1272  }
1273 
1274  for(Int_t i=0;i<2;i++)
1275  {
1276  AliESDtrack *tesd = (AliESDtrack*)trkArray->UncheckedAt(i);
1277  delete tesd;
1278  }
1279  trkArray->Clear();
1280  delete trkArray;
1281 
1282  return secvertex;
1283 }
1284 
1285 //________________________________________________________________________
1287  AliVEvent *event)
1288 {
1289  //
1290  //Used only for pp
1291  //copied from AliAnalysisVertexingHF (except for the following 3 lines)
1292  //
1293 
1294  Bool_t fRecoPrimVtxSkippingTrks = kTRUE;
1295  Bool_t fRmTrksFromPrimVtx = kFALSE;
1296 
1297  AliESDVertex *vertexESD = 0;
1298  AliAODVertex *vertexAOD = 0;
1299 
1300  //vertexESD = new AliESDVertex(*fV1);
1301 
1302 
1303  if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) {
1304  // primary vertex from the input event
1305 
1306  vertexESD = new AliESDVertex(*fV1);
1307 
1308  } else {
1309  // primary vertex specific to this candidate
1310 
1311  Int_t nTrks = trkArray->GetEntriesFast();
1312  AliVertexerTracks *vertexer = new AliVertexerTracks(event->GetMagneticField());
1313 
1314  if(fRecoPrimVtxSkippingTrks) {
1315  // recalculating the vertex
1316 
1317  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraint")) {
1318  Float_t diamondcovxy[3];
1319  event->GetDiamondCovXY(diamondcovxy);
1320  Double_t pos[3]={event->GetDiamondX(),event->GetDiamondY(),0.};
1321  Double_t cov[6]={diamondcovxy[0],diamondcovxy[1],diamondcovxy[2],0.,0.,10.*10.};
1322  AliESDVertex *diamond = new AliESDVertex(pos,cov,1.,1);
1323  vertexer->SetVtxStart(diamond);
1324  delete diamond; diamond=NULL;
1325  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraintOnlyFitter"))
1326  vertexer->SetOnlyFitter();
1327  }
1328  Int_t skipped[1000];
1329  Int_t nTrksToSkip=0,id;
1330  AliExternalTrackParam *t = 0;
1331  for(Int_t i=0; i<nTrks; i++) {
1332  t = (AliExternalTrackParam*)trkArray->UncheckedAt(i);
1333  id = (Int_t)t->GetID();
1334  if(id<0) continue;
1335  skipped[nTrksToSkip++] = id;
1336  }
1337  // TEMPORARY FIX
1338  // For AOD, skip also tracks without covariance matrix
1339  Double_t covtest[21];
1340  for(Int_t j=0; j<event->GetNumberOfTracks(); j++) {
1341  AliVTrack *vtrack = (AliVTrack*)event->GetTrack(j);
1342  if(!vtrack->GetCovarianceXYZPxPyPz(covtest)) {
1343  id = (Int_t)vtrack->GetID();
1344  if(id<0) continue;
1345  skipped[nTrksToSkip++] = id;
1346  }
1347  }
1348  for(Int_t ijk=nTrksToSkip; ijk<1000; ijk++) skipped[ijk]=-1;
1349  //
1350  vertexer->SetSkipTracks(nTrksToSkip,skipped);
1351  vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(event);
1352 
1353  } else if(fRmTrksFromPrimVtx && nTrks>0) {
1354  // removing the prongs tracks
1355 
1356  TObjArray rmArray(nTrks);
1357  UShort_t *rmId = new UShort_t[nTrks];
1358  AliESDtrack *esdTrack = 0;
1359  AliESDtrack *t = 0;
1360  for(Int_t i=0; i<nTrks; i++) {
1361  t = (AliESDtrack*)trkArray->UncheckedAt(i);
1362  esdTrack = new AliESDtrack(*t);
1363  rmArray.AddLast(esdTrack);
1364  if(esdTrack->GetID()>=0) {
1365  rmId[i]=(UShort_t)esdTrack->GetID();
1366  } else {
1367  rmId[i]=9999;
1368  }
1369  }
1370  Float_t diamondxy[2]={static_cast<Float_t>(event->GetDiamondX()),static_cast<Float_t>(event->GetDiamondY())};
1371  vertexESD = vertexer->RemoveTracksFromVertex(fV1,&rmArray,rmId,diamondxy);
1372  delete [] rmId; rmId=NULL;
1373  rmArray.Delete();
1374 
1375  }
1376 
1377  delete vertexer; vertexer=NULL;
1378  if(!vertexESD) return vertexAOD;
1379  if(vertexESD->GetNContributors()<=0) {
1380  //AliDebug(2,"vertexing failed");
1381  delete vertexESD; vertexESD=NULL;
1382  return vertexAOD;
1383  }
1384 
1385 
1386  }
1387 
1388  // convert to AliAODVertex
1389  Double_t pos[3],cov[6],chi2perNDF;
1390  vertexESD->GetXYZ(pos); // position
1391  vertexESD->GetCovMatrix(cov); //covariance matrix
1392  chi2perNDF = vertexESD->GetChi2toNDF();
1393  delete vertexESD; vertexESD=NULL;
1394 
1395  vertexAOD = new AliAODVertex(pos,cov,chi2perNDF);
1396 
1397  return vertexAOD;
1398 }
1399 
1400 //________________________________________________________________________
1402 {
1403  //
1404  // Reconstruct secondary vertex from trkArray (Copied from AliAnalysisVertexingHF)
1405  //
1406 
1407  AliESDVertex *vertexESD = 0;
1408  AliAODVertex *vertexAOD = 0;
1409 
1410  AliVertexerTracks *fVertexerTracks = new AliVertexerTracks(fBzkG);
1411 
1412  fVertexerTracks->SetVtxStart(fV1);
1413  vertexESD = (AliESDVertex*)fVertexerTracks->VertexForSelectedESDTracks(trkArray);
1414 
1415  delete fVertexerTracks; fVertexerTracks=NULL;
1416 
1417  if(!vertexESD) return vertexAOD;
1418 
1419  if(vertexESD->GetNContributors()!=trkArray->GetEntriesFast()) {
1420  //AliDebug(2,"vertexing failed");
1421  delete vertexESD; vertexESD=NULL;
1422  return vertexAOD;
1423  }
1424 
1425  Double_t vertRadius2=vertexESD->GetX()*vertexESD->GetX()+vertexESD->GetY()*vertexESD->GetY();
1426  if(vertRadius2>8.){
1427  // vertex outside beam pipe, reject candidate to avoid propagation through material
1428  delete vertexESD; vertexESD=NULL;
1429  return vertexAOD;
1430  }
1431 
1432 
1433  // convert to AliAODVertex
1434  Double_t pos[3],cov[6],chi2perNDF;
1435  vertexESD->GetXYZ(pos); // position
1436  vertexESD->GetCovMatrix(cov); //covariance matrix
1437  chi2perNDF = vertexESD->GetChi2toNDF();
1438  dispersion = vertexESD->GetDispersion();
1439  delete vertexESD; vertexESD=NULL;
1440 
1441  Int_t nprongs= (useTRefArray ? 0 : trkArray->GetEntriesFast());
1442  vertexAOD = new AliAODVertex(pos,cov,chi2perNDF,0x0,-1,AliAODVertex::kUndef,nprongs);
1443 
1444  return vertexAOD;
1445 }
1446 
1447 //________________________________________________________________________
1448 AliAODRecoCascadeHF3Prong* AliAnalysisTaskSEXicPlus2XiPiPifromAODtracks::MakeCascadeHF3Prong(AliAODcascade *casc, AliAODTrack *part1, AliAODTrack *part2, AliAODEvent * aod, AliAODVertex *secVert, Double_t dispersion)
1449 {
1450  //
1451  // Make AliAODRecoCascadeHF3Prong object from the arguments
1452  //
1453 
1454  //------------------------------------------------
1455  // PrimaryVertex
1456  //------------------------------------------------
1457  AliAODVertex *primVertexAOD;
1458  Bool_t unsetvtx = kFALSE;
1460  primVertexAOD = CallPrimaryVertex(casc,part1,part2,aod);
1461  if(!primVertexAOD){
1462  primVertexAOD = fVtx1;
1463  }else{
1464  unsetvtx = kTRUE;
1465  }
1466  }else{
1467  primVertexAOD = fVtx1;
1468  }
1469  if(!primVertexAOD) return 0x0;
1470  Double_t pos[3]; primVertexAOD->GetXYZ(pos);
1471 
1472 
1473  //------------------------------------------------
1474  // DCA between tracks
1475  //------------------------------------------------
1476  AliESDtrack *esdtrack1 = new AliESDtrack((AliVTrack*)part1);
1477  AliESDtrack *esdtrack2 = new AliESDtrack((AliVTrack*)part2);
1478  Double_t xyz[3], pxpypz[3], cv[21]; Short_t sign;
1479  xyz[0]=casc->DecayVertexXiX();
1480  xyz[1]=casc->DecayVertexXiY();
1481  xyz[2]=casc->DecayVertexXiZ();
1482  pxpypz[0]=casc->MomXiX();
1483  pxpypz[1]=casc->MomXiY();
1484  pxpypz[2]=casc->MomXiZ();
1485  casc->GetCovarianceXYZPxPyPz(cv);
1486  sign=casc->ChargeXi();
1487  AliExternalTrackParam *trackCasc = new AliExternalTrackParam(xyz,pxpypz,cv,sign);
1488 
1489  Double_t xdummy, ydummy;
1490  Double_t dcap1p2 = esdtrack1->GetDCA(esdtrack2,fBzkG,xdummy,ydummy);
1491  Double_t dcap1casc = esdtrack1->GetDCA(trackCasc,fBzkG,xdummy,ydummy);
1492  Double_t dcap2casc = esdtrack2->GetDCA(trackCasc,fBzkG,xdummy,ydummy);
1493  Double_t dca[3]={dcap1casc,dcap2casc,dcap1p2};
1494 
1495  //------------------------------------------------
1496  // Propagate all tracks to the secondary vertex and calculate momentum there
1497  //------------------------------------------------
1498 
1499  Double_t d0z0[2],covd0z0[3];
1500  Double_t secR = TMath::Sqrt(secVert->GetX()*secVert->GetX()+secVert->GetY()*secVert->GetY());
1501  if(secR<1.0){
1502  part1->PropagateToDCA(secVert,fBzkG,kVeryBig,d0z0,covd0z0);
1503  part2->PropagateToDCA(secVert,fBzkG,kVeryBig,d0z0,covd0z0);
1504  trackCasc->PropagateToDCA(secVert,fBzkG,kVeryBig);
1505  }else{
1506  part1->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0,covd0z0);
1507  part2->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0,covd0z0);
1508  trackCasc->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig);
1509  }
1510 
1511  Double_t momxi_new[3]={-9999,-9999,-9999.};
1512  trackCasc->GetPxPyPz(momxi_new);
1513 
1514  Double_t px[3],py[3],pz[3];
1515  px[0] = part1->Px(); py[0] = part1->Py(); pz[0] = part1->Pz();
1516  px[1] = momxi_new[0]; py[1] = momxi_new[1]; pz[1] = momxi_new[2];
1517  px[2] = part2->Px(); py[2] = part2->Py(); pz[2] = part2->Pz();
1518 
1519  //------------------------------------------------
1520  // d0
1521  //------------------------------------------------
1522  Double_t d0[3],d0err[3];
1523  part1->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0,covd0z0);
1524  d0[0]= d0z0[0];
1525  d0err[0] = TMath::Sqrt(covd0z0[0]);
1526 
1527  trackCasc->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0,covd0z0);
1528  d0[1]= d0z0[0];
1529  d0err[1] = TMath::Sqrt(covd0z0[0]);//Do not know what to use
1530 
1531  part2->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0,covd0z0);
1532  d0[2]= d0z0[0];
1533  d0err[2] = TMath::Sqrt(covd0z0[0]);
1534 
1535 
1536  //------------------------------------------------
1537  // Other stuff
1538  //------------------------------------------------
1539  Double_t dist12=0.0;//Vertex pi-casc not calculated
1540  Double_t dist23=0.0;//Vertex pi-casc not calculated
1541  Short_t charge=(Short_t)(part1->Charge()+trackCasc->Charge()+part2->Charge());
1542 
1543  //------------------------------------------------
1544  // Create AliAODRecoCascadeHF3Prong
1545  //------------------------------------------------
1546  AliAODRecoCascadeHF3Prong *theCascade = new AliAODRecoCascadeHF3Prong(secVert,charge,px,py,pz,d0,d0err,dca,dispersion,dist12,dist23);
1547  if(!theCascade)
1548  {
1549  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
1550  if(esdtrack1) delete esdtrack1;
1551  if(esdtrack2) delete esdtrack2;
1552  if(trackCasc) delete trackCasc;
1553  return 0x0;
1554  }
1555  theCascade->SetOwnPrimaryVtx(primVertexAOD);
1556  UShort_t id[3]={(UShort_t)part1->GetID(),(UShort_t)trackCasc->GetID(),(UShort_t)part2->GetID()};
1557  theCascade->SetProngIDs(3,id);
1558 
1559  theCascade->GetSecondaryVtx()->AddDaughter(part1);
1560  theCascade->GetSecondaryVtx()->AddDaughter(casc);
1561  theCascade->GetSecondaryVtx()->AddDaughter(part2);
1562 
1563  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
1564  if(esdtrack1) delete esdtrack1;
1565  if(esdtrack2) delete esdtrack2;
1566  if(trackCasc) delete trackCasc;
1567 
1568  return theCascade;
1569 }
Int_t charge
Double_t InvMassPiXiPi() const
Xic invariant mass.
AliAODTrack * GetBachelor2() const
double Double_t
Definition: External.C:58
Bool_t SingleCascadeCutsRef(AliAODcascade *casc, Double_t *vert)
AliAODVertex * PrimaryVertex(const TObjArray *trkArray, AliVEvent *event)
void SelectTrack(const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks, Bool_t *seleFlags)
Definition: External.C:236
Bool_t GetUseCombined()
Definition: AliAODPidHF.h:165
char Char_t
Definition: External.C:18
AliAODVertex * CallReconstructSecondaryVertex(AliAODTrack *trk1, AliAODTrack *trk2, Double_t &disp)
TList * fOutputAll
! User output slot 3 // Analysis histos
void SelectCascade(const AliVEvent *event, Int_t nCascades, Int_t &nSeleCasc, Bool_t *seleCascFlags)
AliAODcascade * GetCascade() const
Double_t GetMaxVtxZ() const
Definition: AliRDHFCuts.h:243
AliAODPidHF * GetPidHF() const
Definition: AliRDHFCuts.h:233
Bool_t fIsMB
Reconstruct primary vertex excluding candidate tracks.
AliAODVertex * ReconstructSecondaryVertex(TObjArray *trkArray, Double_t &dispersion, Bool_t useTRefArray=kTRUE)
virtual void UserCreateOutputObjects()
Implementation of interface methods.
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
AliAODTrack * GetBachelor1() const
AliAODVertex * GetOwnPrimaryVtx() const
AliAODVertex * CallPrimaryVertex(AliAODcascade *casc, AliAODTrack *trk1, AliAODTrack *trk2, AliAODEvent *evt)
void SetProngIDs(Int_t nIDs, UShort_t *id)
TH1F * fHistoCascDcaPosToPrimVertex
! DCA of positive track to primary vertex
AliPIDResponse * GetPidResponse() const
Definition: AliAODPidHF.h:160
void GetDCAs(Double_t dca[3]) const
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)
Double_t DecayLengthXY() const
TH1F * fHistoCascDcaBachToPrimVertex
! DCA of bachelor track to primary vertex
AliAODRecoCascadeHF3Prong * MakeCascadeHF3Prong(AliAODcascade *casc, AliAODTrack *trk1, AliAODTrack *trk2, AliAODEvent *aod, AliAODVertex *secvert, Double_t dispersion)
Bool_t SingleCascadeCuts(AliAODcascade *casc, Double_t *vert)
AliRDHFCutsXicPlustoXiPiPifromAODtracks * fAnalCuts
histogram to check centrality
Bool_t IsEventSelected(AliVEvent *event)
Int_t MatchToMC(Int_t pdgabs, Int_t pdgabscasc, Int_t *pdgDg, Int_t *pdgDgcasc, Int_t *pdgDgv0, TClonesArray *mcArray) const
const Int_t nVar
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
void FillROOTObjects(AliAODRecoCascadeHF3Prong *xicobj, AliAODMCParticle *mcpart, AliAODMCParticle *mcdau1, AliAODMCParticle *mcdau2, AliAODMCParticle *mcdauxi, Int_t mcnused)
TH1F * fHistoCascCosPAXiPrim
! Cosine pointing angle of Xi to primary vertex
unsigned short UShort_t
Definition: External.C:28
Bool_t GetIsUsePID() const
Definition: AliRDHFCuts.h:256
const char Option_t
Definition: External.C:48
Bool_t IsEventRejectedDueToTrigger() const
Definition: AliRDHFCuts.h:302
bool Bool_t
Definition: External.C:53
TH1F * fHistoCascDcaNegToPrimVertex
! DCA of negative track to primary vertex
Double_t DecayLength() const
TTree * fVariablesTree
flag to decide whether to write the candidate variables on a tree variables