CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
resolutionFunctionBase< T > Class Template Referenceabstract

#include <Functions.h>

Inheritance diagram for resolutionFunctionBase< T >:
resolutionFunctionType0< T > resolutionFunctionType45< T > resolutionFunctionType46< T > resolutionFunctionType47< T >

Public Member Functions

virtual double covPt1Pt2 (const double &pt1, const double &eta1, const double &pt2, const double &eta2, const T &parval)
 
virtual int parNum () const
 
 resolutionFunctionBase ()
 
virtual void setParameters (double *Start, double *Step, double *Mini, double *Maxi, int *ind, TString *parname, const T &parResol, const std::vector< int > &parResolOrder, const int muonType)
 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 double sigmaCotgTh (const double &pt, const double &eta, const T &parval)=0
 
virtual double sigmaPhi (const double &pt, const double &eta, const T &parval)=0
 
virtual double sigmaPt (const double &pt, const double &eta, const T &parval)=0
 
virtual double sigmaPtError (const double &pt, const double &eta, const T &parval, const T &parError)
 
virtual ~resolutionFunctionBase ()=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, 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 resolutionFunctionBase< T >

Resolution functions.
Need to use templates to make it work with both array and std::vector<double>.

Definition at line 828 of file Functions.h.

Constructor & Destructor Documentation

◆ resolutionFunctionBase()

template<class T>
resolutionFunctionBase< T >::resolutionFunctionBase ( )
inline

Definition at line 838 of file Functions.h.

838 {}

◆ ~resolutionFunctionBase()

template<class T >
resolutionFunctionBase< T >::~resolutionFunctionBase ( )
inlinepure virtual

Definition at line 916 of file Functions.h.

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

Member Function Documentation

◆ covPt1Pt2()

template<class T>
virtual double resolutionFunctionBase< T >::covPt1Pt2 ( const double &  pt1,
const double &  eta1,
const double &  pt2,
const double &  eta2,
const T parval 
)
inlinevirtual

Reimplemented in resolutionFunctionType47< T >.

Definition at line 834 of file Functions.h.

Referenced by ErrorsPropagationAnalyzer::massResolution(), and MuScleFitUtils::massResolution().

835  {
836  return 0.;
837  }

◆ parNum()

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

Definition at line 865 of file Functions.h.

Referenced by MuScleFitUtils::minimizeLikelihood().

865 { return parNum_; }

◆ setPar() [1/2]

template<class T>
virtual void resolutionFunctionBase< T >::setPar ( double *  Start,
double *  Step,
double *  Mini,
double *  Maxi,
int *  ind,
TString *  parname,
const T parResol,
const std::vector< int > &  parResolOrder,
double *  thisStep,
double *  thisMini,
double *  thisMaxi,
TString *  thisParName 
)
inlineprotectedvirtual

This method sets the parameters.

Definition at line 870 of file Functions.h.

Referenced by resolutionFunctionType45< T >::setParameters(), resolutionFunctionType46< T >::setParameters(), and resolutionFunctionType47< T >::setParameters().

881  {
882  for (int iPar = 0; iPar < this->parNum_; ++iPar) {
883  Start[iPar] = parResol[iPar];
884  Step[iPar] = thisStep[iPar];
885  Mini[iPar] = thisMini[iPar];
886  Maxi[iPar] = thisMaxi[iPar];
887  ind[iPar] = parResolOrder[iPar];
888  parname[iPar] = thisParName[iPar];
889  }
890  }

◆ setPar() [2/2]

template<class T>
virtual void resolutionFunctionBase< 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 891 of file Functions.h.

899  {
900  if (int(parSet.size()) != this->parNum_) {
901  std::cout << "Error: wrong number of parameter initializations = " << parSet.size()
902  << ". Number of parameters is " << this->parNum_ << std::endl;
903  exit(1);
904  }
905  for (int iPar = 0; iPar < this->parNum_; ++iPar) {
906  Start[iPar] = parResol[iPar];
907  Step[iPar] = parSet[iPar].step;
908  Mini[iPar] = parSet[iPar].mini;
909  Maxi[iPar] = parSet[iPar].maxi;
910  ind[iPar] = parResolOrder[iPar];
911  parname[iPar] = parSet[iPar].name;
912  }
913  }
def exit(msg="")

◆ setParameters() [1/2]

template<class T>
virtual void resolutionFunctionBase< T >::setParameters ( double *  Start,
double *  Step,
double *  Mini,
double *  Maxi,
int *  ind,
TString *  parname,
const T parResol,
const std::vector< int > &  parResolOrder,
const int  muonType 
)
inlinevirtual

This method is used to differentiate parameters among the different functions.

Reimplemented in resolutionFunctionType47< T >, resolutionFunctionType46< T >, resolutionFunctionType45< T >, and resolutionFunctionType0< T >.

Definition at line 841 of file Functions.h.

Referenced by MuScleFitUtils::minimizeLikelihood().

849  {};

◆ setParameters() [2/2]

template<class T>
virtual void resolutionFunctionBase< 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

Reimplemented in resolutionFunctionType47< T >, resolutionFunctionType46< T >, resolutionFunctionType45< T >, and resolutionFunctionType0< T >.

Definition at line 850 of file Functions.h.

861  {
862  std::cout << "The method setParameters must be implemented for this resolution function" << std::endl;
863  exit(1);
864  }
def exit(msg="")

◆ sigmaCotgTh()

template<class T>
virtual double resolutionFunctionBase< T >::sigmaCotgTh ( const double &  pt,
const double &  eta,
const T parval 
)
pure virtual

◆ sigmaPhi()

template<class T>
virtual double resolutionFunctionBase< T >::sigmaPhi ( const double &  pt,
const double &  eta,
const T parval 
)
pure virtual

◆ sigmaPt()

template<class T>
virtual double resolutionFunctionBase< T >::sigmaPt ( const double &  pt,
const double &  eta,
const T parval 
)
pure virtual

◆ sigmaPtError()

template<class T>
virtual double resolutionFunctionBase< T >::sigmaPtError ( const double &  pt,
const double &  eta,
const T parval,
const T parError 
)
inlinevirtual

Member Data Documentation

◆ parNum_

template<class T>
int resolutionFunctionBase< T >::parNum_
protected