Skip to content
Snippets Groups Projects
Commit b6358ef7 authored by Lorenzo Moneta's avatar Lorenzo Moneta
Browse files

Fixes to documentation of Doxygen pages

parent e7dcb0aa
Branches
Tags
No related merge requests found
/**
The %ROOT Mathematical Libraries.
See the \subpage MathPage "Mathematical Libraries" description page.
\defgroup Math Math
\brief The %ROOT Mathematical Libraries.
See the \subpage MathPage "Mathematical Libraries" description page.
\page MathPage The ROOT Mathematical Libraries
......
......@@ -9,16 +9,19 @@ These 2D,3D and 4D vectors are different from vectors of the Linear Algebra pack
In contrast to CLHEP or the %ROOT physics libraries, GenVector provides class templates for modelling the vectors. There is a user-controlled freedom on how the vector is internally represented. This is expressed by a choice of coordinate system which is supplied as a template prameter when the vector is constructed. Furthermore each coordinate system is itself a template, so that the user can specify the underlying scalar type.
In more detail, the main characteristics of GenVector are:
* #### Optimal runtime performances
* **Optimal runtime performances**
We try to minimize any overhead in the run-time performances. We have deliberatly avoided to have any virtual function and even virtual destructors in the classes and have inlined as much as possible all the functions. For this reason, we have chosen to use template classes to implement the GenVector concepts instead of abstract or base classes and virtual functions.
* #### Points and Vector concept
We try to minimize any overhead in the run-time performances. We have deliberatly avoided to have any virtual function and even virtual destructors in the classes and have inlined as much as
possible all the functions. For this reason, we have chosen to use template classes to implement the GenVector concepts instead of abstract or base classes and virtual functions.
* **Points and Vector concept**
Mathematically vectors and points are two distinct concepts. They have different transformations, like vectors only rotate while points rotate and translate. You can add two vectors but not two points and the difference between two points is a vector. We then distinguish for the 2 and 3 dimensional case, between points and vectors, modeling them with different classes:
* ROOT::Math::DisplacementVector3D and ROOT::Math::DisplacementVector2D template classes describing 3 and 2 component direction and magnitude vectors, not rooted at any particular point;
* ROOT::Math::PositionVector3D template and ROOT::Math::PositionVector3D class modeling the points in 3 and 2 dimensions
For the 4D space-time vectors, we use the same class to model them, ROOT::Math::LorentzVector, since we have recognized a limited needs for modeling the functionality of a 4D point.
* #### Generic Coordinate System
* **Generic Coordinate System**
The vector classes are based on a generic type of coordinate system, expressed as a template parameter of the class. Various classes exist to describe the various coordinates systems:
* **2D coordinate system** classes:
......@@ -37,14 +40,16 @@ In more detail, the main characteristics of GenVector are:
Users can define the Vectors according to the coordinate type which is most efficient for their use. Transformations between the various coordinate systems are available through copy constructors or the assignment _(=)_ operator.
For maximum flexibility and minimize in some use case memory allocation, the coordinate system classes are templated on the scalar type. To avoid exposing templated parameter to the users, typedefs are defined for all types of vectors based an double's.
See the \ref Vector3DPage "3D Vector", \ref Point3DPage "3D Point", \ref Vector2DPage "2D Vector and Point", and \ref LorentzVectorPage "LorentzVector" classes for all the possible types of vector classes which can be constructed by the user with the available coordinate system types.
* #### Coordinate System Tag
* **Coordinate System Tag**
The 2D and 3D points and vector classes can be associated to a tag defining the coordinate system. This can be used to distinguish between vectors of different coordinate systems like global or local vectors. The coordinate system tag is a template parameter of the ROOT::Math::DisplacementVector3D (and ROOT::Math::DisplacementVector2D) and ROOT::Math::PositionVector3D (and ROOT::Math::PositionVector2D) classes. A default tag, ROOT::Math::DefaultCoordinateSystemTag, exists for users who don't need this functionality.
* ### Transformations
* **Transformations**
The transformations are modeled using simple (non-template) classes, using double as the scalar type to avoid too large numerical errors. The transformations are grouped in Rotations (in 3 dimensions), Lorentz transformations and Poincarre transformations, which are Translation/Rotation combinations. Each group has several members which may model physically equivalent trasformations but with different internal representations. Transformation classes can operate on all type of vectors using the _operator()_ or the _operator *_ and the transformations can also be combined via the _operator *_. In more detail the transformations available are:
* #### 3D Rotations classes
* **3D Rotations classes**
* Rotation described by a 3x3 matrix (ROOT::Math::Rotation3D)
* Rotation described by Euler angles, Goldstein representation, (ROOT::Math::EulerAngles)
......@@ -52,11 +57,11 @@ In more detail, the main characteristics of GenVector are:
* Rotation described by a direction axis and an angle (ROOT::Math::AxisAngle)
* Rotation described by a quaternion (ROOT::Math::Quaternion)
* Optimized rotation around the x (ROOT::Math::RotationX), y (ROOT::Math::RotationY) and z (ROOT::Math::RotationZ) axis and described by just one angle.
* #### 3D Transformation
* **3D Transformation**
We describe the transformations defined as a composition between a rotation and a translation using the class ROOT::Math::Transform3D. It is important to note that transformations act differently on Vectors and Points. The Vectors only rotate, therefore when applying a transfomation (rotation + translation) on a Vector, only the rotation operates while the translation has no effect. The interface for Transformations is similar to the one used in the CLHEP Geometry package (class [Transform3D](http://www.hep.phy.cam.ac.uk/lhcb/doc/CLHEP/1.9.1.2/html/classHepGeom_1_1Transform3D.html)).
A class, ROOT::Math::Translation3D. describe transformations consisting of only a translation. Translation can be applied only on Points, applying them on Vector objects has no effect. The Translation3D class can be combined with both ROOT::Math::Rotation3D and ROOT::Math::Transform3D using the _operator *_ to obtain a new transformation as an instance of a Transform3D class.
* #### Lorentz Rotation
* **Lorentz Rotation**
* Generic Lorentz Rotation described by a 4x4 matrix containing a 3D rotation part and a boost part (class ROOT::Math::LorentzRotation)
* A pure boost in an arbitrary direction and described by a 4x4 symmetric matrix or 10 numbers (class ROOT::Math::Boost)
......@@ -64,22 +69,22 @@ In more detail, the main characteristics of GenVector are:
Other main characteristics of the GenVector classes are:
* #### Minimal Vector classes interface
* **Minimal Vector classes interface**
We have tried to keep the interface to a minimal level:
* We try to avoid methods providing the same functionality but with different names ( like getX() and x() ).
* we minimize the number of setter methods, avoiding methods which can be ambigous and set the Vector classes in an inconsistent state. We provide only methods which set all the coordinates at the same time or set only the coordinates on which the vector is based, for example SetX() for a cartesian vector. We then enforce the use of transformations as rotations or translations (additions) for modifying the vector contents.
* The majority of the functionality, which is present in the CLHEP package, involving operations on two vectors, is moved in separated helper functions (see ROOT::Math::VectorUtil). This has the advantage that the basic interface will remain more stable with time while additional functions can be added easily.
* #### Naming Convention
* **Naming Convention**
As part of %ROOT, the GenVector package adheres to the prescribed ROOT naming convention, with some (approved) exceptions, as described here:
* Every class and function is in the _ROOT::Math_ namespace
* Member function names starts with upper-case letter, apart some exceptions (see later CLHEP compatibility)
* #### Compatibility with CLHEP Vector classes
* **Compatibility with CLHEP Vector classes**
* For backward compatibility with CLHEP the Vector classes can be constructed easly from a CLHEP HepVector or HepLorentzVector, by using a template constructor, which requires only that the classes implement the accessors x(), y() and z() (and t() for the 4D).
* we have decided to provide Vector member function with the same naming convention as CLHEP for the most used functions like _x()_, _y()_ and _z()_.
* ### Connection to Linear Algebra package
* **Connection to Linear Algebra package**
In some use cases, like in track reconstruction, it is needed to use the content of the vector and rotation classes in conjunction with linear algebra operations. We prefer to avoid any direct dependency to any Linear algebra package. However, we provide some hooks to convert to and from Linear Algebra classes.
* The vector and the transformation classes have methods which allow to get and set their data members (like SetCoordinates and GetCoordinates ) passing either a generic iterator or a pointer to a contigous set of data, like a C array. This allows a easy connection with linear algebra package which allows creation of matrices using C arrays (like the %ROOT TMatrix classes) or iterators ( SMatrix classes )
......
// LorentzVector doxygen page
/** \page LorentzVectorPage LorentzVector Classes
To avoid exposing templated parameter to the users, typedefs are defined for all types of vectors based an double's and float's. To use them, one must include the header file _Math/Vector4D.h_. The following typedef's, defined in the header file _Math/Vector4Dfwd.h_, are available for the different instantiations of the template class ROOT::Math::LorentzVector:
* ROOT::Math::XYZTVector vector based on x,y,z,t coordinates (cartesian) in double precision
* ROOT::Math::XYZTVectorF vector based on x,y,z,t coordinates (cartesian) in float precision
* ROOT::Math::PtEtaPhiEVector vector based on pt (rho),eta,phi and E (t) coordinates in double precision
* ROOT::Math::PtEtaPhiMVector vector based on pt (rho),eta,phi and M (t) coordinates in double precision
* ROOT::Math::PxPyPzMVector vector based on px,py,pz and M (mass) coordinates in double precision
The metric used for all the LorentzVector's is (-,-,-,+)
#### Constructors and Assignment
The following declarations are available:
<pre>XYZTVector v1; // create an empty vector (x = 0, y = 0, z = 0, t = 0)
XYZTVector v2(1,2,3,4); // create a vector with x=1, y = 2, z = 3, t = 4
PtEtaPhiEVector v3(1,2,PI,5); // create a vector with pt = 1, eta = 2, phi = PI, E = 5
</pre>
Note that each type of vector is constructed by passing its coordinates representations, so a XYZTVector(1,2,3,4) is different from a PtEtaPhiEVector(1,2,3,4).
In addition the Vector classes can be constructed by any vector, which implements the accessors x(), y() and z() and t(). This cann be another ROOT::Math::LorentzVector based on a different coordinate system or even any vector of a different package, like the CLHEP HepLorentzVector that implements the required signature.
<pre>XYZTVector v1(1,2,3,4);
PtEtaPhiEVector v2(v1);
CLHEP::HepLorentzVector q(1,2,3,4);
XYZTVector v3(q)
</pre>
#### Coordinate Accessors
All the same coordinate accessors are available through the interface of the class ROOT::Math::LorentzVector. For example:
<pre>v1.X(); v1.X(); v1.Z(); v1.T() // returns cartesian components for the cartesian vector v1
v2.Px(); v2.Py(); v2.Pz(); v2.E() // returns cartesian components for the cylindrical vector v2
v1.Pt(); v1.Eta(); v1.Phi(); v1.M() // returns other components for the cartesian vector v1
</pre>
In addition, all the 4 coordinates of the vector can be retrieved with the GetCoordinates method:
<pre>double d[4];
v1.GetCoordinates(d); // fill d array with (x,y,z,t) components of v1
v2.GetCoordinates(d); // fill d array with (pt,eta,phi,e) components of v2
std::vector <double>w(4);
v1.GetCoordinates(w.begin(),w.end()); // fill std::vector with (x,y,z,t) components of v1</double> </pre>
To get information on all the coordinate accessors see the reference documentation of ROOT::Math::LorentzVector
#### Setter Methods
One can set only all the three coordinates via:
<pre>v1.SetCoordinates(c1,c2,c3,c4); // sets the (x,y,z,t) for a XYZTVector
v2.SetCoordinates(c1,c2,c3,c4); // sets pt,eta,phi,e for a PtEtaPhiEVector
v2.SetXYZ(x,y,z,t); // sets the 4 cartesian components for the PtEtaPhiEVector
</pre>
Single coordinate setter methods are available for the basic vector coordinates, like SetX() for a XYZTVector or SetPt() for a PtEtaPhiEVector. Attempting to do a SetX() on a non cartesian vector will not compile.
<pre>XYZTVector v1; v1.SetX(1) // OK setting x for a cartesian vector
PtEtaPhiEVector v2; v2.SetX(1) // ERROR: cannot set X for a non-cartesian vector. Method will not compile
v2.SetR(1) // OK setting Pt for a PtEtaPhiEVector vector
</pre>
In addition there are setter methods from C arrays or iterators.
<pre>double d[4] = {1.,2.,3.,4.};
XYZTVector v;
v.SetCoordinates(d); // set (x,y,z,t) components of v using values from d
</pre>
or for example from an std::vector using the iterators
<pre>std::vector <double>w(4);
v.SetCoordinates(w.begin(),w.end()); // set (x,y,z,t) components of v using values from w</double> </pre>
#### Arithmetic Operations
The following operations are possible between LorentzVectors classes, even of different coordinate system types: ( v and w are two LorentzVector of the same type, q is a generic LorentzVector implementing x(), y(), z() and t() and a is a generic scalar type: double, flot, int, etc.... )
<pre>v += q;
v -= q;
v = -q;
v *= a;
v /= a;
w = v + q;
w = v - q;
w = v * a;
w = a * v;
w = v / a;
</pre>
#### Comparison
<pre>v == w;
v != w;
</pre>
#### Other Methods
<pre>a = v.Dot(q); // dot product in metric (+,+,+,-) of two LorentzVector's
XYZVector s = v.Vect() // return the spatial components (x,y,z)
v.Beta(); // return beta and gamma value
v.Gamma() // (vector must be time-like otherwise result is meaningless)
XYZVector b = v.BoostToCM() // return boost vector which will bring the Vector in its mas frame (P=0)
</pre>
*/
......@@ -2,7 +2,7 @@
\defgroup MathCore MathCore
The Core Mathematical Library of %ROOT. See the \ref MathCorePage description page.
\brief The Core Mathematical Library of %ROOT. See the \ref MathCorePage "MathCore" description page.
\ingroup Math
......@@ -26,13 +26,12 @@ The Core Mathematical Library of %ROOT. See the \ref MathCorePage description pa
Note that in this latest release the \ref Vector "GenVector" (physics and geometry vectors for 2,3 and 4 dimensions with their transformations) is not anymore part of MathCore, but is built as a separate library.
MathCore contains instead now classes which were originally part of _libCore_. These include:
* [**<tt>TMath</tt>**](http://root.cern.ch/root/htmldoc/math/mathcore/TMath.html): namespace with mathematical functions and basic function algorithms.
* [**<tt>TComplex</tt>**](http://root.cern.ch/root/htmldoc/TComplex.html): class for complex numbers.
* Random classes: base class [**<tt>TRandom</tt>**](http://root.cern.ch/root/htmldoc/TRandom.html) and the derived classes [<tt>TRandom1</tt>](http://root.cern.ch/root/htmldoc/TRandom1.html), [<tt>TRandom2</tt>](http://root.cern.ch/root/htmldoc/TRandom2.html) and [<tt>TRandom3</tt>](http://root.cern.ch/root/htmldoc/TRandom.html)), implementing the pseudo-random number generators.
* **TMath** : namespace with mathematical functions and basic function algorithms.
* **TComplex**: class for complex numbers.
* Random classes: base class **TRandom** and the derived classes TRandom1, TRandom2 and TRandom3, implementing the pseudo-random number generators.
* Other classes, such as
* TKDTree for partitioning the data using a kd-Tree and TKDTreeBinning for binning data using a kdTree
* ROOT::Math::GoFTest for goodness of fit tests
MathCore and its CINT dictionary is normally built by default in %ROOT. Alternatively MathCore can be built as a stand-alone library (excluding classes like <tt>TComplex</tt> or <tt>TRandom</tt>
having a direct dependency of %ROOT _libCore_), downloading the current version from [here](../MathCore.tar.gz). Note, that the stand-alone library, in contrast to the one distributed by %ROOT, **does
not** contain the dictionary information and therefore cannot be used interactively. To build the stand-alone MathCore library run first the _configure_ script and then _make_. Do _configure --help_
to see options available in configuring, like defining the installation directory. Run also _make install_ to install the library and include files and _make check_ to build the tests.
*/
......@@ -3,7 +3,7 @@
\defgroup MathMore MathMore
The Mathematical library providing some advanced functionality and based on GSL. See the \ref MathMorePage page.
\brief The Mathematical library providing some advanced functionality and based on GSL. See the \ref MathMorePage "MathMore" Library page.
\ingroup Math
......@@ -30,10 +30,7 @@ The mathematical functions are implemented as a set of free functions in the nam
To build MathMore you need to have first GSL installed somewhere in your system. A version of GSL larger or equal 1.8 is required. A tar file of GSL can be downloaded from the [GSL Web site](http://www.gnu.org/software/gsl/#downloading), or (for version 1.8) from [here](http://seal.web.cern.ch/seal/MathLibs/gsl-1.8.tar.gz). Windows binaries, compiled using Visual Studio 7.1 can be downloaded from [this location](http://seal.web.cern.ch/seal/MathLibs/GSL-1.8.zip).
MathMore (and its %ROOT CINT dictionary) can be built within %ROOT whenever a GSL library is found in the system. Optionally the GSL library and header file location can be specified in the %ROOT configure script with _configure --with-gsl-incdir=... --with-gsl-libdir=..._
MathMore can be built also a stand-alone library (without requiring %ROOT) downloding the tar file from the Web. Note that in this case the library will **NOT** contain the dictionary information and therefore cannot be used interactivly.
The current standalone version of MathMore can be downloaded [here](../MathMore.tar.gz).
To build the library run first the script _configure --with-gsl="gsl_dir_location"_ and then _make_. Do _configure --help_ to see options available in configuring, like defining the installation directory. Run also _make install_ to install the library and include files and _make check_ to build the tests.
The source code is distributed under the GNU General Public License.
MathMore links with the GSL static libraries. On some platform (like Linux x86-64) GSL needs to be compiled with the option _--with-pic_.
The source code of MathMore is distributed under the GNU General Public License
*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment