]>
Commit | Line | Data |
---|---|---|
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 | //------------------------------------------------------- | |
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 | ||
c5e3e5d1 | 24 | #include "AliESDVertex.h" |
fee9ef0d | 25 | #include "AliESDtrack.h" |
2d57349e | 26 | #include "AliTracker.h" |
ec1be5d5 | 27 | #include "AliLog.h" |
2d57349e | 28 | |
29 | #include <TObjArray.h> | |
fee9ef0d | 30 | #include <TMatrixD.h> |
2d57349e | 31 | |
32 | class TTree; | |
2d57349e | 33 | class AliESD; |
34 | ||
35 | class AliVertexerTracks : public TObject { | |
36 | ||
37 | public: | |
38 | AliVertexerTracks(); | |
39 | AliVertexerTracks(Double_t xStart, Double_t yStart); | |
40 | virtual ~AliVertexerTracks(); | |
41 | ||
ec1be5d5 | 42 | AliESDVertex* FindPrimaryVertex(const AliESD *esdEvent); |
fee9ef0d | 43 | AliESDVertex* VertexForSelectedTracks(TTree *trkTree,Bool_t optUseFitter=kTRUE, Bool_t optPropagate=kTRUE); |
44 | AliESDVertex* VertexForSelectedTracks(TObjArray *trkArray,Bool_t optUseFitter=kTRUE, Bool_t optPropagate=kTRUE); | |
45 | AliESDVertex* RemoveTracksFromVertex(AliESDVertex *inVtx,TTree *trksTree,Float_t *diamondxy); | |
46 | void SetConstraintOff() { fConstraint=kFALSE; return; } | |
47 | void SetConstraintOn() { fConstraint=kTRUE; return; } | |
48 | void SetDebug(Int_t optdebug=0) { fDebug=optdebug; return; } | |
49 | void SetDCAcut(Double_t maxdca) { fDCAcut=maxdca; return; } | |
50 | void SetFinderAlgorithm(Int_t opt=1) { fAlgo=opt; return; } | |
51 | void SetITSRequired() { fITSin=kTRUE; return; } | |
52 | void SetITSrefitRequired() { fITSin=kTRUE;fITSrefit=kTRUE; return; } | |
50ff0bcd | 53 | void SetITSNotRequired() { fITSrefit=kFALSE;fITSin=kFALSE; return; } |
54 | void SetITSrefitNotRequired() { fITSrefit=kFALSE; return; } | |
fee9ef0d | 55 | void SetMaxd0z0(Double_t maxd0z0=0.5) { fMaxd0z0=maxd0z0; return; } |
07680cae | 56 | void SetMinITSClusters(Int_t n=5) { fMinITSClusters = n; return; } |
fee9ef0d | 57 | void SetMinTracks(Int_t n=1) { fMinTracks = n; return; } |
58 | void SetNSigmad0(Double_t n=3) { fNSigma=n; return; } | |
59 | Double_t GetNSigmad0() const { return fNSigma; } | |
60 | void SetOnlyFitter() { if(!fConstraint) AliFatal("Set constraint first!"); | |
61 | fOnlyFitter=kTRUE; return; } | |
ec1be5d5 | 62 | void SetSkipTracks(Int_t n,Int_t *skipped); |
07680cae | 63 | void SetVtxStart(Double_t x=0,Double_t y=0,Double_t z=0) |
64 | { fNominalPos[0]=x; fNominalPos[1]=y; fNominalPos[2]=z; return; } | |
65 | void SetVtxStartSigma(Double_t sx=3,Double_t sy=3,Double_t sz=6) | |
50ff0bcd | 66 | { fNominalCov[0]=sx*sx; fNominalCov[2]=sy*sy; fNominalCov[5]=sz*sz; |
67 | fNominalCov[1]=0.; fNominalCov[3]=0.; fNominalCov[4]=0.; return; } | |
68 | void SetVtxStart(AliESDVertex *vtx); | |
71d84967 | 69 | static Double_t GetStrLinMinDist(Double_t *p0,Double_t *p1,Double_t *x0); |
70 | static Double_t GetDeterminant3X3(Double_t matr[][3]); | |
71 | static void GetStrLinDerivMatrix(Double_t *p0,Double_t *p1,Double_t (*m)[3],Double_t *d); | |
72 | static void GetStrLinDerivMatrix(Double_t *p0,Double_t *p1,Double_t *sigmasq,Double_t (*m)[3],Double_t *d); | |
07680cae | 73 | |
2d57349e | 74 | protected: |
318aecb9 | 75 | Double_t GetField() const { |
76 | if(!AliTracker::GetFieldMap()) | |
77 | AliFatal("Field map not set; use AliTracker::SetFieldMap()!"); | |
78 | return AliTracker::GetBz(); } | |
fee9ef0d | 79 | void HelixVertexFinder(); |
0c69be49 | 80 | void OneTrackVertFinder(); |
fee9ef0d | 81 | Int_t PrepareTracks(TTree &trkTree,Int_t optImpParCut); |
82 | Bool_t TrackToPoint(AliESDtrack *t, | |
83 | TMatrixD &ri,TMatrixD &wWi) const; | |
2d57349e | 84 | void VertexFinder(Int_t optUseWeights=0); |
fee9ef0d | 85 | void VertexFitter(Bool_t useConstraint=kFALSE); |
86 | void StrLinVertexFinderMinDist(Int_t optUseWeights=0); | |
eae1677e | 87 | void TooFewTracks(const AliESD *esdEvent); |
88 | ||
71d84967 | 89 | |
ec1be5d5 | 90 | AliVertex fVert; // vertex after vertex finder |
91 | AliESDVertex *fCurrentVertex; // ESD vertex after fitter | |
07680cae | 92 | Double_t fNominalPos[3]; // initial knowledge on vertex position |
50ff0bcd | 93 | Double_t fNominalCov[6]; // initial knowledge on vertex position |
fee9ef0d | 94 | Bool_t fConstraint; // true when "mean vertex" was set in |
95 | // fNominal ... and must be used in the fit | |
96 | Bool_t fOnlyFitter; // primary with one fitter shot only | |
97 | // (use only with beam constraint) | |
2d57349e | 98 | Int_t fMinTracks; // minimum number of tracks |
07680cae | 99 | Int_t fMinITSClusters; // minimum number of ITS clusters per track |
2d57349e | 100 | TObjArray fTrkArray; // array with tracks to be processed |
ec1be5d5 | 101 | Int_t *fTrksToSkip; // tracks to be skipped for find and fit |
102 | Int_t fNTrksToSkip; // number of tracks to be skipped | |
2d57349e | 103 | Double_t fDCAcut; // maximum DCA between 2 tracks used for vertex |
104 | Int_t fAlgo; // option for vertex finding algorythm | |
07680cae | 105 | Double_t fNSigma; // number of sigmas for d0 cut in PrepareTracks() |
fee9ef0d | 106 | Double_t fMaxd0z0; // value [mm] for sqrt(d0d0+z0z0) cut |
107 | // in PrepareTracks(1) if fConstraint=kFALSE | |
50ff0bcd | 108 | Bool_t fITSin; // if kTRUE (default), use only kITSin tracks |
109 | // if kFALSE, use all tracks (also TPC only) | |
110 | Bool_t fITSrefit; // if kTRUE (default), use only kITSrefit tracks | |
111 | // if kFALSE, use all tracks (also TPC only) | |
112 | Int_t fDebug; //! debug flag - verbose printing if >0 | |
2d57349e | 113 | // fAlgo=1 (default) finds minimum-distance point among all selected tracks |
114 | // approximated as straight lines | |
115 | // and uses errors on track parameters as weights | |
116 | // fAlgo=2 finds minimum-distance point among all the selected tracks | |
117 | // approximated as straight lines | |
118 | // fAlgo=3 finds the average point among DCA points of all pairs of tracks | |
119 | // treated as helices | |
120 | // fAlgo=4 finds the average point among DCA points of all pairs of tracks | |
121 | // approximated as straight lines | |
122 | // and uses errors on track parameters as weights | |
123 | // fAlgo=5 finds the average point among DCA points of all pairs of tracks | |
124 | // approximated as straight lines | |
125 | ||
fe12e09c | 126 | private: |
127 | AliVertexerTracks(const AliVertexerTracks & source); | |
128 | AliVertexerTracks & operator=(const AliVertexerTracks & source); | |
2d57349e | 129 | |
fee9ef0d | 130 | ClassDef(AliVertexerTracks,6) // 3D Vertexing with ESD tracks |
2d57349e | 131 | }; |
132 | ||
133 | #endif |