1 //--------------------------------------------------------------------------
2 // Test macro for reconstruction and analysis of D0->Kpi
4 // Andrea Dainese, andrea.dainese@pd.infn.it
5 //--------------------------------------------------------------------------
7 void AliD0toKpiReco() {
9 //============== R E C O N S T R U C T I O N ==============================
11 // Look for field value in galice.root
14 delete gAlice->GetRunLoader();
18 if(!gSystem->AccessPathName("galice.root",kFileExists)) {
19 AliRunLoader *rl = AliRunLoader::Open("galice.root");
21 field=(Double_t)(gAlice->Field()->SolenoidField())/10.;
22 printf(" B = %3.1f T read from gAlice and set\n",field);
23 delete gAlice->GetRunLoader();
27 printf(" File galice.root not found: default %3.1f T being used!\n",field);
30 AliD0toKpiAnalysis *analysis = new AliD0toKpiAnalysis();
31 //--- set magnetic field
32 analysis->SetBz(field);
33 // set simulation to take info on PDG codes from kine tree
34 //analysis->SetSimulation();
35 //--- set this is you want only signal candidates in output file
36 //analysis->SetOnlySignal();
37 //--- set this if you want to compute primary vertex D0 by D0 using
38 // other tracks in the event (for pp, broad interaction region);
39 // it is time-consuming procedure, so it can be done after a
40 // preselection on invariant mass
41 //analysis->SetVertexOnTheFly();
42 //analysis->SetMassCut(0.1); // GeV
43 //--- set single-track preselections
44 analysis->SetPtCut(0.5); // GeV
45 analysis->Setd0Cut(50.); // micron
46 //--- set cuts on D0 candidates to be written to file
47 // (see AliD0toKpiAnalysis.h for a description and for the defaults)
48 analysis->SetD0Cuts(0.1,1000.,1.1,0.,0.,10000.,10000.,0.,.5);
49 //analysis->SetD0Cuts();
51 //--- check the settings
52 analysis->PrintStatus();
56 //analysis->SetDebug();
57 //analysis->FindCandidates(evFirst,evLast,"AliD0toKpi.root");
58 analysis->FindCandidatesESD(evFirst,evLast,"AliD0toKpi.root");
63 //==========================================================================
64 void AliD0toKpiSele() {
66 //======================== S E L E C T I O N ============================
68 AliD0toKpiAnalysis *analysis = new AliD0toKpiAnalysis();
69 analysis->SetSimulation();
70 analysis->SetOnlySignal();
71 analysis->SetD0Cuts(0.1,1000.,1.1,0.,0.,10000.,10000.,0.,.5);
72 analysis->ApplySelection("AliD0toKpi.root","AliD0toKpi_sele.root");
77 //==========================================================================