Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:46

0001 #include "DataFormats/Alignment/interface/TkFittedLasBeam.h"
0002 #include "FWCore/Utilities/interface/Exception.h"
0003 #include <vector>
0004 
0005 ////////////////////////////////////////////////////////////////////////////////
0006 TkFittedLasBeam::TkFittedLasBeam() {}
0007 
0008 TkFittedLasBeam::TkFittedLasBeam(const TkLasBeam &lasBeam) : TkLasBeam(lasBeam) {}
0009 
0010 ////////////////////////////////////////////////////////////////////////////////
0011 void TkFittedLasBeam::setParameters(unsigned int parametrisation,
0012                                     const std::vector<Scalar> &params,
0013                                     const AlgebraicSymMatrix &paramCovariance,
0014                                     const AlgebraicMatrix &derivatives,
0015                                     unsigned int firstFixedParam,
0016                                     float chi2) {
0017   parametrisation_ = parametrisation;
0018   parameters_ = params;
0019   paramCovariance_ = paramCovariance;
0020   derivatives_ = derivatives;
0021   firstFixedParameter_ = firstFixedParam;
0022   chi2_ = chi2;
0023 
0024   // check integrity
0025   if (parameters_.size() != static_cast<unsigned int>(derivatives_.num_col())         // # parameters
0026       || static_cast<unsigned int>(derivatives_.num_row()) != this->getData().size()  // # hits
0027       || firstFixedParameter_ > parameters_.size()                                    // index 'fixed' might be the
0028       || static_cast<unsigned int>(paramCovariance_.num_row()) != firstFixedParameter_) {
0029     throw cms::Exception("BadInput")
0030         << "[TkFittedLasBeam::setParameters] with inconsistent sizes: (parametrisation " << parametrisation << "):\n"
0031         << parameters_.size() << " parameters,\n"
0032         << derivatives_.num_row() << "x" << derivatives_.num_col() << " derivatives,\n"
0033         << "firstFixed = " << firstFixedParameter_ << " (i.e. "
0034         << static_cast<int>(parameters_.size()) - static_cast<int>(firstFixedParameter_)
0035         << " global parameters),\n"  // cast on line before to allow difference to be < 0, [un]signed!
0036         << "cov. matrix size " << paramCovariance_.num_row() << ".\n";
0037   }
0038 }