CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Attributes
ROOT::Math::Transform3DPJ Class Reference

#include <Transform3DPJ.h>

Public Types

enum  ETransform3DMatrixIndex {
  kXX = 0, kXY = 1, kXZ = 2, kDX = 3,
  kYX = 4, kYY = 5, kYZ = 6, kDY = 7,
  kZX = 8, kZY = 9, kZZ =10, kDZ = 11
}
 
typedef PositionVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > Point
 
typedef DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > Vector
 

Public Member Functions

template<class IT >
void GetComponents (IT begin, IT end) const
 
template<class IT >
void GetComponents (IT begin) const
 
void GetComponents (double &xx, double &xy, double &xz, double &dx, double &yx, double &yy, double &yz, double &dy, double &zx, double &zy, double &zz, double &dz) const
 
void GetDecomposition (Rotation3D &r, Vector &v) const
 
template<class ForeignMatrix >
void GetTransformMatrix (ForeignMatrix &m) const
 
Transform3DPJ Inverse () const
 
void Invert ()
 
bool operator!= (const Transform3DPJ &rhs) const
 
Point operator() (const Point &p) const
 
Vector operator() (const Vector &v) const
 
template<class CoordSystem >
PositionVector3D< CoordSystem > operator() (const PositionVector3D< CoordSystem > &p) const
 
template<class CoordSystem >
DisplacementVector3D< CoordSystem > operator() (const DisplacementVector3D< CoordSystem > &v) const
 
template<class CoordSystem >
LorentzVector< CoordSystem > operator() (const LorentzVector< CoordSystem > &q) const
 
Plane3D operator() (const Plane3D &plane) const
 
template<class AVector >
AVector operator* (const AVector &v) const
 
Transform3DPJ operator* (const Transform3DPJ &t) const
 
Transform3DPJoperator*= (const Transform3DPJ &t)
 
template<class ForeignMatrix >
Transform3DPJoperator= (const ForeignMatrix &m)
 
bool operator== (const Transform3DPJ &rhs) const
 
template<class IT >
void SetComponents (IT begin, IT end)
 
void SetComponents (double xx, double xy, double xz, double dx, double yx, double yy, double yz, double dy, double zx, double zy, double zz, double dz)
 
template<class ForeignMatrix >
void SetTransformMatrix (const ForeignMatrix &m)
 
template<class CoordSystem , class Tag1 , class Tag2 >
void Transform (const PositionVector3D< CoordSystem, Tag1 > &p1, PositionVector3D< CoordSystem, Tag2 > &p2) const
 
template<class CoordSystem , class Tag1 , class Tag2 >
void Transform (const DisplacementVector3D< CoordSystem, Tag1 > &v1, DisplacementVector3D< CoordSystem, Tag2 > &v2) const
 
 Transform3DPJ ()
 
template<class IT >
 Transform3DPJ (IT begin, IT end)
 
 Transform3DPJ (const Rotation3D &r, const Vector &v)
 
 Transform3DPJ (const Vector &v, const Rotation3D &r)
 
 Transform3DPJ (const Rotation3D &r)
 
 Transform3DPJ (const AxisAngle &r)
 
 Transform3DPJ (const EulerAngles &r)
 
 Transform3DPJ (const Quaternion &r)
 
 Transform3DPJ (const RotationX &r)
 
 Transform3DPJ (const RotationY &r)
 
 Transform3DPJ (const RotationZ &r)
 
template<class CoordSystem , class Tag >
 Transform3DPJ (const DisplacementVector3D< CoordSystem, Tag > &v)
 
 Transform3DPJ (const Vector &v)
 
template<class ARotation , class CoordSystem , class Tag >
 Transform3DPJ (const ARotation &r, const DisplacementVector3D< CoordSystem, Tag > &v)
 
template<class ARotation , class CoordSystem , class Tag >
 Transform3DPJ (const DisplacementVector3D< CoordSystem, Tag > &v, const ARotation &r)
 
 Transform3DPJ (const Point &fr0, const Point &fr1, const Point &fr2, const Point &to0, const Point &to1, const Point &to2)
 
