CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
fftjetcms::Polynomial Class Reference

#include <ScaleCalculators.h>

Inheritance diagram for fftjetcms::Polynomial:

Public Member Functions

double operator() (const double &x) const
 
 Polynomial (const std::vector< double > &coeffs)
 
 ~Polynomial ()
 

Private Member Functions

 Polynomial ()
 

Private Attributes

double * coeffs_
 
const unsigned nCoeffs
 

Detailed Description

Definition at line 210 of file ScaleCalculators.h.

Constructor & Destructor Documentation

fftjetcms::Polynomial::Polynomial ( const std::vector< double > &  coeffs)
inline

Definition at line 213 of file ScaleCalculators.h.

References popcon2dropbox::copy().

214  : coeffs_(0), nCoeffs(coeffs.size())
215  {
216  if (nCoeffs)
217  {
218  coeffs_ = new double[nCoeffs];
219  std::copy(coeffs.begin(), coeffs.end(), coeffs_);
220  }
221  }
fftjetcms::Polynomial::~Polynomial ( )
inline

Definition at line 222 of file ScaleCalculators.h.

222 {delete [] coeffs_;}
fftjetcms::Polynomial::Polynomial ( )
private

Member Function Documentation

double fftjetcms::Polynomial::operator() ( const double &  x) const
inline

Definition at line 224 of file ScaleCalculators.h.

References i, and AlCaHLTBitMon_ParallelJobs::p.

225  {
226  double sum = 0.0;
227  const double* p = coeffs_ + nCoeffs - 1;
228  for (unsigned i=0; i<nCoeffs; ++i)
229  {
230  sum *= x;
231  sum += *p--;
232  }
233  return sum;
234  }
int i
Definition: DBlmapReader.cc:9
T x() const
Cartesian x coordinate.

Member Data Documentation

double* fftjetcms::Polynomial::coeffs_
private

Definition at line 238 of file ScaleCalculators.h.

const unsigned fftjetcms::Polynomial::nCoeffs
private

Definition at line 239 of file ScaleCalculators.h.