1 /****************************************************************************
2 * Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch *
3 ****************************************************************************/
5 #if !defined(__CINT__) || defined(__MAKECINT__)
7 #include "AliV0vertexer.h"
10 #include "TStopwatch.h"
13 #include "AliKalmanTrack.h"
16 #include "AliRunLoader.h"
19 extern AliRun *gAlice;
21 Int_t AliV0FindVertices(Int_t nev=5) {
22 cerr<<"Looking for V0 vertices...\n";
25 delete gAlice->GetRunLoader();
30 AliRunLoader* rl = AliRunLoader::Open("galice.root");
32 cerr<<"AliV0FindVertices.C : Can not open session RL=NULL"<< endl;
36 if (rl->LoadgAlice()) {
37 cerr<<"AliV0FindVertices.C : LoadgAlice returned error"<<endl;
42 AliKalmanTrack::SetConvConst(
43 1000/0.299792458/rl->GetAliRun()->Field()->SolenoidField()
46 Double_t cuts[]={33, // max. allowed chi2
47 0.16,// min. allowed negative daughter's impact parameter
48 0.05,// min. allowed positive daughter's impact parameter
49 0.080,// max. allowed DCA between the daughter tracks
50 0.998,// max. allowed cosine of V0's pointing angle
51 0.9, // min. radius of the fiducial volume
52 2.9 // max. radius of the fiducial volume
55 AliV0vertexer vtxer(cuts);
57 if (nev>rl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents();
59 TFile *v0f=TFile::Open("AliESDv0.root","RECREATE");
60 if ((!v0f)||(!v0f->IsOpen())) {
61 cerr<<"Can't AliESDv0.root !\n"; return 1;
63 TFile *itsf=TFile::Open("AliESDits.root");
64 if ((!itsf)||(!itsf->IsOpen())) {
65 cerr<<"Can't AliESDits.root !\n"; return 1;
68 TIter next(itsf->GetListOfKeys());
69 for (Int_t i=0; i<nev; i++) {
71 if ((key=(TKey*)next())==0) break;
72 cerr<<"Processing event number: "<<i<<endl;
73 AliESD *event=(AliESD*)key->ReadObj();
75 //Double_t vtx[3]={0.,0.,0.}; vtxer.SetVertex(vtx); // primary vertex (cm)
77 rc=vtxer.Tracks2V0vertices(event);
81 sprintf(ename,"%d",i);
83 if (!event->Write(ename)) rc++;
86 cerr<<"Something bad happened...\n";
90 timer.Stop(); timer.Print();