//-------------------------------------------------------------------------
// Implementation of the V0 vertexer class
-//
+// reads tracks writes out V0 vertices
+// fills the ESD with the V0s
// Origin: Iouri Belikov, IReS, Strasbourg, Jouri.Belikov@cern.ch
//-------------------------------------------------------------------------
#include <TObjArray.h>
Int_t i;
for (i=0; i<nentr; i++) {
AliESDtrack *esd=event->GetTrack(i);
- Int_t status=esd->GetStatus();
+ UInt_t status=esd->GetStatus();
+ UInt_t flags=AliESDtrack::kITSin|AliESDtrack::kTPCin|
+ AliESDtrack::kTPCpid|AliESDtrack::kESDpid;
- if ((status&AliESDtrack::kITSrefit)==0)
- if ((status&AliESDtrack::kITSout)!=0 || (status&AliESDtrack::kITSin)==0)
- continue;
+ if ((status&AliESDtrack::kITSrefit)==0)
+ if (flags!=status) continue;
AliITStrackV2 *iotrack=new AliITStrackV2(*esd);
iotrack->SetLabel(i); // now it is the index in array of ESD tracks
- iotrack->PropagateTo(3.,0.0023,65.19);
- iotrack->PropagateTo(2.5,0.,0.);
-
- if (iotrack->Get1Pt() > 0.) {nneg++; negtrks.AddLast(iotrack);}
+ if ((status&AliESDtrack::kITSrefit)==0) //correction for the beam pipe
+ if (!iotrack->PropagateTo(3.,0.0023,65.19)) {
+ delete iotrack;
+ continue;
+ }
+ if (!iotrack->PropagateTo(2.5,0.,0.)) {
+ delete iotrack;
+ continue;
+ }
+
+ if (iotrack->Get1Pt() < 0.) {nneg++; negtrks.AddLast(iotrack);}
else {npos++; postrks.AddLast(iotrack);}
}
//if (cost < (5*fCPAmax-0.9-TMath::Sqrt(r2)*(fCPAmax-1))/4.1) continue;
if (cost < fCPAmax) continue;
-
+ vertex.SetDcaDaughters(dca);
//vertex.ChangeMassHypothesis(); //default is Lambda0
event->AddV0(&vertex);
//--------------------------------------------------------------------
//This function reconstructs V0 vertices
//--------------------------------------------------------------------
+ Warning("Tracks2V0vertices(TTree*,TTree*)",
+ "Will be removed soon ! Use Tracks2V0vertices(AliESD*) instead");
+
TBranch *branch=tTree->GetBranch("tracks");
if (!branch) {
Error("Tracks2V0vertices","Can't get the 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)) {
+ delete iotrack;
+ continue;
+ }
+ if (!iotrack->PropagateTo(2.5,0.,0.)) {
+ delete iotrack;
+ continue;
+ }
if (iotrack->Get1Pt() > 0.) {nneg++; negtrks.AddLast(iotrack);}
else {npos++; postrks.AddLast(iotrack);}
//if (cost < (5*fCPAmax-0.9-TMath::Sqrt(r2)*(fCPAmax-1))/4.1) continue;
if (cost < fCPAmax) continue;
-
+ vertex.SetDcaDaughters(dca);
//vertex.ChangeMassHypothesis(); //default is Lambda0
ioVertex=&vertex; vTree->Fill();
return 0;
}
-Double_t AliV0vertexer::PropagateToDCA(AliITStrackV2 *n, AliITStrackV2 *p) {
+Double_t
+AliV0vertexer::PropagateToDCA(AliITStrackV2 *n, AliITStrackV2 *p) const {
//--------------------------------------------------------------------
// This function returns the DCA between two tracks
// The tracks will be moved to the point of DCA !