67 if(
_verbosedebug) { std::cout <<
"Roo2DKeysPdf::Roo2DKeysPdf copy ctor" << std::endl; }
114 if(
_verbosedebug) { std::cout <<
"Roo2DKeysPdf::Roo2KeysPdf dtor" << std::endl; }
130 if(
_verbosedebug) { std::cout <<
"Roo2DKeysPdf::loadDataSet" << std::endl; }
134 if(
_verbosedebug) { std::cout <<
"Roo2DKeysPdf::loadDataSet(RooDataSet& data, TString options)" << std::endl; }
141 std::cout <<
"ERROR: Roo2DKeysPdf::loadDataSet The input data set is empty. Unable to begin generating the PDF" << std::endl;
169 std::cout <<
"Roo2DKeysPdf::Roo2DKeysPdf invalid RooAbsReal name: "<<
xx.GetName()<<
" not in the data set" << std::endl;
174 std::cout <<
"Roo2DKeysPdf::Roo2DKeysPdf invalid RooAbsReal name: "<<
yy.GetName()<<
" not in the data set" << std::endl;
179 std::cout <<
"Roo2DKeysPdf::Roo2DKeysPdf Unable to initialize object; incompatible RooDataSet doesn't contain"<< std::endl;
180 std::cout <<
" all of the RooAbsReal arguments"<< std::endl;
193 _x[
j] =
X->getVal() ;
194 _y[
j] = Y->getVal() ;
205 std::cout <<
"Roo2DKeysPdf::Roo2DKeysPdf Empty data set was used; can't generate a PDF"<< std::endl;
225 if(
_verbosedebug) { std::cout <<
"Roo2DKeysPdf::setOptions" << std::endl; }
243 std::cout <<
"Roo2DKeysPdf::setOptions(TString options) options = "<< options << std::endl;
244 std::cout <<
"\t_BandWidthType = " <<
_BandWidthType << std::endl;
246 std::cout <<
"\t_debug = " <<
_debug << std::endl;
247 std::cout <<
"\t_verbosedebug = " <<
_verbosedebug << std::endl;
248 std::cout <<
"\t_vverbosedebug = " <<
_vverbosedebug << std::endl;
257 std::cout <<
"Roo2DKeysPdf::getOptions(void)" << std::endl;
258 std::cout <<
"\t_BandWidthType = " <<
_BandWidthType << std::endl;
260 std::cout <<
"\t_debug = " <<
_debug << std::endl;
261 std::cout <<
"\t_verbosedebug = " <<
_verbosedebug << std::endl;
262 std::cout <<
"\t_vverbosedebug = " <<
_vverbosedebug << std::endl;
272 if(
_verbosedebug) { std::cout <<
"Roo2DKeysPdf::calculateBandWidth(Int_t kernel)" << std::endl; }
286 std::cout <<
"Roo2DKeysPdf::calculateBandWidth The sqr(variance sum) == 0.0. " <<
" Your dataset represents a delta function."<< std::endl;
300 std::cout <<
"Roo2DKeysPdf::calculateBandWidth Using a normal bandwidth (same for a given dimension) based on"<< std::endl;
301 std::cout <<
" h_j = n^{-1/6}*sigma_j for the j^th dimension and n events * "<<
_widthScaleFactor<< std::endl;
314 std::cout <<
"Roo2DKeysPdf::calculateBandWidth Using an adaptive bandwidth (in general different for all events) [default]"<< std::endl;
341 if(
_vverbosedebug) { std::cout <<
"Roo2DKeysPdf::evaluate()" << std::endl; }
357 if(
_vverbosedebug ) { std::cout <<
"Roo2DKeysPdf::evaluateFull()" << std::endl; }
413 if(
_vverbosedebug) { std::cout <<
"Roo2DKeysPdf::highBoundaryCorrection" << std::endl; }
415 if(
thisH == 0.0)
return 0.0;
425 if(
_vverbosedebug) { std::cout <<
"Roo2DKeysPdf::lowBoundaryCorrection" << std::endl; }
427 if(
thisH == 0.0)
return 0.0;
467 if(
_BandWidthType == 1) std::cout <<
"The Bandwidth Type selected is Trivial" << std::endl;
468 else std::cout <<
"The Bandwidth Type selected is Adaptive" << std::endl;
482 std::cout <<
"Roo2DKeysPdf::getMean unknown axis "<<axis<< std::endl;
496 std::cout <<
"Roo2DKeysPdf::getSigma unknown axis "<<axis<< std::endl;
524 std::cout <<
"Roo2DKeysPdf::writeHistToFile This member function is temporarily disabled" << std::endl;
529 std::cout <<
"Roo2DKeysPdf::writeHistToFile unable to open file "<<
outputFile << std::endl;
558 TFile * file =
nullptr;
564 std::cout <<
"Roo2DKeysPdf::writeNTupleToFile unable to open file "<<
outputFile << std::endl;
574 label +=
" the source data for 2D Keys PDF";
576 if(!
_theTree) { std::cout <<
"Unable to get a TTree for output" << std::endl;
return; }
609 out <<
"Roo2DKeysPDF instance domain information:"<< std::endl;
610 out <<
"\tX_min = " <<
_lox << std::endl;
611 out <<
"\tX_max = " <<
_hix << std::endl;
612 out <<
"\tY_min = " <<
_loy << std::endl;
613 out <<
"\tY_max = " <<
_hiy << std::endl;
615 out <<
"Data information:" << std::endl;
616 out <<
"\t<x> = " <<
_xMean << std::endl;
617 out <<
"\tsigma(x) = " <<
_xSigma << std::endl;
618 out <<
"\t<y> = " <<
_yMean << std::endl;
619 out <<
"\tsigma(y) = " <<
_ySigma << std::endl;
621 out <<
"END of info for Roo2DKeys pdf instance"<< std::endl;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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 x1
Option_t Option_t TPoint TPoint const char y1
Two-dimensional kernel estimation PDF.
double getMean(const char *axis) const
Roo2DKeysPdf(const char *name, const char *title, RooAbsReal &xx, RooAbsReal &yy, RooDataSet &data, TString options="a", double widthScaleFactor=1.0)
Constructor.
void writeNTupleToFile(char *outputFile, const char *name) const
Saves the data and calculated bandwidths to a file, as a record of what produced the PDF and to give ...
void writeToFile(char *outputFile, const char *name) const
double lowBoundaryCorrection(double thisVar, double thisH, double low, double tVar) const
double evaluate() const override
Evaluates the kernel estimation for x,y, interpolating between the points if necessary.
Int_t getBandWidthType() const
void PrintInfo(std::ostream &) const
Prints out _p[_nPoints][_nPoints] indicating the domain limits.
Int_t loadDataSet(RooDataSet &data, TString options)
Loads a new data set into the class instance.
double g(double var1, double *_var1, double sigma1, double var2, double *_var2, double sigma2) const
Calculates f(t_i) for the bandwidths.
double getSigma(const char *axis) const
~Roo2DKeysPdf() override
Destructor.
void setWidthScaleFactor(double widthScaleFactor)
double highBoundaryCorrection(double thisVar, double thisH, double high, double tVar) const
Apply the mirror at boundary correction to a dimension given the space position to evaluate at (thisV...
void writeHistToFile(char *outputFile, const char *histName) const
Plots the PDF as a histogram and saves it to a file, so that it can be loaded in as a Roo2DHist PDF i...
Int_t calculateBandWidth(Int_t kernel=-999)
Calculates the kernel bandwidth for x & y and the probability look up table _p[i][j].
void setOptions(TString options)
void getOptions(void) const
double evaluateFull(double thisX, double thisY) const
Evaluates the sum of the product of the 2D kernels for use in calculating the fixed kernel estimate,...
RooAbsArg * find(const char *name) const
Find object with given name in list.
Abstract interface for all probability density functions.
Abstract base class for objects that represent a real value and implements functionality common to al...
TH1 * fillHistogram(TH1 *hist, const RooArgList &plotVars, double scaleFactor=1, const RooArgSet *projectedVars=nullptr, bool scaling=true, const RooArgSet *condObs=nullptr, bool setError=true) const
Fill the ROOT histogram 'hist' with values sampled from this function at the bin centers.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Container class to hold unbinned data.
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.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsiz=0) override
Write memory objects to this file.
void Close(Option_t *option="") override
Close a file.
void SetName(const char *name) override
Change the name of this histogram.
2-D histogram with a float per channel (see TH1 documentation)
const char * GetName() const override
Returns name of object.
void ToLower()
Change string to lower-case.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
A TTree represents a columnar dataset.