]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliV0vertexer.cxx
"Version
[u/mrichter/AliRoot.git] / ITS / AliV0vertexer.cxx
index 139d3b95d760c38512ce01e4e564772823a89292..9e7c23d125066b32a3ac5bbb54fc674379ee80ee 100644 (file)
@@ -45,19 +45,26 @@ Int_t AliV0vertexer::Tracks2V0vertices(AliESD *event) {
    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
      if ((status&AliESDtrack::kITSrefit)==0)   //correction for the beam pipe
-        iotrack->PropagateTo(3.,0.0023,65.19); //material
-     iotrack->PropagateTo(2.5,0.,0.);
-
-     if (iotrack->Get1Pt() > 0.) {nneg++; negtrks.AddLast(iotrack);}
+        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);}
    }   
 
@@ -104,7 +111,7 @@ Int_t AliV0vertexer::Tracks2V0vertices(AliESD *event) {
 
         //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);
@@ -125,6 +132,9 @@ Int_t AliV0vertexer::Tracks2V0vertices(TTree *tTree, TTree *vTree) {
   //--------------------------------------------------------------------
   //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 !");
@@ -143,7 +153,14 @@ Int_t AliV0vertexer::Tracks2V0vertices(TTree *tTree, TTree *vTree) {
        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);}
@@ -198,7 +215,7 @@ Int_t AliV0vertexer::Tracks2V0vertices(TTree *tTree, TTree *vTree) {
 
         //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();