]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/AliAnalysisVertexingHFTest.C
Possibility to use KF vertexer (Andrea, Giuseppe); possibility to store results in...
[u/mrichter/AliRoot.git] / PWG3 / AliAnalysisVertexingHFTest.C
CommitLineData
6a213b59 1//--------------------------------------------------------------------------
2// Test macro for reconstruction of heavy-flavour vertexing candidates
3//
4// Andrea Dainese, andrea.dainese@lnl.infn.it
5//--------------------------------------------------------------------------
6
7void AliAnalysisVertexingHFTest(Int_t evFirst=0,
b82f6d67 8 Int_t evLast=0,
6a213b59 9 TString infile="AliESDs.root",
10 TString outfile="VertexingHF.root") {
11
12 gSystem->Load("libAOD.so");
13 gSystem->Load("libPWG3base.so");
14
15 AliAnalysisVertexingHF *vHF = new AliAnalysisVertexingHF();
16 //--- switch-off candidates finding (default: all on)
17 //vHF->SetD0toKpiOff();
18 //vHF->SetJPSItoEleOff();
b82f6d67 19 vHF->Set3ProngOff();
20 vHF->Set4ProngOff();
21 //--- secondary vertex with KF?
22 //vHF->SetSecVtxWithKF();
6a213b59 23 //--- set cuts for single-track selection
24 vHF->SetITSrefitRequired();
25 vHF->SetBothSPDNotRequired();
26 vHF->SetMinITSCls(5);
27 vHF->SetMinPtCut(0.);
28 vHF->SetMind0Cut(0.);
29 //--- set cuts for candidates selection
30 //vHF->SetD0toKpiCuts();
31 //vHF->SetBtoJPSICuts();
32 //vHF->SetDplusCuts();
33 //--- set this if you want to reconstruct primary vertex candidate by
34 // candidate using other tracks in the event (for pp, broad
35 // interaction region)
36 //vHF->SetRecoPrimVtxSkippingTrks();
37 //--- OR set this if you want to remove the candidate daughters from
38 // the primary vertex, without recostructing it from scratch
39 //vHF->SetRmTrksFromPrimVtx();
40
41 //--- check the settings
42 vHF->PrintStatus();
43 //--- verbose
44 vHF->SetDebug(1);
45
b82f6d67 46 TTree *trees = new TTree[2];
6a213b59 47 AliAODRecoDecayHF2Prong *rd2=0;
b82f6d67 48 //AliAODRecoDecayHF3Prong *rd3=0;
49 //AliAODRecoDecayHF4Prong *rd4=0;
6a213b59 50 trees[0].Branch("D0toKpi","AliAODRecoDecayHF2Prong",&rd2);
51 trees[1].Branch("JPSItoEle","AliAODRecoDecayHF2Prong",&rd2);
b82f6d67 52 //trees[2].Branch("Charmto3Prong","AliAODRecoDecayHF3Prong",&rd3);
53 //trees[3].Branch("D0to4Prong","AliAODRecoDecayHF4Prong",&rd4);
6a213b59 54
5e6f195c 55 TFile *inesd = new TFile(infile.Data());
56 AliESDEvent *esd = new AliESDEvent();
6a213b59 57 TTree *esdTree = (TTree*)inesd->Get("esdTree");
5e6f195c 58 esd->ReadFromTree(esdTree);
6a213b59 59
60 if(esdTree->GetEntries()<evLast) evLast=esdTree->GetEntries()-1;
61 for(Int_t i=evFirst; i<=evLast; i++) {
62 esdTree->GetEvent(i);
63 vHF->FindCandidates(esd,trees);
64 //if(i==evLast) i=evFirst;
65 }
66
67 delete esdTree;
68 inesd->Close();
69 delete inesd;
70
71 // Write trees with candidates
72 TFile *fout = new TFile("AliAnalysisVertexingHF.root","recreate");
73 trees[0].Write("TreeD0toKpi");
74 trees[1].Write("TreeJPSItoEle");
b82f6d67 75 //trees[2].Write("TreeCharm3Prong");
76 //trees[3].Write("TreeD0to4Prong");
6a213b59 77 fout->Close();
78 delete fout;
79
80 return;
81}