CMS 3D CMS Logo

Public Member Functions

backgroundFunctionType1 Class Reference

Linear. More...

#include <Functions.h>

Inheritance diagram for backgroundFunctionType1:
backgroundFunctionBase

List of all members.

Public Member Functions

 backgroundFunctionType1 (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.

Definition at line 2763 of file Functions.h.


Constructor & Destructor Documentation

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

Returns the value of the linear function f(M) = 1 + b*M for M < -1/b, 0 otherwise.
b is chosen to be negative (background decreasing when M increases).
Note that this form describes only cases with a != 0 (keep in mind that the relative height with respect to the signal is controlled by the fraction parameter).

Definition at line 2772 of file Functions.h.

References backgroundFunctionBase::parNum_.

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

Member Function Documentation

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

Implements backgroundFunctionBase.

Definition at line 2775 of file Functions.h.

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

  {
    double a = 1.;
    double b = parval[1];

    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 backgroundFunctionType1::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 2788 of file Functions.h.

References backgroundFunctionBase::setPar().

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