template<class ForeignMatrix >
 Transform3DPJ (const ForeignMatrix &m)
 
 Transform3DPJ (double xx, double xy, double xz, double dx, double yx, double yy, double yz, double dy, double zx, double zy, double zz, double dz)
 

Protected Member Functions

void AssignFrom (const Rotation3D &r, const Vector &v)
 
void AssignFrom (const Rotation3D &r)
 
void AssignFrom (const Vector &v)
 
void SetIdentity ()
 

Private Attributes

double fM [12]
 

Detailed Description

Basic 3D Transformation class describing a rotation and then a translation The internal data are a rotation data and a 3D vector data and they can be represented like a 3x4 matrix The class has a template parameter the coordinate system tag of the reference system to which the transformatioon will be applied. For example for transforming from global to local coordinate systems, the transfrom3D has to be instantiated with the coordinate of the traget system

Definition at line 61 of file Transform3DPJ.h.

Member Typedef Documentation

typedef PositionVector3D<Cartesian3D<double>, DefaultCoordinateSystemTag > ROOT::Math::Transform3DPJ::Point

Definition at line 67 of file Transform3DPJ.h.

typedef DisplacementVector3D<Cartesian3D<double>, DefaultCoordinateSystemTag > ROOT::Math::Transform3DPJ::Vector

Definition at line 66 of file Transform3DPJ.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

ROOT::Math::Transform3DPJ::Transform3DPJ ( )
inline

Default constructor (identy rotation) + zero translation

Definition at line 81 of file Transform3DPJ.h.

References SetIdentity().

Referenced by Transform3DPJ().

82  {
83  SetIdentity();
84  }
template<class IT >
ROOT::Math::Transform3DPJ::Transform3DPJ ( IT  begin,
IT  end 
)
inline

Construct given a pair of pointers or iterators defining the beginning and end of an array of 12 Scalars

Definition at line 91 of file Transform3DPJ.h.

References SetComponents().

92  {
94  }
#define end
Definition: vmac.h:39
void SetComponents(IT begin, IT end)
#define begin
Definition: vmac.h:32
ROOT::Math::Transform3DPJ::Transform3DPJ ( const Rotation3D &  r,
const Vector v 
)
inline

Construct from a rotation and then a translation described by a Vector

Definition at line 99 of file Transform3DPJ.h.

References AssignFrom().

100  {
101  AssignFrom( r, v );
102  }
void AssignFrom(const Rotation3D &r, const Vector &v)
ROOT::Math::Transform3DPJ::Transform3DPJ ( const Vector v,
const Rotation3D &  r 
)
inline

Construct from a translation and then a rotation (inverse assignment)

Definition at line 106 of file Transform3DPJ.h.

References AssignFrom(), and alignCSCRings::r.

107  {
108  // is equivalent from having first the rotation and then the translation vector rotated
109  AssignFrom( r, r(v) );
110  }
void AssignFrom(const Rotation3D &r, const Vector &v)
ROOT::Math::Transform3DPJ::Transform3DPJ ( const Rotation3D &  r)
inlineexplicit

Construct from a 3D Rotation only with zero translation

Definition at line 115 of file Transform3DPJ.h.

References AssignFrom().

115  {
116  AssignFrom(r);
117  }
void AssignFrom(const Rotation3D &r, const Vector &v)
ROOT::Math::Transform3DPJ::Transform3DPJ ( const AxisAngle &  r)
inlineexplicit

Definition at line 119 of file Transform3DPJ.h.

References AssignFrom().

119  {
120  AssignFrom(Rotation3D(r));
121  }
void AssignFrom(const Rotation3D &r, const Vector &v)
ROOT::Math::Transform3DPJ::Transform3DPJ ( const EulerAngles &  r)
inlineexplicit

Definition at line 122 of file Transform3DPJ.h.

References AssignFrom().

122  {
123  AssignFrom(Rotation3D(r));
124  }
void AssignFrom(const Rotation3D &r, const Vector &v)
ROOT::Math::Transform3DPJ::Transform3DPJ ( const Quaternion &  r)
inlineexplicit

Definition at line 125 of file Transform3DPJ.h.

References AssignFrom().

