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