72enum BasisSign {
Both = 0, Plus = +1, Minus = -1 };
76 return static_cast<BasisType
>(basisCode == 0 ? 0 : (basisCode / 10) + 1);
109 mean(
"mean",
"Mean",
this,_mean),
111 msf(
"msf",
"Mean Scale Factor",
this,_meanSF),
120 _flatSFInt(
other._flatSFInt),
121 _asympInt(
other._asympInt),
133 std::string str =
name;
136 str.erase(remove(str.begin(),str.end(),
' '),str.end());
140 if (str ==
"exp(-abs(@0)/@1)")
return expBasisSum ;
141 if (str ==
"exp(-@0/@1)*sin(@0*@2)")
return sinBasisPlus ;
143 if (str ==
"exp(-abs(@0)/@1)*sin(@0*@2)")
return sinBasisSum ;
144 if (str ==
"exp(-@0/@1)*cos(@0*@2)")
return cosBasisPlus ;
146 if (str ==
"exp(-abs(@0)/@1)*cos(@0*@2)")
return cosBasisSum ;
148 if (str ==
"(@0/@1)*(@0/@1)*exp(-@0/@1)")
return quadBasisPlus ;
149 if (str ==
"exp(-@0/@1)*cosh(@0*@2/2)")
return coshBasisPlus;
151 if (str ==
"exp(-abs(@0)/@1)*cosh(@0*@2/2)")
return coshBasisSum;
152 if (str ==
"exp(-@0/@1)*sinh(@0*@2/2)")
return sinhBasisPlus;
154 if (str ==
"exp(-abs(@0)/@1)*sinh(@0*@2/2)")
return sinhBasisSum;
172 std::span<double> output =
ctx.output();
173 std::size_t
size = output.size();
197 {xVals, meanVals, meanSfVals, sigmaVals, sigmaSfVals, param1Vals},
extraArgs);
207 for (
unsigned int i = 0; i <
size; ++i) {
216 static double root2(std::sqrt(2.)) ;
217 static double root2pi(std::sqrt(2.*std::atan2(0.,-1.))) ;
218 static double rootpi(std::sqrt(std::atan2(0.,-1.))) ;
244 double _x =
omega *tau ;
260 if (_x==0.)
return result ;
278 if (
basisSign!=Minus)
result += 0.5*( evalCerf(0,-
u,
c*(1-_y)).real()+
sgn*evalCerf(0,-
u,
c*(1+_y)).real()) ;
288 double f1 = std::exp(-
u*
u);
297 double f1 = std::exp(-
u*
u);
361 static const double root2 = std::sqrt(2.) ;
363 static const double rootpi = std::sqrt(std::atan2(0.0,-1.0));
381 if (
verboseEval()>0) std::cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 1st form" << std::endl ;
405 if (
verboseEval()>0) std::cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 2nd form" << std::endl ;
417 if (
verboseEval()>0) std::cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 3d form tau=" << tau << std::endl ;
426 double _x =
omega * tau ;
430 if (
verboseEval()>0) std::cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 4th form omega = " <<
omega <<
", tau = " << tau << std::endl ;
441 if (
verboseEval()>0) std::cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 5th form omega = " <<
omega <<
", tau = " << tau << std::endl ;
452 if (
verboseEval()>0) {std::cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 8th form tau=" << tau << std::endl ; }
455 if (
basisSign!=Minus)
result += 0.5*(
evalCerfInt(+1,0,tau/(1-_y),-
umin,-
umax,
c*(1-_y)).real()+
sgn*
evalCerfInt(+1,0,tau/(1+_y),-
umin,-
umax,
c*(1+_y)).real());
456 if (
basisSign!=Plus)
result += 0.5*(
sgn*
evalCerfInt(-1,0,tau/(1-_y),
umin,
umax,
c*(1-_y)).real()+
evalCerfInt(-1,0,tau/(1+_y),
umin,
umax,
c*(1+_y)).real());
463 if (
verboseEval()>0) std::cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 6th form tau=" << tau << std::endl ;
485 if (
verboseEval()>0) std::cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 7th form tau=" << tau << std::endl ;
518 std::complex<double>
diff(2., 0.);
525 diff *= std::complex<double>(1., _x);
526 diff *= tau / (1.+_x*_x);
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
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
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
static int verboseEval()
Return global level of verbosity for p.d.f. evaluations.
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...
virtual void doEval(RooFit::EvalContext &) const
Base function for computing multiple values of a RooAbsReal.
bool matchArgs(const RooArgSet &allDeps, RooArgSet &analDeps, const RooArgProxy &a, const Proxies &... proxies) const
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Class RooGaussModel implements a RooResolutionModel that models a Gaussian distribution.
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
std::complex< double > evalCerfInt(double sign, double wt, double tau, double umin, double umax, double c) const
void doEval(RooFit::EvalContext &) const override
Base function for computing multiple values of a RooAbsReal.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
void generateEvent(Int_t code) override
Interface for generation of an event using the algorithm corresponding to the specified code.
bool canComputeBatchWithCuda() const override
Int_t basisCode(const char *name) const override
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...
double analyticalIntegral(Int_t code, const char *rangeName) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
static std::complex< double > erfc(const std::complex< double > z)
complex erfc function
static std::complex< double > erf(const std::complex< double > z)
complex erf function
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
Provides static functions to create and keep track of RooRealVar constants.
RooResolutionModel is the base class for PDFs that represent a resolution model that can be convolute...
Int_t _basisCode
Identifier code for selected basis function.
RooAbsRealLValue & convVar() const
Return the convolution variable of the 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.
const T & arg() const
Return reference to object held in proxy.
double min(const char *rname=nullptr) const
Query lower limit of range. This requires the payload to be RooAbsRealLValue or derived.
const char * GetName() const override
Returns name of object.
This is the base class for the ROOT Random number generators.
void compute(Config cfg, Computer comp, std::span< double > output, VarSpan vars, ArgSpan extraArgs={})
STD::complex< double > evalCerf(double swt, double u, double c)
STD::complex< double > evalCerfApprox(double _x, double u, double c)
use the approximation: erf(z) = exp(-z*z)/(STD::sqrt(pi)*z) to explicitly cancel the divergent exp(y*...