CMS 3D CMS Logo

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

#include <Functions.h>

Inheritance diagram for scaleFunctionType36< 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
 
 scaleFunctionType36 ()
 
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...
 
virtual void setParameters (double *Start, double *Step, double *Mini, double *Maxi, int *ind, TString *parname, const T &parScale, const std::vector< int > &parScaleOrder, const std::vector< double > &parStep, const std::vector< double > &parMin, const std::vector< double > &parMax, const int muonType)
 
- Public Member Functions inherited from scaleFunctionBase< T >
virtual int parNum () const
 
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 scaleFunctionType36< T >

Definition at line 2115 of file Functions.h.

Constructor & Destructor Documentation

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

Definition at line 2117 of file Functions.h.

References scaleFunctionBase< T >::parNum_.

2117 { this->parNum_ = 13; }

Member Function Documentation

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

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

2137  {
2138  // scaleVec->push_back(1);
2139  for( int i=0; i<this->parNum_; ++i ) {
2140  scaleVec->push_back(0);
2141  }
2142  }
int i
Definition: DBlmapReader.cc:9
template<class T >
virtual double scaleFunctionType36< 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 2118 of file Functions.h.

References funct::sin().

2118  {
2119  double ampl(0), phase(0), twist(0);
2120  if ( eta < parScale[11] ) {
2121  ampl = parScale[1]; phase = parScale[2];
2122  twist = parScale[3]*TMath::SinH(eta-parScale[11])+parScale[6]*TMath::SinH(parScale[11]) ;
2123  } else if ( parScale[11] <= eta && eta <= parScale[12] ) {
2124  ampl = parScale[4]; phase = parScale[5];
2125  twist = parScale[6]*TMath::SinH(eta);
2126  } else if ( parScale[12] < eta ) {
2127  ampl = parScale[7]; phase = parScale[8];
2128  twist = parScale[9]*TMath::SinH(eta-parScale[12])+parScale[6]*TMath::SinH(parScale[12]) ;
2129  }
2130  double curv = (1.+parScale[0])*((double)chg/pt
2131  -twist
2132  -ampl*sin(phi+phase)
2133  -0.5*(double)chg*parScale[10]);
2134  return 1./((double)chg*curv);
2135  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T eta() const
Definition: DDAxes.h:10
template<class T >
virtual void scaleFunctionType36< 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 2143 of file Functions.h.

References scaleFunctionBase< T >::setPar().

2144  {
2145  double thisStep[] = {0.000001,
2146  0.000001, 0.01, 0.000001,
2147  0.000001, 0.01, 0.000001,
2148  0.000001, 0.01, 0.000001,
2149  0.000001,
2150  -0.01, 0.01};
2151  TString thisParName[] = {"Curv global scale" ,
2152  "Phi ampl eta<-1.5" , "Phi phase eta<-1.5" , "Twist eta<-1.5" ,
2153  "Phi ampl |eta|<1.5" , "Phi phase |eta|<1.5", "Twist |eta|<1.5" ,
2154  "Phi ampl eta>+1.5" , "Phi phase eta>+1.5" , "Twist eta>+1.5" ,
2155  "Charge depend bias",
2156  "eta neg boundary", "eta pos boundary"};
2157  if( muonType == 1 ) {
2158  double thisMini[] = {-0.1, -0.3, -3.1416, -0.3, -0.3, -3.1416, -0.3, -0.3, -3.1416, -0.3, -0.3, -2.6, 0.};
2159  double thisMaxi[] = { 0.1, 0.3, 3.1416, 0.3, 0.3, 3.1416, 0.3, 0.3, 3.1416, 0.3, 0.3, 0., 2.6};
2160  this->setPar( Start, Step, Mini, Maxi, ind, parname, parScale, parScaleOrder, thisStep, thisMini, thisMaxi, thisParName );
2161  } else {
2162  double thisMini[] = {-0.1, -0.3, -3.1416, -0.3, -0.3, -3.1416, -0.3, -0.3, -3.1416, -0.3, -0.3, -2.6, 0.};
2163  double thisMaxi[] = { 0.1, 0.3, 3.1416, 0.3, 0.3, 3.1416, 0.3, 0.3, 3.1416, 0.3, 0.3, 0., 2.6};
2164  this->setPar( Start, Step, Mini, Maxi, ind, parname, parScale, parScaleOrder, thisStep, thisMini, thisMaxi, thisParName );
2165  }
2166  }
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
template<class T >
virtual void scaleFunctionType36< T >::setParameters ( double *  Start,
double *  Step,
double *  Mini,
double *  Maxi,
int *  ind,
TString *  parname,
const T parScale,
const std::vector< int > &  parScaleOrder,
const std::vector< double > &  parStep,
const std::vector< double > &  parMin,
const std::vector< double > &  parMax,
const int  muonType 
)
inlinevirtual

Reimplemented from scaleFunctionBase< T >.

Definition at line 2167 of file Functions.h.

References gather_cfg::cout, cmsRelvalreport::exit, i, scaleFunctionBase< T >::parNum_, and scaleFunctionBase< T >::setPar().

2173  {
2174  if( (int(parStep.size()) != this->parNum_) || (int(parMin.size()) != this->parNum_) || (int(parMax.size()) != this->parNum_) ) {
2175  std::cout << "Error: par step or min or max do not match with number of parameters" << std::endl;
2176  std::cout << "parNum = " << this->parNum_ << std::endl;
2177  std::cout << "parStep.size() = " << parStep.size() << std::endl;
2178  std::cout << "parMin.size() = " << parMin.size() << std::endl;
2179  std::cout << "parMax.size() = " << parMax.size() << std::endl;
2180  exit(1);
2181  }
2182  std::vector<ParameterSet> parSet(this->parNum_);
2183  // name, step, mini, maxi
2184  parSet[0] = ParameterSet( "Curv global scale", parStep[0], parMin[0], parMax[0] );
2185  parSet[1] = ParameterSet( "Phi ampl eta<-1.5", parStep[1], parMin[1], parMax[1] );
2186  parSet[2] = ParameterSet( "Phi phase eta<-1.5", parStep[2], parMin[2], parMax[2] );
2187  parSet[3] = ParameterSet( "Twist eta<-1.5", parStep[3], parMin[3], parMax[3] );
2188  parSet[4] = ParameterSet( "Phi ampl |eta|<1.5", parStep[4], parMin[4], parMax[4] );
2189  parSet[5] = ParameterSet( "Phi phase |eta|<1.5", parStep[5], parMin[5], parMax[5] );
2190  parSet[6] = ParameterSet( "Twist |eta|<1.5", parStep[6], parMin[6], parMax[6] );
2191  parSet[7] = ParameterSet( "Phi ampl eta>1.5", parStep[7], parMin[7], parMax[7] );
2192  parSet[8] = ParameterSet( "Phi phase eta>1.5", parStep[8], parMin[8], parMax[8] );
2193  parSet[9] = ParameterSet( "Twist eta>1.5" , parStep[9], parMin[9], parMax[9] );
2194  parSet[10] = ParameterSet( "Charge depend bias", parStep[10],parMin[10],parMax[10] );
2195  parSet[11] = ParameterSet( "Eta neg boundary", parStep[11],parMin[11],parMax[11] );
2196  parSet[12] = ParameterSet( "Eta pos boundary", parStep[12],parMin[12],parMax[12] );
2197 
2198 
2199  std::cout << "setting parameters" << std::endl;
2200  for( int i=0; i<this->parNum_; ++i ) {
2201  std::cout << "parStep["<<i<<"] = " << parStep[i]
2202  << ", parMin["<<i<<"] = " << parMin[i]
2203  << ", parMax["<<i<<"] = " << parMin[i] << std::endl;
2204  }
2205  this->setPar( Start, Step, Mini, Maxi, ind, parname, parScale, parScaleOrder, parSet );
2206  }
int i
Definition: DBlmapReader.cc:9
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
tuple cout
Definition: gather_cfg.py:121