]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/AliAnalysisVertexingHFTest.C
Merging THbtp and HBTP in one library. Comiplation on Windows/Cygwin
[u/mrichter/AliRoot.git] / PWG3 / AliAnalysisVertexingHFTest.C
1 //--------------------------------------------------------------------------
2 // Test macro for reconstruction of heavy-flavour vertexing candidates
3 //
4 //     Andrea Dainese, andrea.dainese@lnl.infn.it
5 //--------------------------------------------------------------------------
6
7 void AliAnalysisVertexingHFTest()
8 {
9   
10   gSystem->Load("libANALYSIS.so");
11   gSystem->Load("libANALYSISalice.so");
12   gSystem->Load("libAOD.so");
13   gSystem->Load("libPWG3base.so");
14
15   AliAnalysisVertexingHF *vHF = new AliAnalysisVertexingHF();
16   //vHF->SetUseTRef();
17   //--- switch-off candidates finding (default: all on)
18   //vHF->SetD0toKpiOff();
19   vHF->SetJPSItoEleOff();
20   vHF->Set3ProngOff();
21   vHF->Set4ProngOff();
22   //--- secondary vertex with KF?
23   vHF->SetSecVtxWithKF();
24   //--- set cuts for single-track selection
25   vHF->SetITSrefitRequired();
26   vHF->SetBothSPDNotRequired();
27   vHF->SetMinITSCls(5);
28   vHF->SetMinPtCut(0.);
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
45   //vHF->SetDebug(1);
46
47   TFile *fout = new TFile("AliAnalysisVertexingHF.root","recreate");
48
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;
72   }
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;
86
87   return;
88 }