CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< AlignmentParametersData
DataContainer
 

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 9 of file AlignmentParametersData.h.

Constructor & Destructor Documentation

AlignmentParametersData::AlignmentParametersData ( void  )

Default constructor.

Definition at line 8 of file AlignmentParametersData.cc.

11  theSelector(new std::vector<bool>()),
12  theNumSelected(0) {}
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 14 of file AlignmentParametersData.cc.

References c, theNumSelected, and theSelector.

17  : theParameters(param), theCovariance(cov), theSelector(sel) {
18  theNumSelected = std::count_if(theSelector->begin(), theSelector->end(), [](auto const& c) { return c == true; });
19 }
const edm::EventSetup & c
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 21 of file AlignmentParametersData.cc.

References c, theNumSelected, and theSelector.

24  : theParameters(new AlgebraicVector(param)),
26  theSelector(new std::vector<bool>(sel)) {
27  theNumSelected = std::count_if(theSelector->begin(), theSelector->end(), [](auto const& c) { return c == true; });
28 }
const edm::EventSetup & c
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 30 of file AlignmentParametersData.cc.

31  : theParameters(param),
32  theCovariance(cov),
33  theSelector(new std::vector<bool>(param->num_row(), true)),
34  theNumSelected(param->num_row()) {}
std::vector< bool > * theSelector
AlgebraicSymMatrix * theCovariance
AlignmentParametersData::AlignmentParametersData ( const AlgebraicVector param,
const AlgebraicSymMatrix cov 
)

Constructor from parameters vector and covariance matrix.

Definition at line 36 of file AlignmentParametersData.cc.

37  : theParameters(new AlgebraicVector(param)),
39  theSelector(new std::vector<bool>(param.num_row(), true)),
40  theNumSelected(param.num_row()) {}
CLHEP::HepVector AlgebraicVector
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::vector< bool > * theSelector
AlgebraicSymMatrix * theCovariance
AlignmentParametersData::~AlignmentParametersData ( void  )
override

Definition at line 42 of file AlignmentParametersData.cc.

References theCovariance, theParameters, and theSelector.

42  {
43  delete theParameters;
44  delete theCovariance;
45  delete theSelector;
46 }
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 48 of file AlignmentParametersData.cc.

References Exception, theCovariance, theParameters, and theSelector.

48  {
49  int selectorSize = static_cast<int>(theSelector->size());
50  int paramSize = theParameters->num_row();
51  int covSize = theCovariance->num_row();
52 
53  if ((paramSize != covSize) || (paramSize != selectorSize))
54  throw cms::Exception("LogicError") << "@SUB=AlignmentParametersData::checkConsistency "
55  << "\nSize mismatch: parameter size = " << paramSize
56  << ", covariance size = " << covSize << ", selector size = " << selectorSize
57  << ".";
58 }
std::vector< bool > * theSelector
AlgebraicSymMatrix * theCovariance
const AlgebraicSymMatrix& AlignmentParametersData::covariance ( void  ) const
inline

Access to the covariance matrix.

Definition at line 34 of file AlignmentParametersData.h.

References theCovariance.

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

Access to the number of selected parameters.

Definition at line 40 of file AlignmentParametersData.h.

References theNumSelected.

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

Access to the parameter vector.

Definition at line 31 of file AlignmentParametersData.h.

References theParameters.

31 { return *theParameters; }
const std::vector<bool>& AlignmentParametersData::selector ( void  ) const
inline

Access to the selection vector.

Definition at line 37 of file AlignmentParametersData.h.

References theSelector.

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

Member Data Documentation

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

Definition at line 51 of file AlignmentParametersData.h.

Referenced by AlignmentParametersData(), and numSelected().

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