]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliV0vertexer.cxx
Correct layer index for LayerSize() and LayerName() methods
[u/mrichter/AliRoot.git] / ITS / AliV0vertexer.cxx
index 120a926506349cf1d0ec458d989ec1cf6df158f9..9e7c23d125066b32a3ac5bbb54fc674379ee80ee 100644 (file)
@@ -46,18 +46,25 @@ Int_t AliV0vertexer::Tracks2V0vertices(AliESD *event) {
    for (i=0; i<nentr; i++) {
      AliESDtrack *esd=event->GetTrack(i);
      UInt_t status=esd->GetStatus();
-     UInt_t flags=AliESDtrack::kITSin|AliESDtrack::kTPCin;
+     UInt_t flags=AliESDtrack::kITSin|AliESDtrack::kTPCin|
+                  AliESDtrack::kTPCpid|AliESDtrack::kESDpid;
 
      if ((status&AliESDtrack::kITSrefit)==0)
-        if ((status&flags)!=status) continue;
+        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
-        if (!iotrack->PropagateTo(3.,0.0023,65.19)) continue;
-     if (!iotrack->PropagateTo(2.5,0.,0.)) continue;
-
-     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);
@@ -146,8 +153,14 @@ Int_t AliV0vertexer::Tracks2V0vertices(TTree *tTree, TTree *vTree) {
        branch->SetAddress(&iotrack);
        tTree->GetEvent(i);
 
-       if (!iotrack->PropagateTo(3.,0.0023,65.19)) continue; 
-       if (!iotrack->PropagateTo(2.5,0.,0.)) continue;
+       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);}
@@ -202,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();