]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/AliBtoJPSItoEleReco_all.C
New options: 1)raw data type. 2)initialization of reconstruction paramteres. Clean up.
[u/mrichter/AliRoot.git] / PWG3 / AliBtoJPSItoEleReco_all.C
1 //--------------------------------------------------------------------------
2 // Test macro for reconstruction and analysis of B->J/psi*X
3 //                                                   |_>e+e-
4 //
5 //     Giuseppe Bruno, giuseppe.bruno@ba.infn.it
6 //      based on the for charm golden channel (D0->Kpi)
7 //--------------------------------------------------------------------------
8
9 void AliBtoJPSItoEleReco_all() {
10   
11   gSystem->Load("libANALYSIS");
12   gSystem->Load("libANALYSISalice");
13   gSystem->Load("libAOD.so");
14   gSystem->Load("libPWG3base.so");
15   gSystem->Load("libPWG3.so");
16
17   //==============  R E C O N S T R U C T I O N ==============================
18
19   Int_t evFirst = 0;
20   Int_t evLast  = 99;
21
22   // Get field from galice.root
23   if (gAlice) {
24     delete gAlice->GetRunLoader();
25     delete gAlice; 
26     gAlice=0;
27   }  
28   AliRunLoader *rl = AliRunLoader::Open("galice.root");
29   if (rl == 0x0) {
30     cerr<<"Can not open session"<<endl;
31     return;
32   }
33   Int_t retval = rl->LoadgAlice();
34   if (retval) {
35     cerr<<"LoadgAlice returned error"<<endl;
36     delete rl;
37     return;
38   }
39   gAlice=rl->GetAliRun();
40   AliMagF *fiel = (AliMagF*)gAlice->Field();
41   // Set the conversion constant between curvature and Pt
42   AliTracker::SetFieldMap(fiel,kTRUE);
43
44   AliBtoJPSItoEleAnalysis *analysis = new AliBtoJPSItoEleAnalysis();
45   // set simulation to take info on PDG codes from kine tree
46   analysis->SetSimulation();
47   rl->LoadKinematics(); 
48   analysis->MakeTracksRefFile(gAlice,evFirst,evLast);
49   // cout << "ci arrivo 2" << endl;
50   //--- set this is you want only signal candidates in output file
51    analysis->SetOnlySignal();
52   //--- set this if you want to compute primary vertex candidate by candidate using 
53   //    other tracks in the event (for pp, broad interaction region);
54   //    it is time-consuming procedure, so it can be done after a 
55   //    preselection on invariant mass
56   //analysis->SetVertexOnTheFly();
57   //analysis->SetMassCut(0.1); // GeV
58   //--- set single-track preselections
59   analysis->SetPtCut(0.); // GeV
60   analysis->Setd0Cut(0.); // micron
61   //--- set cuts on candidates to be written to file
62   //    (see AliBtoJPSItoEleAnalysis.h for a description and for the defaults)
63   //analysis->SetBCuts(0.1,1000.,1.1,0.,0.,10000.,10000.,0.,.5);
64   analysis->SetBCuts();
65
66   //--- check the settings
67   analysis->PrintStatus();
68
69   analysis->FindCandidates(evFirst,evLast,"AliBtoJPSItoEle_all.root");
70   delete analysis;
71
72   return;
73 }
74 //==========================================================================
75 void AliBtoJPSItoEleSele() {  
76
77   gSystem->Load("libANALYSIS");
78   gSystem->Load("libANALYSISalice");
79   gSystem->Load("libAOD.so");
80   gSystem->Load("libPWG3base.so");
81   gSystem->Load("libPWG3.so");
82
83   //========================  S E L E C T I O N ============================
84
85   AliBtoJPSItoEleAnalysis *analysis = new AliBtoJPSItoEleAnalysis();
86   analysis->SetSimulation();
87   analysis->SetOnlySignal();
88   analysis->SetBCuts(0.1,1000.,1.1,0.,0.,10000.,10000.,0.,.5);
89   analysis->ApplySelection("AliBtoJPSItoEle.root","AliBtoJPSItoEle_sele.root");
90   delete analysis;
91
92   return;
93 }
94 //==========================================================================
95  
96
97
98
99
100