]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/vertexingHF/AliAnalysisVertexingHFTest.C
New structure of PWG3: PWG3base, PWG3muon, PWG3vertexingHF and PWG3vertexingOld ...
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / 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
7201805f 7void AliAnalysisVertexingHFTest()
7456a9e7 8{
6a213b59 9
7456a9e7 10 gSystem->Load("libANALYSIS.so");
7201805f 11 gSystem->Load("libANALYSISalice.so");
6a213b59 12 gSystem->Load("libAOD.so");
13 gSystem->Load("libPWG3base.so");
14
15 AliAnalysisVertexingHF *vHF = new AliAnalysisVertexingHF();
7456a9e7 16 //vHF->SetUseTRef();
6a213b59 17 //--- switch-off candidates finding (default: all on)
18 //vHF->SetD0toKpiOff();
7456a9e7 19 vHF->SetJPSItoEleOff();
b82f6d67 20 vHF->Set3ProngOff();
21 vHF->Set4ProngOff();
22 //--- secondary vertex with KF?
7456a9e7 23 vHF->SetSecVtxWithKF();
6a213b59 24 //--- set cuts for single-track selection
25 vHF->SetITSrefitRequired();
26 vHF->SetBothSPDNotRequired();
27 vHF->SetMinITSCls(5);
7456a9e7 28 vHF->SetMinPtCut(0.);
6a213b59 29 vHF->SetMind0Cut(0.);
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();
41
42 //--- check the settings
43 vHF->PrintStatus();
44 //--- verbose
7456a9e7 45 //vHF->SetDebug(1);
6a213b59 46
7201805f 47 TFile *fout = new TFile("AliAnalysisVertexingHF.root","recreate");
260836a9 48
7201805f 49 TTree **trees = 0;
50 trees = new TTree*[1];
51 AliAODRecoDecayHF2Prong *rd2=0;
52 //AliAODRecoDecayHF3Prong *rd3=0;
53 //AliAODRecoDecayHF4Prong *rd4=0;
54 trees[0] = new TTree("D0toKpi","D0toKpi");
55 trees[0]->Branch("D0toKpi","AliAODRecoDecayHF2Prong",&rd2);
56 //trees[1] = new TTree("JPSItoEle","JPSItoEle");
57 //trees[1]->Branch("JPSItoEle","AliAODRecoDecayHF2Prong",&rd2);
58 //trees[2] = new TTree("Charmto3Prong","Charmto3Prong");
59 //trees[2]->Branch("Charmto3Prong","AliAODRecoDecayHF3Prong",&rd3);
60 //trees[3] = new TTree("Charmto4Prong","Charmto4Prong");
61 //trees[3]->Branch("D0to4Prong","AliAODRecoDecayHF4Prong",&rd4);
62
63 TFile *inesd = new TFile("AliESDs.root");
64 AliESDEvent *esd = new AliESDEvent();
65 TTree *esdTree = (TTree*)inesd->Get("esdTree");
66 esd->ReadFromTree(esdTree);
67
68 for(Int_t i=0; i<esdTree->GetEntries(); i++) {
69 esdTree->GetEvent(i);
70 vHF->FindCandidates(esd,trees);
71 //if(i==evLast) i=evFirst;
6a213b59 72 }
7201805f 73
74 delete esdTree;
75 inesd->Close();
76 delete inesd;
77
78 // Write trees with candidates
79 fout->cd();
80 trees[0]->Write("TreeD0toKpi");
81 //trees[1]->Write("TreeJPSItoEle");
82 //trees[2]->Write("TreeCharm3Prong");
83 //trees[3]->Write("TreeD0to4Prong");
84 fout->Close();
85 delete fout;
6a213b59 86
6a213b59 87 return;
88}