|
Meerkat
v1r3
Multidimensional kernel density estimation package
|
#include <AdaptiveKernelDensity.hh>
|
| AdaptiveKernelDensity (const char *pdfName, AbsPhaseSpace *thePhaseSpace, TTree *tree, const char *vars1, UInt_t bins1, Double_t width1, AbsDensity *widthScale, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 1-dimensional adaptive kernel PDF from the sample of points in an NTuple. More...
|
|
| AdaptiveKernelDensity (const char *pdfName, AbsPhaseSpace *thePhaseSpace, TTree *tree, const char *vars1, const char *weight, UInt_t bins1, Double_t width1, AbsDensity *widthScale, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 1-dimensional adaptive kernel PDF from the sample of points in an NTuple with weight. More...
|
|
| AdaptiveKernelDensity (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 *widthScale, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 2-dimensional adaptive kernel PDF from the sample of points in an NTUple. More...
|
|
| AdaptiveKernelDensity (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 *widthScale, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 2-dimensional adaptive kernel PDF from the sample of points in an NTuple with weight. More...
|
|
| AdaptiveKernelDensity (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 *widthScale, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 3-dimensional adaptive kernel PDF from the sample of points in an NTuple. More...
|
|
| AdaptiveKernelDensity (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 *widthScale, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 3-dimensional adaptive kernel PDF from the sample of points in an NTuple with weight. More...
|
|
| AdaptiveKernelDensity (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 *widthScale, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 4-dimensional adaptive kernel PDF from the sample of points in an NTuple. More...
|
|
| AdaptiveKernelDensity (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 *widthScale, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 4-dimensional adaptive kernel PDF from the sample of points in an NTuple with weight. More...
|
|
| AdaptiveKernelDensity (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 *widthScale, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 5-dimensional adaptive kernel PDF from the sample of points in an NTuple. More...
|
|
| AdaptiveKernelDensity (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 *widthScale, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for 5-dimensional adaptive kernel PDF from the sample of points in an NTuple with weight. More...
|
|
| AdaptiveKernelDensity (const char *pdfName, AbsPhaseSpace *thePhaseSpace, TTree *tree, std::vector< TString > &vars, std::vector< UInt_t > &binning, std::vector< Double_t > &width, AbsDensity *widthScale, AbsDensity *approx=0, UInt_t toyEvents=0, UInt_t maxEvents=0, UInt_t skipEvents=0) |
| Constructor for adaptive kernel PDF of arbitrary dimensionality from the sample of points in an NTUple. More...
|
|
virtual | ~AdaptiveKernelDensity () |
| Destructor. More...
|
|
void | writeToFile (const char *fileName) |
| Write density map to file 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 *widthScale, 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 widthScale=1., 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 *theDensity, 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...
|
|
A class to calculate the binned multidimensional density using adaptive kernel estimation technique with approximation PDF.
Definition at line 14 of file AdaptiveKernelDensity.hh.
AdaptiveKernelDensity::AdaptiveKernelDensity |
( |
const char * |
pdfName, |
|
|
AbsPhaseSpace * |
thePhaseSpace, |
|
|
TTree * |
tree, |
|
|
const char * |
vars1, |
|
|
UInt_t |
bins1, |
|
|
Double_t |
width1, |
|
|
AbsDensity * |
widthScale, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 1-dimensional adaptive kernel PDF 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 | average kernel width |
[in] | widthScale | PDF for width scaling |
[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 35 of file AdaptiveKernelDensity.cpp.
AdaptiveKernelDensity::AdaptiveKernelDensity |
( |
const char * |
pdfName, |
|
|
AbsPhaseSpace * |
thePhaseSpace, |
|
|
TTree * |
tree, |
|
|
const char * |
vars1, |
|
|
const char * |
weight, |
|
|
UInt_t |
bins1, |
|
|
Double_t |
width1, |
|
|
AbsDensity * |
widthScale, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 1-dimensional adaptive kernel PDF 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 | average kernel width |
[in] | widthScale | PDF for width scaling |
[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 59 of file AdaptiveKernelDensity.cpp.
AdaptiveKernelDensity::AdaptiveKernelDensity |
( |
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 * |
widthScale, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 2-dimensional adaptive kernel PDF 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 | average kernel width for the 1st variable |
[in] | width2 | average kernel width for the 2nd variable |
[in] | widthScale | PDF for width scaling |
[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 85 of file AdaptiveKernelDensity.cpp.
AdaptiveKernelDensity::AdaptiveKernelDensity |
( |
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 * |
widthScale, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 2-dimensional adaptive kernel PDF 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 | average kernel width for the 1st variable |
[in] | width2 | average kernel width for the 2nd variable |
[in] | widthScale | PDF for width scaling |
[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 112 of file AdaptiveKernelDensity.cpp.
AdaptiveKernelDensity::AdaptiveKernelDensity |
( |
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 * |
widthScale, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 3-dimensional adaptive kernel PDF 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 | average kernel width for the 1st variable |
[in] | width2 | average kernel width for the 2nd variable |
[in] | width3 | average kernel width for the 3rd variable |
[in] | widthScale | PDF for width scaling |
[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 141 of file AdaptiveKernelDensity.cpp.
AdaptiveKernelDensity::AdaptiveKernelDensity |
( |
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 * |
widthScale, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 3-dimensional adaptive kernel PDF 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 | average kernel width for the 1st variable |
[in] | width2 | average kernel width for the 2nd variable |
[in] | width3 | average kernel width for the 3rd variable |
[in] | widthScale | PDF for width scaling |
[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 171 of file AdaptiveKernelDensity.cpp.
AdaptiveKernelDensity::AdaptiveKernelDensity |
( |
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 * |
widthScale, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 4-dimensional adaptive kernel PDF 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 | average kernel width for the 1st variable |
[in] | width2 | average kernel width for the 2nd variable |
[in] | width3 | average kernel width for the 3rd variable |
[in] | width4 | average kernel width for the 4th variable |
[in] | widthScale | PDF for width scaling |
[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 203 of file AdaptiveKernelDensity.cpp.
AdaptiveKernelDensity::AdaptiveKernelDensity |
( |
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 * |
widthScale, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 4-dimensional adaptive kernel PDF 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 | average kernel width for the 1st variable |
[in] | width2 | average kernel width for the 2nd variable |
[in] | width3 | average kernel width for the 3rd variable |
[in] | width4 | average kernel width for the 4th variable |
[in] | widthScale | PDF for width scaling |
[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 236 of file AdaptiveKernelDensity.cpp.
AdaptiveKernelDensity::AdaptiveKernelDensity |
( |
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 * |
widthScale, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 5-dimensional adaptive kernel PDF 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 | average kernel width for the 1st variable |
[in] | width2 | average kernel width for the 2nd variable |
[in] | width3 | average kernel width for the 3rd variable |
[in] | width4 | average kernel width for the 4th variable |
[in] | width5 | average kernel width for the 5th variable |
[in] | widthScale | PDF for width scaling |
[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 271 of file AdaptiveKernelDensity.cpp.
AdaptiveKernelDensity::AdaptiveKernelDensity |
( |
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 * |
widthScale, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for 5-dimensional adaptive kernel PDF 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 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 | average kernel width for the 1st variable |
[in] | width2 | average kernel width for the 2nd variable |
[in] | width3 | average kernel width for the 3rd variable |
[in] | width4 | average kernel width for the 4th variable |
[in] | width5 | average kernel width for the 5th variable |
[in] | widthScale | PDF for width scaling |
[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 307 of file AdaptiveKernelDensity.cpp.
AdaptiveKernelDensity::AdaptiveKernelDensity |
( |
const char * |
pdfName, |
|
|
AbsPhaseSpace * |
thePhaseSpace, |
|
|
TTree * |
tree, |
|
|
std::vector< TString > & |
vars, |
|
|
std::vector< UInt_t > & |
binning, |
|
|
std::vector< Double_t > & |
width, |
|
|
AbsDensity * |
widthScale, |
|
|
AbsDensity * |
approx = 0 , |
|
|
UInt_t |
toyEvents = 0 , |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
Constructor for adaptive kernel PDF 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 one larger. |
[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 average kernel widths. The size of vector should match the dimensionality of phase space. |
[in] | widthScale | PDF for width scaling |
[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 20 of file AdaptiveKernelDensity.cpp.
AdaptiveKernelDensity::~AdaptiveKernelDensity |
( |
| ) |
|
|
virtual |
void AdaptiveKernelDensity::addToMap |
( |
std::vector< Double_t > & |
map, |
|
|
std::vector< Double_t > & |
point, |
|
|
Double_t |
widthScale = 1. , |
|
|
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] | widthScale | kernel width scale factor |
[in] | weight | point weight |
Definition at line 429 of file AdaptiveKernelDensity.cpp.
Double_t AdaptiveKernelDensity::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 1072 of file AdaptiveKernelDensity.cpp.
void AdaptiveKernelDensity::fillMapFromDensity |
( |
AbsDensity * |
theDensity, |
|
|
UInt_t |
toyEvents = 0 |
|
) |
| |
|
private |
void AdaptiveKernelDensity::fillMapFromTree |
( |
TTree * |
tree, |
|
|
std::vector< TString > & |
vars, |
|
|
UInt_t |
maxEvents = 0 , |
|
|
UInt_t |
skipEvents = 0 |
|
) |
| |
|
private |
void AdaptiveKernelDensity::init |
( |
AbsPhaseSpace * |
thePhaseSpace, |
|
|
TTree * |
tree, |
|
|
std::vector< TString > & |
vars, |
|
|
std::vector< UInt_t > & |
binning, |
|
|
std::vector< Double_t > & |
width, |
|
|
AbsDensity * |
widthScale, |
|
|
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 average kernel widths. The size of vector should match the dimensionality of phase space. |
[in] | widthScale | PDF for width scaling |
[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 352 of file AdaptiveKernelDensity.cpp.
UInt_t AdaptiveKernelDensity::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 416 of file AdaptiveKernelDensity.cpp.
Double_t AdaptiveKernelDensity::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 971 of file AdaptiveKernelDensity.cpp.
void AdaptiveKernelDensity::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 In addition, determine the maximum value of the PDF to be use as a majorant for toy MC generation.
Definition at line 898 of file AdaptiveKernelDensity.cpp.
void AdaptiveKernelDensity::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 424 of file AdaptiveKernelDensity.hh.
void AdaptiveKernelDensity::writeToFile |
( |
const char * |
fileName | ) |
|
Write density map to file 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 739 of file AdaptiveKernelDensity.cpp.
void AdaptiveKernelDensity::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 814 of file AdaptiveKernelDensity.cpp.
void AdaptiveKernelDensity::writeToTextFile |
( |
const char * |
fileName | ) |
|
AbsDensity* AdaptiveKernelDensity::m_approxDensity |
|
private |
std::vector<Double_t> AdaptiveKernelDensity::m_approxMap |
|
private |
std::vector<UInt_t> AdaptiveKernelDensity::m_binning |
|
private |
UInt_t AdaptiveKernelDensity::m_dim |
|
private |
Bool_t AdaptiveKernelDensity::m_fractionalMode |
|
private |
std::vector<Double_t> AdaptiveKernelDensity::m_map |
|
private |
Double_t AdaptiveKernelDensity::m_maxScale |
|
private |
Double_t AdaptiveKernelDensity::m_maxValue |
|
private |
Double_t AdaptiveKernelDensity::m_minScale |
|
private |
Double_t AdaptiveKernelDensity::m_minValue |
|
private |
std::vector<Double_t> AdaptiveKernelDensity::m_width |
|
private |
AbsDensity* AdaptiveKernelDensity::m_widthScaleDensity |
|
private |
The documentation for this class was generated from the following files:
|