kalmanalignment is hosted by Hepforge, IPPP Durham

/home/mweber/Dokumente/CMS/Alignment/kalmanalignment/trunk/util/Utilities.h File Reference

Various preprocessor macros, variables, functions, and procedures that misfit elsewhere. More...

#include <string>
#include <iostream>
#include <assert.h>
#include "TString.h"
#include "TVectorD.h"
#include "TMatrixD.h"
#include "TMatrixDSym.h"
#include "TObject.h"
#include "TTree.h"
#include <CLHEP/Matrix/Vector.h>
#include <CLHEP/Matrix/Matrix.h>
#include <CLHEP/Matrix/SymMatrix.h>

Go to the source code of this file.

Defines

#define LOG(level, message)
#define ERROR(message)   LOG(1, message);
#define WARNING(message)   LOG(2, message);
#define INFO(message)   LOG(3, message);
#define MATRIX_SIZE(mname, matrix)   std::cout << "Matrix " << mname << " has " << matrix.num_row() << " rows and " << matrix.num_col() << " columns." << std::endl;
#define PMATRIX(mname, matrix)   if (gLogLevel > 2) { cout << mname; matrix.Print(); }
#define MATRIX(matrix)   PMATRIX(#matrix, matrix)
#define THROW(errmsg)   throw (std::string( __PRETTY_FUNCTION__ )+std::string(" (file: ")+std::string( __FILE__ )+std::string(", line: ")+std::string( Form("%d", __LINE__) )+std::string(") ")+std::string(errmsg));
#define CATCH   catch (std::string message) { cerr << "EXCEPTION in " << message << std::endl; }

Functions

void setXYZ (CLHEP::HepVector &v, double x, double y, double z)
bool equal (const double val1, const double val2, const double precision)
void GetSubMatrix (const CLHEP::HepMatrix &m, int startRow, int startColumn, int endRow, int endColumn, CLHEP::HepMatrix &sub)
void GetSubMatrix (const CLHEP::HepSymMatrix &m, int startRow, int startColumn, int endRow, int endColumn, CLHEP::HepMatrix &sub)
void SetSubMatrix (CLHEP::HepMatrix &m, int startRow, int startColumn, const CLHEP::HepMatrix &sub)
void SetSubMatrix (CLHEP::HepSymMatrix &m, int startRow, int startColumn, const CLHEP::HepMatrix &sub)
CLHEP::HepVector GetSubVector (const CLHEP::HepVector &v, int start, int end)
void SetSubVector (CLHEP::HepVector &v, int start, const CLHEP::HepVector &sub)
void CLHEPtoROOT (const CLHEP::HepMatrix &oldM, TMatrixD *newM)
void CLHEPtoROOT (const CLHEP::HepSymMatrix &oldM, TMatrixDSym *newM)
void CLHEPtoROOT (const CLHEP::HepVector &oldV, TVectorD *newV)
TObject * get_object (const char *objectname, const char *filename)
TTree * get_tree (const char *treename, const char *filename)
TTree * init_align_tree (const char *filename)

Variables

int gLogLevel

Detailed Description

Various preprocessor macros, variables, functions, and procedures that misfit elsewhere.


Define Documentation

#define LOG (   level,
  message 
)
Value:
if (gLogLevel >= level) { switch (level) { \
case 1: std::cerr << "ERROR: " << message << std::endl; break; \
case 2: std::cerr << "WARNING: " << message << std::endl; break; \
case 3: std::cout << "INFO: " << message << std::endl; break; \
default: std::cout << "DEBUG: " << message << std::endl; } }

Function Documentation

bool equal ( const double  val1,
const double  val2,
const double  precision 
)

Test if two values are equal within a certain precision.

void GetSubMatrix ( const CLHEP::HepMatrix &  m,
int  startRow,
int  startColumn,
int  endRow,
int  endColumn,
CLHEP::HepMatrix &  sub 
)

Get a submatrix from a large matrix

CLHEP::HepVector GetSubVector ( const CLHEP::HepVector &  v,
int  start,
int  end 
)

Get/set a subvector from a large vector

void SetSubMatrix ( CLHEP::HepMatrix &  m,
int  startRow,
int  startColumn,
const CLHEP::HepMatrix &  sub 
)

Set a submatrix in a large matrix