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