//-------------------------------------------------------------------------
// 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;
+
+ if ((status&AliESDtrack::kITSrefit)==0)
+ if ((status&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;
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
AliV0vertex v0(*v), *pv0=&v0;
AliITStrackV2 bt(*b), *pbt=&bt;
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
AliV0vertex v0(*v), *pv0=&v0;
AliITStrackV2 bt(*b), *pbt=&bt;
//--------------------------------------------------------------------
// 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;