52 std::log(std::numeric_limits<double>::epsilon()));
67 Mirror mirror,
double rho) :
69 _x(
"x",
"observable",this,
x),
70 _mirrorLeft(mirror==MirrorLeft || mirror==MirrorBoth || mirror==MirrorLeftAsymRight),
71 _mirrorRight(mirror==MirrorRight || mirror==MirrorBoth || mirror==MirrorAsymLeftRight),
72 _asymLeft(mirror==MirrorAsymLeft || mirror==MirrorAsymLeftRight || mirror==MirrorAsymBoth),
73 _asymRight(mirror==MirrorAsymRight || mirror==MirrorLeftAsymRight || mirror==MirrorAsymBoth),
92 Mirror mirror,
double rho) :
94 _x(
"x",
"Observable",this,xpdf),
95 _mirrorLeft(mirror==MirrorLeft || mirror==MirrorBoth || mirror==MirrorLeftAsymRight),
96 _mirrorRight(mirror==MirrorRight || mirror==MirrorBoth || mirror==MirrorAsymLeftRight),
97 _asymLeft(mirror==MirrorAsymLeft || mirror==MirrorAsymLeftRight || mirror==MirrorAsymBoth),
98 _asymRight(mirror==MirrorAsymRight || mirror==MirrorLeftAsymRight || mirror==MirrorAsymBoth),
115 RooAbsPdf(other,
name), _x(
"x",this,other._x), _nEvents(other._nEvents),
116 _mirrorLeft( other._mirrorLeft ), _mirrorRight( other._mirrorRight ),
117 _asymLeft(other._asymLeft), _asymRight(other._asymRight),
160 inline bool operator()(
const struct Data&
a,
const struct Data&
b)
const
161 {
return a.x <
b.x; }
169 std::vector<Data> tmp;
171 double x0 = 0.,
x1 = 0.,
x2 = 0.;
175 for (
Int_t i = 0; i <
data.numEntries(); ++i) {
177 const double x = real.
getVal();
178 const double w =
data.weight();
197 std::sort(tmp.begin(), tmp.end(), cmp());
203 for (
unsigned i = 0; i < tmp.size(); ++i) {
209 std::vector<Data> tmp2;
214 double sigmav=std::sqrt(
x2/x0-meanv*meanv);
215 double h=std::pow(
double(4)/
double(3),0.2)*std::pow(
_sumWgt,-0.2)*
_rho;
216 double hmin=
h*sigmav*std::sqrt(2.)/10;
217 double norm=
h*std::sqrt(sigmav *
_sumWgt)/(2.0*std::sqrt(3.0));
231 const double xlo = std::min(
_hi,
233 const double xhi = std::max(
_lo,
235 if (xlo >= xhi)
continue;
243 for (
Int_t k = binlo; k <= binhi; ++k, chi += chi2incr) {
249 const double xlo = std::min(
_hi,
251 const double xhi = std::max(
_lo,
253 if (xlo >= xhi)
continue;
261 for (
Int_t k = binlo; k <= binhi; ++k, chi += chi2incr) {
268 const double xlo = std::min(
_hi,
270 const double xhi = std::max(
_lo,
272 if (xlo >= xhi)
continue;
280 for (
Int_t k = binlo; k <= binhi; ++k, chi += chi2incr) {
285 static const double sqrt2pi(std::sqrt(2*
TMath::Pi()));
336 for (
Int_t i = imin + 2; i < imax; ++i)
351 }
else if (imin == imax) {
371 double max = -std::numeric_limits<double>::max();
388 for ( ; it < iend; ++it) {
389 const double r = (
x - *it) / sigmav;
390 y += std::exp(-0.5 *
r *
r);
393 static const double sqrt2pi(std::sqrt(2*
TMath::Pi()));
394 return y/(sigmav*sqrt2pi);
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.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
virtual double getMax(const char *name=nullptr) const
Get maximum of currently defined range.
virtual double getMin(const char *name=nullptr) const
Get minimum of currently defined range.
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.
RooDataSet is a 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.
RooRealVar represents a variable that can be changed from the outside.
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.
static uint64_t sum(uint64_t i)