//-------------------------------------------------------------------------
// Implementation of the cascade vertexer class
-//
+// Reads V0s and tracks, writes out cascade vertices
+// Fills the ESD with the cascades
// Origin: Christian Kuhn, IReS, Strasbourg, christian.kuhn@ires.in2p3.fr
//-------------------------------------------------------------------------
#include <TObjArray.h>
#include "AliESD.h"
#include "AliESDv0.h"
-#include "AliESDcascade.h"
#include "AliCascadeVertex.h"
#include "AliCascadeVertexer.h"
#include "AliITStrackV2.h"
TObjArray trks(ntr);
for (i=0; i<ntr; i++) {
AliESDtrack *esdtr=event->GetTrack(i);
+ UInt_t status=esdtr->GetStatus();
+ UInt_t flags=AliESDtrack::kITSin|AliESDtrack::kTPCin|
+ AliESDtrack::kTPCpid|AliESDtrack::kESDpid;
+
+ if ((status&AliESDtrack::kITSrefit)==0)
+ if (flags!=status) continue;
+
AliITStrackV2 *iotrack=new AliITStrackV2(*esdtr);
- iotrack->PropagateTo(3.,0.0023,65.19); iotrack->PropagateTo(2.5,0.,0.);
+ iotrack->SetLabel(i); // now it is the index in array of ESD tracks
+ if ((status&AliESDtrack::kITSrefit)==0) //correction for the beam pipe
+ if (!iotrack->PropagateTo(3.,0.0023,65.19)) continue;
+ if (!iotrack->PropagateTo(2.5,0.,0.)) continue;
trks.AddLast(iotrack);
}
+ ntr=trks.GetEntriesFast();
Double_t massLambda=1.11568;
Int_t ncasc=0;
AliV0vertex *v=(AliV0vertex*)vtcs.UncheckedAt(i);
v->ChangeMassHypothesis(kLambda0); // the v0 must be Lambda
if (TMath::Abs(v->GetEffMass()-massLambda)>fMassWin) continue;
- if (v->GetD(0,0,0)<fDV0min) continue;
+ if (v->GetD(fX,fY,fZ)<fDV0min) continue;
for (Int_t j=0; j<ntr; j++) {
AliITStrackV2 *b=(AliITStrackV2*)trks.UncheckedAt(j);
- if (TMath::Abs(b->GetD())<fDBachMin) continue;
- if (b->Get1Pt()<0.) continue; // bachelor's charge
+ if (b->Get1Pt()>0.) continue; // bachelor's charge
+ if (TMath::Abs(b->GetD(fX,fY))<fDBachMin) continue;
AliV0vertex v0(*v), *pv0=&v0;
AliITStrackV2 bt(*b), *pbt=&bt;
{
Double_t x1,y1,z1; pv0->GetXYZ(x1,y1,z1);
if (r2 > (x1*x1+y1*y1)) continue;
- if (z*z > z1*z1) continue;
+ //if ((z-fZ)*(z-fZ) > (z1-fZ)*(z1-fZ)) continue;
}
Double_t px,py,pz; cascade.GetPxPyPz(px,py,pz);
Double_t p2=px*px+py*py+pz*pz;
- Double_t cost=(x*px+y*py+z*pz)/TMath::Sqrt(p2*(r2+z*z));
-
- if (cost<fCPAmax) continue; //condition on the cascade pointing angle
+ Double_t cost=((x-fX)*px + (y-fY)*py + (z-fZ)*pz)/
+ TMath::Sqrt(p2*((x-fX)*(x-fX) + (y-fY)*(y-fY) + (z-fZ)*(z-fZ)));
+ if (cost<fCPAmax) continue; //condition on the cascade pointing angle
//cascade.ChangeMassHypothesis(); //default is Xi
event->AddCascade(&cascade);
AliV0vertex *v=(AliV0vertex*)vtcs.UncheckedAt(i);
v->ChangeMassHypothesis(kLambda0Bar); //the v0 must be anti-Lambda
if (TMath::Abs(v->GetEffMass()-massLambda)>fMassWin) continue;
- if (v->GetD(0,0,0)<fDV0min) continue;
+ if (v->GetD(fX,fY,fZ)<fDV0min) continue;
for (Int_t j=0; j<ntr; j++) {
AliITStrackV2 *b=(AliITStrackV2*)trks.UncheckedAt(j);
- if (TMath::Abs(b->GetD())<fDBachMin) continue;
- if (b->Get1Pt()>0.) continue; // bachelor's charge
+ if (TMath::Abs(b->GetD(fX,fY))<fDBachMin) continue;
+ if (b->Get1Pt()<0.) continue; // bachelor's charge
AliV0vertex v0(*v), *pv0=&v0;
AliITStrackV2 bt(*b), *pbt=&bt;
Double_t px,py,pz; cascade.GetPxPyPz(px,py,pz);
Double_t p2=px*px+py*py+pz*pz;
- Double_t cost=(x*px+y*py+z*pz)/TMath::Sqrt(p2*(r2+z*z));
+ Double_t cost=((x-fX)*px + (y-fY)*py + (z-fZ)*pz)/
+ TMath::Sqrt(p2*((x-fX)*(x-fX) + (y-fY)*(y-fY) + (z-fZ)*(z-fZ)));
if (cost<fCPAmax) continue; //condition on the cascade pointing angle
//cascade.ChangeMassHypothesis(); //default is Xi
//--------------------------------------------------------------------
// This function reconstructs cascade vertices
//--------------------------------------------------------------------
+ Warning("V0sTracks2CascadeVertices(TTree*,TTree*,TTree*)",
+ "Will be removed soon ! Use V0sTracks2CascadeVertices(AliESD*) instead");
+
TBranch *branch=vTree->GetBranch("vertices");
if (!branch) {
Error("V0sTracks2CascadeVertices","Can't get the V0 branch !");
branch->SetAddress(&iotrack);
tTree->GetEvent(i);
- iotrack->PropagateTo(3.,0.0023,65.19); iotrack->PropagateTo(2.5,0.,0.);
+ if (!iotrack->PropagateTo(3.,0.0023,65.19)) continue;
+ if (!iotrack->PropagateTo(2.5,0.,0.)) continue;
ntrack++; trks.AddLast(iotrack);
if (TMath::Abs(bachtrk->GetD())<fDBachMin) continue; // eliminate to small impact parameters
- if (lV0ver->GetPdgCode()==kLambda0 && bachtrk->Get1Pt()<0.) continue; // condition on V0 label
- if (lV0ver->GetPdgCode()==kLambda0Bar && bachtrk->Get1Pt()>0.) continue; // + good sign for bachelor
+ if (lV0ver->GetPdgCode()==kLambda0 && bachtrk->Get1Pt()>0.) continue; // condition on V0 label
+ if (lV0ver->GetPdgCode()==kLambda0Bar && bachtrk->Get1Pt()<0.) continue; // + good sign for bachelor
AliV0vertex lV0(*lV0ver), *pV0=&lV0;
AliITStrackV2 bt(*bachtrk), *pbt=&bt;