CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes

scaleFunctionBase< T > Class Template Reference

#include <Functions.h>

Inheritance diagram for scaleFunctionBase< T >:
scaleFunctionType0< T > scaleFunctionType1< T > scaleFunctionType10< T > scaleFunctionType11< T > scaleFunctionType12< T > scaleFunctionType13< T > scaleFunctionType14< T > scaleFunctionType15< T > scaleFunctionType16< T > scaleFunctionType17< T > scaleFunctionType18< T > scaleFunctionType19< T > scaleFunctionType2< T > scaleFunctionType20< T > scaleFunctionType21< T > scaleFunctionType22< T > scaleFunctionType23< T > scaleFunctionType24< T > scaleFunctionType25< T > scaleFunctionType26< T > scaleFunctionType27< T > scaleFunctionType28< T > scaleFunctionType29< T > scaleFunctionType3< T > scaleFunctionType30< T > scaleFunctionType31< T > scaleFunctionType32< T > scaleFunctionType33< T > scaleFunctionType34< T > scaleFunctionType35< T > scaleFunctionType36< T > scaleFunctionType37< T > scaleFunctionType38< T > scaleFunctionType4< T > scaleFunctionType5< T > scaleFunctionType50< T > scaleFunctionType51< T > scaleFunctionType52< T > scaleFunctionType6< T > scaleFunctionType7< T > scaleFunctionType8< T > scaleFunctionType9< T >

List of all members.

Public Member Functions

virtual int parNum () const
virtual void resetParameters (std::vector< double > *scaleVec) const
 This method is used to reset the scale parameters to neutral values (useful for iterations > 0)
virtual double scale (const double &pt, const double &eta, const double &phi, const int chg, const T &parScale) const =0
virtual void setParameters (double *Start, double *Step, double *Mini, double *Maxi, int *ind, TString *parname, const T &parScale, const std::vector< int > &parScaleOrder, const int muonType)=0
 This method is used to differentiate parameters among the different functions.
virtual void setParameters (double *Start, double *Step, double *Mini, double *Maxi, int *ind, TString *parname, const T &parResol, const std::vector< int > &parResolOrder, const std::vector< double > &parStep, const std::vector< double > &parMin, const std::vector< double > &parMax, const int muonType)
virtual ~scaleFunctionBase ()=0

Protected Member Functions

virtual void setPar (double *Start, double *Step, double *Mini, double *Maxi, int *ind, TString *parname, const T &parScale, const std::vector< int > &parScaleOrder, double *thisStep, double *thisMini, double *thisMaxi, TString *thisParName)
 This method sets the parameters.
virtual void setPar (double *Start, double *Step, double *Mini, double *Maxi, int *ind, TString *parname, const T &parResol, const std::vector< int > &parResolOrder, const std::vector< ParameterSet > &parSet)

Protected Attributes

int parNum_

Detailed Description

template<class T>
class scaleFunctionBase< T >

The correct functor is selected at job start in the constructor. The pt value is taken by reference and modified internally. eta, phi and chg are taken by const reference.
Made into a template so that it can be used with arrays too (parval for the scale fit is an array, because Lykelihood is an extern C function, because TMinuit asks it).
Note that in the array case it takes the pointer by const reference, thus the elements of the array are modifiable.

Definition at line 44 of file Functions.h.


Constructor & Destructor Documentation

template<class T >
scaleFunctionBase< T >::~scaleFunctionBase ( ) [inline, pure virtual]

Definition at line 99 of file Functions.h.

{ }  // defined even though it's pure virtual; should be faster this way.

Member Function Documentation

template<class T>
virtual int scaleFunctionBase< T >::parNum ( ) const [inline, virtual]

Definition at line 66 of file Functions.h.

Referenced by MuScleFitUtils::minimizeLikelihood().

{ return parNum_; }
template<class T>
virtual void scaleFunctionBase< T >::resetParameters ( std::vector< double > *  scaleVec) const [inline, virtual]
template<class T>
virtual double scaleFunctionBase< T >::scale ( const double &  pt,
const double &  eta,
const double &  phi,
const int  chg,
const T parScale 
) const [pure virtual]
template<class T>
virtual void scaleFunctionBase< T >::setPar ( double *  Start,
double *  Step,
double *  Mini,
double *  Maxi,
int *  ind,
TString *  parname,
const T parResol,
const std::vector< int > &  parResolOrder,
const std::vector< ParameterSet > &  parSet 
) [inline, protected, virtual]

