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 **************************************************************************/
18 Revision 1.1 1999/12/17 09:01:14 fca
19 Y.Schutz new classes for reconstruction
24 //_________________________________________________________________________
25 // Base Class of Cluster (empty cxx needed by Root)
26 //*-- Author : Yves Schutz SUBATECH
27 //////////////////////////////////////////////////////////////////////////////
29 // --- ROOT system ---
31 #include "TObjArray.h"
33 // --- Standard library ---
35 // --- AliRoot header files ---
37 #include "AliRecPoint.h"
42 //____________________________________________________________________________
43 AliRecPoint::AliRecPoint()
48 fLocPos.SetXYZ(0., 0., 0.) ;
49 fLocPosM = new TMatrix(3,3) ;
52 fDigitsList = new int[fMaxDigit]; ;
55 fTracksList = new int[fMaxTrack]; ;
58 //____________________________________________________________________________
59 AliRecPoint::~AliRecPoint()
71 //____________________________________________________________________________
72 void AliRecPoint::AddDigit(AliDigitNew & digit)
74 // adds a digit to the digits list
75 // and accumulates the total amplitude and the multiplicity
78 if ( fMulDigit >= fMaxDigit ) { // increase the size of the list
79 int * tempo = new ( int[fMaxDigit*=2] ) ;
83 for ( index = 0 ; index < fMulDigit ; index++ )
84 tempo[index] = fDigitsList[index] ;
90 fDigitsList[fMulDigit++]= (int) &digit ;
91 fAmp += digit.GetAmp() ;
94 //____________________________________________________________________________
95 // void AliRecPoint::AddTrack(AliTrack & track)
97 // // adds a digit to the digits list
98 // // and accumulates the total amplitude and the multiplicity
101 // if ( fMulTrack >= fMaxTrack ) { // increase the size of the list
102 // int * tempo = new int[fMaxTrack*=2] ;
104 // for ( index = 0 ; index < fMulTrack ; index++ )
105 // tempo[index] = fTracksList[index] ;
106 // delete fTracksList ;
107 // fTracksList = tempo ;
110 // fTracksList[fMulTrack++]= (int) &Track ;
113 //____________________________________________________________________________
114 void AliRecPoint::GetCovarianceMatrix(TMatrix & mat)
116 // returns the covariant matrix for the local position
122 //____________________________________________________________________________
123 void AliRecPoint::GetLocalPosition(TVector3 & pos)
125 // returns the position of the cluster in the local reference system of the sub-detector
132 //____________________________________________________________________________
133 void AliRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrix & gmat)
135 // returns the position of the cluster in the global reference system of ALICE
136 // and the uncertainty on this position
139 fGeom->GetGlobal(this, gpos, gmat) ;
143 //______________________________________________________________________________
144 void AliRecPoint::Streamer(TBuffer &R__b)
146 // Stream an object of class AliRecPoint.
148 if (R__b.IsReading()) {
149 Version_t R__v = R__b.ReadVersion(); if (R__v) { }
150 TObject::Streamer(R__b);
153 fDigitsList = new Int_t[fMulDigit] ;
154 R__b.ReadFastArray(fDigitsList, fMulDigit);
156 fLocPos.Streamer(R__b);
159 fTracksList = new Int_t[fMulTrack] ;
160 R__b.ReadFastArray(fTracksList, fMulTrack);
162 R__b.WriteVersion(AliRecPoint::IsA());
163 TObject::Streamer(R__b);
166 R__b.WriteFastArray(fDigitsList, fMulDigit);
168 fLocPos.Streamer(R__b);
171 R__b.WriteFastArray(fTracksList, fMulTrack);