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=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();
28 printf(" File galice.root not found: default %3.1f T being used!\n",field);
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();
52 //--- check the settings
53 analysis->PrintStatus();
56 Int_t evLast = 1000000;
57 //analysis->SetDebug();
58 //analysis->FindCandidates(evFirst,evLast,"AliD0toKpi.root");
59 analysis->FindCandidatesESD(evFirst,evLast,"AliD0toKpi.root");
64 //==========================================================================
65 void AliD0toKpiSele() {
67 //======================== S E L E C T I O N ============================
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");
78 //==========================================================================