1 #ifndef RecoTracker_PixelTrackFitting_RZLine_h 2 #define RecoTracker_PixelTrackFitting_RZLine_h 28 template <
typename P,
typename E,
typename B>
31 const size_t nSafe =
n > 0 ?
n : 1;
35 for (
size_t i = 0;
i <
n; ++
i) {
41 float simpleCot2 =
n > 1 ?
sqr((
z[
n - 1] -
z[0]) / (
r[
n - 1] -
r[0])) : 0.f;
42 for (
size_t i = 0;
i <
n; ++
i) {
52 RZLine(
const std::vector<float>&
r,
const std::vector<float>&
z,
const std::vector<float>&
errZ) {
53 const size_t n =
errZ.size();
54 float errZ2[
n > 0 ?
n :
n + 1];
55 for (
size_t i = 0;
i <
n; ++
i)
64 RZLine(
const std::array<float, N>&
r,
const std::array<float, N>&
z,
const std::array<float, N>&
errZ) {
65 std::array<float, N> errZ2;
66 for (
size_t i = 0;
i <
N; ++
i)
101 if (
n < 2) [[unlikely]] {
106 for (
size_t i = 0;
i <
n; ++
i) {
111 template <
typename T>
RZLine(const P &points, const E &errors, const B &isBarrel)
RZLine(const std::array< float, N > &r, const std::array< float, N > &z, const std::array< float, N > &errZ)
static constexpr T sqr(T t)
RZLine(const T &r, const T &z, const T &errZ2, ErrZ2_tag)
void calculate(const T *r, const T *z, const T *errZ2, size_t n)
std::pair< OmniClusterRef, TrackingParticleRef > P
void linearFit(T const *__restrict__ x, T const *__restrict__ y, int ndat, T const *__restrict__ sigy2, T &slope, T &intercept, T &covss, T &covii, T &covsi)
RZLine(const std::vector< float > &r, const std::vector< float > &z, const std::vector< float > &errZ)