]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ANALYSIS/AliD0toKpiTest.C
Updated comments (Raffaele)
[u/mrichter/AliRoot.git] / ANALYSIS / AliD0toKpiTest.C
CommitLineData
3a9a3487 1//--------------------------------------------------------------------------
2// Test macro for reconstruction and analysis of D0->Kpi
3//
ef0182f7 4// Andrea Dainese, andrea.dainese@lnl.infn.it
3a9a3487 5//--------------------------------------------------------------------------
6
7void AliD0toKpiReco() {
8
ef0182f7 9 gSystem->Load("libANALYSIS.so");
10
3a9a3487 11 //============== R E C O N S T R U C T I O N ==============================
12
ef0182f7 13 Int_t evFirst = 0;
14 Int_t evLast = 1000000;
15
16 // Get field from galice.root
3a9a3487 17 if (gAlice) {
18 delete gAlice->GetRunLoader();
19 delete gAlice;
20 gAlice=0;
ef0182f7 21 }
22 AliRunLoader *rl = AliRunLoader::Open("galice.root");
23 if (rl == 0x0) {
24 cerr<<"Can not open session"<<endl;
25 return;
3a9a3487 26 }
ef0182f7 27 Int_t retval = rl->LoadgAlice();
28 if (retval) {
29 cerr<<"LoadgAlice returned error"<<endl;
30 delete rl;
31 return;
3a9a3487 32 }
ef0182f7 33 gAlice=rl->GetAliRun();
34 AliMagF *fiel = (AliMagF*)gAlice->Field();
35 // Set the conversion constant between curvature and Pt
36 AliTracker::SetFieldMap(fiel,kTRUE);
3a9a3487 37
38 AliD0toKpiAnalysis *analysis = new AliD0toKpiAnalysis();
3a9a3487 39 // set simulation to take info on PDG codes from kine tree
ef0182f7 40 analysis->SetSimulation();
41 rl->LoadKinematics();
42 analysis->MakeTracksRefFile(gAlice,evFirst,evLast);
3a9a3487 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
ef0182f7 52 analysis->SetPtCut(0.); // GeV
53 analysis->Setd0Cut(0.); // micron
3a9a3487 54 //--- set cuts on D0 candidates to be written to file
55 // (see AliD0toKpiAnalysis.h for a description and for the defaults)
ef0182f7 56 //analysis->SetD0Cuts(0.1,1000.,1.1,0.,0.,10000.,10000.,0.,.5);
57 analysis->SetD0Cuts();
3a9a3487 58
59 //--- check the settings
60 analysis->PrintStatus();
61
ef0182f7 62 analysis->FindCandidates(evFirst,evLast,"AliD0toKpi.root");
3a9a3487 63 delete analysis;
64
65 return;
66}
67//==========================================================================
68void AliD0toKpiSele() {
69
ef0182f7 70 gSystem->Load("libANALYSIS.so");
71
3a9a3487 72 //======================== S E L E C T I O N ============================
73
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");
79 delete analysis;
80
81 return;
82}
83//==========================================================================
84
85
86
87
88
89