39 x(
"x",
"Observable",this,_x),
40 mean(
"mean",
"Mean",this,_mean),
41 sigma(
"sigma",
"Width",this,_sigma)
49 RooAbsPdf(other,
name),
x(
"x",this,other.
x), mean(
"mean",this,other.mean),
58 const double arg =
x -
mean;
59 const double sig =
sigma;
60 return std::exp(-0.5*arg*arg/(sig*sig));
83 assert(code==1 || code==2);
95 max = (
x.
max(rangeName)-
mean)/xscale;
96 min = (
x.
min(rangeName)-
mean)/xscale;
98 max = (
mean.
max(rangeName)-
x)/xscale;
99 min = (
mean.
min(rangeName)-
x)/xscale;
107 const double ecmin = std::erfc(std::abs(min));
108 const double ecmax = std::erfc(std::abs(max));
111 return resultScale * 0.5 * (
112 min*max < 0.0 ? 2.0 - (ecmin + ecmax)
113 : max <= 0. ? ecmax - ecmin : ecmin - ecmax
121 if (
matchArgs(directVars,generateVars,
x))
return 1 ;
130 assert(code==1 || code==2) ;
149 std::cout <<
"error in RooGaussian generateEvent"<< std::endl;
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
virtual RooSpan< const double > getValues(RooBatchCompute::RunContext &evalData, const RooArgSet *normSet=nullptr) const
by this change, please consult the release notes for ROOT 6.24 for guidance on how to make this trans...
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.
virtual RooSpan< double > computeGaussian(const RooAbsReal *, RunContext &, RooSpan< const double > x, RooSpan< const double > mean, RooSpan< const double > sigma)=0
void generateEvent(Int_t code) override
Interface for generation of an event using the algorithm corresponding to the specified code.
Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const override
Load generatedVars with the subset of directVars that we can generate events for, and return a code t...
RooSpan< double > evaluateSpan(RooBatchCompute::RunContext &evalData, const RooArgSet *normSet) const override
Compute multiple values of Gaussian distribution.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
Double_t evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
A simple container to hold a batch of data values.
double min(const char *rname=0) const
Query lower limit of range. This requires the payload to be RooAbsRealLValue or derived.
double max(const char *rname=0) const
Query upper limit of range. This requires the payload to be RooAbsRealLValue or derived.
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...
R__EXTERN RooBatchComputeInterface * dispatch
This dispatch pointer points to an implementation of the compute library, provided one has been loade...
void checkRangeOfParameters(const RooAbsReal *callingClass, std::initializer_list< const RooAbsReal * > pars, double min=-std::numeric_limits< double >::max(), double max=std::numeric_limits< double >::max(), bool limitsInAllowedRange=false, std::string extraMessage="")
Check if the parameters have a range, and warn if the range extends below / above the set limits.
constexpr Double_t Sqrt2()
constexpr Double_t TwoPi()
This struct enables passing computation data around between elements of a computation graph.