CMS 3D CMS Logo

AlignmentExtendedCorrelationsEntry Class Reference

Data container for a correlations matrix (represented by a vector of floats), with basic access functions. More...

#include <Alignment/CommonAlignmentAlgorithm/interface/AlignmentExtendedCorrelationsEntry.h>

List of all members.

Public Member Functions

 AlignmentExtendedCorrelationsEntry (const AlgebraicMatrix &mat)
 Constructor from CLHEP matrix.
 AlignmentExtendedCorrelationsEntry (short unsigned int nRows, short unsigned int nCols, const float init)
 Constructor. Initializes all elements of the correlations matrix to the given value.
 AlignmentExtendedCorrelationsEntry (short unsigned int nRows, short unsigned int nCols)
 Constructor. Leaves the correlations matrix uninitialized.
 AlignmentExtendedCorrelationsEntry (void)
 Default constructor.
AlgebraicMatrix matrix (void) const
 Retrieve the correlation matrix in a CLHEP matrix representation;.
const short unsigned int numCol (void) const
 Get the number of columns of the correlation matrix.
const short unsigned int numRow (void) const
 Get the number of rows of the correlation matrix.
void operator *= (const float multiply)
 Multiply all elements of the correlations matrix with a given number.
const float operator() (short unsigned int iRow, short unsigned int jCol) const
 Read or write an element of the correlations matrix. NOTE: Indexing starts from [0,0].
float & operator() (short unsigned int iRow, short unsigned int jCol)
 Read or write an element of the correlations matrix. NOTE: Indexing starts from [0,0].
 ~AlignmentExtendedCorrelationsEntry (void)
 Destructor.

Private Attributes

std::vector< float > theData
short unsigned int theNCols
short unsigned int theNRows


Detailed Description

Data container for a correlations matrix (represented by a vector of floats), with basic access functions.

NOTE: This class is designed specifically for the use within AlignmentExtendedCorrelationsStore, and is not intended to be used elsewhere.

Definition at line 13 of file AlignmentExtendedCorrelationsEntry.h.


Constructor & Destructor Documentation

AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry ( void   ) 

Default constructor.

Definition at line 5 of file AlignmentExtendedCorrelationsEntry.cc.

00005                                                                              :
00006 //   theCounter( 0 ),
00007   theNRows( 0 ),
00008   theNCols( 0 )
00009 {}

AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry ( short unsigned int  nRows,
short unsigned int  nCols 
) [explicit]

Constructor. Leaves the correlations matrix uninitialized.

Definition at line 12 of file AlignmentExtendedCorrelationsEntry.cc.

00013                                                                                                    :
00014 //   theCounter( 0 ),
00015   theNRows( nRows ),
00016   theNCols( nCols ),
00017   theData( nRows*nCols )
00018 {}

AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry ( short unsigned int  nRows,
short unsigned int  nCols,
const float  init 
) [explicit]

Constructor. Initializes all elements of the correlations matrix to the given value.

Definition at line 21 of file AlignmentExtendedCorrelationsEntry.cc.

00023                                                                          :
00024 //   theCounter( 0 ),
00025   theNRows( nRows ),
00026   theNCols( nCols ),
00027   theData( nRows*nCols, init )
00028 {}

AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry ( const AlgebraicMatrix mat  )  [explicit]

Constructor from CLHEP matrix.

Definition at line 31 of file AlignmentExtendedCorrelationsEntry.cc.

References i, j, theData, and theNCols.

00031                                                                                                    :
00032 //   theCounter( 0 ),
00033   theNRows( mat.num_row() ),
00034   theNCols( mat.num_col() ),
00035   theData( mat.num_row()*mat.num_col() )
00036 {
00037   for ( int i = 0; i < mat.num_row(); ++i )
00038   {
00039     for ( int j = 0; j < mat.num_col(); ++j )
00040     {
00041       theData[i*theNCols+j] = mat[i][j];
00042     }
00043   }
00044 }

AlignmentExtendedCorrelationsEntry::~AlignmentExtendedCorrelationsEntry ( void   )  [inline]

