Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooKeysPdf.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitModels *
4 * File: $Id: RooKeysPdf.h,v 1.10 2007/05/11 09:13:07 verkerke Exp $
5 * Authors: *
6 * GR, Gerhard Raven, UC San Diego, raven@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
9 * *
10 * Copyright (c) 2000-2005, Regents of the University of California *
11 * and Stanford University. All rights reserved. *
12 * *
13 * Redistribution and use in source and binary forms, *
14 * with or without modification, are permitted according to the terms *
15 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
16 *****************************************************************************/
17#ifndef ROO_KEYS
18#define ROO_KEYS
19
20#include "RooAbsPdf.h"
21#include "RooRealProxy.h"
22
23class RooRealVar;
24
25class RooKeysPdf : public RooAbsPdf {
26public:
27 /// Boundary correction obtained by reflecting the data across the lower
28 /// and/or upper edge of the observable range. Symmetric mirroring adds the
29 /// reflected events (density flat at the boundary), asymmetric mirroring
30 /// subtracts them (density vanishing at the boundary).
31 enum Mirror {
32 NoMirror, ///< No boundary correction
33 MirrorLeft, ///< Symmetric mirror at the lower edge
34 MirrorRight, ///< Symmetric mirror at the upper edge
35 MirrorBoth, ///< Symmetric mirror at both edges
36 MirrorAsymLeft, ///< Asymmetric mirror at the lower edge
37 MirrorAsymLeftRight, ///< Asymmetric mirror at the lower edge, symmetric mirror at the upper edge
38 MirrorAsymRight, ///< Asymmetric mirror at the upper edge
39 MirrorLeftAsymRight, ///< Symmetric mirror at the lower edge, asymmetric mirror at the upper edge
40 MirrorAsymBoth ///< Asymmetric mirror at both edges
41 };
42 RooKeysPdf() ;
43 RooKeysPdf(const char *name, const char *title,
45 double rho=1);
46 RooKeysPdf(const char *name, const char *title,
48 double rho=1);
49 RooKeysPdf(const RooKeysPdf& other, const char* name=nullptr);
50 TObject* clone(const char* newname=nullptr) const override {return new RooKeysPdf(*this,newname); }
51 ~RooKeysPdf() override;
52
54 const char* rangeName = nullptr) const override;
55 double analyticalIntegral(Int_t code, const char* rangeName = nullptr) const override;
56 Int_t getMaxVal(const RooArgSet& vars) const override;
57 double maxVal(Int_t code) const override;
58
60
61protected:
62
64 double evaluate() const override;
65
66private:
67 // how far you have to go out in a Gaussian until it is smaller than the
68 // machine precision
69 static const double _nSigma; ///<!
70
72 double *_dataPts = nullptr; //[_nEvents]
73 double *_dataWgts = nullptr; //[_nEvents]
74 double *_weights = nullptr; //[_nEvents]
75 double _sumWgt = 0.0;
76
77 constexpr static int _nPoints{1000};
79
80 double g(double x,double sigma) const;
81
82 bool _mirrorLeft = false;
83 bool _mirrorRight = false;
84 bool _asymLeft = false;
85 bool _asymRight = false;
86
87 // cached info on variable
89 double _lo, _hi, _binWidth;
90 double _rho;
91
92 ClassDefOverride(RooKeysPdf,2) // One-dimensional non-parametric kernel estimation p.d.f.
93};
94
95#endif
#define g(i)
Definition RSha256.hxx:105
char Char_t
Character 1 byte (char)
Definition RtypesCore.h:52
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
char name[80]
Definition TGX11.cxx:148
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:32
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:63
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Container class to hold unbinned data.
Definition RooDataSet.h:32
Class RooKeysPdf implements a one-dimensional kernel estimation p.d.f which model the distribution of...
Definition RooKeysPdf.h:25
double _binWidth
Definition RooKeysPdf.h:89
double _sumWgt
Definition RooKeysPdf.h:75
static constexpr int _nPoints
Definition RooKeysPdf.h:77
double * _dataWgts
Definition RooKeysPdf.h:73
RooKeysPdf()
coverity[UNINIT_CTOR]
double _lookupTable[_nPoints+1]
Definition RooKeysPdf.h:78
double maxVal(Int_t code) const override
Return maximum value for set of observables identified by code assigned in getMaxVal.
bool _mirrorRight
Definition RooKeysPdf.h:83
double _rho
Definition RooKeysPdf.h:90
double _hi
Definition RooKeysPdf.h:89
TObject * clone(const char *newname=nullptr) const override
Definition RooKeysPdf.h:50
Char_t _varName[128]
Definition RooKeysPdf.h:88
Int_t _nEvents
Definition RooKeysPdf.h:71
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.
RooRealProxy _x
Definition RooKeysPdf.h:63
double * _weights
Definition RooKeysPdf.h:74
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
bool _mirrorLeft
Definition RooKeysPdf.h:82
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
~RooKeysPdf() override
double _lo
Definition RooKeysPdf.h:89
Mirror
Boundary correction obtained by reflecting the data across the lower and/or upper edge of the observa...
Definition RooKeysPdf.h:31
@ MirrorAsymRight
Asymmetric mirror at the upper edge.
Definition RooKeysPdf.h:38
@ NoMirror
No boundary correction.
Definition RooKeysPdf.h:32
@ MirrorBoth
Symmetric mirror at both edges.
Definition RooKeysPdf.h:35
@ MirrorLeftAsymRight
Symmetric mirror at the lower edge, asymmetric mirror at the upper edge.
Definition RooKeysPdf.h:39
@ MirrorLeft
Symmetric mirror at the lower edge.
Definition RooKeysPdf.h:33
@ MirrorAsymLeft
Asymmetric mirror at the lower edge.
Definition RooKeysPdf.h:36
@ MirrorRight
Symmetric mirror at the upper edge.
Definition RooKeysPdf.h:34
@ MirrorAsymBoth
Asymmetric mirror at both edges.
Definition RooKeysPdf.h:40
@ MirrorAsymLeftRight
Asymmetric mirror at the lower edge, symmetric mirror at the upper edge.
Definition RooKeysPdf.h:37
double * _dataPts
Definition RooKeysPdf.h:72
bool _asymRight
Definition RooKeysPdf.h:85
static const double _nSigma
!
Definition RooKeysPdf.h:69
bool _asymLeft
Definition RooKeysPdf.h:84
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.
Definition RooRealVar.h:37
Mother of all ROOT objects.
Definition TObject.h:42
const Double_t sigma
Double_t x[n]
Definition legend1.C:17