]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDrecPoint.cxx
Remove compilation of grndmq
[u/mrichter/AliRoot.git] / TRD / AliTRDrecPoint.cxx
CommitLineData
f7336fa3 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$
5443e65e 18Revision 1.8 2002/03/28 14:59:07 cblume
19Coding conventions
20
0a29d0f1 21Revision 1.7 2001/12/05 15:04:34 hristov
22Changes related to the corrections of AliRecPoint
23
11432582 24Revision 1.6 2001/02/14 18:22:26 cblume
25Change in the geometry of the padplane
26
71d9fa7b 27Revision 1.5 2000/11/14 14:40:27 cblume
28Correction for the Sun compiler (kTRUE and kFALSE)
29
57527628 30Revision 1.4 2000/11/01 14:53:21 cblume
31Merge with TRD-develop
32
793ff80c 33Revision 1.1.4.2 2000/10/04 16:34:58 cblume
34Replace include files by forward declarations
35
36Revision 1.1.4.1 2000/09/22 14:50:39 cblume
37Adapted to tracking code
38
39Revision 1.3 2000/06/09 11:10:07 cblume
40Compiler warnings and coding conventions, next round
41
dd9a6ee3 42Revision 1.2 2000/06/08 18:32:58 cblume
43Make code compliant to coding conventions
44
8230f242 45Revision 1.1 2000/02/28 19:02:07 cblume
46Add new TRD classes
47
f7336fa3 48*/
49
50///////////////////////////////////////////////////////////////////////////////
51// //
52// TRD reconstructed point //
53// //
54///////////////////////////////////////////////////////////////////////////////
55
793ff80c 56#include "AliRun.h"
57
f7336fa3 58#include "AliTRDgeometry.h"
59#include "AliTRDrecPoint.h"
60#include "AliTRD.h"
61
62ClassImp(AliTRDrecPoint)
63
64//_____________________________________________________________________________
65AliTRDrecPoint::AliTRDrecPoint():AliRecPoint()
66{
67 //
68 // Standard constructor
69 //
70
71 fDetector = 0;
72
8230f242 73 AliTRD *trd;
f7336fa3 74 if ((gAlice) &&
8230f242 75 (trd = ((AliTRD*) gAlice->GetDetector("TRD")))) {
76 fGeom = trd->GetGeometry();
f7336fa3 77 }
78 else {
79 fGeom = NULL;
80 }
81
82}
83
11432582 84//_____________________________________________________________________________
85AliTRDrecPoint::AliTRDrecPoint(const char * opt):AliRecPoint(opt)
86{
87 //
88 // Standard constructor
89 //
90
91 fDetector = 0;
92
93 AliTRD *trd;
94 if ((gAlice) &&
95 (trd = ((AliTRD*) gAlice->GetDetector("TRD")))) {
96 fGeom = trd->GetGeometry();
97 }
98 else {
99 fGeom = NULL;
100 }
101
102}
103
8230f242 104//_____________________________________________________________________________
105AliTRDrecPoint::~AliTRDrecPoint()
106{
107 //
108 // AliTRDrecPoint destructor
109 //
110
111}
112
f7336fa3 113//_____________________________________________________________________________
114void AliTRDrecPoint::AddDigit(Int_t digit)
115{
116 //
117 // Adds the index of a digit to the digits list
118 //
119
120 // First resize the list
121 // (no clusters with more than 3 digits for the TRD
122 if ((fMulDigit == 0) && (fMaxDigit >= 5)) {
123 fMaxDigit = 5;
124 delete fDigitsList;
125 fDigitsList = new int[fMaxDigit];
126 }
127
128 // Increase the size of the list if necessary
129 if (fMulDigit >= fMaxDigit) {
dd9a6ee3 130 fMaxDigit *= 2;
131 int *tempo = new (int[fMaxDigit]);
f7336fa3 132 Int_t index;
133 for (index = 0; index < fMulDigit; index++)
134 tempo[index] = fDigitsList[index];
135 delete fDigitsList;
136 fDigitsList = tempo;
137 }
138
139 fDigitsList[fMulDigit++] = digit;
140
141}
142
143//_____________________________________________________________________________
144void AliTRDrecPoint::SetLocalPosition(TVector3 &pos)
145{
146 //
147 // Sets the position of the point in the local coordinate system
148 // (row,col,time) and calculates the error matrix in the same
149 // system.
150 //
151
5443e65e 152 //const Float_t kSq12 = 3.464101615;
f7336fa3 153
154 // Set the position
5443e65e 155 //fLocPos = pos;
f7336fa3 156
157 // Set the error matrix
158 // row: pad-size / sqrt(12)
159 // col: not defined yet
160 // time: bin-size / sqrt(12)
5443e65e 161 //Int_t plane = ((AliTRDgeometry *) fGeom)->GetPlane(fDetector);
162 //Int_t chamber = ((AliTRDgeometry *) fGeom)->GetChamber(fDetector);
163 //Int_t sector = ((AliTRDgeometry *) fGeom)->GetSector(fDetector);
164 //fLocPosM->operator()(0,0) = ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane
165 // ,chamber
166 // ,sector)
167 // / kSq12;
168 //fLocPosM->operator()(1,1) = 0.0;
169 //fLocPosM->operator()(2,2) = ((AliTRDgeometry *) fGeom)->GetTimeBinSize()
170 // / kSq12;
f7336fa3 171
793ff80c 172 // printf("rec. point: row = %f, col = %f, time = %f \n",
173 // fLocPos[0],fLocPos[1],fLocPos[2]);
174
f7336fa3 175}
793ff80c 176
177//_____________________________________________________________________________
178void AliTRDrecPoint::SetTrackingYZ(Float_t sigmaY, Float_t sigmaZ)
179{
180 //
181 // Sets the position of the point in the local coordinate system
182 // of tracking sector
183 //
184
5443e65e 185 //Int_t plane = ((AliTRDgeometry *) fGeom)->GetPlane(fDetector);
186 //Int_t chamber = ((AliTRDgeometry *) fGeom)->GetChamber(fDetector);
187 //Int_t sector = ((AliTRDgeometry *) fGeom)->GetSector(fDetector);
793ff80c 188
189
190 // Set the position
191
5443e65e 192 //Float_t padRow = fLocPos[0]; // Pad Row position
193 //Float_t padCol = fLocPos[1]; // Pad Column position
793ff80c 194
5443e65e 195 //Float_t col0 = ((AliTRDgeometry *) fGeom)->GetCol0(plane);
196 //Float_t row0 = ((AliTRDgeometry *) fGeom)->GetRow0(plane,chamber,sector);
793ff80c 197
198 // Float_t offset = 0.5 * ((AliTRDgeometry *) fGeom)->GetChamberWidth(plane);
199
5443e65e 200 //fY = - (col0 + padCol * ((AliTRDgeometry *) fGeom)->GetColPadSize(plane));
201 //fZ = row0 + padRow * ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane
202 // ,chamber
203 // ,sector);
793ff80c 204
205 // fSigmaY = sigmaY * sigmaY;
206 // fSigmaZ = sigmaZ * sigmaZ;
207
5443e65e 208//fSigmaY2 = 0.05 * 0.05;
793ff80c 209
5443e65e 210//fSigmaZ2 = ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane,chamber,sector)
211// * ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane,chamber,sector)
212// / 12.;
71d9fa7b 213
793ff80c 214}
215
216//_____________________________________________________________________________
217void AliTRDrecPoint::AddTrackIndex(Int_t *track)
218{
219 // Adds track index. Currently assumed that track is an array of
220 // size 9, and up to 3 track indexes are stored in fTracks[3].
221 // Indexes are sorted according to:
222 // 1) index of max number of appearances is stored first
223 // 2) if two or more indexes appear equal number of times, the lowest
224 // ones are stored first;
225
0a29d0f1 226 const Int_t kSize = 9;
793ff80c 227
0a29d0f1 228 Int_t entries[kSize][2], i, j, index;
793ff80c 229
0a29d0f1 230 Bool_t indexAdded;
793ff80c 231
0a29d0f1 232 for (i=0; i<kSize; i++) {
793ff80c 233 entries[i][0]=-1;
234 entries[i][1]=0;
235 }
236
237
0a29d0f1 238 for (Int_t k=0; k<kSize; k++) {
793ff80c 239 index=track[k];
0a29d0f1 240 indexAdded=kFALSE; j=0;
793ff80c 241 if (index >= 0) {
0a29d0f1 242 while ( (!indexAdded) && ( j < kSize ) ) {
793ff80c 243 if ((entries[j][0]==index) || (entries[j][1]==0)) {
244 entries[j][0]=index;
245 entries[j][1]=entries[j][1]+1;
0a29d0f1 246 indexAdded=kTRUE;
793ff80c 247 }
248 j++;
249 }
250 }
251 }
252
253 // sort by number of appearances and index value
254 Int_t swap=1, tmp0, tmp1;
255 while ( swap > 0) {
256 swap=0;
0a29d0f1 257 for(i=0; i<(kSize-1); i++) {
793ff80c 258 if ((entries[i][0] >= 0) && (entries[i+1][0] >= 0)) {
259 if ((entries[i][1] < entries[i+1][1]) ||
260 ((entries[i][1] == entries[i+1][1]) &&
261 (entries[i][0] > entries[i+1][0]))) {
262 tmp0=entries[i][0];
263 tmp1=entries[i][1];
264 entries[i][0]=entries[i+1][0];
265 entries[i][1]=entries[i+1][1];
266 entries[i+1][0]=tmp0;
267 entries[i+1][1]=tmp1;
268 swap++;
269 }
270 }
271 }
272 }
273
274 // set track indexes
275
276 for(i=0; i<3; i++) {
277 fTracks[i] = entries[i][0];
278 }
279
280 return;
281
282}
5443e65e 283
284
285
286
287
288
289