ATLAS Offline Software
VectorNtupleBranch.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRK_VECTORNTUPLEBRANCH_H
6 #define TRK_VECTORNTUPLEBRANCH_H
7 
8 #include <string>
9 class TTree;
10 
12 #include "CLHEP/Geometry/Vector3D.h"
13 #include "CLHEP/Geometry/Point3D.h"
14 #include "CLHEP/Matrix/Vector.h"
15 
16 namespace Trk {
17 
35 
37  bool initForWrite(TTree& tree, const std::string& varname, int nrow, const std::string& prefix = "" );
38 
40  bool initForRead(TTree& tree, const std::string& varname, int nrow, const std::string& prefix = "" );
41 
43  bool fill( const Amg::VectorX& matrix );
44 
46  bool fill( const CLHEP::HepVector& vec );
47 
49  bool fill( const CLHEP::Hep3Vector& vec );
50 
52  bool fill( const HepGeom::Point3D<double>& vec );
53 
55  bool fill( const HepGeom::Vector3D<double>& vec );
56 
58  static const int ROWMAX = 10;
59  int m_nrows {-1};
60  float m_vector[ROWMAX]{};
61  };
62 
63 }
64 
65 #endif
Amg::VectorX
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Definition: EventPrimitives.h:32
Trk::VectorNtupleBranch
This class provides a simple interface to write Vectors to a root tree The size of the vectors cannot...
Definition: VectorNtupleBranch.h:34
Trk::VectorNtupleBranch::ROWMAX
static const int ROWMAX
maximum size of the vector
Definition: VectorNtupleBranch.h:58
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
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
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::VectorNtupleBranch::m_nrows
int m_nrows
Definition: VectorNtupleBranch.h:59
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
Trk::VectorNtupleBranch::m_vector
float m_vector[ROWMAX]
Definition: VectorNtupleBranch.h:60
EventPrimitives.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
python.testIfMatch.matrix
matrix
Definition: testIfMatch.py:66
LArG4AODNtuplePlotter.varname
def varname(hname)
Definition: LArG4AODNtuplePlotter.py:37