326c2d4b |
1 | // @(#) $Id$ |
d54804bf |
2 | //*************************************************************************** |
3 | // This file is property of and copyright by the ALICE HLT Project * |
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. * |
17 | //*************************************************************************** |
326c2d4b |
18 | |
19 | #include "AliHLTTPCCAParam.h" |
00d07bcd |
20 | #include "AliHLTTPCCAMath.h" |
326c2d4b |
21 | |
22 | |
00d07bcd |
23 | #if !defined(HLTCA_GPUCODE) |
24 | |
25 | GPUd() AliHLTTPCCAParam::AliHLTTPCCAParam() |
d54804bf |
26 | : fISlice(0),fNRows(63),fAlpha(0.174533), fDAlpha(0.349066), |
326c2d4b |
27 | fCosAlpha(0), fSinAlpha(0), fAngleMin(0), fAngleMax(0), fRMin(83.65), fRMax(133.3), |
d54804bf |
28 | fZMin(0.0529937), fZMax(249.778), fErrX(0), fErrY(0), fErrZ(0.228808),fPadPitch(0.4),fBz(-5.), |
693d2443 |
29 | fHitPickUpFactor(2.), |
d54804bf |
30 | fMaxTrackMatchDRow(4), fTrackConnectionFactor(3.5), fTrackChiCut(3.5), fTrackChi2Cut(10) |
326c2d4b |
31 | { |
00d07bcd |
32 | // constructor |
eb30eb49 |
33 | fParamS0Par[0][0][0] = 0.00047013; |
34 | fParamS0Par[0][0][1] = 2.00135e-05; |
35 | fParamS0Par[0][0][2] = 0.0106533; |
36 | fParamS0Par[0][0][3] = 5.27104e-08; |
37 | fParamS0Par[0][0][4] = 0.012829; |
38 | fParamS0Par[0][0][5] = 0.000147125; |
39 | fParamS0Par[0][0][6] = 4.99432; |
40 | fParamS0Par[0][1][0] = 0.000883342; |
41 | fParamS0Par[0][1][1] = 1.07011e-05; |
42 | fParamS0Par[0][1][2] = 0.0103187; |
43 | fParamS0Par[0][1][3] = 4.25141e-08; |
44 | fParamS0Par[0][1][4] = 0.0224292; |
45 | fParamS0Par[0][1][5] = 8.27274e-05; |
46 | fParamS0Par[0][1][6] = 4.17233; |
47 | fParamS0Par[0][2][0] = 0.000745399; |
48 | fParamS0Par[0][2][1] = 5.62408e-06; |
49 | fParamS0Par[0][2][2] = 0.0151562; |
50 | fParamS0Par[0][2][3] = 5.08757e-08; |
51 | fParamS0Par[0][2][4] = 0.0601004; |
52 | fParamS0Par[0][2][5] = 7.97129e-05; |
53 | fParamS0Par[0][2][6] = 4.84913; |
54 | fParamS0Par[1][0][0] = 0.00215126; |
55 | fParamS0Par[1][0][1] = 6.82233e-05; |
56 | fParamS0Par[1][0][2] = 0.0221867; |
57 | fParamS0Par[1][0][3] = -6.27825e-09; |
58 | fParamS0Par[1][0][4] = -0.00745378; |
59 | fParamS0Par[1][0][5] = 0.000172629; |
60 | fParamS0Par[1][0][6] = 6.24987; |
61 | fParamS0Par[1][1][0] = 0.00181667; |
62 | fParamS0Par[1][1][1] = -4.17772e-06; |
63 | fParamS0Par[1][1][2] = 0.0253429; |
64 | fParamS0Par[1][1][3] = 1.3011e-07; |
65 | fParamS0Par[1][1][4] = -0.00362827; |
66 | fParamS0Par[1][1][5] = 0.00030406; |
67 | fParamS0Par[1][1][6] = 17.7775; |
68 | fParamS0Par[1][2][0] = 0.00158251; |
69 | fParamS0Par[1][2][1] = -3.55911e-06; |
70 | fParamS0Par[1][2][2] = 0.0247899; |
71 | fParamS0Par[1][2][3] = 7.20604e-08; |
72 | fParamS0Par[1][2][4] = 0.0179946; |
73 | fParamS0Par[1][2][5] = 0.000425504; |
74 | fParamS0Par[1][2][6] = 20.9294; |
75 | |
326c2d4b |
76 | Update(); |
77 | } |
00d07bcd |
78 | #endif |
326c2d4b |
79 | |
00d07bcd |
80 | GPUd() void AliHLTTPCCAParam::Initialize( Int_t iSlice, |
eb30eb49 |
81 | Int_t nRows, Float_t rowX[], |
82 | Float_t alpha, Float_t dAlpha, |
83 | Float_t rMin, Float_t rMax, |
84 | Float_t zMin, Float_t zMax, |
85 | Float_t padPitch, Float_t zSigma, |
86 | Float_t bz |
326c2d4b |
87 | ) |
88 | { |
89 | // initialization |
d54804bf |
90 | fISlice = iSlice; |
91 | fAlpha = alpha; |
92 | fDAlpha = dAlpha; |
93 | fRMin = rMin; |
94 | fRMax = rMax; |
95 | fZMin = zMin; |
96 | fZMax = zMax; |
97 | fPadPitch = padPitch; |
326c2d4b |
98 | fErrY = 1.; // not in use |
d54804bf |
99 | fErrZ = zSigma; |
100 | fBz = bz; |
101 | fNRows = nRows; |
102 | for( Int_t irow=0; irow<nRows; irow++ ){ |
103 | fRowX[irow] = rowX[irow]; |
dc4788ec |
104 | } |
105 | |
326c2d4b |
106 | Update(); |
107 | } |
108 | |
00d07bcd |
109 | GPUd() void AliHLTTPCCAParam::Update() |
326c2d4b |
110 | { |
111 | // update of calculated values |
00d07bcd |
112 | fCosAlpha = CAMath::Cos(fAlpha); |
113 | fSinAlpha = CAMath::Sin(fAlpha); |
326c2d4b |
114 | fAngleMin = fAlpha - fDAlpha/2.; |
115 | fAngleMax = fAlpha + fDAlpha/2.; |
00d07bcd |
116 | fErrX = fPadPitch/CAMath::Sqrt(12.); |
326c2d4b |
117 | fTrackChi2Cut = fTrackChiCut * fTrackChiCut; |
118 | } |
119 | |
00d07bcd |
120 | GPUd() void AliHLTTPCCAParam::Slice2Global( Float_t x, Float_t y, Float_t z, |
eb30eb49 |
121 | Float_t *X, Float_t *Y, Float_t *Z ) const |
326c2d4b |
122 | { |
123 | // conversion of coorinates sector->global |
124 | *X = x*fCosAlpha - y*fSinAlpha; |
125 | *Y = y*fCosAlpha + x*fSinAlpha; |
126 | *Z = z; |
127 | } |
128 | |
00d07bcd |
129 | GPUd() void AliHLTTPCCAParam::Global2Slice( Float_t X, Float_t Y, Float_t Z, |
eb30eb49 |
130 | Float_t *x, Float_t *y, Float_t *z ) const |
326c2d4b |
131 | { |
132 | // conversion of coorinates global->sector |
133 | *x = X*fCosAlpha + Y*fSinAlpha; |
134 | *y = Y*fCosAlpha - X*fSinAlpha; |
135 | *z = Z; |
136 | } |
eb30eb49 |
137 | |
00d07bcd |
138 | GPUd() Float_t AliHLTTPCCAParam::GetClusterError2( Int_t yz, Int_t type, Float_t z, Float_t angle ) const |
eb30eb49 |
139 | { |
140 | //* recalculate the cluster error wih respect to the track slope |
141 | Float_t angle2 = angle*angle; |
00d07bcd |
142 | const Float_t *c = fParamS0Par[yz][type]; |
eb30eb49 |
143 | Float_t v = c[0] + z*(c[1] + c[3]*z) + angle2*(c[2] + angle2*c[4] + c[5]*z ); |
00d07bcd |
144 | return CAMath::Abs(v); |
eb30eb49 |
145 | } |
146 | |
00d07bcd |
147 | GPUh() void AliHLTTPCCAParam::WriteSettings( std::ostream &out ) const |
eb30eb49 |
148 | { |
00d07bcd |
149 | // write settings to the file |
4687b8fc |
150 | out << fISlice<<std::endl; |
151 | out << fNRows<<std::endl; |
152 | out << fAlpha<<std::endl; |
153 | out << fDAlpha<<std::endl; |
154 | out << fCosAlpha<<std::endl; |
155 | out << fSinAlpha<<std::endl; |
156 | out << fAngleMin<<std::endl; |
157 | out << fAngleMax<<std::endl; |
158 | out << fRMin<<std::endl; |
159 | out << fRMax<<std::endl; |
160 | out << fZMin<<std::endl; |
161 | out << fZMax<<std::endl; |
162 | out << fErrX<<std::endl; |
163 | out << fErrY<<std::endl; |
164 | out << fErrZ<<std::endl; |
165 | out << fPadPitch<<std::endl; |
166 | out << fBz<<std::endl; |
693d2443 |
167 | out << fHitPickUpFactor<<std::endl; |
4687b8fc |
168 | out << fMaxTrackMatchDRow<<std::endl; |
169 | out << fTrackConnectionFactor<<std::endl; |
170 | out << fTrackChiCut<<std::endl; |
171 | out << fTrackChi2Cut<<std::endl; |
eb30eb49 |
172 | for( Int_t iRow = 0; iRow<fNRows; iRow++ ){ |
4687b8fc |
173 | out << fRowX[iRow]<<std::endl; |
eb30eb49 |
174 | } |
4687b8fc |
175 | out<<std::endl; |
eb30eb49 |
176 | for( Int_t i=0; i<2; i++ ) |
177 | for( Int_t j=0; j<3; j++ ) |
178 | for( Int_t k=0; k<7; k++ ) |
4687b8fc |
179 | out << fParamS0Par[i][j][k]<<std::endl; |
180 | out<<std::endl; |
eb30eb49 |
181 | } |
182 | |
00d07bcd |
183 | GPUh() void AliHLTTPCCAParam::ReadSettings( std::istream &in ) |
eb30eb49 |
184 | { |
00d07bcd |
185 | // Read settings from the file |
186 | |
eb30eb49 |
187 | in >> fISlice; |
188 | in >> fNRows; |
189 | in >> fAlpha; |
190 | in >> fDAlpha; |
191 | in >> fCosAlpha; |
192 | in >> fSinAlpha; |
193 | in >> fAngleMin; |
194 | in >> fAngleMax; |
195 | in >> fRMin; |
196 | in >> fRMax; |
197 | in >> fZMin; |
198 | in >> fZMax; |
199 | in >> fErrX; |
200 | in >> fErrY; |
201 | in >> fErrZ; |
202 | in >> fPadPitch; |
203 | in >> fBz; |
693d2443 |
204 | in >> fHitPickUpFactor; |
eb30eb49 |
205 | in >> fMaxTrackMatchDRow; |
206 | in >> fTrackConnectionFactor; |
207 | in >> fTrackChiCut; |
208 | in >> fTrackChi2Cut; |
209 | for( Int_t iRow = 0; iRow<fNRows; iRow++ ){ |
210 | in >> fRowX[iRow]; |
211 | } |
212 | for( Int_t i=0; i<2; i++ ) |
213 | for( Int_t j=0; j<3; j++ ) |
214 | for( Int_t k=0; k<7; k++ ) |
215 | in >> fParamS0Par[i][j][k]; |
216 | } |