ATLAS Offline Software
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 
6 #include "TrkSurfaces/Surface.h"
7 #include <TTree.h>
8 
9 namespace Trk {
10 
11  void SurfaceNtupleBranch::initForWrite(TTree& tree, const std::string& 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 ) {
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 }
Trk::SurfaceNtupleBranch::fill
void fill(const Trk::Surface &surface)
fill a vector
Definition: SurfaceNtupleBranch.cxx:30
Surface.h
Trk::Surface::associatedDetectorElementIdentifier
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
tree
TChain * tree
Definition: tile_monitor.h:30
SurfaceNtupleBranch.h
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::SurfaceNtupleBranch::initForRead
void initForRead(TTree &tree, const std::string &prefix="")
initialize class for reading
Definition: SurfaceNtupleBranch.cxx:21
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
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::SurfaceNtupleBranch::initForWrite
void initForWrite(TTree &tree, const std::string &prefix="")
initialize class for writing
Definition: SurfaceNtupleBranch.cxx:11
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
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
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