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.8 2002/03/28 14:59:07 cblume
21 Revision 1.7 2001/12/05 15:04:34 hristov
22 Changes related to the corrections of AliRecPoint
24 Revision 1.6 2001/02/14 18:22:26 cblume
25 Change in the geometry of the padplane
27 Revision 1.5 2000/11/14 14:40:27 cblume
28 Correction for the Sun compiler (kTRUE and kFALSE)
30 Revision 1.4 2000/11/01 14:53:21 cblume
31 Merge with TRD-develop
33 Revision 1.1.4.2 2000/10/04 16:34:58 cblume
34 Replace include files by forward declarations
36 Revision 1.1.4.1 2000/09/22 14:50:39 cblume
37 Adapted to tracking code
39 Revision 1.3 2000/06/09 11:10:07 cblume
40 Compiler warnings and coding conventions, next round
42 Revision 1.2 2000/06/08 18:32:58 cblume
43 Make code compliant to coding conventions
45 Revision 1.1 2000/02/28 19:02:07 cblume
50 ///////////////////////////////////////////////////////////////////////////////
52 // TRD reconstructed point //
54 ///////////////////////////////////////////////////////////////////////////////
58 #include "AliTRDgeometry.h"
59 #include "AliTRDrecPoint.h"
62 ClassImp(AliTRDrecPoint)
64 //_____________________________________________________________________________
65 AliTRDrecPoint::AliTRDrecPoint():AliRecPoint()
68 // Standard constructor
75 (trd = ((AliTRD*) gAlice->GetDetector("TRD")))) {
76 fGeom = trd->GetGeometry();
84 //_____________________________________________________________________________
85 AliTRDrecPoint::AliTRDrecPoint(const char * opt):AliRecPoint(opt)
88 // Standard constructor
95 (trd = ((AliTRD*) gAlice->GetDetector("TRD")))) {
96 fGeom = trd->GetGeometry();
104 //_____________________________________________________________________________
105 AliTRDrecPoint::~AliTRDrecPoint()
108 // AliTRDrecPoint destructor
113 //_____________________________________________________________________________
114 void AliTRDrecPoint::AddDigit(Int_t digit)
117 // Adds the index of a digit to the digits list
120 // First resize the list
121 // (no clusters with more than 3 digits for the TRD
122 if ((fMulDigit == 0) && (fMaxDigit >= 5)) {
125 fDigitsList = new int[fMaxDigit];
128 // Increase the size of the list if necessary
129 if (fMulDigit >= fMaxDigit) {
131 int *tempo = new (int[fMaxDigit]);
133 for (index = 0; index < fMulDigit; index++)
134 tempo[index] = fDigitsList[index];
139 fDigitsList[fMulDigit++] = digit;
143 //_____________________________________________________________________________
144 void AliTRDrecPoint::SetLocalPosition(TVector3 &pos)
147 // Sets the position of the point in the local coordinate system
148 // (row,col,time) and calculates the error matrix in the same
152 //const Float_t kSq12 = 3.464101615;
157 // Set the error matrix
158 // row: pad-size / sqrt(12)
159 // col: not defined yet
160 // time: bin-size / sqrt(12)
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
168 //fLocPosM->operator()(1,1) = 0.0;
169 //fLocPosM->operator()(2,2) = ((AliTRDgeometry *) fGeom)->GetTimeBinSize()
172 // printf("rec. point: row = %f, col = %f, time = %f \n",
173 // fLocPos[0],fLocPos[1],fLocPos[2]);
177 //_____________________________________________________________________________
178 void AliTRDrecPoint::SetTrackingYZ(Float_t sigmaY, Float_t sigmaZ)
181 // Sets the position of the point in the local coordinate system
182 // of tracking sector
185 //Int_t plane = ((AliTRDgeometry *) fGeom)->GetPlane(fDetector);
186 //Int_t chamber = ((AliTRDgeometry *) fGeom)->GetChamber(fDetector);
187 //Int_t sector = ((AliTRDgeometry *) fGeom)->GetSector(fDetector);
192 //Float_t padRow = fLocPos[0]; // Pad Row position
193 //Float_t padCol = fLocPos[1]; // Pad Column position
195 //Float_t col0 = ((AliTRDgeometry *) fGeom)->GetCol0(plane);
196 //Float_t row0 = ((AliTRDgeometry *) fGeom)->GetRow0(plane,chamber,sector);
198 // Float_t offset = 0.5 * ((AliTRDgeometry *) fGeom)->GetChamberWidth(plane);
200 //fY = - (col0 + padCol * ((AliTRDgeometry *) fGeom)->GetColPadSize(plane));
201 //fZ = row0 + padRow * ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane
205 // fSigmaY = sigmaY * sigmaY;
206 // fSigmaZ = sigmaZ * sigmaZ;
208 //fSigmaY2 = 0.05 * 0.05;
210 //fSigmaZ2 = ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane,chamber,sector)
211 // * ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane,chamber,sector)
216 //_____________________________________________________________________________
217 void AliTRDrecPoint::AddTrackIndex(Int_t *track)
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;
226 const Int_t kSize = 9;
228 Int_t entries[kSize][2], i, j, index;
232 for (i=0; i<kSize; i++) {
238 for (Int_t k=0; k<kSize; k++) {
240 indexAdded=kFALSE; j=0;
242 while ( (!indexAdded) && ( j < kSize ) ) {
243 if ((entries[j][0]==index) || (entries[j][1]==0)) {
245 entries[j][1]=entries[j][1]+1;
253 // sort by number of appearances and index value
254 Int_t swap=1, tmp0, tmp1;
257 for(i=0; i<(kSize-1); i++) {
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]))) {
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;
277 fTracks[i] = entries[i][0];