1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 //-----------------------------------------------------------------
17 // Implementation of the base class for fast track fitters
20 //-----------------------------------------------------------------
22 #include <TMatrixDSym.h>
25 #include "AliTrackFitter.h"
26 #include "AliTrackPointArray.h"
28 ClassImp(AliTrackFitter)
30 //_____________________________________________________________________________
31 AliTrackFitter::AliTrackFitter()
33 // default constructor
35 for (Int_t i=0;i<6;i++) fParams[i] = 0;
38 fPVolId = fPTrack = 0;
45 //_____________________________________________________________________________
46 AliTrackFitter::AliTrackFitter(AliTrackPointArray *array, Bool_t owner)
48 // constructor from space points array
50 for (Int_t i=0;i<6;i++) fParams[i] = 0;
51 fCov = new TMatrixDSym(6);
52 fPVolId = fPTrack = 0;
57 SetTrackPointArray(array,owner);
60 //_____________________________________________________________________________
61 AliTrackFitter::AliTrackFitter(const AliTrackFitter &fitter):
66 SetTrackPointArray(fitter.fPoints,fitter.fIsOwner);
67 for (Int_t i=0;i<6;i++) fParams[i] = fitter.fParams[i];
68 fCov = new TMatrixDSym(*fitter.fCov);
71 fMinNPoints = fitter.fMinNPoints;
75 //_____________________________________________________________________________
76 AliTrackFitter &AliTrackFitter::operator =(const AliTrackFitter& fitter)
78 // assignment operator
80 if(this==&fitter) return *this;
82 SetTrackPointArray(fitter.fPoints);
83 for (Int_t i=0;i<6;i++) fParams[i] = fitter.fParams[i];
84 fCov = new TMatrixDSym(*fitter.fCov);
87 fMinNPoints = fitter.fMinNPoints;
93 //_____________________________________________________________________________
94 AliTrackFitter::~AliTrackFitter()
101 //_____________________________________________________________________________
102 void AliTrackFitter::Reset()
104 for (Int_t i=0;i<6;i++) fParams[i] = 0;
106 fCov = new TMatrixDSym(6);
107 fPVolId = fPTrack = 0;
112 void AliTrackFitter::SetTrackPointArray(AliTrackPointArray *array, Bool_t owner)
114 // Load space points from array
115 // By default we don't copy them but
116 // just put the pointers to them
119 if (fIsOwner) delete fPoints;
122 fPoints = new AliTrackPointArray(*array);
131 Bool_t AliTrackFitter::FindVolId(const TArrayI *array, UShort_t volid) const
133 // The method is used to check whenever
134 // the volume id (volid) is contained in
135 // a array of integers
136 Int_t nVolIds = array->GetSize();
137 if (nVolIds == 0) return kFALSE;
139 Bool_t found = kFALSE;
140 for (Int_t iVolId = 0; iVolId < nVolIds; iVolId++) {
141 if ((*array)[iVolId] == volid) {