ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::TransformNtupleBranch Struct Reference

This class provides a simple interface to write Transforms to a root tree. More...

#include <TransformNtupleBranch.h>

Collaboration diagram for Trk::TransformNtupleBranch:

Public Member Functions

void initForWrite (TTree &tree, std::string_view prefix="")
 initialize class for writing
void initForRead (TTree &tree, std::string_view prefix="")
 initialize class for reading
void fill (const Amg::Transform3D &transform)
 fill a transform
void fill (const HepGeom::Transform3D &transform)
 fill a transform

Public Attributes

MatrixNtupleBranch m_rotation
 data
VectorNtupleBranch m_translation

Detailed Description

This class provides a simple interface to write Transforms to a root tree.

Usage:

TTree* myTree = new TTree("data","data"); TransformNtupleBranch branch; branch.initForWrite(*myTree,"");

for(int i=0;i<n;++i){ branch.fill( ); myTree->Fill(); }

Definition at line 34 of file TransformNtupleBranch.h.

Member Function Documentation

◆ fill() [1/2]

void Trk::TransformNtupleBranch::fill ( const Amg::Transform3D & transform)

fill a transform

Definition at line 23 of file TransformNtupleBranch.cxx.

23 {
24 Amg::Vector3D translation = transform.translation();
26
27 m_rotation.fill(rotation);
28 m_translation.fill(translation);
29 }
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Eigen::Matrix< double, 3, 1 > Vector3D
MatrixNtupleBranch m_rotation
data

◆ fill() [2/2]

void Trk::TransformNtupleBranch::fill ( const HepGeom::Transform3D & transform)

fill a transform

Definition at line 31 of file TransformNtupleBranch.cxx.

31 {
32 m_rotation.fill(transform.getRotation());
33 m_translation.fill(transform.getTranslation());
34 }

◆ initForRead()

void Trk::TransformNtupleBranch::initForRead ( TTree & tree,
std::string_view prefix = "" )

initialize class for reading

Definition at line 16 of file TransformNtupleBranch.cxx.

16 {
17 m_rotation.initForRead(tree,"rot",3,3,prefix);
18 m_translation.initForRead(tree,"trans",3,prefix);
19 }
TChain * tree

◆ initForWrite()

void Trk::TransformNtupleBranch::initForWrite ( TTree & tree,
std::string_view prefix = "" )

initialize class for writing

Definition at line 11 of file TransformNtupleBranch.cxx.

11 {
12 m_rotation.initForWrite(tree,"rot",3,3,prefix);
13 m_translation.initForWrite(tree,"trans",3,prefix);
14 }

Member Data Documentation

◆ m_rotation

MatrixNtupleBranch Trk::TransformNtupleBranch::m_rotation

data

Definition at line 49 of file TransformNtupleBranch.h.

◆ m_translation

VectorNtupleBranch Trk::TransformNtupleBranch::m_translation

Definition at line 50 of file TransformNtupleBranch.h.


The documentation for this struct was generated from the following files: