]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSVertexerTracks.h
merging RecPoints and ClustersV2. All ClusterFinders produce AliITSRecPoints objects...
[u/mrichter/AliRoot.git] / ITS / AliITSVertexerTracks.h
CommitLineData
cab6ff9b 1#ifndef ALIITSVERTEXERTRACKS_H
2#define ALIITSVERTEXERTRACKS_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 primary vertex determination with ITS tracks
9//
10// Origin: A.Dainese, Padova, andrea.dainese@pd.infn.it
11// M.Masera, Torino, massimo.masera@to.infn.it
12//-------------------------------------------------------
13
14/*****************************************************************************
15 * *
16 * This class determines the primary vertex position using ITS tracks. *
17 * This is done in two steps: *
18 * 1) Vertex Finding: a reasonable estimate of the vertex position is *
19 * obtained from a mean of "points of closest approach" between all *
20 * possible pairs of tracks. *
21 * 2) Vertex Fitting: once tracks are propagated to the position given by *
22 * first step, the optimal estimate of the position of vertex is obtained *
23 * from a weighted average of the track positions. A covariance *
24 * matrix and a chi2 for the vertex are given. *
25 * *
26 *****************************************************************************/
cab6ff9b 27#include "AliITSVertexer.h"
66e811e2 28#include "AliITSSimpleVertex.h"
cab6ff9b 29
3a4956bf 30#include <TObjArray.h>
31
cab6ff9b 32class TTree;
d681bb2d 33class AliESDVertex;
66e811e2 34class AliITSSimpleVertex;
a48d1ed3 35class AliESD;
66e811e2 36class AliITStrackV2;
cab6ff9b 37
38class AliITSVertexerTracks : public AliITSVertexer {
39
40 public:
41 // default constructor
7d0f8548 42 AliITSVertexerTracks();
cab6ff9b 43 // standard constructor
11ba84a4 44 AliITSVertexerTracks(TFile *inFile,TFile *outFile,
7d0f8548 45 Int_t fEv=0,Int_t lEv=0,
11ba84a4 46 Double_t xStart=0.,Double_t yStart=0.);
47 // alternative constructor
7d0f8548 48 AliITSVertexerTracks(TString fn,Double_t xStart=0,Double_t yStart=0);
cab6ff9b 49 // destructor
a48d1ed3 50 virtual ~AliITSVertexerTracks();
cab6ff9b 51 // return vertex from the set of tracks in the tree
d681bb2d 52 AliESDVertex* VertexOnTheFly(TTree &trkTree);
cab6ff9b 53 // computes the vertex for the current event
66e811e2 54 virtual AliESDVertex* FindPrimaryVertexForCurrentEvent(Int_t evnumb);
55 virtual AliESDVertex* FindVertexForCurrentEvent(Int_t evnumb){
56 Warning(" FindVertexForCurrentEvent","Deprecated method use FindPrimaryVertexForCurrentEvent instead");
57 return FindPrimaryVertexForCurrentEvent(evnumb);
58 }
11ba84a4 59 // computes the vertex for the current event using the ESD
66e811e2 60 AliESDVertex* FindPrimaryVertexForCurrentEvent(AliESD *esdEvent);
61 AliESDVertex* FindVertexForCurrentEvent(AliESD *esdEvent){
62 Warning(" FindVertexForCurrentEvent","Deprecated method use FindPrimaryVertexForCurrentEvent instead");
63 return FindPrimaryVertexForCurrentEvent(esdEvent);
64 }
88cb7938 65 // computes the vertex for each event and stores it on file
cab6ff9b 66 virtual void FindVertices();
11ba84a4 67 // computes the vertex for each event and stores it in the ESD
68 void FindVerticesESD();
66e811e2 69
70 // computes the vertex for selected tracks
71 // (TrkPos=vector with track positions in ESD)
72 AliITSSimpleVertex* VertexForSelectedTracks(AliESD *esdEvent,Int_t nofCand, Int_t *trkPos, Int_t opt=1);
73 // opt=1 (default) finds minimum-distance point among all the selected tracks
74 // approximated as straight lines
75 // and uses errors on track parameters as weights
76 // opt=2 finds minimum-distance point among all the selected tracks
77 // approximated as straight lines
78 // opt=3 finds the average point among DCA points of all pairs of tracks
79 // treated as helices
80 // opt=4 finds the average point among DCA points of all pairs of tracks
81 // approximated as straight lines
82 // and uses errors on track parameters as weights
83 // opt=5 finds the average point among DCA points of all pairs of tracks
84 // approximated as straight lines
85
86
cab6ff9b 87 virtual void PrintStatus() const;
11ba84a4 88 void SetMinTracks(Int_t n=2) { fMinTracks = n; return; }
89 void SetSkipTracks(Int_t n,Int_t *skipped);
cab6ff9b 90 void SetVtxStart(Double_t x=0,Double_t y=0)
91 { fNominalPos[0]=x; fNominalPos[1]=y; return; }
66e811e2 92 void SetDCAcut(Double_t maxdca)
93 { fDCAcut=maxdca; return;}
cab6ff9b 94
95 private:
a48d1ed3 96 // copy constructor (NO copy allowed: the constructor is protected
97 // to avoid misuse)
98 AliITSVertexerTracks(const AliITSVertexerTracks& vtxr);
99 // assignment operator (NO assignment allowed)
100 AliITSVertexerTracks& operator=(const AliITSVertexerTracks& /* vtxr */);
11ba84a4 101 TFile *fInFile; // input file (with tracks)
102 TFile *fOutFile; // output file for vertices
66e811e2 103 AliITSSimpleVertex fSimpVert; // vertex after vertex finder
cab6ff9b 104 Double_t fNominalPos[2]; // initial knowledge on vertex position
105 Int_t fMinTracks; // minimum number of tracks
66e811e2 106 Double_t fDCAcut; // maximum DCA between 2 tracks used for vertex
cab6ff9b 107 Double_t fMaxChi2PerTrack; // maximum contribition to the chi2
cab6ff9b 108 TObjArray fTrkArray; // array with tracks to be processed
109 Int_t *fTrksToSkip; // tracks to be skipped for find and fit
110 Int_t fNTrksToSkip; // number of tracks to be skipped
111
112 Bool_t CheckField() const;
113 void ComputeMaxChi2PerTrack(Int_t nTracks);
114 Int_t PrepareTracks(TTree &trkTree);
66e811e2 115 Int_t PrepareTracks(AliESD* esdEvent,Int_t NofCand, Int_t *TrkPos);
116 Double_t Prepare(AliITStrackV2* itstrack);
cab6ff9b 117 void TooFewTracks();
66e811e2 118 void VertexFinder(Int_t OptUseWeights=0);
119 void HelixVertexFinder();
120 void StrLinVertexFinderMinDist(Int_t OptUseWeights=0);
121 static void GetStrLinDerivMatrix(Double_t *p0,Double_t *p1,Double_t m[][3],Double_t *d);
122 static void GetStrLinDerivMatrix(Double_t *p0,Double_t *p1,Double_t *sigmasq,Double_t m[][3],Double_t *d);
123 static Double_t GetStrLinMinDist(Double_t *p0,Double_t *p1,Double_t *x0);
124 static Double_t GetDeterminant3X3(Double_t matr[][3]);
125
cab6ff9b 126 void VertexFitter();
127
128 ClassDef(AliITSVertexerTracks,1) // 3D Vertexing with ITS tracks
129};
130
131#endif
132
133
134