// Exponential p.d.f
// END_HTML
#include "RooFit.h"
#include "Riostream.h"
#include "Riostream.h"
#include <math.h>
#include "RooExponential.h"
#include "RooRealVar.h"
ClassImp(RooExponential)
RooExponential::RooExponential(const char *name, const char *title,
RooAbsReal& _x, RooAbsReal& _c) :
RooAbsPdf(name, title),
x("x","Dependent",this,_x),
c("c","Exponent",this,_c)
{
}
RooExponential::RooExponential(const RooExponential& other, const char* name) :
RooAbsPdf(other, name), x("x",this,other.x), c("c",this,other.c)
{
}
Double_t RooExponential::evaluate() const{
return exp(c*x);
}
Int_t RooExponential::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* ) const
{
if (matchArgs(allVars,analVars,x)) return 1 ;
return 0 ;
}
Double_t RooExponential::analyticalIntegral(Int_t code, const char* rangeName) const
{
switch(code) {
case 1:
{
Double_t ret(0) ;
if(c == 0.0) {
ret = (x.max(rangeName) - x.min(rangeName));
} else {
ret = ( exp( c*x.max(rangeName) ) - exp( c*x.min(rangeName) ) )/c;
}
return ret ;
}
}
assert(0) ;
return 0 ;
}
Last change: Mon Aug 25 11:36:27 2008
Last generated: 2008-08-25 11:36
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.