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