CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Static Private Member Functions
FrameToFrameDerivative Class Reference

#include <FrameToFrameDerivative.h>

Public Member Functions

AlgebraicMatrix frameToFrameDerivative (const Alignable *object, const Alignable *composedObject) const
 
AlgebraicMatrix66 getDerivative (const align::RotationType &objectRot, const align::RotationType &composeRot, const align::GlobalPoint &objectPos, const align::GlobalPoint &composePos) const
 

Private Member Functions

AlgebraicMatrix derivativePosPos (const AlgebraicMatrix &RotDet, const AlgebraicMatrix &RotRot) const
 Calculates the derivative DPos/DPos. More...
 
AlgebraicMatrix derivativePosRot (const AlgebraicMatrix &RotDet, const AlgebraicMatrix &RotRot, const AlgebraicVector &S) const
 Calculates the derivative DPos/DRot. More...
 
AlgebraicMatrix derivativeRotRot (const AlgebraicMatrix &RotDet, const AlgebraicMatrix &RotRot) const
 Calculates the derivative DRot/DRot. More...
 
AlgebraicMatrix getDerivative (const align::RotationType &objectRot, const align::RotationType &composeRot, const align::GlobalVector &posVec) const
 
AlgebraicVector linearEulerAngles (const AlgebraicMatrix &rotDelta) const
 Gets linear approximated euler Angles. More...
 

Static Private Member Functions

static AlgebraicMatrix transform (const align::RotationType &)
 Helper to transform from RotationType to AlgebraicMatrix. More...
 

Detailed Description

Class for calculating the jacobian d_object/d_composedObject for the rigid body parametrisation of both, i.e. the derivatives expressing the influence of u, v, w, alpha, beta, gamma of the composedObject on u, v, w, alpha, beta, gamma of its component 'object'.

Date
2007/10/08 15:56:00
Revision
1.6

(last update by

Author
cklae

)

Definition at line 20 of file FrameToFrameDerivative.h.

Member Function Documentation

◆ derivativePosPos()

AlgebraicMatrix FrameToFrameDerivative::derivativePosPos ( const AlgebraicMatrix RotDet,
const AlgebraicMatrix RotRot 
) const
private

Calculates the derivative DPos/DPos.

Definition at line 95 of file FrameToFrameDerivative.cc.

96  {
97  return RotDet * RotRot.T();
98 }

Referenced by getDerivative().

◆ derivativePosRot()

AlgebraicMatrix FrameToFrameDerivative::derivativePosRot ( const AlgebraicMatrix RotDet,
const AlgebraicMatrix RotRot,
const AlgebraicVector S 
) const
private

Calculates the derivative DPos/DRot.

Definition at line 101 of file FrameToFrameDerivative.cc.

103  {
104  AlgebraicVector dEulerA(3);
105  AlgebraicVector dEulerB(3);
106  AlgebraicVector dEulerC(3);
107  AlgebraicMatrix RotDa(3, 3);
108  AlgebraicMatrix RotDb(3, 3);
109  AlgebraicMatrix RotDc(3, 3);
110 
111  RotDa[1][2] = 1;
112  RotDa[2][1] = -1;
113  RotDb[0][2] = -1;
114  RotDb[2][0] = 1; // New beta sign
115  RotDc[0][1] = 1;
116  RotDc[1][0] = -1;
117 
118  dEulerA = RotDet * (RotRot.T() * RotDa * RotRot * S);
119  dEulerB = RotDet * (RotRot.T() * RotDb * RotRot * S);
120  dEulerC = RotDet * (RotRot.T() * RotDc * RotRot * S);
121 
122  AlgebraicMatrix eulerDeriv(3, 3);
123  eulerDeriv[0][0] = dEulerA[0];
124  eulerDeriv[1][0] = dEulerA[1];
125  eulerDeriv[2][0] = dEulerA[2];
126  eulerDeriv[0][1] = dEulerB[0];
127  eulerDeriv[1][1] = dEulerB[1];
128  eulerDeriv[2][1] = dEulerB[2];
129  eulerDeriv[0][2] = dEulerC[0];
130  eulerDeriv[1][2] = dEulerC[1];
131  eulerDeriv[2][2] = dEulerC[2];
132 
133  return eulerDeriv;
134 }

