Back to home page

EIC code displayed by LXR

 
 

    


Warning, /acts/docs/plugins/root.rst is written in an unsupported language. File is not indexed.

0001 ROOT plugin
0002 ===========
0003 
0004 General
0005 -------
0006 
0007 The ``Root`` plutin provides geometry and I/O components to ACTS from the ROOT framework.
0008 
0009 
0010 Geometry
0011 --------
0012 
0013 The ``Root`` plugin connects a geometry described with the ``ROOT::Geom`` module with ACTS. This is done by parsing the ROOT geometry and selecting ``TGeoNode`` objects that represent chosen geometrical objects.
0014 ACTS detector elements are represented by surfaces with dedicated shapes, hence a conversion of the volume based ``TGeoNode`` description into ``Acts::Surface`` objects needs to take place.
0015 
0016 An example use of the ``TGeo`` plugin can be found in the ``TGeoDetector`` example.
0017 
0018 Parsing the ROOT Geometry
0019 -------------------------
0020 
0021 Once a geometry is imported in ROOT, it can be accessed via the ``gGeoManager``. The ``Acts::TGeoLayerBuilder``, which implements an ``Acts::ILayerBuilder``, relies on the fact that this ``gGeoManager`` is accessible, if it points to ``nullptr``, obviously no conversion is done.
0022 The ``Acts::TGeoLayerBuilder`` can be configured to search within given parsing ranges for ``TGeoNode`` objects to be converted into ``Acts::Surface`` objects. A vector of search strings can be used for situations where multiple sensor types are used or additional objects are bound to be described.
0023 A dedicated ``Acts::TGeoParser`` struct is then used to select the nodes from the ROOT geometry.
0024 
0025 Conversion of TGeoShapes to Acts::Surfaces
0026 ------------------------------------------
0027 
0028 An automatic translation of ``TGeoShape`` objects into corresponding ``Acts::Surface`` objects with appropriate bound descriptions is done by the ``Acts::TGeoSurfaceConverter`` class.
0029 There is some limited freedom in re-defining the orientation of the coordinate system between ROOT and ACTS which can be used to adapt local coordinate definitions on the converted objects.
0030 This is indicated by the ``const std::string& axes`` argument of the converter.
0031 
0032 The nomenclature/convention is the following:
0033  * the resulting local cartesian coordinate system must by right-handed: this is guaranteed by the fact that the third local axis is constructed as a cross product of the first two local axis
0034  * defining the new local axes with respect to the ``TGeo`` definition is done by naming the new axes in order, e.g. an unchanged coordinate system has the tag ``XYZ``, or ``XY*``, as the third axis is defined by the first two ones
0035  * flipping the direction of a axis is done by lower capital, e.g. ``yZ*`` redefines the negative y-axis of the ``TGeoMatrix`` as the (obviously) positive x-axis of the ``Acts::Transform3`` and redefines the positive z-axis of the ``TGeoMatrix`` as corresponding y-axis of the ``Acts::Transform3``
0036 
0037 In case a translation request is malformed, a ``std::exception`` is thrown, indicating the problem.
0038 
0039 Examples of supported ``TGeoShape`` transformations to ``Acts::Surface`` objects can be found in the ``Tests/UnitTests/Plugins/Root`` unit test suite, a summary of the output can be seen below.
0040 
0041 Additionally, an option exists to split surfaces after the transformation
0042 has taken place by adding a splitter implementation to the ``Acts::TGeoLayerBuilder``, like the ``Acts::TGeoCylinderDiscSplitter``. This can be useful to describe e.g. a cylindrical detector with tangential planar surfaces.
0043 
0044 .. figure:: figures/tgeo/TGeoBBox_PlaneSurface.png
0045   :width: 800
0046 
0047   Conversion of a ``TGeoBBox`` shape into a ``Acts::PlaneSurface`` with ``Acts::RectangleBounds``. All axes iterations are allowed for this conversion.
0048 
0049 .. figure:: figures/tgeo/TGeoTrd1_PlaneSurface.png
0050   :width: 800
0051 
0052   Conversion of a ``TGeoTrd1`` shape into a ``Acts::PlaneSurface`` with ``Acts::TrapezoidBounds``. The axes definitions need to be ``(x/X)(z/Z)(*/*)``.
0053 
0054 .. figure:: figures/tgeo/TGeoTrd2_PlaneSurface_xz.png
0055   :width: 800
0056 
0057   Conversion of a ``TGeoTrd2`` shape into a ``Acts::PlaneSurface`` with ``Acts::TrapezoidBounds``. The axes definitions shown are ``(x/X)(z/Z)(*/*)``, the second coordinate has to be the z-axis.
0058 
0059 .. figure:: figures/tgeo/TGeoTrd2_PlaneSurface_yz.png
0060   :width: 800
0061 
0062   Conversion of a ``TGeoTrd2`` shape into a ``Acts::PlaneSurface`` with ``Acts::TrapezoidBounds``. The axes definitions shown are ``(y/Y)(z/Z)(*/*)``, the second coordinate has to be the z-axis.
0063 
0064 .. figure:: figures/tgeo/TGeoTube_CylinderSurface.png
0065   :width: 800
0066 
0067   Conversion of a ``TGeoTube`` shape into a ``Acts::CylinderSurface`` with ``Acts::CylinderBounds``. The axes definitions has to be ``(x/X)(y/Y)(*/*)``.
0068 
0069 .. figure:: figures/tgeo/TGeoTube_DiscSurface.png
0070   :width: 800
0071 
0072   Conversion of a ``TGeoTube`` shape into a ``Acts::DiscSurface`` with ``Acts::DiscBounds``.The axes definitions has to be ``(x/X)(y/Y)(*/*)``.