]>
Commit | Line | Data |
---|---|---|
eafbab77 | 1 | //-------------------------------------------------------------------------- |
2 | // Test macro for reconstruction and analysis of D0->Kpi | |
3 | // | |
4 | // Andrea Dainese, andrea.dainese@lnl.infn.it | |
5 | //-------------------------------------------------------------------------- | |
6 | ||
7 | void AliD0toKpiReco() { | |
8 | ||
c75b58db | 9 | gSystem->Load("libANALYSIS"); |
9af36e3a | 10 | gSystem->Load("libAOD.so"); |
11 | gSystem->Load("libPWG3base.so"); | |
eafbab77 | 12 | |
13 | //============== R E C O N S T R U C T I O N ============================== | |
14 | ||
15 | Int_t evFirst = 0; | |
16 | Int_t evLast = 1000000; | |
17 | ||
18 | // Get field from galice.root | |
19 | if (gAlice) { | |
20 | delete gAlice->GetRunLoader(); | |
21 | delete gAlice; | |
22 | gAlice=0; | |
23 | } | |
24 | AliRunLoader *rl = AliRunLoader::Open("galice.root"); | |
25 | if (rl == 0x0) { | |
26 | cerr<<"Can not open session"<<endl; | |
27 | return; | |
28 | } | |
29 | Int_t retval = rl->LoadgAlice(); | |
30 | if (retval) { | |
31 | cerr<<"LoadgAlice returned error"<<endl; | |
32 | delete rl; | |
33 | return; | |
34 | } | |
35 | gAlice=rl->GetAliRun(); | |
36 | AliMagF *fiel = (AliMagF*)gAlice->Field(); | |
37 | // Set the conversion constant between curvature and Pt | |
38 | AliTracker::SetFieldMap(fiel,kTRUE); | |
39 | ||
40 | AliD0toKpiAnalysis *analysis = new AliD0toKpiAnalysis(); | |
41 | // set simulation to take info on PDG codes from kine tree | |
42 | analysis->SetSimulation(); | |
43 | rl->LoadKinematics(); | |
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(); | |
60 | ||
61 | //--- check the settings | |
62 | analysis->PrintStatus(); | |
63 | ||
64 | analysis->FindCandidates(evFirst,evLast,"AliD0toKpi.root"); | |
65 | delete analysis; | |
66 | ||
67 | return; | |
68 | } | |
69 | //========================================================================== | |
70 | void AliD0toKpiSele() { | |
71 | ||
c75b58db | 72 | gSystem->Load("libANALYSIS"); |
9af36e3a | 73 | gSystem->Load("libAOD.so"); |
74 | gSystem->Load("libPWG3base.so"); | |
eafbab77 | 75 | |
76 | //======================== S E L E C T I O N ============================ | |
77 | ||
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"); | |
83 | delete analysis; | |
84 | ||
85 | return; | |
86 | } | |
87 | //========================================================================== | |
88 | ||
89 | ||
90 | ||
91 | ||
92 | ||
93 |