125  {
126  AssignFrom(Rotation3D(r));
127  }
void AssignFrom(const Rotation3D &r, const Vector &v)
ROOT::Math::Transform3DPJ::Transform3DPJ ( const RotationX &  r)
inlineexplicit

Definition at line 129 of file Transform3DPJ.h.

References AssignFrom().

129  {
130  AssignFrom(Rotation3D(r));
131  }
void AssignFrom(const Rotation3D &r, const Vector &v)
ROOT::Math::Transform3DPJ::Transform3DPJ ( const RotationY &  r)
inlineexplicit

Definition at line 132 of file Transform3DPJ.h.

References AssignFrom().

132  {
133  AssignFrom(Rotation3D(r));
134  }
void AssignFrom(const Rotation3D &r, const Vector &v)
ROOT::Math::Transform3DPJ::Transform3DPJ ( const RotationZ &  r)
inlineexplicit

Definition at line 135 of file Transform3DPJ.h.

References AssignFrom().

135  {
136  AssignFrom(Rotation3D(r));
137  }
void AssignFrom(const Rotation3D &r, const Vector &v)
template<class CoordSystem , class Tag >
ROOT::Math::Transform3DPJ::Transform3DPJ ( const DisplacementVector3D< CoordSystem, Tag > &  v)
inlineexplicit

Construct from a translation only, represented by any DisplacementVector3D and with an identity rotation

Definition at line 144 of file Transform3DPJ.h.

References AssignFrom().

144  {
145  AssignFrom(Vector(v.X(),v.Y(),v.Z()));
146  }
void AssignFrom(const Rotation3D &r, const Vector &v)
DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > Vector
Definition: Transform3DPJ.h:66
ROOT::Math::Transform3DPJ::Transform3DPJ ( const Vector v)
inlineexplicit

Construct from a translation only, represented by a Cartesian 3D Vector, and with an identity rotation

Definition at line 151 of file Transform3DPJ.h.

References AssignFrom().

151  {
152  AssignFrom(v);
153  }
void AssignFrom(const Rotation3D &r, const Vector &v)
template<class ARotation , class CoordSystem , class Tag >
ROOT::Math::Transform3DPJ::Transform3DPJ ( const ARotation &  r,
const DisplacementVector3D< CoordSystem, Tag > &  v 
)
inline

Construct from a rotation (any rotation object) and then a translation (represented by any DisplacementVector) The requirements on the rotation and vector objects are that they can be transformed in a Rotation3D class and in a Vector

Definition at line 166 of file Transform3DPJ.h.

References AssignFrom().

167  {
168  AssignFrom( Rotation3D(r), Vector (v.X(),v.Y(),v.Z()) );
169  }
void AssignFrom(const Rotation3D &r, const Vector &v)
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
template<class ARotation , class CoordSystem , class Tag >
ROOT::Math::Transform3DPJ::Transform3DPJ ( const DisplacementVector3D< CoordSystem, Tag > &  v,
const ARotation &  r 
)
inline

Construct from a translation (using any type of DisplacementVector ) and then a rotation (any rotation object). Requirement on the rotation and vector objects are that they can be transformed in a Rotation3D class and in a Vector

Definition at line 177 of file Transform3DPJ.h.

References AssignFrom(), and Transform3DPJ().

178  {
179  // is equivalent from having first the rotation and then the translation vector rotated
180  Rotation3D r3d(r);
181  AssignFrom( r3d, r3d( Vector(v.X(),v.Y(),v.Z()) ) );
182  }
void AssignFrom(const Rotation3D &r, const Vector &v)
DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > Vector
Definition: Transform3DPJ.h:66
ROOT::Math::Transform3DPJ::Transform3DPJ ( const Point fr0,
const Point fr1,
const Point fr2,
const Point to0,
const Point to1,
const Point to2 
)

Construct transformation from one coordinate system defined by three points (origin + two axis) to a new coordinate system defined by other three points (origin + axis)

Parameters
fr0point defining origin of original reference system
fr1point defining first axis of original reference system
fr2point defining second axis of original reference system
to0point defining origin of transformed reference system
to1point defining first axis transformed reference system
to2point defining second axis transformed reference system
template<class ForeignMatrix >
ROOT::Math::Transform3DPJ::Transform3DPJ ( const ForeignMatrix &  m)
inlineexplicit

