82 std::string str =
name;
85 str.erase(remove(str.begin(),str.end(),
' '),str.end());
91 if (str ==
"exp(-@0/@1)*sin(@0*@2)")
return sinBasisPlus ;
93 if (str ==
"exp(-abs(@0)/@1)*sin(@0*@2)")
return sinBasisSum ;
94 if (str ==
"exp(-@0/@1)*cos(@0*@2)")
return cosBasisPlus ;
96 if (str ==
"exp(-abs(@0)/@1)*cos(@0*@2)")
return cosBasisSum ;
98 if (str ==
"(@0/@1)*(@0/@1)*exp(-@0/@1)")
return quadBasisPlus ;
101 if (str ==
"exp(-abs(@0)/@1)*cosh(@0*@2/2)")
return coshBasisSum;
102 if (str ==
"exp(-@0/@1)*sinh(@0*@2/2)")
return sinhBasisPlus;
104 if (str ==
"exp(-abs(@0)/@1)*sinh(@0*@2/2)")
return sinhBasisSum;
177 if ((basisSign==
Minus &&
x>0) ||
178 (basisSign==
Plus &&
x<0))
return 0 ;
186 return exp(-std::abs((
double)
x)/tau) ;
190 return exp(-std::abs((
double)
x)/tau)*sin(
x*dm) ;
194 return exp(-std::abs((
double)
x)/tau)*cos(
x*dm) ;
197 double tscaled = std::abs((
double)
x)/tau;
198 return exp(-tscaled)*tscaled ;
201 double tscaled = std::abs((
double)
x)/tau;
202 return exp(-tscaled)*tscaled*tscaled;
206 return exp(-std::abs((
double)
x)/tau)*sinh(
x*dg/2) ;
210 return exp(-std::abs((
double)
x)/tau)*cosh(
x*dg/2) ;
225 auto xVals = dataMap.
at(
x);
244 const double basisSign =
static_cast<double>((
BasisSign)(
_basisCode - 10 * (basisType - 1) - 2));
352 const double xmin =
x.
min(rangeName);
353 const double xmax =
x.
max(rangeName);
360 if (tau==0)
return 1 ;
364 if ((basisSign !=
Plus) && (
xmin<0)) {
373 if (tau==0)
return 0 ;
375 if (basisSign !=
Minus) {
376 double term = exp(-
xmax/tau);
381 if(term > 0.0) term *= -1/tau*sin(dm*
xmax) - dm*cos(dm*
xmax);
385 if (basisSign !=
Plus) {
386 double term = exp(
xmin/tau);
387 if (term > 0.0) term *= -1/tau*sin(dm*(-
xmin)) - dm*cos(dm*(-
xmin));
391 return result / (1/(tau*tau) + dm*dm) ;
396 if (tau==0)
return 1 ;
398 if (basisSign !=
Minus) {
399 double term = exp(-
xmax/tau);
400 if(term > 0.0) term *= -1/tau*cos(dm*
xmax) + dm*sin(dm*
xmax);
404 if (basisSign !=
Plus) {
405 double term = exp(
xmin/tau);
406 if(term > 0.0) term *= -1/tau*cos(dm*(-
xmin)) + dm*sin(dm*(-
xmin));
410 return result / (1/(tau*tau) + dm*dm) ;
414 if (tau==0)
return 0 ;
415 double t_max =
xmax/tau ;
416 return tau*( 1 - (1 + t_max)*exp(-t_max) ) ;
420 if (tau==0)
return 0 ;
421 double t_max =
xmax/tau ;
422 return tau*( 2 - (2 + (2 + t_max)*t_max)*exp(-t_max) ) ;
427 if (tau==0)
return 0 ;
429 double taup = 2*tau/(2-tau*dg);
430 double taum = 2*tau/(2+tau*dg);
431 if (basisSign !=
Minus)
result += 0.5*( taup*(1-exp(-
xmax/taup)) - taum*(1-exp(-
xmax/taum)) ) ;
432 if (basisSign !=
Plus)
result -= 0.5*( taup*(1-exp(
xmin/taup)) - taum*(1-exp(
xmin/taum)) ) ;
438 if (tau==0)
return 1 ;
440 double taup = 2*tau/(2-tau*dg);
441 double taum = 2*tau/(2+tau*dg);
442 if (basisSign !=
Minus)
result += 0.5*( taup*(1-exp(-
xmax/taup)) + taum*(1-exp(-
xmax/taum)) ) ;
443 if (basisSign !=
Plus)
result += 0.5*( taup*(1-exp(
xmin/taup)) + taum*(1-exp(
xmin/taum)) ) ;
459 const RooArgSet* auxProto,
bool verbose)
const
462 return new RooGenContext(convPdf, vars, prototype, auxProto, verbose, &forceDirect);
472 if (
matchArgs(directVars,generateVars,
x))
return 1 ;
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
RooAbsAnaConvPdf is the base class for PDFs that represent a physics model that can be analytically c...
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
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...
const RefCountList_t & servers() const
List of all servers of this object.
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.
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
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.
RooDataSet is a container class to hold unbinned data.
RooSpan< const double > at(RooAbsArg const *arg, RooAbsArg const *caller=nullptr)
Class RooGenContext implement a universal generator context for all RooAbsPdf classes that do not hav...
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.
A simple container to hold a batch of data values.
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.
RooTruthModel is an implementation of RooResolution model that provides a delta-function resolution m...
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.
void computeBatch(cudaStream_t *, double *output, size_t size, RooFit::Detail::DataMap const &) const override
Base function for computing multiple values of a RooAbsReal.
~RooTruthModel() override
Destructor.
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'.
const char * GetTitle() const override
Returns title of object.
R__EXTERN RooBatchComputeInterface * dispatchCUDA
R__EXTERN RooBatchComputeInterface * dispatchCPU
This dispatch pointer points to an implementation of the compute library, provided one has been loade...
std::vector< double > ArgVector