]>
Commit | Line | Data |
---|---|---|
326c2d4b | 1 | // @(#) $Id$ |
ce565086 | 2 | // ************************************************************************** |
fbb9b71b | 3 | // This file is property of and copyright by the ALICE HLT Project * |
d54804bf | 4 | // ALICE Experiment at CERN, All rights reserved. * |
5 | // * | |
6 | // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> * | |
7 | // Ivan Kisel <kisel@kip.uni-heidelberg.de> * | |
8 | // for The ALICE HLT Project. * | |
9 | // * | |
10 | // Permission to use, copy, modify and distribute this software and its * | |
11 | // documentation strictly for non-commercial purposes is hereby granted * | |
12 | // without fee, provided that the above copyright notice appears in all * | |
13 | // copies and that both the copyright notice and this permission notice * | |
14 | // appear in the supporting documentation. The authors make no claims * | |
15 | // about the suitability of this software for any purpose. It is * | |
16 | // provided "as is" without express or implied warranty. * | |
ce565086 | 17 | // * |
d54804bf | 18 | //*************************************************************************** |
326c2d4b | 19 | |
ce565086 | 20 | |
326c2d4b | 21 | #include "AliHLTTPCCAParam.h" |
00d07bcd | 22 | #include "AliHLTTPCCAMath.h" |
326c2d4b | 23 | |
24 | ||
fbb9b71b | 25 | #if !defined(HLTCA_GPUCODE) |
00d07bcd | 26 | |
27 | GPUd() AliHLTTPCCAParam::AliHLTTPCCAParam() | |
fbb9b71b | 28 | : fISlice( 0 ), fNRows( 63 ), fAlpha( 0.174533 ), fDAlpha( 0.349066 ), |
29 | fCosAlpha( 0 ), fSinAlpha( 0 ), fAngleMin( 0 ), fAngleMax( 0 ), fRMin( 83.65 ), fRMax( 133.3 ), | |
a8714ffa | 30 | fZMin( 0.0529937 ), fZMax( 249.778 ), fErrX( 0 ), fErrY( 0 ), fErrZ( 0.228808 ), fPadPitch( 0.4 ), fBzkG( -5.00668 ), |
31 | fConstBz( -5.00668*0.000299792458 ), fHitPickUpFactor( 1. ), | |
f0fb467d | 32 | fMaxTrackMatchDRow( 4 ), fNeighboursSearchArea(3.), fTrackConnectionFactor( 3.5 ), fTrackChiCut( 3.5 ), fTrackChi2Cut( 10 ), fClusterError2CorrectionY(1.), fClusterError2CorrectionZ(1.) |
326c2d4b | 33 | { |
00d07bcd | 34 | // constructor |
eb30eb49 | 35 | fParamS0Par[0][0][0] = 0.00047013; |
36 | fParamS0Par[0][0][1] = 2.00135e-05; | |
37 | fParamS0Par[0][0][2] = 0.0106533; | |
38 | fParamS0Par[0][0][3] = 5.27104e-08; | |
39 | fParamS0Par[0][0][4] = 0.012829; | |
40 | fParamS0Par[0][0][5] = 0.000147125; | |
41 | fParamS0Par[0][0][6] = 4.99432; | |
42 | fParamS0Par[0][1][0] = 0.000883342; | |
43 | fParamS0Par[0][1][1] = 1.07011e-05; | |
44 | fParamS0Par[0][1][2] = 0.0103187; | |
45 | fParamS0Par[0][1][3] = 4.25141e-08; | |
46 | fParamS0Par[0][1][4] = 0.0224292; | |
47 | fParamS0Par[0][1][5] = 8.27274e-05; | |
48 | fParamS0Par[0][1][6] = 4.17233; | |
49 | fParamS0Par[0][2][0] = 0.000745399; | |
50 | fParamS0Par[0][2][1] = 5.62408e-06; | |
51 | fParamS0Par[0][2][2] = 0.0151562; | |
52 | fParamS0Par[0][2][3] = 5.08757e-08; | |
53 | fParamS0Par[0][2][4] = 0.0601004; | |
54 | fParamS0Par[0][2][5] = 7.97129e-05; | |
55 | fParamS0Par[0][2][6] = 4.84913; | |
56 | fParamS0Par[1][0][0] = 0.00215126; | |
57 | fParamS0Par[1][0][1] = 6.82233e-05; | |
58 | fParamS0Par[1][0][2] = 0.0221867; | |
59 | fParamS0Par[1][0][3] = -6.27825e-09; | |
60 | fParamS0Par[1][0][4] = -0.00745378; | |
61 | fParamS0Par[1][0][5] = 0.000172629; | |
62 | fParamS0Par[1][0][6] = 6.24987; | |
63 | fParamS0Par[1][1][0] = 0.00181667; | |
64 | fParamS0Par[1][1][1] = -4.17772e-06; | |
65 | fParamS0Par[1][1][2] = 0.0253429; | |
66 | fParamS0Par[1][1][3] = 1.3011e-07; | |
67 | fParamS0Par[1][1][4] = -0.00362827; | |
68 | fParamS0Par[1][1][5] = 0.00030406; | |
69 | fParamS0Par[1][1][6] = 17.7775; | |
70 | fParamS0Par[1][2][0] = 0.00158251; | |
71 | fParamS0Par[1][2][1] = -3.55911e-06; | |
72 | fParamS0Par[1][2][2] = 0.0247899; | |
73 | fParamS0Par[1][2][3] = 7.20604e-08; | |
74 | fParamS0Par[1][2][4] = 0.0179946; | |
75 | fParamS0Par[1][2][5] = 0.000425504; | |
76 | fParamS0Par[1][2][6] = 20.9294; | |
77 | ||
15d2e9cf | 78 | |
326c2d4b | 79 | Update(); |
80 | } | |
81 | ||
7be9b0d7 | 82 | void AliHLTTPCCAParam::Initialize( int iSlice, |
fbb9b71b | 83 | int nRows, float rowX[], |
84 | float alpha, float dAlpha, | |
85 | float rMin, float rMax, | |
86 | float zMin, float zMax, | |
87 | float padPitch, float zSigma, | |
88 | float bz | |
89 | ) | |
326c2d4b | 90 | { |
fbb9b71b | 91 | // initialization |
d54804bf | 92 | fISlice = iSlice; |
93 | fAlpha = alpha; | |
94 | fDAlpha = dAlpha; | |
95 | fRMin = rMin; | |
96 | fRMax = rMax; | |
97 | fZMin = zMin; | |
98 | fZMax = zMax; | |
99 | fPadPitch = padPitch; | |
326c2d4b | 100 | fErrY = 1.; // not in use |
d54804bf | 101 | fErrZ = zSigma; |
91794c67 | 102 | fBzkG = bz; |
d54804bf | 103 | fNRows = nRows; |
fbb9b71b | 104 | for ( int irow = 0; irow < nRows; irow++ ) { |
d54804bf | 105 | fRowX[irow] = rowX[irow]; |
c1cab320 | 106 | //std::cout << " row " << irow << " x= " << rowX[irow] << std::endl; |
dc4788ec | 107 | } |
108 | ||
326c2d4b | 109 | Update(); |
110 | } | |
111 | ||
7be9b0d7 | 112 | void AliHLTTPCCAParam::Update() |
326c2d4b | 113 | { |
114 | // update of calculated values | |
91794c67 | 115 | |
116 | const double kCLight = 0.000299792458; | |
117 | fConstBz = fBzkG * kCLight; | |
118 | ||
119 | fPolinomialFieldBz[0] = fConstBz * ( 0.999286 ); | |
120 | fPolinomialFieldBz[1] = fConstBz * ( -4.54386e-7 ); | |
121 | fPolinomialFieldBz[2] = fConstBz * ( 2.32950e-5 ); | |
122 | fPolinomialFieldBz[3] = fConstBz * ( -2.99912e-7 ); | |
123 | fPolinomialFieldBz[4] = fConstBz * ( -2.03442e-8 ); | |
124 | fPolinomialFieldBz[5] = fConstBz * ( 9.71402e-8 ); | |
125 | ||
fbb9b71b | 126 | fCosAlpha = CAMath::Cos( fAlpha ); |
127 | fSinAlpha = CAMath::Sin( fAlpha ); | |
7be9b0d7 | 128 | fAngleMin = fAlpha - fDAlpha / 2.f; |
129 | fAngleMax = fAlpha + fDAlpha / 2.f; | |
fbb9b71b | 130 | fErrX = fPadPitch / CAMath::Sqrt( 12. ); |
326c2d4b | 131 | fTrackChi2Cut = fTrackChiCut * fTrackChiCut; |
132 | } | |
133 | ||
7be9b0d7 | 134 | #endif |
135 | ||
136 | ||
fbb9b71b | 137 | GPUd() void AliHLTTPCCAParam::Slice2Global( float x, float y, float z, |
138 | float *X, float *Y, float *Z ) const | |
139 | { | |
326c2d4b | 140 | // conversion of coorinates sector->global |
fbb9b71b | 141 | *X = x * fCosAlpha - y * fSinAlpha; |
142 | *Y = y * fCosAlpha + x * fSinAlpha; | |
326c2d4b | 143 | *Z = z; |
144 | } | |
fbb9b71b | 145 | |
146 | GPUd() void AliHLTTPCCAParam::Global2Slice( float X, float Y, float Z, | |
147 | float *x, float *y, float *z ) const | |
326c2d4b | 148 | { |
149 | // conversion of coorinates global->sector | |
fbb9b71b | 150 | *x = X * fCosAlpha + Y * fSinAlpha; |
151 | *y = Y * fCosAlpha - X * fSinAlpha; | |
326c2d4b | 152 | *z = Z; |
153 | } | |
eb30eb49 | 154 | |
fbb9b71b | 155 | GPUd() float AliHLTTPCCAParam::GetClusterError2( int yz, int type, float z, float angle ) const |
eb30eb49 | 156 | { |
157 | //* recalculate the cluster error wih respect to the track slope | |
6de2bc40 | 158 | |
fbb9b71b | 159 | float angle2 = angle * angle; |
160 | const float *c = fParamS0Par[yz][type]; | |
161 | float v = c[0] + z * ( c[1] + c[3] * z ) + angle2 * ( c[2] + angle2 * c[4] + c[5] * z ); | |
162 | return CAMath::Abs( v ); | |
eb30eb49 | 163 | } |
164 | ||
fbb9b71b | 165 | GPUd() void AliHLTTPCCAParam::GetClusterErrors2( int iRow, float z, float sinPhi, float cosPhi, float DzDs, float &Err2Y, float &Err2Z ) const |
63d8b79d | 166 | { |
167 | // | |
168 | // Use calibrated cluster error from OCDB | |
169 | // | |
170 | ||
fbb9b71b | 171 | z = CAMath::Abs( ( 250. - 0.275 ) - CAMath::Abs( z ) ); |
172 | int type = ( iRow < 63 ) ? 0 : ( ( iRow > 126 ) ? 1 : 2 ); | |
173 | float cosPhiInv = CAMath::Abs( cosPhi ) > 1.e-2 ? 1. / cosPhi : 0; | |
6de2bc40 | 174 | float angleY = sinPhi * cosPhiInv ; // dy/dx |
175 | float angleZ = DzDs * cosPhiInv ; // dz/dx | |
63d8b79d | 176 | |
fbb9b71b | 177 | Err2Y = GetClusterError2( 0, type, z, angleY ); |
178 | Err2Z = GetClusterError2( 1, type, z, angleZ ); | |
63d8b79d | 179 | } |
180 | ||
c7d6f78b | 181 | #ifndef HLTCA_GPUCODE |
fbb9b71b | 182 | GPUh() void AliHLTTPCCAParam::WriteSettings( std::ostream &out ) const |
eb30eb49 | 183 | { |
00d07bcd | 184 | // write settings to the file |
fbb9b71b | 185 | out << fISlice << std::endl; |
186 | out << fNRows << std::endl; | |
187 | out << fAlpha << std::endl; | |
188 | out << fDAlpha << std::endl; | |
189 | out << fCosAlpha << std::endl; | |
190 | out << fSinAlpha << std::endl; | |
191 | out << fAngleMin << std::endl; | |
192 | out << fAngleMax << std::endl; | |
193 | out << fRMin << std::endl; | |
194 | out << fRMax << std::endl; | |
195 | out << fZMin << std::endl; | |
196 | out << fZMax << std::endl; | |
197 | out << fErrX << std::endl; | |
198 | out << fErrY << std::endl; | |
199 | out << fErrZ << std::endl; | |
200 | out << fPadPitch << std::endl; | |
91794c67 | 201 | out << fBzkG << std::endl; |
fbb9b71b | 202 | out << fHitPickUpFactor << std::endl; |
203 | out << fMaxTrackMatchDRow << std::endl; | |
204 | out << fTrackConnectionFactor << std::endl; | |
205 | out << fTrackChiCut << std::endl; | |
206 | out << fTrackChi2Cut << std::endl; | |
207 | for ( int iRow = 0; iRow < fNRows; iRow++ ) { | |
208 | out << fRowX[iRow] << std::endl; | |
eb30eb49 | 209 | } |
fbb9b71b | 210 | out << std::endl; |
211 | for ( int i = 0; i < 2; i++ ) | |
212 | for ( int j = 0; j < 3; j++ ) | |
213 | for ( int k = 0; k < 7; k++ ) | |
214 | out << fParamS0Par[i][j][k] << std::endl; | |
215 | out << std::endl; | |
eb30eb49 | 216 | } |
217 | ||
00d07bcd | 218 | GPUh() void AliHLTTPCCAParam::ReadSettings( std::istream &in ) |
eb30eb49 | 219 | { |
00d07bcd | 220 | // Read settings from the file |
221 | ||
eb30eb49 | 222 | in >> fISlice; |
223 | in >> fNRows; | |
224 | in >> fAlpha; | |
225 | in >> fDAlpha; | |
226 | in >> fCosAlpha; | |
227 | in >> fSinAlpha; | |
228 | in >> fAngleMin; | |
229 | in >> fAngleMax; | |
230 | in >> fRMin; | |
231 | in >> fRMax; | |
232 | in >> fZMin; | |
233 | in >> fZMax; | |
234 | in >> fErrX; | |
235 | in >> fErrY; | |
236 | in >> fErrZ; | |
237 | in >> fPadPitch; | |
91794c67 | 238 | in >> fBzkG; |
693d2443 | 239 | in >> fHitPickUpFactor; |
eb30eb49 | 240 | in >> fMaxTrackMatchDRow; |
241 | in >> fTrackConnectionFactor; | |
242 | in >> fTrackChiCut; | |
243 | in >> fTrackChi2Cut; | |
fbb9b71b | 244 | for ( int iRow = 0; iRow < fNRows; iRow++ ) { |
eb30eb49 | 245 | in >> fRowX[iRow]; |
246 | } | |
fbb9b71b | 247 | for ( int i = 0; i < 2; i++ ) |
248 | for ( int j = 0; j < 3; j++ ) | |
249 | for ( int k = 0; k < 7; k++ ) | |
250 | in >> fParamS0Par[i][j][k]; | |
eb30eb49 | 251 | } |
c7d6f78b | 252 | #endif |