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.7.6.2 2002/07/24 10:09:31 alibrary
21 Revision 1.7.6.1 2002/06/10 15:28:58 hristov
24 Revision 1.8 2002/03/28 14:59:07 cblume
27 Revision 1.9 2002/06/12 09:54:35 cblume
28 Update of tracking code provided by Sergei
30 Revision 1.8 2002/03/28 14:59:07 cblume
33 Revision 1.7 2001/12/05 15:04:34 hristov
34 Changes related to the corrections of AliRecPoint
36 Revision 1.6 2001/02/14 18:22:26 cblume
37 Change in the geometry of the padplane
39 Revision 1.5 2000/11/14 14:40:27 cblume
40 Correction for the Sun compiler (kTRUE and kFALSE)
42 Revision 1.4 2000/11/01 14:53:21 cblume
43 Merge with TRD-develop
45 Revision 1.1.4.2 2000/10/04 16:34:58 cblume
46 Replace include files by forward declarations
48 Revision 1.1.4.1 2000/09/22 14:50:39 cblume
49 Adapted to tracking code
51 Revision 1.3 2000/06/09 11:10:07 cblume
52 Compiler warnings and coding conventions, next round
54 Revision 1.2 2000/06/08 18:32:58 cblume
55 Make code compliant to coding conventions
57 Revision 1.1 2000/02/28 19:02:07 cblume
62 ///////////////////////////////////////////////////////////////////////////////
64 // TRD reconstructed point //
66 ///////////////////////////////////////////////////////////////////////////////
70 #include "AliTRDgeometry.h"
71 #include "AliTRDrecPoint.h"
74 ClassImp(AliTRDrecPoint)
76 //_____________________________________________________________________________
77 AliTRDrecPoint::AliTRDrecPoint():AliRecPoint()
80 // Standard constructor
87 (trd = ((AliTRD*) gAlice->GetDetector("TRD")))) {
88 fGeom = trd->GetGeometry();
96 //_____________________________________________________________________________
97 AliTRDrecPoint::AliTRDrecPoint(const char * opt):AliRecPoint(opt)
100 // Standard constructor
107 (trd = ((AliTRD*) gAlice->GetDetector("TRD")))) {
108 fGeom = trd->GetGeometry();
116 //_____________________________________________________________________________
117 AliTRDrecPoint::~AliTRDrecPoint()
120 // AliTRDrecPoint destructor
125 //_____________________________________________________________________________
126 void AliTRDrecPoint::AddDigit(Int_t digit)
129 // Adds the index of a digit to the digits list
132 // First resize the list
133 // (no clusters with more than 3 digits for the TRD
134 if ((fMulDigit == 0) && (fMaxDigit >= 5)) {
137 fDigitsList = new int[fMaxDigit];
140 // Increase the size of the list if necessary
141 if (fMulDigit >= fMaxDigit) {
143 int *tempo = new (int[fMaxDigit]);
145 for (index = 0; index < fMulDigit; index++)
146 tempo[index] = fDigitsList[index];
151 fDigitsList[fMulDigit++] = digit;
155 //_____________________________________________________________________________
156 void AliTRDrecPoint::SetLocalPosition(TVector3 &pos)
159 // Sets the position of the point in the local coordinate system
160 // (row,col,time) and calculates the error matrix in the same
164 //const Float_t kSq12 = 3.464101615;
169 // Set the error matrix
170 // row: pad-size / sqrt(12)
171 // col: not defined yet
172 // time: bin-size / sqrt(12)
173 //Int_t plane = ((AliTRDgeometry *) fGeom)->GetPlane(fDetector);
174 //Int_t chamber = ((AliTRDgeometry *) fGeom)->GetChamber(fDetector);
175 //Int_t sector = ((AliTRDgeometry *) fGeom)->GetSector(fDetector);
176 //fLocPosM->operator()(0,0) = ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane
180 //fLocPosM->operator()(1,1) = 0.0;
181 //fLocPosM->operator()(2,2) = ((AliTRDgeometry *) fGeom)->GetTimeBinSize()
184 // printf("rec. point: row = %f, col = %f, time = %f \n",
185 // fLocPos[0],fLocPos[1],fLocPos[2]);
189 //_____________________________________________________________________________
190 void AliTRDrecPoint::SetTrackingYZ(Float_t sigmaY, Float_t sigmaZ)
193 // Sets the position of the point in the local coordinate system
194 // of tracking sector
197 //Int_t plane = ((AliTRDgeometry *) fGeom)->GetPlane(fDetector);
198 //Int_t chamber = ((AliTRDgeometry *) fGeom)->GetChamber(fDetector);
199 //Int_t sector = ((AliTRDgeometry *) fGeom)->GetSector(fDetector);
204 //Float_t padRow = fLocPos[0]; // Pad Row position
205 //Float_t padCol = fLocPos[1]; // Pad Column position
207 //Float_t col0 = ((AliTRDgeometry *) fGeom)->GetCol0(plane);
208 //Float_t row0 = ((AliTRDgeometry *) fGeom)->GetRow0(plane,chamber,sector);
210 // Float_t offset = 0.5 * ((AliTRDgeometry *) fGeom)->GetChamberWidth(plane);
212 //fY = - (col0 + padCol * ((AliTRDgeometry *) fGeom)->GetColPadSize(plane));
213 //fZ = row0 + padRow * ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane
217 // fSigmaY = sigmaY * sigmaY;
218 // fSigmaZ = sigmaZ * sigmaZ;
220 //fSigmaY2 = 0.05 * 0.05;
222 //fSigmaZ2 = ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane,chamber,sector)
223 // * ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane,chamber,sector)
228 //_____________________________________________________________________________
229 void AliTRDrecPoint::AddTrackIndex(Int_t *track)
231 // Adds track index. Currently assumed that track is an array of
232 // size 9, and up to 3 track indexes are stored in fTracks[3].
233 // Indexes are sorted according to:
234 // 1) index of max number of appearances is stored first
235 // 2) if two or more indexes appear equal number of times, the lowest
236 // ones are stored first;
238 const Int_t kSize = 9;
240 Int_t entries[kSize][2], i, j, index;
244 for (i=0; i<kSize; i++) {
250 for (Int_t k=0; k<kSize; k++) {
252 indexAdded=kFALSE; j=0;
254 while ( (!indexAdded) && ( j < kSize ) ) {
255 if ((entries[j][0]==index) || (entries[j][1]==0)) {
257 entries[j][1]=entries[j][1]+1;
265 // sort by number of appearances and index value
266 Int_t swap=1, tmp0, tmp1;
269 for(i=0; i<(kSize-1); i++) {
270 if ((entries[i][0] >= 0) && (entries[i+1][0] >= 0)) {
271 if ((entries[i][1] < entries[i+1][1]) ||
272 ((entries[i][1] == entries[i+1][1]) &&
273 (entries[i][0] > entries[i+1][0]))) {
276 entries[i][0]=entries[i+1][0];
277 entries[i][1]=entries[i+1][1];
278 entries[i+1][0]=tmp0;
279 entries[i+1][1]=tmp1;
289 fTracks[i] = entries[i][0];