]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliESDtest.C
Primary vertex included in ESD (Yu.Belikov)
[u/mrichter/AliRoot.git] / STEER / AliESDtest.C
index ffaa41e209fc3087b7e7e86e4b0dbe8d1287ccc4..1345c089421c7a3a1ed26cd5411d529bc731ae12 100644 (file)
   #include "TSystem.h"
   #include "TStopwatch.h"
   #include "TGeant3.h"
+  #include "TArrayF.h"
 
   #include "AliMagF.h"
   #include "AliRun.h"
   #include "AliRunLoader.h"
   #include "AliLoader.h"
+  #include "AliHeader.h"
+  #include "AliGenEventHeader.h"
 
   #include "AliESD.h"
   #include "AliESDpid.h"
@@ -33,6 +36,8 @@
   #include "AliITS.h"
   #include "AliITSgeom.h"
   #include "AliITStrackerV2.h"
+  #include "AliV0vertexer.h"
+  #include "AliCascadeVertexer.h"
   #include "AliITSpidESD.h"
   #include "AliITSLoader.h"
 
@@ -89,7 +94,6 @@ Int_t AliESDtest(Int_t nev=1) {
    );
 
 
-
 /**** The ITS corner ********************/
 
    AliITSLoader* itsl = (AliITSLoader*)rl->GetLoader("ITSLoader");
@@ -113,6 +117,27 @@ Int_t AliESDtest(Int_t nev=1) {
    Double_t parITS[]={34.,0.15,10.};
    AliITSpidESD itsPID(parITS);
 
+   //An instance of the V0 finder
+   Double_t cuts[]={33,  // max. allowed chi2
+                    0.16,// min. allowed negative daughter's impact parameter 
+                    0.05,// min. allowed positive daughter's impact parameter 
+                    0.080,// max. allowed DCA between the daughter tracks
+                    0.998,// max. allowed cosine of V0's pointing angle
+                    0.9,  // min. radius of the fiducial volume
+                    2.9   // max. radius of the fiducial volume
+                   };
+   AliV0vertexer vtxer(cuts);
+
+   Double_t cts[]={33.,    // max. allowed chi2
+                    0.05,   // min. allowed V0 impact parameter 
+                    0.008,  // window around the Lambda mass 
+                    0.035,  // min. allowed bachelor's impact parameter 
+                    0.10,   // max. allowed DCA between a V0 and a track
+                    0.9985, //max. allowed cosine of the cascade pointing angle
+                    0.9,    // min. radius of the fiducial volume
+                    2.9     // max. radius of the fiducial volume
+                   };
+   AliCascadeVertexer cvtxer=AliCascadeVertexer(cts);
 
 /**** The TPC corner ********************/
 
@@ -197,6 +222,20 @@ Int_t AliESDtest(Int_t nev=1) {
 
      rl->GetEvent(i);
  
+//***** Primary vertex reconstruction (MC vertex position, for the moment)
+     TArrayF v(3);     
+     rl->GetHeader()->GenEventHeader()->PrimaryVertex(v);
+     Double_t vtx[3]={v[0],v[1],v[2]};
+     Double_t cvtx[6]={
+       0.005,
+       0.000, 0.005,
+       0.000, 0.000, 0.010
+     };
+     event->SetVertex(vtx,cvtx);
+     cvtx[1]=cvtx[0]; cvtx[2]=cvtx[5]; //trackers use only the diag.elements
+
+//***** Initial path towards the primary vertex
+     tpcTracker.SetVertex(vtx,cvtx);
      TTree *tpcTree=tpcl->TreeR();
      if (!tpcTree) {
         cerr<<"Can't get the TPC cluster tree !\n";
@@ -205,40 +244,36 @@ Int_t AliESDtest(Int_t nev=1) {
      tpcTracker.LoadClusters(tpcTree);
      rc+=tpcTracker.Clusters2Tracks(event);
 
-
+     itsTracker.SetVertex(vtx,cvtx);
      TTree *itsTree=itsl->TreeR();
      if (!itsTree) {
-        cerr<<"Can't get the TPC cluster tree !\n";
+        cerr<<"Can't get the ITS cluster tree !\n";
         return 4;
      }     
      itsTracker.LoadClusters(itsTree);
      rc+=itsTracker.Clusters2Tracks(event);
 
+
+//***** Back propagation towards the outer barrel detectors
      rc+=itsTracker.PropagateBack(event); 
-     itsTracker.UnloadClusters();
-     itsPID.MakePID(event);
+     //itsPID.MakePID(event);
      
      rc+=tpcTracker.PropagateBack(event);
-     tpcTracker.UnloadClusters();
      tpcPID.MakePID(event);
 
-
      TTree *trdTree=trdl->TreeR();
      if (!trdTree) {
-        cerr<<"Can't get the TPC cluster tree !\n";
+        cerr<<"Can't get the TRD cluster tree !\n";
         return 4;
      } 
      trdTracker.LoadClusters(trdTree);
      rc+=trdTracker.PropagateBack(event);
-     trdTracker.UnloadClusters();
-
 /*
      for (Int_t iTrack = 0; iTrack < event->GetNumberOfTracks(); iTrack++) {
        AliESDtrack* track = event->GetTrack(iTrack);
        trdPID->MakePID(track);
      }
 */
-
      TTree *tofTree=tofl->TreeD();
      if (!tofTree) {
         cerr<<"Can't get the TOF cluster tree !\n";
@@ -249,9 +284,32 @@ Int_t AliESDtest(Int_t nev=1) {
      tofPID.UnloadClusters();
 
 
-    //Here is the combined PID
+
+//***** Here is the combined PID
      AliESDpid::MakePID(event);
 
+
+
+//***** Now the final refit at the primary vertex...
+     rc+=trdTracker.RefitInward(event);
+     trdTracker.UnloadClusters();
+
+     rc+=tpcTracker.RefitInward(event);
+     tpcTracker.UnloadClusters();
+
+     rc+=itsTracker.RefitInward(event); 
+     itsTracker.UnloadClusters();
+
+
+
+//***** Hyperon reconstruction 
+     vtxer.SetVertex(vtx);
+     rc+=vtxer.Tracks2V0vertices(event);            // V0 finding
+     rc+=cvtxer.V0sTracks2CascadeVertices(event);   // cascade finding
+
+
+
+//***** Some final manipulations with this event 
      if (rc==0) {
         Char_t ename[100]; 
         sprintf(ename,"%d",i);