References S().

Referenced by getDerivative().

◆ derivativeRotRot()

AlgebraicMatrix FrameToFrameDerivative::derivativeRotRot ( const AlgebraicMatrix RotDet,
const AlgebraicMatrix RotRot 
) const
private

Calculates the derivative DRot/DRot.

Definition at line 137 of file FrameToFrameDerivative.cc.

138  {
139  AlgebraicVector dEulerA(3);
140  AlgebraicVector dEulerB(3);
141  AlgebraicVector dEulerC(3);
142  AlgebraicMatrix RotDa(3, 3);
143  AlgebraicMatrix RotDb(3, 3);
144  AlgebraicMatrix RotDc(3, 3);
145 
146  RotDa[1][2] = 1;
147  RotDa[2][1] = -1;
148  RotDb[0][2] = -1;
149  RotDb[2][0] = 1; // New beta sign
150  RotDc[0][1] = 1;
151  RotDc[1][0] = -1;
152 
153  dEulerA = linearEulerAngles(RotDet * RotRot.T() * RotDa * RotRot * RotDet.T());
154  dEulerB = linearEulerAngles(RotDet * RotRot.T() * RotDb * RotRot * RotDet.T());
155  dEulerC = linearEulerAngles(RotDet * RotRot.T() * RotDc * RotRot * RotDet.T());
156 
157  AlgebraicMatrix eulerDeriv(3, 3);
158 
159  eulerDeriv[0][0] = dEulerA[0];
160  eulerDeriv[1][0] = dEulerA[1];
161  eulerDeriv[2][0] = dEulerA[2];
162  eulerDeriv[0][1] = dEulerB[0];
163  eulerDeriv[1][1] = dEulerB[1];
164  eulerDeriv[2][1] = dEulerB[2];
165  eulerDeriv[0][2] = dEulerC[0];
166  eulerDeriv[1][2] = dEulerC[1];
167  eulerDeriv[2][2] = dEulerC[2];
168 
169  return eulerDeriv;
170 }

References linearEulerAngles().

Referenced by getDerivative().

◆ frameToFrameDerivative()

AlgebraicMatrix FrameToFrameDerivative::frameToFrameDerivative ( const Alignable object,
const Alignable composedObject 
) const

Return the derivative DeltaFrame(object)/DeltaFrame(composedObject), i.e. a 6x6 matrix:

/ du/du_c du/dv_c du/dw_c du/da_c du/db_c du/dg_c | | dv/du_c dv/dv_c dv/dw_c dv/da_c dv/db_c dv/dg_c | | dw/du_c dw/dv_c dw/dw_c dw/da_c dw/db_c dw/dg_c | | da/du_c da/dv_c da/dw_c da/da_c da/db_c da/dg_c | | db/du_c db/dv_c db/dw_c db/da_c db/db_c db/dg_c | \ dg/du_c dg/dv_c dg/dw_c dg/da_c dg/db_c dg/dg_c /

where u, v, w, a, b, g are shifts and rotations of the object and u_c, v_c, w_c, a_c, b_c, g_c those of the composed object.

Definition at line 16 of file FrameToFrameDerivative.cc.

17  {
18  return getDerivative(object->globalRotation(),
19  composedObject->globalRotation(),
20  composedObject->globalPosition() - object->globalPosition());
21 }

References getDerivative(), Alignable::globalPosition(), Alignable::globalRotation(), and resolutioncreator_cfi::object.

Referenced by RigidBodyAlignmentParameters4D::derivatives(), RigidBodyAlignmentParameters::derivatives(), MillePedeMonitor::fillFrameToFrame(), ParametersToParametersDerivatives::initBowedRigid(), and ParametersToParametersDerivatives::initRigidRigid().

