ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
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 More...
 
void initForRead (TTree &tree, const std::string &prefix="")
 initialize class for reading More...
 
void fill (const Trk::Surface &surface)
 fill a vector More...
 

Public Attributes

TransformNtupleBranch m_transform
 data More...
 
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  }

◆ initForRead()

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

initialize class for reading

Definition at line 21 of file SurfaceNtupleBranch.cxx.

21  {
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  }

◆ initForWrite()

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

initialize class for writing

Definition at line 11 of file SurfaceNtupleBranch.cxx.

11  {
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:
Trk::Surface::associatedDetectorElementIdentifier
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
tree
TChain * tree
Definition: tile_monitor.h:30
Trk::VectorNtupleBranch::initForRead
bool initForRead(TTree &tree, const std::string &varname, int nrow, const std::string &prefix="")
initialize class for reading
Definition: VectorNtupleBranch.cxx:22
Identifier::get_compact
value_type get_compact() const
Get the compact id.
Trk::TransformNtupleBranch::initForRead
void initForRead(TTree &tree, const std::string &prefix="")
initialize class for reading
Definition: TransformNtupleBranch.cxx:17
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
Trk::VectorNtupleBranch::initForWrite
bool initForWrite(TTree &tree, const std::string &varname, int nrow, const std::string &prefix="")
initialize class for writing
Definition: VectorNtupleBranch.cxx:10
Trk::VectorNtupleBranch::fill
bool fill(const Amg::VectorX &matrix)
fill a vector
Definition: VectorNtupleBranch.cxx:34
Trk::SurfaceNtupleBranch::m_id
int m_id
Definition: SurfaceNtupleBranch.h:51
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
Trk::Surface::normal
virtual const Amg::Vector3D & normal() const
Returns the normal vector of the Surface (i.e.
Trk::TransformNtupleBranch::fill
void fill(const Amg::Transform3D &transform)
fill a transform
Definition: TransformNtupleBranch.cxx:24
Trk::SurfaceNtupleBranch::m_normal
VectorNtupleBranch m_normal
Definition: SurfaceNtupleBranch.h:50
Trk::SurfaceNtupleBranch::m_center
VectorNtupleBranch m_center
Definition: SurfaceNtupleBranch.h:49
Trk::TransformNtupleBranch::initForWrite
void initForWrite(TTree &tree, const std::string &prefix="")
initialize class for writing
Definition: TransformNtupleBranch.cxx:12
Trk::Surface::transform
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
Trk::SurfaceNtupleBranch::m_transform
TransformNtupleBranch m_transform
data
Definition: SurfaceNtupleBranch.h:48