70 double massThreshold) :
72 _mass(
"mass",
"Mass observable", this, mass),
73 _mu(
"mu",
"Location parameter of the underlying normal distribution.", this, mu),
74 _lambda(
"lambda",
"Width parameter of the underlying normal distribution (=2 lambda)", this, lambda),
75 _gamma(
"gamma",
"Shift of transformation", this,
gamma),
76 _delta(
"delta",
"Scale of transformation", this, delta),
77 _massThreshold(massThreshold)
87 _mass(
"Mass", this, other._mass),
88 _mu(
"mean", this, other._mu),
89 _lambda(
"lambda", this, other._lambda),
90 _gamma(
"gamma", this, other._gamma),
91 _delta(
"delta", this, other._delta),
92 _massThreshold(other._massThreshold)
108 const double result =
_delta
111 *
exp(-0.5 * expo * expo);
124template<
class TMass,
class TMu,
class TLambda,
class TGamma,
class TDelta>
126 TDelta delta,
double massThreshold) {
131 for (
int i = 0; i <
n; ++i) {
132 const double arg = (mass[i] - mu[i]) / lambda[i];
136 const double asinh_arg = asinh(arg);
138 const double expo =
gamma[i] + delta[i] * asinh_arg;
139 const double result = delta[i] / sqrt_twoPi
143 const double passThrough = mass[i] >= massThreshold;
144 output[i] = result * passThrough;
167 maxSize = std::min({massData, muData, lambdaData, gammaData, deltaData},
169 return l.size() != 0 &&
l.size() <
r.size();
178 if (!massData.empty()
179 && (muData.empty() && lambdaData.empty() && gammaData.empty() && deltaData.empty())) {
216 const double globalNorm = 1.;
220 double min = -1.E300;
223 double argMin, argMax;
228 }
else if (code ==
kMean) {
239 }
else if (code ==
kGamma) {
243 }
else if (code ==
kDelta) {
260 const double result = 0.5 * (
261 min*max < 0.0 ? 2.0 - (ecmin + ecmax)
262 : max <= 0. ? ecmax - ecmin : ecmin - ecmax
266 return globalNorm * (result != 0. ? result : 1.E-300);
301 throw std::logic_error(
"Generation in other variables not yet implemented.");
RooSpan< double > makeWritableBatchUnInit(std::size_t begin, std::size_t batchSize, const RooArgSet *const normSet=nullptr, Tag_t ownerTag=kUnspecified)
Make a batch and return a span pointing to the pdf-local memory.
Little adapter that gives a bracket operator to types that don't have one.
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().
BatchHelpers::BatchData _batchData
RooArgSet is a container object that can hold multiple RooAbsArg objects.
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.
void generateEvent(Int_t code) override
Generate events based on code obtained by getGenerator().
Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const override
Advertise which kind of direct event generation is supported.
RooSpan< double > evaluateBatch(std::size_t begin, std::size_t end) const override
Compute in batches.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
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.
RooSpan< const typename T::value_type > getValBatch(std::size_t begin, std::size_t batchSize) const
Retrieve a batch of real or category data.
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.
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.
static constexpr double gauss
constexpr Double_t TwoPi()
static void output(int code)