52 std::log(std::numeric_limits<double>::epsilon()));
58 _mirrorLeft(false), _mirrorRight(false),
59 _asymLeft(false), _asymRight(false)
69 Mirror mirror,
double rho) :
71 _x(
"x",
"observable",this,
x),
76 _mirrorLeft(mirror==MirrorLeft || mirror==MirrorBoth || mirror==MirrorLeftAsymRight),
77 _mirrorRight(mirror==MirrorRight || mirror==MirrorBoth || mirror==MirrorAsymLeftRight),
78 _asymLeft(mirror==MirrorAsymLeft || mirror==MirrorAsymLeftRight || mirror==MirrorAsymBoth),
79 _asymRight(mirror==MirrorAsymRight || mirror==MirrorLeftAsymRight || mirror==MirrorAsymBoth),
98 Mirror mirror,
double rho) :
100 _x(
"x",
"Observable",this,xpdf),
105 _mirrorLeft(mirror==MirrorLeft || mirror==MirrorBoth || mirror==MirrorLeftAsymRight),
106 _mirrorRight(mirror==MirrorRight || mirror==MirrorBoth || mirror==MirrorAsymLeftRight),
107 _asymLeft(mirror==MirrorAsymLeft || mirror==MirrorAsymLeftRight || mirror==MirrorAsymBoth),
108 _asymRight(mirror==MirrorAsymRight || mirror==MirrorLeftAsymRight || mirror==MirrorAsymBoth),
125 RooAbsPdf(other,
name), _x(
"x",this,other._x), _nEvents(other._nEvents),
126 _dataPts(0), _dataWgts(0), _weights(0), _sumWgt(0),
127 _mirrorLeft( other._mirrorLeft ), _mirrorRight( other._mirrorRight ),
128 _asymLeft(other._asymLeft), _asymRight(other._asymRight),
171 inline bool operator()(
const struct Data&
a,
const struct Data&
b)
const
172 {
return a.x <
b.x; }
180 std::vector<Data> tmp;
182 double x0 = 0.,
x1 = 0.,
x2 = 0.;
186 for (
Int_t i = 0; i <
data.numEntries(); ++i) {
188 const double x = real.
getVal();
189 const double w =
data.weight();
208 std::sort(tmp.begin(), tmp.end(), cmp());
214 for (
unsigned i = 0; i < tmp.size(); ++i) {
220 std::vector<Data> tmp2;
225 double sigmav=std::sqrt(
x2/x0-meanv*meanv);
226 double h=std::pow(
double(4)/
double(3),0.2)*std::pow(
_sumWgt,-0.2)*
_rho;
227 double hmin=
h*sigmav*std::sqrt(2.)/10;
228 double norm=
h*std::sqrt(sigmav *
_sumWgt)/(2.0*std::sqrt(3.0));
242 const double xlo = std::min(
_hi,
244 const double xhi = std::max(
_lo,
246 if (xlo >= xhi)
continue;
254 for (
Int_t k = binlo; k <= binhi; ++k, chi += chi2incr) {
260 const double xlo = std::min(
_hi,
262 const double xhi = std::max(
_lo,
264 if (xlo >= xhi)
continue;
272 for (
Int_t k = binlo; k <= binhi; ++k, chi += chi2incr) {
279 const double xlo = std::min(
_hi,
281 const double xhi = std::max(
_lo,
283 if (xlo >= xhi)
continue;
291 for (
Int_t k = binlo; k <= binhi; ++k, chi += chi2incr) {
296 static const double sqrt2pi(std::sqrt(2*
TMath::Pi()));
347 for (
Int_t i = imin + 2; i < imax; ++i)
362 }
else if (imin == imax) {
382 double max = -std::numeric_limits<double>::max();
399 for ( ; it < iend; ++it) {
400 const double r = (
x - *it) / sigmav;
401 y += std::exp(-0.5 *
r *
r);
404 static const double sqrt2pi(std::sqrt(2*
TMath::Pi()));
405 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.
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.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
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)