]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliCascadeVertexer.cxx
Consistency changes, bug fix, and new conditions on the kITSrefit and kTPCrefit bits...
[u/mrichter/AliRoot.git] / STEER / AliCascadeVertexer.cxx
index 8b25ea293e4f9d7be3b601ced953879c15c6a365..2934d0cd8e5224274883b77b1f0941aa93fe689e 100644 (file)
 #include <TObjArray.h>
 #include <TTree.h>
 
-#include "AliESD.h"
+#include "AliESDEvent.h"
 #include "AliESDv0.h"
 #include "AliESDcascade.h"
 #include "AliCascadeVertexer.h"
+#include "AliESDtrack.h"
+#include "AliESDVertex.h"
 
 ClassImp(AliCascadeVertexer)
 
@@ -47,14 +49,14 @@ Double_t
 Double_t 
   AliCascadeVertexer::fgDCAmax=0.10;    //max DCA between the V0 and the track 
 Double_t 
-  AliCascadeVertexer::fgCPAmax=0.9985;  //max cosine of the cascade pointing angle
+  AliCascadeVertexer::fgCPAmin=0.9985;  //min cosine of the cascade pointing angle
 Double_t 
   AliCascadeVertexer::fgRmin=0.2;       //min radius of the fiducial volume
 Double_t 
   AliCascadeVertexer::fgRmax=100.;      //max radius of the fiducial volume
   
 
-Int_t AliCascadeVertexer::V0sTracks2CascadeVertices(AliESD *event) {
+Int_t AliCascadeVertexer::V0sTracks2CascadeVertices(AliESDEvent *event) {
   //--------------------------------------------------------------------
   // This function reconstructs cascade vertices
   //      Adapted to the ESD by I.Belikov (Jouri.Belikov@cern.ch)
@@ -81,12 +83,10 @@ Int_t AliCascadeVertexer::V0sTracks2CascadeVertices(AliESD *event) {
    TArrayI trk(nentr); Int_t ntr=0;
    for (i=0; i<nentr; i++) {
        AliESDtrack *esdtr=event->GetTrack(i);
-       UInt_t status=esdtr->GetStatus();
-       UInt_t flags=AliESDtrack::kITSin|AliESDtrack::kTPCin|
-                    AliESDtrack::kTPCpid|AliESDtrack::kESDpid;
+       ULong_t status=esdtr->GetStatus();
 
        if ((status&AliESDtrack::kITSrefit)==0)
-          if (flags!=status) continue;
+         if ((status&AliESDtrack::kTPCrefit)==0) continue;
 
        if (TMath::Abs(esdtr->GetD(xv,yv,b))<fDBachMin) continue;
 
@@ -106,7 +106,8 @@ Int_t AliCascadeVertexer::V0sTracks2CascadeVertices(AliESD *event) {
 
       for (Int_t j=0; j<ntr; j++) {//loop on tracks
         Int_t bidx=trk[j];
-        if (bidx==v->GetNindex()) continue; //bachelor and v0's negative tracks must be different
+        //Bo:   if (bidx==v->GetNindex()) continue; //bachelor and v0's negative tracks must be different
+         if (bidx==v->GetIndex(0)) continue; //Bo:  consistency 0 for neg
         AliESDtrack *btrk=event->GetTrack(bidx);
          if (btrk->GetSign()>0) continue;  // bachelor's charge 
           
@@ -119,7 +120,7 @@ Int_t AliCascadeVertexer::V0sTracks2CascadeVertices(AliESD *event) {
          AliESDcascade cascade(*pv0,*pbt,bidx);//constucts a cascade candidate
          if (cascade.GetChi2Xi() > fChi2max) continue;
 
-        Double_t x,y,z; cascade.GetXYZ(x,y,z); 
+        Double_t x,y,z; cascade.GetXYZcascade(x,y,z); // Bo: bug correction
          Double_t r2=x*x + y*y; 
          if (r2 > fRmax*fRmax) continue;   // condition on fiducial zone
          if (r2 < fRmin*fRmin) continue;
@@ -131,7 +132,7 @@ Int_t AliCascadeVertexer::V0sTracks2CascadeVertices(AliESD *event) {
          Double_t x1,y1,z1; pv0->GetXYZ(x1,y1,z1);
          if (r2 > (x1*x1+y1*y1)) continue;
 
-        if (cascade.GetCascadeCosineOfPointingAngle(xv,yv,zv) <fCPAmax) continue; //condition on the cascade pointing angle 
+        if (cascade.GetCascadeCosineOfPointingAngle(xv,yv,zv) <fCPAmin) continue; //condition on the cascade pointing angle 
         
         event->AddCascade(&cascade);
          ncasc++;
@@ -147,7 +148,8 @@ Int_t AliCascadeVertexer::V0sTracks2CascadeVertices(AliESD *event) {
 
       for (Int_t j=0; j<ntr; j++) {//loop on tracks
         Int_t bidx=trk[j];
-        if (bidx==v->GetPindex()) continue; //bachelor and v0's positive tracks must be different
+        //Bo:   if (bidx==v->GetPindex()) continue; //bachelor and v0's positive tracks must be different
+         if (bidx==v->GetIndex(1)) continue; //Bo:  consistency 1 for pos
         AliESDtrack *btrk=event->GetTrack(bidx);
          if (btrk->GetSign()<0) continue;  // bachelor's charge 
           
@@ -160,7 +162,7 @@ Int_t AliCascadeVertexer::V0sTracks2CascadeVertices(AliESD *event) {
          AliESDcascade cascade(*pv0,*pbt,bidx); //constucts a cascade candidate
          if (cascade.GetChi2Xi() > fChi2max) continue;
 
-        Double_t x,y,z; cascade.GetXYZ(x,y,z); 
+        Double_t x,y,z; cascade.GetXYZcascade(x,y,z); // Bo: bug correction
          Double_t r2=x*x + y*y; 
          if (r2 > fRmax*fRmax) continue;   // condition on fiducial zone
          if (r2 < fRmin*fRmin) continue;
@@ -173,7 +175,7 @@ Int_t AliCascadeVertexer::V0sTracks2CascadeVertices(AliESD *event) {
          if (r2 > (x1*x1+y1*y1)) continue;
          if (z*z > z1*z1) continue;
 
-        if (cascade.GetCascadeCosineOfPointingAngle(xv,yv,zv) < fCPAmax) continue; //condition on the cascade pointing angle 
+        if (cascade.GetCascadeCosineOfPointingAngle(xv,yv,zv) < fCPAmin) continue; //condition on the cascade pointing angle 
         event->AddCascade(&cascade);
          ncasc++;