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