]>
Commit | Line | Data |
---|---|---|
65163b68 | 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 | $Log$ | |
18 | Revision 1.1 1999/12/17 09:01:14 fca | |
19 | Y.Schutz new classes for reconstruction | |
20 | ||
21 | */ | |
22 | ||
23 | //-*-C++-*- | |
24 | //_________________________________________________________________________ | |
25 | // Base Class of Cluster (empty cxx needed by Root) | |
26 | //*-- Author : Yves Schutz SUBATECH | |
27 | ////////////////////////////////////////////////////////////////////////////// | |
28 | ||
29 | // --- ROOT system --- | |
30 | ||
31 | #include "TObjArray.h" | |
32 | ||
33 | // --- Standard library --- | |
34 | ||
35 | // --- AliRoot header files --- | |
36 | ||
37 | #include "AliRecPoint.h" | |
38 | ||
39 | ClassImp(AliRecPoint) | |
40 | ||
41 | ||
42 | //____________________________________________________________________________ | |
43 | AliRecPoint::AliRecPoint() | |
44 | { | |
45 | // ctor | |
46 | fAmp = 0.0 ; | |
47 | ||
48 | fLocPos.SetXYZ(0., 0., 0.) ; | |
49 | fLocPosM = new TMatrix(3,3) ; | |
50 | fMaxDigit = 100 ; | |
51 | fMulDigit = 0 ; | |
52 | fDigitsList = new int[fMaxDigit]; ; | |
53 | fMaxTrack = 5 ; | |
54 | fMulTrack = 0 ; | |
55 | fTracksList = new int[fMaxTrack]; ; | |
56 | } | |
57 | ||
58 | //____________________________________________________________________________ | |
59 | AliRecPoint::~AliRecPoint() | |
60 | { | |
61 | // dtor | |
62 | ||
63 | delete fLocPosM ; | |
64 | if ( fDigitsList ) delete fDigitsList ; | |
65 | if ( fTracksList ) delete fTracksList ; | |
66 | ||
67 | } | |
68 | ||
69 | //____________________________________________________________________________ | |
70 | void AliRecPoint::AddDigit(AliDigitNew & digit) | |
71 | { | |
72 | // adds a digit to the digits list | |
73 | // and accumulates the total amplitude and the multiplicity | |
74 | ||
75 | ||
76 | if ( fMulDigit >= fMaxDigit ) { // increase the size of the list | |
77 | int * tempo = new ( int[fMaxDigit*=2] ) ; | |
78 | ||
79 | Int_t index ; | |
80 | ||
81 | for ( index = 0 ; index < fMulDigit ; index++ ) | |
82 | tempo[index] = fDigitsList[index] ; | |
83 | ||
84 | delete fDigitsList ; | |
85 | fDigitsList = tempo ; | |
86 | } | |
87 | ||
88 | fDigitsList[fMulDigit++]= (int) &digit ; | |
89 | fAmp += digit.GetAmp() ; | |
90 | } | |
91 | ||
92 | //____________________________________________________________________________ | |
93 | // void AliRecPoint::AddTrack(AliTrack & track) | |
94 | // { | |
95 | // // adds a digit to the digits list | |
96 | // // and accumulates the total amplitude and the multiplicity | |
97 | ||
98 | ||
99 | // if ( fMulTrack >= fMaxTrack ) { // increase the size of the list | |
100 | // int * tempo = new int[fMaxTrack*=2] ; | |
101 | // Int_t index ; | |
102 | // for ( index = 0 ; index < fMulTrack ; index++ ) | |
103 | // tempo[index] = fTracksList[index] ; | |
104 | // delete fTracksList ; | |
105 | // fTracksList = tempo ; | |
106 | // } | |
107 | ||
108 | // fTracksList[fMulTrack++]= (int) &Track ; | |
109 | // } | |
110 | ||
111 | //____________________________________________________________________________ | |
112 | void AliRecPoint::GetCovarianceMatrix(TMatrix & mat) | |
113 | { | |
114 | // returns the covariant matrix for the local position | |
115 | ||
116 | mat = *fLocPosM ; | |
117 | ||
118 | } | |
119 | ||
120 | //____________________________________________________________________________ | |
121 | void AliRecPoint::GetLocalPosition(TVector3 & pos) | |
122 | { | |
123 | // returns the position of the cluster in the local reference system of the sub-detector | |
124 | ||
125 | pos = fLocPos; | |
126 | ||
127 | ||
128 | } | |
129 | ||
130 | //____________________________________________________________________________ | |
131 | void AliRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrix & gmat) | |
132 | { | |
133 | // returns the position of the cluster in the global reference system of ALICE | |
134 | // and the uncertainty on this position | |
135 | ||
136 | ||
137 | fGeom->GetGlobal(this, gpos, gmat) ; | |
138 | ||
139 | } | |
140 | ||
141 | //______________________________________________________________________________ | |
142 | void AliRecPoint::Streamer(TBuffer &R__b) | |
143 | { | |
144 | // Stream an object of class AliRecPoint. | |
145 | ||
146 | if (R__b.IsReading()) { | |
147 | Version_t R__v = R__b.ReadVersion(); if (R__v) { } | |
148 | TObject::Streamer(R__b); | |
149 | R__b >> fAmp; | |
150 | R__b.ReadArray(fDigitsList); | |
151 | R__b >> fGeom; | |
152 | fLocPos.Streamer(R__b); | |
153 | R__b >> fLocPosM; | |
154 | R__b >> fMulDigit; | |
155 | R__b >> fMulTrack; | |
156 | R__b.ReadArray(fTracksList); | |
157 | } else { | |
158 | R__b.WriteVersion(AliRecPoint::IsA()); | |
159 | TObject::Streamer(R__b); | |
160 | R__b << fAmp; | |
161 | R__b.WriteArray(fDigitsList, fMaxDigit); | |
162 | R__b << fGeom; | |
163 | fLocPos.Streamer(R__b); | |
164 | R__b << fLocPosM; | |
165 | R__b << fMulDigit; | |
166 | R__b << fMulTrack; | |
167 | R__b.WriteArray(fTracksList, fMaxTrack); | |
168 | } | |
169 | } |