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