1 //--------------------------------------------------------------------------
2 // Test macro for reconstruction of heavy-flavour vertexing candidates
4 // Andrea Dainese, andrea.dainese@lnl.infn.it
5 //--------------------------------------------------------------------------
7 void AliAnalysisVertexingHFTest(Int_t evFirst=0,
9 TString infile="AliESDs.root",
10 TString outfile="VertexingHF.root") {
12 gSystem->Load("libANALYSIS");
13 gSystem->Load("libAOD.so");
14 gSystem->Load("libPWG3base.so");
16 AliAnalysisVertexingHF *vHF = new AliAnalysisVertexingHF();
17 //--- switch-off candidates finding (default: all on)
18 //vHF->SetD0toKpiOff();
19 //vHF->SetJPSItoEleOff();
22 //--- secondary vertex with KF?
23 //vHF->SetSecVtxWithKF();
24 //--- set cuts for single-track selection
25 vHF->SetITSrefitRequired();
26 vHF->SetBothSPDNotRequired();
30 //--- set cuts for candidates selection
31 //vHF->SetD0toKpiCuts();
32 //vHF->SetBtoJPSICuts();
33 //vHF->SetDplusCuts();
34 //--- set this if you want to reconstruct primary vertex candidate by
35 // candidate using other tracks in the event (for pp, broad
36 // interaction region)
37 //vHF->SetRecoPrimVtxSkippingTrks();
38 //--- OR set this if you want to remove the candidate daughters from
39 // the primary vertex, without recostructing it from scratch
40 //vHF->SetRmTrksFromPrimVtx();
42 //--- check the settings
47 TTree *trees = new TTree[2];
48 AliAODRecoDecayHF2Prong *rd2=0;
49 //AliAODRecoDecayHF3Prong *rd3=0;
50 //AliAODRecoDecayHF4Prong *rd4=0;
51 trees[0].Branch("D0toKpi","AliAODRecoDecayHF2Prong",&rd2);
52 trees[1].Branch("JPSItoEle","AliAODRecoDecayHF2Prong",&rd2);
53 //trees[2].Branch("Charmto3Prong","AliAODRecoDecayHF3Prong",&rd3);
54 //trees[3].Branch("D0to4Prong","AliAODRecoDecayHF4Prong",&rd4);
56 TFile *inesd = new TFile(infile.Data());
57 AliESDEvent *esd = new AliESDEvent();
58 TTree *esdTree = (TTree*)inesd->Get("esdTree");
59 esd->ReadFromTree(esdTree);
61 if(esdTree->GetEntries()<evLast) evLast=esdTree->GetEntries()-1;
62 for(Int_t i=evFirst; i<=evLast; i++) {
64 vHF->FindCandidates(esd,trees);
65 //if(i==evLast) i=evFirst;
72 // Write trees with candidates
73 TFile *fout = new TFile("AliAnalysisVertexingHF.root","recreate");
74 trees[0].Write("TreeD0toKpi");
75 trees[1].Write("TreeJPSItoEle");
76 //trees[2].Write("TreeCharm3Prong");
77 //trees[3].Write("TreeD0to4Prong");