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

◆ DataContainer

Definition at line 9 of file AlignmentParametersData.h.

Constructor & Destructor Documentation

◆ AlignmentParametersData() [1/5]

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() [2/5]

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 HltBtagPostValidation_cff::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 }
std::vector< bool > * theSelector
AlgebraicSymMatrix * theCovariance

◆ AlignmentParametersData() [3/5]

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 HltBtagPostValidation_cff::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 }
CLHEP::HepVector AlgebraicVector
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::vector< bool > * theSelector
AlgebraicSymMatrix * theCovariance

◆ AlignmentParametersData() [4/5]

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() [5/5]

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::~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

◆ checkConsistency()

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

◆ covariance()

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

◆ numSelected()

int AlignmentParametersData::numSelected ( void  )
inline

Access to the number of selected parameters.

Definition at line 40 of file AlignmentParametersData.h.

References theNumSelected.

◆ parameters()

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; }

◆ selector()

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

◆ theCovariance

AlgebraicSymMatrix* AlignmentParametersData::theCovariance
private

◆ theNumSelected

int AlignmentParametersData::theNumSelected
private

Definition at line 51 of file AlignmentParametersData.h.

Referenced by AlignmentParametersData(), and numSelected().

◆ theParameters

AlgebraicVector* AlignmentParametersData::theParameters
private

◆ theSelector

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