LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
geo_vectors.h File Reference

Definitions of geometry vector data types. More...

#include "Math/GenVector/CoordinateSystemTags.h"
#include "Math/GenVector/Cartesian3D.h"
#include "Math/GenVector/PositionVector3D.h"
#include "Math/GenVector/DisplacementVector3D.h"
#include "Math/GenVector/Rotation3D.h"
#include "RVersion.h"

Go to the source code of this file.

Namespaces

 geo
 Namespace collecting geometry-related classes utilities.
 

Macros

#define GENVECTOR_CONSTEXPR
 A declaration is made constexpr if GenVector supports it. More...
 

Typedefs

Generic vector types.
template<typename T , typename C = ROOT::Math::GlobalCoordinateSystemTag>
using geo::GenVector3DBase_t = ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< T >, C >
 
template<typename T , typename C = ROOT::Math::GlobalCoordinateSystemTag>
using geo::GenPoint3DBase_t = ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< T >, C >
 
template<typename C >
using geo::Vector3DBase_t = GenVector3DBase_t< double, C >
 
template<typename C >
using geo::Point3DBase_t = GenPoint3DBase_t< double, C >
 Type of 3D point with representation in double precision. More...
 

Vector types for the standard LArSoft geometry.

LArSoft geometry provides two main types of vectors in 3D space:

  1. geo::Point_t to describe an absolute position in global coordinates
  2. geo::Vector_t to describe a displacement or direction (or momentum!)

Both vectors are supposed to represent:

  • centimeters in double precision when used on the real geometry space
  • in the global coordinate system, which is represented by the tag geo::GlobalCoords.

These types constitute the basic objects the geometry works with.

All interfaces should support them.

Note
As this requires some transition, please report any interface missing support for these types by opening a "necessary maintenance" request in the LArSoft issue tracker at https://cdcvs.fnal.gov/redmine/projects/larsoft/issues . Even if there are plenty.

The same type of vectors, but in a different coordinate system representation, can be obtained by using geo::Point3DBase_t template:

(geo::Vector3DBase_t is also available). If a single precision vector is desired, the most general geo::GenPoint3DBase_t and geo::GenVector3DBase_t are also available:

using geo::Length_t = double
 Type used for coordinates and distances. They are measured in centimeters. More...
 
using geo::GlobalCoords = ROOT::Math::GlobalCoordinateSystemTag
 Tag for vectors in the global coordinate system. More...
 
using geo::Vector_t = ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag >
 Type for representation of momenta in 3D space. More...
 
using geo::Point_t = ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag >
 Type for representation of position in physical 3D space. More...
 
template<typename CoordSystemTag >
using geo::VectorIn_t = Vector3DBase_t< CoordSystemTag >
 Type for representation of momenta in 3D space. More...
 
template<typename CoordSystemTag >
using geo::PointIn_t = Point3DBase_t< CoordSystemTag >
 Type for representation of positions in 3D space. More...
 
using geo::Rotation_t = ROOT::Math::Rotation3D
 Type for representation of space rotations. More...
 
template<typename Vector = Vector_t>
constexpr Vector geo::Xaxis ()
 Returns a x axis vector of the specified type. More...
 
template<typename Vector = Vector_t>
constexpr Vector geo::Yaxis ()
 Returns a y axis vector of the specified type. More...
 
template<typename Vector = Vector_t>
constexpr Vector geo::Zaxis ()
 Returns a z axis vector of the specified type. More...
 
template<typename Point = Point_t>
constexpr Point geo::origin ()
 Returns a origin position with a point of the specified type. More...
 

Detailed Description

Definitions of geometry vector data types.

Author
Gianluca Petrillo (petri.nosp@m.llo@.nosp@m.fnal..nosp@m.gov)
Date
March 23, 2017

This library depends on ROOT GenVector. In the CET link list in CMakeLists.txt, link to ${ROOT_GENVECTOR}.

Additional utilities are available from geo_vectors_utils.h.

Definition in file geo_vectors.h.

Macro Definition Documentation

#define GENVECTOR_CONSTEXPR

A declaration is made constexpr if GenVector supports it.

This macro defines as "constexpr", only if GenVector's vector types can be used as constexpr.

Currently the implementation is quite lame, since it does not autodetect whether GenVector library supports the feature or not, and it assumes it doesn't. So this becomes basically a placeholder to remind the maintainers to replace it with an actual constexpr when that will be supported. To make maintainers not forget this, it will explode on each new ROOT version.

A feature request to ROOT was opened as JIRA 9320.

See also Fermilab Redmine issue #19476 (https://cdcvs.fnal.gov/redmine/issues/19476).

Definition at line 47 of file geo_vectors.h.