ATLAS Offline Software
cfErPr.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #include <cmath>
9 
10 namespace Trk {
11 
12 void cferpr(const long int ich, double *par, double *ref, const double s0, double *errold, double *errnew)
13 {
14 
15 
16  double r__, dsphi, dseps, dsrho, cs, sn, xp, yp;
17  double derivm[25]; /* was [5][5] */
18  double ctg, dsq, dyp, d__3;
19 /* ------------------------------------------ */
20 /* This routine propagates the trajectory error matrix */
21 /* originally evaluated at s=0 to the curved abcissa S */
22 /* assuming that the track travels into VACUUM */
23 /* INPUT: ICH Charge of track */
24 /* PAR(5) Track parameters */
25 /* REF(3) New reference point */
26 /* ERROLD error matrix at (0,0,0) */
27 /* S0 curved abcissa of propagation */
28 /* OUTPUT: ERRNEW New error matrix */
29 /* ------ */
30 /* derivm(i,j)=D(X'.j)/D(X.i) */
31 /* ----------------------------------------------------------- */
32 /* Author: V.Kostyukhin */
33 /* ------------------------------------------------------------ */
34  /* Parameter adjustments */
35  --par;
36  --ref;
37 
38 
39  /* --------------------------------------------------- */
40  for (int ii= 0; ii< 25; ++ii) derivm[ii] = 0.;
41 /* -- */
42  cs = cos(par[4]);
43  sn = sin(par[4]);
44  xp = ref[1] * cs + ref[2] * sn; //==(*s0) for neutral particles
45  yp = ref[1] * sn - ref[2] * cs;
46  double sinp3 = sin(par[3]);
47  ctg = cos(par[3]) / sinp3;
48  derivm[6] = 1.;
49  derivm[12] = 1.;
50  derivm[24] = 1.;
51  if (ich != 0) {
52  r__ = 1. / par[5];
53  dyp = r__ - par[1] + yp;
54  dsphi = -r__ * (yp * dyp + xp * xp) / (dyp * dyp + xp * xp);
55  dseps = r__ * xp / (dyp * dyp + xp * xp);
56  dsrho = -r__ * s0 + r__ * r__ * dseps;
57  derivm[5] = dseps * ctg;
58  derivm[7] = -s0 / (sinp3 * sinp3);
59  derivm[8] = dsphi * ctg;
60  derivm[9] = dsrho * ctg;
61  derivm[15] = par[5] * dseps;
62 /* Computing 2nd power */
63  d__3 = r__ - par[1];
64  dsq = sqrt(ref[1]*ref[1] + ref[2]*ref[2] + d__3*d__3 + 2.*d__3*yp);
65  derivm[4] = -(r__*r__) + d_sign(1., r__) * (r__*r__) * dyp / dsq;
66  derivm[3] = d_sign(1., r__) * (par[1] - r__) * xp / dsq;
67  derivm[19] = s0 + par[5] * dsrho;
68  derivm[0] = d_sign(1., r__) * dyp / dsq;
69  derivm[18] = par[5] * dsphi + 1.;
70  } else {
71  derivm[0] = 1.;
72  derivm[18] = 1.;
73  //derivm[3] = par[1] - xp; VK Error!!!
74  derivm[3] = - xp; //dEps/dPhi
75  derivm[7] = -xp / (sinp3 * sinp3); //dZ/dTheta
76  derivm[8] = -yp * ctg; //dZ/dPhi
77  }
78  tdasatVK(derivm, &errold[0], &errnew[0], 5, 5);
79 
80 }
81 
82 
83 } //end of namespace Trk
84 
Trk::d_sign
double d_sign(double value, double sign)
Definition: TrkVKalUtils.h:33
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
Trk::cferpr
void cferpr(const long int ich, double *par, double *ref, const double s0, double *errold, double *errnew)
Definition: cfErPr.cxx:12
Trk::tdasatVK
void tdasatVK(const double *Der, const double *CovI, double *CovF, long int M, long int N)
Definition: Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Utilities.cxx:218
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
ref
const boost::regex ref(r_ef)
TrkVKalUtils.h
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
cfErPr.h
Utilities.h