Construct from a linear algebra matrix of size at least 3x4, which must support operator()(i,j) to obtain elements (0,0) thru (2,3). The 3x3 sub-block is assumed to be the rotation part and the translations vector are described by the 4-th column

Definition at line 212 of file Transform3DPJ.h.

References SetComponents().

212  {
213  SetComponents(m);
214  }
void SetComponents(IT begin, IT end)
ROOT::Math::Transform3DPJ::Transform3DPJ ( double  xx,
double  xy,
double  xz,
double  dx,
double  yx,
double  yy,
double  yz,
double  dy,
double  zx,
double  zy,
double  zz,
double  dz 
)
inline

Member Function Documentation

void ROOT::Math::Transform3DPJ::AssignFrom ( const Rotation3D &  r,
const Vector v 
)
protected

make transformation from first a rotation then a translation

Definition at line 211 of file Transform3DPJ.cc.

References fM, mps_fire::i, kDX, kDY, kDZ, kYX, and kZX.

Referenced by operator!=(), and Transform3DPJ().

212 {
213  // assignment from rotation + translation
214 
215  double rotData[9];
216  r.GetComponents(rotData, rotData +9);
217  // first raw
218  for (int i = 0; i < 3; ++i)
219  fM[i] = rotData[i];
220  // second raw
221  for (int i = 0; i < 3; ++i)
222  fM[kYX+i] = rotData[3+i];
223  // third raw
224  for (int i = 0; i < 3; ++i)
225  fM[kZX+i] = rotData[6+i];
226 
227  // translation data
228  double vecData[3];
229  v.GetCoordinates(vecData, vecData+3);
230  fM[kDX] = vecData[0];
231  fM[kDY] = vecData[1];
232  fM[kDZ] = vecData[2];
233 }
void ROOT::Math::Transform3DPJ::AssignFrom ( const Rotation3D &  r)
protected

make transformation from only rotations (zero translation)

Definition at line 236 of file Transform3DPJ.cc.

References fM, and mps_fire::i.

237 {
238  // assign from only a rotation (null translation)
239  double rotData[9];
240  r.GetComponents(rotData, rotData +9);
241  for (int i = 0; i < 3; ++i) {
242  for (int j = 0; j < 3; ++j)
243  fM[4*i + j] = rotData[3*i+j];
244  // empty vector data
245  fM[4*i + 3] = 0;
246  }
247 }
void ROOT::Math::Transform3DPJ::AssignFrom ( const Vector v)
protected

make transformation from only translation (identity rotations)

Definition at line 249 of file Transform3DPJ.cc.

References fM, kDX, kDY, kDZ, kXX, kXY, kXZ, kYX, kYY, kYZ, kZX, kZY, and kZZ.

template<class IT >
void ROOT::Math::Transform3DPJ::GetComponents ( IT  begin,
IT  end 
) const
inline

Get the 12 matrix components into data specified by an iterator begin and another to the end of the desired data (12 past start).

Definition at line 261 of file Transform3DPJ.h.

References begin, fM, and mps_fire::i.

Referenced by ROOT::Math::operator<<().

261  {
262  for (int i = 0; i <12; ++i) {
263  *begin = fM[i];
264  ++begin;
265  }
266  assert (end==begin);
267  }
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
template<class IT >
void ROOT::Math::Transform3DPJ::GetComponents ( IT  begin) const
inline

Get the 12 matrix components into data specified by an iterator begin

Definition at line 273 of file Transform3DPJ.h.

References popcon2dropbox::copy(), and fM.

273  {
274  std::copy ( fM, fM+12, begin );
275  }
def copy(args, dbName)
#define begin
Definition: vmac.h:32
void ROOT::Math::Transform3DPJ::GetComponents ( double &  xx,
double &  xy,
double &  xz,
double &  dx,
double &  yx,
double &  yy,
double &  yz,
double &  dy,
double &  zx,
double &  zy,
double &  zz,
double &  dz 
) const
inline

Get the nine components into 12 scalars

Definition at line 321 of file Transform3DPJ.h.

