]>
Commit | Line | Data |
---|---|---|
98937d93 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
16 | //----------------------------------------------------------------- | |
17 | // Implementation of the base class for fast track fitters | |
18 | // | |
19 | // | |
20 | //----------------------------------------------------------------- | |
21 | ||
22 | #include <TMatrixDSym.h> | |
23 | ||
24 | #include "AliTrackFitter.h" | |
25 | #include "AliTrackPointArray.h" | |
26 | ||
27 | ClassImp(AliTrackFitter) | |
28 | ||
29 | //_____________________________________________________________________________ | |
30 | AliTrackFitter::AliTrackFitter() | |
31 | { | |
32 | // default constructor | |
33 | // | |
34 | for (Int_t i=0;i<6;i++) fParams[i] = 0; | |
35 | fCov = 0; | |
36 | fPoints = 0; | |
37 | fIsOwner = kFALSE; | |
38 | } | |
39 | ||
40 | //_____________________________________________________________________________ | |
41 | AliTrackFitter::AliTrackFitter(AliTrackPointArray *array, Bool_t owner) | |
42 | { | |
43 | // constructor from space points array | |
44 | // | |
45 | for (Int_t i=0;i<6;i++) fParams[i] = 0; | |
46 | fCov = new TMatrixDSym(6); | |
47 | fIsOwner = kFALSE; | |
48 | SetTrackPointArray(array,owner); | |
49 | } | |
50 | ||
51 | //_____________________________________________________________________________ | |
52 | AliTrackFitter::AliTrackFitter(const AliTrackFitter &fitter): | |
53 | TObject(fitter) | |
54 | { | |
55 | // Copy constructor | |
56 | // | |
57 | for (Int_t i=0;i<6;i++) fParams[i] = fitter.fParams[i]; | |
58 | fCov = new TMatrixDSym(*fitter.fCov); | |
59 | fIsOwner = kFALSE; | |
60 | SetTrackPointArray(fitter.fPoints,fitter.fIsOwner); | |
61 | } | |
62 | ||
63 | //_____________________________________________________________________________ | |
64 | AliTrackFitter &AliTrackFitter::operator =(const AliTrackFitter& fitter) | |
65 | { | |
66 | // assignment operator | |
67 | // | |
68 | if(this==&fitter) return *this; | |
69 | ||
70 | for (Int_t i=0;i<6;i++) fParams[i] = fitter.fParams[i]; | |
71 | fCov = new TMatrixDSym(*fitter.fCov); | |
72 | fIsOwner = kFALSE; | |
73 | SetTrackPointArray(fitter.fPoints); | |
74 | ||
75 | return *this; | |
76 | } | |
77 | ||
78 | //_____________________________________________________________________________ | |
79 | AliTrackFitter::~AliTrackFitter() | |
80 | { | |
81 | if (fIsOwner) | |
82 | delete fPoints; | |
83 | delete fCov; | |
84 | } | |
85 | ||
86 | //_____________________________________________________________________________ | |
87 | void AliTrackFitter::Reset() | |
88 | { | |
89 | for (Int_t i=0;i<6;i++) fParams[i] = 0; | |
90 | delete fCov; | |
91 | fCov = new TMatrixDSym(6); | |
92 | } | |
93 | ||
94 | void AliTrackFitter::SetTrackPointArray(AliTrackPointArray *array, Bool_t owner) | |
95 | { | |
96 | // Load space points from array | |
97 | // By default we don't copy them but | |
98 | // just put the pointers to them | |
99 | Reset(); | |
100 | ||
101 | if (fIsOwner) delete fPoints; | |
102 | ||
103 | if (owner) { | |
104 | fPoints = new AliTrackPointArray(*array); | |
105 | fIsOwner = kTRUE; | |
106 | } | |
107 | else { | |
108 | fPoints = array; | |
109 | fIsOwner = kFALSE; | |
110 | } | |
111 | } |