CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
AlignmentExtendedCorrelationsEntry Class Reference

#include <AlignmentExtendedCorrelationsEntry.h>

Public Member Functions

 AlignmentExtendedCorrelationsEntry (void)
 Default constructor. More...
 
 AlignmentExtendedCorrelationsEntry (short unsigned int nRows, short unsigned int nCols)
 Constructor. Leaves the correlations matrix uninitialized. More...
 
 AlignmentExtendedCorrelationsEntry (short unsigned int nRows, short unsigned int nCols, const float init)
 Constructor. Initializes all elements of the correlations matrix to the given value. More...
 
 AlignmentExtendedCorrelationsEntry (const AlgebraicMatrix &mat)
 Constructor from CLHEP matrix. More...
 
AlgebraicMatrix matrix (void) const
 Retrieve the correlation matrix in a CLHEP matrix representation;. More...
 
const short unsigned int numCol (void) const
 Get the number of columns of the correlation matrix. More...
 
const short unsigned int numRow (void) const
 Get the number of rows of the correlation matrix. More...
 
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]. More...
 
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]. More...
 
void operator*= (const float multiply)
 Multiply all elements of the correlations matrix with a given number. More...
 
 ~AlignmentExtendedCorrelationsEntry (void)
 Destructor. More...
 

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 11 of file AlignmentExtendedCorrelationsEntry.h.

Constructor & Destructor Documentation

AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry ( void  )

Default constructor.

Definition at line 4 of file AlignmentExtendedCorrelationsEntry.cc.

5  : // theCounter( 0 ),
6  theNRows(0),
7  theNCols(0) {}
AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry ( short unsigned int  nRows,
short unsigned int  nCols 
)
explicit

Constructor. Leaves the correlations matrix uninitialized.

Definition at line 9 of file AlignmentExtendedCorrelationsEntry.cc.

11  : // theCounter( 0 ),
12  theNRows(nRows),
13  theNCols(nCols),
14  theData(nRows * nCols) {}
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 16 of file AlignmentExtendedCorrelationsEntry.cc.

19  : // theCounter( 0 ),
20  theNRows(nRows),
21  theNCols(nCols),
22  theData(nRows * nCols, init) {}
int init
Definition: HydjetWrapper.h:64
AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry ( const AlgebraicMatrix mat)
explicit

Constructor from CLHEP matrix.

Definition at line 24 of file AlignmentExtendedCorrelationsEntry.cc.

References mps_fire::i, dqmiolumiharvest::j, theData, and theNCols.

25  : // theCounter( 0 ),
26  theNRows(mat.num_row()),
27  theNCols(mat.num_col()),
28  theData(mat.num_row() * mat.num_col()) {
29  for (int i = 0; i < mat.num_row(); ++i) {
30  for (int j = 0; j < mat.num_col(); ++j) {
31  theData[i * theNCols + j] = mat[i][j];
32  }
33  }
34 }
AlignmentExtendedCorrelationsEntry::~AlignmentExtendedCorrelationsEntry ( void  )
inline

Destructor.

Definition at line 26 of file AlignmentExtendedCorrelationsEntry.h.

26 {}

Member Function Documentation

AlgebraicMatrix AlignmentExtendedCorrelationsEntry::matrix ( void  ) const

Retrieve the correlation matrix in a CLHEP matrix representation;.

Definition at line 41 of file AlignmentExtendedCorrelationsEntry.cc.

References mps_fire::i, dqmiolumiharvest::j, mps_fire::result, theData, theNCols, and theNRows.

41  {
43 
44  for (int i = 0; i < theNRows; ++i) {
45  for (int j = 0; j < theNCols; ++j) {
46  result[i][j] = theData[i * theNCols + j];
47  }
48  }
49 
50  return result;
51 }
tuple result
Definition: mps_fire.py:311
CLHEP::HepMatrix AlgebraicMatrix
const short unsigned int AlignmentExtendedCorrelationsEntry::numCol ( void  ) const
inline
const short unsigned int AlignmentExtendedCorrelationsEntry::numRow ( void  ) const
inline
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 29 of file AlignmentExtendedCorrelationsEntry.h.

References theData, and theNCols.

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 32 of file AlignmentExtendedCorrelationsEntry.h.

References theData, and theNCols.

32  {
33  return theData[iRow * theNCols + jCol];
34  }
void AlignmentExtendedCorrelationsEntry::operator*= ( const float  multiply)

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

Definition at line 36 of file AlignmentExtendedCorrelationsEntry.cc.

References Matriplex::multiply(), and theData.

36  {
37  for (std::vector<float>::iterator it = theData.begin(); it != theData.end(); ++it)
38  (*it) *= multiply;
39 }
void multiply(const MPlex< T, D, D, N > &A, const MPlex< T, D, D, N > &B, MPlex< T, D, D, N > &C)
Definition: Matriplex.h:340

Member Data Documentation

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

Definition at line 60 of file AlignmentExtendedCorrelationsEntry.h.

Referenced by matrix(), and numRow().