]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliVertexerTracks.h
Checking if the field map is set and propagating the tracks to the found vertex
[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   AliESDVertex* FindPrimaryVertexOld(const AliESD *esdEvent);
46   void  SetMinTracks(Int_t n=2) { fMinTracks = n; return; }
47   void  SetMinITSClusters(Int_t n=5) { fMinITSClusters = n; return; }
48   void  SetSkipTracks(Int_t n,Int_t *skipped);
49   void SetDebug(Int_t optdebug=0) {fDebug=optdebug;}
50   void  SetVtxStart(Double_t x=0,Double_t y=0,Double_t z=0) 
51     { fNominalPos[0]=x; fNominalPos[1]=y; fNominalPos[2]=z; return; }
52   void  SetVtxStartSigma(Double_t sx=3,Double_t sy=3,Double_t sz=6) 
53     { fNominalSigma[0]=sx; fNominalSigma[1]=sy; fNominalSigma[2]=sz; return; }
54   void  SetVtxStart(AliESDVertex *vtx) 
55     { SetVtxStart(vtx->GetXv(),vtx->GetYv(),vtx->GetZv());
56       SetVtxStartSigma(vtx->GetXRes(),vtx->GetYRes(),vtx->GetZRes()); return; }
57   void  SetDCAcut(Double_t maxdca)
58     { fDCAcut=maxdca; return;}
59   void SetFinderAlgorithm(Int_t opt=1) 
60     { fAlgo=opt; return;}
61   void  SetNSigmad0(Double_t n=3) 
62     { fNSigma=n; return; }
63   static Double_t GetStrLinMinDist(Double_t *p0,Double_t *p1,Double_t *x0);
64   static Double_t GetDeterminant3X3(Double_t matr[][3]);
65   static void GetStrLinDerivMatrix(Double_t *p0,Double_t *p1,Double_t (*m)[3],Double_t *d);
66   static void GetStrLinDerivMatrix(Double_t *p0,Double_t *p1,Double_t *sigmasq,Double_t (*m)[3],Double_t *d);
67
68  protected:
69   Double_t GetField() const { 
70     if(!AliTracker::GetFieldMap())
71       AliFatal("Field map not set; use AliTracker::SetFieldMap()!");
72     return AliTracker::GetBz(); } 
73   Int_t    PrepareTracks(TTree &trkTree, Int_t OptImpParCut);
74   Double_t Sigmad0rphi(Double_t pt) const;
75   void     VertexFinder(Int_t optUseWeights=0);
76   void     HelixVertexFinder();
77   void     StrLinVertexFinderMinDist(Int_t OptUseWeights=0);
78   void     VertexFitter(Bool_t useNominaVtx=kFALSE);
79   void     TooFewTracks(const AliESD *esdEvent);
80
81    
82   AliVertex fVert;         // vertex after vertex finder
83   AliESDVertex *fCurrentVertex;  // ESD vertex after fitter
84   Double_t  fNominalPos[3];   // initial knowledge on vertex position
85   Double_t  fNominalSigma[3]; // initial knowledge on vertex position
86   Int_t     fMinTracks;       // minimum number of tracks
87   Int_t     fMinITSClusters;  // minimum number of ITS clusters per track
88   TObjArray fTrkArray;        // array with tracks to be processed
89   Int_t     *fTrksToSkip;     // tracks to be skipped for find and fit 
90   Int_t     fNTrksToSkip;     // number of tracks to be skipped 
91   Double_t  fDCAcut;          // maximum DCA between 2 tracks used for vertex
92   Int_t     fAlgo;            // option for vertex finding algorythm
93   Double_t  fNSigma;          // number of sigmas for d0 cut in PrepareTracks()
94   Int_t fDebug;               //! debug flag - verbose printing if >0
95   // fAlgo=1 (default) finds minimum-distance point among all selected tracks
96   //         approximated as straight lines 
97   //         and uses errors on track parameters as weights
98   // fAlgo=2 finds minimum-distance point among all the selected tracks
99   //         approximated as straight lines 
100   // fAlgo=3 finds the average point among DCA points of all pairs of tracks
101   //         treated as helices
102   // fAlgo=4 finds the average point among DCA points of all pairs of tracks
103   //         approximated as straight lines 
104   //         and uses errors on track parameters as weights
105   // fAlgo=5 finds the average point among DCA points of all pairs of tracks
106   //         approximated as straight lines 
107
108  private:
109   AliVertexerTracks(const AliVertexerTracks & source);
110   AliVertexerTracks & operator=(const AliVertexerTracks & source);
111
112   ClassDef(AliVertexerTracks,4) // 3D Vertexing with ESD tracks 
113 };
114
115 #endif