CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
scaleFunctionBase< T > Class Template Referenceabstract

#include <Functions.h>

Inheritance diagram for scaleFunctionBase< T >:
scaleFunction50< 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 >

Public Member Functions

virtual int parNum () const
 
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) More...
 
virtual double scale (const double &pt, const double &eta, const double &phi, const int chg, const T &parScale) const =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. More...
 
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
 
virtual ~scaleFunctionBase ()=0
 

Protected Member Functions

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< ParSet > &parSet)
 
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. More...
 
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 ( )
inlinepure virtual

Definition at line 99 of file Functions.h.

99 { } // defined even though it's pure virtual; should be faster this way.
template<class T>
virtual scaleFunctionBase< T >::~scaleFunctionBase ( )
pure virtual

Member Function Documentation

template<class T>
virtual int scaleFunctionBase< T >::parNum ( ) const
inlinevirtual

Definition at line 48 of file MuScleFitCorrector_Functions.h.

48 { return parNum_; }
template<class T>
virtual int scaleFunctionBase< T >::parNum ( ) const
inlinevirtual
template<class T>
virtual void scaleFunctionBase< T >::resetParameters ( std::vector< double > *  scaleVec) const
inlinevirtual

This method is used to reset the scale parameters to neutral values (useful for iterations > 0)

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

Definition at line 49 of file Functions.h.

Referenced by MuScleFitUtils::minimizeLikelihood().

49  {
50  std::cout << "ERROR: the resetParameters method must be defined in each scale function" << std::endl;
51  std::cout << "Please add it to the scaleFunction you are using" << std::endl;
52  exit(1);
53  }
tuple cout
Definition: gather_cfg.py:121
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 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< ParSet > &  parSet 
)
inlineprotectedvirtual

Definition at line 51 of file MuScleFitCorrector_Functions.h.

52  {
53  if( int(parSet.size()) != this->parNum_ ) {
54  std::cout << "Error: wrong number of parameter initializations = " << parSet.size() << ". Number of parameters is " << this->parNum_ << std::endl;
55  exit(1);
56  }
57  for( int iPar=0; iPar<this->parNum_; ++iPar ) {
58  Start[iPar] = parResol[iPar];
59  Step[iPar] = parSet[iPar].step;
60  Mini[iPar] = parSet[iPar].mini;
61  Maxi[iPar] = parSet[iPar].maxi;
62  ind[iPar] = parResolOrder[iPar];
63  parname[iPar] = parSet[iPar].name;
64  }
65  }
tuple cout
Definition: gather_cfg.py:121
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 
)
inlineprotectedvirtual

This method sets the parameters.

Definition at line 70 of file Functions.h.

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

72  {
73  for( int iPar=0; iPar<this->parNum_; ++iPar ) {
74  Start[iPar] = parScale[iPar];
75  Step[iPar] = thisStep[iPar];
76  Mini[iPar] = thisMini[iPar];
77  Maxi[iPar] = thisMaxi[iPar];
78  ind[iPar] = parScaleOrder[iPar];
79  parname[iPar] = thisParName[iPar];
80  }
81  }
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 
)
inlineprotectedvirtual

Definition at line 82 of file Functions.h.

83  {
84  if( int(parSet.size()) != this->parNum_ ) {
85  std::cout << "Error: wrong number of parameter initializations = " << parSet.size() << ". Number of parameters is " << this->parNum_ << std::endl;
86  exit(1);
87  }
88  for( int iPar=0; iPar<this->parNum_; ++iPar ) {
89  Start[iPar] = parResol[iPar];
90  Step[iPar] = parSet[iPar].step;
91  Mini[iPar] = parSet[iPar].mini;
92  Maxi[iPar] = parSet[iPar].maxi;
93  ind[iPar] = parResolOrder[iPar];
94  parname[iPar] = parSet[iPar].name;
95  }
96  }
tuple cout
Definition: gather_cfg.py:121
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
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 
)
inlinevirtual

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