1 #if !defined(__CINT__) || defined(__MAKECINT__)
3 #include "AliCascadeVertexer.h"
6 #include "TStopwatch.h"
11 #include "AliTracker.h"
12 #include "AliRunLoader.h"
15 Int_t AliCascadeFindVertices(Int_t nev=5) {
16 cerr<<"Looking for cascade vertices...\n";
19 delete gAlice->GetRunLoader();
23 AliRunLoader* rl = AliRunLoader::Open("galice.root");
25 cerr<<"AliCascadeFindVertices.C : Can not open session RL=NULL"<< endl;
29 if (rl->LoadgAlice()) {
30 cerr<<"AliV0FindVertices.C : LoadgAlice returned error"<<endl;
36 AliTracker::SetFieldMap(gAlice->Field(),1); // 1 means uniform magnetic field
37 Double_t cuts[]={33., // max. allowed chi2
38 0.05, // min. allowed V0 impact parameter
39 0.008, // window around the Lambda mass
40 0.035, // min. allowed bachelor's impact parameter
41 0.10, // max. allowed DCA between a V0 and a track
42 0.9985,// max. allowed cosine of the cascade pointing angle
43 0.9, // min. radius of the fiducial volume
44 2.9 // max. radius of the fiducial volume
47 AliCascadeVertexer *vertexer=new AliCascadeVertexer(cuts);
50 if (nev>rl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents();
52 TFile *casf=TFile::Open("AliESDcas.root","RECREATE");
53 if ((!casf)||(!casf->IsOpen())) {
54 cerr<<"Can't AliESDcas.root !\n"; return 1;
56 TFile *v0f=TFile::Open("AliESDv0.root");
57 if ((!v0f)||(!v0f->IsOpen())) {
58 cerr<<"Can't AliESDv0.root !\n"; return 1;
62 TIter next(v0f->GetListOfKeys());
63 for (Int_t i=0; i<nev; i++) {
65 if ((key=(TKey*)next())==0) break;
66 cerr<<"Processing event number: "<<i<<endl;
67 AliESD *event=(AliESD*)key->ReadObj();
69 rc=vertexer->V0sTracks2CascadeVertices(event);
73 sprintf(ename,"%d",i);
75 if (!event->Write(ename)) rc++;
78 cerr<<"Something bad happened...\n";
83 timer.Stop(); timer.Print();