]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliRecPoint.cxx
Removal of useless dependecies via forward declarations
[u/mrichter/AliRoot.git] / STEER / AliRecPoint.cxx
CommitLineData
2a33668d 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$
94de3818 18Revision 1.5 2000/07/11 18:24:59 fca
19Coding convention corrections + few minor bug fixes
20
aee8290b 21Revision 1.4 2000/05/16 08:30:02 fca
22Using automatic streamer for c arrays
23
712d6528 24Revision 1.3 2000/03/20 14:22:25 fca
25New version to support new PHOS code
26
65a2d2b0 27Revision 1.2 2000/02/15 09:43:54 fca
28Corrections
29- a bug in the streamer (wrong size of the arrays)
30- replace Read/WriteArray by Read/WriteFastArray (suggestion R.Brun)
31
dad18d4d 32Revision 1.1 1999/12/17 09:01:14 fca
33Y.Schutz new classes for reconstruction
34
2a33668d 35*/
36
37//-*-C++-*-
38//_________________________________________________________________________
94de3818 39// Base Class for reconstructed space points
40// usually coming from the clusterisation algorithms
41// run on the digits
42//
2a33668d 43//*-- Author : Yves Schutz SUBATECH
44//////////////////////////////////////////////////////////////////////////////
45
46// --- ROOT system ---
47
48#include "TObjArray.h"
49
50// --- Standard library ---
51
52// --- AliRoot header files ---
53
54#include "AliRecPoint.h"
94de3818 55#include "AliGeometry.h"
56#include "AliDigitNew.h"
2a33668d 57
58ClassImp(AliRecPoint)
59
60
61//____________________________________________________________________________
62AliRecPoint::AliRecPoint()
63{
64 // ctor
65 fAmp = 0.0 ;
66
67 fLocPos.SetXYZ(0., 0., 0.) ;
65a2d2b0 68 fLocPosM = new TMatrix(3,3) ;
69 fMaxDigit = 100 ;
70 fMulDigit = 0 ;
71 fDigitsList = new int[fMaxDigit]; ;
72 fMaxTrack = 5 ;
73 fMulTrack = 0 ;
74 fTracksList = new int[fMaxTrack]; ;
75 fIndexInList = -1 ; // to be set when the point is already stored
2a33668d 76}
77
aee8290b 78//____________________________________________________________________________
79AliRecPoint::AliRecPoint(const AliRecPoint& recp)
80{
81 //
82 // Copy constructor
83 //
84 recp.Copy(*this);
85}
86
2a33668d 87//____________________________________________________________________________
88AliRecPoint::~AliRecPoint()
89{
90 // dtor
91
92 delete fLocPosM ;
dad18d4d 93 if ( fDigitsList )
94 delete fDigitsList ;
95 if ( fTracksList )
96 delete fTracksList ;
2a33668d 97
98}
99
100//____________________________________________________________________________
101void AliRecPoint::AddDigit(AliDigitNew & digit)
102{
103 // adds a digit to the digits list
104 // and accumulates the total amplitude and the multiplicity
105
106
107 if ( fMulDigit >= fMaxDigit ) { // increase the size of the list
108 int * tempo = new ( int[fMaxDigit*=2] ) ;
109
110 Int_t index ;
111
112 for ( index = 0 ; index < fMulDigit ; index++ )
113 tempo[index] = fDigitsList[index] ;
114
115 delete fDigitsList ;
116 fDigitsList = tempo ;
117 }
118
65a2d2b0 119 fDigitsList[fMulDigit] = digit.GetIndexInList() ;
120 fMulDigit++ ;
2a33668d 121 fAmp += digit.GetAmp() ;
122}
123
124//____________________________________________________________________________
125// void AliRecPoint::AddTrack(AliTrack & track)
126// {
127// // adds a digit to the digits list
128// // and accumulates the total amplitude and the multiplicity
129
130
131// if ( fMulTrack >= fMaxTrack ) { // increase the size of the list
132// int * tempo = new int[fMaxTrack*=2] ;
133// Int_t index ;
134// for ( index = 0 ; index < fMulTrack ; index++ )
135// tempo[index] = fTracksList[index] ;
136// delete fTracksList ;
137// fTracksList = tempo ;
138// }
139
140// fTracksList[fMulTrack++]= (int) &Track ;
141// }
142
aee8290b 143//____________________________________________________________________________
144void AliRecPoint::Copy(AliRecPoint& recp) const
145{
146 //
147 // Copy *this onto pts
148 //
149 // Copy all first
150 if(this != &recp) {
151 ((TObject*) this)->Copy((TObject&)recp);
152 recp.fAmp = fAmp;
153 recp.fGeom = fGeom;
154 recp.fIndexInList = fIndexInList;
155 recp.fLocPos = fLocPos;
156 recp.fLocPosM = new TMatrix(*fLocPosM);
157 recp.fMaxDigit = fMaxDigit;
158 recp.fMulDigit = fMulDigit;
159 recp.fMaxTrack = fMaxTrack;
160 recp.fMulTrack = fMulTrack;
161
162 // Duplicate pointed objects
163 recp.fDigitsList = new Int_t[fMulDigit];
164 memcpy(recp.fDigitsList,fDigitsList,fMulDigit*sizeof(Int_t));
165 recp.fTracksList = new Int_t[fMulTrack];
166 memcpy(recp.fTracksList,fTracksList,fMulTrack*sizeof(Int_t));
167 }
168}
169
2a33668d 170//____________________________________________________________________________
171void AliRecPoint::GetCovarianceMatrix(TMatrix & mat)
172{
173 // returns the covariant matrix for the local position
174
175 mat = *fLocPosM ;
176
177}
178
179//____________________________________________________________________________
94de3818 180void AliRecPoint::GetLocalPosition(TVector3 & pos) const
2a33668d 181{
182 // returns the position of the cluster in the local reference system of the sub-detector
183
184 pos = fLocPos;
185
186
187}
188
aee8290b 189//____________________________________________________________________________
190AliRecPoint & AliRecPoint::operator= (const AliRecPoint &recp)
191{
192 recp.Copy(*this);
193 return (*this);
194}
195
196
2a33668d 197//____________________________________________________________________________
94de3818 198void AliRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrix & gmat) const
2a33668d 199{
200 // returns the position of the cluster in the global reference system of ALICE
201 // and the uncertainty on this position
202
203
204 fGeom->GetGlobal(this, gpos, gmat) ;
205
206}
207
65a2d2b0 208