CMS 3D CMS Logo

AlignmentParametersData Class Reference

#include <Alignment/CommonAlignment/interface/AlignmentParametersData.h>

Inheritance diagram for AlignmentParametersData:

ReferenceCounted

List of all members.

Public Types

typedef
ReferenceCountingPointer
< AlignmentParametersData
DataContainer

Public Member Functions

 AlignmentParametersData (const AlgebraicVector &param, const AlgebraicSymMatrix &cov)
 Constructor from parameters vector and covariance matrix.
 AlignmentParametersData (AlgebraicVector *param, AlgebraicSymMatrix *cov)
 Constructor from parameters vector and covariance matrix.
 AlignmentParametersData (const AlgebraicVector &param, const AlgebraicSymMatrix &cov, const std::vector< bool > &sel)
 Constructor from parameters vector, covariance matrix and selection vector.
 AlignmentParametersData (AlgebraicVector *param, AlgebraicSymMatrix *cov, std::vector< bool > *sel)
 Constructor from parameters vector, covariance matrix and selection vector.
 AlignmentParametersData (void)
 Default constructor.
void checkConsistency (void) const
 Check if the size of the parameters vector, the size of the covariance matrix, the size of the selector and the number of selected parameters is consistent.
const AlgebraicSymMatrixcovariance (void) const
 Access to the covariance matrix.
int numSelected (void)
 Access to the number of selected parameters.
const AlgebraicVectorparameters (void) const
 Access to the parameter vector.
const std::vector< bool > & selector (void) const
 Access to the selection vector.
 ~AlignmentParametersData (void)

Private Attributes

AlgebraicSymMatrixtheCovariance
int theNumSelected
AlgebraicVectortheParameters
std::vector< bool > * theSelector


Detailed Description

Definition at line 7 of file AlignmentParametersData.h.


Member Typedef Documentation

typedef ReferenceCountingPointer<AlignmentParametersData> AlignmentParametersData::DataContainer

Definition at line 12 of file AlignmentParametersData.h.


Constructor & Destructor Documentation

AlignmentParametersData::AlignmentParametersData ( void   ) 

Default constructor.

Definition at line 9 of file AlignmentParametersData.cc.

00009                                                        :
00010   theParameters( new AlgebraicVector() ),
00011   theCovariance( new AlgebraicSymMatrix() ),
00012   theSelector( new std::vector<bool>() ),
00013   theNumSelected( 0 )
00014 {}

AlignmentParametersData::AlignmentParametersData ( AlgebraicVector param,
AlgebraicSymMatrix cov,
std::vector< bool > *  sel 
)

Constructor from parameters vector, covariance matrix and selection vector.

NOTE: The input data must live on the heap and must not be deleted by the user.

Definition at line 17 of file AlignmentParametersData.cc.

References theNumSelected, and theSelector.

00019                                                                          :
00020   theParameters( param ),
00021   theCovariance( cov ),
00022   theSelector( sel )
00023 {
00024   theNumSelected = std::count_if( theSelector->begin(),
00025                                   theSelector->end(),
00026                                   std::bind2nd( std::equal_to<bool>(), true ) );
00027 }

AlignmentParametersData::AlignmentParametersData ( const AlgebraicVector param,
const AlgebraicSymMatrix cov,
const std::vector< bool > &  sel 
)

Constructor from parameters vector, covariance matrix and selection vector.

Definition at line 30 of file AlignmentParametersData.cc.

References theNumSelected, and theSelector.

00032                                                                                :
00033   theParameters( new AlgebraicVector( param ) ),
00034   theCovariance( new AlgebraicSymMatrix( cov ) ),
00035   theSelector( new std::vector<bool>( sel ) )
00036 {
00037   theNumSelected = std::count_if( theSelector->begin(),
00038                                   theSelector->end(),
00039                                   std::bind2nd( std::equal_to<bool>(), true ) );
00040 }

AlignmentParametersData::AlignmentParametersData ( AlgebraicVector param,
AlgebraicSymMatrix cov 
)

