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, const std::string &prefix="")
 initialize class for writing
void initForRead (TTree &tree, const std::string &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 24 of file TransformNtupleBranch.cxx.

24 {
25 Amg::Vector3D translation = transform.translation();
27
28 m_rotation.fill(rotation);
29 m_translation.fill(translation);
30 }
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 32 of file TransformNtupleBranch.cxx.

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

◆ initForRead()

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

initialize class for reading

Definition at line 17 of file TransformNtupleBranch.cxx.

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

◆ initForWrite()

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

initialize class for writing

Definition at line 12 of file TransformNtupleBranch.cxx.

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

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: