CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
AlignmentParametersData Class Reference

#include <AlignmentParametersData.h>

Inheritance diagram for AlignmentParametersData:
ReferenceCounted

Public Types

typedef ReferenceCountingPointer< AlignmentParametersDataDataContainer
 

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 7 of file AlignmentParametersData.h.

Member Typedef Documentation

Definition at line 12 of file AlignmentParametersData.h.

Constructor & Destructor Documentation

AlignmentParametersData::AlignmentParametersData ( void  )

Default constructor.

Definition at line 9 of file AlignmentParametersData.cc.

9  :
12  theSelector( new std::vector<bool>() ),
13  theNumSelected( 0 )
14 {}
CLHEP::HepVector AlgebraicVector
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::vector< bool > * theSelector
AlgebraicSymMatrix * theCovariance
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.

19  :
20  theParameters( param ),
21  theCovariance( cov ),
22  theSelector( sel )
23 {
24  theNumSelected = std::count_if( theSelector->begin(),
25  theSelector->end(),
26  std::bind2nd( std::equal_to<bool>(), true ) );
27 }
std::vector< bool > * theSelector
AlgebraicSymMatrix * theCovariance
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.

32  :
33  theParameters( new AlgebraicVector( param ) ),
34  theCovariance( new AlgebraicSymMatrix( cov ) ),
35  theSelector( new std::vector<bool>( sel ) )
36 {
37  theNumSelected = std::count_if( theSelector->begin(),
38  theSelector->end(),
39  std::bind2nd( std::equal_to<bool>(), true ) );
40 }
CLHEP::HepVector AlgebraicVector
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::vector< bool > * theSelector
AlgebraicSymMatrix * theCovariance
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.

44  :
45  theParameters( param ),
46  theCovariance( cov ),
47  theSelector( new std::vector<bool>( param->num_row(), true ) ),
48  theNumSelected( param->num_row() )
49 {}
std::vector< bool > * theSelector
AlgebraicSymMatrix * theCovariance
AlignmentParametersData::AlignmentParametersData ( const AlgebraicVector param,
const AlgebraicSymMatrix cov 
)

Constructor from parameters vector and covariance matrix.

Definition at line 52 of file AlignmentParametersData.cc.

53  :
54  theParameters( new AlgebraicVector( param ) ),
55  theCovariance( new AlgebraicSymMatrix( cov ) ),
56  theSelector( new std::vector<bool>( param.num_row(), true ) ),
57  theNumSelected( param.num_row() )
58 {}
CLHEP::HepVector AlgebraicVector
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::vector< bool > * theSelector
AlgebraicSymMatrix * theCovariance
AlignmentParametersData::~AlignmentParametersData ( void  )
override

Definition at line 61 of file AlignmentParametersData.cc.

References theCovariance, theParameters, and theSelector.

62 {
63  delete theParameters;
64  delete theCovariance;
65  delete theSelector;
66 }
std::vector< bool > * theSelector
AlgebraicSymMatrix * theCovariance

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.

Referenced by numSelected().

70 {
71  int selectorSize = static_cast<int>( theSelector->size() );
72  int paramSize = theParameters->num_row();
73  int covSize = theCovariance->num_row();
74 
75  if ( ( paramSize != covSize ) || ( paramSize != selectorSize ) )
76  throw cms::Exception("LogicError") << "@SUB=AlignmentParametersData::checkConsistency "
77  << "\nSize mismatch: parameter size = " << paramSize
78  << ", covariance size = " << covSize
79  << ", selector size = " << selectorSize << ".";
80 }
std::vector< bool > * theSelector
AlgebraicSymMatrix * theCovariance
const AlgebraicSymMatrix& AlignmentParametersData::covariance ( void  ) const
inline

Access to the covariance matrix.

Definition at line 43 of file AlignmentParametersData.h.

References theCovariance.

43 { return *theCovariance; }
AlgebraicSymMatrix * theCovariance
int AlignmentParametersData::numSelected ( void  )
inline

Access to the number of selected parameters.

Definition at line 49 of file AlignmentParametersData.h.

References checkConsistency(), and theNumSelected.

const AlgebraicVector& AlignmentParametersData::parameters ( void  ) const
inline
const std::vector<bool>& AlignmentParametersData::selector ( void  ) const
inline

Access to the selection vector.

Definition at line 46 of file AlignmentParametersData.h.

References theSelector.

46 { return *theSelector; }
std::vector< bool > * theSelector

Member Data Documentation

AlgebraicSymMatrix* AlignmentParametersData::theCovariance
private
int AlignmentParametersData::theNumSelected
private

Definition at line 61 of file AlignmentParametersData.h.

Referenced by AlignmentParametersData(), and numSelected().

AlgebraicVector* AlignmentParametersData::theParameters
private
std::vector<bool>* AlignmentParametersData::theSelector
private