MINT2
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RooJohnsonSU Class Reference

#include <RooJohnsonSU.h>

Inheritance diagram for RooJohnsonSU:

Public Member Functions

 RooJohnsonSU ()
 
 RooJohnsonSU (const char *name, const char *title, RooAbsReal &_x, RooAbsReal &_mean, RooAbsReal &_width, RooAbsReal &_nu, RooAbsReal &_tau)
 
 RooJohnsonSU (const RooJohnsonSU &other, const char *name=0)
 
TObject * clone (const char *newname) const
 
virtual ~RooJohnsonSU ()
 

Protected Member Functions

Double_t evaluate () const
 
Int_t getAnalyticalIntegral (RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
 
Double_t analyticalIntegral (Int_t code, const char *rangeName=0) const
 

Protected Attributes

RooRealProxy x
 
RooRealProxy mean
 
RooRealProxy width
 
RooRealProxy nu
 
RooRealProxy tau
 

Detailed Description

Definition at line 31 of file RooJohnsonSU.h.

Constructor & Destructor Documentation

◆ RooJohnsonSU() [1/3]

RooJohnsonSU::RooJohnsonSU ( )
inline

Definition at line 33 of file RooJohnsonSU.h.

33 {} ;

◆ RooJohnsonSU() [2/3]

RooJohnsonSU::RooJohnsonSU ( const char *  name,
const char *  title,
RooAbsReal &  _x,
RooAbsReal &  _mean,
RooAbsReal &  _width,
RooAbsReal &  _nu,
RooAbsReal &  _tau 
)

Definition at line 39 of file RooJohnsonSU.cpp.

44  :
45 RooAbsPdf(name,title),
46 x("x","x",this,_x),
47 mean("mean","mean",this,_mean),
48 width("width","width",this,_width),
49 nu("nu","nu",this,_nu),
50 tau("tau","tau",this,_tau)
51 {
52 }
RooRealProxy mean
Definition: RooJohnsonSU.h:47
RooRealProxy width
Definition: RooJohnsonSU.h:48
RooRealProxy x
Definition: RooJohnsonSU.h:46
RooRealProxy tau
Definition: RooJohnsonSU.h:50
RooRealProxy nu
Definition: RooJohnsonSU.h:49

◆ RooJohnsonSU() [3/3]

RooJohnsonSU::RooJohnsonSU ( const RooJohnsonSU other,
const char *  name = 0 
)

Definition at line 55 of file RooJohnsonSU.cpp.

55  :
56 RooAbsPdf(other,name),
57 x("x",this,other.x),
58 mean("mean",this,other.mean),
59 width("width",this,other.width),
60 nu("nu",this,other.nu),
61 tau("tau",this,other.tau)
62 {
63 }
RooRealProxy mean
Definition: RooJohnsonSU.h:47
RooRealProxy width
Definition: RooJohnsonSU.h:48
RooRealProxy x
Definition: RooJohnsonSU.h:46
RooRealProxy tau
Definition: RooJohnsonSU.h:50
RooRealProxy nu
Definition: RooJohnsonSU.h:49

◆ ~RooJohnsonSU()

virtual RooJohnsonSU::~RooJohnsonSU ( )
inlinevirtual

Definition at line 42 of file RooJohnsonSU.h.

42 { }

Member Function Documentation

◆ analyticalIntegral()

Double_t RooJohnsonSU::analyticalIntegral ( Int_t  code,
const char *  rangeName = 0 
) const
protected

Definition at line 94 of file RooJohnsonSU.cpp.

95 {
96  assert(code==1) ;
97 
98  // calculate a few variables
99  double w = exp( tau * tau);
100  double omega = - nu * tau;
101  double c = 0.5 * (w-1) * (w * TMath::CosH(2 * omega) + 1);
102  c = pow(c, -0.5);
103  double zmax = (- x.max(rangeName) + (mean + c * width * sqrt(w) * TMath::SinH(omega) )) / c / width;
104  double zmin = (- x.min(rangeName) + (mean + c * width * sqrt(w) * TMath::SinH(omega) )) / c / width;
105  static const Double_t pi = atan2(0.0,-1.0);
106  static const Double_t PiBy2 = pi/2.0;
107  static const Double_t rootPiBy2 = sqrt(PiBy2);
108 
109  // the integral calculation
110  Double_t ret = 0;
111  if(code==1){
112  // ret = rootPiBy2 * sigx * (RooMath::erf((x.max(rangeName)-mean)/xscale)-RooMath::erf((x.min(rangeName)-mean)/xscale));
113  ret = -0.25/rootPiBy2* ( RooMath::erf( (nu*tau + TMath::ASinH( zmax ) )/(sqrt(2)*tau) )-
114  RooMath::erf( (nu*tau + TMath::ASinH( zmin ) )/(sqrt(2)*tau) ) );
115 
116  /*-rootPiBy2 * ( RooMath::erf( PiBy2 * nu - ( PiBy2 * TMath::ASinH( zmax ) / tau ) ) -
117  RooMath::erf( PiBy2 * nu - ( PiBy2 * TMath::ASinH( zmin ) / tau ) ) );
118  ret *= c * width;
119  ret *= 0.5 / c / width / pi;*/
120  // if (gDebug>2) {
121  // cout << "Int_gauss_dx(mean=" << mean << ",sigma=" << sigma << ", xmin=" << x.min(rangeName) << ", xmax=" << x.max(rangeName) << ")=" << ret << endl ;
122  // }
123  } else{
124  cout << "Error in RooJohnsonSU::analyticalIntegral" << endl;
125  }
126  return ret ;
127 
128 }
RooRealProxy mean
Definition: RooJohnsonSU.h:47
static const double pi
RooRealProxy width
Definition: RooJohnsonSU.h:48
RooRealProxy x
Definition: RooJohnsonSU.h:46
RooRealProxy tau
Definition: RooJohnsonSU.h:50
RooRealProxy nu
Definition: RooJohnsonSU.h:49

◆ clone()

TObject* RooJohnsonSU::clone ( const char *  newname) const
inline

Definition at line 41 of file RooJohnsonSU.h.

41 { return new RooJohnsonSU(*this,newname); }

◆ evaluate()

Double_t RooJohnsonSU::evaluate ( ) const
protected

Definition at line 67 of file RooJohnsonSU.cpp.

68 {
69  // ENTER EXPRESSION IN TERMS OF VARIABLE ARGUMENTS HERE
70  // calculate a few variables
71  double w = exp( tau * tau);
72  double omega = - nu * tau;
73  double c = 0.5 * (w-1) * (w * TMath::CosH(2 * omega) + 1);
74  c = pow(c, -0.5);
75  double z = (x - (mean + c * width * sqrt(w) * TMath::SinH(omega) )) / c / width;
76  double r = -nu + TMath::ASinH(z) / tau;
77  // the actual value
78  double val = 1. / (c * width * 2 * TMath::Pi());
79  val *= 1. / (tau * sqrt(z*z+1));
80  val *= exp(-0.5 * r * r);
81  // return
82  return val ;
83 }
RooRealProxy mean
Definition: RooJohnsonSU.h:47
RooRealProxy width
Definition: RooJohnsonSU.h:48
RooRealProxy x
Definition: RooJohnsonSU.h:46
RooRealProxy tau
Definition: RooJohnsonSU.h:50
RooRealProxy nu
Definition: RooJohnsonSU.h:49

◆ getAnalyticalIntegral()

Int_t RooJohnsonSU::getAnalyticalIntegral ( RooArgSet &  allVars,
RooArgSet &  analVars,
const char *  rangeName = 0 
) const
protected

Definition at line 87 of file RooJohnsonSU.cpp.

88 {
89  if (matchArgs(allVars,analVars,x)) return 1 ;
90  return 0 ;
91 }
RooRealProxy x
Definition: RooJohnsonSU.h:46

Member Data Documentation

◆ mean

RooRealProxy RooJohnsonSU::mean
protected

Definition at line 47 of file RooJohnsonSU.h.

◆ nu

RooRealProxy RooJohnsonSU::nu
protected

Definition at line 49 of file RooJohnsonSU.h.

◆ tau

RooRealProxy RooJohnsonSU::tau
protected

Definition at line 50 of file RooJohnsonSU.h.

◆ width

RooRealProxy RooJohnsonSU::width
protected

Definition at line 48 of file RooJohnsonSU.h.

◆ x

RooRealProxy RooJohnsonSU::x
protected

Definition at line 46 of file RooJohnsonSU.h.


The documentation for this class was generated from the following files: