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

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

#include <SurfaceNtupleBranch.h>

Collaboration diagram for Trk::SurfaceNtupleBranch:

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 Trk::Surface &surface)
 fill a vector

Public Attributes

TransformNtupleBranch m_transform
 data
VectorNtupleBranch m_center
VectorNtupleBranch m_normal
int m_id

Detailed Description

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

Usage:

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

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

Definition at line 36 of file SurfaceNtupleBranch.h.

Member Function Documentation

◆ fill()

void Trk::SurfaceNtupleBranch::fill ( const Trk::Surface & surface)

fill a vector

Definition at line 30 of file SurfaceNtupleBranch.cxx.

30 {
31
32 m_transform.fill(surface.transform());
33 m_center.fill(surface.center());
34 m_normal.fill(surface.normal());
36 }
value_type get_compact() const
Get the compact id.
virtual const Amg::Vector3D & normal() const
Returns the normal vector of the Surface (i.e.
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
const Amg::Vector3D & center() const
Returns the center position of the Surface.
TransformNtupleBranch m_transform
data

◆ initForRead()

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

initialize class for reading

Definition at line 21 of file SurfaceNtupleBranch.cxx.

21 {
22 m_transform.initForRead(tree,prefix);
23 m_center.initForRead(tree,"center",3,prefix);
24 m_normal.initForRead(tree,"normal",3,prefix);
25 TString bname = prefix.c_str();
26 bname += "_id";
27 tree.SetBranchAddress(bname,&m_id);
28 }
TChain * tree

◆ initForWrite()

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

initialize class for writing

Definition at line 11 of file SurfaceNtupleBranch.cxx.

11 {
12 m_transform.initForWrite(tree,prefix);
13 m_center.initForWrite(tree,"center",3,prefix);
14 m_normal.initForWrite(tree,"normal",3,prefix);
15
16 TString bname = prefix.c_str();
17 bname += "id";
18 tree.Branch(bname,&m_id);
19 }

Member Data Documentation

◆ m_center

VectorNtupleBranch Trk::SurfaceNtupleBranch::m_center

Definition at line 49 of file SurfaceNtupleBranch.h.

◆ m_id

int Trk::SurfaceNtupleBranch::m_id

Definition at line 51 of file SurfaceNtupleBranch.h.

◆ m_normal

VectorNtupleBranch Trk::SurfaceNtupleBranch::m_normal

Definition at line 50 of file SurfaceNtupleBranch.h.

◆ m_transform

TransformNtupleBranch Trk::SurfaceNtupleBranch::m_transform

data

Definition at line 48 of file SurfaceNtupleBranch.h.


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