References fM, GetDecomposition(), kDX, kDY, kDZ, kXX, kXY, kXZ, kYX, kYY, kYZ, kZX, kZY, kZZ, operator()(), AlCaHLTBitMon_ParallelJobs::p, alignCSCRings::r, and findQualityFiles::v.

void ROOT::Math::Transform3DPJ::GetDecomposition ( Rotation3D &  r,
Vector v 
) const

Get the rotation and translation vector representing the 3D transformation

Definition at line 145 of file Transform3DPJ.cc.

References fM, kDX, kDY, kDZ, kXX, kXY, kXZ, kYX, kYY, kYZ, kZX, kZY, kZZ, operator()(), AlCaHLTBitMon_ParallelJobs::p, alignCSCRings::r, and protons_cff::t.

Referenced by CrystalPad::CrystalPad(), GetComponents(), and operator()().

template<class ForeignMatrix >
void ROOT::Math::Transform3DPJ::GetTransformMatrix ( ForeignMatrix &  m) const
inline

Get components into a linear algebra matrix of size at least 3x4, which must support operator()(i,j) for write access to elements (0,0) thru (2,3).

Definition at line 298 of file Transform3DPJ.h.

References fM, kDX, kDY, kDZ, kXX, kXY, kXZ, kYX, kYY, kYZ, kZX, kZY, kZZ, and funct::m.

Transform3DPJ ROOT::Math::Transform3DPJ::Inverse ( ) const
inline

Return the inverse of the transformation.

Definition at line 442 of file Transform3DPJ.h.

References Invert(), and protons_cff::t.

442  {
443  Transform3DPJ t(*this);
444  t.Invert();
445  return t;
446  }
void ROOT::Math::Transform3DPJ::Invert ( )

Invert the transformation in place

Definition at line 114 of file Transform3DPJ.cc.

References MessageLogger_cfi::cerr, fM, kDX, kDY, kDZ, kXX, kXY, kXZ, kYX, kYY, kYZ, kZX, kZY, kZZ, and SetComponents().

Referenced by Inverse(), and operator*().

115 {
116  //
117  // Name: Transform3DPJ::inverse Date: 24.09.96
118  // Author: E.Chernyaev (IHEP/Protvino) Revised:
119  //
120  // Function: Find inverse affine transformation.
121 
122  double detxx = fM[kYY]*fM[kZZ] - fM[kYZ]*fM[kZY];
123  double detxy = fM[kYX]*fM[kZZ] - fM[kYZ]*fM[kZX];
124  double detxz = fM[kYX]*fM[kZY] - fM[kYY]*fM[kZX];
125  double det = fM[kXX]*detxx - fM[kXY]*detxy + fM[kXZ]*detxz;
126  if (det == 0) {
127  std::cerr << "Transform3DPJ::inverse error: zero determinant" << std::endl;
128  return;
129  }
130  det = 1./det; detxx *= det; detxy *= det; detxz *= det;
131  double detyx = (fM[kXY]*fM[kZZ] - fM[kXZ]*fM[kZY] )*det;
132  double detyy = (fM[kXX]*fM[kZZ] - fM[kXZ]*fM[kZX] )*det;
133  double detyz = (fM[kXX]*fM[kZY] - fM[kXY]*fM[kZX] )*det;
134  double detzx = (fM[kXY]*fM[kYZ] - fM[kXZ]*fM[kYY] )*det;
135  double detzy = (fM[kXX]*fM[kYZ] - fM[kXZ]*fM[kYX] )*det;
136  double detzz = (fM[kXX]*fM[kYY] - fM[kXY]*fM[kYX] )*det;
138  (detxx, -detyx, detzx, -detxx*fM[kDX]+detyx*fM[kDY]-detzx*fM[kDZ],
139  -detxy, detyy, -detzy, detxy*fM[kDX]-detyy*fM[kDY]+detzy*fM[kDZ],
140  detxz, -detyz, detzz, -detxz*fM[kDX]+detyz*fM[kDY]-detzz*fM[kDZ]);
141 }
void SetComponents(IT begin, IT end)
bool ROOT::Math::Transform3DPJ::operator!= ( const Transform3DPJ rhs) const
inline

Definition at line 468 of file Transform3DPJ.h.

