45 x(
"x",
"Observable",this,_x),
46 mean(
"mean",
"Mean",this,_mean),
47 sigma(
"sigma",
"Width",this,_sigma)
54 RooAbsPdf(other,
name),
x(
"x",this,other.
x), mean(
"mean",this,other.mean),
63 const double arg =
x -
mean;
64 const double sig =
sigma;
65 return exp(-0.5*arg*arg/(sig*sig)) ;
101 assert(code==1 || code==2);
113 max = (
x.
max(rangeName)-
mean)/xscale;
114 min = (
x.
min(rangeName)-
mean)/xscale;
116 max = (
mean.
max(rangeName)-
x)/xscale;
117 min = (
mean.
min(rangeName)-
x)/xscale;
125 const double ecmin =
std::erfc(std::abs(min));
126 const double ecmax =
std::erfc(std::abs(max));
129 return resultScale * 0.5 * (
130 min*max < 0.0 ? 2.0 - (ecmin + ecmax)
131 : max <= 0. ? ecmax - ecmin : ecmin - ecmax
139 if (
matchArgs(directVars,generateVars,
x))
return 1 ;
148 assert(code==1 || code==2) ;
167 cout <<
"error in RooGaussian generateEvent"<< endl;
virtual Double_t getLogVal(const RooArgSet *set=0) const
Return the log of the current value with given normalization An error message is printed if the argum...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Bool_t matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
Double_t getLogVal(const RooArgSet *set) const
calculate and return the negative log-likelihood of the Poisson
void generateEvent(Int_t code)
Interface for generation of an event using the algorithm corresponding to the specified code.
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const
Load generatedVars with the subset of directVars that we can generate events for, and return a code t...
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
Double_t min(const char *rname=0) const
Double_t max(const char *rname=0) const
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
double erfc(double x)
Complementary error function.
constexpr Double_t Sqrt2()
constexpr Double_t TwoPi()