1 #if !defined(__CINT__) || defined(__MAKECINT__)
3 #include "AliCascadeVertexer.h"
6 #include "TStopwatch.h"
11 #include "AliKalmanTrack.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;
35 AliKalmanTrack::SetConvConst(
36 1000/0.299792458/rl->GetAliRun()->Field()->SolenoidField()
39 Double_t cuts[]={33., // max. allowed chi2
40 0.05, // min. allowed V0 impact parameter
41 0.008, // window around the Lambda mass
42 0.035, // min. allowed bachelor's impact parameter
43 0.10, // max. allowed DCA between a V0 and a track
44 0.9985,// max. allowed cosine of the cascade pointing angle
45 0.9, // min. radius of the fiducial volume
46 2.9 // max. radius of the fiducial volume
49 AliCascadeVertexer *vertexer=new AliCascadeVertexer(cuts);
52 if (nev>rl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents();
54 TFile *casf=TFile::Open("AliESDcas.root","RECREATE");
55 if ((!casf)||(!casf->IsOpen())) {
56 cerr<<"Can't AliESDcas.root !\n"; return 1;
58 TFile *v0f=TFile::Open("AliESDv0.root");
59 if ((!v0f)||(!v0f->IsOpen())) {
60 cerr<<"Can't AliESDv0.root !\n"; return 1;
64 TIter next(v0f->GetListOfKeys());
65 for (Int_t i=0; i<nev; i++) {
67 if ((key=(TKey*)next())==0) break;
68 cerr<<"Processing event number: "<<i<<endl;
69 AliESD *event=(AliESD*)key->ReadObj();
71 rc=vertexer->V0sTracks2CascadeVertices(event);
75 sprintf(ename,"%d",i);
77 if (!event->Write(ename)) rc++;
80 cerr<<"Something bad happened...\n";
85 timer.Stop(); timer.Print();