]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/AliD0toKpiTest.C
Add optional seeding in the TRD (M.Ivanov)
[u/mrichter/AliRoot.git] / ANALYSIS / AliD0toKpiTest.C
1 //--------------------------------------------------------------------------
2 // Test macro for reconstruction and analysis of D0->Kpi
3 //
4 //     Andrea Dainese, andrea.dainese@pd.infn.it
5 //--------------------------------------------------------------------------
6
7 void AliD0toKpiReco() {
8   
9   //==============  R E C O N S T R U C T I O N ==============================
10
11   // Look for field value in galice.root
12   Double_t field = 0.4;
13   if (gAlice) {
14     delete gAlice->GetRunLoader();
15     delete gAlice; 
16     gAlice=0;
17   }
18   if(!gSystem->AccessPathName("galice.root",kFileExists)) {
19     AliRunLoader *rl = AliRunLoader::Open("galice.root");
20     rl->LoadgAlice();
21     field=gAlice->Field();
22     Double_t bz=field->SolenoidField()/10.;
23     printf("B = %3.1f T read from gAlice and set\n",bz);
24     delete gAlice->GetRunLoader();
25     delete gAlice; 
26     gAlice=0;
27   } else {
28     printf(" File galice.root not found: default %3.1f T being used!\n",field);
29   }
30
31   AliD0toKpiAnalysis *analysis = new AliD0toKpiAnalysis();
32   //--- set magnetic field
33   analysis->SetBz(field); 
34   // set simulation to take info on PDG codes from kine tree
35   //analysis->SetSimulation();
36   //--- set this is you want only signal candidates in output file
37   //analysis->SetOnlySignal();
38   //--- set this if you want to compute primary vertex D0 by D0 using 
39   //    other tracks in the event (for pp, broad interaction region);
40   //    it is time-consuming procedure, so it can be done after a 
41   //    preselection on invariant mass
42   //analysis->SetVertexOnTheFly();
43   //analysis->SetMassCut(0.1); // GeV
44   //--- set single-track preselections
45   analysis->SetPtCut(0.5); // GeV
46   analysis->Setd0Cut(50.); // micron
47   //--- set cuts on D0 candidates to be written to file
48   //    (see AliD0toKpiAnalysis.h for a description and for the defaults)
49   analysis->SetD0Cuts(0.1,1000.,1.1,0.,0.,10000.,10000.,0.,.5);
50   //analysis->SetD0Cuts();
51
52   //--- check the settings
53   analysis->PrintStatus();
54
55   Int_t evFirst = 0;
56   Int_t evLast  = 1000000;
57   //analysis->SetDebug();
58   //analysis->FindCandidates(evFirst,evLast,"AliD0toKpi.root");
59   analysis->FindCandidatesESD(evFirst,evLast,"AliD0toKpi.root");
60   delete analysis;
61
62   return;
63 }
64 //==========================================================================
65 void AliD0toKpiSele() {  
66
67   //========================  S E L E C T I O N ============================
68
69   AliD0toKpiAnalysis *analysis = new AliD0toKpiAnalysis();
70   analysis->SetSimulation();
71   analysis->SetOnlySignal();
72   analysis->SetD0Cuts(0.1,1000.,1.1,0.,0.,10000.,10000.,0.,.5);
73   analysis->ApplySelection("AliD0toKpi.root","AliD0toKpi_sele.root");
74   delete analysis;
75
76   return;
77 }
78 //==========================================================================
79  
80
81
82
83
84