-
Notifications
You must be signed in to change notification settings - Fork 0
/
AliMagWrapCheb.cxx
1285 lines (1236 loc) · 44.8 KB
/
AliMagWrapCheb.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
* Author: The ALICE Off-line Project. *
* Contributors are mentioned in the code where appropriate. *
* *
* Permission to use, copy, modify and distribute this software and its *
* documentation strictly for non-commercial purposes is hereby granted *
* without fee, provided that the above copyright notice appears in all *
* copies and that both the copyright notice and this permission notice *
* appear in the supporting documentation. The authors make no claims *
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
#include "AliMagWrapCheb.h"
#include "AliLog.h"
#include <TSystem.h>
#include <TArrayF.h>
#include <TArrayI.h>
ClassImp(AliMagWrapCheb)
//__________________________________________________________________________________________
AliMagWrapCheb::AliMagWrapCheb() :
fNParamsSol(0),fNZSegSol(0),fNPSegSol(0),fNRSegSol(0),
fSegZSol(0),fSegPSol(0),fSegRSol(0),
fBegSegPSol(0),fNSegPSol(0),fBegSegRSol(0),fNSegRSol(0),fSegIDSol(0),fMinZSol(1.e6),fMaxZSol(-1.e6),fParamsSol(0),fMaxRSol(0),
//
fNParamsTPC(0),fNZSegTPC(0),fNPSegTPC(0),fNRSegTPC(0),
fSegZTPC(0),fSegPTPC(0),fSegRTPC(0),
fBegSegPTPC(0),fNSegPTPC(0),fBegSegRTPC(0),fNSegRTPC(0),fSegIDTPC(0),fMinZTPC(1.e6),fMaxZTPC(-1.e6),fParamsTPC(0),fMaxRTPC(0),
//
fNParamsTPCRat(0),fNZSegTPCRat(0),fNPSegTPCRat(0),fNRSegTPCRat(0),
fSegZTPCRat(0),fSegPTPCRat(0),fSegRTPCRat(0),
fBegSegPTPCRat(0),fNSegPTPCRat(0),fBegSegRTPCRat(0),fNSegRTPCRat(0),fSegIDTPCRat(0),fMinZTPCRat(1.e6),fMaxZTPCRat(-1.e6),fParamsTPCRat(0),fMaxRTPCRat(0),
//
fNParamsDip(0),fNZSegDip(0),fNYSegDip(0),fNXSegDip(0),
fSegZDip(0),fSegYDip(0),fSegXDip(0),
fBegSegYDip(0),fNSegYDip(0),fBegSegXDip(0),fNSegXDip(0),fSegIDDip(0),fMinZDip(1.e6),fMaxZDip(-1.e6),fParamsDip(0)
//
#ifdef _MAGCHEB_CACHE_
,fCacheSol(0),fCacheDip(0),fCacheTPCInt(0),fCacheTPCRat(0)
#endif
//
{
// default constructor
}
//__________________________________________________________________________________________
AliMagWrapCheb::AliMagWrapCheb(const AliMagWrapCheb& src) :
TNamed(src),
fNParamsSol(0),fNZSegSol(0),fNPSegSol(0),fNRSegSol(0),
fSegZSol(0),fSegPSol(0),fSegRSol(0),
fBegSegPSol(0),fNSegPSol(0),fBegSegRSol(0),fNSegRSol(0),fSegIDSol(0),fMinZSol(1.e6),fMaxZSol(-1.e6),fParamsSol(0),fMaxRSol(0),
//
fNParamsTPC(0),fNZSegTPC(0),fNPSegTPC(0),fNRSegTPC(0),
fSegZTPC(0),fSegPTPC(0),fSegRTPC(0),
fBegSegPTPC(0),fNSegPTPC(0),fBegSegRTPC(0),fNSegRTPC(0),fSegIDTPC(0),fMinZTPC(1.e6),fMaxZTPC(-1.e6),fParamsTPC(0),fMaxRTPC(0),
//
fNParamsTPCRat(0),fNZSegTPCRat(0),fNPSegTPCRat(0),fNRSegTPCRat(0),
fSegZTPCRat(0),fSegPTPCRat(0),fSegRTPCRat(0),
fBegSegPTPCRat(0),fNSegPTPCRat(0),fBegSegRTPCRat(0),fNSegRTPCRat(0),fSegIDTPCRat(0),fMinZTPCRat(1.e6),fMaxZTPCRat(-1.e6),fParamsTPCRat(0),fMaxRTPCRat(0),
//
fNParamsDip(0),fNZSegDip(0),fNYSegDip(0),fNXSegDip(0),
fSegZDip(0),fSegYDip(0),fSegXDip(0),
fBegSegYDip(0),fNSegYDip(0),fBegSegXDip(0),fNSegXDip(0),fSegIDDip(0),fMinZDip(1.e6),fMaxZDip(-1.e6),fParamsDip(0)
//
#ifdef _MAGCHEB_CACHE_
,fCacheSol(0),fCacheDip(0),fCacheTPCInt(0),fCacheTPCRat(0)
#endif
{
// copy constructor
CopyFrom(src);
//
}
//__________________________________________________________________________________________
void AliMagWrapCheb::CopyFrom(const AliMagWrapCheb& src)
{
// copy method
Clear();
SetName(src.GetName());
SetTitle(src.GetTitle());
//
fNParamsSol = src.fNParamsSol;
fNZSegSol = src.fNZSegSol;
fNPSegSol = src.fNPSegSol;
fNRSegSol = src.fNRSegSol;
fMinZSol = src.fMinZSol;
fMaxZSol = src.fMaxZSol;
fMaxRSol = src.fMaxRSol;
if (src.fNParamsSol) {
memcpy(fSegZSol = new Float_t[fNZSegSol], src.fSegZSol, sizeof(Float_t)*fNZSegSol);
memcpy(fSegPSol = new Float_t[fNPSegSol], src.fSegPSol, sizeof(Float_t)*fNPSegSol);
memcpy(fSegRSol = new Float_t[fNRSegSol], src.fSegRSol, sizeof(Float_t)*fNRSegSol);
memcpy(fBegSegPSol= new Int_t[fNZSegSol], src.fBegSegPSol, sizeof(Int_t)*fNZSegSol);
memcpy(fNSegPSol = new Int_t[fNZSegSol], src.fNSegPSol, sizeof(Int_t)*fNZSegSol);
memcpy(fBegSegRSol= new Int_t[fNPSegSol], src.fBegSegRSol, sizeof(Int_t)*fNPSegSol);
memcpy(fNSegRSol = new Int_t[fNPSegSol], src.fNSegRSol, sizeof(Int_t)*fNPSegSol);
memcpy(fSegIDSol = new Int_t[fNRSegSol], src.fSegIDSol, sizeof(Int_t)*fNRSegSol);
fParamsSol = new TObjArray(fNParamsSol);
for (int i=0;i<fNParamsSol;i++) fParamsSol->AddAtAndExpand(new AliCheb3D(*src.GetParamSol(i)),i);
}
//
fNParamsTPC = src.fNParamsTPC;
fNZSegTPC = src.fNZSegTPC;
fNPSegTPC = src.fNPSegTPC;
fNRSegTPC = src.fNRSegTPC;
fMinZTPC = src.fMinZTPC;
fMaxZTPC = src.fMaxZTPC;
fMaxRTPC = src.fMaxRTPC;
if (src.fNParamsTPC) {
memcpy(fSegZTPC = new Float_t[fNZSegTPC], src.fSegZTPC, sizeof(Float_t)*fNZSegTPC);
memcpy(fSegPTPC = new Float_t[fNPSegTPC], src.fSegPTPC, sizeof(Float_t)*fNPSegTPC);
memcpy(fSegRTPC = new Float_t[fNRSegTPC], src.fSegRTPC, sizeof(Float_t)*fNRSegTPC);
memcpy(fBegSegPTPC= new Int_t[fNZSegTPC], src.fBegSegPTPC, sizeof(Int_t)*fNZSegTPC);
memcpy(fNSegPTPC = new Int_t[fNZSegTPC], src.fNSegPTPC, sizeof(Int_t)*fNZSegTPC);
memcpy(fBegSegRTPC= new Int_t[fNPSegTPC], src.fBegSegRTPC, sizeof(Int_t)*fNPSegTPC);
memcpy(fNSegRTPC = new Int_t[fNPSegTPC], src.fNSegRTPC, sizeof(Int_t)*fNPSegTPC);
memcpy(fSegIDTPC = new Int_t[fNRSegTPC], src.fSegIDTPC, sizeof(Int_t)*fNRSegTPC);
fParamsTPC = new TObjArray(fNParamsTPC);
for (int i=0;i<fNParamsTPC;i++) fParamsTPC->AddAtAndExpand(new AliCheb3D(*src.GetParamTPCInt(i)),i);
}
//
fNParamsTPCRat = src.fNParamsTPCRat;
fNZSegTPCRat = src.fNZSegTPCRat;
fNPSegTPCRat = src.fNPSegTPCRat;
fNRSegTPCRat = src.fNRSegTPCRat;
fMinZTPCRat = src.fMinZTPCRat;
fMaxZTPCRat = src.fMaxZTPCRat;
fMaxRTPCRat = src.fMaxRTPCRat;
if (src.fNParamsTPCRat) {
memcpy(fSegZTPCRat = new Float_t[fNZSegTPCRat], src.fSegZTPCRat, sizeof(Float_t)*fNZSegTPCRat);
memcpy(fSegPTPCRat = new Float_t[fNPSegTPCRat], src.fSegPTPCRat, sizeof(Float_t)*fNPSegTPCRat);
memcpy(fSegRTPCRat = new Float_t[fNRSegTPCRat], src.fSegRTPCRat, sizeof(Float_t)*fNRSegTPCRat);
memcpy(fBegSegPTPCRat= new Int_t[fNZSegTPCRat], src.fBegSegPTPCRat, sizeof(Int_t)*fNZSegTPCRat);
memcpy(fNSegPTPCRat = new Int_t[fNZSegTPCRat], src.fNSegPTPCRat, sizeof(Int_t)*fNZSegTPCRat);
memcpy(fBegSegRTPCRat= new Int_t[fNPSegTPCRat], src.fBegSegRTPCRat, sizeof(Int_t)*fNPSegTPCRat);
memcpy(fNSegRTPCRat = new Int_t[fNPSegTPCRat], src.fNSegRTPCRat, sizeof(Int_t)*fNPSegTPCRat);
memcpy(fSegIDTPCRat = new Int_t[fNRSegTPCRat], src.fSegIDTPCRat, sizeof(Int_t)*fNRSegTPCRat);
fParamsTPCRat = new TObjArray(fNParamsTPCRat);
for (int i=0;i<fNParamsTPCRat;i++) fParamsTPCRat->AddAtAndExpand(new AliCheb3D(*src.GetParamTPCRatInt(i)),i);
}
//
fNParamsDip = src.fNParamsDip;
fNZSegDip = src.fNZSegDip;
fNYSegDip = src.fNYSegDip;
fNXSegDip = src.fNXSegDip;
fMinZDip = src.fMinZDip;
fMaxZDip = src.fMaxZDip;
if (src.fNParamsDip) {
memcpy(fSegZDip = new Float_t[fNZSegDip], src.fSegZDip, sizeof(Float_t)*fNZSegDip);
memcpy(fSegYDip = new Float_t[fNYSegDip], src.fSegYDip, sizeof(Float_t)*fNYSegDip);
memcpy(fSegXDip = new Float_t[fNXSegDip], src.fSegXDip, sizeof(Float_t)*fNXSegDip);
memcpy(fBegSegYDip= new Int_t[fNZSegDip], src.fBegSegYDip, sizeof(Int_t)*fNZSegDip);
memcpy(fNSegYDip = new Int_t[fNZSegDip], src.fNSegYDip, sizeof(Int_t)*fNZSegDip);
memcpy(fBegSegXDip= new Int_t[fNYSegDip], src.fBegSegXDip, sizeof(Int_t)*fNYSegDip);
memcpy(fNSegXDip = new Int_t[fNYSegDip], src.fNSegXDip, sizeof(Int_t)*fNYSegDip);
memcpy(fSegIDDip = new Int_t[fNXSegDip], src.fSegIDDip, sizeof(Int_t)*fNXSegDip);
fParamsDip = new TObjArray(fNParamsDip);
for (int i=0;i<fNParamsDip;i++) fParamsDip->AddAtAndExpand(new AliCheb3D(*src.GetParamDip(i)),i);
}
//
}
//__________________________________________________________________________________________
AliMagWrapCheb& AliMagWrapCheb::operator=(const AliMagWrapCheb& rhs)
{
// assignment
if (this != &rhs) {
Clear();
CopyFrom(rhs);
}
return *this;
//
}
//__________________________________________________________________________________________
void AliMagWrapCheb::Clear(const Option_t *)
{
// clear all dynamic parts
if (fNParamsSol) {
fParamsSol->SetOwner(kTRUE);
delete fParamsSol; fParamsSol = 0;
delete[] fSegZSol; fSegZSol = 0;
delete[] fSegPSol; fSegPSol = 0;
delete[] fSegRSol; fSegRSol = 0;
delete[] fBegSegPSol; fBegSegPSol = 0;
delete[] fNSegPSol; fNSegPSol = 0;
delete[] fBegSegRSol; fBegSegRSol = 0;
delete[] fNSegRSol; fNSegRSol = 0;
delete[] fSegIDSol; fSegIDSol = 0;
}
fNParamsSol = fNZSegSol = fNPSegSol = fNRSegSol = 0;
fMinZSol = 1e6;
fMaxZSol = -1e6;
fMaxRSol = 0;
//
if (fNParamsTPC) {
fParamsTPC->SetOwner(kTRUE);
delete fParamsTPC; fParamsTPC = 0;
delete[] fSegZTPC; fSegZTPC = 0;
delete[] fSegPTPC; fSegPTPC = 0;
delete[] fSegRTPC; fSegRTPC = 0;
delete[] fBegSegPTPC; fBegSegPTPC = 0;
delete[] fNSegPTPC; fNSegPTPC = 0;
delete[] fBegSegRTPC; fBegSegRTPC = 0;
delete[] fNSegRTPC; fNSegRTPC = 0;
delete[] fSegIDTPC; fSegIDTPC = 0;
}
fNParamsTPC = fNZSegTPC = fNPSegTPC = fNRSegTPC = 0;
fMinZTPC = 1e6;
fMaxZTPC = -1e6;
fMaxRTPC = 0;
//
if (fNParamsTPCRat) {
fParamsTPCRat->SetOwner(kTRUE);
delete fParamsTPCRat; fParamsTPCRat = 0;
delete[] fSegZTPCRat; fSegZTPCRat = 0;
delete[] fSegPTPCRat; fSegPTPCRat = 0;
delete[] fSegRTPCRat; fSegRTPCRat = 0;
delete[] fBegSegPTPCRat; fBegSegPTPCRat = 0;
delete[] fNSegPTPCRat; fNSegPTPCRat = 0;
delete[] fBegSegRTPCRat; fBegSegRTPCRat = 0;
delete[] fNSegRTPCRat; fNSegRTPCRat = 0;
delete[] fSegIDTPCRat; fSegIDTPCRat = 0;
}
fNParamsTPCRat = fNZSegTPCRat = fNPSegTPCRat = fNRSegTPCRat = 0;
fMinZTPCRat = 1e6;
fMaxZTPCRat = -1e6;
fMaxRTPCRat = 0;
//
if (fNParamsDip) {
fParamsDip->SetOwner(kTRUE);
delete fParamsDip; fParamsDip = 0;
delete[] fSegZDip; fSegZDip = 0;
delete[] fSegYDip; fSegYDip = 0;
delete[] fSegXDip; fSegXDip = 0;
delete[] fBegSegYDip; fBegSegYDip = 0;
delete[] fNSegYDip; fNSegYDip = 0;
delete[] fBegSegXDip; fBegSegXDip = 0;
delete[] fNSegXDip; fNSegXDip = 0;
delete[] fSegIDDip; fSegIDDip = 0;
}
fNParamsDip = fNZSegDip = fNYSegDip = fNXSegDip = 0;
fMinZDip = 1e6;
fMaxZDip = -1e6;
//
#ifdef _MAGCHEB_CACHE_
fCacheSol = 0;
fCacheDip = 0;
fCacheTPCInt = 0;
fCacheTPCRat = 0;
#endif
//
}
//__________________________________________________________________________________________
void AliMagWrapCheb::Field(const Double_t *xyz, Double_t *b) const
{
// compute field in cartesian coordinates. If point is outside of the parameterized region
// get it at closest valid point
Double_t rphiz[3];
//
#ifndef _BRING_TO_BOUNDARY_ // exact matching to fitted volume is requested
b[0] = b[1] = b[2] = 0;
#endif
//
if (xyz[2]>fMinZSol) {
CartToCyl(xyz,rphiz);
//
#ifdef _MAGCHEB_CACHE_
if (fCacheSol && fCacheSol->IsInside(rphiz))
fCacheSol->Eval(rphiz,b);
else
#endif //_MAGCHEB_CACHE_
FieldCylSol(rphiz,b);
// convert field to cartesian system
CylToCartCylB(rphiz, b,b);
return;
}
//
#ifdef _MAGCHEB_CACHE_
if (fCacheDip && fCacheDip->IsInside(xyz)) {
fCacheDip->Eval(xyz,b); // check the cache first
return;
}
#else //_MAGCHEB_CACHE_
AliCheb3D* fCacheDip = 0;
#endif //_MAGCHEB_CACHE_
int iddip = FindDipSegment(xyz);
if (iddip>=0) {
fCacheDip = GetParamDip(iddip);
//
#ifndef _BRING_TO_BOUNDARY_
if (!fCacheDip->IsInside(xyz)) return;
#endif //_BRING_TO_BOUNDARY_
//
fCacheDip->Eval(xyz,b);
}
//
}
//__________________________________________________________________________________________
Double_t AliMagWrapCheb::GetBz(const Double_t *xyz) const
{
// compute Bz for the point in cartesian coordinates. If point is outside of the parameterized region
// get it at closest valid point
Double_t rphiz[3];
//
if (xyz[2]>fMinZSol) {
//
CartToCyl(xyz,rphiz);
//
#ifdef _MAGCHEB_CACHE_
if (fCacheSol && fCacheSol->IsInside(rphiz)) return fCacheSol->Eval(rphiz,2);
#endif //_MAGCHEB_CACHE_
return FieldCylSolBz(rphiz);
}
//
#ifdef _MAGCHEB_CACHE_
if (fCacheDip && fCacheDip->IsInside(xyz)) return fCacheDip->Eval(xyz,2); // check the cache first
//
#else //_MAGCHEB_CACHE_
AliCheb3D* fCacheDip = 0;
#endif //_MAGCHEB_CACHE_
//
int iddip = FindDipSegment(xyz);
if (iddip>=0) {
fCacheDip = GetParamDip(iddip);
//
#ifndef _BRING_TO_BOUNDARY_
if (!fCacheDip->IsInside(xyz)) return 0.;
#endif // _BRING_TO_BOUNDARY_
//
return fCacheDip->Eval(xyz,2);
//
}
//
return 0;
//
}
//__________________________________________________________________________________________
void AliMagWrapCheb::Print(Option_t *) const
{
// print info
printf("Alice magnetic field parameterized by Chebyshev polynomials\n");
printf("Segmentation for Solenoid (%+.2f<Z<%+.2f cm | R<%.2f cm)\n",fMinZSol,fMaxZSol,fMaxRSol);
//
if (fParamsSol) {
for (int i=0;i<fNParamsSol;i++) {
printf("SOL%4d ",i);
GetParamSol(i)->Print();
}
}
//
printf("Segmentation for TPC field integral (%+.2f<Z<%+.2f cm | R<%.2f cm)\n",fMinZTPC,fMaxZTPC,fMaxRTPC);
//
if (fParamsTPC) {
for (int i=0;i<fNParamsTPC;i++) {
printf("TPC%4d ",i);
GetParamTPCInt(i)->Print();
}
}
//
printf("Segmentation for TPC field ratios integral (%+.2f<Z<%+.2f cm | R<%.2f cm)\n",fMinZTPCRat,fMaxZTPCRat,fMaxRTPCRat);
//
if (fParamsTPCRat) {
for (int i=0;i<fNParamsTPCRat;i++) {
printf("TPCRat%4d ",i);
GetParamTPCRatInt(i)->Print();
}
}
//
printf("Segmentation for Dipole (%+.2f<Z<%+.2f cm)\n",fMinZDip,fMaxZDip);
if (fParamsDip) {
for (int i=0;i<fNParamsDip;i++) {
printf("DIP%4d ",i);
GetParamDip(i)->Print();
}
}
//
}
//__________________________________________________________________________________________________
Int_t AliMagWrapCheb::FindDipSegment(const Double_t *xyz) const
{
// find the segment containing point xyz. If it is outside find the closest segment
if (!fNParamsDip) return -1;
int xid,yid,zid = TMath::BinarySearch(fNZSegDip,fSegZDip,(Float_t)xyz[2]); // find zsegment
//
Bool_t reCheck = kFALSE;
while(1) {
int ysegBeg = fBegSegYDip[zid];
//
for (yid=0;yid<fNSegYDip[zid];yid++) if (xyz[1]<fSegYDip[ysegBeg+yid]) break;
if ( --yid < 0 ) yid = 0;
yid += ysegBeg;
//
int xsegBeg = fBegSegXDip[yid];
for (xid=0;xid<fNSegXDip[yid];xid++) if (xyz[0]<fSegXDip[xsegBeg+xid]) break;
//
if ( --xid < 0) xid = 0;
xid += xsegBeg;
//
// to make sure that due to the precision problems we did not pick the next Zbin
if (!reCheck && (xyz[2] - fSegZDip[zid] < 3.e-5) && zid &&
!GetParamDip(fSegIDDip[xid])->IsInside(xyz)) { // check the previous Z bin
zid--;
reCheck = kTRUE;
continue;
}
break;
}
// AliInfo(Form("%+.2f %+.2f %+.2f %d %d %d %4d",xyz[0],xyz[1],xyz[2],xid,yid,zid,fSegIDDip[xid]));
return fSegIDDip[xid];
}
//__________________________________________________________________________________________________
Int_t AliMagWrapCheb::GetDipSegmentsForZSlice(int zid, TObjArray& arr) const
{
if (zid<0 || zid>=fNZSegDip) return -1;
arr.Clear();
arr.SetOwner(kFALSE);
int ysegBeg = fBegSegYDip[zid];
for (int yid=0;yid<fNSegYDip[zid];yid++) {
int yid1 = yid + ysegBeg;
int xsegBeg = fBegSegXDip[yid1];
for (int xid=0;xid<fNSegXDip[yid1];xid++) {
int xid1 = xid + xsegBeg;
// printf("#%2d Adding segment %d\n",arr.GetEntriesFast(),xid1);
// GetParamDip(fSegIDDip[xid1])->Print();
arr.AddLast( GetParamDip(fSegIDDip[xid1]) );
}
}
return arr.GetEntriesFast();
}
//__________________________________________________________________________________________________
Int_t AliMagWrapCheb::FindSolSegment(const Double_t *rpz) const
{
// find the segment containing point xyz. If it is outside find the closest segment
if (!fNParamsSol) return -1;
int rid,pid,zid = TMath::BinarySearch(fNZSegSol,fSegZSol,(Float_t)rpz[2]); // find zsegment
//
Bool_t reCheck = kFALSE;
while(1) {
int psegBeg = fBegSegPSol[zid];
for (pid=0;pid<fNSegPSol[zid];pid++) if (rpz[1]<fSegPSol[psegBeg+pid]) break;
if ( --pid < 0 ) pid = 0;
pid += psegBeg;
//
int rsegBeg = fBegSegRSol[pid];
for (rid=0;rid<fNSegRSol[pid];rid++) if (rpz[0]<fSegRSol[rsegBeg+rid]) break;
if ( --rid < 0) rid = 0;
rid += rsegBeg;
//
// to make sure that due to the precision problems we did not pick the next Zbin
if (!reCheck && (rpz[2] - fSegZSol[zid] < 3.e-5) && zid &&
!GetParamSol(fSegIDSol[rid])->IsInside(rpz)) { // check the previous Z bin
zid--;
reCheck = kTRUE;
continue;
}
break;
}
// AliInfo(Form("%+.2f %+.4f %+.2f %d %d %d %4d",rpz[0],rpz[1],rpz[2],rid,pid,zid,fSegIDSol[rid]));
return fSegIDSol[rid];
}
//__________________________________________________________________________________________________
Int_t AliMagWrapCheb::FindTPCSegment(const Double_t *rpz) const
{
// find the segment containing point xyz. If it is outside find the closest segment
if (!fNParamsTPC) return -1;
int rid,pid,zid = TMath::BinarySearch(fNZSegTPC,fSegZTPC,(Float_t)rpz[2]); // find zsegment
//
Bool_t reCheck = kFALSE;
while(1) {
int psegBeg = fBegSegPTPC[zid];
//
for (pid=0;pid<fNSegPTPC[zid];pid++) if (rpz[1]<fSegPTPC[psegBeg+pid]) break;
if ( --pid < 0 ) pid = 0;
pid += psegBeg;
//
int rsegBeg = fBegSegRTPC[pid];
for (rid=0;rid<fNSegRTPC[pid];rid++) if (rpz[0]<fSegRTPC[rsegBeg+rid]) break;
if ( --rid < 0) rid = 0;
rid += rsegBeg;
//
// to make sure that due to the precision problems we did not pick the next Zbin
if (!reCheck && (rpz[2] - fSegZTPC[zid] < 3.e-5) && zid &&
!GetParamTPCInt(fSegIDTPC[rid])->IsInside(rpz)) { // check the previous Z bin
zid--;
reCheck = kTRUE;
continue;
}
break;
}
// AliInfo(Form("%+.2f %+.4f %+.2f %d %d %d %4d",rpz[0],rpz[1],rpz[2],rid,pid,zid,fSegIDTPC[rid]));
return fSegIDTPC[rid];
}
//__________________________________________________________________________________________________
Int_t AliMagWrapCheb::FindTPCRatSegment(const Double_t *rpz) const
{
// find the segment containing point xyz. If it is outside find the closest segment
if (!fNParamsTPCRat) return -1;
int rid,pid,zid = TMath::BinarySearch(fNZSegTPCRat,fSegZTPCRat,(Float_t)rpz[2]); // find zsegment
//
Bool_t reCheck = kFALSE;
while(1) {
int psegBeg = fBegSegPTPCRat[zid];
//
for (pid=0;pid<fNSegPTPCRat[zid];pid++) if (rpz[1]<fSegPTPCRat[psegBeg+pid]) break;
if ( --pid < 0 ) pid = 0;
pid += psegBeg;
//
int rsegBeg = fBegSegRTPCRat[pid];
for (rid=0;rid<fNSegRTPCRat[pid];rid++) if (rpz[0]<fSegRTPCRat[rsegBeg+rid]) break;
if ( --rid < 0) rid = 0;
rid += rsegBeg;
//
// to make sure that due to the precision problems we did not pick the next Zbin
if (!reCheck && (rpz[2] - fSegZTPCRat[zid] < 3.e-5) && zid &&
!GetParamTPCRatInt(fSegIDTPCRat[rid])->IsInside(rpz)) { // check the previous Z bin
zid--;
reCheck = kTRUE;
continue;
}
break;
}
// AliInfo(Form("%+.2f %+.4f %+.2f %d %d %d %4d",rpz[0],rpz[1],rpz[2],rid,pid,zid,fSegIDTPCRat[rid]));
return fSegIDTPCRat[rid];
}
//__________________________________________________________________________________________
void AliMagWrapCheb::GetTPCInt(const Double_t *xyz, Double_t *b) const
{
// compute TPC region field integral in cartesian coordinates.
// If point is outside of the parameterized region get it at closeset valid point
static Double_t rphiz[3];
//
// TPCInt region
// convert coordinates to cyl system
CartToCyl(xyz,rphiz);
#ifndef _BRING_TO_BOUNDARY_
if ( (rphiz[2]>GetMaxZTPCInt()||rphiz[2]<GetMinZTPCInt()) ||
rphiz[0]>GetMaxRTPCInt()) {for (int i=3;i--;) b[i]=0; return;}
#endif
//
GetTPCIntCyl(rphiz,b);
//
// convert field to cartesian system
CylToCartCylB(rphiz, b,b);
//
}
//__________________________________________________________________________________________
void AliMagWrapCheb::GetTPCRatInt(const Double_t *xyz, Double_t *b) const
{
// compute TPCRat region field integral in cartesian coordinates.
// If point is outside of the parameterized region get it at closeset valid point
static Double_t rphiz[3];
//
// TPCRatInt region
// convert coordinates to cyl system
CartToCyl(xyz,rphiz);
#ifndef _BRING_TO_BOUNDARY_
if ( (rphiz[2]>GetMaxZTPCRatInt()||rphiz[2]<GetMinZTPCRatInt()) ||
rphiz[0]>GetMaxRTPCRatInt()) {for (int i=3;i--;) b[i]=0; return;}
#endif
//
GetTPCRatIntCyl(rphiz,b);
//
// convert field to cartesian system
CylToCartCylB(rphiz, b,b);
//
}
//__________________________________________________________________________________________
void AliMagWrapCheb::FieldCylSol(const Double_t *rphiz, Double_t *b) const
{
// compute Solenoid field in Cylindircal coordinates
// note: if the point is outside the volume get the field in closest parameterized point
int id = FindSolSegment(rphiz);
if (id>=0) {
#ifndef _MAGCHEB_CACHE_
AliCheb3D* fCacheSol = 0;
#endif
fCacheSol = GetParamSol(id);
//
#ifndef _BRING_TO_BOUNDARY_ // exact matching to fitted volume is requested
if (!fCacheSol->IsInside(rphiz)) return;
#endif
fCacheSol->Eval(rphiz,b);
}
//
}
//__________________________________________________________________________________________
Double_t AliMagWrapCheb::FieldCylSolBz(const Double_t *rphiz) const
{
// compute Solenoid field in Cylindircal coordinates
// note: if the point is outside the volume get the field in closest parameterized point
int id = FindSolSegment(rphiz);
if (id<0) return 0.;
//
#ifndef _MAGCHEB_CACHE_
AliCheb3D* fCacheSol = 0;
#endif
//
fCacheSol = GetParamSol(id);
#ifndef _BRING_TO_BOUNDARY_
return fCacheSol->IsInside(rphiz) ? fCacheSol->Eval(rphiz,2) : 0;
#else
return fCacheSol->Eval(rphiz,2);
#endif
//
}
//__________________________________________________________________________________________
void AliMagWrapCheb::GetTPCIntCyl(const Double_t *rphiz, Double_t *b) const
{
// compute field integral in TPC region in Cylindircal coordinates
// note: the check for the point being inside the parameterized region is done outside
//
#ifdef _MAGCHEB_CACHE_
//
if (fCacheTPCInt && fCacheTPCInt->IsInside(rphiz)) {
fCacheTPCInt->Eval(rphiz,b);
return;
}
#else //_MAGCHEB_CACHE_
AliCheb3D* fCacheTPCInt = 0;
#endif //_MAGCHEB_CACHE_
//
int id = FindTPCSegment(rphiz);
if (id>=0) {
// if (id>=fNParamsTPC) {
// b[0] = b[1] = b[2] = 0;
// AliError(Form("Wrong TPCParam segment %d",id));
// b[0] = b[1] = b[2] = 0;
// return;
// }
fCacheTPCInt = GetParamTPCInt(id);
if (fCacheTPCInt->IsInside(rphiz)) {
fCacheTPCInt->Eval(rphiz,b);
return;
}
}
//
b[0] = b[1] = b[2] = 0;
//
}
//__________________________________________________________________________________________
void AliMagWrapCheb::GetTPCRatIntCyl(const Double_t *rphiz, Double_t *b) const
{
// compute field integral in TPCRat region in Cylindircal coordinates
// note: the check for the point being inside the parameterized region is done outside
//
#ifdef _MAGCHEB_CACHE_
if (fCacheTPCRat && fCacheTPCRat->IsInside(rphiz)) {
fCacheTPCRat->Eval(rphiz,b);
return;
}
#else
AliCheb3D* fCacheTPCRat = 0;
#endif //_MAGCHEB_CACHE_
//
int id = FindTPCRatSegment(rphiz);
if (id>=0) {
// if (id>=fNParamsTPCRat) {
// AliError(Form("Wrong TPCRatParam segment %d",id));
// b[0] = b[1] = b[2] = 0;
// return;
// }
fCacheTPCRat = GetParamTPCRatInt(id);
if (fCacheTPCRat->IsInside(rphiz)) {
fCacheTPCRat->Eval(rphiz,b);
return;
}
}
//
b[0] = b[1] = b[2] = 0;
//
}
#ifdef _INC_CREATION_ALICHEB3D_
//_______________________________________________
void AliMagWrapCheb::LoadData(const char* inpfile)
{
// read coefficients data from the text file
//
TString strf = inpfile;
gSystem->ExpandPathName(strf);
FILE* stream = fopen(strf,"r");
if (!stream) {
printf("Did not find input file %s\n",strf.Data());
return;
}
//
TString buffs;
AliCheb3DCalc::ReadLine(buffs,stream);
if (!buffs.BeginsWith("START")) AliFatalF("Expected: \"START <name>\", found \"%s\"",buffs.Data());
if (buffs.First(' ')>0) SetName(buffs.Data()+buffs.First(' ')+1);
//
// Solenoid part -----------------------------------------------------------
AliCheb3DCalc::ReadLine(buffs,stream);
if (!buffs.BeginsWith("START SOLENOID")) AliFatalF("Expected: \"START SOLENOID\", found \"%s\"",buffs.Data());
AliCheb3DCalc::ReadLine(buffs,stream); // nparam
int nparSol = buffs.Atoi();
//
for (int ip=0;ip<nparSol;ip++) {
AliCheb3D* cheb = new AliCheb3D();
cheb->LoadData(stream);
AddParamSol(cheb);
}
//
AliCheb3DCalc::ReadLine(buffs,stream);
if (!buffs.BeginsWith("END SOLENOID")) AliFatalF("Expected \"END SOLENOID\", found \"%s\"",buffs.Data());
//
// TPCInt part -----------------------------------------------------------
AliCheb3DCalc::ReadLine(buffs,stream);
if (!buffs.BeginsWith("START TPCINT")) AliFatalF("Expected: \"START TPCINT\", found \"%s\"",buffs.Data());
//
AliCheb3DCalc::ReadLine(buffs,stream); // nparam
int nparTPCInt = buffs.Atoi();
//
for (int ip=0;ip<nparTPCInt;ip++) {
AliCheb3D* cheb = new AliCheb3D();
cheb->LoadData(stream);
AddParamTPCInt(cheb);
}
//
AliCheb3DCalc::ReadLine(buffs,stream);
if (!buffs.BeginsWith("END TPCINT")) AliFatalF("Expected \"END TPCINT\", found \"%s\"",buffs.Data());
//
// TPCRatInt part -----------------------------------------------------------
AliCheb3DCalc::ReadLine(buffs,stream);
if (!buffs.BeginsWith("START TPCRatINT")) AliFatalF("Expected: \"START TPCRatINT\", found \"%s\"",buffs.Data());
AliCheb3DCalc::ReadLine(buffs,stream); // nparam
int nparTPCRatInt = buffs.Atoi();
//
for (int ip=0;ip<nparTPCRatInt;ip++) {
AliCheb3D* cheb = new AliCheb3D();
cheb->LoadData(stream);
AddParamTPCRatInt(cheb);
}
//
AliCheb3DCalc::ReadLine(buffs,stream);
if (!buffs.BeginsWith("END TPCRatINT")) AliFatalF("Expected \"END TPCRatINT\", found \"%s\"",buffs.Data());
//
// Dipole part -----------------------------------------------------------
AliCheb3DCalc::ReadLine(buffs,stream);
if (!buffs.BeginsWith("START DIPOLE")) AliFatalF("Expected: \"START DIPOLE\", found \"%s\"",buffs.Data());
//
AliCheb3DCalc::ReadLine(buffs,stream); // nparam
int nparDip = buffs.Atoi();
//
for (int ip=0;ip<nparDip;ip++) {
AliCheb3D* cheb = new AliCheb3D();
cheb->LoadData(stream);
AddParamDip(cheb);
}
//
AliCheb3DCalc::ReadLine(buffs,stream);
if (!buffs.BeginsWith("END DIPOLE")) AliFatalF("Expected \"END DIPOLE\", found \"%s\"",buffs.Data());
//
AliCheb3DCalc::ReadLine(buffs,stream);
if (!buffs.BeginsWith("END ") && !buffs.Contains(GetName())) AliFatalF("Expected: \"END %s\", found \"%s\"",GetName(),buffs.Data());
//
// ---------------------------------------------------------------------------
fclose(stream);
BuildTableSol();
BuildTableDip();
BuildTableTPCInt();
BuildTableTPCRatInt();
//
printf("Loaded magnetic field \"%s\" from %s\n",GetName(),strf.Data());
//
}
//__________________________________________________________________________________________
void AliMagWrapCheb::BuildTableSol()
{
// build lookup table
BuildTable(fNParamsSol,fParamsSol,
fNZSegSol,fNPSegSol,fNRSegSol,
fMinZSol,fMaxZSol,
&fSegZSol,&fSegPSol,&fSegRSol,
&fBegSegPSol,&fNSegPSol,
&fBegSegRSol,&fNSegRSol,
&fSegIDSol);
}
//__________________________________________________________________________________________
void AliMagWrapCheb::BuildTableDip()
{
// build lookup table
BuildTable(fNParamsDip,fParamsDip,
fNZSegDip,fNYSegDip,fNXSegDip,
fMinZDip,fMaxZDip,
&fSegZDip,&fSegYDip,&fSegXDip,
&fBegSegYDip,&fNSegYDip,
&fBegSegXDip,&fNSegXDip,
&fSegIDDip);
}
//__________________________________________________________________________________________
void AliMagWrapCheb::BuildTableTPCInt()
{
// build lookup table
BuildTable(fNParamsTPC,fParamsTPC,
fNZSegTPC,fNPSegTPC,fNRSegTPC,
fMinZTPC,fMaxZTPC,
&fSegZTPC,&fSegPTPC,&fSegRTPC,
&fBegSegPTPC,&fNSegPTPC,
&fBegSegRTPC,&fNSegRTPC,
&fSegIDTPC);
}
//__________________________________________________________________________________________
void AliMagWrapCheb::BuildTableTPCRatInt()
{
// build lookup table
BuildTable(fNParamsTPCRat,fParamsTPCRat,
fNZSegTPCRat,fNPSegTPCRat,fNRSegTPCRat,
fMinZTPCRat,fMaxZTPCRat,
&fSegZTPCRat,&fSegPTPCRat,&fSegRTPCRat,
&fBegSegPTPCRat,&fNSegPTPCRat,
&fBegSegRTPCRat,&fNSegRTPCRat,
&fSegIDTPCRat);
}
#endif
//_______________________________________________
#ifdef _INC_CREATION_ALICHEB3D_
//__________________________________________________________________________________________
AliMagWrapCheb::AliMagWrapCheb(const char* inputFile) :
fNParamsSol(0),fNZSegSol(0),fNPSegSol(0),fNRSegSol(0),
fSegZSol(0),fSegPSol(0),fSegRSol(0),
fBegSegPSol(0),fNSegPSol(0),fBegSegRSol(0),fNSegRSol(0),fSegIDSol(0),fMinZSol(1.e6),fMaxZSol(-1.e6),fParamsSol(0),fMaxRSol(0),
//
fNParamsTPC(0),fNZSegTPC(0),fNPSegTPC(0),fNRSegTPC(0),
fSegZTPC(0),fSegPTPC(0),fSegRTPC(0),
fBegSegPTPC(0),fNSegPTPC(0),fBegSegRTPC(0),fNSegRTPC(0),fSegIDTPC(0),fMinZTPC(1.e6),fMaxZTPC(-1.e6),fParamsTPC(0),fMaxRTPC(0),
//
fNParamsTPCRat(0),fNZSegTPCRat(0),fNPSegTPCRat(0),fNRSegTPCRat(0),
fSegZTPCRat(0),fSegPTPCRat(0),fSegRTPCRat(0),
fBegSegPTPCRat(0),fNSegPTPCRat(0),fBegSegRTPCRat(0),fNSegRTPCRat(0),fSegIDTPCRat(0),fMinZTPCRat(1.e6),fMaxZTPCRat(-1.e6),fParamsTPCRat(0),fMaxRTPCRat(0),
//
fNParamsDip(0),fNZSegDip(0),fNYSegDip(0),fNXSegDip(0),
fSegZDip(0),fSegYDip(0),fSegXDip(0),
fBegSegYDip(0),fNSegYDip(0),fBegSegXDip(0),fNSegXDip(0),fSegIDDip(0),fMinZDip(1.e6),fMaxZDip(-1.e6),fParamsDip(0)
#ifdef _MAGCHEB_CACHE_
,fCacheSol(0),fCacheDip(0),fCacheTPCInt(0),fCacheTPCRat(0)
#endif
//
{
// construct from coeffs from the text file
LoadData(inputFile);
}
//__________________________________________________________________________________________
void AliMagWrapCheb::AddParamSol(const AliCheb3D* param)
{
// adds new parameterization piece for Sol
// NOTE: pieces must be added strictly in increasing R then increasing Z order
//
if (!fParamsSol) fParamsSol = new TObjArray();
fParamsSol->Add( (AliCheb3D*)param );
fNParamsSol++;
if (fMaxRSol<param->GetBoundMax(0)) fMaxRSol = param->GetBoundMax(0);
//
}
//__________________________________________________________________________________________
void AliMagWrapCheb::AddParamTPCInt(const AliCheb3D* param)
{
// adds new parameterization piece for TPCInt
// NOTE: pieces must be added strictly in increasing R then increasing Z order
//
if (!fParamsTPC) fParamsTPC = new TObjArray();
fParamsTPC->Add( (AliCheb3D*)param);
fNParamsTPC++;
if (fMaxRTPC<param->GetBoundMax(0)) fMaxRTPC = param->GetBoundMax(0);
//
}
//__________________________________________________________________________________________
void AliMagWrapCheb::AddParamTPCRatInt(const AliCheb3D* param)
{
// adds new parameterization piece for TPCRatInt
// NOTE: pieces must be added strictly in increasing R then increasing Z order
//
if (!fParamsTPCRat) fParamsTPCRat = new TObjArray();
fParamsTPCRat->Add( (AliCheb3D*)param);
fNParamsTPCRat++;
if (fMaxRTPCRat<param->GetBoundMax(0)) fMaxRTPCRat = param->GetBoundMax(0);
//
}
//__________________________________________________________________________________________
void AliMagWrapCheb::AddParamDip(const AliCheb3D* param)
{
// adds new parameterization piece for Dipole
//
if (!fParamsDip) fParamsDip = new TObjArray();
fParamsDip->Add( (AliCheb3D*)param);
fNParamsDip++;
//
}
//__________________________________________________________________________________________
void AliMagWrapCheb::ResetDip()
{
// clean Dip field (used for update)
if (fNParamsDip) {
delete fParamsDip; fParamsDip = 0;
delete[] fSegZDip; fSegZDip = 0;
delete[] fSegXDip; fSegXDip = 0;
delete[] fSegYDip; fSegYDip = 0;
delete[] fBegSegYDip; fBegSegYDip = 0;
delete[] fNSegYDip; fNSegYDip = 0;
delete[] fBegSegXDip; fBegSegXDip = 0;
delete[] fNSegXDip; fNSegXDip = 0;
delete[] fSegIDDip; fSegIDDip = 0;
}
fNParamsDip = fNZSegDip = fNXSegDip = fNYSegDip = 0;
fMinZDip = 1e6;
fMaxZDip = -1e6;
//
}
//__________________________________________________________________________________________
void AliMagWrapCheb::ResetSol()
{
// clean Sol field (used for update)
if (fNParamsSol) {
delete fParamsSol; fParamsSol = 0;
delete[] fSegZSol; fSegZSol = 0;
delete[] fSegPSol; fSegPSol = 0;
delete[] fSegRSol; fSegRSol = 0;
delete[] fBegSegPSol; fBegSegPSol = 0;
delete[] fNSegPSol; fNSegPSol = 0;
delete[] fBegSegRSol; fBegSegRSol = 0;
delete[] fNSegRSol; fNSegRSol = 0;
delete[] fSegIDSol; fSegIDSol = 0;
}
fNParamsSol = fNZSegSol = fNPSegSol = fNRSegSol = 0;
fMinZSol = 1e6;
fMaxZSol = -1e6;
fMaxRSol = 0;
//
}
//__________________________________________________________________________________________
void AliMagWrapCheb::ResetTPCInt()
{
// clean TPC field integral (used for update)
if (fNParamsTPC) {
delete fParamsTPC; fParamsTPC = 0;
delete[] fSegZTPC; fSegZTPC = 0;
delete[] fSegPTPC; fSegPTPC = 0;
delete[] fSegRTPC; fSegRTPC = 0;
delete[] fBegSegPTPC; fBegSegPTPC = 0;
delete[] fNSegPTPC; fNSegPTPC = 0;
delete[] fBegSegRTPC; fBegSegRTPC = 0;
delete[] fNSegRTPC; fNSegRTPC = 0;
delete[] fSegIDTPC; fSegIDTPC = 0;
}
fNParamsTPC = fNZSegTPC = fNPSegTPC = fNRSegTPC = 0;
fMinZTPC = 1e6;
fMaxZTPC = -1e6;
fMaxRTPC = 0;
//
}
//__________________________________________________________________________________________
void AliMagWrapCheb::ResetTPCRatInt()
{
// clean TPCRat field integral (used for update)
if (fNParamsTPCRat) {
delete fParamsTPCRat; fParamsTPCRat = 0;
delete[] fSegZTPCRat; fSegZTPCRat = 0;
delete[] fSegPTPCRat; fSegPTPCRat = 0;
delete[] fSegRTPCRat; fSegRTPCRat = 0;
delete[] fBegSegPTPCRat; fBegSegPTPCRat = 0;
delete[] fNSegPTPCRat; fNSegPTPCRat = 0;