]>
Commit | Line | Data |
---|---|---|
566abf75 | 1 | #if !defined(__CINT__) || defined(__MAKECINT__) |
ddae8318 | 2 | #include <Riostream.h> |
ca28c5f5 | 3 | #include "AliCascadeVertexer.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 | 12 | Int_t AliCascadeFindVertices(Int_t nev=5) { |
ca28c5f5 | 13 | cerr<<"Looking for cascade vertices...\n"; |
14 | ||
566abf75 | 15 | if (gAlice) { |
16 | delete gAlice->GetRunLoader(); | |
17 | delete gAlice; | |
18 | gAlice=0; | |
ca28c5f5 | 19 | } |
566abf75 | 20 | AliRunLoader* rl = AliRunLoader::Open("galice.root"); |
21 | if (rl == 0x0) { | |
22 | cerr<<"AliCascadeFindVertices.C : Can not open session RL=NULL"<< endl; | |
23 | return 1; | |
ca28c5f5 | 24 | } |
566abf75 | 25 | AliITSLoader* itsl = (AliITSLoader*)rl->GetLoader("ITSLoader"); |
26 | if (itsl == 0x0) { | |
27 | cerr<<"AliCascadeFindVertices.C : Can not get ITS loader"<<endl; | |
28 | return 2; | |
29 | } | |
30 | itsl->LoadTracks("read"); | |
31 | itsl->LoadV0s("read"); | |
32 | itsl->LoadCascades("recreate"); | |
33 | ||
04b2a5f1 | 34 | Double_t cuts[]={33., // max. allowed chi2 |
35 | 0.05, // min. allowed V0 impact parameter | |
36 | 0.008, // window around the Lambda mass | |
37 | 0.035, // min. allowed bachelor's impact parameter | |
38 | 0.10, // max. allowed DCA between a V0 and a track | |
39 | 0.9985, // max. allowed cosine of the cascade pointing angle | |
40 | 0.9, // min. radius of the fiducial volume | |
41 | 2.9 // max. radius of the fiducial volume | |
ca28c5f5 | 42 | }; |
43 | TStopwatch timer; | |
44 | AliCascadeVertexer *vertexer=new AliCascadeVertexer(cuts); | |
566abf75 | 45 | Int_t rc=0; |
46 | if (nev>rl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents(); | |
47 | for (Int_t i=0; i<nev; i++) { | |
48 | rl->GetEvent(i); | |
49 | ||
50 | TTree *tTree=itsl->TreeT(); | |
51 | if (!tTree) { | |
52 | cerr<<"AliCascadeFindVertices.C : Can't get the ITS track tree !"<<endl; | |
53 | return 3; | |
54 | } | |
55 | TTree *vTree=itsl->TreeV0(); | |
56 | if (!vTree) { | |
57 | cerr<<"AliCascadeFindVertices.C : Can't get the V0 tree !"<<endl; | |
58 | return 4; | |
59 | } | |
60 | TTree *xTree=itsl->TreeX(); | |
61 | if (!xTree) { | |
62 | itsl->MakeTree("X"); | |
63 | xTree=itsl->TreeX(); | |
64 | } | |
65 | ||
66 | rc=vertexer->V0sTracks2CascadeVertices(vTree,tTree,xTree); | |
67 | ||
68 | itsl->WriteCascades("OVERWRITE"); | |
69 | } | |
ca28c5f5 | 70 | delete vertexer; |
71 | timer.Stop(); timer.Print(); | |
72 | ||
566abf75 | 73 | delete rl; |
ca28c5f5 | 74 | |
75 | return rc; | |
76 | } |