]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliVertexerTracks.h
Coding convention fixes
[u/mrichter/AliRoot.git] / STEER / AliVertexerTracks.h
CommitLineData
2d57349e 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//-------------------------------------------------------
6d8df534 8// Class for vertex determination with tracks
2d57349e 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 * *
6d8df534 19 * This class determines the vertex of a set of tracks. *
2d57349e 20 * Different algorithms are implemented, see data member fAlgo. *
21 * *
22 *****************************************************************************/
23
2d57349e 24#include <TObjArray.h>
25
6d8df534 26#include "AliLog.h"
f5740e9a 27#include "AliESDVertex.h"
6d8df534 28
f5740e9a 29class AliExternalTrackParam;
0aa2faf4 30class AliVEvent;
8e104736 31class AliStrLine;
2d57349e 32
33class AliVertexerTracks : public TObject {
34
35 public:
36 AliVertexerTracks();
dc3719f3 37 AliVertexerTracks(Double_t fieldkG);
2d57349e 38 virtual ~AliVertexerTracks();
39
f5740e9a 40 AliESDVertex* FindPrimaryVertex(const AliVEvent *vEvent);
41 AliESDVertex* FindPrimaryVertex(const TObjArray *trkArrayOrig,UShort_t *idOrig);
42 AliESDVertex* VertexForSelectedTracks(const TObjArray *trkArray,UShort_t *id,
6d8df534 43 Bool_t optUseFitter=kTRUE,
97669588 44 Bool_t optPropagate=kTRUE,
45 Bool_t optUseDiamondConstraint=kFALSE);
6d8df534 46 AliESDVertex* VertexForSelectedESDTracks(TObjArray *trkArray,
47 Bool_t optUseFitter=kTRUE,
97669588 48 Bool_t optPropagate=kTRUE,
49 Bool_t optUseDiamondConstraint=kFALSE);
6d8df534 50 AliESDVertex* RemoveTracksFromVertex(AliESDVertex *inVtx,
f5740e9a 51 const TObjArray *trkArray,UShort_t *id,
52 const Float_t *diamondxy) const;
6b908072 53 AliESDVertex* RemoveConstraintFromVertex(AliESDVertex *inVtx,
54 Float_t *diamondxyz,
55 Float_t *diamondcov) const;
a00021a7 56 void SetITSMode(Double_t dcacut=0.1,
57 Double_t dcacutIter0=0.1,
58 Double_t maxd0z0=0.5,
59 Int_t minCls=5,
60 Int_t mintrks=1,
61 Double_t nsigma=3.,
62 Double_t mindetfitter=100.,
63 Double_t maxtgl=1000.,
64 Double_t fidR=3.,
8c75f668 65 Double_t fidZ=30.,
66 Int_t finderAlgo=1,
67 Int_t finderAlgoIter0=4);
a00021a7 68 void SetTPCMode(Double_t dcacut=0.1,
69 Double_t dcacutIter0=1.0,
70 Double_t maxd0z0=5.0,
71 Int_t minCls=10,
72 Int_t mintrks=1,
73 Double_t nsigma=3.,
74 Double_t mindetfitter=0.1,
75 Double_t maxtgl=1.5,
76 Double_t fidR=3.,
8c75f668 77 Double_t fidZ=30.,
78 Int_t finderAlgo=1,
79 Int_t finderAlgoIter0=4);
a00021a7 80 void SetCuts(Double_t *cuts);
fee9ef0d 81 void SetConstraintOff() { fConstraint=kFALSE; return; }
82 void SetConstraintOn() { fConstraint=kTRUE; return; }
fee9ef0d 83 void SetDCAcut(Double_t maxdca) { fDCAcut=maxdca; return; }
f09c879d 84 void SetDCAcutIter0(Double_t maxdca) { fDCAcutIter0=maxdca; return; }
fee9ef0d 85 void SetFinderAlgorithm(Int_t opt=1) { fAlgo=opt; return; }
6d8df534 86 void SetITSrefitRequired() { fITSrefit=kTRUE; return; }
40cfa14d 87 void SetITSpureSA() { fITSpureSA=kTRUE; return; }
0aa2faf4 88 Bool_t GetITSrefitRequired() const { return fITSrefit; }
50ff0bcd 89 void SetITSrefitNotRequired() { fITSrefit=kFALSE; return; }
6b29d399 90 void SetFiducialRZ(Double_t r=3,Double_t z=30) { fFiducialR=r; fFiducialZ=z; return; }
fee9ef0d 91 void SetMaxd0z0(Double_t maxd0z0=0.5) { fMaxd0z0=maxd0z0; return; }
6b29d399 92 void SetMinClusters(Int_t n=5) { fMinClusters=n; return; }
0aa2faf4 93 Int_t GetMinClusters() const { return fMinClusters; }
6d8df534 94 void SetMinTracks(Int_t n=1) { fMinTracks=n; return; }
fee9ef0d 95 void SetNSigmad0(Double_t n=3) { fNSigma=n; return; }
96 Double_t GetNSigmad0() const { return fNSigma; }
f09c879d 97 void SetMinDetFitter(Double_t mindet=100.) { fMinDetFitter=mindet; return; }
98 void SetMaxTgl(Double_t maxtgl=1.) { fMaxTgl=maxtgl; return; }
fee9ef0d 99 void SetOnlyFitter() { if(!fConstraint) AliFatal("Set constraint first!");
100 fOnlyFitter=kTRUE; return; }
f5740e9a 101 void SetSkipTracks(Int_t n,const Int_t *skipped);
3b768a1d 102 void SetVtxStart(Double_t x=0,Double_t y=0,Double_t z=0)
07680cae 103 { fNominalPos[0]=x; fNominalPos[1]=y; fNominalPos[2]=z; return; }
146c29df 104 void SetVtxStartSigma(Double_t sx=3.,Double_t sy=3.,Double_t sz=15.)
50ff0bcd 105 { fNominalCov[0]=sx*sx; fNominalCov[2]=sy*sy; fNominalCov[5]=sz*sz;
106 fNominalCov[1]=0.; fNominalCov[3]=0.; fNominalCov[4]=0.; return; }
107 void SetVtxStart(AliESDVertex *vtx);
f5740e9a 108 static Double_t GetStrLinMinDist(const Double_t *p0,const Double_t *p1,const Double_t *x0);
71d84967 109 static Double_t GetDeterminant3X3(Double_t matr[][3]);
f5740e9a 110 static void GetStrLinDerivMatrix(const Double_t *p0,Double_t *p1,Double_t (*m)[3],Double_t *d);
111 static void GetStrLinDerivMatrix(const Double_t *p0,const Double_t *p1,const Double_t *sigmasq,Double_t (*m)[3],Double_t *d);
112 static AliESDVertex TrackletVertexFinder(const TClonesArray *lines, Int_t optUseWeights=0);
8e104736 113 static AliESDVertex TrackletVertexFinder(AliStrLine **lines, const Int_t knacc, Int_t optUseWeights=0);
dc3719f3 114 void SetFieldkG(Double_t field=-999.) { fFieldkG=field; return; }
115 Double_t GetFieldkG() const {
116 if(fFieldkG<-99.) AliFatal("Field value not set");
117 return fFieldkG; }
3b768a1d 118 void SetNSigmaForUi00(Double_t n=1.5) { fnSigmaForUi00=n; return; }
119 Double_t GetNSigmaForUi00() const { return fnSigmaForUi00; }
07680cae 120
2d57349e 121 protected:
fee9ef0d 122 void HelixVertexFinder();
0c69be49 123 void OneTrackVertFinder();
f5740e9a 124 Int_t PrepareTracks(const TObjArray &trkArrayOrig,const UShort_t *idOrig,
6d8df534 125 Int_t optImpParCut);
f09c879d 126 Bool_t PropagateTrackTo(AliExternalTrackParam *track,
127 Double_t xToGo);
6d8df534 128 Bool_t TrackToPoint(AliExternalTrackParam *t,
f5740e9a 129 const TMatrixD &ri,TMatrixD &wWi,
0bf2e2b4 130 Bool_t uUi3by3=kFALSE) const;
2d57349e 131 void VertexFinder(Int_t optUseWeights=0);
6d8df534 132 void VertexFitter();
fee9ef0d 133 void StrLinVertexFinderMinDist(Int_t optUseWeights=0);
6d8df534 134 void TooFewTracks();
eae1677e 135
146c29df 136 AliESDVertex fVert; // vertex after vertex finder
ec1be5d5 137 AliESDVertex *fCurrentVertex; // ESD vertex after fitter
f09c879d 138 UShort_t fMode; // 0 ITS+TPC; 1 TPC
dc3719f3 139 Double_t fFieldkG; // z component of field (kGauss)
07680cae 140 Double_t fNominalPos[3]; // initial knowledge on vertex position
50ff0bcd 141 Double_t fNominalCov[6]; // initial knowledge on vertex position
f09c879d 142 TObjArray fTrkArraySel; // array with tracks to be processed
143 UShort_t *fIdSel; // IDs of the tracks (AliESDtrack::GetID())
144 Int_t *fTrksToSkip; // track IDs to be skipped for find and fit
145 Int_t fNTrksToSkip; // number of tracks to be skipped
fee9ef0d 146 Bool_t fConstraint; // true when "mean vertex" was set in
147 // fNominal ... and must be used in the fit
148 Bool_t fOnlyFitter; // primary with one fitter shot only
149 // (use only with beam constraint)
2d57349e 150 Int_t fMinTracks; // minimum number of tracks
6b29d399 151 Int_t fMinClusters; // minimum number of ITS or TPC clusters per track
2d57349e 152 Double_t fDCAcut; // maximum DCA between 2 tracks used for vertex
f09c879d 153 Double_t fDCAcutIter0; // maximum DCA between 2 tracks used for vertex
07680cae 154 Double_t fNSigma; // number of sigmas for d0 cut in PrepareTracks()
43c9dae1 155 Double_t fMaxd0z0; // value for sqrt(d0d0+z0z0) cut
fee9ef0d 156 // in PrepareTracks(1) if fConstraint=kFALSE
f09c879d 157 Double_t fMinDetFitter; // minimum determinant to try to invertex matrix
158 Double_t fMaxTgl; // maximum tgl of tracks
50ff0bcd 159 Bool_t fITSrefit; // if kTRUE (default), use only kITSrefit tracks
160 // if kFALSE, use all tracks (also TPC only)
40cfa14d 161 Bool_t fITSpureSA; // if kFALSE (default) skip ITSpureSA tracks
162 // if kTRUE use only those
6b29d399 163 Double_t fFiducialR; // radius of fiducial cylinder for tracks
164 Double_t fFiducialZ; // length of fiducial cylinder for tracks
3b768a1d 165 Double_t fnSigmaForUi00; // n. sigmas from finder in TrackToPoint
f09c879d 166 Int_t fAlgo; // option for vertex finding algorythm
8c75f668 167 Int_t fAlgoIter0; // this is for iteration 0
2d57349e 168 // fAlgo=1 (default) finds minimum-distance point among all selected tracks
169 // approximated as straight lines
170 // and uses errors on track parameters as weights
171 // fAlgo=2 finds minimum-distance point among all the selected tracks
172 // approximated as straight lines
173 // fAlgo=3 finds the average point among DCA points of all pairs of tracks
174 // treated as helices
175 // fAlgo=4 finds the average point among DCA points of all pairs of tracks
176 // approximated as straight lines
177 // and uses errors on track parameters as weights
178 // fAlgo=5 finds the average point among DCA points of all pairs of tracks
179 // approximated as straight lines
180
3b768a1d 181
fe12e09c 182 private:
183 AliVertexerTracks(const AliVertexerTracks & source);
184 AliVertexerTracks & operator=(const AliVertexerTracks & source);
2d57349e 185
40cfa14d 186 ClassDef(AliVertexerTracks,14) // 3D Vertexing with tracks
2d57349e 187};
188
189#endif
43c9dae1 190