Namespaces | Classes
Genfit

Namespaces

 genf
 Generic Interface to magnetic fields in GENFIT.
 

Classes

class  GFException
 Exception class for error handling in GENFIT (provides storage for diagnostic information) More...
 
class  GFAbsRecoHitProducer
 Abstract interface class for GFRecoHitProducer. More...
 
class  GFRecoHitProducer< hit_T, recoHit_T >
 Template class for a hit producer module. More...
 
template<class ROOTOBJ >
void genf::PrintROOTobject (std::ostream &, const ROOTOBJ &)
 Small utility functions which print some ROOT objects into an output stream. More...
 
template<typename T >
void genf::PrintROOTmatrix (std::ostream &out, const TMatrixT< T > &m)
 
template<>
void genf::PrintROOTobject (std::ostream &, const TVector3 &v)
 

Detailed Description

Author
Christian Höppner (Technische Universität München, original author)
Christian Höppner (Technische Universität München, original author)
Sebastian Neubert (Technische Universität München, original author)

Function Documentation

template<typename T >
void genf::PrintROOTmatrix ( std::ostream &  out,
const TMatrixT< T > &  m 
)

Definition at line 130 of file GFException.h.

130  {
131 
132  constexpr std::streamsize fw = 11;
133  constexpr std::streamsize ifw = 4 + (fw & 1);
134  const Int_t rb = m.GetRowLwb(), cb = m.GetColLwb();
135 
136  const Int_t R = m.GetNrows(), C = m.GetNcols();
137  out << R << "x" << C << " matrix is as follows";
138 
139  std::streamsize swidth = out.width(4);
140  std::ios::fmtflags sflags = out.flags();
141  out.unsetf(std::ios_base::floatfield); // out << std::defaultfloat;
142 
143  // header: column number
144  std::string index_pad((fw-ifw)/2, ' ');
145  out << "\n" << std::string(ifw, ' ') << " |";
146  for (Int_t c = 0; c < C; ++c)
147  out << index_pad << std::setw(ifw) << (cb + c) << index_pad << "|";
148 
149  // dashed line
150  out << "\n" << std::string((C+1) * (fw+1), '-');
151 
152  // content, row by row
153  for (Int_t r = 0; r < R; ++r) {
154  // header: row number
155  out << "\n" << std::setw(ifw) << (rb + r) << " |";
156  for (Int_t c = 0; c < C; ++c) out << std::setw(fw) << m(rb + r, cb + c) << " ";
157  } // for r
158  out << "\n\n";
159 
160  // restore the stream features
161  out.flags(sflags);
162  out.width(swidth);
163 } // genf::PrintROOTmatrix<TMatrixT<T>>()
std::string string
Definition: nybbler.cc:12
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
template<class ROOTOBJ >
void genf::PrintROOTobject ( std::ostream &  ,
const ROOTOBJ &  obj 
)

Small utility functions which print some ROOT objects into an output stream.

Definition at line 127 of file GFException.h.

127 { obj.Print(); }
template<>
void genf::PrintROOTobject ( std::ostream &  out,
const TVector3 &  v 
)

Definition at line 88 of file GFException.cxx.

88  {
89  out << "(x,y,z)=(" << v.X() << "," << v.Y() << "," << v.Z() << ")"
90  " (rho,theta,phi)=(" << v.Mag() << "," << (v.Theta()*TMath::RadToDeg())
91  << "," << (v.Phi()*TMath::RadToDeg()) << ")";
92 } // genf::PrintROOTobject<TVector3>()