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"
29 ClassImp(AliTrackFitter)
31 //_____________________________________________________________________________
32 AliTrackFitter::AliTrackFitter()
34 // default constructor
36 for (Int_t i=0;i<6;i++) fParams[i] = 0;
39 fPVolId = fPTrack = 0;
46 //_____________________________________________________________________________
47 AliTrackFitter::AliTrackFitter(AliTrackPointArray *array, Bool_t owner)
49 // constructor from space points array
51 for (Int_t i=0;i<6;i++) fParams[i] = 0;
52 fCov = new TMatrixDSym(6);
53 fPVolId = fPTrack = 0;
58 SetTrackPointArray(array,owner);
61 //_____________________________________________________________________________
62 AliTrackFitter::AliTrackFitter(const AliTrackFitter &fitter):
67 SetTrackPointArray(fitter.fPoints,fitter.fIsOwner);
68 for (Int_t i=0;i<6;i++) fParams[i] = fitter.fParams[i];
69 fCov = new TMatrixDSym(*fitter.fCov);
72 fMinNPoints = fitter.fMinNPoints;
76 //_____________________________________________________________________________
77 AliTrackFitter &AliTrackFitter::operator =(const AliTrackFitter& fitter)
79 // assignment operator
81 if(this==&fitter) return *this;
83 SetTrackPointArray(fitter.fPoints);
84 for (Int_t i=0;i<6;i++) fParams[i] = fitter.fParams[i];
85 fCov = new TMatrixDSym(*fitter.fCov);
88 fMinNPoints = fitter.fMinNPoints;
94 //_____________________________________________________________________________
95 AliTrackFitter::~AliTrackFitter()
102 //_____________________________________________________________________________
103 void AliTrackFitter::Reset()
105 for (Int_t i=0;i<6;i++) fParams[i] = 0;
107 fCov = new TMatrixDSym(6);
108 fPVolId = fPTrack = 0;
113 void AliTrackFitter::SetTrackPointArray(AliTrackPointArray *array, Bool_t owner)
115 // Load space points from array
116 // By default we don't copy them but
117 // just put the pointers to them
119 AliWarning("Invalid pointer to the space-points array !");
120 if (fIsOwner) delete fPoints;
127 if (fIsOwner) delete fPoints;
130 fPoints = new AliTrackPointArray(*array);
139 Bool_t AliTrackFitter::FindVolId(const TArrayI *array, UShort_t volid) const
141 // The method is used to check whenever
142 // the volume id (volid) is contained in
143 // a array of integers
144 Int_t nVolIds = array->GetSize();
145 if (nVolIds == 0) return kFALSE;
147 Bool_t found = kFALSE;
148 for (Int_t iVolId = 0; iVolId < nVolIds; iVolId++) {
149 if ((*array)[iVolId] == volid) {