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():AliRecPoint()
35 // Standard constructor
40 fGeom = AliTRDgeometry::GetGeometry();
44 //_____________________________________________________________________________
45 AliTRDrecPoint::AliTRDrecPoint(const char * opt):AliRecPoint(opt)
48 // Standard constructor
53 fGeom = AliTRDgeometry::GetGeometry();
57 //_____________________________________________________________________________
58 AliTRDrecPoint::~AliTRDrecPoint()
61 // AliTRDrecPoint destructor
66 //_____________________________________________________________________________
67 void AliTRDrecPoint::AddDigit(Int_t digit)
70 // Adds the index of a digit to the digits list
73 // First resize the list
74 // (no clusters with more than 3 digits for the TRD
75 if ((fMulDigit == 0) && (fMaxDigit >= 5)) {
78 fDigitsList = new int[fMaxDigit];
81 // Increase the size of the list if necessary
82 if (fMulDigit >= fMaxDigit) {
84 Int_t *tempo = new Int_t[fMaxDigit];
86 for (index = 0; index < fMulDigit; index++)
87 tempo[index] = fDigitsList[index];
92 fDigitsList[fMulDigit++] = digit;
96 //_____________________________________________________________________________
97 void AliTRDrecPoint::SetLocalPosition(TVector3 & /*pos*/)
100 // Sets the position of the point in the local coordinate system
101 // (row,col,time) and calculates the error matrix in the same
105 //const Float_t kSq12 = 3.464101615;
110 // Set the error matrix
111 // row: pad-size / sqrt(12)
112 // col: not defined yet
113 // time: bin-size / sqrt(12)
114 //Int_t plane = ((AliTRDgeometry *) fGeom)->GetPlane(fDetector);
115 //Int_t chamber = ((AliTRDgeometry *) fGeom)->GetChamber(fDetector);
116 //Int_t sector = ((AliTRDgeometry *) fGeom)->GetSector(fDetector);
117 //fLocPosM->operator()(0,0) = ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane
121 //fLocPosM->operator()(1,1) = 0.0;
122 //fLocPosM->operator()(2,2) = ((AliTRDgeometry *) fGeom)->GetTimeBinSize()
125 // printf("rec. point: row = %f, col = %f, time = %f \n",
126 // fLocPos[0],fLocPos[1],fLocPos[2]);
130 //_____________________________________________________________________________
131 void AliTRDrecPoint::SetTrackingYZ(Float_t /*sigmaY*/, Float_t /*sigmaZ*/)
134 // Sets the position of the point in the local coordinate system
135 // of tracking sector
138 //Int_t plane = ((AliTRDgeometry *) fGeom)->GetPlane(fDetector);
139 //Int_t chamber = ((AliTRDgeometry *) fGeom)->GetChamber(fDetector);
140 //Int_t sector = ((AliTRDgeometry *) fGeom)->GetSector(fDetector);
145 //Float_t padRow = fLocPos[0]; // Pad Row position
146 //Float_t padCol = fLocPos[1]; // Pad Column position
148 //Float_t col0 = ((AliTRDgeometry *) fGeom)->GetCol0(plane);
149 //Float_t row0 = ((AliTRDgeometry *) fGeom)->GetRow0(plane,chamber,sector);
151 // Float_t offset = 0.5 * ((AliTRDgeometry *) fGeom)->GetChamberWidth(plane);
153 //fY = - (col0 + padCol * ((AliTRDgeometry *) fGeom)->GetColPadSize(plane));
154 //fZ = row0 + padRow * ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane
158 // fSigmaY = sigmaY * sigmaY;
159 // fSigmaZ = sigmaZ * sigmaZ;
161 //fSigmaY2 = 0.05 * 0.05;
163 //fSigmaZ2 = ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane,chamber,sector)
164 // * ((AliTRDgeometry *) fGeom)->GetRowPadSize(plane,chamber,sector)
169 //_____________________________________________________________________________
170 void AliTRDrecPoint::AddTrackIndex(Int_t *track)
172 // Adds track index. Currently assumed that track is an array of
173 // size 9, and up to 3 track indexes are stored in fTracks[3].
174 // Indexes are sorted according to:
175 // 1) index of max number of appearances is stored first
176 // 2) if two or more indexes appear equal number of times, the lowest
177 // ones are stored first;
179 const Int_t kSize = 9;
181 Int_t entries[kSize][2], i, j, index;
185 for (i=0; i<kSize; i++) {
191 for (Int_t k=0; k<kSize; k++) {
193 indexAdded=kFALSE; j=0;
195 while ( (!indexAdded) && ( j < kSize ) ) {
196 if ((entries[j][0]==index) || (entries[j][1]==0)) {
198 entries[j][1]=entries[j][1]+1;
206 // sort by number of appearances and index value
207 Int_t swap=1, tmp0, tmp1;
210 for(i=0; i<(kSize-1); i++) {
211 if ((entries[i][0] >= 0) && (entries[i+1][0] >= 0)) {
212 if ((entries[i][1] < entries[i+1][1]) ||
213 ((entries[i][1] == entries[i+1][1]) &&
214 (entries[i][0] > entries[i+1][0]))) {
217 entries[i][0]=entries[i+1][0];
218 entries[i][1]=entries[i+1][1];
219 entries[i+1][0]=tmp0;
220 entries[i+1][1]=tmp1;
230 fTracks[i] = entries[i][0];