]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDrecPoint.cxx
Macro for Bari's 1D pattern recognition
[u/mrichter/AliRoot.git] / TRD / AliTRDrecPoint.cxx
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$
18 Revision 1.2  2000/06/08 18:32:58  cblume
19 Make code compliant to coding conventions
20
21 Revision 1.1  2000/02/28 19:02:07  cblume
22 Add new TRD classes
23
24 */
25
26 ///////////////////////////////////////////////////////////////////////////////
27 //                                                                           //
28 //  TRD reconstructed point                                                  //
29 //                                                                           //
30 ///////////////////////////////////////////////////////////////////////////////
31
32 #include "AliTRDgeometry.h"
33 #include "AliTRDrecPoint.h"
34 #include "AliTRD.h"
35
36 ClassImp(AliTRDrecPoint)
37
38 //_____________________________________________________________________________
39 AliTRDrecPoint::AliTRDrecPoint():AliRecPoint()
40 {
41   //
42   // Standard constructor
43   //
44
45   fDetector = 0;
46
47   AliTRD *trd;
48   if ((gAlice) &&
49       (trd = ((AliTRD*) gAlice->GetDetector("TRD")))) {
50     fGeom = trd->GetGeometry();
51   }
52   else {
53     fGeom = NULL;
54   }
55
56 }
57
58 //_____________________________________________________________________________
59 AliTRDrecPoint::~AliTRDrecPoint()
60 {
61   //
62   // AliTRDrecPoint destructor
63   //
64
65 }
66
67 //_____________________________________________________________________________
68 void AliTRDrecPoint::AddDigit(Int_t digit)
69 {
70   //
71   // Adds the index of a digit to the digits list
72   //
73
74   // First resize the list 
75   // (no clusters with more than 3 digits for the TRD
76   if ((fMulDigit == 0) && (fMaxDigit >= 5)) {
77     fMaxDigit = 5;
78     delete fDigitsList;
79     fDigitsList = new int[fMaxDigit];
80   }
81
82   // Increase the size of the list if necessary
83   if (fMulDigit >= fMaxDigit) { 
84     fMaxDigit *= 2;
85     int *tempo = new (int[fMaxDigit]); 
86     Int_t index; 
87     for (index = 0; index < fMulDigit; index++)
88       tempo[index] = fDigitsList[index]; 
89     delete fDigitsList; 
90     fDigitsList = tempo; 
91   }
92   
93   fDigitsList[fMulDigit++] = digit;
94
95 }
96
97 //_____________________________________________________________________________
98 void AliTRDrecPoint::SetLocalPosition(TVector3 &pos)
99 {
100   //
101   // Sets the position of the point in the local coordinate system
102   // (row,col,time) and calculates the error matrix in the same
103   // system.
104   //
105
106   const Float_t kSq12 = 3.464101615;
107
108   // Set the position
109   fLocPos = pos;
110
111   // Set the error matrix
112   // row:  pad-size / sqrt(12)
113   // col:  not defined yet
114   // time: bin-size / sqrt(12)
115   fLocPosM->operator()(0,0) = ((AliTRDgeometry *) fGeom)->GetRowPadSize()  
116                             / kSq12;
117   fLocPosM->operator()(1,1) = 0.0;
118   fLocPosM->operator()(2,2) = ((AliTRDgeometry *) fGeom)->GetTimeBinSize() 
119                             / kSq12;
120
121 }