CMS 3D CMS Logo

Public Member Functions

backgroundFunctionType5 Class Reference

Linear with eta dependence. More...

#include <Functions.h>

Inheritance diagram for backgroundFunctionType5:
backgroundFunctionBase

List of all members.

Public Member Functions

 backgroundFunctionType5 (const double &lowerLimit, const double &upperLimit)
virtual double operator() (const double *parval, const double &mass, const double &eta) const
virtual void setParameters (double *Start, double *Step, double *Mini, double *Maxi, int *ind, TString *parname, const std::vector< double >::const_iterator &parBgrIt, const std::vector< int >::const_iterator &parBgrOrderIt, const int muonType)
 This method is used to differentiate parameters among the different functions.

Detailed Description

Linear with eta dependence.

Definition at line 2941 of file Functions.h.


Constructor & Destructor Documentation

backgroundFunctionType5::backgroundFunctionType5 ( const double &  lowerLimit,
const double &  upperLimit 
) [inline]

Returns the value of the linear function f(M) = a + b*M for M < -a/b, 0 otherwise.
Where a = 1 + c*eta*eta and b is chosen to be negative (background decreasing when M increases).

Definition at line 2948 of file Functions.h.

References backgroundFunctionBase::parNum_.

                                                                                :
    backgroundFunctionBase(lowerLimit, upperLimit)
    { this->parNum_ = 3; }

Member Function Documentation

virtual double backgroundFunctionType5::operator() ( const double *  parval,
const double &  mass,
const double &  eta 
) const [inline, virtual]

Implements backgroundFunctionBase.

Definition at line 2951 of file Functions.h.

References a, b, eta(), backgroundFunctionBase::lowerLimit_, lumiNorm::norm, and backgroundFunctionBase::upperLimit_.

  {
    double b = parval[1];
    // double c = parval[2];
    double a = 1 + parval[2]*eta*eta;

    double norm = -(a*lowerLimit_ + b*lowerLimit_*lowerLimit_/2.);

    if( -a/b > upperLimit_ ) norm += a*upperLimit_ + b*upperLimit_*upperLimit_/2.;
    else norm += -a*a/(2*b);

    if( mass < -a/b && norm != 0 ) return (a + b*mass)/norm;
    else return 0;
  }
virtual void backgroundFunctionType5::setParameters ( double *  Start,
double *  Step,
double *  Mini,
double *  Maxi,
int *  ind,
TString *  parname,
const std::vector< double >::const_iterator &  parBgrIt,
const std::vector< int >::const_iterator &  parBgrOrderIt,
const int  muonType 
) [inline, virtual]

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

Implements backgroundFunctionBase.

Definition at line 2965 of file Functions.h.

References backgroundFunctionBase::setPar().

                                                                                                                                                                                                                                            {
    double thisStep[] = {0.01, 0.01, 0.01};
    TString thisParName[] = {"Bgr fraction", "Constant", "Linear"};
    if( muonType == 1 ) {
      double thisMini[] = {0.0,  0., -300.};
      double thisMaxi[] = {1.0, 300.,   0.};
      this->setPar( Start, Step, Mini, Maxi, ind, parname, parBgrIt, parBgrOrderIt, thisStep, thisMini, thisMaxi, thisParName );
    } else {
      double thisMini[] = {0.0,  0., -300.};
      double thisMaxi[] = {1.0, 300.,   0.};
      this->setPar( Start, Step, Mini, Maxi, ind, parname, parBgrIt, parBgrOrderIt, thisStep, thisMini, thisMaxi, thisParName );
    }
  }