CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

AsymPow Class Reference

#include <AsymPow.h>

List of all members.

Public Member Functions

 AsymPow ()
 AsymPow (const char *name, const char *title, RooAbsReal &kappaLow, RooAbsReal &kappaHigh, RooAbsReal &theta)
TObject * clone (const char *newname) const
 ~AsymPow ()

Protected Member Functions

Double_t evaluate () const

Private Member Functions

Double_t logKappaForX (Double_t x) const

Private Attributes

RooRealProxy kappaHigh_
RooRealProxy kappaLow_
RooRealProxy theta_

Detailed Description

Definition at line 22 of file AsymPow.h.


Constructor & Destructor Documentation

AsymPow::AsymPow ( ) [inline]

Definition at line 25 of file AsymPow.h.

Referenced by clone().

{}
AsymPow::AsymPow ( const char *  name,
const char *  title,
RooAbsReal &  kappaLow,
RooAbsReal &  kappaHigh,
RooAbsReal &  theta 
)

Definition at line 7 of file AsymPow.cc.

                                                                                                                    :
        RooAbsReal(name,title),
        kappaLow_("kappaLow","Base for theta < 0", this, kappaLow), 
        kappaHigh_("kappaHigh","Base for theta > 0", this, kappaHigh),
        theta_("theta", "Exponent (unit gaussian)", this, theta) 
        { }
AsymPow::~AsymPow ( )

Definition at line 14 of file AsymPow.cc.

{}

Member Function Documentation

TObject * AsymPow::clone ( const char *  newname) const

Definition at line 16 of file AsymPow.cc.

References AsymPow(), kappaHigh_, kappaLow_, and theta_.

{
    // never understood if RooFit actually cares of const-correctness or not.
    return new AsymPow(newname, this->GetTitle(), 
                const_cast<RooAbsReal &>(kappaLow_.arg()), 
                const_cast<RooAbsReal &>(kappaHigh_.arg()),
                const_cast<RooAbsReal &>(theta_.arg()));
}
Double_t AsymPow::evaluate ( ) const [protected]

Definition at line 25 of file AsymPow.cc.

References create_public_lumi_plots::exp, logKappaForX(), theta_, and x.

                                 {
    Double_t x = theta_;
    return exp(logKappaForX(x) * x);
}
Double_t AsymPow::logKappaForX ( Double_t  x) const [private]

Definition at line 30 of file AsymPow.cc.

References alpha, kappaHigh_, kappaLow_, create_public_lumi_plots::log, run_regression::ret, and x.

Referenced by evaluate().

                                               {
#if 0
    // old version with discontinuous derivatives
    return (x >= 0 ? log(kappaHigh_) : - log(kappaLow_));
#else
    if (fabs(x) >= 0.5) return (x >= 0 ? log(kappaHigh_) : - log(kappaLow_));
    // interpolate between log(kappaHigh) and -log(kappaLow) 
    //    logKappa(x) = avg + halfdiff * h(2x)
    // where h(x) is the 3th order polynomial
    //    h(x) = (3 x^5 - 10 x^3 + 15 x)/8;
    // chosen so that h(x) satisfies the following:
    //      h (+/-1) = +/-1 
    //      h'(+/-1) = 0
    //      h"(+/-1) = 0
    double logKhi =  log(kappaHigh_);
    double logKlo = -log(kappaLow_);
    double avg = 0.5*(logKhi + logKlo), halfdiff = 0.5*(logKhi - logKlo);
    double twox = x+x, twox2 = twox*twox;
    double alpha = 0.125 * twox * (twox2 * (3*twox2 - 10.) + 15.);
    double ret = avg + alpha*halfdiff;
    //assert(alpha >= -1 && alpha <= 1 && "Something is wrong in the interpolation");
    return ret;
#endif
} 

Member Data Documentation

RooRealProxy AsymPow::kappaHigh_ [private]

Definition at line 35 of file AsymPow.h.

Referenced by clone(), and logKappaForX().

RooRealProxy AsymPow::kappaLow_ [private]

Definition at line 35 of file AsymPow.h.

Referenced by clone(), and logKappaForX().

RooRealProxy AsymPow::theta_ [private]

Definition at line 36 of file AsymPow.h.

Referenced by clone(), and evaluate().