LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
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)
 Small utility functions which print some ROOT objects into an output stream. More...
 
template<>
void genf::PrintROOTobject (std::ostream &, const TVector3 &v)
 Small utility functions which print some ROOT objects into an output stream. More...
 

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 
)

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

Definition at line 132 of file GFException.h.

References R.

Referenced by genf::GFAbsTrackRep::Print(), and GFException::quiet().

132  {
133 
134  constexpr std::streamsize fw = 11;
135  constexpr std::streamsize ifw = 4 + (fw & 1);
136  const Int_t rb = m.GetRowLwb(), cb = m.GetColLwb();
137 
138  const Int_t R = m.GetNrows(), C = m.GetNcols();
139  out << R << "x" << C << " matrix is as follows";
140 
141  std::streamsize swidth = out.width(4);
142  std::ios::fmtflags sflags = out.flags();
143  out.unsetf(std::ios_base::floatfield); // out << std::defaultfloat;
144 
145  // header: column number
146  std::string index_pad((fw-ifw)/2, ' ');
147  out << "\n" << std::string(ifw, ' ') << " |";
148  for (Int_t c = 0; c < C; ++c)
149  out << index_pad << std::setw(ifw) << (cb + c) << index_pad << "|";
150 
151  // dashed line
152  out << "\n" << std::string((C+1) * (fw+1), '-');
153 
154  // content, row by row
155  for (Int_t r = 0; r < R; ++r) {
156  // header: row number
157  out << "\n" << std::setw(ifw) << (rb + r) << " |";
158  for (Int_t c = 0; c < C; ++c) out << std::setw(fw) << m(rb + r, cb + c) << " ";
159  } // for r
160  out << "\n\n";
161 
162  // restore the stream features
163  out.flags(sflags);
164  out.width(swidth);
165 } // genf::PrintROOTmatrix<TMatrixT<T>>()
Double_t R
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 129 of file GFException.h.

Referenced by genf::RKTrackRep::extrapolate(), genf::GFTrack::fillGeoTrack(), genf::GFTrackCand::Print(), and genf::GFAbsRecoHit::Print().

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

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

Definition at line 86 of file GFException.cxx.

Referenced by GFException::quiet(), and genf::ROOTobjectToString().

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