]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Primary vertex included in ESD (Yu.Belikov)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 7 Dec 2003 11:34:48 +0000 (11:34 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 7 Dec 2003 11:34:48 +0000 (11:34 +0000)
STEER/AliESD.cxx
STEER/AliESD.h
STEER/AliESDtest.C

index e7e39a912d8181ecc4564eb5957f82dcb0ada514..4defb6d49634fc9d63a11f5324ad2dd232d88a54 100644 (file)
@@ -38,6 +38,24 @@ AliESD::AliESD():
   fV0s("AliESDv0",200),
   fCascades("AliESDcascade",20)
 {
+  Int_t i;
+  for (i=0; i<3; i++) fVtx[i]=0.;
+  for (i=0; i<6; i++) fCovVtx[i]=0.;
 }
 
+void AliESD::SetVertex(const Double_t *vtx, const Double_t *cvtx) {
+  //Save the primary vertex position
+  Int_t i;
+  for (i=0; i<3; i++) fVtx[i]=vtx[i];
+  if (cvtx)
+  for (i=0; i<6; i++) fCovVtx[i]=cvtx[i];   
+}
+
+void AliESD::GetVertex(Double_t *vtx, Double_t *cvtx) const {
+  //Get the primary vertex position
+  Int_t i;
+  for (i=0; i<3; i++) vtx[i]=fVtx[i];
+  if (cvtx)
+  for (i=0; i<6; i++) cvtx[i]=fCovVtx[i];   
+}
 
index 19df050e99a2c9c2ee8fd169d22a3d3383cee155..2786872fa83847e7ca1a627fc33d30be96272c78 100644 (file)
@@ -34,13 +34,13 @@ public:
 
   void SetEventNumber(Int_t n) {fEventNumber=n;}
 
-  AliESDtrack *GetTrack(Int_t i) {
+  AliESDtrack *GetTrack(Int_t i) const {
     return (AliESDtrack *)fTracks.UncheckedAt(i);
   }
-  AliESDCaloTrack *GetCaloTrack(Int_t i) {
+  AliESDCaloTrack *GetCaloTrack(Int_t i) const {
     return (AliESDCaloTrack *)fCaloTracks.UncheckedAt(i);
   }
-  AliESDMuonTrack *GetMuonTrack(Int_t i) {
+  AliESDMuonTrack *GetMuonTrack(Int_t i) const {
     return (AliESDMuonTrack *)fMuonTracks.UncheckedAt(i);
   }
 
@@ -54,20 +54,23 @@ public:
     new(fMuonTracks[fMuonTracks.GetEntriesFast()]) AliESDMuonTrack(*t);
   }
 
-  AliESDv0 *GetV0(Int_t i) {
+  AliESDv0 *GetV0(Int_t i) const {
     return (AliESDv0 *)fV0s.UncheckedAt(i);
   }
   void AddV0(const AliESDv0 *v) {
     new(fV0s[fV0s.GetEntriesFast()]) AliESDv0(*v);
   }
 
-  AliESDcascade *GetCascade(Int_t i) {
+  AliESDcascade *GetCascade(Int_t i) const {
     return (AliESDcascade *)fCascades.UncheckedAt(i);
   }
   void AddCascade(const AliESDcascade *c) {
     new(fCascades[fCascades.GetEntriesFast()]) AliESDcascade(*c);
   }
 
+  void SetVertex(const Double_t *vtx, const Double_t *cvtx=0);
+  void GetVertex(Double_t *vtx, Double_t *cvtx) const;
+
   Int_t  GetEventNumber() const {return fEventNumber;}
   Int_t  GetRunNumber() const {return fRunNumber;}
   Long_t GetTrigger() const {return fTrigger;}
@@ -86,6 +89,9 @@ protected:
   Long_t       fTrigger;         // Trigger Type
   Int_t        fRecoVersion;     // Version of reconstruction 
 
+  Double_t fVtx[3];              // Primary vertex position
+  Double_t fCovVtx[6];           // Cov. matrix of the primary vertex position
+
   TClonesArray  fTracks;         // ESD tracks
   TClonesArray  fCaloTracks;     // Calorimeters' ESD tracks
   TClonesArray  fMuonTracks;     // MUON ESD tracks
index da6ddf1dc6969590631d43f7074ea87dce105b31..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"
@@ -109,8 +112,6 @@ Int_t AliESDtest(Int_t nev=1) {
 
    //An instance of the ITS tracker
    AliITStrackerV2 itsTracker(geom);
-   {Double_t xyz[]={0.,0.,0.}, ers[]={0.005, 0.005, 0.010};
-   itsTracker.SetVertex(xyz,ers);}
    
    //An instance of the ITS PID maker
    Double_t parITS[]={34.,0.15,10.};
@@ -221,8 +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";
@@ -231,6 +244,7 @@ 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 ITS cluster tree !\n";
@@ -289,6 +303,7 @@ Int_t AliESDtest(Int_t nev=1) {
 
 
 //***** Hyperon reconstruction 
+     vtxer.SetVertex(vtx);
      rc+=vtxer.Tracks2V0vertices(event);            // V0 finding
      rc+=cvtxer.V0sTracks2CascadeVertices(event);   // cascade finding