CMS 3D CMS Logo

ErrorFrameTransformer.h
Go to the documentation of this file.
1 #ifndef ErrorFrameTransformer_H
2 #define ErrorFrameTransformer_H
3 
9 
11 
14 
15  //old version 1
16  static GlobalError transform(const LocalError& le, const Surface& surf) {
17  // the GlobalError is a sym matrix, initialisation takes only
18  // 6 T because GlobalError is stored as a lower triangular matrix.
19  Scalar cxx = le.xx();
20  Scalar cxy = le.xy();
21  Scalar cyy = le.yy();
22 
24 
25  return GlobalError(r.xx() * (r.xx() * cxx + r.yx() * cxy) + r.yx() * (r.xx() * cxy + r.yx() * cyy),
26  r.xx() * (r.xy() * cxx + r.yy() * cxy) + r.yx() * (r.xy() * cxy + r.yy() * cyy),
27  r.xy() * (r.xy() * cxx + r.yy() * cxy) + r.yy() * (r.xy() * cxy + r.yy() * cyy),
28  r.xx() * (r.xz() * cxx + r.yz() * cxy) + r.yx() * (r.xz() * cxy + r.yz() * cyy),
29  r.xy() * (r.xz() * cxx + r.yz() * cxy) + r.yy() * (r.xz() * cxy + r.yz() * cyy),
30  r.xz() * (r.xz() * cxx + r.yz() * cxy) + r.yz() * (r.xz() * cxy + r.yz() * cyy));
31  }
32 
33  static LocalError transform(const GlobalError& ge, const Surface& surf) {
34  Scalar cxx = ge.cxx();
35  Scalar cyx = ge.cyx();
36  Scalar cyy = ge.cyy();
37  Scalar czx = ge.czx();
38  Scalar czy = ge.czy();
39  Scalar czz = ge.czz();
40 
42 
43  Scalar l11 = r.xx() * (r.xx() * cxx + r.xy() * cyx + r.xz() * czx) +
44  r.xy() * (r.xx() * cyx + r.xy() * cyy + r.xz() * czy) +
45  r.xz() * (r.xx() * czx + r.xy() * czy + r.xz() * czz);
46  Scalar l12 = r.yx() * (r.xx() * cxx + r.xy() * cyx + r.xz() * czx) +
47  r.yy() * (r.xx() * cyx + r.xy() * cyy + r.xz() * czy) +
48  r.yz() * (r.xx() * czx + r.xy() * czy + r.xz() * czz);
49  Scalar l22 = r.yx() * (r.yx() * cxx + r.yy() * cyx + r.yz() * czx) +
50  r.yy() * (r.yx() * cyx + r.yy() * cyy + r.yz() * czy) +
51  r.yz() * (r.yx() * czx + r.yy() * czy + r.yz() * czz);
52 
53  return LocalError(l11, l12, l22);
54  }
55 
56  //new Jacobian for 6x6 APE in muon code
58  const AlgebraicVector& positions,
59  const AlgebraicVector& directions) {
60  const AlgebraicSymMatrix66& as(ge.matrix());
61 
62  AlgebraicMatrix46 jacobian46;
63  jacobian46[0][0] = 1.;
64  jacobian46[0][1] = 0.;
65  jacobian46[0][2] = -directions[0];
66  jacobian46[0][3] = -positions[1] * directions[0];
67  jacobian46[0][4] = positions[0] * directions[0];
68  jacobian46[0][5] = -positions[1];
69 
70  jacobian46[1][0] = 0.;
71  jacobian46[1][1] = 1.;
72  jacobian46[1][2] = -directions[1];
73  jacobian46[1][3] = -positions[1] * directions[1];
74  jacobian46[1][4] = positions[0] * directions[1];
75  jacobian46[1][5] = positions[0];
76 
77  jacobian46[2][0] = 0.;
78  jacobian46[2][1] = 0.;
79  jacobian46[2][2] = 0.;
80  jacobian46[2][3] = -directions[1] * directions[0];
81  jacobian46[2][4] = 1. + directions[0] * directions[0];
82  jacobian46[2][5] = -directions[1];
83 
84  jacobian46[3][0] = 0.;
85  jacobian46[3][1] = 0.;
86  jacobian46[3][2] = 0.;
87  jacobian46[3][3] = -1. - directions[1] * directions[1];
88  jacobian46[3][4] = directions[0] * directions[1];
89  jacobian46[3][5] = directions[0];
90 
91  AlgebraicSymMatrix44 out = ROOT::Math::Similarity(jacobian46, as);
92 
93  LocalErrorExtended newError(out);
94 
95  return newError;
96  }
97 };
98 
99 #endif
TkRotation< float >
ErrorFrameTransformer::transform46
static LocalErrorExtended transform46(const GlobalErrorExtended &ge, const AlgebraicVector &positions, const AlgebraicVector &directions)
Definition: ErrorFrameTransformer.h:57
AlgebraicObjects.h
ErrorFrameTransformer::Scalar
Surface::Scalar Scalar
Definition: ErrorFrameTransformer.h:13
LocalError::xy
float xy() const
Definition: LocalError.h:23
Surface
Definition: Surface.h:36
GlobalErrorBase::czy
T czy() const
Definition: GlobalErrorBase.h:105
AlgebraicMatrix46
ROOT::Math::SMatrix< double, 4, 6, ROOT::Math::MatRepStd< double, 4, 6 > > AlgebraicMatrix46
Definition: AlgebraicROOTObjects.h:50
GlobalError
GlobalErrorBase< double, ErrorMatrixTag > GlobalError
Definition: GlobalError.h:13
GlobalErrorBase::cyy
T cyy() const
Definition: GlobalErrorBase.h:101
ErrorFrameTransformer
Definition: ErrorFrameTransformer.h:12
LocalErrorExtended.h
directions
directions
Definition: DeviationsFromFileSensor2D.cc:15
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
Surface.h
LocalError.h
LocalError::xx
float xx() const
Definition: LocalError.h:22
AlgebraicSymMatrix66
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
Definition: AlgebraicROOTObjects.h:24
GlobalErrorBase::cxx
T cxx() const
Definition: GlobalErrorBase.h:97
GlobalErrorBase::cyx
T cyx() const
Definition: GlobalErrorBase.h:99
LocalError
Definition: LocalError.h:12
GlobalError.h
GlobalErrorBase< double, ErrorMatrixTag >
LocalErrorBaseExtended< double, ErrorMatrixTag >
AlgebraicSymMatrix44
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
Definition: AlgebraicROOTObjects.h:22
alignCSCRings.r
r
Definition: alignCSCRings.py:93
GlobalErrorBase::czz
T czz() const
Definition: GlobalErrorBase.h:107
ErrorFrameTransformer::transform
static LocalError transform(const GlobalError &ge, const Surface &surf)
Definition: ErrorFrameTransformer.h:33
GlobalErrorBaseExtended::matrix
const AlgebraicSymMatrix66 & matrix() const
Definition: GlobalErrorBaseExtended.h:153
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
GlobalErrorBaseExtended< double, ErrorMatrixTag >
GloballyPositioned::rotation
const RotationType & rotation() const
Definition: GloballyPositioned.h:38
ErrorFrameTransformer::transform
static GlobalError transform(const LocalError &le, const Surface &surf)
Definition: ErrorFrameTransformer.h:16
LocalError::yy
float yy() const
Definition: LocalError.h:24
AlgebraicROOTObjects.h
GloballyPositioned< float >::Scalar
float Scalar
Definition: GloballyPositioned.h:20
GlobalErrorBase::czx
T czx() const
Definition: GlobalErrorBase.h:103