Classes | |
struct | CalculateCompressedSize |
struct | CalculateCompressedSize< 1 > |
struct | Vector3DComparer |
struct | VectorVector3DComparer |
Typedefs | |
typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > | MatrixX |
typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > | SymMatrixX |
typedef Eigen::Matrix< double, Eigen::Dynamic, 1 > | VectorX |
typedef Eigen::Quaternion< double > | Rotation3D |
typedef Eigen::Translation < double, 3 > | Translation3D |
typedef Eigen::AngleAxisd | AngleAxis3D |
typedef Eigen::Affine3d | Transform3D |
typedef Eigen::Matrix< double, 3, 1 > | Vector3D |
typedef Eigen::Matrix< double, 2, 1 > | Vector2D |
typedef Eigen::Matrix< double, 3, 3 > | RotationMatrix3D |
typedef std::set < Amg::Vector3D, Vector3DComparer > | SetVector3D |
typedef std::set< std::vector < Amg::Vector3D > , VectorVector3DComparer > | SetVectorVector3D |
Enumerations | |
enum | AxisDefs { x = 0, y = 1, z = 2, px = 0, py = 1, pz = 2 } |
Functions | |
double | error (const Amg::MatrixX &mat, int index) |
template<int N> | |
double | error (const AmgSymMatrix(N)&mat, int index) |
template<int N> | |
void | compress (const AmgSymMatrix(N)&covMatrix, std::vector< float > &vec) |
void | compress (const MatrixX &covMatrix, std::vector< float > &vec) |
template<int N> | |
void | expand (std::vector< float >::const_iterator it, std::vector< float >::const_iterator, AmgSymMatrix(N)&covMatrix) |
void | expand (std::vector< float >::const_iterator it, std::vector< float >::const_iterator it_end, MatrixX &covMatrix) |
template<int N> | |
double | largestDifference (const AmgSymMatrix(N)&m1, const AmgSymMatrix(N)&m2, bool relative=false) |
template<int N> | |
int | largestDifference (const AmgVector(N)&m1, const AmgVector(N)&m2, bool relative=false) |
template<int N> | |
std::pair< int, int > | compare (const AmgSymMatrix(N)&m1, const AmgSymMatrix(N)&m2, double precision=1e-9, bool relative=false) |
template<int N> | |
int | compare (const AmgVector(N)&m1, const AmgVector(N)&m2, double precision=1e-9, bool relative=false) |
template<int N> | |
bool | isSymMatrix (const AmgSymMatrix(N)&m) |
double | roundWithPrecision (double val, int precision) |
std::string | toString (const MatrixX &matrix, int precision=4, std::string offset="") |
std::string | toString (const CLHEP::HepGenMatrix &matrix, int precision=4, std::string offset="") |
template<class T > | |
std::string | AsString (const T &m) |
Amg::Transform3D | CLHEPTransformToEigen (const HepGeom::Transform3D &CLHEPtransf) |
RotationMatrix3D | CLHEPRotationToEigen (const CLHEP::HepRotation &CLHEProtation) |
Translation3D | CLHEPTranslationToEigen (const CLHEP::Hep3Vector &CLHEPtranslation) |
Amg::Transform3D | CLHEPTranslate3DToEigen (const HepGeom::Translate3D &CLHEPtranslate3D) |
HepGeom::Transform3D | EigenTransformToCLHEP (const Amg::Transform3D &eigenTransf) |
Amg::Vector3D | Hep3VectorToEigen (const CLHEP::Hep3Vector &CLHEPvector) |
CLHEP::Hep3Vector | EigenToHep3Vector (const Amg::Vector3D &eigenvector) |
Amg::Vector3D | convert_CLHEPPhiThetaPsi_to_EigenEulerAngles (Amg::Vector3D clhep_angles, int convention=0) |
Amg::Vector3D | convert_EigenEulerAngles_to_CLHEPPhiThetaPsi (Amg::Vector3D eigen_angles, int convention=0) |
Amg::Vector3D | getPhiThetaPsi (Amg::RotationMatrix3D mat, int convention=0) |
Amg::RotationMatrix3D | setPhi (Amg::RotationMatrix3D mat, double angle, int convention=0) |
double | angle (const Amg::Vector3D &v1, const Amg::Vector3D &v2) |
float | distance2 (const Amg::Vector3D &p1, const Amg::Vector3D &p2) |
float | distance (const Amg::Vector3D &p1, const Amg::Vector3D &p2) |
void | setPhi (Amg::Vector3D &v, double phi) |
void | setThetaPhi (Amg::Vector3D &v, double theta, double phi) |
void | setRThetaPhi (Amg::Vector3D &v, double r, double theta, double phi) |
void | setTheta (Amg::Vector3D &v, double theta) |
void | setPerp (Amg::Vector3D &v, double perp) |
void | setMag (Amg::Vector3D &v, double mag) |
double | deltaPhi (const Amg::Vector3D &v1, const Amg::Vector3D &v2) |
double | deltaR (const Amg::Vector3D &v1, const Amg::Vector3D &v2) |
void | setVector3DCartesian (Amg::Vector3D &v1, double x1, double y1, double z1) |
double | mag2Vector3D (const Amg::Vector3D &v1) |
double | magVector3D (const Amg::Vector3D &v1) |
double | rVector3D (const Amg::Vector3D &v1) |
Amg::Vector3D | transform (Amg::Vector3D &v, Amg::Transform3D &tr) |
Amg::Transform3D | getTransformFromRotTransl (Amg::RotationMatrix3D rot, Amg::Vector3D transl_vec) |
void | getAngleAxisFromRotation (Amg::RotationMatrix3D &rotation, double &rotationAngle, Amg::Vector3D &rotationAxis) |
Amg::Vector3D | getTranslationVectorFromTransform (const Amg::Transform3D &tr) |
Amg::Rotation3D | getRotation3DfromAngleAxis (double angle, Amg::Vector3D &axis) |
Amg::Transform3D | getRotateX3D (double angle) |
Amg::Transform3D | getRotateY3D (double angle) |
Amg::Transform3D | getRotateZ3D (double angle) |
std::string | toString (const Amg::Translation3D &translation, int precision=4) |
std::string | toString (const Amg::Transform3D &transform, int precision=4, std::string offset="") |
std::string | toString (const CLHEP::HepRotation &rot, int precision=4, std::string offset="") |
std::string | toString (const CLHEP::Hep3Vector &translation, int precision=4) |
std::string | toString (const CLHEP::Hep2Vector &translation, int precision=4) |
std::string | toString (const HepGeom::Transform3D &transf, int precision=4, std::string offset="") |
Event primitives helper functions
Definition of ATLAS Math & Geometry primitives (Amg)
This is based on the Eigen geometry module: http://eigen.tuxfamily.org/dox/group__Geometry__Module.html
Geometry primitives helper functions
typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> Amg::MatrixX |
Dynamic Matrix - not recommended
typedef Eigen::Matrix<double, Eigen::Dynamic, 1> Amg::VectorX |
Dynamic Vector - not recommended
enum Amg::AxisDefs |
elment for code readability
double Amg::angle | ( | const Amg::Vector3D & | v1, | |
const Amg::Vector3D & | v2 | |||
) | [inline] |
calculates the opening angle between two vectors
std::string Amg::AsString | ( | const T & | m | ) | [inline] |
write an Amg Eigen object to std::string
int Amg::compare | ( | const AmgVector(N)& | m1, | |
const AmgVector(N)& | m2, | |||
double | precision = 1e-9 , |
|||
bool | relative = false | |||
) | [inline] |
compare two vectors, returns the indices of the first element that fails the condition, returns <-1,-1> if all is ok Users can provide the required precision and whether the difference should be evaluate relative to the values or absolutely
std::pair<int, int> Amg::compare | ( | const AmgSymMatrix(N)& | m1, | |
const AmgSymMatrix(N)& | m2, | |||
double | precision = 1e-9 , |
|||
bool | relative = false | |||
) | [inline] |
compare two matrices, returns the indices of the first element that fails the condition, returns <-1,-1> if all is ok Users can provide the required precision and whether the difference should be evaluate relative to the values or absolutely
Amg::Vector3D Amg::convert_CLHEPPhiThetaPsi_to_EigenEulerAngles | ( | Amg::Vector3D | clhep_angles, | |
int | convention = 0 | |||
) | [inline] |
Convert CLEHP Phi,Theta,Psi angles to Eigen euler angles using Z-X-Z convention
N.B. if "convention = 0" --> "Z-X-Z" convention ==> DEFAULT!! if "convention = 1" --> "Z-Y-Z"
Amg::Vector3D Amg::convert_EigenEulerAngles_to_CLHEPPhiThetaPsi | ( | Amg::Vector3D | eigen_angles, | |
int | convention = 0 | |||
) | [inline] |
Convert Eigen euler angles to CLEHP Phi,Theta,Psi angles
N.B. if "convention = 0" --> "Z-X-Z" convention ==> DEFAULT!! if "convention = 1" --> "Z-Y-Z" convention
Note: as explained in: eigen / Eigen / src / Geometry / EulerAngles.h the returned angles are in the ranges [0:pi]x[-pi:pi]x[-pi:pi]
(source here: https://bitbucket.org/eigen/eigen/src/42e011583bceb055a43fa688622e828fbbabf818/Eigen/src/Geometry/EulerAngles.h)
N.B.!! CLHEP's Phi, Theta, Psi correspond to eulerAngles[2], [1] and [0] respectively, with the sign inverted.
float Amg::distance | ( | const Amg::Vector3D & | p1, | |
const Amg::Vector3D & | p2 | |||
) | [inline] |
calculates the distance between two point in 3D space
float Amg::distance2 | ( | const Amg::Vector3D & | p1, | |
const Amg::Vector3D & | p2 | |||
) | [inline] |
calculates the squared distance between two point in 3D space
double Amg::error | ( | const Amg::MatrixX & | mat, | |
int | index | |||
) | [inline] |
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in range
Amg::Vector3D Amg::getPhiThetaPsi | ( | Amg::RotationMatrix3D | mat, | |
int | convention = 0 | |||
) | [inline] |
Get the equivalents to CLHEP Phi, Theta, Psi Euler angles
phi = vector[0] theta = vector[1] psi = vector[2]
N.B. if "convention = 0" --> "Z-X-Z" convention ==> DEFAULT!! if "convention = 1" --> "Z-Y-Z" convention
N.B.!! for normal usage, use the default notation (simply leave it empty, or use convention=0), or, alternatively, be sure to use the same convention in both setPhi() and getPhiThetaPsi().
we extract the Euler Angles from the Eigen matrix,
Amg::Transform3D Amg::getRotateX3D | ( | double | angle | ) | [inline] |
get a rotation transformation around X-axis
Amg::Transform3D Amg::getRotateY3D | ( | double | angle | ) | [inline] |
get a rotation transformation around Y-axis
Amg::Transform3D Amg::getRotateZ3D | ( | double | angle | ) | [inline] |
get a rotation transformation around Z-axis
Amg::Rotation3D Amg::getRotation3DfromAngleAxis | ( | double | angle, | |
Amg::Vector3D & | axis | |||
) | [inline] |
get a AngleAxis from an angle and an axis.
to replace the CLHEP constructor: CLHEP::Rotate3D::Rotate3D(double a, cconst Vector3D< double > & v)
Amg::Vector3D Amg::getTranslationVectorFromTransform | ( | const Amg::Transform3D & | tr | ) | [inline] |
Get the Translation vector out of a Transformation
int Amg::largestDifference | ( | const AmgVector(N)& | m1, | |
const AmgVector(N)& | m2, | |||
bool | relative = false | |||
) | [inline] |
get largest difference betweem two vectors Users can decide whether the difference should be evaluate relative to the values or absolutely
double Amg::largestDifference | ( | const AmgSymMatrix(N)& | m1, | |
const AmgSymMatrix(N)& | m2, | |||
bool | relative = false | |||
) | [inline] |
get largest difference between two matrices Users can decide whether the difference should be evaluate relative to the values or absolutely
double Amg::mag2Vector3D | ( | const Amg::Vector3D & | v1 | ) | [inline] |
Gets magnitude squared of the vector.
double Amg::magVector3D | ( | const Amg::Vector3D & | v1 | ) | [inline] |
Gets magnitude of the vector.
double Amg::roundWithPrecision | ( | double | val, | |
int | precision | |||
) | [inline] |
EventPrimitvesToStringConverter
inline methods for conversion of EventPrimitives (Matrix) to std::string.
This is to enhance formatted screen ouput and for ASCII based testing.
The offset can be used to offset the lines (starting from line 2) wrt to the zero position for formatting reasons.
double Amg::rVector3D | ( | const Amg::Vector3D & | v1 | ) | [inline] |
Gets r-component in spherical coordinate system
void Amg::setMag | ( | Amg::Vector3D & | v, | |
double | mag | |||
) | [inline] |
scales the vector length without changing the angles
void Amg::setPerp | ( | Amg::Vector3D & | v, | |
double | perp | |||
) | [inline] |
scales the vector in the xy plane without changing the z coordinate nor the angles
void Amg::setPhi | ( | Amg::Vector3D & | v, | |
double | phi | |||
) | [inline] |
sets the phi angle of a vector without changing theta nor the magnitude
void Amg::setRThetaPhi | ( | Amg::Vector3D & | v, | |
double | r, | |||
double | theta, | |||
double | phi | |||
) | [inline] |
sets radius, the theta and phi angle of a vector. Angles are measured in RADIANS
void Amg::setTheta | ( | Amg::Vector3D & | v, | |
double | theta | |||
) | [inline] |
sets the theta of a vector without changing phi nor the magnitude
void Amg::setThetaPhi | ( | Amg::Vector3D & | v, | |
double | theta, | |||
double | phi | |||
) | [inline] |
sets the theta and phi angle of a vector without changing the magnitude
void Amg::setVector3DCartesian | ( | Amg::Vector3D & | v1, | |
double | x1, | |||
double | y1, | |||
double | z1 | |||
) | [inline] |
Sets components in cartesian coordinate system.
std::string Amg::toString | ( | const Amg::Translation3D & | translation, | |
int | precision = 4 | |||
) | [inline] |
GeoPrimitvesToStringConverter
static methods for conversion of GeoPrimitives and will call the EventPrimitives converter (Matrix) to std::string.
This is to enhance formatted screen ouput and for ASCII based testing.
The offset can be used to offset the lines (starting from line 2) wrt to the zero position for formatting reasons.
Amg::Vector3D Amg::transform | ( | Amg::Vector3D & | v, | |
Amg::Transform3D & | tr | |||
) | [inline] |
Transform a point from a Trasformation3D
from CLHEP::Point3D::transform: http://proj-clhep.web.cern.ch/proj-clhep/doc/CLHEP_2_0_4_7/doxygen/html/Point3D_8cc-source.html#l00032