18 s.setf(std::ios::scientific, std::ios::floatfield);
21 if constexpr (std::is_same_v<DataT, fvec>) {
24 s <<
" x " << GetX()[i];
25 s <<
" y " << GetY()[i];
26 s <<
" tx " << GetTx()[i];
27 s <<
" ty " << GetTy()[i];
28 s <<
" qp " << GetQp()[i];
29 s <<
" t " << GetTime()[i];
30 s <<
" vi " << GetVi()[i];
32 s <<
" z " << GetZ()[i] << std::endl;
34 s <<
" c00 " << C00()[i];
35 s <<
" c11 " << C11()[i];
36 s <<
" c22 " << C22()[i];
37 s <<
" c33 " << C33()[i];
38 s <<
" c44 " << C44()[i] << std::endl;
39 s <<
" c55 " << C55()[i] << std::endl;
40 s <<
" c66 " << C66()[i] << std::endl;
41 s << ToStringCorrelations(i);
43 s <<
" chi2 " << fChiSq[i];
44 s <<
" ndf " << fNdf[i] << std::endl;
50 s <<
"T = " << std::endl;
51 s <<
" x " << GetX() << std::endl;
52 s <<
" y " << GetY() << std::endl;
53 s <<
" tx " << GetTx() << std::endl;
54 s <<
" ty " << GetTy() << std::endl;
55 s <<
" qp " << GetQp() << std::endl;
56 s <<
" t " << GetTime() << std::endl;
57 s <<
" vi " << GetVi() << std::endl;
58 s <<
" z " << GetZ() << std::endl;
59 s <<
"C = " << std::endl;
60 s <<
" c00 " << C00() << std::endl;
61 s <<
" c11 " << C11() << std::endl;
62 s <<
" c22 " << C22() << std::endl;
63 s <<
" c33 " << C33() << std::endl;
64 s <<
" c44 " << C44() << std::endl;
65 s <<
" c55 " << C55() << std::endl;
66 s <<
" c66 " << C66() << std::endl;
67 s << ToStringCorrelations(i);
69 s <<
" chi2 " << fChiSq << std::endl;
70 s <<
" ndf " << fNdf << std::endl;
79 s << std::setprecision(6);
82 if constexpr (std::is_same_v<DataT, fvec>) {
84 float s0 =
sqrt(C00()[i]);
85 float s1 =
sqrt(C11()[i]);
86 float s2 =
sqrt(C22()[i]);
87 float s3 =
sqrt(C33()[i]);
88 float s4 =
sqrt(C44()[i]);
89 float s5 =
sqrt(C55()[i]);
90 float s6 =
sqrt(C66()[i]);
92 s <<
"K = " << std::endl;
93 s <<
" " << C10()[i] / s1 / s0 << std::endl;
94 s <<
" " << C20()[i] / s2 / s0 <<
" " << C21()[i] / s2 / s1 << std::endl;
95 s <<
" " << C30()[i] / s3 / s0 <<
" " << C31()[i] / s3 / s1 <<
" " << C32()[i] / s3 / s2 << std::endl;
96 s <<
" " << C40()[i] / s4 / s0 <<
" " << C41()[i] / s4 / s1 <<
" " << C42()[i] / s4 / s2 <<
" "
97 << C43()[i] / s4 / s3 << std::endl;
98 s <<
" " << C50()[i] / s5 / s0 <<
" " << C51()[i] / s5 / s1 <<
" " << C52()[i] / s5 / s2 <<
" "
99 << C53()[i] / s5 / s3 <<
" " << C54()[i] / s5 / s4 << std::endl;
100 s <<
" " << C60()[i] / s6 / s0 <<
" " << C61()[i] / s6 / s1 <<
" " << C62()[i] / s6 / s2 <<
" "
101 << C63()[i] / s6 / s3 <<
" " << C64()[i] / s6 / s4 <<
" " << C65()[i] / s6 / s5 << std::endl;
108 DataT s0 =
sqrt(C00());
109 DataT s1 =
sqrt(C11());
110 DataT s2 =
sqrt(C22());
111 DataT s3 =
sqrt(C33());
112 DataT s4 =
sqrt(C44());
113 DataT s5 =
sqrt(C55());
114 DataT s6 =
sqrt(C66());
116 s <<
"K = " << std::endl;
117 s <<
" k10 " << C10() / s1 / s0 << std::endl;
119 s <<
"\n k20 " << C20() / s2 / s0 << std::endl;
120 s <<
" k21 " << C21() / s2 / s1 << std::endl;
122 s <<
"\n k30 " << C30() / s3 / s0 << std::endl;
123 s <<
" k31 " << C31() / s3 / s1 << std::endl;
124 s <<
" k32 " << C32() / s3 / s2 << std::endl;
126 s <<
"\n k40 " << C40() / s4 / s0 << std::endl;
127 s <<
" k41 " << C41() / s4 / s1 << std::endl;
128 s <<
" k42 " << C42() / s4 / s2 << std::endl;
129 s <<
" k43 " << C43() / s4 / s3 << std::endl;
131 s <<
"\n k50 " << C50() / s5 / s0 << std::endl;
132 s <<
" k51 " << C51() / s5 / s1 << std::endl;
133 s <<
" k52 " << C52() / s5 / s2 << std::endl;
134 s <<
" k53 " << C53() / s5 / s3 << std::endl;
135 s <<
" k54 " << C54() / s5 / s4 << std::endl;
137 s <<
"\n k60 " << C60() / s6 / s0 << std::endl;
138 s <<
" k61 " << C61() / s6 / s1 << std::endl;
139 s <<
" k62 " << C62() / s6 / s2 << std::endl;
140 s <<
" k63 " << C63() / s6 / s3 << std::endl;
141 s <<
" k64 " << C64() / s6 / s4 << std::endl;
142 s <<
" k65 " << C65() / s6 / s5 << std::endl;
210 auto check = [&](
const std::string& s, DataT val) {
212 if (!std::isfinite(dval)) {
214 if (printWhenWrong) {
215 LOG(warning) <<
" TrackParam parameter " << s <<
", vector entry " << k <<
" is not finite: " << dval;
228 check(
"chi2", fChiSq);
230 check(
"chi2time", fChiSqTime);
231 check(
"ndfTime", fNdfTime);
236 for (
int i = 0; i < 7; i++) {
240 if (printWhenWrong) {
241 LOG(warning) <<
" TrackParam: C[" << i <<
"," << i <<
"], vec entry " << k <<
" is not positive: " << val
251 for (
int i = 1; i < 7; i++) {
252 for (
int j = 0; j < i; j++) {
253 double tolerance = 1.0;
257 if (cij * cij > tolerance * (cii * cjj)) {
259 if (printWhenWrong) {
260 LOG(warning) <<
" TrackParam: correlation [" << i <<
"," << j <<
"], vec entry " << k
261 <<
" is too large: " << cij /
sqrt(cii * cjj) << std::endl;
270 for (
int i = 2; i < 7; i++) {
271 for (
int j = 1; j < i; j++) {
272 for (
int m = 0; m < j; m++) {
273 double tolerance = 1.0;
280 if (Cxx * Cyz * Cyz + Cyy * Cxz * Cxz + Czz * Cxy * Cxy
281 > tolerance * (Cxx * Cyy * Czz + 2. * Cxy * Cyz * Cxz)) {
283 if (printWhenWrong) {
284 double Kxy = Cxy /
sqrt(Cxx * Cyy);
285 double Kxz = Cxz /
sqrt(Cxx * Czz);
286 double Kyz = Cyz /
sqrt(Cyy * Czz);
287 LOG(warning) <<
" TrackParam: correlations between parametetrs " << i <<
", " << j <<
", " << m
288 <<
", vec entry " << k <<
" are wrong: " << Kxy <<
" " << Kxz <<
" " << Kyz << std::endl
289 <<
" inequation: " << Kxy * Kxy + Kxz * Kxz + Kyz * Kyz <<
" > " << 1 + 2 * Kxy * Kxz * Kyz
297 if (!ok && printWhenWrong) {
298 LOG(warning) <<
"TrackParam parameters are not consistent: " << std::endl;