Constructor from parameters vector and covariance matrix.

NOTE: The input data must live on the heap and must not be deleted by the user.

Definition at line 43 of file AlignmentParametersData.cc.

00044                                                                             :
00045   theParameters( param ),
00046   theCovariance( cov ),
00047   theSelector( new std::vector<bool>( param->num_row(), true ) ),
00048   theNumSelected( param->num_row() )
00049 {}

AlignmentParametersData::AlignmentParametersData ( const AlgebraicVector param,
const AlgebraicSymMatrix cov 
)

Constructor from parameters vector and covariance matrix.

Definition at line 52 of file AlignmentParametersData.cc.

00053                                                                                   :
00054   theParameters( new AlgebraicVector( param ) ),
00055   theCovariance( new AlgebraicSymMatrix( cov ) ),
00056   theSelector( new std::vector<bool>( param.num_row(), true ) ),
00057   theNumSelected( param.num_row() )
00058 {}

AlignmentParametersData::~AlignmentParametersData ( void   ) 

Definition at line 61 of file AlignmentParametersData.cc.

References theCovariance, theParameters, and theSelector.

00062 {
00063   delete theParameters;
00064   delete theCovariance;
00065   delete theSelector;
00066 }


Member Function Documentation

void AlignmentParametersData::checkConsistency ( void   )  const

Check if the size of the parameters vector, the size of the covariance matrix, the size of the selector and the number of selected parameters is consistent.

An exception of type "LogicError" is thrown in case of any inconsistencies.

Definition at line 69 of file AlignmentParametersData.cc.

References Exception, theCovariance, theParameters, and theSelector.

00070 {
00071   int selectorSize = static_cast<int>( theSelector->size() );
00072   int paramSize = theParameters->num_row();
00073   int covSize = theCovariance->num_row();
00074 
00075   if ( ( paramSize != covSize ) || ( paramSize != selectorSize ) )
00076       throw cms::Exception("LogicError") << "@SUB=AlignmentParametersData::checkConsistency "
00077                                          << "\nSize mismatch: parameter size = " << paramSize
00078                                          << ", covariance size = " << covSize
00079                                          << ", selector size = " << selectorSize << ".";
00080 }

const AlgebraicSymMatrix& AlignmentParametersData::covariance ( void   )  const [inline]

Access to the covariance matrix.

Definition at line 43 of file AlignmentParametersData.h.

References theCovariance.

00043 { return *theCovariance; } 

int AlignmentParametersData::numSelected ( void   )  [inline]

Access to the number of selected parameters.

Definition at line 49 of file AlignmentParametersData.h.

References theNumSelected.

00049 { return theNumSelected; }

const AlgebraicVector& AlignmentParametersData::parameters ( void   )  const [inline]

Access to the parameter vector.

Definition at line 40 of file AlignmentParametersData.h.

References theParameters.

00040 { return *theParameters; }

const std::vector<bool>& AlignmentParametersData::selector ( void   )  const [inline]

Access to the selection vector.

Definition at line 46 of file AlignmentParametersData.h.

References theSelector.

00046 { return *theSelector; }


Member Data Documentation

AlgebraicSymMatrix* AlignmentParametersData::theCovariance [private]

Definition at line 59 of file AlignmentParametersData.h.

Referenced by checkConsistency(), covariance(), and ~AlignmentParametersData().

int AlignmentParametersData::theNumSelected [private]

Definition at line 61 of file AlignmentParametersData.h.

Referenced by AlignmentParametersData(), and numSelected().

AlgebraicVector* AlignmentParametersData::theParameters [private]

Definition at line 58 of file AlignmentParametersData.h.

Referenced by checkConsistency(), parameters(), and ~AlignmentParametersData().

std::vector<bool>* AlignmentParametersData::theSelector [private]

Definition at line 60 of file AlignmentParametersData.h.

Referenced by AlignmentParametersData(), checkConsistency(), selector(), and ~AlignmentParametersData().


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