]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliV0vertexer.cxx
In AliMUONESDInterface:
[u/mrichter/AliRoot.git] / STEER / AliV0vertexer.cxx
index e460a988422f2fc0bdd8e12fc3c543bf8c665a0d..4553283103a1ec51e02c71824360ec50445efabd 100644 (file)
 //               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 "AliESD.h"
+#include "AliESDEvent.h"
 #include "AliESDv0.h"
-#include "AliESDtrack.h"
 #include "AliV0vertexer.h"
 
 ClassImp(AliV0vertexer)
 
 
 //A set of very loose cuts 
-Double_t AliV0vertexer::fgChi2max=33.;//max. chi2
-Double_t AliV0vertexer::fgDNmin=0.16; //min. negative daughter's imp parameter 
-Double_t AliV0vertexer::fgDPmin=0.05; //min. positive daughter's imp parameter
-Double_t AliV0vertexer::fgDCAmax=0.08; //max. DCA between the daughter tracks
-Double_t AliV0vertexer::fgCPAmax=0.99;//max. cosine of V0's pointing angle
-Double_t AliV0vertexer::fgRmin=0.9;   //min. radius of the fiducial volume
-Double_t AliV0vertexer::fgRmax=2.9;   //max. radius of the fiducial volume
-
-Int_t AliV0vertexer::Tracks2V0vertices(AliESD *event) {
+Double_t AliV0vertexer::fgChi2max=33.; //max chi2
+Double_t AliV0vertexer::fgDNmin=0.05;  //min imp parameter for the 1st daughter
+Double_t AliV0vertexer::fgDPmin=0.05;  //min imp parameter for the 2nd daughter
+Double_t AliV0vertexer::fgDCAmax=1.5;  //max DCA between the daughter tracks
+Double_t AliV0vertexer::fgCPAmin=0.9;  //min cosine of V0's pointing angle
+Double_t AliV0vertexer::fgRmin=0.2;    //min radius of the fiducial volume
+Double_t AliV0vertexer::fgRmax=200.;   //max radius of the fiducial volume
+
+Int_t AliV0vertexer::Tracks2V0vertices(AliESDEvent *event) {
   //--------------------------------------------------------------------
   //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;
 
    Int_t i;
    for (i=0; i<nentr; i++) {
      AliESDtrack *esdTrack=event->GetTrack(i);
-     UInt_t status=esdTrack->GetStatus();
-     UInt_t flags=AliESDtrack::kITSin|AliESDtrack::kTPCin|
-                  AliESDtrack::kTPCpid|AliESDtrack::kESDpid;
+     ULong_t status=esdTrack->GetStatus();
 
-     if ((status&AliESDtrack::kITSrefit)==0)
-        if (flags!=status) continue;
+     //if ((status&AliESDtrack::kITSrefit)==0)//not to accept the ITS SA tracks
+        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;
 
@@ -85,8 +83,8 @@ Int_t AliV0vertexer::Tracks2V0vertices(AliESD *event) {
          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;
@@ -115,8 +113,11 @@ Int_t AliV0vertexer::Tracks2V0vertices(AliESD *event) {
          AliESDv0 vertex(nt,nidx,pt,pidx);
          if (vertex.GetChi2V0() > fChi2max) continue;
         
-        if (vertex.GetV0CosineOfPointingAngle(xv,yv,zv) < fCPAmax) continue;
+        Float_t cpa=vertex.GetV0CosineOfPointingAngle(xPrimaryVertex,yPrimaryVertex,zPrimaryVertex);
+        if (cpa < fCPAmin) continue;
         vertex.SetDcaV0Daughters(dca);
+         vertex.SetV0CosineOfPointingAngle(cpa);
+         vertex.ChangeMassHypothesis(kK0Short);
 
          event->AddV0(&vertex);