◆ getDerivative() [1/2]

AlgebraicMatrix66 FrameToFrameDerivative::getDerivative ( const align::RotationType objectRot,
const align::RotationType composeRot,
const align::GlobalPoint objectPos,
const align::GlobalPoint composePos 
) const

Calculates derivatives DeltaFrame(object)/DeltaFrame(composedobject) using their positions and orientations, see method frameToFrameDerivative(..) for definition. As a new method it gets a new interface avoiding CLHEP that should anyway be replaced by SMatrix at some point...

Definition at line 24 of file FrameToFrameDerivative.cc.

27  {
28  return asSMatrix<6, 6>(this->getDerivative(objectRot, composeRot, composePos - objectPos));
29 }

Referenced by frameToFrameDerivative().

◆ getDerivative() [2/2]

AlgebraicMatrix FrameToFrameDerivative::getDerivative ( const align::RotationType objectRot,
const align::RotationType composeRot,
const align::GlobalVector posVec 
) const
private

Calculates derivatives using the orientation Matrixes and the origin difference vector

Definition at line 32 of file FrameToFrameDerivative.cc.

34  {
35  AlgebraicMatrix rotDet = transform(objectRot);
36  AlgebraicMatrix rotCompO = transform(composeRot);
37 
38  AlgebraicVector diffVec(3);
39 
40  diffVec(1) = posVec.x();
41  diffVec(2) = posVec.y();
42  diffVec(3) = posVec.z();
43 
45 
46  AlgebraicMatrix derivAA(3, 3);
47  AlgebraicMatrix derivAB(3, 3);
48  AlgebraicMatrix derivBB(3, 3);
49 
50  derivAA = derivativePosPos(rotDet, rotCompO);
51  derivAB = derivativePosRot(rotDet, rotCompO, diffVec);
52  derivBB = derivativeRotRot(rotDet, rotCompO);
53 
54  derivative[0][0] = derivAA[0][0];
55  derivative[0][1] = derivAA[0][1];
56  derivative[0][2] = derivAA[0][2];
57  derivative[0][3] = derivAB[0][0];
58  derivative[0][4] = derivAB[0][1];
59  derivative[0][5] = derivAB[0][2];
60  derivative[1][0] = derivAA[1][0];
61  derivative[1][1] = derivAA[1][1];
62  derivative[1][2] = derivAA[1][2];
63  derivative[1][3] = derivAB[1][0];
64  derivative[1][4] = derivAB[1][1];
65  derivative[1][5] = derivAB[1][2];
66  derivative[2][0] = derivAA[2][0];
67  derivative[2][1] = derivAA[2][1];
68  derivative[2][2] = derivAA[2][2];
69  derivative[2][3] = derivAB[2][0];
70  derivative[2][4] = derivAB[2][1];
71  derivative[2][5] = derivAB[2][2];
72  derivative[3][0] = 0;
73  derivative[3][1] = 0;
74  derivative[3][2] = 0;
75  derivative[3][3] = derivBB[0][0];
76  derivative[3][4] = derivBB[0][1];
77  derivative[3][5] = derivBB[0][2];
78  derivative[4][0] = 0;
79  derivative[4][1] = 0;
80  derivative[4][2] = 0;
81  derivative[4][3] = derivBB[1][0];
82  derivative[4][4] = derivBB[1][1];
83  derivative[4][5] = derivBB[1][2];
84  derivative[5][0] = 0;
85  derivative[5][1] = 0;
86  derivative[5][2] = 0;
87  derivative[5][3] = derivBB[2][0];
88  derivative[5][4] = derivBB[2][1];
89  derivative[5][5] = derivBB[2][2];
90 
91  return derivative;
92 }