Destructor.

Definition at line 31 of file AlignmentExtendedCorrelationsEntry.h.

00031 {}


Member Function Documentation

AlgebraicMatrix AlignmentExtendedCorrelationsEntry::matrix ( void   )  const

Retrieve the correlation matrix in a CLHEP matrix representation;.

Definition at line 53 of file AlignmentExtendedCorrelationsEntry.cc.

References i, j, HLT_VtxMuL3::result, theData, theNCols, and theNRows.

00054 {
00055   AlgebraicMatrix result( theNRows, theNCols );
00056 
00057   for ( int i = 0; i < theNRows; ++i )
00058   {
00059     for ( int j = 0; j < theNCols; ++j )
00060     {
00061       result[i][j] = theData[i*theNCols+j];
00062     }
00063   }
00064 
00065   return result;
00066 }

const short unsigned int AlignmentExtendedCorrelationsEntry::numCol ( void   )  const [inline]

Get the number of columns of the correlation matrix.

Definition at line 43 of file AlignmentExtendedCorrelationsEntry.h.

References theNCols.

Referenced by AlignmentExtendedCorrelationsStore::fillCovariance(), AlignmentExtendedCorrelationsStore::fillCovarianceT(), AlignmentExtendedCorrelationsStore::readFromCovariance(), and AlignmentExtendedCorrelationsStore::readFromCovarianceT().

00043 { return theNCols; }

const short unsigned int AlignmentExtendedCorrelationsEntry::numRow ( void   )  const [inline]

Get the number of rows of the correlation matrix.

Definition at line 40 of file AlignmentExtendedCorrelationsEntry.h.

References theNRows.

Referenced by AlignmentExtendedCorrelationsStore::fillCovariance(), AlignmentExtendedCorrelationsStore::fillCovarianceT(), AlignmentExtendedCorrelationsStore::readFromCovariance(), and AlignmentExtendedCorrelationsStore::readFromCovarianceT().

00040 { return theNRows; }

void AlignmentExtendedCorrelationsEntry::operator *= ( const float  multiply  ) 

Multiply all elements of the correlations matrix with a given number.

Definition at line 47 of file AlignmentExtendedCorrelationsEntry.cc.

References it, and theData.

00048 {
00049   for ( std::vector< float >::iterator it = theData.begin(); it != theData.end(); ++it ) (*it) *= multiply;
00050 }

const float AlignmentExtendedCorrelationsEntry::operator() ( short unsigned int  iRow,
short unsigned int  jCol 
) const [inline]

Read or write an element of the correlations matrix. NOTE: Indexing starts from [0,0].

Definition at line 37 of file AlignmentExtendedCorrelationsEntry.h.

References theData, and theNCols.

00037 { return theData[iRow*theNCols+jCol]; }

float& AlignmentExtendedCorrelationsEntry::operator() ( short unsigned int  iRow,
short unsigned int  jCol 
) [inline]

Read or write an element of the correlations matrix. NOTE: Indexing starts from [0,0].

Definition at line 34 of file AlignmentExtendedCorrelationsEntry.h.

References theData, and theNCols.

00034 { return theData[iRow*theNCols+jCol]; }


Member Data Documentation

std::vector< float > AlignmentExtendedCorrelationsEntry::theData [private]

Definition at line 67 of file AlignmentExtendedCorrelationsEntry.h.

Referenced by AlignmentExtendedCorrelationsEntry(), matrix(), operator *=(), and operator()().

short unsigned int AlignmentExtendedCorrelationsEntry::theNCols [private]

Definition at line 65 of file AlignmentExtendedCorrelationsEntry.h.

Referenced by AlignmentExtendedCorrelationsEntry(), matrix(), numCol(), and operator()().

short unsigned int AlignmentExtendedCorrelationsEntry::theNRows [private]

Definition at line 64 of file AlignmentExtendedCorrelationsEntry.h.

Referenced by matrix(), and numRow().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:14:27 2009 for CMSSW by  doxygen 1.5.4