CMS 3D CMS Logo

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

#include <Functions.h>

Inheritance diagram for scaleFunctionType22< T >:
scaleFunctionBase< T >

Public Member Functions

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
 
 scaleFunctionType22 ()
 
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)
 This method is used to differentiate parameters among the different functions. More...
 
- Public Member Functions inherited from scaleFunctionBase< T >
virtual int parNum () const
 
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
 

Additional Inherited Members

- Protected Member Functions inherited from scaleFunctionBase< T >
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 inherited from scaleFunctionBase< T >
int parNum_
 

Detailed Description

template<class T>
class scaleFunctionType22< T >

Definition at line 993 of file Functions.h.

Constructor & Destructor Documentation

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

Definition at line 996 of file Functions.h.

References scaleFunctionBase< T >::parNum_.

996 { this->parNum_ = 5; }

Member Function Documentation

template<class T >
virtual void scaleFunctionType22< 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 from scaleFunctionBase< T >.

Definition at line 1022 of file Functions.h.

References i, and scaleFunctionBase< T >::parNum_.

1023  {
1024  scaleVec->push_back(1);
1025  for( int i=1; i<this->parNum_; ++i ) {
1026  scaleVec->push_back(0);
1027  }
1028  }
int i
Definition: DBlmapReader.cc:9
template<class T >
virtual double scaleFunctionType22< T >::scale ( const double &  pt,
const double &  eta,
const double &  phi,
const int  chg,
const T parScale 
) const
inlinevirtual

Implements scaleFunctionBase< T >.

Definition at line 997 of file Functions.h.

References gather_cfg::cout, cmsRelvalreport::exit, and funct::sin().

998  {
999  // Set to 0: use the same parameters for negative and positive muons
1000  int negChg = 0;
1001  if( chg > 0 ) {
1002  if( phi > 0 ) {
1003  return (parScale[0] + parScale[1]*TMath::Abs(phi)*sin(2*phi + parScale[2]))*pt;
1004  }
1005  else {
1006  return (parScale[0] + parScale[3]*TMath::Abs(phi)*sin(2*phi + parScale[4]))*pt;
1007  }
1008  }
1009  else if( chg < 0 ) {
1010  if( phi > 0 ) {
1011  return (parScale[0] - parScale[1+negChg]*TMath::Abs(phi)*sin(2*phi + parScale[2+negChg]))*pt;
1012  }
1013  else {
1014  return (parScale[0] - parScale[3+negChg]*TMath::Abs(phi)*sin(2*phi + parScale[4+negChg]))*pt;
1015  }
1016  }
1017  std::cout << "Error: we should not be here." << std::endl;
1018  exit(1);
1019  return 1;
1020  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
tuple cout
Definition: gather_cfg.py:121
Definition: DDAxes.h:10
template<class T >
virtual void scaleFunctionType22< 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 
)
inlinevirtual

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

Implements scaleFunctionBase< T >.

Definition at line 1029 of file Functions.h.

References scaleFunctionBase< T >::setPar().

1030  {
1031  double thisStep[] = {0.0001, 0.0001, 0.01, 0.0001, 0.01};
1032  // , 0.0001, 0.01, 0.0001, 0.01};
1033  TString thisParName[] = {"Phi offset",
1034  "amplitude pos phi", "phase pos phi",
1035  "amplitude neg phi", "phase neg phi"};
1036  // "amplitude pos charge pos phi", "phase pos charge pos phi",
1037  // "amplitude pos charge neg phi", "phase pos charge neg phi",
1038  // "amplitude neg charge pos phi", "phase neg charge pos phi",
1039  // "amplitude neg charge neg phi", "phase neg charge neg phi" };
1040  if( muonType == 1 ) {
1041  double thisMini[] = {0.9, -0.3, -0.3, -0.3, -0.3};
1042  // , -0.3, -0.3, -0.3, -0.3};
1043  double thisMaxi[] = {1.1, 0.3, 0.3, 0.3, 0.3};
1044  // , 0.3, 0.3, 0.3, 0.3};
1045  this->setPar( Start, Step, Mini, Maxi, ind, parname, parScale, parScaleOrder, thisStep, thisMini, thisMaxi, thisParName );
1046  } else {
1047  double thisMini[] = {0.9, -0.1, -3, -0.1, -3};
1048  // , -0.1, -3, -0.1, -3};
1049  double thisMaxi[] = {1.1, 0.1, 3, 0.1, 3};
1050  // , 0.1, 3, 0.1, 3};
1051  this->setPar( Start, Step, Mini, Maxi, ind, parname, parScale, parScaleOrder, thisStep, thisMini, thisMaxi, thisParName );
1052  }
1053  }
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.
Definition: Functions.h:70