//modified by R. Vernet 30/6/2006 : daughter label
//modified by R. Vernet 3/7/2006 : causality
+//modified by I. Belikov 24/11/2006 : static setter for the default cuts
#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)
-Int_t AliCascadeVertexer::V0sTracks2CascadeVertices(AliESD *event) {
+//A set of loose cuts
+Double_t
+ AliCascadeVertexer::fgChi2max=33.; //maximal allowed chi2
+Double_t
+ AliCascadeVertexer::fgDV0min=0.05; //min V0 impact parameter
+Double_t
+ AliCascadeVertexer::fgMassWin=0.01; //"window" around the Lambda mass
+Double_t
+ AliCascadeVertexer::fgDBachMin=0.035; //min bachelor impact parameter
+Double_t
+ AliCascadeVertexer::fgDCAmax=0.10; //max DCA between the V0 and the track
+Double_t
+ 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(AliESDEvent *event) {
//--------------------------------------------------------------------
// This function reconstructs cascade vertices
// Adapted to the ESD by I.Belikov (Jouri.Belikov@cern.ch)
//--------------------------------------------------------------------
+ const AliESDVertex *vtx=event->GetVertex();
+ Double_t xv=vtx->GetXv(), yv=vtx->GetYv(), zv=vtx->GetZv();
+
Double_t b=event->GetMagneticField();
Int_t nV0=(Int_t)event->GetNumberOfV0s();
Int_t i;
for (i=0; i<nV0; i++) {
AliESDv0 *v=event->GetV0(i);
- if (v->GetD(fX,fY,fZ)<fDV0min) continue;
+ if (v->GetOnFlyStatus()) continue;
+ if (v->GetD(xv,yv,zv)<fDV0min) continue;
vtcs.AddLast(v);
}
nV0=vtcs.GetEntriesFast();
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(fX,fY,b))<fDBachMin) continue;
+ if (TMath::Abs(esdtr->GetD(xv,yv,b))<fDBachMin) continue;
trk[ntr++]=i;
}
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
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;
Double_t x1,y1,z1; pv0->GetXYZ(x1,y1,z1);
if (r2 > (x1*x1+y1*y1)) continue;
- if (cascade.GetCascadeCosineOfPointingAngle(fX,fY,fZ) <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++;
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
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;
if (r2 > (x1*x1+y1*y1)) continue;
if (z*z > z1*z1) continue;
- if (cascade.GetCascadeCosineOfPointingAngle(fX,fY,fZ) < 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++;
}
-inline Double_t det(Double_t a00, Double_t a01, Double_t a10, Double_t a11){
+Double_t det(Double_t a00, Double_t a01, Double_t a10, Double_t a11){
// determinant 2x2
return a00*a11 - a01*a10;
}
-inline Double_t det (Double_t a00,Double_t a01,Double_t a02,
+Double_t det (Double_t a00,Double_t a01,Double_t a02,
Double_t a10,Double_t a11,Double_t a12,
Double_t a20,Double_t a21,Double_t a22) {
// determinant 3x3