CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
AsymPow Class Reference

#include <AsymPow.h>

Inheritance diagram for AsymPow:

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

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

Definition at line 7 of file AsymPow.cc.

7  :
8  RooAbsReal(name,title),
9  kappaLow_("kappaLow","Base for theta < 0", this, kappaLow),
10  kappaHigh_("kappaHigh","Base for theta > 0", this, kappaHigh),
11  theta_("theta", "Exponent (unit gaussian)", this, theta)
12  { }
Geom::Theta< T > theta() const
RooRealProxy theta_
Definition: AsymPow.h:36
RooRealProxy kappaHigh_
Definition: AsymPow.h:35
RooRealProxy kappaLow_
Definition: AsymPow.h:35
AsymPow::~AsymPow ( )

Definition at line 14 of file AsymPow.cc.

14 {}

Member Function Documentation

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

Definition at line 16 of file AsymPow.cc.

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

17 {
18  // never understood if RooFit actually cares of const-correctness or not.
19  return new AsymPow(newname, this->GetTitle(),
20  const_cast<RooAbsReal &>(kappaLow_.arg()),
21  const_cast<RooAbsReal &>(kappaHigh_.arg()),
22  const_cast<RooAbsReal &>(theta_.arg()));
23 }
RooRealProxy theta_
Definition: AsymPow.h:36
AsymPow()
Definition: AsymPow.h:25
RooRealProxy kappaHigh_
Definition: AsymPow.h:35
RooRealProxy kappaLow_
Definition: AsymPow.h:35
Double_t AsymPow::evaluate ( ) const
protected

Definition at line 25 of file AsymPow.cc.

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

25  {
26  Double_t x = theta_;
27  return exp(logKappaForX(x) * x);
28 }
RooRealProxy theta_
Definition: AsymPow.h:36
Double_t logKappaForX(Double_t x) const
Definition: AsymPow.cc:30
Definition: DDAxes.h:10
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().

30  {
31 #if 0
32  // old version with discontinuous derivatives
33  return (x >= 0 ? log(kappaHigh_) : - log(kappaLow_));
34 #else
35  if (fabs(x) >= 0.5) return (x >= 0 ? log(kappaHigh_) : - log(kappaLow_));
36  // interpolate between log(kappaHigh) and -log(kappaLow)
37  // logKappa(x) = avg + halfdiff * h(2x)
38  // where h(x) is the 3th order polynomial
39  // h(x) = (3 x^5 - 10 x^3 + 15 x)/8;
40  // chosen so that h(x) satisfies the following:
41  // h (+/-1) = +/-1
42  // h'(+/-1) = 0
43  // h"(+/-1) = 0
44  double logKhi = log(kappaHigh_);
45  double logKlo = -log(kappaLow_);
46  double avg = 0.5*(logKhi + logKlo), halfdiff = 0.5*(logKhi - logKlo);
47  double twox = x+x, twox2 = twox*twox;
48  double alpha = 0.125 * twox * (twox2 * (3*twox2 - 10.) + 15.);
49  double ret = avg + alpha*halfdiff;
50  //assert(alpha >= -1 && alpha <= 1 && "Something is wrong in the interpolation");
51  return ret;
52 #endif
53 }
float alpha
Definition: AMPTWrapper.h:95
RooRealProxy kappaHigh_
Definition: AsymPow.h:35
RooRealProxy kappaLow_
Definition: AsymPow.h:35
Definition: DDAxes.h:10

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