00001 #include "DataFormats/Alignment/interface/TkFittedLasBeam.h" 00002 #include "FWCore/Utilities/interface/Exception.h" 00003 #include <vector> 00004 00006 TkFittedLasBeam::TkFittedLasBeam() 00007 { 00008 } 00009 00010 TkFittedLasBeam::TkFittedLasBeam(const TkLasBeam &lasBeam) : TkLasBeam(lasBeam) 00011 { 00012 } 00013 00015 void TkFittedLasBeam::setParameters(unsigned int parametrisation, 00016 const std::vector<Scalar> ¶ms, 00017 const AlgebraicSymMatrix ¶mCovariance, 00018 const AlgebraicMatrix &derivatives, 00019 unsigned int firstFixedParam, float chi2) 00020 { 00021 parametrisation_ = parametrisation; 00022 parameters_ = params; 00023 paramCovariance_ = paramCovariance; 00024 derivatives_ = derivatives; 00025 firstFixedParameter_ = firstFixedParam; 00026 chi2_ = chi2; 00027 00028 // check integrity 00029 if (parameters_.size() != static_cast<unsigned int>(derivatives_.num_col()) // # parameters 00030 || static_cast<unsigned int>(derivatives_.num_row()) != this->getData().size() // # hits 00031 || firstFixedParameter_ > parameters_.size() // index 'fixed' might be the 00032 || static_cast<unsigned int>(paramCovariance_.num_row()) != firstFixedParameter_) { 00033 throw cms::Exception("BadInput") 00034 << "[TkFittedLasBeam::setParameters] with inconsistent sizes: (parametrisation " 00035 << parametrisation << "):\n" 00036 << parameters_.size() << " parameters,\n" 00037 << derivatives_.num_row() << "x" << derivatives_.num_col() << " derivatives,\n" 00038 << "firstFixed = " << firstFixedParameter_ << " (i.e. " 00039 << static_cast<int>(parameters_.size()) - static_cast<int>(firstFixedParameter_) 00040 << " global parameters),\n" // cast on line before to allow difference to be < 0, [un]signed! 00041 << "cov. matrix size " << paramCovariance_.num_row() << ".\n"; 00042 } 00043 } 00044