80enum BasisSign {
Both = 0, Plus = +1, Minus = -1 };
102 std::string str =
name;
105 str.erase(remove(str.begin(),str.end(),
' '),str.end());
110 if (str ==
"exp(-abs(@0)/@1)")
return expBasisSum ;
111 if (str ==
"exp(-@0/@1)*sin(@0*@2)")
return sinBasisPlus ;
113 if (str ==
"exp(-abs(@0)/@1)*sin(@0*@2)")
return sinBasisSum ;
114 if (str ==
"exp(-@0/@1)*cos(@0*@2)")
return cosBasisPlus ;
116 if (str ==
"exp(-abs(@0)/@1)*cos(@0*@2)")
return cosBasisSum ;
118 if (str ==
"(@0/@1)*(@0/@1)*exp(-@0/@1)")
return quadBasisPlus ;
119 if (str ==
"exp(-@0/@1)*cosh(@0*@2/2)")
return coshBasisPlus;
121 if (str ==
"exp(-abs(@0)/@1)*cosh(@0*@2/2)")
return coshBasisSum;
122 if (str ==
"exp(-@0/@1)*sinh(@0*@2/2)")
return sinhBasisPlus;
124 if (str ==
"exp(-abs(@0)/@1)*sinh(@0*@2/2)")
return sinhBasisSum;
189 return basis().getVal() ;
201 double tau = (
static_cast<RooAbsReal*
>(
basis().getParameter(1)))->getVal() ;
205 return std::exp(-std::abs((
double)
x)/tau) ;
208 double dm = (
static_cast<RooAbsReal*
>(
basis().getParameter(2)))->getVal() ;
209 return std::exp(-std::abs((
double)
x)/tau)*std::sin(
x*dm) ;
212 double dm = (
static_cast<RooAbsReal*
>(
basis().getParameter(2)))->getVal() ;
213 return std::exp(-std::abs((
double)
x)/tau)*std::cos(
x*dm) ;
216 double tscaled = std::abs((
double)
x)/tau;
220 double tscaled = std::abs((
double)
x)/tau;
225 return std::exp(-std::abs((
double)
x)/tau)*std::sinh(
x*
dg/2) ;
229 return std::exp(-std::abs((
double)
x)/tau)*std::cosh(
x*
dg/2) ;
241 auto config = ctx.
config(
this);
278 {xVals, param1Vals, param2Vals},
extraArgs);
283 {xVals, param1Vals, param2Vals},
extraArgs);
298 {xVals, param1Vals, param2Vals},
extraArgs);
303 {xVals, param1Vals, param2Vals},
extraArgs);
356 x = std::max(
x, 0.0);
357 return -tau * std::exp(-
x / tau);
364 x = std::max(
x, 0.0);
365 return -(tau +
x) * std::exp(-
x / tau);
372 x = std::max(
x, 0.0);
373 return -(std::exp(-
x / tau) * (2 * tau * tau +
x *
x + 2 * tau *
x)) / tau;
380 const double num = tau * std::exp(-
x / tau);
381 const double den = dm * dm * tau * tau + 1.0;
389 const double num = 2 * tau * std::exp(-
x / tau);
390 const double den = dm * dm * tau * tau - 4.0;
398 x = std::max(
x, 0.0);
403 return fac != 0.0 ?
fac * (-tau * dm * std::cos(dm *
x) - std::sin(dm *
x)) : 0.0;
410 x = std::max(
x, 0.0);
412 return fac != 0.0 ?
fac * (tau * dm * std::sin(dm *
x) - std::cos(dm *
x)) : 0.0;
419 x = std::max(
x, 0.0);
421 const double arg = 0.5 * dm *
x;
422 return fac != 0.0 ?
fac * (tau * dm * std::cosh(arg) - 2. * std::sinh(arg)) : 0.0;
429 x = std::max(
x, 0.0);
431 const double arg = 0.5 * dm *
x;
432 return fac != 0.0 ?
fac * (tau * dm * std::sinh(arg) + 2. * std::cosh(arg)) : 0.0;
439template <
class Function>
479 const double tau = (
static_cast<RooAbsReal *
>(
basis().getParameter(1)))->getVal();
481 needsDm ? (
static_cast<RooAbsReal *
>(
basis().getParameter(2)))->getVal() : std::numeric_limits<Double_t>::quiet_NaN();
483 const double xmin =
x.
min(rangeName);
484 const double xmax =
x.
max(rangeName);
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Double_t(* Function)(Double_t)
Base class for PDFs that represent a physics model that can be analytically convolved with a resoluti...
Common abstract base class for objects that represent a value and a "shape" in RooFit.
TIterator Use servers() and begin()
void removeServer(RooAbsArg &server, bool force=false)
Unregister another RooAbsArg as a server to us, ie, declare that we no longer depend on its value and...
void addServer(RooAbsArg &server, bool valueProp=true, bool shapeProp=false, std::size_t refCount=1)
Register another RooAbsArg as a server to us, ie, declare that we depend on it.
Abstract base class for generator contexts of RooAbsPdf objects.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
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.
Container class to hold unbinned data.
std::span< const double > at(RooAbsArg const *arg, RooAbsArg const *caller=nullptr)
std::span< double > output()
RooBatchCompute::Config config(RooAbsArg const *arg) const
Implements a universal generator context for all RooAbsPdf classes that do not have or need a special...
RooResolutionModel is the base class for PDFs that represent a resolution model that can be convolute...
bool _ownBasis
Flag indicating ownership of _basis.
Int_t _basisCode
Identifier code for selected basis function.
RooAbsRealLValue & convVar() const
Return the convolution variable of the resolution model.
RooFormulaVar * _basis
Basis function convolved with this resolution model.
const RooFormulaVar & basis() const
RooTemplateProxy< RooAbsRealLValue > x
Dependent/convolution variable.
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.
Implements a RooResolution model that corresponds to a delta function.
void doEval(RooFit::EvalContext &) const override
Base function for computing multiple values of a RooAbsReal.
void generateEvent(Int_t code) override
Implement internal generator for observable x, x=0 for all events following definition of delta funct...
double evaluate() const override
Evaluate the truth model: a delta function when used as PDF, the basis function itself,...
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Advertise analytical integrals for compiled basis functions and when used as p.d.f without basis func...
Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, bool staticInitOK=true) const override
Advertise internal generator for observable x.
RooAbsGenContext * modelGenContext(const RooAbsAnaConvPdf &convPdf, const RooArgSet &vars, const RooDataSet *prototype=nullptr, const RooArgSet *auxProto=nullptr, bool verbose=false) const override
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Implement analytical integrals when used as p.d.f and for compiled basis functions.
Int_t basisCode(const char *name) const override
Return basis code for given basis definition string.
void changeBasis(RooFormulaVar *basis) override
Changes associated bases function to 'inBasis'.
void compute(Config cfg, Computer comp, std::span< double > output, VarSpan vars, ArgSpan extraArgs={})