CMS 3D CMS Logo

AlignmentParametersData.cc
Go to the documentation of this file.
2 
4 
5 #include <algorithm>
6 #include <functional>
7 
9  : theParameters(new AlgebraicVector()),
10  theCovariance(new AlgebraicSymMatrix()),
11  theSelector(new std::vector<bool>()),
12  theNumSelected(0) {}
13 
15  AlgebraicSymMatrix* cov,
16  std::vector<bool>* sel)
17  : theParameters(param), theCovariance(cov), theSelector(sel) {
18  theNumSelected = std::count_if(theSelector->begin(), theSelector->end(), [](auto const& c) { return c == true; });
19 }
20 
22  const AlgebraicSymMatrix& cov,
23  const std::vector<bool>& sel)
24  : theParameters(new AlgebraicVector(param)),
25  theCovariance(new AlgebraicSymMatrix(cov)),
26  theSelector(new std::vector<bool>(sel)) {
27  theNumSelected = std::count_if(theSelector->begin(), theSelector->end(), [](auto const& c) { return c == true; });
28 }
29 
31  : theParameters(param),
32  theCovariance(cov),
33  theSelector(new std::vector<bool>(param->num_row(), true)),
34  theNumSelected(param->num_row()) {}
35 
37  : theParameters(new AlgebraicVector(param)),
38  theCovariance(new AlgebraicSymMatrix(cov)),
39  theSelector(new std::vector<bool>(param.num_row(), true)),
40  theNumSelected(param.num_row()) {}
41 
43  delete theParameters;
44  delete theCovariance;
45  delete theSelector;
46 }
47 
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 }
electrons_cff.bool
bool
Definition: electrons_cff.py:372
AlignmentParametersData::theParameters
AlgebraicVector * theParameters
Definition: AlignmentParametersData.h:48
AlignmentParametersData.h
AlignmentParametersData::~AlignmentParametersData
~AlignmentParametersData(void) override
Definition: AlignmentParametersData.cc:42
AlignmentParametersData::checkConsistency
void checkConsistency(void) const
Definition: AlignmentParametersData.cc:48
AlignmentParametersData::AlignmentParametersData
AlignmentParametersData(void)
Default constructor.
Definition: AlignmentParametersData.cc:8
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
funct::true
true
Definition: Factorize.h:173
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
std
Definition: JetResolutionObject.h:76
Exception
Definition: hltDiff.cc:246
AlignmentParametersData::theCovariance
AlgebraicSymMatrix * theCovariance
Definition: AlignmentParametersData.h:49
Exception.h
AlignmentParametersData::theSelector
std::vector< bool > * theSelector
Definition: AlignmentParametersData.h:50
EgammaValidation_Wenu_cff.sel
sel
Definition: EgammaValidation_Wenu_cff.py:33