45 x(
"x",
"Dependent",this,_x),
46 c(
"c",
"Exponent",this,_c)
77 assert(code == 1 || code ==2);
79 auto& constant = code == 1 ?
c :
x;
80 auto& integrand = code == 1 ?
x :
c;
82 if (constant == 0.0) {
83 return integrand.
max(rangeName) - integrand.min(rangeName);
86 return (
exp(constant*integrand.max(rangeName)) -
exp(constant*integrand.min(rangeName)))
93template<
class Tx,
class Tc>
94void compute(
size_t n,
double* __restrict
output, Tx
x, Tc
c) {
96 for (
size_t i = 0; i <
n; ++i) {
113 const bool batchX = !xData.empty();
114 const bool batchC = !cData.empty();
116 if (!batchX && !batchC) {
119 batchSize =
findSize({ xData, cData });
122 if (batchX && !batchC ) {
125 else if (!batchX && batchC ) {
128 else if (batchX && batchC ) {
129 compute(batchSize,
output.data(), xData, cData);
RooSpan< double > makeWritableBatchUnInit(std::size_t begin, std::size_t batchSize)
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 analyticalIntegral(Int_t code, const char *rangeName=0) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
RooSpan< double > evaluateBatch(std::size_t begin, std::size_t batchSize) const override
Evaluate the exponential without normalising it on the given batch.
Double_t evaluate() const override
cout << "exp(x=" << x << ",c=" << c << ")=" << exp(c*x) << endl ;
A simple container to hold a batch of data values.
RooSpan< const double > getValBatch(std::size_t begin, std::size_t batchSize) const
Double_t max(const char *rname=0) const
Query upper limit of range. This requires the payload to be RooAbsRealLValue or derived.
size_t findSize(std::vector< RooSpan< const double > > parameters)
This function returns the minimum size of the non-zero-sized batches.
static void output(int code)