|
Meerkat
v1r3
Multidimensional kernel density estimation package
|
#include <BinnedKernelDensity.hh>
|
| BinnedKernelDensity (const char *pdfName, AbsPhaseSpace *thePhaseSpace, TTree *tree, const char *vars1, UInt_t bins1, Double_t width1, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 1-dimensional kernel PDF with binned interpolation from the sample of points in an NTuple. More...
|
|
| BinnedKernelDensity (const char *pdfName, AbsPhaseSpace *thePhaseSpace, TTree *tree, const char *vars1, const char *weight, UInt_t bins1, Double_t width1, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 1-dimensional kernel PDF with binned interpolation from the sample of points in an NTuple with weight. More...
|
|
| BinnedKernelDensity (const char *pdfName, AbsPhaseSpace *thePhaseSpace, TTree *tree, const char *vars1, const char *vars2, UInt_t bins1, UInt_t bins2, Double_t width1, Double_t width2, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 2-dimensional kernel PDF with binned interpolation from the sample of points in an NTUple. More...
|
|
| BinnedKernelDensity (const char *pdfName, AbsPhaseSpace *thePhaseSpace, TTree *tree, const char *vars1, const char *vars2, const char *weight, UInt_t bins1, UInt_t bins2, Double_t width1, Double_t width2, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 2-dimensional kernel PDF with binned interpolation from the sample of points in an NTuple with weight. More...
|
|
| BinnedKernelDensity (const char *pdfName, AbsPhaseSpace *thePhaseSpace, TTree *tree, const char *vars1, const char *vars2, const char *vars3, UInt_t bins1, UInt_t bins2, UInt_t bins3, Double_t width1, Double_t width2, Double_t width3, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 3-dimensional kernel PDF with binned interpolation from the sample of points in an NTUple. More...
|
|
| BinnedKernelDensity (const char *pdfName, AbsPhaseSpace *thePhaseSpace, TTree *tree, const char *vars1, const char *vars2, const char *vars3, const char *weight, UInt_t bins1, UInt_t bins2, UInt_t bins3, Double_t width1, Double_t width2, Double_t width3, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 3-dimensional kernel PDF with binned interpolation from the sample of points in an NTuple with weight. More...
|
|
| BinnedKernelDensity (const char *pdfName, AbsPhaseSpace *thePhaseSpace, TTree *tree, const char *vars1, const char *vars2, const char *vars3, const char *vars4, UInt_t bins1, UInt_t bins2, UInt_t bins3, UInt_t bins4, Double_t width1, Double_t width2, Double_t width3, Double_t width4, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 4-dimensional kernel PDF with binned interpolation from the sample of points in an NTuple. More...
|
|
| BinnedKernelDensity (const char *pdfName, AbsPhaseSpace *thePhaseSpace, TTree *tree, const char *vars1, const char *vars2, const char *vars3, const char *vars4, const char *weight, UInt_t bins1, UInt_t bins2, UInt_t bins3, UInt_t bins4, Double_t width1, Double_t width2, Double_t width3, Double_t width4, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 4-dimensional kernel PDF with binned interpolation from the sample of points in an NTuple with weight. More...
|
|
| BinnedKernelDensity (const char *pdfName, AbsPhaseSpace *thePhaseSpace, TTree *tree, const char *vars1, const char *vars2, const char *vars3, const char *vars4, const char *vars5, UInt_t bins1, UInt_t bins2, UInt_t bins3, UInt_t bins4, UInt_t bins5, Double_t width1, Double_t width2, Double_t width3, Double_t width4, Double_t width5, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 5-dimensional kernel PDF with binned interpolation from the sample of points in an NTuple. More...
|
|
| BinnedKernelDensity (const char *pdfName, AbsPhaseSpace *thePhaseSpace, TTree *tree, const char *vars1, const char *vars2, const char *vars3, const char *vars4, const char *vars5, const char *weight, UInt_t bins1, UInt_t bins2, UInt_t bins3, UInt_t bins4, UInt_t bins5, Double_t width1, Double_t width2, Double_t width3, Double_t width4, Double_t width5, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 5-dimensional kernel PDF with binned interpolation from the sample of points in an NTuple with weight. More...
|
|
| BinnedKernelDensity (const char *pdfName, AbsPhaseSpace *thePhaseSpace, TTree *tree, std::vector< TString > &vars, std::vector< UInt_t > &binning, std::vector< Double_t > &width, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for kernel PDF with binned interpolation of arbitrary dimensionality from the sample of points in an NTuple. More...
|
|
virtual | ~BinnedKernelDensity () |
| Destructor. More...
|
|
void | writeToFile (const char *fileName) |
| Write density map to a file, ROOT or text depending on extension. More...
|
|
void | writeToTextFile (const char *fileName) |
| Write the binned PDF to a text file. More...
|
|
void | writeToRootFile (const char *fileName) |
| Write the binned density into a ROOT file. More...
|
|
Double_t | density (std::vector< Double_t > &x) |
| Calculate PDF density at the point. Multilinear binned interpolation is used which is calculated in the constructor, so this call is fast. More...
|
|
AbsPhaseSpace * | phaseSpace () |
| Return the phase space. More...
|
|
void | setFractionalMode (Bool_t mode=true) |
| Set fractional mode of operation. More...
|
|
void | normalise (void) |
| Normalise the PDF such that the average PDF value over the allowed phase space equals to 1. More...
|
|
| AbsDensity (const char *pdfName) |
| Constructor. More...
|
|
virtual | ~AbsDensity () |
| Destructor. More...
|
|
void | slice (std::vector< Double_t > &x, UInt_t num, TH1F *hist) |
| Calculate 1D slice of the PDF. More...
|
|
void | slice (std::vector< Double_t > &x, UInt_t numx, UInt_t numy, TH2F *hist, Bool_t inPhaseSpace=true) |
| Calculate 2D slice of the PDF. More...
|
|
double | transform (TH1F *hist1, TH1F *hist2, double x) |
|
void | project (TH1F *hist) |
| Calculate projection of the 1D PDF. More...
|
|
void | project (TH2F *hist, Bool_t inPhaseSpace=true) |
| Calculate projection of the 2D PDF. More...
|
|
void | setMajorant (Double_t majorant) |
| Set majorant for accept-reject method. More...
|
|
void | setMaxTries (UInt_t maxTries) |
| Set maximum number of tries for accept-reject method. More...
|
|
Double_t | generate (std::vector< Double_t > &x) |
| Generate a single point within the phase space according to the PDF using accept-reject method. More...
|
|
void | generate (TNtuple *tree, UInt_t numEvents) |
| Generate a sample of points within the phase space according to the PDF using accept-reject method. More...
|
|
const char * | name (void) |
| Return the name of the PDF. More...
|
|
void | setSeed (UInt_t seed=0) |
| Set random seed. More...
|
|
|
void | init (AbsPhaseSpace *thePhaseSpace, TTree *tree, std::vector< TString > &vars, std::vector< UInt_t > &binning, std::vector< Double_t > &width, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Common initialise method used by all constructors. More...
|
|
UInt_t | iterToIndex (std::vector< UInt_t > &iter) |
| Convert an N-dimensional iterator vector into a linear bin index in the bin map. More...
|
|
void | addToMap (std::vector< Double_t > &map, std::vector< Double_t > &point, Double_t weight=1.) |
| Add a kernel density of a single data point to the binned map. More...
|
|
void | fillMapFromTree (TTree *tree, std::vector< TString > &vars, UInt_t maxEvents=0, UInt_t skipEvents=0) |
|
void | fillMapFromDensity (AbsDensity *density, UInt_t toyEvents=0) |
|
Double_t | mapDensity (std::vector< Double_t > &map, std::vector< Double_t > &x) |
| Calculate the raw density using the binned map (estimated or approximation) at a given point. More...
|
|
Definition at line 10 of file BinnedKernelDensity.hh.
BinnedKernelDensity::BinnedKernelDensity |
( |
const char * |
pdfName, |
|
|
AbsPhaseSpace * |
thePhaseSpace, |
|
|
TTree * |
tree, |
|
|
const char * |
vars1, |
|
|
UInt_t |
bins1, |
|
|
Double_t |
width1, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 1-dimensional kernel PDF with binned interpolation from the sample of points in an NTuple.
- Parameters
-
[in] | pdfName | PDF name |
[in] | thePhaseSpace | phase space |
[in] | tree | ROOT NTuple |
[in] | vars1 | variable name |
[in] | bins1 | number of bins for the binned interpolation |
[in] | width1 | kernel width |
[in] | approx | approximation PDF. Uniform approximation is used for approx=0 |
[in] | toyEvents | number of toy events for MC convolution of the approximation PDF. Use binned convolution if toyEvents=0 |
[in] | maxEvents | maximum number of events to read from NTuple. Read all events if maxEvents=0 |
[in] | skipEvents | number of NTuple events to skip from the beginning |
Definition at line 31 of file BinnedKernelDensity.cpp.
BinnedKernelDensity::BinnedKernelDensity |
( |
const char * |
pdfName, |
|
|
AbsPhaseSpace * |
thePhaseSpace, |
|
|
TTree * |
tree, |
|
|
const char * |
vars1, |
|
|
const char * |
weight, |
|
|
UInt_t |
bins1, |
|
|
Double_t |
width1, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 1-dimensional kernel PDF with binned interpolation from the sample of points in an NTuple with weight.
- Parameters
-
[in] | pdfName | PDF name |
[in] | thePhaseSpace | phase space |
[in] | tree | ROOT NTuple |
[in] | vars1 | variable name |
[in] | weight | weight variable name |
[in] | bins1 | number of bins for the binned interpolation |
[in] | width1 | kernel width |
[in] | approx | approximation PDF. Uniform approximation is used for approx=0 |
[in] | toyEvents | number of toy events for MC convolution of the approximation PDF. Use binned convolution if toyEvents=0 |
[in] | maxEvents | maximum number of events to read from NTuple. Read all events if maxEvents=0 |
[in] | skipEvents | number of NTuple events to skip from the beginning |
Definition at line 54 of file BinnedKernelDensity.cpp.
BinnedKernelDensity::BinnedKernelDensity |
( |
const char * |
pdfName, |
|
|
AbsPhaseSpace * |
thePhaseSpace, |
|
|
TTree * |
tree, |
|
|
const char * |
vars1, |
|
|
const char * |
vars2, |
|
|
UInt_t |
bins1, |
|
|
UInt_t |
bins2, |
|
|
Double_t |
width1, |
|
|
Double_t |
width2, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 2-dimensional kernel PDF with binned interpolation from the sample of points in an NTUple.
- Parameters
-
[in] | pdfName | PDF name |
[in] | thePhaseSpace | phase space |
[in] | tree | ROOT NTuple |
[in] | vars1 | 1st variable name |
[in] | vars2 | 2nd variable name |
[in] | bins1 | number of bins for the 1st variable for the binned interpolation |
[in] | bins2 | number of bins for the 2nd variable for the binned interpolation |
[in] | width1 | kernel width for the 1st variable |
[in] | width2 | kernel width for the 2nd variable |
[in] | approx | approximation PDF. Uniform approximation is used for approx=0 |
[in] | toyEvents | number of toy events for MC convolution of the approximation PDF. Use binned convolution if toyEvents=0 |
[in] | maxEvents | maximum number of events to read from NTuple. Read all events if maxEvents=0 |
[in] | skipEvents | number of NTuple events to skip from the beginning |
Definition at line 79 of file BinnedKernelDensity.cpp.
BinnedKernelDensity::BinnedKernelDensity |
( |
const char * |
pdfName, |
|
|
AbsPhaseSpace * |
thePhaseSpace, |
|
|
TTree * |
tree, |
|
|
const char * |
vars1, |
|
|
const char * |
vars2, |
|
|
const char * |
weight, |
|
|
UInt_t |
bins1, |
|
|
UInt_t |
bins2, |
|
|
Double_t |
width1, |
|
|
Double_t |
width2, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 2-dimensional kernel PDF with binned interpolation from the sample of points in an NTuple with weight.
- Parameters
-
[in] | pdfName | PDF name |
[in] | thePhaseSpace | phase space |
[in] | tree | ROOT NTuple |
[in] | vars1 | 1st variable name |
[in] | vars2 | 2nd variable name |
[in] | weight | weight variable name |
[in] | bins1 | number of bins for the 1st variable for the binned interpolation |
[in] | bins2 | number of bins for the 2nd variable for the binned interpolation |
[in] | width1 | kernel width for the 1st variable |
[in] | width2 | kernel width for the 2nd variable |
[in] | approx | approximation PDF. Uniform approximation is used for approx=0 |
[in] | toyEvents | number of toy events for MC convolution of the approximation PDF. Use binned convolution if toyEvents=0 |
[in] | maxEvents | maximum number of events to read from NTuple. Read all events if maxEvents=0 |
[in] | skipEvents | number of NTuple events to skip from the beginning |
Definition at line 105 of file BinnedKernelDensity.cpp.
BinnedKernelDensity::BinnedKernelDensity |
( |
const char * |
pdfName, |
|
|
AbsPhaseSpace * |
thePhaseSpace, |
|
|
TTree * |
tree, |
|
|
const char * |
vars1, |
|
|
const char * |
vars2, |
|
|
const char * |
vars3, |
|
|
UInt_t |
bins1, |
|
|
UInt_t |
bins2, |
|
|
UInt_t |
bins3, |
|
|
Double_t |
width1, |
|
|
Double_t |
width2, |
|
|
Double_t |
width3, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 3-dimensional kernel PDF with binned interpolation from the sample of points in an NTUple.
- Parameters
-
[in] | pdfName | PDF name |
[in] | thePhaseSpace | phase space |
[in] | tree | ROOT NTuple |
[in] | vars1 | 1st variable name |
[in] | vars2 | 2nd variable name |
[in] | vars3 | 3rd variable name |
[in] | bins1 | number of bins for the 1st variable for the binned interpolation |
[in] | bins2 | number of bins for the 2nd variable for the binned interpolation |
[in] | bins3 | number of bins for the 3rd variable for the binned interpolation |
[in] | width1 | kernel width for the 1st variable |
[in] | width2 | kernel width for the 2nd variable |
[in] | width3 | kernel width for the 3rd variable |
[in] | approx | approximation PDF. Uniform approximation is used for approx=0 |
[in] | toyEvents | number of toy events for MC convolution of the approximation PDF. Use binned convolution if toyEvents=0 |
[in] | maxEvents | maximum number of events to read from NTuple. Read all events if maxEvents=0 |
[in] | skipEvents | number of NTuple events to skip from the beginning |
Definition at line 133 of file BinnedKernelDensity.cpp.
BinnedKernelDensity::BinnedKernelDensity |
( |
const char * |
pdfName, |
|
|
AbsPhaseSpace * |
thePhaseSpace, |
|
|
TTree * |
tree, |
|
|
const char * |
vars1, |
|
|
const char * |
vars2, |
|
|
const char * |
vars3, |
|
|
const char * |
weight, |
|
|
UInt_t |
bins1, |
|
|
UInt_t |
bins2, |
|
|
UInt_t |
bins3, |
|
|
Double_t |
width1, |
|
|
Double_t |
width2, |
|
|
Double_t |
width3, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 3-dimensional kernel PDF with binned interpolation from the sample of points in an NTuple with weight.
- Parameters
-
[in] | pdfName | PDF name |
[in] | thePhaseSpace | phase space |
[in] | tree | ROOT NTuple |
[in] | vars1 | 1st variable name |
[in] | vars2 | 2nd variable name |
[in] | vars3 | 3rd variable name |
[in] | weight | weight variable name |
[in] | bins1 | number of bins for the 1st variable for the binned interpolation |
[in] | bins2 | number of bins for the 2nd variable for the binned interpolation |
[in] | bins3 | number of bins for the 3rd variable for the binned interpolation |
[in] | width1 | kernel width for the 1st variable |
[in] | width2 | kernel width for the 2nd variable |
[in] | width3 | kernel width for the 3rd variable |
[in] | approx | approximation PDF. Uniform approximation is used for approx=0 |
[in] | toyEvents | number of toy events for MC convolution of the approximation PDF. Use binned convolution if toyEvents=0 |
[in] | maxEvents | maximum number of events to read from NTuple. Read all events if maxEvents=0 |
[in] | skipEvents | number of NTuple events to skip from the beginning |
Definition at line 162 of file BinnedKernelDensity.cpp.
BinnedKernelDensity::BinnedKernelDensity |
( |
const char * |
pdfName, |
|
|
AbsPhaseSpace * |
thePhaseSpace, |
|
|
TTree * |
tree, |
|
|
const char * |
vars1, |
|
|
const char * |
vars2, |
|
|
const char * |
vars3, |
|
|
const char * |
vars4, |
|
|
UInt_t |
bins1, |
|
|
UInt_t |
bins2, |
|
|
UInt_t |
bins3, |
|
|
UInt_t |
bins4, |
|
|
Double_t |
width1, |
|
|
Double_t |
width2, |
|
|
Double_t |
width3, |
|
|
Double_t |
width4, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 4-dimensional kernel PDF with binned interpolation from the sample of points in an NTuple.
- Parameters
-
[in] | pdfName | PDF name |
[in] | thePhaseSpace | phase space |
[in] | tree | ROOT NTuple |
[in] | vars1 | 1st variable name |
[in] | vars2 | 2nd variable name |
[in] | vars3 | 3rd variable name |
[in] | vars4 | 4th variable name |
[in] | bins1 | number of bins for the 1st variable for the binned interpolation |
[in] | bins2 | number of bins for the 2nd variable for the binned interpolation |
[in] | bins3 | number of bins for the 3rd variable for the binned interpolation |
[in] | bins4 | number of bins for the 4th variable for the binned interpolation |
[in] | width1 | kernel width for the 1st variable |
[in] | width2 | kernel width for the 2nd variable |
[in] | width3 | kernel width for the 3rd variable |
[in] | width4 | kernel width for the 4th variable |
[in] | approx | approximation PDF. Uniform approximation is used for approx=0 |
[in] | toyEvents | number of toy events for MC convolution of the approximation PDF. Use binned convolution if toyEvents=0 |
[in] | maxEvents | maximum number of events to read from NTuple. Read all events if maxEvents=0 |
[in] | skipEvents | number of NTuple events to skip from the beginning |
Definition at line 193 of file BinnedKernelDensity.cpp.
BinnedKernelDensity::BinnedKernelDensity |
( |
const char * |
pdfName, |
|
|
AbsPhaseSpace * |
thePhaseSpace, |
|
|
TTree * |
tree, |
|
|
const char * |
vars1, |
|
|
const char * |
vars2, |
|
|
const char * |
vars3, |
|
|
const char * |
vars4, |
|
|
const char * |
weight, |
|
|
UInt_t |
bins1, |
|
|
UInt_t |
bins2, |
|
|
UInt_t |
bins3, |
|
|
UInt_t |
bins4, |
|
|
Double_t |
width1, |
|
|
Double_t |
width2, |
|
|
Double_t |
width3, |
|
|
Double_t |
width4, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 4-dimensional kernel PDF with binned interpolation from the sample of points in an NTuple with weight.
- Parameters
-
[in] | pdfName | PDF name |
[in] | thePhaseSpace | phase space |
[in] | tree | ROOT NTuple |
[in] | vars1 | 1st variable name |
[in] | vars2 | 2nd variable name |
[in] | vars3 | 3rd variable name |
[in] | vars4 | 4th variable name |
[in] | weight | weight variable name |
[in] | bins1 | number of bins for the 1st variable for the binned interpolation |
[in] | bins2 | number of bins for the 2nd variable for the binned interpolation |
[in] | bins3 | number of bins for the 3rd variable for the binned interpolation |
[in] | bins4 | number of bins for the 4th variable for the binned interpolation |
[in] | width1 | kernel width for the 1st variable |
[in] | width2 | kernel width for the 2nd variable |
[in] | width3 | kernel width for the 3rd variable |
[in] | width4 | kernel width for the 4th variable |
[in] | approx | approximation PDF. Uniform approximation is used for approx=0 |
[in] | toyEvents | number of toy events for MC convolution of the approximation PDF. Use binned convolution if toyEvents=0 |
[in] | maxEvents | maximum number of events to read from NTuple. Read all events if maxEvents=0 |
[in] | skipEvents | number of NTuple events to skip from the beginning |
Definition at line 225 of file BinnedKernelDensity.cpp.
BinnedKernelDensity::BinnedKernelDensity |
( |
const char * |
pdfName, |
|
|
AbsPhaseSpace * |
thePhaseSpace, |
|
|
TTree * |
tree, |
|
|
const char * |
vars1, |
|
|
const char * |
vars2, |
|
|
const char * |
vars3, |
|
|
const char * |
vars4, |
|
|
const char * |
vars5, |
|
|
UInt_t |
bins1, |
|
|
UInt_t |
bins2, |
|
|
UInt_t |
bins3, |
|
|
UInt_t |
bins4, |
|
|
UInt_t |
bins5, |
|
|
Double_t |
width1, |
|
|
Double_t |
width2, |
|
|
Double_t |
width3, |
|
|
Double_t |
width4, |
|
|
Double_t |
width5, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 5-dimensional kernel PDF with binned interpolation from the sample of points in an NTuple.
- Parameters
-
[in] | pdfName | PDF name |
[in] | thePhaseSpace | phase space |
[in] | tree | ROOT NTuple |
[in] | vars1 | 1st variable name |
[in] | vars2 | 2nd variable name |
[in] | vars3 | 3rd variable name |
[in] | vars4 | 4th variable name |
[in] | vars5 | 5th variable name |
[in] | bins1 | number of bins for the 1st variable for the binned interpolation |
[in] | bins2 | number of bins for the 2nd variable for the binned interpolation |
[in] | bins3 | number of bins for the 3rd variable for the binned interpolation |
[in] | bins4 | number of bins for the 4th variable for the binned interpolation |
[in] | bins5 | number of bins for the 5th variable for the binned interpolation |
[in] | width1 | kernel width for the 1st variable |
[in] | width2 | kernel width for the 2nd variable |
[in] | width3 | kernel width for the 3rd variable |
[in] | width4 | kernel width for the 4th variable |
[in] | width5 | kernel width for the 5th variable |
[in] | approx | approximation PDF. Uniform approximation is used for approx=0 |
[in] | toyEvents | number of toy events for MC convolution of the approximation PDF. Use binned convolution if toyEvents=0 |
[in] | maxEvents | maximum number of events to read from NTuple. Read all events if maxEvents=0 |
[in] | skipEvents | number of NTuple events to skip from the beginning |
Definition at line 259 of file BinnedKernelDensity.cpp.
BinnedKernelDensity::BinnedKernelDensity |
( |
const char * |
pdfName, |
|
|
AbsPhaseSpace * |
thePhaseSpace, |
|
|
TTree * |
tree, |
|
|
const char * |
vars1, |
|
|
const char * |
vars2, |
|
|
const char * |
vars3, |
|
|
const char * |
vars4, |
|
|
const char * |
vars5, |
|
|
const char * |
weight, |
|
|
UInt_t |
bins1, |
|
|
UInt_t |
bins2, |
|
|
UInt_t |
bins3, |
|
|
UInt_t |
bins4, |
|
|
UInt_t |
bins5, |
|
|
Double_t |
width1, |
|
|
Double_t |
width2, |
|
|
Double_t |
width3, |
|
|
Double_t |
width4, |
|
|
Double_t |
width5, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 5-dimensional kernel PDF with binned interpolation from the sample of points in an NTuple with weight.
- Parameters
-
[in] | pdfName | PDF name |
[in] | thePhaseSpace | phase space |
[in] | tree | ROOT NTuple |
[in] | vars1 | 1st variable name |
[in] | vars2 | 2nd variable name |
[in] | vars3 | 3rd variable name |
[in] | vars4 | 4th variable name |
[in] | vars5 | 5th variable name |
[in] | weight | weight |
[in] | bins1 | number of bins for the 1st variable for the binned interpolation |
[in] | bins2 | number of bins for the 2nd variable for the binned interpolation |
[in] | bins3 | number of bins for the 3rd variable for the binned interpolation |
[in] | bins4 | number of bins for the 4th variable for the binned interpolation |
[in] | bins5 | number of bins for the 5th variable for the binned interpolation |
[in] | width1 | kernel width for the 1st variable |
[in] | width2 | kernel width for the 2nd variable |
[in] | width3 | kernel width for the 3rd variable |
[in] | width4 | kernel width for the 4th variable |
[in] | width5 | kernel width for the 5th variable |
[in] | approx | approximation PDF. Uniform approximation is used for approx=0 |
[in] | toyEvents | number of toy events for MC convolution of the approximation PDF. Use binned convolution if toyEvents=0 |
[in] | maxEvents | maximum number of events to read from NTuple. Read all events if maxEvents=0 |
[in] | skipEvents | number of NTuple events to skip from the beginning |
Definition at line 294 of file BinnedKernelDensity.cpp.
BinnedKernelDensity::BinnedKernelDensity |
( |
const char * |
pdfName, |
|
|
AbsPhaseSpace * |
thePhaseSpace, |
|
|
TTree * |
tree, |
|
|
std::vector< TString > & |
vars, |
|
|
std::vector< UInt_t > & |
binning, |
|
|
std::vector< Double_t > & |
width, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for kernel PDF with binned interpolation of arbitrary dimensionality from the sample of points in an NTuple.
- Parameters
-
[in] | pdfName | PDF name |
[in] | thePhaseSpace | phase space |
[in] | tree | ROOT NTuple |
[in] | vars | vector of variable names. The size of vector should match the dimensionality of phase space or be larger by one. |
[in] | binning | vector of numbers of bins for the binned interpolation. The size of vector should match the dimensionality of phase space. |
[in] | width | vector of kernel widths. The size of vector should match the dimensionality of phase space. |
[in] | approx | approximation PDF. Uniform approximation is used for approx=0 |
[in] | toyEvents | number of toy events for MC convolution of the approximation PDF. Use binned convolution if toyEvents=0 |
[in] | maxEvents | maximum number of events to read from NTuple. Read all events if maxEvents=0 |
[in] | skipEvents | number of NTuple events to skip from the beginning |
Definition at line 17 of file BinnedKernelDensity.cpp.
BinnedKernelDensity::~BinnedKernelDensity |
( |
| ) |
|
|
virtual |
void BinnedKernelDensity::addToMap |
( |
std::vector< Double_t > & |
map, |
|
|
std::vector< Double_t > & |
point, |
|
|
Double_t |
weight = 1. |
|
) |
| |
|
private |
Add a kernel density of a single data point to the binned map.
- Parameters
-
[in] | map | pointer to the binned map |
[in] | point | data point coordinates |
[in] | weight | point weight |
Definition at line 405 of file BinnedKernelDensity.cpp.
Double_t BinnedKernelDensity::density |
( |
std::vector< Double_t > & |
x | ) |
|
|
virtual |
Calculate PDF density at the point. Multilinear binned interpolation is used which is calculated in the constructor, so this call is fast.
- Parameters
-
- Returns
- PDF value
Implements AbsDensity.
Definition at line 996 of file BinnedKernelDensity.cpp.
void BinnedKernelDensity::fillMapFromDensity |
( |
AbsDensity * |
density, |
|
|
UInt_t |
toyEvents = 0 |
|
) |
| |
|
private |
void BinnedKernelDensity::fillMapFromTree |
( |
TTree * |
tree, |
|
|
std::vector< TString > & |
vars, |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
|
private |
void BinnedKernelDensity::init |
( |
AbsPhaseSpace * |
thePhaseSpace, |
|
|
TTree * |
tree, |
|
|
std::vector< TString > & |
vars, |
|
|
std::vector< UInt_t > & |
binning, |
|
|
std::vector< Double_t > & |
width, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
|
private |
Common initialise method used by all constructors.
Initialise method used by all constructors.
- Parameters
-
[in] | thePhaseSpace | phase space |
[in] | tree | ROOT NTuple |
[in] | vars | vector of variable names. The size of vector should match the dimensionality of phase space. |
[in] | binning | vector of numbers of bins for the binned interpolation. The size of vector should match the dimensionality of phase space. |
[in] | width | vector of kernel widths. The size of vector should match the dimensionality of phase space. |
[in] | approx | approximation PDF. Uniform approximation is used for approx=0 |
[in] | toyEvents | number of toy events for MC convolution of the approximation PDF. Use binned convolution if toyEvents=0 |
[in] | maxEvents | maximum number of events to read from NTuple. Read all events if maxEvents=0 |
[in] | skipEvents | number of NTuple events to skip from the beginning |
Definition at line 336 of file BinnedKernelDensity.cpp.
UInt_t BinnedKernelDensity::iterToIndex |
( |
std::vector< UInt_t > & |
iter | ) |
|
|
private |
Convert an N-dimensional iterator vector into a linear bin index in the bin map.
Calculate map index for a given iterator vector.
- Parameters
-
- Returns
- bin index in the map
Definition at line 392 of file BinnedKernelDensity.cpp.
Double_t BinnedKernelDensity::mapDensity |
( |
std::vector< Double_t > & |
map, |
|
|
std::vector< Double_t > & |
x |
|
) |
| |
|
private |
Calculate the raw density using the binned map (estimated or approximation) at a given point.
- Parameters
-
[in] | map | reference to the bin map |
[in] | x | point |
Definition at line 895 of file BinnedKernelDensity.cpp.
void BinnedKernelDensity::normalise |
( |
void |
| ) |
|
Normalise the PDF such that the average PDF value over the allowed phase space equals to 1.
Normalise density to have the average PDF value over the allowed phase space equal to 1.
Definition at line 827 of file BinnedKernelDensity.cpp.
void BinnedKernelDensity::setFractionalMode |
( |
Bool_t |
mode = true | ) |
|
|
inline |
Set fractional mode of operation.
- Parameters
-
mode | If mode==true, the density returned will be the ratio of the kernel and approximation density |
Definition at line 400 of file BinnedKernelDensity.hh.
void BinnedKernelDensity::writeToFile |
( |
const char * |
fileName | ) |
|
Write density map to a file, ROOT or text depending on extension.
Write the binned PDF to a file. Can be used later by BinnedDensity. Format of the file (text or ROOT) is decided based on the extension of the file name.
- Parameters
-
Definition at line 673 of file BinnedKernelDensity.cpp.
void BinnedKernelDensity::writeToRootFile |
( |
const char * |
fileName | ) |
|
Write the binned density into a ROOT file.
Write density map to a ROOT file.
- Parameters
-
[in] | fileName | output ROOT file name |
Definition at line 744 of file BinnedKernelDensity.cpp.
void BinnedKernelDensity::writeToTextFile |
( |
const char * |
fileName | ) |
|
Write the binned PDF to a text file.
Write density map to a text file.
- Parameters
-
Definition at line 682 of file BinnedKernelDensity.cpp.
std::vector<Double_t> BinnedKernelDensity::m_approxMap |
|
private |
std::vector<UInt_t> BinnedKernelDensity::m_binning |
|
private |
UInt_t BinnedKernelDensity::m_dim |
|
private |
Bool_t BinnedKernelDensity::m_fractionalMode |
|
private |
std::vector<Double_t> BinnedKernelDensity::m_map |
|
private |
std::vector<Double_t> BinnedKernelDensity::m_width |
|
private |
The documentation for this class was generated from the following files:
|