50 std::log(std::numeric_limits<double>::epsilon()));
74 _x(
"x",
"Observable", this, xpdf),
75 _mirrorLeft(mirror == MirrorLeft || mirror == MirrorBoth || mirror == MirrorLeftAsymRight),
76 _mirrorRight(mirror == MirrorRight || mirror == MirrorBoth || mirror == MirrorAsymLeftRight),
77 _asymLeft(mirror == MirrorAsymLeft || mirror == MirrorAsymLeftRight || mirror == MirrorAsymBoth),
78 _asymRight(mirror == MirrorAsymRight || mirror == MirrorLeftAsymRight || mirror == MirrorAsymBoth),
81 _binWidth((_hi - _lo) / (_nPoints - 1)),
95 _x(
"x", this, other._x),
96 _nEvents(other._nEvents),
97 _mirrorLeft(other._mirrorLeft),
98 _mirrorRight(other._mirrorRight),
99 _asymLeft(other._asymLeft),
100 _asymRight(other._asymRight),
103 _binWidth(other._binWidth),
144 inline bool operator()(
const struct Data&
a,
const struct Data&
b)
const
145 {
return a.x <
b.x; }
153 std::vector<Data> tmp;
161 for (
Int_t i = 0; i <
data.numEntries(); ++i) {
163 const double x = real.
getVal();
164 const double w =
data.weight();
183 std::sort(tmp.begin(), tmp.end(), cmp());
189 for (
unsigned i = 0; i < tmp.size(); ++i) {
195 std::vector<Data> tmp2;
200 double sigmav=std::sqrt(
x2/x0-meanv*meanv);
201 double h=std::pow(
double(4)/
double(3),0.2)*std::pow(
_sumWgt,-0.2)*
_rho;
202 double hmin=
h*sigmav*std::sqrt(2.)/10;
203 double norm=
h*std::sqrt(sigmav *
_sumWgt)/(2.0*std::sqrt(3.0));
217 const double xlo = std::min(
_hi,
219 const double xhi = std::max(
_lo,
221 if (xlo >= xhi)
continue;
229 for (
Int_t k = binlo; k <= binhi; ++k, chi += chi2incr) {
235 const double xlo = std::min(
_hi,
237 const double xhi = std::max(
_lo,
239 if (xlo >= xhi)
continue;
247 for (
Int_t k = binlo; k <= binhi; ++k, chi += chi2incr) {
254 const double xlo = std::min(
_hi,
256 const double xhi = std::max(
_lo,
258 if (xlo >= xhi)
continue;
266 for (
Int_t k = binlo; k <= binhi; ++k, chi += chi2incr) {
271 static const double sqrt2pi(std::sqrt(2*
TMath::Pi()));
313 const double xmin = std::max(
_lo,
_x.min(rangeName));
314 const double xmax = std::min(
_hi,
_x.max(rangeName));
322 for (
Int_t i = imin + 2; i < imax; ++i)
337 }
else if (imin == imax) {
357 double max = -std::numeric_limits<double>::max();
374 for ( ; it < iend; ++it) {
375 const double r = (
x - *it) / sigmav;
376 y += std::exp(-0.5 *
r *
r);
379 static const double sqrt2pi(std::sqrt(2*
TMath::Pi()));
380 return y/(sigmav*sqrt2pi);
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t hmin
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 r
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
TRObject operator()(const T1 &t1) const
bool contains(const RooAbsArg &var) const
Check if collection contains an argument with the same name as var.
Abstract interface for all probability density functions.
Abstract base class for objects that represent a real value and implements functionality common to al...
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().
RooAbsArg * absArg() const
Return pointer to contained argument.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Container class to hold unbinned data.
Class RooKeysPdf implements a one-dimensional kernel estimation p.d.f which model the distribution of...
static constexpr int _nPoints
RooKeysPdf()
coverity[UNINIT_CTOR]
double _lookupTable[_nPoints+1]
double maxVal(Int_t code) const override
Return maximum value for set of observables identified by code assigned in getMaxVal.
double g(double x, double sigma) const
void LoadDataSet(RooDataSet &data)
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
static const double _nSigma
Int_t getMaxVal(const RooArgSet &vars) const override
Advertise capability to determine maximum value of function for given set of observables.
Variable that can be changed from the outside.
const char * GetName() const override
Returns name of object.
static uint64_t sum(uint64_t i)