CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AlignmentParametersData.cc
Go to the documentation of this file.
2 
4 
5 #include <algorithm>
6 #include <functional>
7 
8 
10  theParameters( new AlgebraicVector() ),
11  theCovariance( new AlgebraicSymMatrix() ),
12  theSelector( new std::vector<bool>() ),
13  theNumSelected( 0 )
14 {}
15 
16 
18  AlgebraicSymMatrix* cov,
19  std::vector<bool>* sel ) :
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 }
28 
29 
31  const AlgebraicSymMatrix& cov,
32  const std::vector<bool>& sel ) :
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 }
41 
42 
44  AlgebraicSymMatrix* cov ) :
45  theParameters( param ),
46  theCovariance( cov ),
47  theSelector( new std::vector<bool>( param->num_row(), true ) ),
48  theNumSelected( param->num_row() )
49 {}
50 
51 
53  const AlgebraicSymMatrix& cov ) :
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 {}
59 
60 
62 {
63  delete theParameters;
64  delete theCovariance;
65  delete theSelector;
66 }
67 
68 
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 }
AlignmentParametersData(void)
Default constructor.
CLHEP::HepVector AlgebraicVector
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::vector< bool > * theSelector
AlgebraicSymMatrix * theCovariance