]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliV0FindVertices.C
Radiator to Pad goes static.
[u/mrichter/AliRoot.git] / ITS / AliV0FindVertices.C
CommitLineData
566abf75 1#if !defined(__CINT__) || defined(__MAKECINT__)
548b1270 2 #include "Riostream.h"
ca28c5f5 3 #include "AliV0vertexer.h"
4 #include "TFile.h"
5 #include "TStopwatch.h"
566abf75 6
7 #include "AliRun.h"
8 #include "AliRunLoader.h"
9 #include "AliITSLoader.h"
ca28c5f5 10#endif
11
566abf75 12extern AliRun *gAlice;
ca28c5f5 13
566abf75 14Int_t AliV0FindVertices(Int_t nev=5) {
15 cerr<<"Looking for V0 vertices...\n";
ca28c5f5 16
566abf75 17 if (gAlice) {
18 delete gAlice->GetRunLoader();
19 delete gAlice;
20 gAlice=0;
21 }
22 AliRunLoader* rl = AliRunLoader::Open("galice.root");
23 if (rl == 0x0) {
24 cerr<<"AliV0FindVertices.C : Can not open session RL=NULL"<< endl;
25 return 1;
26 }
27 AliITSLoader* itsl = (AliITSLoader*)rl->GetLoader("ITSLoader");
28 if (itsl == 0x0) {
29 cerr<<"AliV0FindVertices.C : Can not get ITS loader"<<endl;
30 return 2;
31 }
32 itsl->LoadTracks("read");
33 itsl->LoadV0s("recreate");
ca28c5f5 34
35 Double_t cuts[]={33, // max. allowed chi2
04b2a5f1 36 0.16,// min. allowed negative daughter's impact parameter
37 0.05,// min. allowed positive daughter's impact parameter
ca28c5f5 38 0.080,// max. allowed DCA between the daughter tracks
39 0.998,// max. allowed cosine of V0's pointing angle
40 0.9, // min. radius of the fiducial volume
41 2.9 // max. radius of the fiducial volume
42 };
43 TStopwatch timer;
5d390eda 44 AliV0vertexer vtxer(cuts);
45 Int_t rc=0;
566abf75 46 if (nev>rl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents();
5d390eda 47 for (Int_t i=0; i<nev; i++) {
566abf75 48 rl->GetEvent(i);
5d390eda 49 //Double_t vtx[3]={0.,0.,0.}; vtxer.SetVertex(vtx); // primary vertex (cm)
566abf75 50
51 TTree *tTree=itsl->TreeT();
52 if (!tTree) {
53 cerr<<"AliV0FindVertices.C : Can't get the ITS track tree !"<<endl;
54 return 3;
55 }
56 TTree *vTree=itsl->TreeV0();
57 if (!vTree) {
58 itsl->MakeTree("V0");
59 vTree=itsl->TreeV0();
60 }
61
62 rc=vtxer.Tracks2V0vertices(tTree,vTree);
63
64 itsl->WriteV0s("OVERWRITE");
5d390eda 65 }
ca28c5f5 66 timer.Stop(); timer.Print();
67
566abf75 68 delete rl;
ca28c5f5 69
70 return rc;
71}