forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPropagator.cxx
More file actions
970 lines (914 loc) · 42.1 KB
/
Propagator.cxx
File metadata and controls
970 lines (914 loc) · 42.1 KB
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
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#include "DetectorsBase/Propagator.h"
#include "GPUCommonLogger.h"
#include "GPUCommonConstants.h"
#include "GPUCommonMath.h"
#include "GPUTPCGMPolynomialField.h"
#include "MathUtils/Utils.h"
#include "ReconstructionDataFormats/HelixHelper.h"
#include "ReconstructionDataFormats/Vertex.h"
using namespace o2::base;
using namespace o2::gpu;
#if !defined(GPUCA_GPUCODE)
#include "Field/MagFieldFast.h" // Don't use this on the GPU
#endif
#if !defined(GPUCA_STANDALONE) && !defined(GPUCA_GPUCODE)
#include "Field/MagneticField.h"
#include "DataFormatsParameters/GRPObject.h"
#include "DataFormatsParameters/GRPMagField.h"
#include "DetectorsBase/GeometryManager.h"
#include <FairRunAna.h> // eventually will get rid of it
#include <TGeoGlobalMagField.h>
template <typename value_T>
PropagatorImpl<value_T>::PropagatorImpl(bool uninitialized)
{
if (uninitialized) {
return;
}
///< construct checking if needed components were initialized
updateField();
}
//____________________________________________________________
template <typename value_T>
void PropagatorImpl<value_T>::updateField()
{
if (!mField) {
mField = static_cast<o2::field::MagneticField*>(TGeoGlobalMagField::Instance()->GetField());
if (!mField) {
LOG(warning) << "No Magnetic Field in TGeoGlobalMagField, checking legacy FairRunAna";
mField = dynamic_cast<o2::field::MagneticField*>(FairRunAna::Instance()->GetField());
}
if (!mField) {
LOG(fatal) << "Magnetic field is not initialized!";
}
if (!mField->getFastField() && mField->fastFieldExists()) {
mField->AllowFastField(true);
mFieldFast = mField->getFastField();
}
}
const value_type xyz[3] = {0.};
if (mFieldFast) {
mFieldFast->GetBz(xyz, mNominalBz);
} else {
mNominalBz = mField->GetBz(xyz[0], xyz[1], xyz[2]);
}
}
//____________________________________________________________
template <typename value_T>
int PropagatorImpl<value_T>::initFieldFromGRP(const std::string grpFileName, bool verbose)
{
/// load grp and init magnetic field
if (verbose) {
LOG(info) << "Loading field from GRP of " << grpFileName;
}
const auto grp = o2::parameters::GRPObject::loadFrom(grpFileName);
if (!grp) {
return -1;
}
if (verbose) {
grp->print();
}
return initFieldFromGRP(grp);
}
//____________________________________________________________
template <typename value_T>
int PropagatorImpl<value_T>::initFieldFromGRP(const o2::parameters::GRPObject* grp, bool verbose)
{
/// init mag field from GRP data and attach it to TGeoGlobalMagField
if (TGeoGlobalMagField::Instance()->IsLocked()) {
if (TGeoGlobalMagField::Instance()->GetField()->TestBit(o2::field::MagneticField::kOverrideGRP)) {
LOG(warning) << "ExpertMode!!! GRP information will be ignored";
LOG(warning) << "ExpertMode!!! Running with the externally locked B field";
return 0;
} else {
LOG(info) << "Destroying existing B field instance";
delete TGeoGlobalMagField::Instance();
}
}
auto fld = o2::field::MagneticField::createFieldMap(grp->getL3Current(), grp->getDipoleCurrent(), o2::field::MagneticField::kConvLHC, grp->getFieldUniformity());
TGeoGlobalMagField::Instance()->SetField(fld);
TGeoGlobalMagField::Instance()->Lock();
if (verbose) {
LOG(info) << "Running with the B field constructed out of GRP";
LOG(info) << "Access field via TGeoGlobalMagField::Instance()->Field(xyz,bxyz) or via";
LOG(info) << "auto o2field = static_cast<o2::field::MagneticField*>( TGeoGlobalMagField::Instance()->GetField() )";
}
return 0;
}
//____________________________________________________________
template <typename value_T>
int PropagatorImpl<value_T>::initFieldFromGRP(const o2::parameters::GRPMagField* grp, bool verbose)
{
/// init mag field from GRP data and attach it to TGeoGlobalMagField
if (TGeoGlobalMagField::Instance()->IsLocked()) {
if (TGeoGlobalMagField::Instance()->GetField()->TestBit(o2::field::MagneticField::kOverrideGRP)) {
LOG(warning) << "ExpertMode!!! GRP information will be ignored";
LOG(warning) << "ExpertMode!!! Running with the externally locked B field";
return 0;
} else {
LOG(info) << "Destroying existing B field instance";
delete TGeoGlobalMagField::Instance();
}
}
auto fld = o2::field::MagneticField::createFieldMap(grp->getL3Current(), grp->getDipoleCurrent(), o2::field::MagneticField::kConvLHC, grp->getFieldUniformity());
TGeoGlobalMagField::Instance()->SetField(fld);
TGeoGlobalMagField::Instance()->Lock();
if (verbose) {
LOG(info) << "Running with the B field constructed out of GRP";
LOG(info) << "Access field via TGeoGlobalMagField::Instance()->Field(xyz,bxyz) or via";
LOG(info) << "auto o2field = static_cast<o2::field::MagneticField*>( TGeoGlobalMagField::Instance()->GetField() )";
}
return 0;
}
#elif !defined(GPUCA_GPUCODE)
template <typename value_T>
PropagatorImpl<value_T>::PropagatorImpl(bool uninitialized)
{
} // empty dummy constructor for standalone benchmark
#endif
//_______________________________________________________________________
template <typename value_T>
GPUd() bool PropagatorImpl<value_T>::PropagateToXBxByBz(TrackParCov_t& track, value_type xToGo, value_type maxSnp, value_type maxStep,
PropagatorImpl<value_T>::MatCorrType matCorr, track::TrackLTIntegral* tofInfo, int signCorr) const
{
//----------------------------------------------------------------
//
// Propagates the track to the plane X=xk (cm)
// taking into account all the three components of the magnetic field
// and correcting for the crossed material.
//
// maxStep - maximal step for propagation
// tofInfo - optional container for track length and PID-dependent TOF integration
//
// matCorr - material correction type, it is up to the user to make sure the pointer is attached (if LUT is requested)
//----------------------------------------------------------------
auto dx = xToGo - track.getX();
int dir = dx > 0.f ? 1 : -1;
if (!signCorr) {
signCorr = -dir; // sign of eloss correction is not imposed
}
std::array<value_type, 3> b{};
while (math_utils::detail::abs<value_type>(dx) > Epsilon) {
auto step = math_utils::detail::min<value_type>(math_utils::detail::abs<value_type>(dx), maxStep);
if (dir < 0) {
step = -step;
}
auto x = track.getX() + step;
auto xyz0 = track.getXYZGlo();
getFieldXYZ(xyz0, &b[0]);
auto correct = [&track, &xyz0, tofInfo, matCorr, signCorr, this]() {
bool res = true;
if (matCorr != MatCorrType::USEMatCorrNONE) {
auto xyz1 = track.getXYZGlo();
auto mb = this->getMatBudget(matCorr, xyz0, xyz1);
if (!track.correctForMaterial(mb.meanX2X0, mb.getXRho(signCorr))) {
res = false;
}
if (tofInfo) {
tofInfo->addStep(mb.length, track.getQ2P2()); // fill L,ToF info using already calculated step length
tofInfo->addX2X0(mb.meanX2X0);
tofInfo->addXRho(mb.getXRho(signCorr));
}
} else if (tofInfo) { // if tofInfo filling was requested w/o material correction, we need to calculate the step lenght
auto xyz1 = track.getXYZGlo();
math_utils::Vector3D<value_type> stepV(xyz1.X() - xyz0.X(), xyz1.Y() - xyz0.Y(), xyz1.Z() - xyz0.Z());
tofInfo->addStep(stepV.R(), track.getQ2P2());
}
return res;
};
if (!track.propagateTo(x, b)) {
return false;
}
if (maxSnp > 0 && math_utils::detail::abs<value_type>(track.getSnp()) >= maxSnp) {
correct();
return false;
}
if (!correct()) {
return false;
}
dx = xToGo - track.getX();
}
track.setX(xToGo);
return true;
}
//_______________________________________________________________________
template <typename value_T>
GPUd() bool PropagatorImpl<value_T>::PropagateToXBxByBz(TrackPar_t& track, value_type xToGo, value_type maxSnp, value_type maxStep,
PropagatorImpl<value_T>::MatCorrType matCorr, track::TrackLTIntegral* tofInfo, int signCorr) const
{
//----------------------------------------------------------------
//
// Propagates the track params to the plane X=xk (cm), NO error evaluation
// taking into account all the three components of the magnetic field
// and optionally correcting for the e.loss crossed material.
//
// maxStep - maximal step for propagation
// tofInfo - optional container for track length and PID-dependent TOF integration
//
// matCorr - material correction type, it is up to the user to make sure the pointer is attached (if LUT is requested)
//----------------------------------------------------------------
auto dx = xToGo - track.getX();
int dir = dx > 0.f ? 1 : -1;
if (!signCorr) {
signCorr = -dir; // sign of eloss correction is not imposed
}
std::array<value_type, 3> b{};
while (math_utils::detail::abs<value_type>(dx) > Epsilon) {
auto step = math_utils::detail::min<value_type>(math_utils::detail::abs<value_type>(dx), maxStep);
if (dir < 0) {
step = -step;
}
auto x = track.getX() + step;
auto xyz0 = track.getXYZGlo();
getFieldXYZ(xyz0, &b[0]);
auto correct = [&track, &xyz0, tofInfo, matCorr, signCorr, this]() {
bool res = true;
if (matCorr != MatCorrType::USEMatCorrNONE) {
auto xyz1 = track.getXYZGlo();
auto mb = this->getMatBudget(matCorr, xyz0, xyz1);
if (!track.correctForELoss(((signCorr < 0) ? -mb.length : mb.length) * mb.meanRho)) {
res = false;
}
if (tofInfo) {
tofInfo->addStep(mb.length, track.getQ2P2()); // fill L,ToF info using already calculated step length
tofInfo->addX2X0(mb.meanX2X0);
tofInfo->addXRho(mb.getXRho(signCorr));
}
} else if (tofInfo) { // if tofInfo filling was requested w/o material correction, we need to calculate the step lenght
auto xyz1 = track.getXYZGlo();
math_utils::Vector3D<value_type> stepV(xyz1.X() - xyz0.X(), xyz1.Y() - xyz0.Y(), xyz1.Z() - xyz0.Z());
tofInfo->addStep(stepV.R(), track.getQ2P2());
}
return res;
};
if (!track.propagateParamTo(x, b)) {
return false;
}
if (maxSnp > 0 && math_utils::detail::abs<value_type>(track.getSnp()) >= maxSnp) {
correct();
return false;
}
if (!correct()) {
return false;
}
dx = xToGo - track.getX();
}
track.setX(xToGo);
return true;
}
//_______________________________________________________________________
template <typename value_T>
GPUd() bool PropagatorImpl<value_T>::propagateToX(TrackParCov_t& track, value_type xToGo, value_type bZ, value_type maxSnp, value_type maxStep,
PropagatorImpl<value_T>::MatCorrType matCorr, track::TrackLTIntegral* tofInfo, int signCorr) const
{
//----------------------------------------------------------------
//
// Propagates the track to the plane X=xk (cm)
// taking into account all the three components of the magnetic field
// and correcting for the crossed material.
//
// maxStep - maximal step for propagation
// tofInfo - optional container for track length and PID-dependent TOF integration
//
// matCorr - material correction type, it is up to the user to make sure the pointer is attached (if LUT is requested)
//----------------------------------------------------------------
auto dx = xToGo - track.getX();
int dir = dx > 0.f ? 1 : -1;
if (!signCorr) {
signCorr = -dir; // sign of eloss correction is not imposed
}
while (math_utils::detail::abs<value_type>(dx) > Epsilon) {
auto step = math_utils::detail::min<value_type>(math_utils::detail::abs<value_type>(dx), maxStep);
if (dir < 0) {
step = -step;
}
auto x = track.getX() + step;
auto xyz0 = track.getXYZGlo();
auto correct = [&track, &xyz0, tofInfo, matCorr, signCorr, this]() {
bool res = true;
if (matCorr != MatCorrType::USEMatCorrNONE) {
auto xyz1 = track.getXYZGlo();
auto mb = this->getMatBudget(matCorr, xyz0, xyz1);
if (!track.correctForMaterial(mb.meanX2X0, mb.getXRho(signCorr))) {
res = false;
}
if (tofInfo) {
tofInfo->addStep(mb.length, track.getQ2P2()); // fill L,ToF info using already calculated step length
tofInfo->addX2X0(mb.meanX2X0);
tofInfo->addXRho(mb.getXRho(signCorr));
}
} else if (tofInfo) { // if tofInfo filling was requested w/o material correction, we need to calculate the step lenght
auto xyz1 = track.getXYZGlo();
math_utils::Vector3D<value_type> stepV(xyz1.X() - xyz0.X(), xyz1.Y() - xyz0.Y(), xyz1.Z() - xyz0.Z());
tofInfo->addStep(stepV.R(), track.getQ2P2());
}
return res;
};
if (!track.propagateTo(x, bZ)) {
return false;
}
if (maxSnp > 0 && math_utils::detail::abs<value_type>(track.getSnp()) >= maxSnp) {
correct();
return false;
}
if (!correct()) {
return false;
}
dx = xToGo - track.getX();
}
track.setX(xToGo);
return true;
}
//_______________________________________________________________________
template <typename value_T>
GPUd() bool PropagatorImpl<value_T>::propagateToX(TrackPar_t& track, value_type xToGo, value_type bZ, value_type maxSnp, value_type maxStep,
PropagatorImpl<value_T>::MatCorrType matCorr, track::TrackLTIntegral* tofInfo, int signCorr) const
{
//----------------------------------------------------------------
//
// Propagates the track parameters only to the plane X=xk (cm)
// taking into account all the three components of the magnetic field
// and correcting for the crossed material.
//
// maxStep - maximal step for propagation
// tofInfo - optional container for track length and PID-dependent TOF integration
//
// matCorr - material correction type, it is up to the user to make sure the pointer is attached (if LUT is requested)
//----------------------------------------------------------------
auto dx = xToGo - track.getX();
int dir = dx > 0.f ? 1 : -1;
if (!signCorr) {
signCorr = -dir; // sign of eloss correction is not imposed
}
while (math_utils::detail::abs<value_type>(dx) > Epsilon) {
auto step = math_utils::detail::min<value_type>(math_utils::detail::abs<value_type>(dx), maxStep);
if (dir < 0) {
step = -step;
}
auto x = track.getX() + step;
auto xyz0 = track.getXYZGlo();
auto correct = [&track, &xyz0, tofInfo, matCorr, signCorr, this]() {
bool res = true;
if (matCorr != MatCorrType::USEMatCorrNONE) {
auto xyz1 = track.getXYZGlo();
auto mb = this->getMatBudget(matCorr, xyz0, xyz1);
if (!track.correctForELoss(mb.getXRho(signCorr))) {
res = false;
}
if (tofInfo) {
tofInfo->addStep(mb.length, track.getQ2P2()); // fill L,ToF info using already calculated step length
tofInfo->addX2X0(mb.meanX2X0);
tofInfo->addXRho(mb.getXRho(signCorr));
}
} else if (tofInfo) { // if tofInfo filling was requested w/o material correction, we need to calculate the step lenght
auto xyz1 = track.getXYZGlo();
math_utils::Vector3D<value_type> stepV(xyz1.X() - xyz0.X(), xyz1.Y() - xyz0.Y(), xyz1.Z() - xyz0.Z());
tofInfo->addStep(stepV.R(), track.getQ2P2());
}
return res;
};
if (!track.propagateParamTo(x, bZ)) {
return false;
}
if (maxSnp > 0 && math_utils::detail::abs<value_type>(track.getSnp()) >= maxSnp) {
correct();
return false;
}
if (!correct()) {
return false;
}
dx = xToGo - track.getX();
}
track.setX(xToGo);
return true;
}
//_______________________________________________________________________
template <typename value_T>
template <typename track_T>
GPUd() bool PropagatorImpl<value_T>::propagateToR(track_T& track, value_type r, bool bzOnly, value_type maxSnp, value_type maxStep,
MatCorrType matCorr, track::TrackLTIntegral* tofInfo, int signCorr) const
{
const value_T MaxPhiLoc = math_utils::detail::asin<value_T>(maxSnp), MaxPhiLocSafe = 0.95 * MaxPhiLoc;
auto bz = getNominalBz();
if (math_utils::detail::abs(bz) > constants::math::Almost0) {
o2::track::TrackAuxPar traux(track, bz);
o2::track::TrackAuxPar crad;
value_type r0 = math_utils::detail::sqrt<value_T>(track.getX() * track.getX() + track.getY() * track.getY());
value_type dr = (r - r0);
value_type rTmp = r - (math_utils::detail::abs<value_T>(dr) > 1. ? (dr > 0 ? 0.5 : -0.5) : 0.5 * dr); // 1st propagate a few mm short of the targer R
crad.rC = rTmp;
crad.c = crad.cc = 1.f;
crad.s = crad.ss = crad.cs = 0.f;
o2::track::CrossInfo cross;
cross.circlesCrossInfo(crad, traux, 0.);
if (cross.nDCA < 1) {
return false;
}
double phiCross[2] = {}, dphi[2] = {};
auto curv = track.getCurvature(bz);
bool clockwise = curv < 0; // q+ in B+ or q- in B- goes clockwise
auto phiLoc = math_utils::detail::asin<double>(track.getSnp());
auto phi0 = phiLoc + track.getAlpha();
o2::math_utils::detail::bringTo02Pi(phi0);
for (int i = 0; i < cross.nDCA; i++) {
// track pT direction angle at crossing points:
// == angle of the tangential to track circle at the crossing point X,Y
// == normal to the radial vector from the track circle center {X-cX, Y-cY}
// i.e. the angle of the vector {Y-cY, -(X-cx)}
auto normX = double(cross.yDCA[i]) - double(traux.yC), normY = -(double(cross.xDCA[i]) - double(traux.xC));
if (!clockwise) {
normX = -normX;
normY = -normY;
}
phiCross[i] = math_utils::detail::atan2<double>(normY, normX);
o2::math_utils::detail::bringTo02Pi(phiCross[i]);
dphi[i] = phiCross[i] - phi0;
if (dphi[i] > o2::constants::math::PI) {
dphi[i] -= o2::constants::math::TwoPI;
} else if (dphi[i] < -o2::constants::math::PI) {
dphi[i] += o2::constants::math::TwoPI;
}
}
int sel = cross.nDCA == 1 ? 0 : (clockwise ? (dphi[0] < dphi[1] ? 0 : 1) : (dphi[1] < dphi[0] ? 0 : 1));
auto deltaPhi = dphi[sel];
while (1) {
auto phiLocFin = phiLoc + deltaPhi;
// case1
if (math_utils::detail::abs<value_type>(phiLocFin) < MaxPhiLocSafe) { // just 1 step propagation
auto deltaX = (math_utils::detail::sin<double>(phiLocFin) - track.getSnp()) / track.getCurvature(bz);
if (!track.propagateTo(track.getX() + deltaX, bz)) {
return false;
}
break;
}
if (math_utils::detail::abs<value_type>(deltaPhi) < (2 * MaxPhiLocSafe)) { // still can go in 1 step with one extra rotation
auto rot = phiLoc + 0.5 * deltaPhi;
if (!track.rotate(track.getAlpha() + rot)) {
return false;
}
phiLoc -= rot;
continue; // should be ok for the case 1 now.
}
auto rot = phiLoc + (deltaPhi > 0 ? MaxPhiLocSafe : -MaxPhiLocSafe);
if (!track.rotate(track.getAlpha() + rot)) {
return false;
}
phiLoc -= rot; // = +- MaxPhiLocSafe
// propagate to phiLoc = +-MaxPhiLocSafe
auto tgtPhiLoc = deltaPhi > 0 ? MaxPhiLocSafe : -MaxPhiLocSafe;
auto deltaX = (math_utils::detail::sin<double>(tgtPhiLoc) - track.getSnp()) / track.getCurvature(bz);
if (!track.propagateTo(track.getX() + deltaX, bz)) {
return false;
}
deltaPhi -= tgtPhiLoc - phiLoc;
phiLoc = deltaPhi > 0 ? MaxPhiLocSafe : -MaxPhiLocSafe;
continue; // should be of for the case 1 now.
}
bz = getBz(math_utils::Point3D<value_type>{value_type(cross.xDCA[sel]), value_type(cross.yDCA[sel]), value_type(track.getZ())});
}
// do final step till target R, also covers Bz = 0;
value_type xfin;
if (!track.getXatLabR(r, xfin, bz)) {
return false;
}
return propagateToX(track, xfin, bzOnly, maxSnp, maxStep, matCorr, tofInfo, signCorr);
}
//_______________________________________________________________________
template <typename value_T>
template <typename track_T>
GPUd() bool PropagatorImpl<value_T>::propagateToAlphaX(track_T& track, value_type alpha, value_type x, bool bzOnly, value_type maxSnp, value_type maxStep, int minSteps,
MatCorrType matCorr, track::TrackLTIntegral* tofInfo, int signCorr) const
{
// propagate to alpha,X, if needed in a few steps
auto snp = track.getSnpAt(alpha, x, getNominalBz());
// apply safety factor 0.9 for crude rotation estimate
if (math_utils::detail::abs<value_type>(snp) < maxSnp * 0.9 && track.rotate(alpha)) {
auto dx = math_utils::detail::abs<value_type>(x - track.getX());
if (dx < Epsilon) {
return true;
}
return propagateTo(track, x, bzOnly, maxSnp, math_utils::detail::min<value_type>(dx / minSteps, maxStep), matCorr, tofInfo, signCorr);
}
return false;
/*
// try to go in a few steps with intermediate rotations
auto alphaTrg = alpha;
math_utils::detail::bringToPMPi<value_type>(alphaTrg);
auto alpCurr = track.getAlpha();
math_utils::detail::bringToPMPi<value_type>(alpCurr);
int nsteps = minSteps > 2 ? minSteps : 2;
auto dalp = math_utils::detail::deltaPhiSmall<value_type>(alpCurr, alphaTrg) / nsteps; // effective (alpha - alphaCurr)/nsteps
auto xtmp = (track.getX() + x) / nsteps;
return track.rotate(alpCurr + dalp) && propagateTo(track, xtmp, bzOnly, maxSnp, maxStep, matCorr, tofInfo, signCorr) &&
track.rotate(alpha) && propagateTo(track, x, bzOnly, maxSnp, maxStep, matCorr, tofInfo, signCorr);
*/
}
//_______________________________________________________________________
template <typename value_T>
GPUd() bool PropagatorImpl<value_T>::propagateToDCA(const o2::dataformats::VertexBase& vtx, TrackParCov_t& track, value_type bZ,
value_type maxStep, PropagatorImpl<value_type>::MatCorrType matCorr,
o2::dataformats::DCA* dca, track::TrackLTIntegral* tofInfo,
int signCorr, value_type maxD) const
{
// propagate track to DCA to the vertex
value_type sn, cs, alp = track.getAlpha();
math_utils::detail::sincos<value_type>(alp, sn, cs);
value_type x = track.getX(), y = track.getY(), snp = track.getSnp(), csp = math_utils::detail::sqrt<value_type>((1.f - snp) * (1.f + snp));
value_type xv = vtx.getX() * cs + vtx.getY() * sn, yv = -vtx.getX() * sn + vtx.getY() * cs, zv = vtx.getZ();
x -= xv;
y -= yv;
// Estimate the impact parameter neglecting the track curvature
value_type d = math_utils::detail::abs<value_type>(x * snp - y * csp);
if (d > maxD) {
if (dca) { // provide default DCA for failed propag
dca->set(o2::track::DefaultDCA, o2::track::DefaultDCA,
o2::track::DefaultDCACov, o2::track::DefaultDCACov, o2::track::DefaultDCACov);
}
return false;
}
value_type crv = track.getCurvature(bZ);
value_type tgfv = -(crv * x - snp) / (crv * y + csp);
sn = tgfv / math_utils::detail::sqrt<value_type>(1.f + tgfv * tgfv);
cs = math_utils::detail::sqrt<value_type>((1. - sn) * (1. + sn));
cs = (math_utils::detail::abs<value_type>(tgfv) > o2::constants::math::Almost0) ? sn / tgfv : o2::constants::math::Almost1;
x = xv * cs + yv * sn;
yv = -xv * sn + yv * cs;
xv = x;
auto tmpT(track); // operate on the copy to recover after the failure
alp += math_utils::detail::asin<value_type>(sn);
if (!tmpT.rotate(alp) || !propagateToX(tmpT, xv, bZ, 0.85, maxStep, matCorr, tofInfo, signCorr)) {
#ifndef GPUCA_ALIGPUCODE
LOG(debug) << "failed to propagate to alpha=" << alp << " X=" << xv << vtx << " | Track is: " << tmpT.asString();
#elif !defined(GPUCA_NO_FMT)
LOG(debug) << "failed to propagate to alpha=" << alp << " X=" << xv << vtx;
#endif
if (dca) { // provide default DCA for failed propag
dca->set(o2::track::DefaultDCA, o2::track::DefaultDCA,
o2::track::DefaultDCACov, o2::track::DefaultDCACov, o2::track::DefaultDCACov);
}
return false;
}
track = tmpT;
if (dca) {
math_utils::detail::sincos<value_type>(alp, sn, cs);
auto s2ylocvtx = vtx.getSigmaX2() * sn * sn + vtx.getSigmaY2() * cs * cs - 2. * vtx.getSigmaXY() * cs * sn;
dca->set(track.getY() - yv, track.getZ() - zv,
track.getSigmaY2() + s2ylocvtx, track.getSigmaZY(), track.getSigmaZ2() + vtx.getSigmaZ2());
}
return true;
}
//_______________________________________________________________________
template <typename value_T>
GPUd() bool PropagatorImpl<value_T>::propagateToDCABxByBz(const o2::dataformats::VertexBase& vtx, TrackParCov_t& track,
value_type maxStep, PropagatorImpl<value_type>::MatCorrType matCorr,
o2::dataformats::DCA* dca, track::TrackLTIntegral* tofInfo,
int signCorr, value_type maxD) const
{
// propagate track to DCA to the vertex
value_type sn, cs, alp = track.getAlpha();
math_utils::detail::sincos<value_type>(alp, sn, cs);
value_type x = track.getX(), y = track.getY(), snp = track.getSnp(), csp = math_utils::detail::sqrt<value_type>((1.f - snp) * (1.f + snp));
value_type xv = vtx.getX() * cs + vtx.getY() * sn, yv = -vtx.getX() * sn + vtx.getY() * cs, zv = vtx.getZ();
x -= xv;
y -= yv;
// Estimate the impact parameter neglecting the track curvature
value_type d = math_utils::detail::abs<value_type>(x * snp - y * csp);
if (d > maxD) {
if (dca) { // provide default DCA for failed propag
dca->set(o2::track::DefaultDCA, o2::track::DefaultDCA,
o2::track::DefaultDCACov, o2::track::DefaultDCACov, o2::track::DefaultDCACov);
}
return false;
}
value_type crv = track.getCurvature(mNominalBz);
value_type tgfv = -(crv * x - snp) / (crv * y + csp);
sn = tgfv / math_utils::detail::sqrt<value_type>(1.f + tgfv * tgfv);
cs = math_utils::detail::sqrt<value_type>((1. - sn) * (1. + sn));
cs = (math_utils::detail::abs<value_type>(tgfv) > o2::constants::math::Almost0) ? sn / tgfv : o2::constants::math::Almost1;
x = xv * cs + yv * sn;
yv = -xv * sn + yv * cs;
xv = x;
auto tmpT(track); // operate on the copy to recover after the failure
alp += math_utils::detail::asin<value_type>(sn);
if (!tmpT.rotate(alp) || !PropagateToXBxByBz(tmpT, xv, 0.85, maxStep, matCorr, tofInfo, signCorr)) {
#ifndef GPUCA_ALIGPUCODE
LOG(debug) << "failed to propagate to alpha=" << alp << " X=" << xv << vtx << " | Track is: " << tmpT.asString();
#elif !defined(GPUCA_NO_FMT)
LOG(debug) << "failed to propagate to alpha=" << alp << " X=" << xv << vtx;
#endif
if (dca) { // provide default DCA for failed propag
dca->set(o2::track::DefaultDCA, o2::track::DefaultDCA,
o2::track::DefaultDCACov, o2::track::DefaultDCACov, o2::track::DefaultDCACov);
}
return false;
}
track = tmpT;
if (dca) {
math_utils::detail::sincos<value_type>(alp, sn, cs);
auto s2ylocvtx = vtx.getSigmaX2() * sn * sn + vtx.getSigmaY2() * cs * cs - 2. * vtx.getSigmaXY() * cs * sn;
dca->set(track.getY() - yv, track.getZ() - zv,
track.getSigmaY2() + s2ylocvtx, track.getSigmaZY(), track.getSigmaZ2() + vtx.getSigmaZ2());
}
return true;
}
//_______________________________________________________________________
template <typename value_T>
GPUd() bool PropagatorImpl<value_T>::propagateToDCA(const math_utils::Point3D<value_type>& vtx, TrackPar_t& track, value_type bZ,
value_type maxStep, PropagatorImpl<value_T>::MatCorrType matCorr,
std::array<value_type, 2>* dca, track::TrackLTIntegral* tofInfo,
int signCorr, value_type maxD) const
{
// propagate track to DCA to the vertex
value_type sn, cs, alp = track.getAlpha();
math_utils::detail::sincos<value_type>(alp, sn, cs);
value_type x = track.getX(), y = track.getY(), snp = track.getSnp(), csp = math_utils::detail::sqrt<value_type>((1.f - snp) * (1.f + snp));
value_type xv = vtx.X() * cs + vtx.Y() * sn, yv = -vtx.X() * sn + vtx.Y() * cs, zv = vtx.Z();
x -= xv;
y -= yv;
// Estimate the impact parameter neglecting the track curvature
value_type d = math_utils::detail::abs<value_type>(x * snp - y * csp);
if (d > maxD) {
if (dca) { // provide default DCA for failed propag
(*dca)[0] = o2::track::DefaultDCA;
(*dca)[1] = o2::track::DefaultDCA;
}
return false;
}
value_type crv = track.getCurvature(bZ);
value_type tgfv = -(crv * x - snp) / (crv * y + csp);
sn = tgfv / math_utils::detail::sqrt<value_type>(1.f + tgfv * tgfv);
cs = math_utils::detail::sqrt<value_type>((1. - sn) * (1. + sn));
cs = (math_utils::detail::abs<value_type>(tgfv) > o2::constants::math::Almost0) ? sn / tgfv : o2::constants::math::Almost1;
x = xv * cs + yv * sn;
yv = -xv * sn + yv * cs;
xv = x;
auto tmpT(track); // operate on the copy to recover after the failure
alp += math_utils::detail::asin<value_type>(sn);
if (!tmpT.rotateParam(alp) || !propagateToX(tmpT, xv, bZ, 0.85, maxStep, matCorr, tofInfo, signCorr)) {
#ifndef GPUCA_ALIGPUCODE
LOG(debug) << "failed to propagate to alpha=" << alp << " X=" << xv << " for vertex "
<< vtx.X() << ' ' << vtx.Y() << ' ' << vtx.Z() << " | Track is: " << tmpT.asString();
#else
LOG(debug) << "failed to propagate to alpha=" << alp << " X=" << xv << " for vertex " << vtx.X() << ' ' << vtx.Y() << ' ' << vtx.Z();
#endif
if (dca) { // provide default DCA for failed propag
(*dca)[0] = o2::track::DefaultDCA;
(*dca)[1] = o2::track::DefaultDCA;
}
return false;
}
track = tmpT;
if (dca) {
(*dca)[0] = track.getY() - yv;
(*dca)[1] = track.getZ() - zv;
}
return true;
}
//_______________________________________________________________________
template <typename value_T>
GPUd() bool PropagatorImpl<value_T>::propagateToDCABxByBz(const math_utils::Point3D<value_type>& vtx, TrackPar_t& track,
value_type maxStep, PropagatorImpl<value_T>::MatCorrType matCorr,
std::array<value_type, 2>* dca, track::TrackLTIntegral* tofInfo,
int signCorr, value_type maxD) const
{
// propagate track to DCA to the vertex
value_type sn, cs, alp = track.getAlpha();
math_utils::detail::sincos<value_type>(alp, sn, cs);
value_type x = track.getX(), y = track.getY(), snp = track.getSnp(), csp = math_utils::detail::sqrt<value_type>((1.f - snp) * (1.f + snp));
value_type xv = vtx.X() * cs + vtx.Y() * sn, yv = -vtx.X() * sn + vtx.Y() * cs, zv = vtx.Z();
x -= xv;
y -= yv;
// Estimate the impact parameter neglecting the track curvature
value_type d = math_utils::detail::abs<value_type>(x * snp - y * csp);
if (d > maxD) {
if (dca) { // provide default DCA for failed propag
(*dca)[0] = o2::track::DefaultDCA;
(*dca)[1] = o2::track::DefaultDCA;
}
return false;
}
value_type crv = track.getCurvature(mNominalBz);
value_type tgfv = -(crv * x - snp) / (crv * y + csp);
sn = tgfv / math_utils::detail::sqrt<value_type>(1.f + tgfv * tgfv);
cs = math_utils::detail::sqrt<value_type>((1. - sn) * (1. + sn));
cs = (math_utils::detail::abs<value_type>(tgfv) > o2::constants::math::Almost0) ? sn / tgfv : o2::constants::math::Almost1;
x = xv * cs + yv * sn;
yv = -xv * sn + yv * cs;
xv = x;
auto tmpT(track); // operate on the copy to recover after the failure
alp += math_utils::detail::asin<value_type>(sn);
if (!tmpT.rotateParam(alp) || !PropagateToXBxByBz(tmpT, xv, 0.85, maxStep, matCorr, tofInfo, signCorr)) {
#ifndef GPUCA_ALIGPUCODE
LOG(debug) << "failed to propagate to alpha=" << alp << " X=" << xv << " for vertex "
<< vtx.X() << ' ' << vtx.Y() << ' ' << vtx.Z() << " | Track is: " << tmpT.asString();
#else
LOG(debug) << "failed to propagate to alpha=" << alp << " X=" << xv << " for vertex " << vtx.X() << ' ' << vtx.Y() << ' ' << vtx.Z();
#endif
if (dca) { // provide default DCA for failed propag
(*dca)[0] = o2::track::DefaultDCA;
(*dca)[1] = o2::track::DefaultDCA;
}
return false;
}
track = tmpT;
if (dca) {
(*dca)[0] = track.getY() - yv;
(*dca)[1] = track.getZ() - zv;
}
return true;
}
//____________________________________________________________
template <typename value_T>
GPUd() float PropagatorImpl<value_T>::estimateLTIncrement(const o2::track::TrackParametrization<value_type>& trc,
const o2::math_utils::Point3D<value_type>& posStart,
const o2::math_utils::Point3D<value_type>& posEnd) const
{
// estimate helical step increment between 2 point
float dX = posEnd.X() - posStart.X(), dY = posEnd.Y() - posStart.Y(), dZ = posEnd.Z() - posStart.Z(), d2XY = dX * dX + dY * dY;
if (getNominalBz() != 0) { // circular arc = 2*R*asin(dXY/2R)
float b[3];
o2::math_utils::Point3D<float> posAv(0.5 * (posEnd.X() + posStart.X()), 0.5 * (posEnd.Y() + posStart.Y()), 0.5 * (posEnd.Z() + posStart.Z()));
getFieldXYZ(posAv, b);
float curvH = math_utils::detail::abs<value_type>(0.5f * trc.getCurvature(b[2])), asArg = curvH * math_utils::detail::sqrt<value_type>(d2XY);
if (curvH > 0.f) {
d2XY = asArg < 1.f ? math_utils::detail::asin<value_type>(asArg) / curvH : o2::constants::math::PIHalf / curvH;
d2XY *= d2XY;
}
}
return math_utils::detail::sqrt<value_type>(d2XY + dZ * dZ);
}
//____________________________________________________________
template <typename value_T>
GPUd() value_T PropagatorImpl<value_T>::estimateLTFast(o2::track::TrackLTIntegral& lt, const o2::track::TrackParametrization<value_type>& trc) const
{
value_T xdca = 0., ydca = 0., length = 0.; // , zdca = 0. // zdca might be used in future
o2::math_utils::CircleXY<value_T> c;
constexpr float TinyF = 1e-9;
auto straigh_line_approx = [&]() {
auto csp2 = (1.f - trc.getSnp()) * (1.f + trc.getSnp());
if (csp2 > TinyF) {
auto csp = math_utils::detail::sqrt<value_type>(csp2);
auto tgp = trc.getSnp() / csp, f = trc.getX() * tgp - trc.getY();
xdca = tgp * f * csp2;
ydca = -f * csp2;
auto dx = xdca - trc.getX(), dy = ydca - trc.getY(), dz = dx * trc.getTgl() / csp;
return math_utils::detail::sqrt<value_type>(dx * dx + dy * dy + dz * dz);
} else { // track is parallel to Y axis
xdca = trc.getX(); // ydca = 0
return math_utils::detail::abs<value_type>(trc.getY() * math_utils::detail::sqrt<value_type>(1. + trc.getTgl() * trc.getTgl())); // distance from the current point to DCA
}
};
trc.getCircleParamsLoc(mNominalBz, c);
if (c.rC != 0.) { // helix
auto distC = math_utils::detail::sqrt<value_type>(c.getCenterD2()); // distance from the circle center to origin
if (distC > 1.e-3) {
auto nrm = (distC - c.rC) / distC;
xdca = nrm * c.xC; // coordinates of the DCA to 0,0 in the local frame
ydca = nrm * c.yC;
auto v0x = trc.getX() - c.xC, v0y = trc.getY() - c.yC, v1x = xdca - c.xC, v1y = ydca - c.yC;
auto angcos = (v0x * v1x + v0y * v1y) / (c.rC * c.rC);
if (math_utils::detail::abs<value_type>(angcos) < 1.f) {
auto ang = math_utils::detail::acos<value_type>(angcos);
if ((trc.getSign() > 0.f) == (mNominalBz > 0.f)) {
ang = -ang; // we need signeg angle
c.rC = -c.rC; // we need signed curvature for zdca
}
// zdca = trc.getZ() + (trc.getSign() > 0. ? c.rC : -c.rC) * trc.getTgl() * ang;
length = math_utils::detail::abs<value_type>(c.rC * ang * math_utils::detail::sqrt<value_type>(1. + trc.getTgl() * trc.getTgl()));
} else { // calculation of the arc length between the position and DCA makes no sense
length = straigh_line_approx();
}
} else { // track with circle center at the origin, and LT makes no sense, take direct distance
xdca = trc.getX();
ydca = trc.getY();
}
} else { // straight line
length = straigh_line_approx();
}
// since we assume the track or its parent comes from the beam-line or decay, add XY(?) distance to it
value_T dcaT = math_utils::detail::sqrt<value_type>(xdca * xdca + ydca * ydca);
length += dcaT;
lt.addStep(length, trc.getQ2P2());
return dcaT;
}
//____________________________________________________________
template <typename value_T>
GPUd() MatBudget PropagatorImpl<value_T>::getMatBudget(PropagatorImpl<value_type>::MatCorrType corrType, const math_utils::Point3D<value_type>& p0, const math_utils::Point3D<value_type>& p1) const
{
#if !defined(GPUCA_STANDALONE) && !defined(GPUCA_GPUCODE)
if (corrType == MatCorrType::USEMatCorrTGeo) {
return GeometryManager::meanMaterialBudget(p0, p1);
}
if (!mMatLUT) {
if (mTGeoFallBackAllowed) {
return GeometryManager::meanMaterialBudget(p0, p1);
} else {
throw std::runtime_error("requested MatLUT is absent and fall-back to TGeo is disabled");
}
}
#endif
return mMatLUT->getMatBudget(p0.X(), p0.Y(), p0.Z(), p1.X(), p1.Y(), p1.Z());
}
template <typename value_T>
template <typename T>
GPUd() void PropagatorImpl<value_T>::getFieldXYZImpl(const math_utils::Point3D<T> xyz, T* bxyz) const
{
if (mGPUField) {
#if defined(GPUCA_GPUCODE_DEVICE) && defined(GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM)
const auto* f = &GPUCA_CONSMEM.param.polynomialField; // Access directly from constant memory on GPU (copied here to avoid complicated header dependencies)
#else
const auto* f = mGPUField;
#endif
float bxyzF[3] = {};
f->GetField(xyz.X(), xyz.Y(), xyz.Z(), bxyzF);
// copy and convert
constexpr value_type kCLight1 = 1. / o2::gpu::gpu_common_constants::kCLight;
for (uint i = 0; i < 3; ++i) {
bxyz[i] = static_cast<value_type>(bxyzF[i]) * kCLight1;
}
} else {
#ifndef GPUCA_GPUCODE
if (mFieldFast) {
mFieldFast->Field(xyz, bxyz); // Must not call the host-only function in GPU compilation
} else {
#ifdef GPUCA_STANDALONE
LOG(fatal) << "Normal field cannot be used in standalone benchmark";
#else
mField->field(xyz, bxyz);
#endif
}
#endif
}
}
template <typename value_T>
template <typename T>
GPUd() T PropagatorImpl<value_T>::getBzImpl(const math_utils::Point3D<T> xyz) const
{
T bz = 0;
if (mGPUField) {
#if defined(GPUCA_GPUCODE_DEVICE) && defined(GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM)
const auto* f = &GPUCA_CONSMEM.param.polynomialField; // Access directly from constant memory on GPU (copied here to avoid complicated header dependencies)
#else
const auto* f = mGPUField;
#endif
constexpr value_type kCLight1 = 1. / o2::gpu::gpu_common_constants::kCLight;
bz = f->GetFieldBz(xyz.X(), xyz.Y(), xyz.Z()) * kCLight1;
} else {
#ifndef GPUCA_GPUCODE
if (mFieldFast) {
mFieldFast->GetBz(xyz, bz); // Must not call the host-only function in GPU compilation
} else {
#ifdef GPUCA_STANDALONE
LOG(fatal) << "Normal field cannot be used in standalone benchmark";
#else
bz = mField->GetBz(xyz.X(), xyz.Y(), xyz.Z());
#endif
}
#endif
}
return bz;
}
template <typename value_T>
GPUd() void PropagatorImpl<value_T>::getFieldXYZ(const math_utils::Point3D<float> xyz, float* bxyz) const
{
getFieldXYZImpl<float>(xyz, bxyz);
}
template <typename value_T>
GPUd() void PropagatorImpl<value_T>::getFieldXYZ(const math_utils::Point3D<double> xyz, double* bxyz) const
{
getFieldXYZImpl<double>(xyz, bxyz);
}
template <typename value_T>
GPUd() float PropagatorImpl<value_T>::getBz(const math_utils::Point3D<float> xyz) const
{
return getBzImpl<float>(xyz);
}
template <typename value_T>
GPUd() double PropagatorImpl<value_T>::getBz(const math_utils::Point3D<double> xyz) const
{
return getBzImpl<double>(xyz);
}
namespace o2::base
{
#if !defined(GPUCA_GPUCODE) || defined(GPUCA_GPUCODE_DEVICE) // FIXME: DR: WORKAROUND to avoid CUDA bug creating host symbols for device code.
template class PropagatorImpl<float>;
template bool GPUdni() PropagatorImpl<float>::propagateToAlphaX<PropagatorImpl<float>::TrackPar_t>(PropagatorImpl<float>::TrackPar_t&, float, float, bool, float, float, int, PropagatorImpl<float>::MatCorrType matCorr, track::TrackLTIntegral*, int) const;
template bool GPUdni() PropagatorImpl<float>::propagateToAlphaX<PropagatorImpl<float>::TrackParCov_t>(PropagatorImpl<float>::TrackParCov_t&, float, float, bool, float, float, int, PropagatorImpl<float>::MatCorrType matCorr, track::TrackLTIntegral*, int) const;
template bool GPUdni() PropagatorImpl<float>::propagateToR<PropagatorImpl<float>::TrackPar_t>(PropagatorImpl<float>::TrackPar_t&, float, bool, float, float, PropagatorImpl<float>::MatCorrType matCorr, track::TrackLTIntegral*, int) const;
template bool GPUdni() PropagatorImpl<float>::propagateToR<PropagatorImpl<float>::TrackParCov_t>(PropagatorImpl<float>::TrackParCov_t&, float, bool, float, float, PropagatorImpl<float>::MatCorrType matCorr, track::TrackLTIntegral*, int) const;
#endif
#ifndef GPUCA_GPUCODE
template class PropagatorImpl<double>;
template bool PropagatorImpl<double>::propagateToAlphaX<PropagatorImpl<double>::TrackPar_t>(PropagatorImpl<double>::TrackPar_t&, double, double, bool, double, double, int, PropagatorImpl<double>::MatCorrType matCorr, track::TrackLTIntegral*, int) const;
template bool PropagatorImpl<double>::propagateToAlphaX<PropagatorImpl<double>::TrackParCov_t>(PropagatorImpl<double>::TrackParCov_t&, double, double, bool, double, double, int, PropagatorImpl<double>::MatCorrType matCorr, track::TrackLTIntegral*, int) const;
#endif
} // namespace o2::base