]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliV0vertexer.cxx
Mixtures instead of materials with fractional Z in SPD (SPD bus and SPD end ladder
[u/mrichter/AliRoot.git] / ITS / AliV0vertexer.cxx
index 4eda554ec5700bf7e75821ef244c3c3c36e2cc87..9e7c23d125066b32a3ac5bbb54fc674379ee80ee 100644 (file)
@@ -15,7 +15,8 @@
 
 //-------------------------------------------------------------------------
 //               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>
@@ -44,18 +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
-     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);}
    }   
 
@@ -102,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);
@@ -123,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 !");
@@ -141,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);}
@@ -196,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();
@@ -213,7 +232,8 @@ Int_t AliV0vertexer::Tracks2V0vertices(TTree *tTree, TTree *vTree) {
    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 !