#include <RooOsipDisc.hh>
Public Member Functions | |
RooOsipDisc (const char *name, const char *title, RooAbsReal &_x, RooAbsReal &_r, RooAbsReal &_b, RooAbsReal &_a, RooAbsReal &_h, RooAbsReal &_s) | |
RooOsipDisc (const RooOsipDisc &other, const char *name=0) | |
virtual TObject * | clone (const char *newname) const |
virtual | ~RooOsipDisc () |
Int_t | getAnalyticalIntegral (RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const |
Double_t | analyticalIntegral (Int_t code, const char *rangeName=0) const |
Int_t | getGenerator (const RooArgSet &directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const |
void | generateEvent (Int_t code) |
Protected Member Functions | |
Double_t | evaluate () const |
Protected Attributes | |
RooRealProxy | x |
RooRealProxy | r |
RooRealProxy | bb |
RooRealProxy | a |
RooRealProxy | h |
RooRealProxy | s |
Definition at line 24 of file RooOsipDisc.hh.
RooOsipDisc::RooOsipDisc | ( | const char * | name, | |
const char * | title, | |||
RooAbsReal & | _x, | |||
RooAbsReal & | _r, | |||
RooAbsReal & | _b, | |||
RooAbsReal & | _a, | |||
RooAbsReal & | _h, | |||
RooAbsReal & | _s | |||
) |
Referenced by clone().
RooOsipDisc::RooOsipDisc | ( | const RooOsipDisc & | other, | |
const char * | name = 0 | |||
) |
virtual RooOsipDisc::~RooOsipDisc | ( | ) | [inline, virtual] |
Double_t RooOsipDisc::analyticalIntegral | ( | Int_t | code, | |
const char * | rangeName = 0 | |||
) | const |
Definition at line 57 of file RooOsipDisc.cc.
References a, bb, h, r, and s.
00058 { 00059 assert(code==1) ; 00060 00061 const Double_t rootPiBy2 = sqrt(TMath::PiOver2()); 00062 Double_t t = -(2*a*r+3*bb*r*r+4*s*r*r*r)*h*h/(1+a*r*r+bb*r*r*r+s*r*r*r*r); 00063 Double_t d = (1+a*r*r+bb*r*r*r+s*r*r*r*r)*exp(t*t/(2*h*h)); 00064 Double_t xscale = TMath::Sqrt2() * h; 00065 00066 return r+a*r*r*r/3+bb*r*r*r*r/4+s*r*r*r*r*r/5+d*rootPiBy2*h*(TMath::Erf((1-r+t)/xscale)-TMath::Erf(t/xscale)); 00067 }
virtual TObject* RooOsipDisc::clone | ( | const char * | newname | ) | const [inline, virtual] |
Definition at line 29 of file RooOsipDisc.hh.
References RooOsipDisc().
00029 { return new RooOsipDisc(*this,newname); }
Double_t RooOsipDisc::evaluate | ( | ) | const [protected] |
Definition at line 38 of file RooOsipDisc.cc.
References a, bb, h, r, s, and x.
00039 { 00040 Double_t t = -(2*a*r+3*bb*r*r+4*s*r*r*r)*h*h/(1+a*r*r+bb*r*r*r+s*r*r*r*r); 00041 Double_t d = (1+a*r*r+bb*r*r*r+s*r*r*r*r)*exp(t*t/(2*h*h)); 00042 if (x<r) { 00043 return 1+a*x*x+bb*x*x*x+s*x*x*x*x; 00044 } 00045 if ((x>r)||(x==r)) { 00046 return d*exp(-0.5*(x-r+t)*(x-r+t)/(h*h)); 00047 } 00048 return 0; 00049 }
void RooOsipDisc::generateEvent | ( | Int_t | code | ) |
Definition at line 75 of file RooOsipDisc.cc.
References x.
00076 { 00077 assert(code==1) ; 00078 Double_t xgen ; 00079 while(1) { 00080 xgen = 0.5; //RooRandom::randomGenerator()->OsipDisc(r,bb,a,h,s); 00081 if (xgen<x.max() && xgen>x.min()) { 00082 x = xgen ; 00083 break; 00084 } 00085 } 00086 return; 00087 }
Int_t RooOsipDisc::getAnalyticalIntegral | ( | RooArgSet & | allVars, | |
RooArgSet & | analVars, | |||
const char * | rangeName = 0 | |||
) | const |
Definition at line 51 of file RooOsipDisc.cc.
References x.
00052 { 00053 if (matchArgs(allVars,analVars,x)) return 1 ; 00054 return 0 ; 00055 }
Int_t RooOsipDisc::getGenerator | ( | const RooArgSet & | directVars, | |
RooArgSet & | generateVars, | |||
Bool_t | staticInitOK = kTRUE | |||
) | const |
Definition at line 69 of file RooOsipDisc.cc.
References x.
00070 { 00071 if (matchArgs(directVars,generateVars,x)) return 1 ; 00072 return 0 ; 00073 }
RooRealProxy RooOsipDisc::a [protected] |
RooRealProxy RooOsipDisc::bb [protected] |
RooRealProxy RooOsipDisc::h [protected] |
RooRealProxy RooOsipDisc::r [protected] |
RooRealProxy RooOsipDisc::s [protected] |
RooRealProxy RooOsipDisc::x [protected] |
Definition at line 40 of file RooOsipDisc.hh.
Referenced by evaluate(), generateEvent(), getAnalyticalIntegral(), and getGenerator().