ATLAS Offline Software
Loading...
Searching...
No Matches
TransformNtupleBranch.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <TTree.h>
8#include <iostream>
9
10namespace Trk {
11
12 void TransformNtupleBranch::initForWrite(TTree& tree, const std::string& prefix ){
13 m_rotation.initForWrite(tree,"rot",3,3,prefix);
14 m_translation.initForWrite(tree,"trans",3,prefix);
15 }
16
17 void TransformNtupleBranch::initForRead(TTree& tree, const std::string& prefix ) {
18 m_rotation.initForRead(tree,"rot",3,3,prefix);
19 m_translation.initForRead(tree,"trans",3,prefix);
20 }
21
22
23
25 Amg::Vector3D translation = transform.translation();
26 Amg::RotationMatrix3D rotation = transform.rotation();
27
28 m_rotation.fill(rotation);
29 m_translation.fill(translation);
30 }
31
32 void TransformNtupleBranch::fill( const HepGeom::Transform3D& transform ) {
33 m_rotation.fill(transform.getRotation());
34 m_translation.fill(transform.getTranslation());
35 }
36}
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
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
MatrixNtupleBranch m_rotation
data
TChain * tree