References AssignFrom(), operator==(), and SetIdentity().

468  {
469  return ! operator==(rhs);
470  }
bool operator==(const Transform3DPJ &rhs) const
Point ROOT::Math::Transform3DPJ::operator() ( const Point p) const

Transformation operation for Position Vector in Cartesian coordinate

Referenced by GetComponents(), GetDecomposition(), operator()(), operator*(), and Transform().

XYZVector ROOT::Math::Transform3DPJ::operator() ( const Vector v) const

Transformation operation for Displacement Vectors in Cartesian coordinate For the Displacement Vectors only the rotation applies - no translations

Definition at line 169 of file Transform3DPJ.cc.

References GetDecomposition(), alignCSCRings::r, and protons_cff::t.

170 {
171  // pass through rotation class ( could be implemented directly to be faster)
172 
173  Rotation3D r;
174  XYZVector t;
175  GetDecomposition(r, t);
176  // only rotation
177  return r(v);
178 }
void GetDecomposition(Rotation3D &r, Vector &v) const
math::XYZVector XYZVector
Definition: RawParticle.h:28
template<class CoordSystem >
PositionVector3D<CoordSystem> ROOT::Math::Transform3DPJ::operator() ( const PositionVector3D< CoordSystem > &  p) const
inline

Transformation operation for Position Vector in any coordinate system

Definition at line 357 of file Transform3DPJ.h.

References operator()().

357  {
358  Point xyzNew = operator() ( Point(p) );
359  return PositionVector3D<CoordSystem> (xyzNew);
360  }
PositionVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > Point
Definition: Transform3DPJ.h:67
Point operator()(const Point &p) const
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:55
template<class CoordSystem >
DisplacementVector3D<CoordSystem> ROOT::Math::Transform3DPJ::operator() ( const DisplacementVector3D< CoordSystem > &  v) const
inline

Transformation operation for Displacement Vector in any coordinate system

Definition at line 366 of file Transform3DPJ.h.

References operator()().

366  {
367  Vector xyzNew = operator() ( Vector(v) );
368  return DisplacementVector3D<CoordSystem> (xyzNew);
369  }
DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > Vector
Definition: Transform3DPJ.h:66
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
Point operator()(const Point &p) const
template<class CoordSystem >
LorentzVector<CoordSystem> ROOT::Math::Transform3DPJ::operator() ( const LorentzVector< CoordSystem > &  q) const
inline

Transformation operation for a Lorentz Vector in any coordinate system

Definition at line 394 of file Transform3DPJ.h.

References operator()().

394  {
395  Vector xyzNew = operator() ( Vector(q.Vect() ) );
396  return LorentzVector<CoordSystem> (xyzNew.X(), xyzNew.Y(), xyzNew.Z(), q.E() );
397  }
DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > Vector
Definition: Transform3DPJ.h:66
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
math::XYZTLorentzVector LorentzVector
Point operator()(const Point &p) const
Plane3D ROOT::Math::Transform3DPJ::operator() ( const Plane3D plane) const

Transformation on a 3D plane

Definition at line 257 of file Transform3DPJ.cc.

References edmIntegrityCheck::d, gen::n, and AlCaHLTBitMon_ParallelJobs::p.

258 {
259  // transformations on a 3D plane
260  XYZVector n = plane.Normal();
261  // take a point on the plane. Use origin projection on the plane
262  // ( -ad, -bd, -cd) if (a**2 + b**2 + c**2 ) = 1
263  double d = plane.HesseDistance();
264  XYZPoint p( - d * n.X() , - d *n.Y(), -d *n.Z() );
265  return Plane3D ( operator() (n), operator() (p) );
266 }
math::XYZVector XYZPoint
math::XYZVector XYZVector
Definition: RawParticle.h:28
ROOT::Math::Plane3D Plane3D
template<class AVector >
AVector ROOT::Math::Transform3DPJ::operator* ( const AVector &  v) const
inline

Transformation operation for Vectors. Apply same rules as operator() depending on type of vector. Will work only for DisplacementVector3D, PositionVector3D and LorentzVector

Definition at line 414 of file Transform3DPJ.h.

References operator()(), operator*=(), and protons_cff::t.

414  {
415  return operator() (v);
416  }
Point operator()(const Point &p) const
Transform3DPJ ROOT::Math::Transform3DPJ::operator* ( const Transform3DPJ t) const
inline

multiply (combine) two transformations

Definition at line 428 of file Transform3DPJ.h.

References Invert(), protons_cff::t, and tmp.

428  {
429  Transform3DPJ tmp(*this);
430  tmp*= t;
431  return tmp;
432  }
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
Transform3DPJ & ROOT::Math::Transform3DPJ::operator*= ( const Transform3DPJ t)

multiply (combine) with another transformation in place

Definition at line 180 of file Transform3DPJ.cc.

References fM, kDX, kDY, kDZ, kXX, kXY, kXZ, kYX, kYY, kYZ, kZX, kZY, kZZ, and SetComponents().

Referenced by operator*().

181 {
182  // combination of transformations
183 
184  SetComponents(fM[kXX]*t.fM[kXX]+fM[kXY]*t.fM[kYX]+fM[kXZ]*t.fM[kZX],
185  fM[kXX]*t.fM[kXY]+fM[kXY]*t.fM[kYY]+fM[kXZ]*t.fM[kZY],
186  fM[kXX]*t.fM[kXZ]+fM[kXY]*t.fM[kYZ]+fM[kXZ]*t.fM[kZZ],
187  fM[kXX]*t.fM[kDX]+fM[kXY]*t.fM[kDY]+fM[kXZ]*t.fM[kDZ]+fM[kDX],
188 
189  fM[kYX]*t.fM[kXX]+fM[kYY]*t.fM[kYX]+fM[kYZ]*t.fM[kZX],
190  fM[kYX]*t.fM[kXY]+fM[kYY]*t.fM[kYY]+fM[kYZ]*t.fM[kZY],
191  fM[kYX]*t.fM[kXZ]+fM[kYY]*t.fM[kYZ]+fM[kYZ]*t.fM[kZZ],
192  fM[kYX]*t.fM[kDX]+fM[kYY]*t.fM[kDY]+fM[kYZ]*t.fM[kDZ]+fM[kDY],
193 
194  fM[kZX]*t.fM[kXX]+fM[kZY]*t.fM[kYX]+fM[kZZ]*t.fM[kZX],
195  fM[kZX]*t.fM[kXY]+fM[kZY]*t.fM[kYY]+fM[kZZ]*t.fM[kZY],
196  fM[kZX]*t.fM[kXZ]+fM[kZY]*t.fM[kYZ]+fM[kZZ]*t.fM[kZZ],
197  fM[kZX]*t.fM[kDX]+fM[kZY]*t.fM[kDY]+fM[kZZ]*t.fM[kDZ]+fM[kDZ]);
198 
199  return *this;
200 }
void SetComponents(IT begin, IT end)
template<class ForeignMatrix >
Transform3DPJ& ROOT::Math::Transform3DPJ::operator= ( const ForeignMatrix &  m)
inline

Construct from a linear algebra matrix of size at least 3x4, which must support operator()(i,j) to obtain elements (0,0) thru (2,3). The 3x3 sub-block is assumed to be the rotation part and the translations vector are described by the 4-th column

Definition at line 234 of file Transform3DPJ.h.

References SetComponents().

234  {
235  SetComponents(m);
236  return *this;
237  }
void SetComponents(IT begin, IT end)
bool ROOT::Math::Transform3DPJ::operator== ( const Transform3DPJ rhs) const
inline

Equality/inequality operators

Definition at line 452 of file Transform3DPJ.h.

References fM.

Referenced by operator!=().

452  {
453  if( fM[0] != rhs.fM[0] ) return false;
454  if( fM[1] != rhs.fM[1] ) return false;
455  if( fM[2] != rhs.fM[2] ) return false;
456  if( fM[3] != rhs.fM[3] ) return false;
457  if( fM[4] != rhs.fM[4] ) return false;
458  if( fM[5] != rhs.fM[5] ) return false;
459  if( fM[6] != rhs.fM[6] ) return false;
460  if( fM[7] != rhs.fM[7] ) return false;
461  if( fM[8] != rhs.fM[8] ) return false;
462  if( fM[9] != rhs.fM[9] ) return false;
463  if( fM[10]!= rhs.fM[10] ) return false;
464  if( fM[11]!= rhs.fM[11] ) return false;
465  return true;
466  }
template<class IT >
void ROOT::Math::Transform3DPJ::SetComponents ( IT  begin,
IT  end 
)
inline

Set the 12 matrix components given an iterator to the start of the desired data, and another to the end (12 past start).

Definition at line 248 of file Transform3DPJ.h.

References begin, fM, and mps_fire::i.

Referenced by Invert(), operator*=(), operator=(), and Transform3DPJ().

248  {
249  for (int i = 0; i <12; ++i) {
250  fM[i] = *begin;
251  ++begin;
252  }
253  assert (end==begin);
254  }
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
void ROOT::Math::Transform3DPJ::SetComponents ( double  xx,
double  xy,
double  xz,
double  dx,
double  yx,
double  yy,
double  yz,
double  dy,
double  zx,
double  zy,
double  zz,
double  dz 
)
inline

Set the components from 12 scalars

Definition at line 309 of file Transform3DPJ.h.

References PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, fM, kDX, kDY, kDZ, kXX, kXY, kXZ, kYX, kYY, kYZ, kZX, kZY, kZZ, geometryCSVtoXML::xx, geometryCSVtoXML::xy, geometryCSVtoXML::xz, geometryCSVtoXML::yy, geometryCSVtoXML::yz, and geometryCSVtoXML::zz.

void ROOT::Math::Transform3DPJ::SetIdentity ( )
protected

Set identity transformation (identity rotation , zero translation)

Definition at line 202 of file Transform3DPJ.cc.

References fM, kDX, kDY, kDZ, kXX, kXY, kXZ, kYX, kYY, kYZ, kZX, kZY, and kZZ.

Referenced by operator!=(), and Transform3DPJ().

template<class ForeignMatrix >
void ROOT::Math::Transform3DPJ::SetTransformMatrix ( const ForeignMatrix &  m)
inline

Set components from a linear algebra matrix of size at least 3x4, which must support operator()(i,j) to obtain elements (0,0) thru (2,3). The 3x3 sub-block is assumed to be the rotation part and the translations vector are described by the 4-th column

Definition at line 285 of file Transform3DPJ.h.

References fM, kDX, kDY, kDZ, kXX, kXY, kXZ, kYX, kYY, kYZ, kZX, kZY, kZZ, and funct::m.

template<class CoordSystem , class Tag1 , class Tag2 >
void ROOT::Math::Transform3DPJ::Transform ( const PositionVector3D< CoordSystem, Tag1 > &  p1,
PositionVector3D< CoordSystem, Tag2 > &  p2 
) const
inline

Transformation operation for points between different coordinate system tags

Definition at line 375 of file Transform3DPJ.h.

References operator()().

375  {
376  Point xyzNew = operator() ( Point(p1.X(), p1.Y(), p1.Z()) );
377  p2.SetXYZ( xyzNew.X(), xyzNew.Y(), xyzNew.Z() );
378  }
PositionVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > Point
Definition: Transform3DPJ.h:67
double p2[4]
Definition: TauolaWrapper.h:90
Point operator()(const Point &p) const
double p1[4]
Definition: TauolaWrapper.h:89
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:55
template<class CoordSystem , class Tag1 , class Tag2 >
void ROOT::Math::Transform3DPJ::Transform ( const DisplacementVector3D< CoordSystem, Tag1 > &  v1,
DisplacementVector3D< CoordSystem, Tag2 > &  v2 
) const
inline

Transformation operation for Displacement Vector of different coordinate systems

Definition at line 385 of file Transform3DPJ.h.

References operator()().

385  {
386  Vector xyzNew = operator() ( Vector(v1.X(), v1.Y(), v1.Z() ) );
387  v2.SetXYZ( xyzNew.X(), xyzNew.Y(), xyzNew.Z() );
388  }
DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > Vector
Definition: Transform3DPJ.h:66
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
Point operator()(const Point &p) const

Member Data Documentation

double ROOT::Math::Transform3DPJ::fM[12]
private