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 (AlgebraicVector *param, AlgebraicSymMatrix *cov)
 
 AlignmentParametersData (AlgebraicVector *param, AlgebraicSymMatrix *cov, std::vector< bool > *sel)
 
 AlignmentParametersData (const AlgebraicVector &param, const AlgebraicSymMatrix &cov)
 Constructor from parameters vector and covariance matrix. More...
 
 AlignmentParametersData (const AlgebraicVector &param, const AlgebraicSymMatrix &cov, const std::vector< bool > &sel)
 Constructor from parameters vector, covariance matrix and selection vector. More...
 
 AlignmentParametersData (void)
 Default constructor. 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) {}

◆ 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.

17  : theParameters(param), theCovariance(cov), theSelector(sel) {
18  theNumSelected = std::count_if(theSelector->begin(), theSelector->end(), [](auto const& c) { return c == true; });
19 }

References HltBtagPostValidation_cff::c, theNumSelected, and theSelector.

◆ 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.

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 }

References HltBtagPostValidation_cff::c, theNumSelected, and theSelector.

◆ 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()) {}

◆ 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()) {}

◆ ~AlignmentParametersData()

AlignmentParametersData::~AlignmentParametersData ( void  )
override

Definition at line 42 of file AlignmentParametersData.cc.

42  {
43  delete theParameters;
44  delete theCovariance;
45  delete theSelector;
46 }

References theCovariance, theParameters, and theSelector.

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.

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 }

References Exception, theCovariance, theParameters, and theSelector.

◆ covariance()

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

Access to the covariance matrix.

Definition at line 34 of file AlignmentParametersData.h.

34 { return *theCovariance; }

References theCovariance.

◆ numSelected()

int AlignmentParametersData::numSelected ( void  )
inline

Access to the number of selected parameters.

Definition at line 40 of file AlignmentParametersData.h.

40 { return theNumSelected; }

References theNumSelected.

◆ parameters()

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

Access to the parameter vector.

Definition at line 31 of file AlignmentParametersData.h.

31 { return *theParameters; }

References theParameters.

◆ selector()

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

Access to the selection vector.

Definition at line 37 of file AlignmentParametersData.h.

37 { return *theSelector; }

References 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
AlignmentParametersData::theParameters
AlgebraicVector * theParameters
Definition: AlignmentParametersData.h:48
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: AlgebraicObjects.h:15
AlignmentParametersData::theNumSelected
int theNumSelected
Definition: AlignmentParametersData.h:51
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
Exception
Definition: hltDiff.cc:246
AlignmentParametersData::theCovariance
AlgebraicSymMatrix * theCovariance
Definition: AlignmentParametersData.h:49
AlignmentParametersData::theSelector
std::vector< bool > * theSelector
Definition: AlignmentParametersData.h:50
EgammaValidation_Wenu_cff.sel
sel
Definition: EgammaValidation_Wenu_cff.py:33