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("libAOD.so");
13 gSystem->Load("libPWG3base.so");
15 AliAnalysisVertexingHF *vHF = new AliAnalysisVertexingHF();
16 //--- switch-off candidates finding (default: all on)
17 //vHF->SetD0toKpiOff();
18 //vHF->SetJPSItoEleOff();
19 //vHF->Set3ProngOff();
20 //vHF->Set4ProngOff();
21 //--- set cuts for single-track selection
22 vHF->SetITSrefitRequired();
23 vHF->SetBothSPDNotRequired();
27 //--- set cuts for candidates selection
28 //vHF->SetD0toKpiCuts();
29 //vHF->SetBtoJPSICuts();
30 //vHF->SetDplusCuts();
31 //--- set this if you want to reconstruct primary vertex candidate by
32 // candidate using other tracks in the event (for pp, broad
33 // interaction region)
34 //vHF->SetRecoPrimVtxSkippingTrks();
35 //--- OR set this if you want to remove the candidate daughters from
36 // the primary vertex, without recostructing it from scratch
37 //vHF->SetRmTrksFromPrimVtx();
39 //--- check the settings
44 TTree *trees = new TTree[4];
45 AliAODRecoDecayHF2Prong *rd2=0;
46 AliAODRecoDecayHF3Prong *rd3=0;
47 AliAODRecoDecayHF4Prong *rd4=0;
48 trees[0].Branch("D0toKpi","AliAODRecoDecayHF2Prong",&rd2);
49 trees[1].Branch("JPSItoEle","AliAODRecoDecayHF2Prong",&rd2);
50 trees[2].Branch("Charmto3Prong","AliAODRecoDecayHF3Prong",&rd3);
51 trees[3].Branch("D0to4Prong","AliAODRecoDecayHF4Prong",&rd4);
53 TFile *inesd = new TFile(infile.Data());
54 AliESDEvent *esd = new AliESDEvent();
55 TTree *esdTree = (TTree*)inesd->Get("esdTree");
56 esd->ReadFromTree(esdTree);
58 if(esdTree->GetEntries()<evLast) evLast=esdTree->GetEntries()-1;
59 for(Int_t i=evFirst; i<=evLast; i++) {
61 vHF->FindCandidates(esd,trees);
62 //if(i==evLast) i=evFirst;
69 // Write trees with candidates
70 TFile *fout = new TFile("AliAnalysisVertexingHF.root","recreate");
71 trees[0].Write("TreeD0toKpi");
72 trees[1].Write("TreeJPSItoEle");
73 trees[2].Write("TreeCharm3Prong");
74 trees[3].Write("TreeD0to4Prong");