41 x(
"x",
"Observable",this,_x),
42 mean(
"mean",
"Mean",this,_mean),
43 sigma(
"sigma",
"Width",this,_sigma)
51 RooAbsPdf(other,
name),
x(
"x",this,other.
x), mean(
"mean",this,other.mean),
69 {dataMap.at(x), dataMap.at(mean), dataMap.at(sigma)});
87 auto& constant = code == 1 ?
mean :
x;
88 auto& integrand = code == 1 ?
x :
mean;
90 return gaussianIntegral(integrand.min(rangeName), integrand.max(rangeName), constant,
sigma);
97 if (
matchArgs(directVars,generateVars,
x))
return 1 ;
106 assert(code==1 || code==2) ;
125 std::cout <<
"error in RooGaussian generateEvent"<< std::endl;
144 auto& constant = code == 1 ?
mean :
x;
145 auto& integrand = code == 1 ?
x :
mean;
147 return ctx.
buildCall(
"RooFit::Detail::AnalyticalIntegrals::gaussianIntegral",
148 integrand.min(rangeName), integrand.max(rangeName), constant,
sigma);
Abstract interface for all probability density functions.
A RooAbsReal::Ref can be constructed from a RooAbsReal& or a double that will be implicitly converted...
Abstract base class for objects that represent a real value and implements functionality common to al...
bool 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.
A class to maintain the context for squashing of RooFit models into code.
std::string buildCall(std::string const &funcname, Args_t const &...args)
Build the code to call the function with name funcname, passing some arguments.
void addResult(RooAbsArg const *key, std::string const &value)
A function to save an expression that includes/depends on the result of the input node.
RooBatchCompute::Config config(RooAbsArg const *arg) const
std::string buildCallToAnalyticIntegral(Int_t code, const char *rangeName, RooFit::Detail::CodeSquashContext &ctx) const override
This function defines the analytical integral translation for the class.
void computeBatch(double *output, size_t size, RooFit::Detail::DataMap const &) const override
Compute multiple values of Gaussian distribution.
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
void generateEvent(Int_t code) override
Interface for generation of an event using the algorithm corresponding to the specified code.
void translate(RooFit::Detail::CodeSquashContext &ctx) const override
This function defines a translation for each RooAbsReal based object that can be used to express the ...
Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, bool staticInitOK=true) const override
Load generatedVars with the subset of directVars that we can generate events for, and return a code t...
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
double max(const char *rname=nullptr) const
Query upper limit of range. This requires the payload to be RooAbsRealLValue or derived.
double min(const char *rname=nullptr) const
Query lower 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...
void compute(Config cfg, Computer comp, RestrictArr output, size_t size, const VarVector &vars, ArgVector &extraArgs)
double gaussianEvaluate(double x, double mean, double sigma)
Function to evaluate an un-normalized RooGaussian.
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 const &extraMessage="")
Check if the parameters have a range, and warn if the range extends below / above the set limits.