test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TkFittedLasBeam.cc
Go to the documentation of this file.
3 #include <vector>
4 
7 {
8 }
9 
11 {
12 }
13 
15 void TkFittedLasBeam::setParameters(unsigned int parametrisation,
16  const std::vector<Scalar> &params,
17  const AlgebraicSymMatrix &paramCovariance,
18  const AlgebraicMatrix &derivatives,
19  unsigned int firstFixedParam, float chi2)
20 {
22  parameters_ = params;
23  paramCovariance_ = paramCovariance;
25  firstFixedParameter_ = firstFixedParam;
26  chi2_ = chi2;
27 
28  // check integrity
29  if (parameters_.size() != static_cast<unsigned int>(derivatives_.num_col()) // # parameters
30  || static_cast<unsigned int>(derivatives_.num_row()) != this->getData().size() // # hits
31  || firstFixedParameter_ > parameters_.size() // index 'fixed' might be the
32  || static_cast<unsigned int>(paramCovariance_.num_row()) != firstFixedParameter_) {
33  throw cms::Exception("BadInput")
34  << "[TkFittedLasBeam::setParameters] with inconsistent sizes: (parametrisation "
35  << parametrisation << "):\n"
36  << parameters_.size() << " parameters,\n"
37  << derivatives_.num_row() << "x" << derivatives_.num_col() << " derivatives,\n"
38  << "firstFixed = " << firstFixedParameter_ << " (i.e. "
39  << static_cast<int>(parameters_.size()) - static_cast<int>(firstFixedParameter_)
40  << " global parameters),\n" // cast on line before to allow difference to be < 0, [un]signed!
41  << "cov. matrix size " << paramCovariance_.num_row() << ".\n";
42  }
43 }
44 
const AlgebraicMatrix & derivatives() const
matrix of local derivatives: columns are parameters, rows are hits
unsigned int parametrisation_
CLHEP::HepMatrix AlgebraicMatrix
unsigned int parametrisation() const
the parametrisation type used (0 means undefined...)
AlgebraicSymMatrix paramCovariance_
beam parameters (depend on parameterisation_)
unsigned int firstFixedParameter_
derivatives with respect to parameters_
CLHEP::HepSymMatrix AlgebraicSymMatrix
const std::vector< SiStripLaserRecHit2D > & getData(void) const
access the collection of hits
Definition: TkLasBeam.h:28
std::vector< Scalar > parameters_
type of parameterisation (0 means undefined)
float chi2_
first non-free parameter in (local) fit
AlgebraicMatrix derivatives_
cov. matrix of &#39;free&#39; params. (dim=firstFixedParameter_)
void setParameters(unsigned int parametrisation, const std::vector< Scalar > &params, const AlgebraicSymMatrix &paramCovariance, const AlgebraicMatrix &derivatives, unsigned int firstFixedParam, float chi2)