73enum BasisSign {
Both = 0, Plus = +1, Minus = -1 };
77 return static_cast<BasisType
>(basisCode == 0 ? 0 : (basisCode / 10) + 1);
110 mean(
"mean",
"Mean",
this,_mean),
112 msf(
"msf",
"Mean Scale Factor",
this,_meanSF),
121 _flatSFInt(
other._flatSFInt),
122 _asympInt(
other._asympInt),
134 std::string str =
name;
137 str.erase(remove(str.begin(),str.end(),
' '),str.end());
141 if (str ==
"exp(-abs(@0)/@1)")
return expBasisSum ;
142 if (str ==
"exp(-@0/@1)*sin(@0*@2)")
return sinBasisPlus ;
144 if (str ==
"exp(-abs(@0)/@1)*sin(@0*@2)")
return sinBasisSum ;
145 if (str ==
"exp(-@0/@1)*cos(@0*@2)")
return cosBasisPlus ;
147 if (str ==
"exp(-abs(@0)/@1)*cos(@0*@2)")
return cosBasisSum ;
149 if (str ==
"(@0/@1)*(@0/@1)*exp(-@0/@1)")
return quadBasisPlus ;
150 if (str ==
"exp(-@0/@1)*cosh(@0*@2/2)")
return coshBasisPlus;
152 if (str ==
"exp(-abs(@0)/@1)*cosh(@0*@2/2)")
return coshBasisSum;
153 if (str ==
"exp(-@0/@1)*sinh(@0*@2/2)")
return sinhBasisPlus;
155 if (str ==
"exp(-abs(@0)/@1)*sinh(@0*@2/2)")
return sinhBasisSum;
198 {xVals, meanVals, meanSfVals, sigmaVals, sigmaSfVals, param1Vals},
extraArgs);
208 for (
unsigned int i = 0; i <
size; ++i) {
217 static double root2(std::sqrt(2.)) ;
218 static double root2pi(std::sqrt(2.*std::atan2(0.,-1.))) ;
219 static double rootpi(std::sqrt(std::atan2(0.,-1.))) ;
245 double _x =
omega *tau ;
261 if (_x==0.)
return result ;
279 if (
basisSign!=Minus)
result += 0.5*( evalCerf(0,-
u,
c*(1-_y)).real()+
sgn*evalCerf(0,-
u,
c*(1+_y)).real()) ;
289 double f1 = std::exp(-
u*
u);
298 double f1 = std::exp(-
u*
u);
362 static const double root2 = std::sqrt(2.) ;
364 static const double rootpi = std::sqrt(std::atan2(0.0,-1.0));
382 if (
verboseEval()>0) std::cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 1st form" << std::endl ;
406 if (
verboseEval()>0) std::cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 2nd form" << std::endl ;
418 if (
verboseEval()>0) std::cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 3d form tau=" << tau << std::endl ;
427 double _x =
omega * tau ;
431 if (
verboseEval()>0) std::cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 4th form omega = " <<
omega <<
", tau = " << tau << std::endl ;
442 if (
verboseEval()>0) std::cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 5th form omega = " <<
omega <<
", tau = " << tau << std::endl ;
453 if (
verboseEval()>0) {std::cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 8th form tau=" << tau << std::endl ; }
456 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());
457 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());
464 if (
verboseEval()>0) std::cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 6th form tau=" << tau << std::endl ;
486 if (
verboseEval()>0) std::cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 7th form tau=" << tau << std::endl ;
519 std::complex<double>
diff(2., 0.);
526 diff *= std::complex<double>(1., _x);
527 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...
bool matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
virtual void doEval(RooFit::EvalContext &) const
Base function for computing multiple values of a RooAbsReal.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
std::span< const double > at(RooAbsArg const *arg, RooAbsArg const *caller=nullptr)
std::span< double > output()
RooBatchCompute::Config config(RooAbsArg const *arg) const
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*...