37 inline double a(
int p,
int l,
int m) {
40 return p%2==0 ?
r : -
r ;
43 void checkCoeffs(
int m1,
int l1,
int m2,
int l2) {
44 if (m1 < 0 || m2 < 0) {
45 throw std::invalid_argument(
"RooLegendre: m coefficients need to be >= 0.");
47 if (l1 < m1 || l2 < m2) {
48 throw std::invalid_argument(
"RooLegendre: m coefficients need to be smaller than corresponding l.");
66 ,
_ctheta(
"ctheta",
"ctheta", this, ctheta)
76 ,
_ctheta(
"ctheta",
"ctheta", this, ctheta)
98 double ctheta = std::max(-1., std::min((
double)
_ctheta, +1.));
111void compute(
size_t batchSize,
const int l1,
const int m1,
const int l2,
const int m2,
112 double * __restrict output,
113 double const * __restrict TH)
115 double legendre1 = 1.0;
116 double legendreMinus1 = 1.0;
126 for (
size_t i=0; i<batchSize; i++) {
128 output[i] = legendreMinus1;
129 }
else if (TH[i] >= 1.0) {
130 output[i] = legendre1;
156 return range ==
nullptr || strlen(range) == 0
157 ? std::abs(
x.min() + 1.) < 1.e-8 && std::abs(
x.max() - 1.) < 1.e-8
158 : std::abs(
x.min(range) + 1.) < 1.e-8 && std::abs(
x.max(range) - 1.) < 1.e-8;
189 for (
int p1=0; 2*p1 <=
_l1-
_m1 ;++p1) {
191 for (
int p2=0; 2*p2 <=
_l2-
_m2 ; ++p2) {
205 if (
_m1==0&&
_m2==0)
return 1;
207 if (
_l1<3&&
_l2<3)
return 1;
212 inline double maxSingle(
int i,
int j) {
220 static const double m2[3] = { 3,3 };
RooTemplateProxy< RooAbsReal > RooRealProxy
Compatibility typedef replacing the old RooRealProxy class.
int Int_t
Signed integer 4 bytes (int).
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
RooAbsReal()
coverity[UNINIT_CTOR] Default constructor
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.
std::span< const double > at(RooAbsArg const *arg, RooAbsArg const *caller=nullptr)
std::span< double > output()
double evaluate() const override
Note: P_0^0 = 1, so P_l^m = P_l^m P_0^0.
Int_t getMaxVal(const RooArgSet &vars) const override
Advertise capability to determine maximum value of function for given set of observables.
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
this was verified to match mathematica for l1 in [0,2], m1 in [0,l1], l2 in [l1,4],...
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
void doEval(RooFit::EvalContext &) const override
Base function for computing multiple values of a RooAbsReal.
double maxVal(Int_t code) const override
Return maximum value for set of observables identified by code assigned in getMaxVal.
double assoc_legendre(unsigned l, unsigned m, double x)
Computes the associated Legendre polynomials.
RVec< PromoteTypes< T0, T1 > > pow(const T0 &x, const RVec< T1 > &v)
double legendre(unsigned l, unsigned m, double x)
Double_t Factorial(Int_t i)
Computes factorial(n).
Double_t Gamma(Double_t z)
Computation of gamma(z) for all z.