]>
Commit | Line | Data |
---|---|---|
a6c02c85 | 1 | // @(#) $Id$ |
c2f37813 | 2 | // Original: AliL3Transform.cxx,v 1.53 2005/06/14 10:55:21 cvetan |
a6c02c85 | 3 | |
4 | // Author: Anders Vestbo <mailto:vestbo@fi.uib.no>, Uli Frankenfeld <mailto:franken@fi.uib.no>, Constantin Loizides <mailto:loizides@ikf.uni-frankfurt.de> | |
5 | //*-- Copyright © ALICE HLT Group | |
6 | ||
7 | ||
a6c02c85 | 8 | #include "dirent.h" |
9 | ||
10 | #ifdef use_aliroot | |
11 | #include <AliRun.h> | |
12 | #include <AliMagF.h> | |
13 | #include <AliTPCParamSR.h> | |
14 | #include <AliTPCPRF2D.h> | |
15 | #include <AliTPCRF1D.h> | |
16 | #endif | |
17 | #ifdef use_root | |
18 | #include <TFile.h> | |
19 | #include <TUnixSystem.h> | |
20 | #include <TTimeStamp.h> | |
21 | #include <TError.h> | |
22 | #endif | |
23 | ||
24 | #include "AliHLTTPCLogging.h" | |
25 | #include "AliHLTTPCTransform.h" | |
26 | ||
27 | #if defined(__GNUC__) && __GNUC__ >= 3 | |
28 | using namespace std; | |
29 | #endif | |
30 | ||
31 | /** \class AliHLTTPCTransform | |
32 | <pre> | |
33 | //_____________________________________________________________ | |
34 | // AliHLTTPCTransform | |
35 | // | |
36 | // Transformation class for ALICE TPC. | |
37 | // | |
38 | // Class which contains all detector specific parameters for the TPC, | |
39 | // and different useful functions for coordinate transforms. | |
40 | // | |
41 | // The class is completely static, which means that no object needs | |
42 | // to be instantiated. Function calls should then be done like, e.g.: | |
43 | // | |
44 | // Double_t eta = AliHLTTPCTransform::GetEta(xyz); | |
45 | // | |
46 | // IMPORTANT: If used as is, default detector parameters will be used, | |
47 | // and you really have to make sure that these correspond to | |
48 | // the AliROOT version you are currently working on!! | |
49 | // You should therefore always initialize the parameters by | |
50 | // | |
51 | // AliHLTTPCTransform::Init(path); | |
52 | // | |
53 | // where path is a char*, giving the path to where file containing | |
54 | // the detector parameter is located. This file should be called | |
55 | // "l3transform.config", and can be created with the function MakeInitFile. | |
56 | // | |
57 | // You can also force reading the parameters from a AliTPCParam object | |
58 | // by setting the flag; | |
59 | // | |
60 | // AliHLTTPCTransform::Init(path,kTRUE); | |
61 | // | |
62 | // where path is a char* | |
63 | // either providing the rootfile name containing the geometry or | |
64 | // the path to the rootfile which should then be called alirunfile.root. | |
65 | // Note that for both of these cases you have to | |
66 | // compile with USEPACKAGE=ALIROOT set (see level3code/Makefile.conf). | |
67 | // | |
68 | // Currently, there are 4 versions of the Transformer: | |
69 | // fVersion==kValiroot: ALIROOT-head compatible | |
70 | // fVersion==kVcosmics: Cosmics data run (2003) compatible | |
71 | // fVersion==kVdefault: means no config file has been loaded | |
72 | // fVersion==kVdeprecated: dont use old (before July 2003) style of transformer | |
73 | // | |
74 | </pre> | |
75 | */ | |
76 | ||
77 | ClassImp(AliHLTTPCTransform) | |
78 | ||
79 | const Double_t AliHLTTPCTransform::fgkAnodeWireSpacing = 0.25; //Taken from the TDR | |
80 | const Double_t AliHLTTPCTransform::fgkBFACT = 0.0029980; //Conversion Factor | |
81 | const Double_t AliHLTTPCTransform::fgkPi = 3.141592653589793; | |
82 | const Double_t AliHLTTPCTransform::fgk2Pi = 2*3.141592653589793; | |
83 | const Double_t AliHLTTPCTransform::fgkPi2 = 0.5*3.141592653589793; | |
84 | const Double_t AliHLTTPCTransform::fgkToDeg = 180/3.141592653589793; | |
85 | ||
86 | //Defined by HLT and GSI | |
87 | Int_t AliHLTTPCTransform::fgNPatches = 6; | |
88 | #if 0 | |
89 | // Old format, corresponding to IntegrTest-5 code and data | |
90 | Int_t AliHLTTPCTransform::fgRows[6][2] = {{0,29},{30,62},{63,90},{91,116},{117,139},{140,158}}; | |
91 | Int_t AliHLTTPCTransform::fgNRows[6] = {30,33,28,26,23,19}; | |
92 | #else | |
93 | // New data corresponding to simulated raw data 2004-08-20, provided by Thomas Kuhr | |
94 | Int_t AliHLTTPCTransform::fgRows[6][2] = {{0,30},{30,62},{63,90},{90,116},{117,139},{139,158}}; | |
95 | Int_t AliHLTTPCTransform::fgNRows[6] = {31,33,28,27,23,20}; | |
96 | #endif | |
97 | ||
98 | // The following definition is generated by MakeInitFile function | |
99 | Double_t AliHLTTPCTransform::fgBField = 0.2; | |
100 | Double_t AliHLTTPCTransform::fgSolenoidBField = 2; | |
101 | Double_t AliHLTTPCTransform::fgBFieldFactor = 1; | |
102 | Int_t AliHLTTPCTransform::fgVersion = kVdefault; | |
5235c3e9 | 103 | Int_t AliHLTTPCTransform::fgNTimeBins = 1024; // = 1024; //446 |
a6c02c85 | 104 | Int_t AliHLTTPCTransform::fgNRowLow = 63; |
105 | Int_t AliHLTTPCTransform::fgNRowUp = 96; | |
106 | Int_t AliHLTTPCTransform::fgNRowUp1 = 64; | |
107 | Int_t AliHLTTPCTransform::fgNRowUp2 = 32; | |
108 | Int_t AliHLTTPCTransform::fgNSectorLow = 36; | |
109 | Int_t AliHLTTPCTransform::fgNSectorUp = 36; | |
110 | Int_t AliHLTTPCTransform::fgNSector = 72; | |
111 | Double_t AliHLTTPCTransform::fgPadPitchWidthLow = 0.4; | |
112 | Double_t AliHLTTPCTransform::fgPadPitchWidthUp = 0.6; | |
a6c02c85 | 113 | Double_t AliHLTTPCTransform::fgZSigma = 0.2288; |
114 | Double_t AliHLTTPCTransform::fgZLength = 250.0000; | |
5235c3e9 | 115 | Double_t AliHLTTPCTransform::fgZWidth = AliHLTTPCTransform::fgZLength / (Double_t)AliHLTTPCTransform::fgNTimeBins ;//0.5660; // 0.2435; // 0.5660 // Width of time bins |
a6c02c85 | 116 | Double_t AliHLTTPCTransform::fgZOffset = 0.6864; |
117 | Double_t AliHLTTPCTransform::fgDiffT = 0.0220; | |
118 | Double_t AliHLTTPCTransform::fgDiffL = 0.0220; | |
119 | Double_t AliHLTTPCTransform::fgOmegaTau = 0.1450; | |
120 | Double_t AliHLTTPCTransform::fgInnerPadLength = 0.75; | |
121 | Double_t AliHLTTPCTransform::fgOuter1PadLength = 1.00; | |
122 | Double_t AliHLTTPCTransform::fgOuter2PadLength = 1.50; | |
123 | Double_t AliHLTTPCTransform::fgInnerPRFSigma = 0.203811; | |
124 | Double_t AliHLTTPCTransform::fgOuter1PRFSigma = 0.299325; | |
125 | Double_t AliHLTTPCTransform::fgOuter2PRFSigma = 0.299323; | |
126 | Double_t AliHLTTPCTransform::fgTimeSigma = 0.228809; | |
127 | Int_t AliHLTTPCTransform::fgADCSat = 1024; | |
128 | Int_t AliHLTTPCTransform::fgZeroSup = 0; | |
129 | Int_t AliHLTTPCTransform::fgNSlice = 36; | |
130 | Int_t AliHLTTPCTransform::fgNRow = 159; | |
131 | Double_t AliHLTTPCTransform::fgNRotShift = 0.5; | |
132 | Int_t AliHLTTPCTransform::fgSlice2Sector[36][2] = { { 0, 36}, | |
133 | { 1, 37}, | |
134 | { 2, 38}, | |
135 | { 3, 39}, | |
136 | { 4, 40}, | |
137 | { 5, 41}, | |
138 | { 6, 42}, | |
139 | { 7, 43}, | |
140 | { 8, 44}, | |
141 | { 9, 45}, | |
142 | {10, 46}, | |
143 | {11, 47}, | |
144 | {12, 48}, | |
145 | {13, 49}, | |
146 | {14, 50}, | |
147 | {15, 51}, | |
148 | {16, 52}, | |
149 | {17, 53}, | |
150 | {18, 54}, | |
151 | {19, 55}, | |
152 | {20, 56}, | |
153 | {21, 57}, | |
154 | {22, 58}, | |
155 | {23, 59}, | |
156 | {24, 60}, | |
157 | {25, 61}, | |
158 | {26, 62}, | |
159 | {27, 63}, | |
160 | {28, 64}, | |
161 | {29, 65}, | |
162 | {30, 66}, | |
163 | {31, 67}, | |
164 | {32, 68}, | |
165 | {33, 69}, | |
166 | {34, 70}, | |
167 | {35, 71} | |
168 | }; | |
169 | ||
170 | Int_t AliHLTTPCTransform::fgSector2Slice[72] = { 0, | |
171 | 1, | |
172 | 2, | |
173 | 3, | |
174 | 4, | |
175 | 5, | |
176 | 6, | |
177 | 7, | |
178 | 8, | |
179 | 9, | |
180 | 10, | |
181 | 11, | |
182 | 12, | |
183 | 13, | |
184 | 14, | |
185 | 15, | |
186 | 16, | |
187 | 17, | |
188 | 18, | |
189 | 19, | |
190 | 20, | |
191 | 21, | |
192 | 22, | |
193 | 23, | |
194 | 24, | |
195 | 25, | |
196 | 26, | |
197 | 27, | |
198 | 28, | |
199 | 29, | |
200 | 30, | |
201 | 31, | |
202 | 32, | |
203 | 33, | |
204 | 34, | |
205 | 35, | |
206 | 0, | |
207 | 1, | |
208 | 2, | |
209 | 3, | |
210 | 4, | |
211 | 5, | |
212 | 6, | |
213 | 7, | |
214 | 8, | |
215 | 9, | |
216 | 10, | |
217 | 11, | |
218 | 12, | |
219 | 13, | |
220 | 14, | |
221 | 15, | |
222 | 16, | |
223 | 17, | |
224 | 18, | |
225 | 19, | |
226 | 20, | |
227 | 21, | |
228 | 22, | |
229 | 23, | |
230 | 24, | |
231 | 25, | |
232 | 26, | |
233 | 27, | |
234 | 28, | |
235 | 29, | |
236 | 30, | |
237 | 31, | |
238 | 32, | |
239 | 33, | |
240 | 34, | |
241 | 35 | |
242 | }; | |
243 | ||
244 | Int_t AliHLTTPCTransform::fgSectorLow[72] = { 1, | |
245 | 1, | |
246 | 1, | |
247 | 1, | |
248 | 1, | |
249 | 1, | |
250 | 1, | |
251 | 1, | |
252 | 1, | |
253 | 1, | |
254 | 1, | |
255 | 1, | |
256 | 1, | |
257 | 1, | |
258 | 1, | |
259 | 1, | |
260 | 1, | |
261 | 1, | |
262 | 1, | |
263 | 1, | |
264 | 1, | |
265 | 1, | |
266 | 1, | |
267 | 1, | |
268 | 1, | |
269 | 1, | |
270 | 1, | |
271 | 1, | |
272 | 1, | |
273 | 1, | |
274 | 1, | |
275 | 1, | |
276 | 1, | |
277 | 1, | |
278 | 1, | |
279 | 1, | |
280 | 0, | |
281 | 0, | |
282 | 0, | |
283 | 0, | |
284 | 0, | |
285 | 0, | |
286 | 0, | |
287 | 0, | |
288 | 0, | |
289 | 0, | |
290 | 0, | |
291 | 0, | |
292 | 0, | |
293 | 0, | |
294 | 0, | |
295 | 0, | |
296 | 0, | |
297 | 0, | |
298 | 0, | |
299 | 0, | |
300 | 0, | |
301 | 0, | |
302 | 0, | |
303 | 0, | |
304 | 0, | |
305 | 0, | |
306 | 0, | |
307 | 0, | |
308 | 0, | |
309 | 0, | |
310 | 0, | |
311 | 0, | |
312 | 0, | |
313 | 0, | |
314 | 0, | |
315 | 0 | |
316 | }; | |
317 | ||
318 | Double_t AliHLTTPCTransform::fgX[159] = { 85.195, | |
319 | 85.945, | |
320 | 86.695, | |
321 | 87.445, | |
322 | 88.195, | |
323 | 88.945, | |
324 | 89.695, | |
325 | 90.445, | |
326 | 91.195, | |
327 | 91.945, | |
328 | 92.695, | |
329 | 93.445, | |
330 | 94.195, | |
331 | 94.945, | |
332 | 95.695, | |
333 | 96.445, | |
334 | 97.195, | |
335 | 97.945, | |
336 | 98.695, | |
337 | 99.445, | |
338 | 100.195, | |
339 | 100.945, | |
340 | 101.695, | |
341 | 102.445, | |
342 | 103.195, | |
343 | 103.945, | |
344 | 104.695, | |
345 | 105.445, | |
346 | 106.195, | |
347 | 106.945, | |
348 | 107.695, | |
349 | 108.445, | |
350 | 109.195, | |
351 | 109.945, | |
352 | 110.695, | |
353 | 111.445, | |
354 | 112.195, | |
355 | 112.945, | |
356 | 113.695, | |
357 | 114.445, | |
358 | 115.195, | |
359 | 115.945, | |
360 | 116.695, | |
361 | 117.445, | |
362 | 118.195, | |
363 | 118.945, | |
364 | 119.695, | |
365 | 120.445, | |
366 | 121.195, | |
367 | 121.945, | |
368 | 122.695, | |
369 | 123.445, | |
370 | 124.195, | |
371 | 124.945, | |
372 | 125.695, | |
373 | 126.445, | |
374 | 127.195, | |
375 | 127.945, | |
376 | 128.695, | |
377 | 129.445, | |
378 | 130.195, | |
379 | 130.945, | |
380 | 131.695, | |
381 | 135.180, | |
382 | 136.180, | |
383 | 137.180, | |
384 | 138.180, | |
385 | 139.180, | |
386 | 140.180, | |
387 | 141.180, | |
388 | 142.180, | |
389 | 143.180, | |
390 | 144.180, | |
391 | 145.180, | |
392 | 146.180, | |
393 | 147.180, | |
394 | 148.180, | |
395 | 149.180, | |
396 | 150.180, | |
397 | 151.180, | |
398 | 152.180, | |
399 | 153.180, | |
400 | 154.180, | |
401 | 155.180, | |
402 | 156.180, | |
403 | 157.180, | |
404 | 158.180, | |
405 | 159.180, | |
406 | 160.180, | |
407 | 161.180, | |
408 | 162.180, | |
409 | 163.180, | |
410 | 164.180, | |
411 | 165.180, | |
412 | 166.180, | |
413 | 167.180, | |
414 | 168.180, | |
415 | 169.180, | |
416 | 170.180, | |
417 | 171.180, | |
418 | 172.180, | |
419 | 173.180, | |
420 | 174.180, | |
421 | 175.180, | |
422 | 176.180, | |
423 | 177.180, | |
424 | 178.180, | |
425 | 179.180, | |
426 | 180.180, | |
427 | 181.180, | |
428 | 182.180, | |
429 | 183.180, | |
430 | 184.180, | |
431 | 185.180, | |
432 | 186.180, | |
433 | 187.180, | |
434 | 188.180, | |
435 | 189.180, | |
436 | 190.180, | |
437 | 191.180, | |
438 | 192.180, | |
439 | 193.180, | |
440 | 194.180, | |
441 | 195.180, | |
442 | 196.180, | |
443 | 197.180, | |
444 | 198.180, | |
445 | 199.430, | |
446 | 200.930, | |
447 | 202.430, | |
448 | 203.930, | |
449 | 205.430, | |
450 | 206.930, | |
451 | 208.430, | |
452 | 209.930, | |
453 | 211.430, | |
454 | 212.930, | |
455 | 214.430, | |
456 | 215.930, | |
457 | 217.430, | |
458 | 218.930, | |
459 | 220.430, | |
460 | 221.930, | |
461 | 223.430, | |
462 | 224.930, | |
463 | 226.430, | |
464 | 227.930, | |
465 | 229.430, | |
466 | 230.930, | |
467 | 232.430, | |
468 | 233.930, | |
469 | 235.430, | |
470 | 236.930, | |
471 | 238.430, | |
472 | 239.930, | |
473 | 241.430, | |
474 | 242.930, | |
475 | 244.430, | |
476 | 245.930 | |
477 | }; | |
478 | ||
84645eb0 | 479 | #if 1 |
db16520a | 480 | // New number of pads changed 2006-04-15 Jochen Thaeder |
481 | // changed according to formula in AliTPCROC.cxx | |
482 | // according to real Pad Distribution on build TPC | |
483 | Int_t AliHLTTPCTransform::fgNPads[159] = {68, | |
484 | 68, | |
485 | 68, | |
486 | 68, | |
487 | 70, | |
488 | 70, | |
489 | 70, | |
490 | 72, | |
491 | 72, | |
492 | 72, | |
493 | 74, | |
494 | 74, | |
495 | 74, | |
496 | 76, | |
497 | 76, | |
498 | 76, | |
499 | 78, | |
500 | 78, | |
501 | 78, | |
502 | 80, | |
503 | 80, | |
504 | 80, | |
505 | 82, | |
506 | 82, | |
507 | 82, | |
508 | 84, | |
509 | 84, | |
510 | 84, | |
511 | 86, | |
512 | 86, | |
513 | 86, | |
514 | 88, | |
515 | 88, | |
516 | 88, | |
517 | 90, | |
518 | 90, | |
519 | 90, | |
520 | 92, | |
521 | 92, | |
522 | 92, | |
523 | 94, | |
524 | 94, | |
525 | 94, | |
526 | 96, | |
527 | 96, | |
528 | 96, | |
529 | 98, | |
530 | 98, | |
531 | 98, | |
532 | 100, | |
533 | 100, | |
534 | 100, | |
535 | 102, | |
536 | 102, | |
537 | 102, | |
538 | 104, | |
539 | 104, | |
540 | 104, | |
541 | 106, | |
542 | 106, | |
543 | 106, | |
544 | 108, | |
545 | 108, | |
546 | 74, | |
547 | 76, | |
548 | 76, | |
549 | 76, | |
550 | 76, | |
551 | 78, | |
552 | 78, | |
553 | 78, | |
554 | 80, | |
555 | 80, | |
556 | 80, | |
557 | 80, | |
558 | 82, | |
559 | 82, | |
560 | 82, | |
561 | 84, | |
562 | 84, | |
563 | 84, | |
564 | 86, | |
565 | 86, | |
566 | 86, | |
567 | 86, | |
568 | 88, | |
569 | 88, | |
570 | 88, | |
571 | 90, | |
572 | 90, | |
573 | 90, | |
574 | 90, | |
575 | 92, | |
576 | 92, | |
577 | 92, | |
578 | 94, | |
579 | 94, | |
580 | 94, | |
581 | 96, | |
582 | 96, | |
583 | 96, | |
584 | 96, | |
585 | 98, | |
586 | 98, | |
587 | 98, | |
588 | 100, | |
589 | 100, | |
590 | 100, | |
591 | 100, | |
592 | 102, | |
593 | 102, | |
594 | 102, | |
595 | 104, | |
596 | 104, | |
597 | 104, | |
598 | 106, | |
599 | 106, | |
600 | 106, | |
601 | 106, | |
602 | 108, | |
603 | 108, | |
604 | 108, | |
605 | 110, | |
606 | 110, | |
607 | 110, | |
608 | 110, | |
609 | 112, | |
610 | 112, | |
611 | 114, | |
612 | 114, | |
613 | 114, | |
614 | 116, | |
615 | 116, | |
616 | 118, | |
617 | 118, | |
618 | 120, | |
619 | 120, | |
620 | 122, | |
621 | 122, | |
622 | 122, | |
623 | 124, | |
624 | 124, | |
625 | 126, | |
626 | 126, | |
627 | 128, | |
628 | 128, | |
629 | 130, | |
630 | 130, | |
631 | 130, | |
632 | 132, | |
633 | 132, | |
634 | 134, | |
635 | 134, | |
636 | 136, | |
637 | 136, | |
638 | 138, | |
639 | 138, | |
640 | 138, | |
641 | 140 | |
642 | }; | |
643 | ||
644 | #else | |
645 | // OLD number of pads changed 2006-04-15 Jochen Thaeder | |
a6c02c85 | 646 | Int_t AliHLTTPCTransform::fgNPads[159] = {67, |
647 | 67, | |
648 | 69, | |
649 | 69, | |
650 | 69, | |
651 | 71, | |
652 | 71, | |
653 | 71, | |
654 | 73, | |
655 | 73, | |
656 | 73, | |
657 | 75, | |
658 | 75, | |
659 | 75, | |
660 | 77, | |
661 | 77, | |
662 | 77, | |
663 | 79, | |
664 | 79, | |
665 | 79, | |
666 | 81, | |
667 | 81, | |
668 | 81, | |
669 | 83, | |
670 | 83, | |
671 | 83, | |
672 | 85, | |
673 | 85, | |
674 | 85, | |
675 | 87, | |
676 | 87, | |
677 | 87, | |
678 | 89, | |
679 | 89, | |
680 | 89, | |
681 | 91, | |
682 | 91, | |
683 | 91, | |
684 | 93, | |
685 | 93, | |
686 | 93, | |
687 | 95, | |
688 | 95, | |
689 | 95, | |
690 | 97, | |
691 | 97, | |
692 | 97, | |
693 | 99, | |
694 | 99, | |
695 | 99, | |
696 | 99, | |
697 | 101, | |
698 | 101, | |
699 | 101, | |
700 | 103, | |
701 | 103, | |
702 | 103, | |
703 | 105, | |
704 | 105, | |
705 | 105, | |
706 | 107, | |
707 | 107, | |
708 | 107, | |
709 | 73, | |
710 | 75, | |
711 | 75, | |
712 | 75, | |
713 | 75, | |
714 | 77, | |
715 | 77, | |
716 | 77, | |
717 | 79, | |
718 | 79, | |
719 | 79, | |
720 | 81, | |
721 | 81, | |
722 | 81, | |
723 | 81, | |
724 | 83, | |
725 | 83, | |
726 | 83, | |
727 | 85, | |
728 | 85, | |
729 | 85, | |
730 | 85, | |
731 | 87, | |
732 | 87, | |
733 | 87, | |
734 | 89, | |
735 | 89, | |
736 | 89, | |
737 | 91, | |
738 | 91, | |
739 | 91, | |
740 | 91, | |
741 | 93, | |
742 | 93, | |
743 | 93, | |
744 | 95, | |
745 | 95, | |
746 | 95, | |
747 | 95, | |
748 | 97, | |
749 | 97, | |
750 | 97, | |
751 | 99, | |
752 | 99, | |
753 | 99, | |
754 | 101, | |
755 | 101, | |
756 | 101, | |
757 | 101, | |
758 | 103, | |
759 | 103, | |
760 | 103, | |
761 | 105, | |
762 | 105, | |
763 | 105, | |
764 | 105, | |
765 | 107, | |
766 | 107, | |
767 | 107, | |
768 | 109, | |
769 | 109, | |
770 | 109, | |
771 | 111, | |
772 | 111, | |
773 | 111, | |
774 | 113, | |
775 | 113, | |
776 | 113, | |
777 | 115, | |
778 | 115, | |
779 | 117, | |
780 | 117, | |
781 | 119, | |
782 | 119, | |
783 | 121, | |
784 | 121, | |
785 | 121, | |
786 | 123, | |
787 | 123, | |
788 | 125, | |
789 | 125, | |
790 | 127, | |
791 | 127, | |
792 | 127, | |
793 | 129, | |
794 | 129, | |
795 | 131, | |
796 | 131, | |
797 | 133, | |
798 | 133, | |
799 | 135, | |
800 | 135, | |
801 | 135, | |
802 | 137, | |
803 | 137, | |
804 | 139 | |
805 | }; | |
db16520a | 806 | #endif |
a6c02c85 | 807 | |
808 | Double_t AliHLTTPCTransform::fgCos[36] = { 0.9848077297, | |
809 | 0.8660253882, | |
810 | 0.6427876353, | |
811 | 0.3420201540, | |
812 | 0.0000000000, | |
813 | -0.3420201540, | |
814 | -0.6427876353, | |
815 | -0.8660253882, | |
816 | -0.9848077297, | |
817 | -0.9848077297, | |
818 | -0.8660253882, | |
819 | -0.6427876353, | |
820 | -0.3420201540, | |
821 | -0.0000000000, | |
822 | 0.3420201540, | |
823 | 0.6427876353, | |
824 | 0.8660253882, | |
825 | 0.9848077297, | |
826 | 0.9848077297, | |
827 | 0.8660253882, | |
828 | 0.6427876353, | |
829 | 0.3420201540, | |
830 | 0.0000000000, | |
831 | -0.3420201540, | |
832 | -0.6427876353, | |
833 | -0.8660253882, | |
834 | -0.9848077297, | |
835 | -0.9848077297, | |
836 | -0.8660253882, | |
837 | -0.6427876353, | |
838 | -0.3420201540, | |
839 | -0.0000000000, | |
840 | 0.3420201540, | |
841 | 0.6427876353, | |
842 | 0.8660253882, | |
843 | 0.9848077297 | |
844 | }; | |
845 | ||
846 | Double_t AliHLTTPCTransform::fgSin[36] = { 0.1736481786, | |
847 | 0.5000000000, | |
848 | 0.7660444379, | |
849 | 0.9396926165, | |
850 | 1.0000000000, | |
851 | 0.9396926165, | |
852 | 0.7660444379, | |
853 | 0.5000000000, | |
854 | 0.1736481786, | |
855 | -0.1736481786, | |
856 | -0.5000000000, | |
857 | -0.7660444379, | |
858 | -0.9396926165, | |
859 | -1.0000000000, | |
860 | -0.9396926165, | |
861 | -0.7660444379, | |
862 | -0.5000000000, | |
863 | -0.1736481786, | |
864 | 0.1736481786, | |
865 | 0.5000000000, | |
866 | 0.7660444379, | |
867 | 0.9396926165, | |
868 | 1.0000000000, | |
869 | 0.9396926165, | |
870 | 0.7660444379, | |
871 | 0.5000000000, | |
872 | 0.1736481786, | |
873 | -0.1736481786, | |
874 | -0.5000000000, | |
875 | -0.7660444379, | |
876 | -0.9396926165, | |
877 | -1.0000000000, | |
878 | -0.9396926165, | |
879 | -0.7660444379, | |
880 | -0.5000000000, | |
881 | -0.1736481786 | |
882 | }; | |
883 | ||
884 | #ifdef use_aliroot | |
885 | Bool_t AliHLTTPCTransform::Init(AliRunLoader *runLoader) | |
886 | { | |
887 | //init with runloader | |
888 | if(!runLoader) { | |
889 | LOG(AliHLTTPCLog::kFatal,"AliHLTTPCTransform::Init","RunLoader") | |
890 | <<" Missing RunLoader! 0x0"<<ENDLOG; | |
891 | return kFALSE; | |
892 | } | |
893 | ||
894 | if(fgVersion != kVdefault) | |
895 | LOG(AliHLTTPCLog::kWarning,"AliHLTTPCTransform::Init","Init values") | |
896 | <<AliHLTTPCLog::kDec<<"You are initializing the parameters more than once; check your code please! "<<fgVersion<<ENDLOG; | |
897 | ||
898 | TDirectory* savedir1 = gDirectory; | |
899 | runLoader->CdGAFile(); | |
900 | AliTPCParamSR *param=(AliTPCParamSR*)gDirectory->Get(GetParamName()); | |
901 | savedir1->cd(); | |
902 | if(!param) | |
903 | { | |
904 | LOG(AliHLTTPCLog::kFatal,"AliHLTTPCTransform::Init","File") | |
905 | <<"No TPC parameters found!"<<ENDLOG; | |
906 | return kFALSE; | |
907 | } | |
908 | ||
909 | AliTPCPRF2D * prfinner = new AliTPCPRF2D; | |
910 | AliTPCPRF2D * prfouter1 = new AliTPCPRF2D; | |
911 | AliTPCPRF2D * prfouter2 = new AliTPCPRF2D; | |
912 | AliTPCRF1D * rf = new AliTPCRF1D(kTRUE); | |
913 | rf->SetGauss(param->GetZSigma(),param->GetZWidth(),1.); | |
914 | rf->SetOffset(3*param->GetZSigma()); | |
915 | rf->Update(); | |
916 | ||
917 | TDirectory *savedir2=gDirectory; | |
918 | TFile *prf_file = TFile::Open("$ALICE_ROOT/TPC/AliTPCprf2d.root"); | |
919 | if (!prf_file->IsOpen()) | |
920 | { | |
921 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Init","File") | |
922 | <<"Can't open $ALICE_ROOT/TPC/AliTPCprf2d.root !"<<ENDLOG; | |
923 | return kFALSE; | |
924 | } | |
925 | prfinner ->Read("prf_07504_Gati_056068_d02"); | |
926 | prfouter1->Read("prf_10006_Gati_047051_d03"); | |
927 | prfouter2->Read("prf_15006_Gati_047051_d03"); | |
928 | prf_file->Close(); | |
929 | savedir2->cd(); | |
930 | ||
931 | param->SetInnerPRF(prfinner); | |
932 | param->SetOuter1PRF(prfouter1); | |
933 | param->SetOuter2PRF(prfouter2); | |
934 | param->SetTimeRF(rf); | |
935 | ||
936 | fgNTimeBins = param->GetMaxTBin()+1; | |
937 | fgNRowLow = param->GetNRowLow(); | |
938 | fgNRowUp = param->GetNRowUp(); | |
939 | fgNRowUp1 = param->GetNRowUp1(); | |
940 | fgNRowUp2 = param->GetNRowUp2(); | |
941 | fgNRow= fgNRowLow + fgNRowUp; | |
942 | if(fgNRow!=159){ | |
943 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Init","fNRow") | |
944 | <<"Number of rows have changed in ALIROOT"<<ENDLOG; | |
945 | return kFALSE; | |
946 | } | |
947 | ||
948 | fgNSectorLow = param->GetNInnerSector(); | |
949 | fgNSectorUp = param->GetNOuterSector(); | |
950 | fgNSector = fgNSectorLow + fgNSectorUp; | |
951 | ||
952 | //test whether they were changes to the rotation shift | |
953 | fgNRotShift=0; | |
954 | Float_t irotshift = param->GetInnerAngleShift(); //shift angle | |
955 | Float_t orotshift = param->GetOuterAngleShift(); //shift angle | |
956 | const Float_t kDegtoRad = 0.01745329251994; | |
957 | Int_t shift1=TMath::Nint(irotshift/kDegtoRad); | |
958 | Int_t shift2=TMath::Nint(orotshift/kDegtoRad+0.1); | |
959 | if((shift1!=shift2) || (shift1!=10)){ | |
960 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Init","Rotshiftangle") | |
961 | <<"Rotation shift angle has changed in ALIROOT"<<ENDLOG; | |
962 | return kFALSE; | |
963 | } else { | |
964 | fgNRotShift=0.5; //our version of the shift angle | |
965 | } | |
966 | ||
967 | fgVersion=kValiroot; | |
968 | SetBFieldFactor((Double_t)runLoader->GetAliRun()->Field()->Factor()); | |
cce3eda4 | 969 | SetSolenoidBField(- |
970 | (Double_t)runLoader->GetAliRun()->Field()->SolenoidField()/ | |
971 | (Double_t)runLoader->GetAliRun()->Field()->Factor() | |
972 | ); | |
a6c02c85 | 973 | fgPadPitchWidthLow=param->GetInnerPadPitchWidth(); |
974 | fgPadPitchWidthUp=param->GetOuterPadPitchWidth(); | |
975 | fgZWidth=param->GetZWidth(); | |
976 | fgZSigma=param->GetZSigma(); | |
977 | fgZLength=param->GetZLength(); | |
978 | fgZOffset=param->GetZOffset(); | |
979 | fgDiffT=param->GetDiffT(); | |
980 | fgDiffL=param->GetDiffL(); | |
981 | fgOmegaTau=param->GetOmegaTau(); | |
982 | fgInnerPadLength=param->GetInnerPadLength(); | |
983 | fgOuter1PadLength=param->GetOuter1PadLength(); | |
984 | fgOuter2PadLength=param->GetOuter2PadLength(); | |
985 | fgInnerPRFSigma=param->GetInnerPRF()->GetSigmaX(); | |
986 | fgOuter1PRFSigma=param->GetOuter1PRF()->GetSigmaX(); | |
987 | fgOuter2PRFSigma=param->GetOuter2PRF()->GetSigmaX(); | |
988 | fgTimeSigma=param->GetTimeRF()->GetSigma(); | |
989 | fgADCSat=param->GetADCSat(); | |
990 | fgZeroSup=param->GetZeroSup(); | |
991 | fgNSlice=fgNSectorLow; | |
992 | ||
993 | //now do the arrays | |
994 | for(Int_t i=0;i<fgNRow;i++){ | |
995 | Int_t sec,row; | |
996 | if( i < fgNRowLow){sec =0;row =i;} | |
997 | else{sec = fgNSectorLow;row =i-fgNRowLow;} | |
998 | fgX[i]=param->GetPadRowRadii(sec,row); | |
999 | } | |
1000 | for(Int_t i=0;i<fgNRow;i++){ | |
1001 | Int_t sec,row; | |
1002 | if( i < fgNRowLow){sec =0;row =i;} | |
1003 | else{sec = fgNSectorLow;row =i-fgNRowLow;} | |
1004 | fgNPads[i]=param->GetNPads(sec,row); | |
1005 | } | |
1006 | for(Int_t i=0;i<fgNSector;i++){ | |
1007 | if(i<fgNSectorLow) fgSectorLow[i]=1; | |
1008 | else fgSectorLow[i]=0; | |
1009 | } | |
1010 | ||
1011 | return kTRUE; | |
1012 | ||
1013 | /* not needed | |
1014 | TTimeStamp time; | |
1015 | Char_t tmpfile[1024]; | |
1016 | sprintf(tmpfile,"./l3transform.config-%d",(Int_t)time.GetSec()); | |
1017 | ||
1018 | return SaveInitFile(tmpfile); | |
1019 | */ | |
1020 | } | |
1021 | #endif | |
1022 | ||
1023 | Bool_t AliHLTTPCTransform::Init(Char_t* path,Bool_t UseAliTPCParam) | |
1024 | { | |
1025 | //Overwrite the parameters with values stored in file "l3transform.config" in path. | |
1026 | //If file does not exist, old default values will be used. | |
1027 | //If flag UseAliTPCParam is set, the parameters will be read from the the rootfile | |
1028 | //which then has to be called path/digitfile.root | |
1029 | ||
1030 | if(fgVersion != kVdefault) | |
1031 | LOG(AliHLTTPCLog::kWarning,"AliHLTTPCTransform::Init","Init values") | |
1032 | <<AliHLTTPCLog::kDec<<"You are initializing the parameters more than once; check your code please! "<<fgVersion<<ENDLOG; | |
1033 | ||
1034 | if(UseAliTPCParam) //use rootfile to generate temporary init file | |
1035 | return ReadInit(path); | |
1036 | ||
1037 | //create filename | |
1038 | Char_t pathname[1024]; | |
1039 | strcpy(pathname,path); | |
1040 | ||
1041 | //test whether provided path is the file itself | |
1042 | Int_t isdir = 0; | |
1043 | DIR *testdir=opendir(pathname); | |
1044 | if(testdir){ | |
1045 | isdir=1; | |
1046 | closedir(testdir); | |
1047 | } | |
1048 | ||
1049 | if(isdir) strcat(pathname,"/l3transform.config"); | |
1050 | ||
1051 | return ReadInitFile(pathname); | |
1052 | } | |
1053 | ||
1054 | Bool_t AliHLTTPCTransform::ReadInitFile(Char_t* pathname) | |
1055 | { | |
1056 | //read transformer settings from pathname | |
1057 | FILE *fptr=fopen(pathname,"r"); | |
1058 | if(!fptr){ | |
1059 | LOG(AliHLTTPCLog::kWarning,"AliHLTTPCTransform::ReadInitFile","File Open") | |
1060 | <<"Pointer to Config File \""<<pathname<<"\" 0x0!"<<ENDLOG; | |
1061 | return kFALSE; | |
1062 | } | |
1063 | ||
1064 | Char_t d1[250], d2[100], d3[100]; | |
1065 | Int_t dummy=0; | |
1066 | Double_t ddummy=0.0; | |
1067 | ||
1068 | while(!feof(fptr)) { | |
1069 | fscanf(fptr,"%s",d1); | |
1070 | if(strcmp(d1,"fVersion")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgVersion=dummy;} | |
1071 | else if(strcmp(d1,"fBFieldFactor")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgBFieldFactor=(Double_t)ddummy;} | |
1072 | else if(strcmp(d1,"fSolenoidBField")==0) | |
1073 | { | |
1074 | fscanf(fptr,"%s %lf %s",d2,&ddummy,d3); | |
1075 | fgSolenoidBField=(Double_t)ddummy; | |
1076 | } | |
1077 | else if(strcmp(d1,"fNTimeBins")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNTimeBins=(Int_t)dummy;} | |
1078 | else if(strcmp(d1,"fNRowLow")==0) | |
1079 | { | |
1080 | fscanf(fptr,"%s %d %s",d2,&dummy,d3); | |
1081 | fgNRowLow=(Int_t)dummy; | |
1082 | if(fgNRowLow != 63) | |
1083 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::ReadInitFile","Overflow") | |
1084 | <<"Number of inner PadRows should be 63! Check and fgrep the code for 63 to see the consequences of this major change!"<<ENDLOG; | |
1085 | } | |
1086 | else if(strcmp(d1,"fNRowUp")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNRowUp=(Int_t)dummy;} | |
1087 | else if(strcmp(d1,"fNRowUp1")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNRowUp1=(Int_t)dummy;} | |
1088 | else if(strcmp(d1,"fNRowUp2")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNRowUp2=(Int_t)dummy;} | |
1089 | else if(strcmp(d1,"fNSectorLow")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNSectorLow=(Int_t)dummy;} | |
1090 | else if(strcmp(d1,"fNSectorUp")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNSectorUp=(Int_t)dummy;} | |
1091 | else if(strcmp(d1,"fNSector")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNSector=(Int_t)dummy;} | |
1092 | else if(strcmp(d1,"fPadPitchWidthLow")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgPadPitchWidthLow=(Double_t)ddummy;} | |
1093 | else if(strcmp(d1,"fPadPitchWidthUp")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgPadPitchWidthUp=(Double_t)ddummy;} | |
1094 | else if(strcmp(d1,"fZWidth")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgZWidth=(Double_t)ddummy;} | |
1095 | else if(strcmp(d1,"fZSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgZSigma=(Double_t)ddummy;} | |
1096 | else if(strcmp(d1,"fZLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgZLength=(Double_t)ddummy;} | |
1097 | else if(strcmp(d1,"fZOffset")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgZOffset=(Double_t)ddummy;} | |
1098 | else if(strcmp(d1,"fNSlice")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNSlice=(Int_t)dummy;} | |
1099 | else if(strcmp(d1,"fDiffT")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgDiffT=(Double_t)ddummy;} | |
1100 | else if(strcmp(d1,"fDiffL")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgDiffL=(Double_t)ddummy;} | |
1101 | else if(strcmp(d1,"fOmegaTau")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgOmegaTau=(Double_t)ddummy;} | |
1102 | else if(strcmp(d1,"fInnerPadLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgInnerPadLength=(Double_t)ddummy;} | |
1103 | else if(strcmp(d1,"fOuter1PadLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgOuter1PadLength=(Double_t)ddummy;} | |
1104 | else if(strcmp(d1,"fOuter2PadLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgOuter2PadLength=(Double_t)ddummy;} | |
1105 | else if(strcmp(d1,"fInnerPRFSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgInnerPRFSigma=(Double_t)ddummy;} | |
1106 | else if(strcmp(d1,"fOuter1PRFSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgOuter1PRFSigma=(Double_t)ddummy;} | |
1107 | else if(strcmp(d1,"fOuter2PRFSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgOuter2PRFSigma=(Double_t)ddummy;} | |
1108 | else if(strcmp(d1,"fTimeSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgTimeSigma=(Double_t)ddummy;} | |
1109 | else if(strcmp(d1,"fADCSat")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgADCSat=(Int_t)dummy;} | |
1110 | else if(strcmp(d1,"fZeroSup")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgZeroSup=(Int_t)dummy;} | |
1111 | else if(strcmp(d1,"fNRow")==0){ | |
1112 | fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNRow=(Int_t)dummy; | |
1113 | if(fgNRow!=159){ | |
1114 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::ReadInitFile","Overflow")<<"Number of PadRows should be 159! Check and fgrep the code for 159 to see the consequences of this major change!"<<ENDLOG; | |
1115 | } | |
1116 | } | |
1117 | else if(strcmp(d1,"fNRotShift")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgNRotShift=(Double_t)ddummy;} | |
1118 | else if(strcmp(d1,"fX[0]")==0){ | |
1119 | fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgX[0]=(Double_t)ddummy; | |
1120 | for(Int_t i=1;i<fgNRow;i++){fscanf(fptr,"%s %s %lf %s",d1,d2,&ddummy,d3);fgX[i]=(Double_t)ddummy;} | |
1121 | } | |
1122 | else if(strcmp(d1,"fNPads[0]")==0){ | |
1123 | fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNPads[0]=(Int_t)dummy; | |
1124 | for(Int_t i=1;i<fgNRow;i++){fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgNPads[i]=(Int_t)dummy;} | |
1125 | } | |
1126 | else if(strcmp(d1,"fNRows[0]")==0){ | |
1127 | fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNRows[0]=(Int_t)dummy; | |
1128 | for(Int_t i=1;i<fgNPatches;i++){fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgNRows[i]=(Int_t)dummy;} | |
1129 | } | |
1130 | else if(strcmp(d1,"fRows[0][0]")==0){ | |
1131 | fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgRows[0][0]=(Int_t)dummy; | |
1132 | fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgRows[0][1]=(Int_t)dummy; | |
1133 | for(Int_t i=1;i<fgNPatches;i++){ | |
1134 | fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgRows[i][0]=(Int_t)dummy; | |
1135 | fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgRows[i][1]=(Int_t)dummy; | |
1136 | } | |
1137 | } | |
1138 | else if(strcmp(d1,"fSlice2Sector[0][0]")==0){ | |
1139 | fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgSlice2Sector[0][0]=(Int_t)dummy; | |
1140 | fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgSlice2Sector[0][1]=(Int_t)dummy; | |
1141 | for(Int_t i=1;i<fgNSlice;i++){ | |
1142 | fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgSlice2Sector[i][0]=(Int_t)dummy; | |
1143 | fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgSlice2Sector[i][1]=(Int_t)dummy; | |
1144 | } | |
1145 | } | |
1146 | else if(strcmp(d1,"fSector2Slice[0]")==0){ | |
1147 | fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgSector2Slice[0]=(Int_t)dummy; | |
1148 | for(Int_t i=1;i<fgNSector;i++){fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgSector2Slice[i]=(Int_t)dummy;} | |
1149 | } | |
1150 | else if(strcmp(d1,"fSectorLow[0]")==0){ | |
1151 | fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgSectorLow[0]=(Int_t)dummy; | |
1152 | for(Int_t i=1;i<fgNSector;i++){fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgSectorLow[i]=(Int_t)dummy;} | |
1153 | } | |
1154 | else if(strcmp(d1,"fCos[0]")==0){ | |
1155 | fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgCos[0]=(Double_t)ddummy; | |
1156 | for(Int_t i=1;i<fgNSlice;i++){fscanf(fptr,"%s %s %lf %s",d1,d2,&ddummy,d3);fgCos[i]=(Double_t)ddummy;} | |
1157 | } | |
1158 | else if(strcmp(d1,"fSin[0]")==0){ | |
1159 | fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgSin[0]=(Double_t)ddummy; | |
1160 | for(Int_t i=1;i<fgNSlice;i++){fscanf(fptr,"%s %s %lf %s",d1,d2,&ddummy,d3);fgSin[i]=(Double_t)ddummy;} | |
1161 | } | |
1162 | } | |
1163 | fclose(fptr); | |
1164 | ||
1165 | //The first multiplier gives the scale factor used to modify the field map | |
1166 | //defined by the second multiplier. | |
1167 | fgBField=fgBFieldFactor*fgSolenoidBField*0.1; | |
1168 | ||
1169 | //Test if new config file has been used. | |
1170 | if(fgVersion==kVdeprecated){ | |
1171 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::ReadInitFile","Version") | |
1172 | <<"Version is deprecated, you have to create a new config file."<<ENDLOG; | |
1173 | return kFALSE; | |
1174 | } | |
1175 | ||
1176 | LOG(AliHLTTPCLog::kInformational,"AliHLTTPCTransform::ReadInitFile","Config") | |
1177 | <<"Successfully loaded values from config file \""<<pathname<<"\""<<ENDLOG; | |
1178 | ||
1179 | return kTRUE; | |
1180 | } | |
1181 | ||
1182 | Bool_t AliHLTTPCTransform::ReadInit(Char_t *path) | |
1183 | { | |
1184 | //Read all the parameters from a aliroot file, and store it in a temporary | |
1185 | //file which is read by Init. Use this if you want to read the parameters from | |
1186 | //the rootfile "every" time. | |
1187 | ||
1188 | #ifndef use_aliroot | |
1189 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::ReadInit","Version") | |
1190 | <<"You have to compile with use_aliroot flag in order to read from AliROOT file"<<ENDLOG; | |
1191 | return kFALSE; | |
1192 | #else | |
1193 | Char_t filename[1024]; | |
1194 | //first test whether provided path is the rootfile itself | |
1195 | Int_t saveErrIgLevel=gErrorIgnoreLevel; | |
1196 | gErrorIgnoreLevel=kFatal; //dont report errors | |
1197 | TFile *rootfile = TFile::Open(path); | |
1198 | if(!rootfile || rootfile->IsZombie()) | |
1199 | { //ok assume its path to alirunfile file | |
1200 | sprintf(filename,"%s/alirunfile.root",path); //create rootfile name | |
1201 | } else { //path contains itself the rootfile name | |
1202 | rootfile->Close(); | |
1203 | sprintf(filename,"%s",path); | |
1204 | } | |
1205 | gErrorIgnoreLevel=saveErrIgLevel; | |
1206 | ||
1207 | //finally make dummy init file /tmp/$USER/l3transform.config-`date` | |
1208 | Char_t tmppath[1024]; | |
1209 | sprintf(tmppath,"/tmp/%s",gSystem->Getenv("USER")); | |
1210 | gSystem->mkdir(tmppath); | |
1211 | TTimeStamp time; | |
1212 | Char_t tmpfile[1024]; | |
1213 | sprintf(tmpfile,"%s/l3transform.config-%d",tmppath,(Int_t)time.GetSec()); | |
1214 | return MakeInitFile(filename,tmpfile); | |
1215 | #endif | |
1216 | } | |
1217 | ||
1218 | Bool_t AliHLTTPCTransform::MakeInitFile(Char_t *rootfilename,Char_t *filename) | |
1219 | { | |
1220 | //Get the parameters from rootfile, and store it on the file "l3transform.config" | |
1221 | //which is being read by Init. fVersion will be kV_aliroot! | |
1222 | ||
1223 | #ifndef use_aliroot | |
1224 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::MakeInitFile","Version") | |
1225 | <<"You have to compile with use_aliroot flag in order to use this function"<<ENDLOG; | |
1226 | return kFALSE; | |
1227 | #else | |
1228 | TFile *rootfile = TFile::Open(rootfilename); | |
1229 | if(!rootfile) | |
1230 | { | |
1231 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::MakeInitFile","File") | |
1232 | <<"Could not open file: "<<rootfilename<<ENDLOG; | |
1233 | return kFALSE; | |
1234 | } | |
1235 | AliRun *gAlice = (AliRun*)rootfile->Get("gAlice"); | |
1236 | if(!gAlice) | |
1237 | { | |
1238 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::MakeInitFile","File") | |
1239 | <<"No gAlice in file: "<<rootfilename<<ENDLOG; | |
1240 | return kFALSE; | |
1241 | } | |
1242 | AliTPCParamSR *param=(AliTPCParamSR*)rootfile->Get(GetParamName()); | |
1243 | if(!param) | |
1244 | { | |
1245 | LOG(AliHLTTPCLog::kWarning,"AliHLTTPCTransform::MakeInitFile","File") | |
1246 | <<"No TPC parameters found in \""<<rootfilename | |
1247 | <<"\", creating standard parameters " | |
1248 | <<"which might not be what you want!"<<ENDLOG; | |
1249 | param=new AliTPCParamSR; | |
1250 | } | |
1251 | ||
1252 | AliTPCPRF2D * prfinner = new AliTPCPRF2D; | |
1253 | AliTPCPRF2D * prfouter1 = new AliTPCPRF2D; | |
1254 | AliTPCPRF2D * prfouter2 = new AliTPCPRF2D; | |
1255 | AliTPCRF1D * rf = new AliTPCRF1D(kTRUE); | |
1256 | rf->SetGauss(param->GetZSigma(),param->GetZWidth(),1.); | |
1257 | rf->SetOffset(3*param->GetZSigma()); | |
1258 | rf->Update(); | |
1259 | ||
1260 | TDirectory *savedir=gDirectory; | |
1261 | TFile *prf_file = TFile::Open("$ALICE_ROOT/TPC/AliTPCprf2d.root"); | |
1262 | if (!prf_file->IsOpen()) | |
1263 | { | |
1264 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::MakeInitFile","File") | |
1265 | <<"Can't open $ALICE_ROOT/TPC/AliTPCprf2d.root !"<<ENDLOG; | |
1266 | return kFALSE; | |
1267 | } | |
1268 | prfinner ->Read("prf_07504_Gati_056068_d02"); | |
1269 | prfouter1->Read("prf_10006_Gati_047051_d03"); | |
1270 | prfouter2->Read("prf_15006_Gati_047051_d03"); | |
1271 | prf_file->Close(); | |
1272 | savedir->cd(); | |
1273 | ||
1274 | param->SetInnerPRF(prfinner); | |
1275 | param->SetOuter1PRF(prfouter1); | |
1276 | param->SetOuter2PRF(prfouter2); | |
1277 | param->SetTimeRF(rf); | |
1278 | ||
1279 | fgNTimeBins = param->GetMaxTBin()+1; | |
1280 | fgNRowLow = param->GetNRowLow(); | |
1281 | fgNRowUp = param->GetNRowUp(); | |
1282 | fgNRowUp1 = param->GetNRowUp1(); | |
1283 | fgNRowUp2 = param->GetNRowUp2(); | |
1284 | fgNRow= fgNRowLow + fgNRowUp; | |
1285 | if(fgNRow!=159){ | |
1286 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::MakeInitFile","fNRow") | |
1287 | <<"Number of rows have changed in ALIROOT"<<ENDLOG; | |
1288 | return kFALSE; | |
1289 | } | |
1290 | ||
1291 | fgNSectorLow = param->GetNInnerSector(); | |
1292 | fgNSectorUp = param->GetNOuterSector(); | |
1293 | fgNSector = fgNSectorLow + fgNSectorUp; | |
1294 | ||
1295 | //test whether they were changes to the rotation shift | |
1296 | fgNRotShift=0; | |
1297 | Float_t irotshift = param->GetInnerAngleShift(); //shift angle | |
1298 | Float_t orotshift = param->GetOuterAngleShift(); //shift angle | |
1299 | const Float_t kDegtoRad = 0.01745329251994; | |
1300 | Int_t shift1=TMath::Nint(irotshift/kDegtoRad); | |
1301 | Int_t shift2=TMath::Nint(orotshift/kDegtoRad+0.1); | |
1302 | if((shift1!=shift2) || (shift1!=10)){ | |
1303 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::MakeInitFile","Rotshiftangle") | |
1304 | <<"Rotation shift angle has changed in ALIROOT"<<ENDLOG; | |
1305 | return kFALSE; | |
1306 | } else { | |
1307 | fgNRotShift=0.5; //our version of the shift angle | |
1308 | } | |
1309 | ||
1310 | fgVersion=kValiroot; | |
1311 | SetBFieldFactor((Double_t)gAlice->Field()->Factor()); | |
cce3eda4 | 1312 | SetSolenoidBField(- |
1313 | (Double_t)gAlice->Field()->SolenoidField()/ | |
1314 | (Double_t)gAlice->Field()->Factor() | |
1315 | ); | |
a6c02c85 | 1316 | fgPadPitchWidthLow=param->GetInnerPadPitchWidth(); |
1317 | fgPadPitchWidthUp=param->GetOuterPadPitchWidth(); | |
1318 | fgZWidth=param->GetZWidth(); | |
1319 | fgZSigma=param->GetZSigma(); | |
1320 | fgZLength=param->GetZLength(); | |
1321 | fgZOffset=param->GetZOffset(); | |
1322 | fgDiffT=param->GetDiffT(); | |
1323 | fgDiffL=param->GetDiffL(); | |
1324 | fgOmegaTau=param->GetOmegaTau(); | |
1325 | fgInnerPadLength=param->GetInnerPadLength(); | |
1326 | fgOuter1PadLength=param->GetOuter1PadLength(); | |
1327 | fgOuter2PadLength=param->GetOuter2PadLength(); | |
1328 | fgInnerPRFSigma=param->GetInnerPRF()->GetSigmaX(); | |
1329 | fgOuter1PRFSigma=param->GetOuter1PRF()->GetSigmaX(); | |
1330 | fgOuter2PRFSigma=param->GetOuter2PRF()->GetSigmaX(); | |
1331 | fgTimeSigma=param->GetTimeRF()->GetSigma(); | |
1332 | fgADCSat=param->GetADCSat(); | |
1333 | fgZeroSup=param->GetZeroSup(); | |
1334 | fgNSlice=fgNSectorLow; | |
1335 | ||
1336 | //now do the arrays | |
1337 | for(Int_t i=0;i<fgNRow;i++){ | |
1338 | Int_t sec,row; | |
1339 | if( i < fgNRowLow){sec =0;row =i;} | |
1340 | else{sec = fgNSectorLow;row =i-fgNRowLow;} | |
1341 | fgX[i]=param->GetPadRowRadii(sec,row); | |
1342 | } | |
1343 | for(Int_t i=0;i<fgNRow;i++){ | |
1344 | Int_t sec,row; | |
1345 | if( i < fgNRowLow){sec =0;row =i;} | |
1346 | else{sec = fgNSectorLow;row =i-fgNRowLow;} | |
1347 | fgNPads[i]=param->GetNPads(sec,row); | |
1348 | } | |
1349 | for(Int_t i=0;i<fgNSector;i++){ | |
1350 | if(i<fgNSectorLow) fgSectorLow[i]=1; | |
1351 | else fgSectorLow[i]=0; | |
1352 | } | |
1353 | ||
1354 | delete gAlice; | |
1355 | rootfile->Close(); | |
1356 | delete rootfile; | |
1357 | ||
1358 | return SaveInitFile(filename); | |
1359 | #endif | |
1360 | } | |
1361 | ||
1362 | Bool_t AliHLTTPCTransform::SaveInitFile(Char_t *filenamepath) | |
1363 | { | |
1364 | //store the parameters in the file "filenamepath" | |
1365 | ||
1366 | FILE *f = fopen(filenamepath,"w"); | |
1367 | if(!f){ | |
1368 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::SaveInitFile","File") | |
1369 | <<"Could not open file: "<<filenamepath<<ENDLOG; | |
1370 | return kFALSE; | |
1371 | } | |
1372 | ||
1373 | fprintf(f,"void AliHLTTPCTransform::Init(){\n"); | |
1374 | fprintf(f," fVersion = %d;\n", fgVersion); | |
1375 | fprintf(f," fBFieldFactor = %.3f;\n",fgBFieldFactor); | |
1376 | fprintf(f," fSolenoidBField = %.3f;\n",fgSolenoidBField); | |
1377 | fprintf(f," fNTimeBins = %d;\n",fgNTimeBins); | |
1378 | fprintf(f," fNRowLow = %d;\n",fgNRowLow); | |
1379 | fprintf(f," fNRowUp = %d;\n",fgNRowUp); | |
1380 | fprintf(f," fNRowUp1 = %d;\n",fgNRowUp1); | |
1381 | fprintf(f," fNRowUp2 = %d;\n",fgNRowUp2); | |
1382 | fprintf(f," fNSectorLow = %d;\n",fgNSectorLow); | |
1383 | fprintf(f," fNSectorUp = %d;\n",fgNSectorUp); | |
1384 | fprintf(f," fNSector = %d;\n",fgNSector); | |
1385 | fprintf(f," fPadPitchWidthLow = %.3f;\n",fgPadPitchWidthLow); | |
1386 | fprintf(f," fPadPitchWidthUp = %.3f;\n",fgPadPitchWidthUp); | |
1387 | fprintf(f," fZWidth = %.4f;\n",fgZWidth); | |
1388 | fprintf(f," fZSigma = %.4f;\n",fgZSigma); | |
1389 | fprintf(f," fZLength = %.4f;\n",fgZLength); | |
1390 | fprintf(f," fZOffset = %.4f;\n",fgZOffset); | |
1391 | fprintf(f," fDiffT = %.4f;\n",fgDiffT); | |
1392 | fprintf(f," fDiffL = %.4f;\n",fgDiffL); | |
1393 | fprintf(f," fOmegaTau = %.4f;\n",fgOmegaTau); | |
1394 | fprintf(f," fInnerPadLength = %.3f;\n",fgInnerPadLength); | |
1395 | fprintf(f," fOuter1PadLength = %.3f;\n",fgOuter1PadLength); | |
1396 | fprintf(f," fOuter2PadLength = %.3f;\n",fgOuter2PadLength); | |
1397 | fprintf(f," fInnerPRFSigma = %.6f;\n",fgInnerPRFSigma); | |
1398 | fprintf(f," fOuter1PRFSigma = %.6f;\n",fgOuter1PRFSigma); | |
1399 | fprintf(f," fOuter2PRFSigma = %.6f;\n",fgOuter2PRFSigma); | |
1400 | fprintf(f," fTimeSigma = %.6f;\n",fgTimeSigma); | |
1401 | fprintf(f," fADCSat = %d;\n",fgADCSat); | |
1402 | fprintf(f," fZeroSup = %d;\n",fgZeroSup); | |
1403 | fprintf(f," fNSlice = %d;\n",fgNSlice); | |
1404 | fprintf(f," fNRow = %d;\n",fgNRow); | |
1405 | fprintf(f," fNRotShift = %.2f;\n",fgNRotShift); | |
1406 | //now do the arrays | |
1407 | for(Int_t i=0;i<fgNRow;i++){ | |
1408 | fprintf(f," fX[%d] = %3.2f;\n",i,fgX[i]); | |
1409 | } | |
1410 | for(Int_t i=0;i<fgNRow;i++){ | |
1411 | fprintf(f," fNPads[%d] = %d;\n",i,fgNPads[i]); | |
1412 | } | |
1413 | ||
1414 | //Slice/Sector dont belong to aliroot, but we want to be flexible | |
1415 | for(Int_t i=0;i<fgNSlice;i++){ | |
1416 | fprintf(f," fSlice2Sector[%d][0] = %d;\n",i,fgSlice2Sector[i][0]); | |
1417 | fprintf(f," fSlice2Sector[%d][1] = %d;\n",i,fgSlice2Sector[i][1]); | |
1418 | } | |
1419 | for(Int_t i=0;i<fgNSector;i++){ | |
1420 | fprintf(f," fSector2Slice[%d] = %d;\n",i,fgSector2Slice[i]); | |
1421 | } | |
1422 | for(Int_t i=0;i<fgNSector;i++){ | |
1423 | fprintf(f," fSectorLow[%d] = %d;\n",i,fgSectorLow[i]); | |
1424 | } | |
1425 | ||
1426 | //Patches also dont really belong to the aliroot settings (but nevermind) | |
1427 | for(Int_t i=0;i<fgNPatches;i++){ | |
1428 | fprintf(f," fNRows[%d] = %d;\n",i,fgNRows[i]); | |
1429 | } | |
1430 | for(Int_t i=0;i<fgNPatches;i++){ | |
1431 | fprintf(f," fRows[%d][0] = %d;\n",i,fgRows[i][0]); | |
1432 | fprintf(f," fRows[%d][1] = %d;\n",i,fgRows[i][1]); | |
1433 | } | |
1434 | ||
1435 | //Rotation shift is an addon, too | |
1436 | for(Int_t i=0;i<fgNSlice;i++){ | |
1437 | Float_t cs = cos( (2*fgkPi/18) * (i+fgNRotShift) ); | |
1438 | fprintf(f," fCos[%d] = %.10f;\n",i,cs); | |
1439 | } | |
1440 | for(Int_t i=0;i<fgNSlice;i++){ | |
1441 | Float_t sn = sin( (2*fgkPi/18) * (i+fgNRotShift) ); | |
1442 | fprintf(f," fSin[%d] = %.10f;\n",i,sn); | |
1443 | } | |
1444 | ||
1445 | fprintf(f,"}\n"); | |
1446 | fclose(f); | |
1447 | ||
1448 | LOG(AliHLTTPCLog::kInformational,"AliHLTTPCTransform::SaveInitFile","File created") | |
1449 | <<"Init file \""<<filenamepath<<"\" created"<<ENDLOG; | |
1450 | ||
1451 | return kTRUE; | |
1452 | } | |
1453 | ||
1454 | Int_t AliHLTTPCTransform::GetNPads(Int_t row) | |
1455 | { | |
1456 | //get number of pads per row | |
1457 | if(row < 0 || row >= fgNRow) | |
1458 | { | |
1459 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetNPads","Row") | |
1460 | <<AliHLTTPCLog::kDec<<"Wrong row "<<row<<ENDLOG; | |
1461 | return 0; | |
1462 | } | |
1463 | ||
1464 | return fgNPads[row]; | |
1465 | } | |
1466 | ||
84645eb0 | 1467 | Int_t AliHLTTPCTransform::GetNumberOfPatches() { |
1468 | return fgNPatches; | |
1469 | } | |
1470 | ||
a6c02c85 | 1471 | Int_t AliHLTTPCTransform::GetFirstRow(Int_t patch) |
1472 | { | |
1473 | //get first row per patch | |
1474 | ||
1475 | if(patch==-1) | |
1476 | return 0; | |
1477 | else if(patch < -1 || patch >= 6) | |
1478 | { | |
1479 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetFirstRow","Patch") | |
1480 | <<AliHLTTPCLog::kDec<<"Wrong patch "<<patch<<ENDLOG; | |
1481 | return 0; | |
1482 | } | |
1483 | else | |
1484 | return fgRows[patch][0]; | |
1485 | } | |
1486 | ||
1487 | Int_t AliHLTTPCTransform::GetLastRow(Int_t patch) | |
1488 | { | |
1489 | //get last row per patch | |
1490 | if(patch==-1) | |
1491 | return fgRows[5][1]; | |
1492 | else if(patch < -1 || patch >= 6) | |
1493 | { | |
1494 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetLastRow","Patch") | |
1495 | <<AliHLTTPCLog::kDec<<"Wrong patch "<<patch<<ENDLOG; | |
1496 | return 0; | |
1497 | } | |
1498 | else | |
1499 | return fgRows[patch][1]; | |
1500 | } | |
1501 | ||
1502 | Int_t AliHLTTPCTransform::GetFirstRowOnDDL(Int_t patch) | |
1503 | { | |
1504 | //get first row per patch | |
1505 | ||
1506 | if(patch==-1) | |
1507 | return 0; | |
1508 | else if(patch < -1 || patch >= 6) | |
1509 | { | |
1510 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetFirstRow","Patch") | |
1511 | <<AliHLTTPCLog::kDec<<"Wrong patch "<<patch<<ENDLOG; | |
1512 | return 0; | |
1513 | } | |
1514 | else | |
1515 | { | |
1516 | if(patch==1) return fgRows[patch][0]+1; | |
1517 | return fgRows[patch][0]; | |
1518 | } | |
1519 | } | |
1520 | ||
1521 | Int_t AliHLTTPCTransform::GetLastRowOnDDL(Int_t patch) | |
1522 | { | |
1523 | //get last row per patch | |
1524 | if(patch==-1) | |
1525 | return fgRows[5][1]; | |
1526 | else if(patch < -1 || patch >= 6) | |
1527 | { | |
1528 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetLastRow","Patch") | |
1529 | <<AliHLTTPCLog::kDec<<"Wrong patch "<<patch<<ENDLOG; | |
1530 | return 0; | |
1531 | } | |
1532 | else | |
1533 | { | |
1534 | if(patch==2 || patch==4) return fgRows[patch][1]-1; | |
1535 | return fgRows[patch][1]; | |
1536 | } | |
1537 | } | |
1538 | ||
1539 | Int_t AliHLTTPCTransform::GetNRows(Int_t patch) | |
1540 | { | |
1541 | //get number of rows per patch | |
1542 | if(patch==-1) | |
1543 | return fgNRow; | |
1544 | else if(patch < -1 || patch >= 6) | |
1545 | { | |
1546 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetNRows","Patch") | |
1547 | <<AliHLTTPCLog::kDec<<"Wrong patch "<<patch<<ENDLOG; | |
1548 | return 0; | |
1549 | } | |
1550 | else | |
1551 | return fgNRows[patch]; | |
1552 | } | |
1553 | ||
1554 | Int_t AliHLTTPCTransform::GetPadRow(Float_t xvalue) | |
1555 | { | |
1556 | //Find the padrow number corresponding to cartesian _local_ x value | |
1557 | if(xvalue < 0 || xvalue > 250) | |
1558 | { | |
1559 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetPadRow","X-value") | |
1560 | <<AliHLTTPCLog::kDec<<"Suspicious x-value, make sure it is in local coordinate! " | |
1561 | <<xvalue<<ENDLOG; | |
1562 | return -1; | |
1563 | } | |
1564 | ||
1565 | Int_t x = (Int_t)rint(xvalue*10); | |
1566 | if(x < (Int_t)rint(fgX[1]*10)) | |
1567 | return 0; | |
1568 | else if(x > (Int_t)rint(fgX[fgNRow-2]*10)) | |
1569 | return fgNRow-1; | |
1570 | else | |
1571 | { | |
1572 | Int_t padrow=1; //Of course, a more clever algorithm could help here | |
1573 | while(padrow < fgNRow-2) | |
1574 | { | |
1575 | if(x > (Int_t)rint(fgX[padrow-1]*10) && x < (Int_t)rint(fgX[padrow+1]*10)) | |
1576 | break; | |
1577 | padrow++; | |
1578 | } | |
1579 | return padrow; | |
1580 | } | |
1581 | } | |
1582 | ||
1583 | Int_t AliHLTTPCTransform::GetPatch(Int_t padrow) | |
1584 | { | |
1585 | //get patch for padrow | |
1586 | if(padrow < 0 || padrow >= fgNRow) | |
1587 | { | |
1588 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetPatch","Padrow") | |
1589 | <<AliHLTTPCLog::kDec<<"Wrong padrow "<<padrow<<ENDLOG; | |
1590 | return -2; | |
1591 | } | |
1592 | Int_t patch=0; | |
1593 | while(patch < fgNPatches) | |
1594 | { | |
1595 | if(padrow >= fgRows[patch][0] && padrow <= fgRows[patch][1]) | |
1596 | break; | |
1597 | patch++; | |
1598 | } | |
1599 | return patch; | |
1600 | } | |
1601 | ||
1602 | Double_t AliHLTTPCTransform::GetPadLength(Int_t padrow) | |
1603 | { | |
1604 | //get pad length for padrow | |
1605 | if(padrow >= fgNRow){ | |
1606 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetPadLength","Padrow") | |
1607 | <<AliHLTTPCLog::kDec<<"Wrong padrow "<<padrow<<ENDLOG; | |
1608 | return 0; | |
1609 | } | |
1610 | ||
1611 | if(padrow < fgNRowLow) | |
1612 | return fgInnerPadLength; | |
1613 | if(padrow >= fgNRowLow && padrow < fgNRowLow + fgNRowUp1 - 1) | |
1614 | return fgOuter1PadLength; | |
1615 | if(padrow >= fgNRowLow + fgNRowUp1 - 1) | |
1616 | return fgOuter2PadLength; | |
1617 | ||
1618 | //should never happen | |
1619 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetPadLength","Padrow") | |
1620 | <<AliHLTTPCLog::kDec<<"Wrong padrow "<<padrow<<ENDLOG; | |
1621 | return -1.0; | |
1622 | } | |
1623 | ||
1624 | Double_t AliHLTTPCTransform::GetPadPitchWidth(Int_t patch) | |
1625 | { | |
1626 | //get pad patch width for patch | |
1627 | if(patch < 0 || patch > fgNPatches) | |
1628 | { | |
1629 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetPadPitchWidth","patct") | |
1630 | <<AliHLTTPCLog::kDec<<"Wrong patch "<<patch<<ENDLOG; | |
1631 | return -1; | |
1632 | } | |
1633 | return patch < 2 ? fgPadPitchWidthLow : fgPadPitchWidthUp; | |
1634 | } | |
1635 | ||
1636 | Double_t AliHLTTPCTransform::GetParSigmaY2(Int_t padrow,Float_t z,Float_t angle) | |
1637 | { | |
1638 | //Calculate the expected transverse cluster width as a function of | |
1639 | //drift distance and crossing angle. | |
1640 | //z = local z-coordinate of cluster | |
1641 | //angle = track crossing angle with normal to padrow plane | |
1642 | //return value = sigma^2 (cartesian coordinates) | |
1643 | ||
1644 | Double_t drift; | |
1645 | if(z > 0) | |
1646 | drift = fgZLength - z; | |
1647 | else | |
1648 | drift = fgZLength + z; | |
1649 | ||
1650 | Double_t t1 = GetPRFSigma(padrow)*GetPRFSigma(padrow); | |
1651 | Double_t t2 = fgDiffT*fgDiffT*drift; | |
1652 | Double_t t3 = GetPadLength(padrow)*GetPadLength(padrow)*tan(angle)*tan(angle)/12; | |
1653 | Double_t t4 = fgkAnodeWireSpacing*fgkAnodeWireSpacing*(tan(angle) - fgOmegaTau)*(tan(angle) - fgOmegaTau)/12; | |
1654 | ||
1655 | return (t1 + t2 + t3 + t4); | |
1656 | } | |
1657 | ||
1658 | Double_t AliHLTTPCTransform::GetParSigmaZ2(Int_t padrow,Float_t z,Float_t tgl) | |
1659 | { | |
1660 | //Calculate the expected longitudinal cluster width as a function of | |
1661 | //drift distance and track crossing angle. | |
1662 | //z = local z-coordinate of cluster | |
1663 | //tgl = tan(dipangle) | |
1664 | //return value = sigma^2 (cartesian coordinates) | |
1665 | ||
1666 | Double_t drift; | |
1667 | if(z > 0) | |
1668 | drift = AliHLTTPCTransform::GetZLength() - z; | |
1669 | else | |
1670 | drift = AliHLTTPCTransform::GetZLength() + z; | |
1671 | ||
1672 | Double_t t1 = fgZSigma*fgZSigma; | |
1673 | Double_t t2 = fgDiffL*fgDiffL*drift; | |
1674 | Double_t t3 = GetPadLength(padrow)*GetPadLength(padrow)*tgl*tgl/12; | |
1675 | ||
1676 | return (t1 + t2 + t3); | |
1677 | } | |
1678 | ||
1679 | Double_t AliHLTTPCTransform::GetPRFSigma(Int_t padrow) | |
1680 | { | |
1681 | //get sigma of pad response function for padrow | |
1682 | ||
1683 | if(padrow >= fgNRow){ | |
1684 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetPRFSigma","Padrow") | |
1685 | <<AliHLTTPCLog::kDec<<"Wrong padrow "<<padrow<<ENDLOG; | |
1686 | return 0; | |
1687 | } | |
1688 | if(padrow < fgNRowLow) | |
1689 | return fgInnerPRFSigma; | |
1690 | if(padrow >= fgNRowLow && padrow < fgNRowLow + fgNRowUp1 - 1) | |
1691 | return fgOuter1PRFSigma; | |
1692 | if(padrow >= fgNRowLow + fgNRowUp1 - 1) | |
1693 | return fgOuter2PRFSigma; | |
1694 | ||
1695 | //should never happen | |
1696 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::GetPRFSigma","Padrow") | |
1697 | <<AliHLTTPCLog::kDec<<"Wrong padrow "<<padrow<<ENDLOG; | |
1698 | return -1.; | |
1699 | } | |
1700 | ||
1701 | Double_t AliHLTTPCTransform::GetEta(Float_t *xyz) | |
1702 | { | |
1703 | //get eta | |
1704 | Double_t r3 = sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]+xyz[2]*xyz[2]); | |
1705 | Double_t eta = 0.5 * log((r3+xyz[2])/(r3-xyz[2])); | |
1706 | return eta; | |
1707 | } | |
1708 | ||
1709 | void AliHLTTPCTransform::XYZtoRPhiEta(Float_t *rpe, Float_t *xyz) | |
1710 | { | |
1711 | //transform xyz into rpe | |
1712 | rpe[0] = sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]+xyz[2]*xyz[2]); | |
1713 | rpe[1] = atan2(xyz[1],xyz[0]); | |
1714 | rpe[2] = 0.5 * log((rpe[0]+xyz[2])/(rpe[0]-xyz[2])); | |
1715 | } | |
1716 | ||
1717 | Double_t AliHLTTPCTransform::GetEta(Int_t slice,Int_t padrow,Int_t pad,Int_t time) | |
1718 | { | |
1719 | //get eta | |
1720 | Float_t xyz[3]; | |
1721 | Int_t sector,row; | |
1722 | Slice2Sector(slice,padrow,sector,row); | |
1723 | Raw2Local(xyz,sector,row,pad,time); | |
1724 | ||
1725 | return GetEta(xyz); | |
1726 | } | |
1727 | ||
1728 | Double_t AliHLTTPCTransform::GetPhi(Float_t *xyz) | |
1729 | { | |
1730 | //get phi | |
1731 | Double_t phi = atan2(xyz[1],xyz[0]); | |
1732 | return phi; | |
1733 | } | |
1734 | ||
1735 | Bool_t AliHLTTPCTransform::Slice2Sector(Int_t slice, Int_t slicerow, Int_t & sector, Int_t &row) | |
1736 | { | |
1737 | //slice to sector number | |
1738 | if(slicerow<0&&slicerow>=fgNRow){ | |
1739 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Slice2Sector","Slicerow") | |
1740 | <<AliHLTTPCLog::kDec<<"Wrong slicerow "<<slicerow<<ENDLOG; | |
1741 | return kFALSE; | |
1742 | } | |
1743 | if(slice<0||slice>=fgNSlice){ | |
1744 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Slice2Sector","Slice") | |
1745 | <<AliHLTTPCLog::kDec<<"Wrong slice "<<slice<<ENDLOG; | |
1746 | return kFALSE; | |
1747 | } | |
1748 | ||
1749 | if(slicerow<fgNRowLow){ | |
1750 | sector = fgSlice2Sector[slice][0]; | |
1751 | row = slicerow; | |
1752 | } | |
1753 | else { | |
1754 | sector = fgSlice2Sector[slice][1]; | |
1755 | row = slicerow-fgNRowLow; | |
1756 | } | |
1757 | ||
1758 | return kTRUE; | |
1759 | } | |
1760 | ||
1761 | Bool_t AliHLTTPCTransform::Sector2Slice(Int_t & slice, Int_t sector) | |
1762 | { | |
1763 | //sector to slice | |
1764 | if(sector<0||sector>=fgNSector){ | |
1765 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Sector2Slice","Sector") | |
1766 | <<AliHLTTPCLog::kDec<<"Wrong sector "<<sector<<ENDLOG; | |
1767 | return kFALSE; | |
1768 | } | |
1769 | ||
1770 | slice=fgSector2Slice[sector]; | |
1771 | ||
1772 | return kTRUE; | |
1773 | } | |
1774 | ||
1775 | Bool_t AliHLTTPCTransform::Sector2Slice(Int_t & slice, Int_t & slicerow, Int_t sector, Int_t row) | |
1776 | { | |
1777 | //sector to slice | |
1778 | if(sector<0 || sector>=fgNSector){ | |
1779 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Sector2Slice","Sector") | |
1780 | <<AliHLTTPCLog::kDec<<"Wrong sector "<<sector<<ENDLOG; | |
1781 | return kFALSE; | |
1782 | } | |
1783 | if(row<0){ | |
1784 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Sector2Slice","Row") | |
1785 | <<AliHLTTPCLog::kDec<<"Wrong row "<<row<<ENDLOG; | |
1786 | return kFALSE; | |
1787 | } | |
1788 | ||
1789 | if(fgSectorLow[sector]){ | |
1790 | if(row>=fgNRowLow){ | |
1791 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Sector2Slice","Row") | |
1792 | <<AliHLTTPCLog::kDec<<"Wrong row "<<row<<ENDLOG; | |
1793 | return kFALSE; | |
1794 | } | |
1795 | slice = fgSector2Slice[sector]; | |
1796 | slicerow = row; | |
1797 | } | |
1798 | else{ | |
1799 | if(row>=fgNRowUp){ | |
1800 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Sector2Slice","Row") | |
1801 | <<AliHLTTPCLog::kDec<<"Wrong row "<<row<<ENDLOG; | |
1802 | return kFALSE; | |
1803 | } | |
1804 | slice = fgSector2Slice[sector]; | |
1805 | slicerow = row + fgNRowLow; | |
1806 | } | |
1807 | ||
1808 | return kTRUE; | |
1809 | } | |
1810 | ||
1811 | Double_t AliHLTTPCTransform::GetMaxY(Int_t slicerow) | |
1812 | { | |
1813 | //get maximum y value (for slice 0) | |
1814 | if(slicerow < fgNRowLow) | |
1815 | return fgPadPitchWidthLow*fgNPads[slicerow]/2; | |
1816 | ||
1817 | else | |
1818 | return fgPadPitchWidthUp*fgNPads[slicerow]/2; | |
1819 | ||
1820 | } | |
1821 | ||
1822 | Double_t AliHLTTPCTransform::Row2X(Int_t slicerow) | |
1823 | { | |
1824 | //slicerow to X value (slice 0) | |
1825 | if(slicerow<0||slicerow>=fgNRow){ | |
1826 | LOG(AliHLTTPCLog::kError,"AliHLTTPCTransform::Row2X","Slicerow") | |
1827 | <<AliHLTTPCLog::kDec<<"Wrong slicerow "<<slicerow<<ENDLOG; | |
1828 | return 0; | |
1829 | } | |
1830 | return fgX[slicerow]; | |
1831 | } | |
1832 | ||
1833 | Double_t AliHLTTPCTransform::GetZFast(Int_t slice, Int_t time, Float_t vertex) | |
1834 | { | |
1835 | //get z value | |
1836 | Double_t z=fgZWidth*time-fgZOffset; | |
1837 | if(slice < 18) | |
1838 | z=fgZLength-z-vertex; | |
1839 | else | |
1840 | z=z-fgZLength-vertex; | |
1841 | return z; | |
1842 | } | |
1843 | ||
1844 | void AliHLTTPCTransform::Local2Global(Float_t *xyz,Int_t slice) | |
1845 | { | |
1846 | //Transformation to global coordinate system | |
1847 | Float_t x0 = xyz[0]; | |
1848 | Float_t y0 = xyz[1]; | |
1849 | ||
1850 | xyz[0]=x0*fgCos[slice]-y0*fgSin[slice]; | |
1851 | xyz[1]=x0*fgSin[slice]+y0*fgCos[slice]; | |
1852 | xyz[2]=xyz[2];//global z=local z | |
1853 | } | |
1854 | ||
1855 | void AliHLTTPCTransform::Local2GlobalAngle(Float_t *angle,Int_t slice) | |
1856 | { | |
1857 | //get angle global | |
1858 | angle[0] = fmod(angle[0]+(slice+fgNRotShift)*(2*fgkPi/18),2*fgkPi); | |
1859 | } | |
1860 | ||
1861 | void AliHLTTPCTransform::Global2LocalAngle(Float_t *angle,Int_t slice) | |
1862 | { | |
1863 | //get angle local | |
1864 | angle[0] = angle[0]-(slice+fgNRotShift)*(2*fgkPi/18); | |
1865 | if(angle[0]<0) angle[0]+=2*fgkPi; | |
1866 | } | |
1867 | ||
1868 | void AliHLTTPCTransform::Raw2Local(Float_t *xyz,Int_t sector,Int_t row,Float_t pad,Float_t time) | |
1869 | { | |
1870 | //Transformation from rawdata to local coordinate system | |
1871 | ||
1872 | Int_t slice,slicerow; | |
1873 | Sector2Slice(slice, slicerow, sector, row); | |
1874 | ||
1875 | //X-Value | |
1876 | xyz[0]=Row2X(slicerow); | |
1877 | ||
1878 | //Y-Value | |
1879 | Int_t npads= fgNPads[slicerow]; | |
1880 | ||
1881 | if(fgSectorLow[sector]) | |
1882 | xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthLow; | |
1883 | else | |
1884 | xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthUp; | |
1885 | ||
1886 | //Z-Value (remember PULSA Delay) | |
1887 | if(slice < 18) | |
1888 | xyz[2]=fgZLength-fgZWidth*time+fgZOffset; | |
1889 | else | |
1890 | xyz[2]=fgZWidth*time-fgZOffset-fgZLength; | |
1891 | } | |
1892 | ||
1893 | void AliHLTTPCTransform::Raw2Local(Float_t *xyz,Int_t sector,Int_t row,Int_t pad,Int_t time) | |
1894 | { | |
1895 | //Transformation from rawdata to local coordinate system | |
1896 | ||
1897 | Int_t slice,slicerow; | |
1898 | Sector2Slice(slice, slicerow, sector, row); | |
1899 | ||
1900 | //X-Value | |
1901 | xyz[0]=Row2X(slicerow); | |
1902 | ||
1903 | //Y-Value | |
1904 | Int_t npads= fgNPads[slicerow]; | |
1905 | ||
1906 | if(fgSectorLow[sector]) | |
1907 | xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthLow; | |
1908 | else | |
1909 | xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthUp; | |
1910 | ||
1911 | //Z-Value (remember PULSA Delay) | |
1912 | if(slice < 18) | |
1913 | xyz[2]=fgZLength-fgZWidth*time+fgZOffset; | |
1914 | else | |
1915 | xyz[2]=fgZWidth*time-fgZOffset-fgZLength; | |
1916 | } | |
1917 | ||
1918 | void AliHLTTPCTransform::RawHLT2Local(Float_t *xyz,Int_t slice, | |
1919 | Int_t slicerow,Float_t pad,Float_t time) | |
1920 | { | |
1921 | //Transformation from HLT rawdata to local coordinate system | |
1922 | ||
1923 | //X-Value | |
1924 | xyz[0]=Row2X(slicerow); | |
1925 | ||
1926 | //Y-Value | |
1927 | Int_t npads= fgNPads[slicerow]; | |
1928 | if(slicerow<fgNRowLow) | |
1929 | xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthLow; | |
1930 | else | |
1931 | xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthUp; | |
1932 | ||
1933 | //Z-Value | |
1934 | if(slice < 18) | |
1935 | xyz[2]=fgZLength-fgZWidth*time+fgZOffset; | |
1936 | else | |
1937 | xyz[2]=fgZWidth*time-fgZOffset-fgZLength; | |
1938 | } | |
1939 | ||
1940 | void AliHLTTPCTransform::RawHLT2Local(Float_t *xyz,Int_t slice, | |
1941 | Int_t slicerow,Int_t pad,Int_t time) | |
1942 | { | |
1943 | //Transformation from HLT rawdata to local coordinate system | |
1944 | ||
1945 | //X-Value | |
1946 | xyz[0]=Row2X(slicerow); | |
1947 | ||
1948 | //Y-Value | |
1949 | Int_t npads= fgNPads[slicerow]; | |
1950 | if(slicerow<fgNRowLow) | |
1951 | xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthLow; | |
1952 | else | |
1953 | xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthUp; | |
1954 | ||
1955 | //Z-Value | |
1956 | if(slice < 18) | |
1957 | xyz[2]=fgZLength-fgZWidth*time+fgZOffset; | |
1958 | else | |
1959 | xyz[2]=fgZWidth*time-fgZOffset-fgZLength; | |
1960 | } | |
1961 | ||
1962 | void AliHLTTPCTransform::Local2Global(Float_t *xyz,Int_t sector,Int_t row) | |
1963 | { | |
1964 | //Transformation to global coordinate system | |
1965 | Int_t slice,slicerow; | |
1966 | Sector2Slice(slice, slicerow, sector, row); | |
1967 | Float_t r=Row2X(slicerow); //have to get x value first | |
1968 | ||
1969 | xyz[0]=r*fgCos[slice]-xyz[1]*fgSin[slice]; | |
1970 | xyz[1]=r*fgSin[slice]+xyz[1]*fgCos[slice]; | |
1971 | xyz[2]=xyz[2];//global z=local z | |
1972 | } | |
1973 | ||
1974 | void AliHLTTPCTransform::LocHLT2Global(Float_t *xyz,Int_t slice,Int_t slicerow) | |
1975 | { | |
1976 | //Transformation from HLT to global coordinate system | |
1977 | Float_t r=Row2X(slicerow); //have to get x value first | |
1978 | ||
1979 | xyz[0]=r*fgCos[slice]-xyz[1]*fgSin[slice]; | |
1980 | xyz[1]=r*fgSin[slice]+xyz[1]*fgCos[slice]; | |
1981 | xyz[2]=xyz[2];//global z=local z | |
1982 | } | |
1983 | ||
1984 | void AliHLTTPCTransform::Global2Local(Float_t *xyz,Int_t sector) | |
1985 | { //check code | |
1986 | Int_t slice; | |
1987 | Sector2Slice(slice, sector); | |
1988 | ||
1989 | Float_t x1 = xyz[0]*fgCos[slice] + xyz[1]*fgSin[slice]; | |
1990 | Float_t y1 = -xyz[0]*fgSin[slice] + xyz[1]*fgCos[slice]; | |
1991 | xyz[0] = x1; | |
1992 | xyz[1] = y1; | |
1993 | } | |
1994 | ||
1995 | void AliHLTTPCTransform::Global2LocHLT(Float_t *xyz,Int_t slice) | |
1996 | { | |
1997 | Float_t x1 = xyz[0]*fgCos[slice] + xyz[1]*fgSin[slice]; | |
1998 | Float_t y1 = -xyz[0]*fgSin[slice] + xyz[1]*fgCos[slice]; | |
1999 | xyz[0] = x1; | |
2000 | xyz[1] = y1; | |
2001 | } | |
2002 | ||
2003 | void AliHLTTPCTransform::Raw2Global(Float_t *xyz,Int_t sector,Int_t row,Float_t pad,Float_t time) | |
2004 | { | |
2005 | //Transformation from raw to global coordinates | |
2006 | ||
2007 | Raw2Local(xyz,sector,row,pad,time); | |
2008 | Local2Global(xyz,sector,row); | |
2009 | } | |
2010 | ||
2011 | void AliHLTTPCTransform::Raw2Global(Float_t *xyz,Int_t sector,Int_t row,Int_t pad,Int_t time) | |
2012 | { | |
2013 | //Transformation from raw to global coordinates | |
2014 | ||
2015 | Raw2Local(xyz,sector,row,pad,time); | |
2016 | Local2Global(xyz,sector,row); | |
2017 | } | |
2018 | ||
2019 | void AliHLTTPCTransform::RawHLT2Global(Float_t *xyz,Int_t slice, | |
2020 | Int_t slicerow,Float_t pad,Float_t time) | |
2021 | { | |
2022 | //Transformation from raw to global coordinates | |
2023 | ||
2024 | RawHLT2Local(xyz,slice,slicerow,pad,time); | |
2025 | LocHLT2Global(xyz,slice,slicerow); | |
2026 | } | |
2027 | ||
2028 | void AliHLTTPCTransform::RawHLT2Global(Float_t *xyz,Int_t slice, | |
2029 | Int_t slicerow,Int_t pad,Int_t time) | |
2030 | { | |
2031 | //Transformation from raw to global coordinates | |
2032 | ||
2033 | RawHLT2Local(xyz,slice,slicerow,pad,time); | |
2034 | LocHLT2Global(xyz,slice,slicerow); | |
2035 | } | |
2036 | ||
2037 | void AliHLTTPCTransform::Local2Raw(Float_t *xyz,Int_t sector,Int_t row) | |
2038 | { | |
2039 | //Transformation from local coordinates to raw | |
2040 | ||
2041 | Int_t slice,slicerow; | |
2042 | Sector2Slice(slice, slicerow, sector, row); | |
2043 | ||
2044 | xyz[0]=slicerow; | |
2045 | ||
2046 | if(fgSectorLow[sector]) | |
2047 | xyz[1]=xyz[1]/fgPadPitchWidthLow+0.5*(fgNPads[slicerow]-1); | |
2048 | else | |
2049 | xyz[1]=xyz[1]/fgPadPitchWidthUp+0.5*(fgNPads[slicerow]-1); | |
2050 | ||
2051 | if(slice < 18) | |
2052 | xyz[2]=(fgZLength-xyz[2]+fgZOffset)/fgZWidth; | |
2053 | else | |
2054 | xyz[2]=(fgZLength+xyz[2]+fgZOffset)/fgZWidth; | |
2055 | } | |
2056 | ||
2057 | void AliHLTTPCTransform::LocHLT2Raw(Float_t *xyz,Int_t slice,Int_t slicerow) | |
2058 | { | |
2059 | //Transformation from local coordinates to raw | |
2060 | ||
2061 | xyz[0]=slicerow; | |
2062 | ||
2063 | if(slicerow<fgNRowLow) | |
2064 | xyz[1]=xyz[1]/fgPadPitchWidthLow+0.5*(fgNPads[slicerow]-1); | |
2065 | else | |
2066 | xyz[1]=xyz[1]/fgPadPitchWidthUp+0.5*(fgNPads[slicerow]-1); | |
2067 | ||
2068 | if(slice < 18) | |
2069 | xyz[2]=(fgZLength-xyz[2]+fgZOffset)/fgZWidth; | |
2070 | else | |
2071 | xyz[2]=(fgZLength+xyz[2]+fgZOffset)/fgZWidth; | |
2072 | } | |
2073 | ||
2074 | void AliHLTTPCTransform::Global2Raw(Float_t *xyz,Int_t sector,Int_t row) | |
2075 | { | |
2076 | //Transformation from global coordinates to raw. | |
2077 | ||
2078 | Global2Local(xyz,sector); | |
2079 | Local2Raw(xyz,sector,row); | |
2080 | } | |
2081 | ||
2082 | void AliHLTTPCTransform::Global2HLT(Float_t *xyz,Int_t slice,Int_t slicerow) | |
2083 | { | |
2084 | //Transformation from global coordinates to raw. | |
2085 | ||
2086 | Global2LocHLT(xyz,slice); | |
2087 | LocHLT2Raw(xyz,slice,slicerow); | |
2088 | } | |
2089 | ||
2090 | void AliHLTTPCTransform::PrintCompileOptions() | |
2091 | { | |
2092 | //print compile options | |
2093 | #if defined(__GNUC__) | |
2094 | cout << "Compiler (g++) version used: " << __GNUC__ << endl; | |
2095 | #endif | |
2096 | ||
2097 | #ifdef no_root | |
2098 | cout << "STANDALONE version: -Dno_root was given." << endl; | |
2099 | #else | |
2100 | const Char_t *roottest="$ROOTSYS/bin/root -n -b -q | grep Version | cut -b 17-25 | cut -d\" \" -f1"; | |
2101 | #ifdef use_aliroot | |
2102 | #ifdef use_cvs | |
2103 | const Char_t *aliroottest="if test -n \"`cd $ALICE_ROOT/STEER/ && cvs stat AliRun.cxx | grep \"Sticky Tag\" | grep none`\"; then echo HEAD; else cd $ALICE_ROOT/STEER/ && cvs stat AliRun.cxx | grep \"Sticky Tag\" | cut -b 18- | cut -d\" \" -f1; fi"; | |
2104 | #else | |
2105 | const Char_t *aliroottest="Unknown"; | |
2106 | #endif | |
2107 | cout << "ALIROOT version: -Duse_aliroot and -Duse_root was given." << endl; | |
2108 | cout << "Root Version: " << ROOTVERSION << " found " << flush; | |
2109 | gSystem->Exec(roottest); | |
2110 | ||
2111 | cout << "AliRoot Version: " << ALIROOTVERSION << " found " << flush; | |
2112 | gSystem->Exec(aliroottest); | |
2113 | #else | |
2114 | cout << "ROOT version: -Duse_root was given." << endl; | |
2115 | cout << "Root Version: " << ROOTVERSION << " found " << flush; | |
2116 | gSystem->Exec(roottest); | |
2117 | #endif | |
2118 | #endif | |
2119 | ||
2120 | #ifdef do_mc | |
2121 | cout << "Using Monte Carlo Info: -Ddo_mc was given." << endl; | |
2122 | #else | |
2123 | cout << "NOT using Monte Carlo Info: -Ddo_mc was not given." << endl; | |
2124 | #endif | |
2125 | ||
2126 | #ifdef INCLUDE_TPC_HOUGH | |
2127 | cout << "Including support for TPC Hough transformations." << endl; | |
2128 | #ifdef ROWHOUGHPARAMS | |
2129 | cout << "Using extended AliHLTTPCTrackSegmentData: -DROWHOUGHPARAMS was given." << endl; | |
2130 | #else | |
2131 | cout << "NOT using extended AliHLTTPCTrackSegmentData: -DROWHOUGHPARAMS was not given." << endl; | |
2132 | #endif | |
2133 | #else | |
2134 | cout << "NOT including any support for TPC Hough transformations." << endl; | |
2135 | #endif // INCLUDE_TPC_HOUGH | |
2136 | ||
2137 | #ifdef use_newio | |
2138 | cout << "Using NEWIO version: -Duse_newio was given." << endl; | |
2139 | #else | |
2140 | cout << "NOT using NEWIO version: -Duse_newio was not given." << endl; | |
2141 | #endif | |
2142 | ||
2143 | #ifdef use_logging | |
2144 | cout << "Using logging classes (MLUC): -Duse_logging was given." << endl; | |
2145 | #else | |
2146 | cout << "NOT using logging classes (MLUC): -Duse_logging not was given." << endl; | |
2147 | #endif | |
2148 | ||
2149 | } |