]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliVertexerTracks.h
New version of AliVertexerTracks (F.Prino)
[u/mrichter/AliRoot.git] / STEER / AliVertexerTracks.h
1 #ifndef ALIVERTEXERTRACKS_H
2 #define ALIVERTEXERTRACKS_H
3 /* Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6
7 //-------------------------------------------------------
8 // Class for vertex determination with ESD tracks
9 //
10 //   Origin: AliITSVertexerTracks  
11 //           A.Dainese, Padova, andrea.dainese@pd.infn.it
12 //           M.Masera,  Torino, massimo.masera@to.infn.it 
13 //   Moved to STEER and adapted to ESD tracks: 
14 //           F.Prino, Torino, prino@to.infn.it 
15 //-------------------------------------------------------
16
17 /*****************************************************************************
18  *                                                                           *
19  * This class determines the vertex of a set of ESD tracks.                  *
20  * Different algorithms are implemented, see data member fAlgo.              *
21  *                                                                           *
22  *****************************************************************************/
23
24 #include "AliESDVertex.h"
25 #include "AliTracker.h"
26 #include "AliLog.h"
27
28 #include <TObjArray.h>
29
30 class TTree; 
31 class AliESD;
32
33 class AliVertexerTracks : public TObject {
34   
35  public:
36   AliVertexerTracks(); 
37   AliVertexerTracks(Double_t xStart, Double_t yStart); 
38   virtual ~AliVertexerTracks();
39
40
41   // computes the vertex from the set of tracks in the tree
42   AliVertex* VertexForSelectedTracks(TTree *trkTree);
43   AliVertex* VertexForSelectedTracks(TObjArray *trkArray);
44   AliESDVertex* FindPrimaryVertex(const AliESD *esdEvent);
45   void  SetMinTracks(Int_t n=2) { fMinTracks = n; return; }
46   void  SetSkipTracks(Int_t n,Int_t *skipped);
47   void SetDebug(Int_t optdebug=0) {fDebug=optdebug;}
48   void  SetVtxStart(Double_t x=0,Double_t y=0) 
49     { fNominalPos[0]=x; fNominalPos[1]=y; return; }
50   void  SetDCAcut(Double_t maxdca)
51     { fDCAcut=maxdca; return;}
52   void SetFinderAlgorithm(Int_t opt=1) 
53     { fAlgo=opt; return;}
54   
55  protected:
56   Double_t   GetField() const { return AliTracker::GetBz();} 
57   void     ComputeMaxChi2PerTrack(Int_t nTracks);
58   Int_t PrepareTracks(TTree &trkTree, Int_t OptImpParCut);
59   void     VertexFinder(Int_t optUseWeights=0);
60   void     HelixVertexFinder();
61   void     StrLinVertexFinderMinDist(Int_t OptUseWeights=0);
62   static void GetStrLinDerivMatrix(Double_t *p0,Double_t *p1,Double_t m[][3],Double_t *d);
63   static void GetStrLinDerivMatrix(Double_t *p0,Double_t *p1,Double_t *sigmasq,Double_t m[][3],Double_t *d);
64   static Double_t GetStrLinMinDist(Double_t *p0,Double_t *p1,Double_t *x0);
65   static Double_t GetDeterminant3X3(Double_t matr[][3]);
66   void     VertexFitter();
67
68   AliVertex fVert;         // vertex after vertex finder
69   AliESDVertex *fCurrentVertex;  // ESD vertex after fitter
70   Double_t  fNominalPos[2];   // initial knowledge on vertex position
71   Int_t     fMinTracks;       // minimum number of tracks
72   Double_t  fMaxChi2PerTrack; // maximum contribition to the chi2 
73   TObjArray fTrkArray;        // array with tracks to be processed
74   Int_t     *fTrksToSkip;     // tracks to be skipped for find and fit 
75   Int_t     fNTrksToSkip;     // number of tracks to be skipped 
76   Double_t  fDCAcut;          // maximum DCA between 2 tracks used for vertex
77   Int_t     fAlgo;            // option for vertex finding algorythm
78   Int_t fDebug;               //! debug flag - verbose printing if >0
79   // fAlgo=1 (default) finds minimum-distance point among all selected tracks
80   //         approximated as straight lines 
81   //         and uses errors on track parameters as weights
82   // fAlgo=2 finds minimum-distance point among all the selected tracks
83   //         approximated as straight lines 
84   // fAlgo=3 finds the average point among DCA points of all pairs of tracks
85   //         treated as helices
86   // fAlgo=4 finds the average point among DCA points of all pairs of tracks
87   //         approximated as straight lines 
88   //         and uses errors on track parameters as weights
89   // fAlgo=5 finds the average point among DCA points of all pairs of tracks
90   //         approximated as straight lines 
91
92
93   ClassDef(AliVertexerTracks,3) // 3D Vertexing with ESD tracks 
94 };
95
96 #endif
97
98
99