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 ///////////////////////////////////////////////////////////////////////////////
20 // TRD reconstructed point //
22 ///////////////////////////////////////////////////////////////////////////////
26 #include "AliTRDgeometry.h"
27 #include "AliTRDrecPoint.h"
29 ClassImp(AliTRDrecPoint)
31 //_____________________________________________________________________________
32 AliTRDrecPoint::AliTRDrecPoint()
43 // Default constructor
46 for (Int_t i = 0; i < 3; i++) {
49 fGeom = AliTRDgeometry::GetGeometry();
53 //_____________________________________________________________________________
54 AliTRDrecPoint::AliTRDrecPoint(const char * opt)
65 // Standard constructor
68 for (Int_t i = 0; i < 3; i++) {
71 fGeom = AliTRDgeometry::GetGeometry();
75 //_____________________________________________________________________________
76 AliTRDrecPoint::~AliTRDrecPoint()
79 // AliTRDrecPoint destructor
84 //_____________________________________________________________________________
85 void AliTRDrecPoint::AddDigit(Int_t digit)
88 // Adds the index of a digit to the digits list
91 // First resize the list
92 // (no clusters with more than 3 digits for the TRD
93 if ((fMulDigit == 0) &&
97 fDigitsList = new int[fMaxDigit];
100 // Increase the size of the list if necessary
101 if (fMulDigit >= fMaxDigit) {
103 Int_t *tempo = new Int_t[fMaxDigit];
105 for (index = 0; index < fMulDigit; index++) {
106 tempo[index] = fDigitsList[index];
112 fDigitsList[fMulDigit++] = digit;
116 //_____________________________________________________________________________
117 void AliTRDrecPoint::SetLocalPosition(TVector3 & /*pos*/)
120 // Sets the position of the point in the local coordinate system
121 // (row,col,time) and calculates the error matrix in the same
125 AliFatal("Not implemented");
129 //_____________________________________________________________________________
130 void AliTRDrecPoint::SetTrackingYZ(Float_t /*sigmaY*/, Float_t /*sigmaZ*/)
133 // Sets the position of the point in the local coordinate system
134 // of tracking sector
137 AliFatal("Not implemented");
141 //_____________________________________________________________________________
142 void AliTRDrecPoint::AddTrackIndex(Int_t *track)
145 // Adds track index. Currently assumed that track is an array of
146 // size 9, and up to 3 track indexes are stored in fTracks[3].
147 // Indexes are sorted according to:
148 // 1) index of max number of appearances is stored first
149 // 2) if two or more indexes appear equal number of times, the lowest
150 // ones are stored first;
153 const Int_t kSize = 9;
154 Int_t entries[kSize][2];
163 for (i = 0; i < kSize; i++) {
168 for (k = 0; k < kSize; k++) {
173 while ((!indexAdded) && (j < kSize)) {
174 if ((entries[j][0] == index) ||
175 (entries[j][1] == 0)) {
176 entries[j][0] = index;
177 entries[j][1] = entries[j][1]+1;
185 // Sort by number of appearances and index value
191 for (i = 0; i < (kSize - 1); i++) {
192 if ((entries[i][0] >= 0) &&
193 (entries[i+1][0] >= 0)) {
194 if ((entries[i][1] < entries[i+1][1]) ||
195 ((entries[i][1] == entries[i+1][1]) &&
196 (entries[i][0] > entries[i+1][0]))) {
197 tmp0 = entries[i][0];
198 tmp1 = entries[i][1];
199 entries[i][0] = entries[i+1][0];
200 entries[i][1] = entries[i+1][1];
201 entries[i+1][0] = tmp0;
202 entries[i+1][1] = tmp1;
210 for(i = 0; i < 3; i++) {
211 fTracks[i] = entries[i][0];