]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliV0vertexer.cxx
removing obsolete component from libAliHLTTrigger
[u/mrichter/AliRoot.git] / STEER / AliV0vertexer.cxx
index 030548d196216f03b0ca76bd03e01b48699a4b70..4e8d21c5811d794973f2a35025ad7ca970028bba 100644 (file)
 //-------------------------------------------------------------------------
 
 
-#include <TObjArray.h>
-#include <TTree.h>
-
 #include "AliESDEvent.h"
 #include "AliESDv0.h"
-#include "AliESDtrack.h"
 #include "AliV0vertexer.h"
-#include "AliESDVertex.h"
 
 ClassImp(AliV0vertexer)
 
@@ -37,38 +32,29 @@ ClassImp(AliV0vertexer)
 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=0.5;  //max DCA between the daughter tracks
-Double_t AliV0vertexer::fgCPAmin=0.99; //min cosine of V0's pointing angle
+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=100.;   //max 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 *vtxSPD=event->GetVertex();
    const AliESDVertex *vtxT3D=event->GetPrimaryVertex();
 
-   Double_t xPrimaryVertex=999, yPrimaryVertex=999, zPrimaryVertex=999;
-   if (vtxT3D->GetStatus()) {
-     xPrimaryVertex=vtxT3D->GetXv();
-     yPrimaryVertex=vtxT3D->GetYv();
-     zPrimaryVertex=vtxT3D->GetZv();
-   }
-   else {
-     xPrimaryVertex=vtxSPD->GetXv();
-     yPrimaryVertex=vtxSPD->GetYv();
-     zPrimaryVertex=vtxSPD->GetZv();
-   }
+   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;
 
@@ -77,7 +63,7 @@ Int_t AliV0vertexer::Tracks2V0vertices(AliESDEvent *event) {
      AliESDtrack *esdTrack=event->GetTrack(i);
      ULong_t status=esdTrack->GetStatus();
 
-     if ((status&AliESDtrack::kITSrefit)==0)
+     //if ((status&AliESDtrack::kITSrefit)==0)//not to accept the ITS SA tracks
         if ((status&AliESDtrack::kTPCrefit)==0) continue;
 
      Double_t d=esdTrack->GetD(xPrimaryVertex,yPrimaryVertex,b);
@@ -127,6 +113,11 @@ Int_t AliV0vertexer::Tracks2V0vertices(AliESDEvent *event) {
          AliESDv0 vertex(nt,nidx,pt,pidx);
          if (vertex.GetChi2V0() > fChi2max) continue;
         
+         Double_t x=vertex.Xv(), y=vertex.Yv();
+         Double_t r2=x*x + y*y;
+         if (r2 < fRmin*fRmin) continue;
+         if (r2 > fRmax*fRmax) continue;
+
         Float_t cpa=vertex.GetV0CosineOfPointingAngle(xPrimaryVertex,yPrimaryVertex,zPrimaryVertex);
         if (cpa < fCPAmin) continue;
         vertex.SetDcaV0Daughters(dca);