References funct::derivative(), derivativePosPos(), derivativePosRot(), derivativeRotRot(), transform(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ linearEulerAngles()

AlgebraicVector FrameToFrameDerivative::linearEulerAngles ( const AlgebraicMatrix rotDelta) const
private

Gets linear approximated euler Angles.

Definition at line 173 of file FrameToFrameDerivative.cc.

173  {
174  AlgebraicMatrix eulerAB(3, 3);
175  AlgebraicVector aB(3);
176  eulerAB[0][1] = 1;
177  eulerAB[1][0] = -1; // New beta sign
178  aB[2] = 1;
179 
180  AlgebraicMatrix eulerC(3, 3);
181  AlgebraicVector C(3);
182  eulerC[2][0] = 1;
183  C[1] = 1;
184 
185  AlgebraicVector eulerAngles(3);
186  eulerAngles = eulerAB * rotDelta * aB + eulerC * rotDelta * C;
187  return eulerAngles;
188 }

References gen::C.

Referenced by derivativeRotRot().

◆ transform()

AlgebraicMatrix FrameToFrameDerivative::transform ( const align::RotationType rot)
inlinestaticprivate

Helper to transform from RotationType to AlgebraicMatrix.

Definition at line 72 of file FrameToFrameDerivative.h.

72  {
73  AlgebraicMatrix R(3, 3);
74 
75  R(1, 1) = rot.xx();
76  R(1, 2) = rot.xy();
77  R(1, 3) = rot.xz();
78  R(2, 1) = rot.yx();
79  R(2, 2) = rot.yy();
80  R(2, 3) = rot.yz();
81  R(3, 1) = rot.zx();
82  R(3, 2) = rot.zy();
83  R(3, 3) = rot.zz();
84 
85  return R;
86 }

References dttmaxenums::R, and makeMuonMisalignmentScenario::rot.

Referenced by getDerivative().

resolutioncreator_cfi.object
object
Definition: resolutioncreator_cfi.py:4
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
FrameToFrameDerivative::transform
static AlgebraicMatrix transform(const align::RotationType &)
Helper to transform from RotationType to AlgebraicMatrix.
Definition: FrameToFrameDerivative.h:72
funct::derivative
Derivative< X, A >::type derivative(const A &_)
Definition: Derivative.h:18
FrameToFrameDerivative::getDerivative
AlgebraicMatrix66 getDerivative(const align::RotationType &objectRot, const align::RotationType &composeRot, const align::GlobalPoint &objectPos, const align::GlobalPoint &composePos) const
Definition: FrameToFrameDerivative.cc:24
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
FrameToFrameDerivative::derivativeRotRot
AlgebraicMatrix derivativeRotRot(const AlgebraicMatrix &RotDet, const AlgebraicMatrix &RotRot) const
Calculates the derivative DRot/DRot.
Definition: FrameToFrameDerivative.cc:137
FrameToFrameDerivative::linearEulerAngles
AlgebraicVector linearEulerAngles(const AlgebraicMatrix &rotDelta) const
Gets linear approximated euler Angles.
Definition: FrameToFrameDerivative.cc:173
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
FrameToFrameDerivative::derivativePosRot
AlgebraicMatrix derivativePosRot(const AlgebraicMatrix &RotDet, const AlgebraicMatrix &RotRot, const AlgebraicVector &S) const
Calculates the derivative DPos/DRot.
Definition: FrameToFrameDerivative.cc:101
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:97
FrameToFrameDerivative::derivativePosPos
AlgebraicMatrix derivativePosPos(const AlgebraicMatrix &RotDet, const AlgebraicMatrix &RotRot) const
Calculates the derivative DPos/DPos.
Definition: FrameToFrameDerivative.cc:95
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
AlgebraicMatrix
CLHEP::HepMatrix AlgebraicMatrix
Definition: AlgebraicObjects.h:14
gen::C
C
Definition: PomwigHadronizer.cc:76
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
Alignable::globalPosition
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
dttmaxenums::R
Definition: DTTMax.h:29
Alignable::globalRotation
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:138