Project
Loading...
Searching...
No Matches
TrackParametrization.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
16
17/*
18 24/09/2020: Added new data member for abs. charge. This is needed for uniform treatment of tracks with non-standard
19 charge: 0 (for V0s) and e.g. 2 for hypernuclei.
20 In the aliroot AliExternalTrackParam this was treated by derived classes using virtual methods, which we don't use in O2.
21 The meaning of mP[kQ2Pt] remains exactly the same, except for q=0 case: in this case the mP[kQ2Pt] is just an alias to
22 1/pT, regardless of its sign, and the getCurvature() will 0 (because mAbsCharge is 0).
23 The methods returning lab momentum or its combination account for eventual q>1.
24 */
25
26#ifndef INCLUDE_RECONSTRUCTIONDATAFORMATS_TRACKPARAMETRIZATION_H_
27#define INCLUDE_RECONSTRUCTIONDATAFORMATS_TRACKPARAMETRIZATION_H_
28
29#include "GPUCommonDef.h"
30#include "GPUCommonRtypes.h"
31#include "GPUCommonMath.h"
32#include "GPUCommonArray.h"
33#include "GPUROOTCartesianFwd.h"
34
35#ifndef GPUCA_GPUCODE_DEVICE
36#include <algorithm>
37#include <cfloat>
38#include <cmath>
39#include <cstring>
40#include <iosfwd>
41#include <type_traits>
42#endif
43
44#ifndef GPUCA_ALIGPUCODE // Used only by functions that are hidden on the GPU
46#include <string>
47#endif
48
50#include "MathUtils/Utils.h"
53
55
56namespace o2
57{
58template <typename T>
59class BaseCluster;
60
61namespace dataformats
62{
63class VertexBase;
64class DCA;
65} // namespace dataformats
66
67namespace track
68{
69// aliases for track elements
70enum ParLabels : int { kY,
92
93enum DirType : int { DirInward = -1,
96
97constexpr int kNParams = 5, kCovMatSize = 15, kLabCovMatSize = 21;
98
99constexpr float kCY2max = 100 * 100, // SigmaY<=100cm
100 kCZ2max = 100 * 100, // SigmaZ<=100cm
101 kCSnp2max = 1 * 1, // SigmaSin<=1
102 kCTgl2max = 1 * 1, // SigmaTan<=1
103 kC1Pt2max = 100 * 100, // Sigma1/Pt<=100 1/GeV
104 kMostProbablePt = 0.6f, // Most Probable Pt (GeV), for running with Bz=0
105 kCalcdEdxAuto = -999.f; // value indicating request for dedx calculation
106
107// access to covariance matrix by row and column
108GPUconstexpr() int CovarMap[kNParams][kNParams] = {{0, 1, 3, 6, 10},
109 {1, 2, 4, 7, 11},
110 {3, 4, 5, 8, 12},
111 {6, 7, 8, 9, 13},
112 {10, 11, 12, 13, 14}};
113
114// access to covariance matrix diagonal elements
115GPUconstexpr() int DiagMap[kNParams] = {0, 2, 5, 9, 14};
116
118constexpr float MaxPT = 100000.; // do not allow pTs exceeding this value (to avoid NANs)
119constexpr float MinPTInv = 1. / MaxPT; // do not allow q/pTs less this value (to avoid NANs)
120constexpr float ELoss2EKinThreshInv = 1. / 0.025; // do not allow E.Loss correction step with dE/Ekin above the inverse of this value
121constexpr int MaxELossIter = 50; // max number of iteration for the ELoss to account for BB dependence on beta*gamma
122// uncomment this to enable correction for BB dependence on beta*gamma via BB derivative
123// #define _BB_NONCONST_CORR_
124
125template <typename value_T = float>
127{ // track parameterization, kinematics only.
128
129 public:
130 using value_t = value_T;
134
135 struct yzerr_t { // 2 measurement with error
138 };
139
140#ifndef GPUCA_GPUCODE_DEVICE
141 static_assert(std::is_floating_point_v<value_t>);
142#endif
143
152
153 GPUd() void set(value_t x, value_t alpha, const params_t& par, int charge = 1, const PID pid = PID::Pion);
154 GPUd() void set(value_t x, value_t alpha, const value_t* par, int charge = 1, const PID pid = PID::Pion);
155 GPUd() const value_t* getParams() const;
156 GPUd() value_t getParam(int i) const;
158 GPUd() value_t getAlpha() const;
161 GPUd() value_t getSnp() const;
162 GPUd() value_t getTgl() const;
163 GPUhd() value_t getQ2Pt() const;
164 GPUd() value_t getCharge2Pt() const;
165 GPUd() int getAbsCharge() const;
166 GPUd() PID getPID() const;
167 GPUd() void setPID(const PID pid, bool passCharge = false);
168
170 GPUd() value_t getCsp2() const;
171 GPUd() value_t getCsp() const;
172
173 GPUd() void setX(value_t v);
174 GPUd() void setParam(value_t v, int i);
175 GPUd() void setAlpha(value_t v);
176 GPUd() void setY(value_t v);
177 GPUd() void setZ(value_t v);
178 GPUd() void setSnp(value_t v);
179 GPUd() void setTgl(value_t v);
180 GPUd() void setQ2Pt(value_t v);
181 GPUd() void setAbsCharge(int q);
182
183 // derived getters
184 GPUd() bool getXatLabR(value_t r, value_t& x, value_t bz, DirType dir = DirAuto) const;
185 GPUd() void getCircleParamsLoc(value_t bz, o2::math_utils::CircleXY<value_t>& circle) const;
186 GPUd() void getCircleParams(value_t bz, o2::math_utils::CircleXY<value_t>& circle, value_t& sna, value_t& csa) const;
187 GPUd() void getLineParams(o2::math_utils::IntervalXY<value_t>& line, value_t& sna, value_t& csa) const;
188 GPUd() value_t getCurvature(value_t b) const;
189 GPUd() int getCharge() const;
190 GPUd() int getSign() const;
191 GPUd() value_t getPhi() const;
192 GPUd() value_t getPhiPos() const;
193
194 GPUd() value_t getPtInv() const;
195 GPUd() value_t getP2Inv() const;
196 GPUd() value_t getP2() const;
197 GPUd() value_t getPInv() const;
199 GPUd() value_t getPt() const;
200 GPUd() value_t getE2() const;
202 GPUdi() static value_t getdEdxBB(value_t betagamma) { return BetheBlochSolid(betagamma); }
203 GPUdi() static value_t getdEdxBBOpt(value_t betagamma) { return BetheBlochSolidOpt(betagamma); }
204 GPUdi() static value_t getBetheBlochSolidDerivativeApprox(value_T dedx, value_T bg) { return BetheBlochSolidDerivative(dedx, bg); }
205
206 GPUd() value_t getTheta() const;
207 GPUd() value_t getEta() const;
208 GPUd() math_utils::Point3D<value_t> getXYZGlo() const;
209 GPUd() void getXYZGlo(dim3_t& xyz) const;
210 GPUd() bool getPxPyPzGlo(dim3_t& pxyz) const;
211 GPUd() bool getPosDirGlo(gpu::gpustd::array<value_t, 9>& posdirp) const;
212
213 // methods for track params estimate at other point
214 GPUd() bool getYZAt(value_t xk, value_t b, value_t& y, value_t& z) const;
221 GPUd() value_t getDCAYtoMV(value_t b, value_t xmv = 0.f, value_t ymv = 0.f, value_t zmv = 0.f) const;
222 GPUd() value_t getDCAZtoMV(value_t b, value_t xmv = 0.f, value_t ymv = 0.f, value_t zmv = 0.f) const;
223 GPUd() math_utils::Point3D<value_t> getXYZGloAt(value_t xk, value_t b, bool& ok) const;
224
225 // parameters manipulation
226 GPUd() bool correctForELoss(value_t xrho, bool anglecorr = false);
227 GPUd() bool rotateParam(value_t alpha);
228 GPUd() bool propagateParamTo(value_t xk, value_t b);
229 GPUd() bool propagateParamTo(value_t xk, const dim3_t& b);
230 GPUd() void invertParam();
231 GPUd() bool propagateParamToDCA(const math_utils::Point3D<value_t>& vtx, value_t b, dim2_t* dca = nullptr, value_t maxD = 999.f);
232 // aliases
233 GPUd() bool rotate(value_t alpha) { return rotateParam(alpha); }
234 GPUd() bool propagateTo(value_t xk, value_t b) { return propagateParamTo(xk, b); }
235 GPUd() bool propagateTo(value_t xk, const dim3_t& b) { return propagateParamTo(xk, b); }
236 GPUd() void invert() { invertParam(); }
237 GPUd() bool propagateToDCA(const math_utils::Point3D<value_t>& vtx, value_t b, dim2_t* dca = nullptr, value_t maxD = 999.f) { return propagateParamToDCA(vtx, b, dca, maxD); }
238
239 GPUd() bool isValid() const;
240 GPUd() void invalidate();
241
242 GPUhd() uint16_t getUserField() const;
243 GPUhd() void setUserField(uint16_t v);
244
245 GPUd() void printParam() const;
246 GPUd() void printParamHexadecimal();
247#ifndef GPUCA_ALIGPUCODE
248 std::string asString() const;
249 std::string asStringHexadecimal();
250#endif
251
252 GPUd() void updateParam(value_t delta, int i);
253 GPUd() void updateParams(const params_t& delta);
254 GPUd() void updateParams(const value_t* delta);
255
256 GPUd() yzerr_t getVertexInTrackFrame(const o2::dataformats::VertexBase& vtx) const;
257
258 private:
259 //
260 static constexpr value_t InvalidX = -99999.f;
261 value_t mX = 0.f;
262 value_t mAlpha = 0.f;
263 value_t mP[kNParams] = {0.f};
264 char mAbsCharge = 1;
265 PID mPID{PID::Pion};
266 uint16_t mUserField = 0;
267
268 ClassDefNV(TrackParametrization, 3);
269};
270
271//____________________________________________________________
272template <typename value_T>
273GPUdi() TrackParametrization<value_T>::TrackParametrization(value_t x, value_t alpha, const params_t& par, int charge, const PID pid)
274 : mX{x}, mAlpha{alpha}, mAbsCharge{char(gpu::CAMath::Abs(charge))}, mPID{pid}
275{
276 // explicit constructor
277 for (int i = 0; i < kNParams; i++) {
278 mP[i] = par[i];
279 }
280}
281
282//____________________________________________________________
283template <typename value_T>
284GPUdi() void TrackParametrization<value_T>::set(value_t x, value_t alpha, const params_t& par, int charge, const PID pid)
285{
286 set(x, alpha, par.data(), charge, pid);
287}
288
289//____________________________________________________________
290template <typename value_T>
291GPUdi() void TrackParametrization<value_T>::set(value_t x, value_t alpha, const value_t* par, int charge, const PID pid)
292{
293 mX = x;
294 mAlpha = alpha;
295 mAbsCharge = char(gpu::CAMath::Abs(charge));
296 for (int i = 0; i < kNParams; i++) {
297 mP[i] = par[i];
298 }
299 mPID = pid;
300}
301
302//____________________________________________________________
303template <typename value_T>
304GPUdi() auto TrackParametrization<value_T>::getParams() const -> const value_t*
305{
306 return mP;
307}
308
309//____________________________________________________________
310template <typename value_T>
311GPUdi() auto TrackParametrization<value_T>::getParam(int i) const -> value_t
312{
313 return mP[i];
314}
315
316//____________________________________________________________
317template <typename value_T>
318GPUdi() auto TrackParametrization<value_T>::getX() const -> value_t
319{
320 return mX;
321}
322
323//____________________________________________________________
324template <typename value_T>
325GPUdi() auto TrackParametrization<value_T>::getAlpha() const -> value_t
326{
327 return mAlpha;
328}
329
330//____________________________________________________________
331template <typename value_T>
332GPUdi() auto TrackParametrization<value_T>::getY() const -> value_t
333{
334 return mP[kY];
335}
336
337//____________________________________________________________
338template <typename value_T>
339GPUdi() auto TrackParametrization<value_T>::getZ() const -> value_t
340{
341 return mP[kZ];
342}
343
344//____________________________________________________________
345template <typename value_T>
346GPUdi() auto TrackParametrization<value_T>::getSnp() const -> value_t
347{
348 return mP[kSnp];
349}
350
351//____________________________________________________________
352template <typename value_T>
353GPUdi() auto TrackParametrization<value_T>::getTgl() const -> value_t
354{
355 return mP[kTgl];
356}
357
358//____________________________________________________________
359template <typename value_T>
360GPUhdi() auto TrackParametrization<value_T>::getQ2Pt() const -> value_t
361{
362 return mP[kQ2Pt];
363}
364
365//____________________________________________________________
366template <typename value_T>
367GPUdi() auto TrackParametrization<value_T>::getCharge2Pt() const -> value_t
368{
369 return mAbsCharge ? mP[kQ2Pt] : 0.f;
370}
371
372//____________________________________________________________
373template <typename value_T>
374GPUdi() int TrackParametrization<value_T>::getAbsCharge() const
375{
376 return mAbsCharge;
377}
378
379//____________________________________________________________
380template <typename value_T>
381GPUdi() PID TrackParametrization<value_T>::getPID() const
382{
383 return mPID;
384}
385
386//____________________________________________________________
387template <typename value_T>
388GPUdi() void TrackParametrization<value_T>::setPID(const PID pid, bool passCharge)
389{
390 mPID = pid;
391 if (passCharge) {
392 setAbsCharge(pid.getCharge()); // If needed, user should change the charge via corr. setter
393 }
394}
395
396//____________________________________________________________
397template <typename value_T>
398GPUdi() auto TrackParametrization<value_T>::getCsp2() const -> value_t
399{
400 const value_t csp2 = (1.f - mP[kSnp]) * (1.f + mP[kSnp]);
402}
403
404//____________________________________________________________
405template <typename value_T>
406GPUdi() auto TrackParametrization<value_T>::getCsp() const -> value_t
407{
408 return gpu::CAMath::Sqrt(getCsp2());
409}
410
411//____________________________________________________________
412template <typename value_T>
413GPUdi() void TrackParametrization<value_T>::setX(value_t v)
414{
415 mX = v;
416}
417
418//____________________________________________________________
419template <typename value_T>
420GPUdi() void TrackParametrization<value_T>::setParam(value_t v, int i)
421{
422 mP[i] = v;
423}
424
425//____________________________________________________________
426template <typename value_T>
427GPUdi() void TrackParametrization<value_T>::setAlpha(value_t v)
428{
429 mAlpha = v;
430}
431
432//____________________________________________________________
433template <typename value_T>
434GPUdi() void TrackParametrization<value_T>::setY(value_t v)
435{
436 mP[kY] = v;
437}
438
439//____________________________________________________________
440template <typename value_T>
441GPUdi() void TrackParametrization<value_T>::setZ(value_t v)
442{
443 mP[kZ] = v;
444}
445
446//____________________________________________________________
447template <typename value_T>
448GPUdi() void TrackParametrization<value_T>::setSnp(value_t v)
449{
450 mP[kSnp] = v;
451}
452
453//____________________________________________________________
454template <typename value_T>
455GPUdi() void TrackParametrization<value_T>::setTgl(value_t v)
456{
457 mP[kTgl] = v;
458}
459
460//____________________________________________________________
461template <typename value_T>
462GPUdi() void TrackParametrization<value_T>::setQ2Pt(value_t v)
463{
464 mP[kQ2Pt] = v;
465}
466
467//____________________________________________________________
468template <typename value_T>
469GPUdi() void TrackParametrization<value_T>::setAbsCharge(int q)
470{
471 mAbsCharge = gpu::CAMath::Abs(q);
472}
473
474//_______________________________________________________
475template <typename value_T>
476GPUdi() void TrackParametrization<value_T>::getCircleParamsLoc(value_t bz, o2::math_utils::CircleXY<value_t>& c) const
477{
478 // get circle params in track local frame, for straight line just set to local coordinates
479 c.rC = getCurvature(bz);
480 // treat as straight track if sagitta between the vertex and middle of TPC is below 0.01 cm
481 constexpr value_t MinSagitta = 0.01f, TPCMidR = 160.f, MinCurv = 8 * MinSagitta / (TPCMidR * TPCMidR);
482 if (gpu::CAMath::Abs(c.rC) > MinCurv) {
483 c.rC = 1.f / getCurvature(bz);
484 value_t sn = getSnp(), cs = gpu::CAMath::Sqrt((1.f - sn) * (1.f + sn));
485 c.xC = getX() - sn * c.rC; // center in tracking
486 c.yC = getY() + cs * c.rC; // frame. Note: r is signed!!!
487 c.rC = gpu::CAMath::Abs(c.rC);
488 } else {
489 c.rC = 0.f; // signal straight line
490 c.xC = getX();
491 c.yC = getY();
492 }
493}
494
495//_______________________________________________________
496template <typename value_T>
497GPUdi() void TrackParametrization<value_T>::getCircleParams(value_t bz, o2::math_utils::CircleXY<value_t>& c, value_t& sna, value_t& csa) const
498{
499 // get circle params in loc and lab frame, for straight line just set to global coordinates
500 getCircleParamsLoc(bz, c);
501 o2::math_utils::detail::sincos(getAlpha(), sna, csa);
502 o2::math_utils::detail::rotateZ<value_t>(c.xC, c.yC, c.xC, c.yC, sna, csa); // center in global frame
503}
504
505//_______________________________________________________
506template <typename value_T>
507GPUdi() void TrackParametrization<value_T>::getLineParams(o2::math_utils::IntervalXY<value_t>& ln, value_t& sna, value_t& csa) const
508{
509 // get line parameterization as { x = x0 + xSlp*t, y = y0 + ySlp*t }
510 o2::math_utils::detail::sincos(getAlpha(), sna, csa);
511 o2::math_utils::detail::rotateZ<value_t>(getX(), getY(), ln.getX0(), ln.getY0(), sna, csa); // reference point in global frame
512 value_t snp = getSnp(), csp = gpu::CAMath::Sqrt((1.f - snp) * (1.f + snp));
513 ln.setDX(csp * csa - snp * sna);
514 ln.setDY(snp * csa + csp * sna);
515}
516
517//____________________________________________________________
518template <typename value_T>
519GPUdi() auto TrackParametrization<value_T>::getCurvature(value_t b) const -> value_t
520{
521 return mAbsCharge ? mP[kQ2Pt] * b * o2::constants::math::B2C : 0.;
522}
523
524//____________________________________________________________
525template <typename value_T>
526GPUdi() int TrackParametrization<value_T>::getCharge() const
527{
528 return getSign() > 0 ? mAbsCharge : -mAbsCharge;
529}
530
531//____________________________________________________________
532template <typename value_T>
533GPUdi() int TrackParametrization<value_T>::getSign() const
534{
535 return mAbsCharge ? (mP[kQ2Pt] > 0.f ? 1 : -1) : 0;
536}
537
538//_______________________________________________________
539template <typename value_T>
540GPUdi() auto TrackParametrization<value_T>::getPhi() const -> value_t
541{
542 // track pt direction phi (in 0:2pi range)
543 value_t phi = gpu::CAMath::ASin(getSnp()) + getAlpha();
544 math_utils::detail::bringTo02Pi<value_t>(phi);
545 return phi;
546}
547
548//_______________________________________________________
549template <typename value_T>
550GPUdi() auto TrackParametrization<value_T>::getPhiPos() const -> value_t
551{
552 // angle of track position (in -pi:pi range)
553 value_t phi = gpu::CAMath::ATan2(getY(), getX()) + getAlpha();
554 math_utils::detail::bringTo02Pi<value_t>(phi);
555 return phi;
556}
557
558//____________________________________________________________
559template <typename value_T>
560GPUdi() auto TrackParametrization<value_T>::getPtInv() const -> value_t
561{
562 // return the inverted track pT
563 value_t ptInv = gpu::CAMath::Abs(mP[kQ2Pt]);
564 if (ptInv < MinPTInv) {
565 ptInv = MinPTInv;
566 }
567 return (mAbsCharge > 1) ? ptInv / mAbsCharge : ptInv;
568}
569
570//____________________________________________________________
571template <typename value_T>
572GPUdi() auto TrackParametrization<value_T>::getP2Inv() const -> value_t
573{
574 // return the inverted track momentum^2
575 value_t p2 = getPtInv();
576 return p2 * p2 / (1.f + getTgl() * getTgl());
577}
578
579//____________________________________________________________
580template <typename value_T>
581GPUdi() auto TrackParametrization<value_T>::getP2() const -> value_t
582{
583 // return the track momentum^2
584 return 1.f / getP2Inv(); // getP2Inv is protected against being 0, full charge accounted
585}
586
587//____________________________________________________________
588template <typename value_T>
589GPUdi() auto TrackParametrization<value_T>::getPInv() const -> value_t
590{
591 // return the inverted track momentum
592 return getPtInv() / gpu::CAMath::Sqrt(1.f + getTgl() * getTgl()); // getPtInv() is protected against being 0, full charge accounted
593}
594
595//____________________________________________________________
596template <typename value_T>
597GPUdi() auto TrackParametrization<value_T>::getP() const -> value_t
598{
599 // return the track momentum
600 return 1.f / getPInv(); // getPInv is already protected against being 0
601}
602
603//____________________________________________________________
604template <typename value_T>
605GPUdi() auto TrackParametrization<value_T>::getE2() const -> value_t
606{
607 // return the track energy^2
608 return getP2() + getPID().getMass2();
609}
610
611//____________________________________________________________
612template <typename value_T>
613GPUdi() auto TrackParametrization<value_T>::getE() const -> value_t
614{
615 // return the track energy
616 return gpu::CAMath::Sqrt(getE2());
617}
618
619//____________________________________________________________
620template <typename value_T>
621GPUdi() auto TrackParametrization<value_T>::getPt() const -> value_t
622{
623 // return the track transverse momentum
624 return 1.f / getPtInv(); // getPtInv is already protected against being 0
625}
626
627//____________________________________________________________
628template <typename value_T>
629GPUdi() auto TrackParametrization<value_T>::getTheta() const -> value_t
630{
631 return constants::math::PIHalf - gpu::CAMath::ATan(mP[3]);
632}
633
634//____________________________________________________________
635template <typename value_T>
636GPUdi() auto TrackParametrization<value_T>::getEta() const -> value_t
637{
638 return -gpu::CAMath::Log(gpu::CAMath::Tan(0.5f * getTheta()));
639}
640
641//_______________________________________________________
642template <typename value_T>
643GPUdi() auto TrackParametrization<value_T>::getXYZGlo() const -> math_utils::Point3D<value_t>
644{
645#ifndef GPUCA_ALIGPUCODE
646 return math_utils::Rotation2D<value_t>(getAlpha())(math_utils::Point3D<value_t>(getX(), getY(), getZ()));
647#else // mockup on GPU without ROOT
648 float sina, cosa;
649 gpu::CAMath::SinCos(getAlpha(), sina, cosa);
650 return math_utils::Point3D<value_t>(cosa * getX() - sina * getY(), cosa * getY() + sina * getX(), getZ());
651#endif
652}
653
654//_______________________________________________________
655template <typename value_T>
656GPUdi() void TrackParametrization<value_T>::getXYZGlo(dim3_t& xyz) const
657{
658 // track coordinates in lab frame
659 xyz[0] = getX();
660 xyz[1] = getY();
661 xyz[2] = getZ();
662 math_utils::detail::rotateZ<value_t>(xyz, getAlpha());
663}
664
665//_______________________________________________________
666template <typename value_T>
667GPUdi() auto TrackParametrization<value_T>::getXYZGloAt(value_t xk, value_t b, bool& ok) const -> math_utils::Point3D<value_t>
668{
669 //----------------------------------------------------------------
670 // estimate global X,Y,Z in global frame at given X
671 //----------------------------------------------------------------
672 value_t y = 0.f, z = 0.f;
673 ok = getYZAt(xk, b, y, z);
674 if (ok) {
675#ifndef GPUCA_ALIGPUCODE
676 return math_utils::Rotation2D<value_t>(getAlpha())(math_utils::Point3D<value_t>(xk, y, z));
677#else // mockup on GPU without ROOT
678 float sina, cosa;
679 gpu::CAMath::SinCos(getAlpha(), sina, cosa);
680 return math_utils::Point3D<value_t>(cosa * xk - sina * y, cosa * y + sina * xk, z);
681#endif
682 } else {
683 return math_utils::Point3D<value_t>();
684 }
685}
686
687//____________________________________________________________
688template <typename value_T>
689GPUdi() bool TrackParametrization<value_T>::isValid() const
690{
691 return mX != InvalidX;
692}
693
694//____________________________________________________________
695template <typename value_T>
696GPUdi() void TrackParametrization<value_T>::invalidate()
697{
698 mX = InvalidX;
699}
700
701template <typename value_T>
702GPUhdi() uint16_t TrackParametrization<value_T>::getUserField() const
703{
704 return mUserField;
705}
706
707template <typename value_T>
708GPUhdi() void TrackParametrization<value_T>::setUserField(uint16_t v)
709{
710 mUserField = v;
711}
712
713//____________________________________________________________
714template <typename value_T>
715GPUdi() void TrackParametrization<value_T>::updateParam(value_t delta, int i)
716{
717 mP[i] += delta;
718}
719
720//____________________________________________________________
721template <typename value_T>
722GPUdi() void TrackParametrization<value_T>::updateParams(const params_t& delta)
723{
724 updateParams(delta.data());
725}
726
727//____________________________________________________________
728template <typename value_T>
729GPUdi() void TrackParametrization<value_T>::updateParams(const value_t* delta)
730{
731 for (int i = kNParams; i--;) {
732 mP[i] += delta[i];
733 }
734 // make sure that snp is in the valid range
735 if (mP[kSnp] > constants::math::Almost1) {
737 } else if (mP[kSnp] < -constants::math::Almost1) {
739 }
740}
741
742} // namespace track
743} // namespace o2
744
745#endif /* INCLUDE_RECONSTRUCTIONDATAFORMATS_TRACKPARAMETRIZATION_H_ */
General auxilliary methods.
particle ids, masses, names class definition
int16_t charge
Definition RawEventData.h:5
int32_t i
#define GPUhdDefault()
constexpr int p2()
useful math constants
Declarations of 2D primitives.
uint16_t pid
Definition RawData.h:2
uint32_t c
Definition RawData.h:2
static constexpr ID Pion
Definition PID.h:96
gpu::gpustd::array< value_t, kNParams > params_t
o2::math_utils::CircleXY< value_t > &circle const
o2::math_utils::CircleXY< value_t > & circle
GPUd() TrackParametrization(value_t x
value_t const params_t int charge
GPUdi() static value_t getdEdxBB(value_t betagamma)
GPUd() value_t getTheta() const
GPUd() bool propagateTo(value_t xk
value_t const params_t int const PID pid
std::string asString() const
GPUdDefault() TrackParametrization()=default
gpu::gpustd::array< value_t, 2 > dim2_t
GPUd() bool propagateToDCA(const math_utils
GPUdi() static value_t getdEdxBBOpt(value_t betagamma)
o2::math_utils::CircleXY< value_t > value_t & sna
GPUhd() value_t getQ2Pt() const
gpu::gpustd::array< value_t, 3 > dim3_t
GPUd() void updateParam(value_t delta
GPUd() bool isValid() const
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
GLint GLenum GLint x
Definition glcorearb.h:403
GLenum src
Definition glcorearb.h:1767
const GLdouble * v
Definition glcorearb.h:832
GLenum array
Definition glcorearb.h:4274
GLdouble f
Definition glcorearb.h:310
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLboolean r
Definition glcorearb.h:1233
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
GLboolean invert
Definition glcorearb.h:543
void set(T *h, size_t v)
Definition PageParser.h:107
constexpr float Almost0
constexpr float B2C
constexpr float PIHalf
constexpr float VeryBig
constexpr float Almost1
std::array< T, N > array
o2::dataformats::DCA DCA
double * getX(double *xyDxy, int N)
double * getY(double *xyDxy, int N)
constexpr float kCTgl2max
GPUhdi() uint16_t TrackParametrization< value_T >
constexpr float HugeF
GPUdi() TrackParametrization< value_T >
constexpr int kCovMatSize
constexpr float kCSnp2max
constexpr int kNParams
GPUconstexpr() int CovarMap[kNParams][kNParams]
constexpr int kLabCovMatSize
const value_T x
Definition TrackUtils.h:136
constexpr float kCY2max
constexpr float kCalcdEdxAuto
constexpr float kMostProbablePt
constexpr float MaxPT
constexpr float MinPTInv
constexpr float kC1Pt2max
constexpr float kCZ2max
constexpr int MaxELossIter
constexpr float ELoss2EKinThreshInv
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...