Definition at line 82 of file Functions.h.

                                                                                                                              {
    if( int(parSet.size()) != this->parNum_ ) {
      std::cout << "Error: wrong number of parameter initializations = " << parSet.size() << ". Number of parameters is " << this->parNum_ << std::endl;
      exit(1);
    }
    for( int iPar=0; iPar<this->parNum_; ++iPar ) {
      Start[iPar] = parResol[iPar];
      Step[iPar] = parSet[iPar].step;
      Mini[iPar] = parSet[iPar].mini;
      Maxi[iPar] = parSet[iPar].maxi;
      ind[iPar] = parResolOrder[iPar];
      parname[iPar] = parSet[iPar].name;
    }
  }
template<class T>
virtual void scaleFunctionBase< T >::setPar ( double *  Start,
double *  Step,
double *  Mini,
double *  Maxi,
int *  ind,
TString *  parname,
const T parScale,
const std::vector< int > &  parScaleOrder,
double *  thisStep,
double *  thisMini,
double *  thisMaxi,
TString *  thisParName 
) [inline, protected, virtual]

This method sets the parameters.

Definition at line 70 of file Functions.h.

Referenced by scaleFunctionType37< T >::setParameters(), scaleFunctionType23< T >::setParameters(), scaleFunctionType30< T >::setParameters(), scaleFunctionType3< T >::setParameters(), scaleFunctionType13< T >::setParameters(), scaleFunctionType29< T >::setParameters(), scaleFunctionType9< T >::setParameters(), scaleFunctionType19< T >::setParameters(), scaleFunctionType33< T >::setParameters(), scaleFunctionType28< T >::setParameters(), scaleFunctionType8< T >::setParameters(), scaleFunctionType18< T >::setParameters(), scaleFunctionType25< T >::setParameters(), scaleFunctionType5< T >::setParameters(), scaleFunctionType15< T >::setParameters(), scaleFunctionType26< T >::setParameters(), scaleFunctionType6< T >::setParameters(), scaleFunctionType16< T >::setParameters(), scaleFunctionType38< T >::setParameters(), scaleFunctionType51< T >::setParameters(), scaleFunctionType35< T >::setParameters(), scaleFunctionType52< T >::setParameters(), scaleFunctionType24< T >::setParameters(), scaleFunctionType36< T >::setParameters(), scaleFunctionType4< T >::setParameters(), scaleFunctionType14< T >::setParameters(), scaleFunctionType21< T >::setParameters(), scaleFunctionType50< T >::setParameters(), scaleFunctionType1< T >::setParameters(), scaleFunctionType11< T >::setParameters(), scaleFunctionType22< T >::setParameters(), scaleFunctionType2< T >::setParameters(), scaleFunctionType12< T >::setParameters(), scaleFunctionType27< T >::setParameters(), scaleFunctionType34< T >::setParameters(), scaleFunctionType7< T >::setParameters(), scaleFunctionType17< T >::setParameters(), scaleFunctionType20< T >::setParameters(), scaleFunctionType31< T >::setParameters(), scaleFunctionType10< T >::setParameters(), and scaleFunctionType32< T >::setParameters().

                                                                                                   {
    for( int iPar=0; iPar<this->parNum_; ++iPar ) {
      Start[iPar] = parScale[iPar];
      Step[iPar] = thisStep[iPar];
      Mini[iPar] = thisMini[iPar];
      Maxi[iPar] = thisMaxi[iPar];
      ind[iPar] = parScaleOrder[iPar];
      parname[iPar] = thisParName[iPar];
    }
  }
template<class T>
virtual void scaleFunctionBase< T >::setParameters ( double *  Start,
double *  Step,
double *  Mini,
double *  Maxi,
int *  ind,
TString *  parname,
const T parResol,
const std::vector< int > &  parResolOrder,
const std::vector< double > &  parStep,
const std::vector< double > &  parMin,
const std::vector< double > &  parMax,
const int  muonType 
) [inline, virtual]
template<class T>
virtual void scaleFunctionBase< T >::setParameters ( double *  Start,
double *  Step,
double *  Mini,
double *  Maxi,
int *  ind,
TString *  parname,
const T parScale,
const std::vector< int > &  parScaleOrder,
const int  muonType 
) [pure virtual]

Member Data Documentation

template<class T>
int scaleFunctionBase< T >::parNum_ [protected]

Definition at line 68 of file Functions.h.

Referenced by scaleFunctionBase< std::vector< double > >::parNum(), scaleFunctionType10< T >::resetParameters(), scaleFunctionType9< T >::resetParameters(), scaleFunctionType20< T >::resetParameters(), scaleFunctionType13< T >::resetParameters(), scaleFunctionType23< T >::resetParameters(), scaleFunctionType19< T >::resetParameters(), scaleFunctionType29< T >::resetParameters(), scaleFunctionType5< T >::resetParameters(), scaleFunctionType35< T >::resetParameters(), scaleFunctionType8< T >::resetParameters(), scaleFunctionType38< T >::resetParameters(), scaleFunctionType15< T >::resetParameters(), scaleFunctionType6< T >::resetParameters(), scaleFunctionType51< T >::resetParameters(), scaleFunctionType36< T >::resetParameters(), scaleFunctionType25< T >::resetParameters(), scaleFunctionType18< T >::resetParameters(), scaleFunctionType28< T >::resetParameters(), scaleFunctionType1< T >::resetParameters(), scaleFunctionType31< T >::resetParameters(), scaleFunctionType16< T >::resetParameters(), scaleFunctionType4< T >::resetParameters(), scaleFunctionType52< T >::resetParameters(), scaleFunctionType34< T >::resetParameters(), scaleFunctionType26< T >::resetParameters(), scaleFunctionType7< T >::resetParameters(), scaleFunctionType37< T >::resetParameters(), scaleFunctionType11< T >::resetParameters(), scaleFunctionType2< T >::resetParameters(), scaleFunctionType50< T >::resetParameters(), scaleFunctionType32< T >::resetParameters(), scaleFunctionType21< T >::resetParameters(), scaleFunctionType14< T >::resetParameters(), scaleFunctionType24< T >::resetParameters(), scaleFunctionType17< T >::resetParameters(), scaleFunctionType30< T >::resetParameters(), scaleFunctionType27< T >::resetParameters(), scaleFunctionType12< T >::resetParameters(), scaleFunctionType3< T >::resetParameters(), scaleFunctionType33< T >::resetParameters(), scaleFunctionType22< T >::resetParameters(), scaleFunctionType0< T >::scaleFunctionType0(), scaleFunctionType1< T >::scaleFunctionType1(), scaleFunctionType10< T >::scaleFunctionType10(), scaleFunctionType11< T >::scaleFunctionType11(), scaleFunctionType12< T >::scaleFunctionType12(), scaleFunctionType13< T >::scaleFunctionType13(), scaleFunctionType14< T >::scaleFunctionType14(), scaleFunctionType15< T >::scaleFunctionType15(), scaleFunctionType16< T >::scaleFunctionType16(), scaleFunctionType17< T >::scaleFunctionType17(), scaleFunctionType18< T >::scaleFunctionType18(), scaleFunctionType19< T >::scaleFunctionType19(), scaleFunctionType2< T >::scaleFunctionType2(), scaleFunctionType20< T >::scaleFunctionType20(), scaleFunctionType21< T >::scaleFunctionType21(), scaleFunctionType22< T >::scaleFunctionType22(), scaleFunctionType23< T >::scaleFunctionType23(), scaleFunctionType24< T >::scaleFunctionType24(), scaleFunctionType25< T >::scaleFunctionType25(), scaleFunctionType26< T >::scaleFunctionType26(), scaleFunctionType27< T >::scaleFunctionType27(), scaleFunctionType28< T >::scaleFunctionType28(), scaleFunctionType29< T >::scaleFunctionType29(), scaleFunctionType3< T >::scaleFunctionType3(), scaleFunctionType30< T >::scaleFunctionType30(), scaleFunctionType31< T >::scaleFunctionType31(), scaleFunctionType32< T >::scaleFunctionType32(), scaleFunctionType33< T >::scaleFunctionType33(), scaleFunctionType34< T >::scaleFunctionType34(), scaleFunctionType35< T >::scaleFunctionType35(), scaleFunctionType36< T >::scaleFunctionType36(), scaleFunctionType37< T >::scaleFunctionType37(), scaleFunctionType38< T >::scaleFunctionType38(), scaleFunctionType4< T >::scaleFunctionType4(), scaleFunctionType5< T >::scaleFunctionType5(), scaleFunctionType50< T >::scaleFunctionType50(), scaleFunctionType51< T >::scaleFunctionType51(), scaleFunctionType52< T >::scaleFunctionType52(), scaleFunctionType6< T >::scaleFunctionType6(), scaleFunctionType7< T >::scaleFunctionType7(), scaleFunctionType8< T >::scaleFunctionType8(), scaleFunctionType9< T >::scaleFunctionType9(), scaleFunctionBase< std::vector< double > >::setPar(), scaleFunctionType37< T >::setParameters(), scaleFunctionType30< T >::setParameters(), scaleFunctionType23< T >::setParameters(), scaleFunctionType29< T >::setParameters(), scaleFunctionType33< T >::setParameters(), scaleFunctionType51< T >::setParameters(), scaleFunctionType38< T >::setParameters(), scaleFunctionType6< T >::setParameters(), scaleFunctionType52< T >::setParameters(), scaleFunctionType35< T >::setParameters(), scaleFunctionType36< T >::setParameters(), scaleFunctionType50< T >::setParameters(), scaleFunctionType1< T >::setParameters(), scaleFunctionType34< T >::setParameters(), scaleFunctionType31< T >::setParameters(), and scaleFunctionType32< T >::setParameters().