ATLAS Offline Software
Loading...
Searching...
No Matches
SurfaceNtupleBranch.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
7#include <TTree.h>
8
9namespace Trk {
10
11 void SurfaceNtupleBranch::initForWrite(TTree& tree, const std::string& prefix ){
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 }
20
21 void SurfaceNtupleBranch::initForRead(TTree& tree, const std::string& prefix ) {
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 }
29
30 void SurfaceNtupleBranch::fill( const Trk::Surface& surface ) {
31
32 m_transform.fill(surface.transform());
33 m_center.fill(surface.center());
34 m_normal.fill(surface.normal());
36 }
37}
value_type get_compact() const
Get the compact id.
Abstract Base Class for tracking surfaces.
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.
Ensure that the ATLAS eigen extensions are properly loaded.
void initForRead(TTree &tree, const std::string &prefix="")
initialize class for reading
TransformNtupleBranch m_transform
data
void initForWrite(TTree &tree, const std::string &prefix="")
initialize class for writing
void fill(const Trk::Surface &surface)
fill a vector
TChain * tree