LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 133 of file GFException.h.

References r.

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

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

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

128 {
129  obj.Print();
130 }
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 93 of file GFException.cxx.

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

94 {
95  out << "(x,y,z)=(" << v.X() << "," << v.Y() << "," << v.Z()
96  << ")"
97  " (rho,theta,phi)=("
98  << v.Mag() << "," << (v.Theta() * TMath::RadToDeg()) << "," << (v.Phi() * TMath::RadToDeg())
99  << ")";
100 } // genf::PrintROOTobject<TVector3>()