1 //--------------------------------------------------------------------------
2 // Test macro for reconstruction and analysis of D0->Kpi
4 // Andrea Dainese, andrea.dainese@lnl.infn.it
5 //--------------------------------------------------------------------------
7 void AliD0toKpiReco() {
9 gSystem->Load("libAOD.so");
10 gSystem->Load("libPWG3base.so");
12 //============== R E C O N S T R U C T I O N ==============================
15 Int_t evLast = 1000000;
17 // Get field from galice.root
19 delete gAlice->GetRunLoader();
23 AliRunLoader *rl = AliRunLoader::Open("galice.root");
25 cerr<<"Can not open session"<<endl;
28 Int_t retval = rl->LoadgAlice();
30 cerr<<"LoadgAlice returned error"<<endl;
34 gAlice=rl->GetAliRun();
35 AliMagF *fiel = (AliMagF*)gAlice->Field();
36 // Set the conversion constant between curvature and Pt
37 AliTracker::SetFieldMap(fiel,kTRUE);
39 AliD0toKpiAnalysis *analysis = new AliD0toKpiAnalysis();
40 // set simulation to take info on PDG codes from kine tree
41 analysis->SetSimulation();
43 analysis->MakeTracksRefFile(gAlice,evFirst,evLast);
44 //--- set this is you want only signal candidates in output file
45 //analysis->SetOnlySignal();
46 //--- set this if you want to compute primary vertex D0 by D0 using
47 // other tracks in the event (for pp, broad interaction region);
48 // it is time-consuming procedure, so it can be done after a
49 // preselection on invariant mass
50 //analysis->SetVertexOnTheFly();
51 //analysis->SetMassCut(0.1); // GeV
52 //--- set single-track preselections
53 analysis->SetPtCut(0.); // GeV
54 analysis->Setd0Cut(0.); // micron
55 //--- set cuts on D0 candidates to be written to file
56 // (see AliD0toKpiAnalysis.h for a description and for the defaults)
57 //analysis->SetD0Cuts(0.1,1000.,1.1,0.,0.,10000.,10000.,0.,.5);
58 analysis->SetD0Cuts();
60 //--- check the settings
61 analysis->PrintStatus();
63 analysis->FindCandidates(evFirst,evLast,"AliD0toKpi.root");
68 //==========================================================================
69 void AliD0toKpiSele() {
71 gSystem->Load("libAOD.so");
72 gSystem->Load("libPWG3base.so");
74 //======================== S E L E C T I O N ============================
76 AliD0toKpiAnalysis *analysis = new AliD0toKpiAnalysis();
77 analysis->SetSimulation();
78 analysis->SetOnlySignal();
79 analysis->SetD0Cuts(0.1,1000.,1.1,0.,0.,10000.,10000.,0.,.5);
80 analysis->ApplySelection("AliD0toKpi.root","AliD0toKpi_sele.root");
85 //==========================================================================