]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Bug fix in treatment of the vertex finder covariance matrix (Andrea)
authorbelikov <belikov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 May 2007 15:54:33 +0000 (15:54 +0000)
committerbelikov <belikov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 May 2007 15:54:33 +0000 (15:54 +0000)
STEER/AliVertexerTracks.cxx
STEER/AliVertexerTracks.h

index 6d9be749dd5c4aee78931e3bab7f0584c156e7ce..bb4a8c9b601cc915bd83935858da0ad2d67984a2 100644 (file)
@@ -56,12 +56,13 @@ fNSigma(3),
 fMaxd0z0(0.5),
 fITSin(kTRUE),
 fITSrefit(kTRUE),
+fnSigmaForUi00(1.5),
 fDebug(0)
 {
 //
 // Default constructor
 //
-  SetVtxStartPos();
+  SetVtxStart();
   SetVtxStartSigma();
   SetMinTracks();
   SetMinITSClusters();
@@ -87,12 +88,13 @@ fNSigma(3),
 fMaxd0z0(0.5),
 fITSin(kTRUE),
 fITSrefit(kTRUE),
+fnSigmaForUi00(1.5),
 fDebug(0)
 {
 //
 // Standard constructor
 //
-  SetVtxStartPos();
+  SetVtxStart();
   SetVtxStartSigma();
   SetMinTracks();
   SetMinITSClusters();
@@ -233,11 +235,6 @@ AliESDVertex* AliVertexerTracks::FindPrimaryVertex(const AliESD *esdEvent)
   } // end loop on the two iterations
 
 
-  // take true pos from SPD vertex in ESD and write it in tracks' vertex
-  Double_t tp[3];
-  esdEvent->GetVertex()->GetTruePos(tp);
-  fCurrentVertex->SetTruePos(tp);
-
   if(fConstraint) {
     if(fOnlyFitter) {
       fCurrentVertex->SetTitle("VertexerTracksWithConstraintOnlyFitter");
@@ -646,9 +643,6 @@ AliESDVertex* AliVertexerTracks::RemoveTracksFromVertex(AliESDVertex *inVtx,
   // store data in the vertex object
   AliESDVertex *outVtx = new AliESDVertex(position,cov,chi2,nUsedTrks);
   outVtx->SetTitle(inVtx->GetTitle());
-  Double_t tp[3];
-  inVtx->GetTruePos(tp);
-  outVtx->SetTruePos(tp);
   UShort_t *inindices = inVtx->GetIndices();
   UShort_t *outindices = new UShort_t[outVtx->GetNContributors()];
   Int_t j=0;
@@ -906,25 +900,24 @@ Bool_t AliVertexerTracks::TrackToPoint(AliESDtrack *t,
     t->GetPxPyPz(p);
     pt = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
     ptot = TMath::Sqrt(pt*pt+p[2]*p[2]);
-    Double_t cp = p[0]/pt;               //cos(phi)=px/pt
-    Double_t sp = p[1]/pt;               //sin(phi)=py/pt
-    Double_t ct = p[2]/ptot;             //cos(theta)=pz/ptot
-    Double_t st = TMath::Sqrt(1.-ct*ct); //sin(theta)
+    Double_t cphi = p[0]/pt;               //cos(phi)=px/pt
+    Double_t sphi = p[1]/pt;               //sin(phi)=py/pt
+    Double_t clambda = pt/ptot;            //cos(lambda)=pt/ptot
+    Double_t slambda = p[2]/ptot;            //sin(lambda)=pz/ptot
     Double_t covfVert[6];
     fVert.GetCovMatrix(covfVert);
     Double_t covfVertalongt = 
-       covfVert[0]*cp*cp*ct*ct 
-      +covfVert[1]*2.*cp*sp*ct*ct
-      +covfVert[3]*2.*cp*ct*st 
-      +covfVert[2]*sp*sp*ct*ct 
-      +covfVert[4]*2.*sp*ct*st 
-      +covfVert[5]*st*st
+       covfVert[0]*cphi*cphi*clambda*clambda 
+      +covfVert[1]*2.*cphi*sphi*clambda*clambda
+      +covfVert[3]*2.*cphi*clambda*slambda 
+      +covfVert[2]*sphi*sphi*clambda*clambda 
+      +covfVert[4]*2.*sphi*clambda*slambda 
+      +covfVert[5]*slambda*slambda
     Double_t cc[15];
     t->GetExternalCovariance(cc);
     // covariance matrix of local (x,y,z) - inverted
     TMatrixD uUi(3,3);
-    Double_t nSigma = 2.;
-    uUi(0,0) = covfVertalongt * nSigma * nSigma;
+    uUi(0,0) = covfVertalongt * fnSigmaForUi00 * fnSigmaForUi00;
     if(fDebug) printf("=====> sqrtUi00 cm  %f\n",TMath::Sqrt(uUi(0,0)));
     uUi(0,1) = 0.;
     uUi(0,2) = 0.;
@@ -978,9 +971,6 @@ void AliVertexerTracks::TooFewTracks(const AliESD* esdEvent)
   fCurrentVertex = new AliESDVertex(pos,err);
   fCurrentVertex->SetNContributors(ncontr);
 
-  Double_t tp[3];
-  esdEvent->GetVertex()->GetTruePos(tp);
-  fCurrentVertex->SetTruePos(tp);
   if(fConstraint) {
     fCurrentVertex->SetTitle("VertexerTracksWithConstraint");
   } else {
@@ -1112,7 +1102,7 @@ void AliVertexerTracks::VertexFitter(Bool_t useConstraint)
     printf("--- VertexFitter(): start\n");
     printf(" Number of tracks in array: %d\n",nTrks);
     printf(" Minimum # tracks required in fit: %d\n",fMinTracks);
-    if(!fOnlyFitter) printf(" Vertex position after finder: %f,%f,%f\n",initPos[0],initPos[1],initPos[2]);
+    printf(" Vertex position after finder: %f,%f,%f\n",initPos[0],initPos[1],initPos[2]);
     if(useConstraint) printf(" This vertex will be used in fit: (%f+-%f,%f+-%f)\n",fNominalPos[0],TMath::Sqrt(fNominalCov[0]),fNominalPos[1],TMath::Sqrt(fNominalCov[2])); 
   }
 
@@ -1299,6 +1289,7 @@ AliESDVertex* AliVertexerTracks::VertexForSelectedTracks(TTree *trkTree,Bool_t o
 
   // vertex fitter
   if(optUseFitter){
+    //SetVtxStart(&fVert);
     VertexFitter(fConstraint);
     if(fDebug) printf(" Vertex fit completed\n");
   }else{
index 32130e20df84ff101883275d104e94359cfcecd0..72d91d20ca7cf2091f346ab3ec6478c4707237f7 100644 (file)
@@ -59,7 +59,7 @@ class AliVertexerTracks : public TObject {
   void  SetOnlyFitter() { if(!fConstraint) AliFatal("Set constraint first!"); 
      fOnlyFitter=kTRUE; return; }
   void  SetSkipTracks(Int_t n,Int_t *skipped);
-  void  SetVtxStartPos(Double_t x=0,Double_t y=0,Double_t z=0) 
+  void  SetVtxStart(Double_t x=0,Double_t y=0,Double_t z=0) 
     { fNominalPos[0]=x; fNominalPos[1]=y; fNominalPos[2]=z; return; }
   void  SetVtxStartSigma(Double_t sx=3.,Double_t sy=3.,Double_t sz=15.) 
     { fNominalCov[0]=sx*sx; fNominalCov[2]=sy*sy; fNominalCov[5]=sz*sz;
@@ -74,6 +74,8 @@ class AliVertexerTracks : public TObject {
   Double_t GetFieldkG() const { 
     if(fFieldkG<-99.) AliFatal("Field value not set");
     return fFieldkG; } 
+  void SetNSigmaForUi00(Double_t n=1.5) { fnSigmaForUi00=n; return; }
+  Double_t GetNSigmaForUi00() const { return fnSigmaForUi00; }
 
  protected:
   void     HelixVertexFinder();
@@ -110,6 +112,7 @@ class AliVertexerTracks : public TObject {
                               // if kFALSE, use all tracks (also TPC only)
   Bool_t    fITSrefit;        // if kTRUE (default), use only kITSrefit tracks
                               // if kFALSE, use all tracks (also TPC only)
+  Double_t  fnSigmaForUi00;   // n. sigmas from finder in TrackToPoint
   Int_t     fDebug;           //! debug flag - verbose printing if >0
   // fAlgo=1 (default) finds minimum-distance point among all selected tracks
   //         approximated as straight lines 
@@ -124,11 +127,12 @@ class AliVertexerTracks : public TObject {
   // fAlgo=5 finds the average point among DCA points of all pairs of tracks
   //         approximated as straight lines 
 
+
  private:
   AliVertexerTracks(const AliVertexerTracks & source);
   AliVertexerTracks & operator=(const AliVertexerTracks & source);
 
-  ClassDef(AliVertexerTracks,8) // 3D Vertexing with ESD tracks 
+  ClassDef(AliVertexerTracks,9) // 3D Vertexing with ESD tracks 
 };
 
 #endif