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