18 std::vector<int>& charges,
20 double b_fieldTesla)
const
23 unsigned int ntrack = cart_coordList.size();
27 const double bend_factor = -0.299792458 * b_fieldTesla;
34 for (
unsigned int i = 0;
i < ntrack;
i++) {
35 const double E = cart_coordList[
i][3];
36 const double px = cart_coordList[
i][0];
37 const double py = cart_coordList[
i][1];
38 const double pz = cart_coordList[
i][2];
40 const double deltaX = refPoint[0] - cart_coordList[
i][4];
41 const double deltaY = refPoint[1] - cart_coordList[
i][5];
43 const double a = charges[
i] * bend_factor;
53 Etot * Etot - Px * Px - Py * Py - Pz * Pz -
56 return vectorOfValues2;
61 std::vector<Amg::VectorX>& cart_coordList,
62 std::vector<int>& charges,
64 double b_fieldTesla)
const
67 const unsigned int ntrack = cart_coordList.size();
71 const double bend_factor = -0.299792458 * b_fieldTesla;
73 for (
unsigned int i = 0;
i < ntrack;
i++) {
74 const double E = cart_coordList[
i][3];
75 const double px = cart_coordList[
i][0];
76 const double py = cart_coordList[
i][1];
77 const double pz = cart_coordList[
i][2];
79 const double deltaX = refPoint[0] - cart_coordList[
i][4];
80 const double deltaY = refPoint[1] - cart_coordList[
i][5];
82 const double a = charges[
i] * bend_factor;
84 for (
unsigned int jtrack = 0; jtrack < ntrack; jtrack++) {
85 const unsigned int joff = jtrack * 7;
86 matrixDeriv2(0, joff + 0) =
87 matrixDeriv2(0, joff + 0) - 2 * (
px -
a *
deltaY);
88 matrixDeriv2(0, joff + 1) =
89 matrixDeriv2(0, joff + 1) - 2 * (
py +
a *
deltaX);
90 matrixDeriv2(0, joff + 2) = matrixDeriv2(0, joff + 2) - 2 *
pz;
91 matrixDeriv2(0, joff + 3) = matrixDeriv2(0, joff + 3) + 2 *
E;
95 matrixDeriv2(0, joff + 4) =
96 matrixDeriv2(0, joff + 4) + 2 *
a * (
py +
a *
deltaX);
97 matrixDeriv2(0, joff + 5) =
98 matrixDeriv2(0, joff + 5) - 2 *
a * (
px -
a *
deltaY);