// Implementation of the V0 vertexer class
// reads tracks writes out V0 vertices
// fills the ESD with the V0s
-// Origin: Iouri Belikov, IReS, Strasbourg, Jouri.Belikov@cern.ch
+// Origin: Iouri Belikov, IPHC, Strasbourg, Jouri.Belikov@cern.ch
//-------------------------------------------------------------------------
-#include <TObjArray.h>
-#include <TTree.h>
-
#include "AliESDEvent.h"
#include "AliESDv0.h"
-#include "AliESDtrack.h"
#include "AliV0vertexer.h"
-#include "AliESDVertex.h"
ClassImp(AliV0vertexer)
//--------------------------------------------------------------------
//This function reconstructs V0 vertices
//--------------------------------------------------------------------
- const AliESDVertex *vtx=event->GetVertex();
- Double_t xv=vtx->GetXv(), yv=vtx->GetYv(), zv=vtx->GetZv();
+
+ const AliESDVertex *vtxT3D=event->GetPrimaryVertex();
+
+ Double_t xPrimaryVertex=vtxT3D->GetXv();
+ Double_t yPrimaryVertex=vtxT3D->GetYv();
+ Double_t zPrimaryVertex=vtxT3D->GetZv();
Int_t nentr=event->GetNumberOfTracks();
Double_t b=event->GetMagneticField();
if (nentr<2) return 0;
- TArrayI neg(nentr/2);
- TArrayI pos(nentr/2);
+ TArrayI neg(nentr);
+ TArrayI pos(nentr);
Int_t nneg=0, npos=0, nvtx=0;
if ((status&AliESDtrack::kITSrefit)==0)
if ((status&AliESDtrack::kTPCrefit)==0) continue;
- Double_t d=esdTrack->GetD(xv,yv,b);
+ Double_t d=esdTrack->GetD(xPrimaryVertex,yPrimaryVertex,b);
if (TMath::Abs(d)<fDPmin) continue;
if (TMath::Abs(d)>fRmax) continue;
Int_t pidx=pos[k];
AliESDtrack *ptrk=event->GetTrack(pidx);
- if (TMath::Abs(ntrk->GetD(xv,yv,b))<fDNmin)
- if (TMath::Abs(ptrk->GetD(xv,yv,b))<fDNmin) continue;
+ if (TMath::Abs(ntrk->GetD(xPrimaryVertex,yPrimaryVertex,b))<fDNmin)
+ if (TMath::Abs(ptrk->GetD(xPrimaryVertex,yPrimaryVertex,b))<fDNmin) continue;
Double_t xn, xp, dca=ntrk->GetDCA(ptrk,b,xn,xp);
if (dca > fDCAmax) continue;
AliESDv0 vertex(nt,nidx,pt,pidx);
if (vertex.GetChi2V0() > fChi2max) continue;
- Float_t cpa=vertex.GetV0CosineOfPointingAngle(xv,yv,zv);
+ Float_t cpa=vertex.GetV0CosineOfPointingAngle(xPrimaryVertex,yPrimaryVertex,zPrimaryVertex);
if (cpa < fCPAmin) continue;
vertex.SetDcaV0Daughters(dca);
vertex.SetV0CosineOfPointingAngle(cpa);