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("libANALYSIS");
10 gSystem->Load("libAOD.so");
11 gSystem->Load("libPWG3base.so");
13 //============== R E C O N S T R U C T I O N ==============================
16 Int_t evLast = 1000000;
18 // Get field from galice.root
20 delete gAlice->GetRunLoader();
24 AliRunLoader *rl = AliRunLoader::Open("galice.root");
26 cerr<<"Can not open session"<<endl;
29 Int_t retval = rl->LoadgAlice();
31 cerr<<"LoadgAlice returned error"<<endl;
35 gAlice=rl->GetAliRun();
36 AliMagF *fiel = (AliMagF*)gAlice->Field();
37 // Set the conversion constant between curvature and Pt
38 AliTracker::SetFieldMap(fiel,kTRUE);
40 AliD0toKpiAnalysis *analysis = new AliD0toKpiAnalysis();
41 // set simulation to take info on PDG codes from kine tree
42 analysis->SetSimulation();
44 analysis->MakeTracksRefFile(gAlice,evFirst,evLast);
45 //--- set this is you want only signal candidates in output file
46 //analysis->SetOnlySignal();
47 //--- set this if you want to compute primary vertex D0 by D0 using
48 // other tracks in the event (for pp, broad interaction region);
49 // it is time-consuming procedure, so it can be done after a
50 // preselection on invariant mass
51 //analysis->SetVertexOnTheFly();
52 //analysis->SetMassCut(0.1); // GeV
53 //--- set single-track preselections
54 analysis->SetPtCut(0.); // GeV
55 analysis->Setd0Cut(0.); // micron
56 //--- set cuts on D0 candidates to be written to file
57 // (see AliD0toKpiAnalysis.h for a description and for the defaults)
58 //analysis->SetD0Cuts(0.1,1000.,1.1,0.,0.,10000.,10000.,0.,.5);
59 analysis->SetD0Cuts();
61 //--- check the settings
62 analysis->PrintStatus();
64 analysis->FindCandidates(evFirst,evLast,"AliD0toKpi.root");
69 //==========================================================================
70 void AliD0toKpiSele() {
72 gSystem->Load("libANALYSIS");
73 gSystem->Load("libAOD.so");
74 gSystem->Load("libPWG3base.so");
76 //======================== S E L E C T I O N ============================
78 AliD0toKpiAnalysis *analysis = new AliD0toKpiAnalysis();
79 analysis->SetSimulation();
80 analysis->SetOnlySignal();
81 analysis->SetD0Cuts(0.1,1000.,1.1,0.,0.,10000.,10000.,0.,.5);
82 analysis->ApplySelection("AliD0toKpi.root","AliD0toKpi_sele.root");
87 //==========================================================================