66 fInterpolMethod( PDF::kSpline2 ),
73 fHistAvgEvtPerBin ( 0 ),
74 fHistDefinedNBins ( 0 ),
77 fBorderMethodString( 0 ),
78 fInterpolateString ( 0 ),
79 fKDEtype ( KDEKernel::
kNone ),
80 fKDEiter ( KDEKernel::kNonadaptiveKDE ),
81 fKDEborder ( KDEKernel::kNoTreatment ),
84 fCheckHist ( kFALSE ),
89 fLogger =
new MsgLogger(
this);
90 GetThisPdfThreadLocal() =
this;
106 fMinNsmooth ( minnsmooth ),
107 fMaxNsmooth ( maxnsmooth ),
109 fInterpolMethod( method ),
116 fHistAvgEvtPerBin ( 0 ),
117 fHistDefinedNBins ( 0 ),
118 fKDEtypeString ( 0 ),
119 fKDEiterString ( 0 ),
120 fBorderMethodString( 0 ),
121 fInterpolateString ( 0 ),
126 fReadingVersion( 0 ),
127 fCheckHist ( checkHist ),
153 fInterpolMethod(
PDF::kKDE ),
160 fHistAvgEvtPerBin ( 0 ),
161 fHistDefinedNBins ( 0 ),
162 fKDEtypeString ( 0 ),
163 fKDEiterString ( 0 ),
164 fBorderMethodString( 0 ),
165 fInterpolateString ( 0 ),
168 fKDEborder ( kborder ),
169 fFineFactor ( FineFactor),
170 fReadingVersion( 0 ),
194 fInterpolMethod(
PDF::kSpline0 ),
201 fHistAvgEvtPerBin ( 50 ),
202 fHistDefinedNBins ( 0 ),
203 fKDEtypeString (
"Gauss" ),
204 fKDEiterString (
"Nonadaptive" ),
205 fBorderMethodString(
"None" ),
206 fInterpolateString (
"Spline2" ),
211 fReadingVersion( 0 ),
218 if (defaultPDF != 0) {
238 if (fSpline !=
NULL)
delete fSpline;
239 if (fHist !=
NULL)
delete fHist;
240 if (fPDFHist !=
NULL)
delete fPDFHist;
241 if (fHistOriginal !=
NULL)
delete fHistOriginal;
242 if (fIGetVal !=
NULL)
delete fIGetVal;
243 if (fGraph !=
NULL)
delete fGraph;
251 GetThisPdfThreadLocal() =
this;
253 if (hist ==
NULL)
Log() <<
kFATAL <<
"Called without valid histogram pointer!" <<
Endl;
264 <<
"type KDE kernel for histogram: \"" << hist->
GetName() <<
"\""
270 Log() <<
kFATAL <<
"PDF construction called with minnsmooth<0" <<
Endl;
271 else if (fMaxNsmooth<=0)
272 fMaxNsmooth = fMinNsmooth;
273 else if (fMaxNsmooth<fMinNsmooth)
274 Log() <<
kFATAL <<
"PDF construction called with maxnsmooth<minnsmooth" <<
Endl;
279 fHistOriginal->SetTitle( fHistOriginal->GetName() );
280 fHist ->SetTitle( fHist->GetName() );
283 fHistOriginal->SetDirectory(0);
284 fHist ->SetDirectory(0);
287 if (fInterpolMethod ==
PDF::kKDE) BuildKDEPDF();
288 else BuildSplinePDF();
296 if (evtNum == 0 && fHistDefinedNBins == 0)
298 else if (fHistDefinedNBins > 0)
299 return fHistDefinedNBins * ResolutionFactor;
300 else if ( evtNum > 0 && fHistAvgEvtPerBin > 0 )
301 return evtNum / fHistAvgEvtPerBin * ResolutionFactor;
303 Log() <<
kFATAL <<
"No number of bins or average event per bin set for PDF" << fHistAvgEvtPerBin <<
Endl;
313 if (fInterpolMethod !=
PDF::kSpline0 && fCheckHist) CheckHist();
316 if (fMaxNsmooth > 0 && fMinNsmooth >=0 ) SmoothHistogram();
322 switch (fInterpolMethod) {
327 fUseHistogram =
kTRUE;
347 Log() <<
kWARNING <<
"No valid interpolation method given! Use Spline2" <<
Endl;
349 Log() <<
kFATAL <<
" Well.. .thinking about it, I better quit so you notice you are forced to fix the mistake " <<
Endl;
355 if (!UseHistogram()) {
356 fSpline->SetTitle( (
TString)fHist->GetTitle() + fSpline->GetTitle() );
357 fSpline->SetName ( (
TString)fHist->GetName() + fSpline->GetName() );
363 if (integral < 0)
Log() <<
kFATAL <<
"Integral: " << integral <<
" <= 0" <<
Endl;
367 if (integral>0) fPDFHist->Scale( 1.0/integral );
369 fPDFHist->SetDirectory(0);
378 fPDFHist =
new TH1F(
"",
"", fgNbin_PdfHist, GetXmin(), GetXmax() );
379 fPDFHist->SetTitle( (
TString)fHist->GetTitle() +
"_hist from_KDE" );
380 fPDFHist->SetName ( (
TString)fHist->GetName() +
"_hist_from_KDE" );
383 Float_t histoLowEdge = fHist->GetBinLowEdge(1);
384 Float_t histoUpperEdge = fPDFHist->GetBinLowEdge(fPDFHist->GetNbinsX()) + fPDFHist->GetBinWidth(fPDFHist->GetNbinsX());
386 fHist, histoLowEdge, histoUpperEdge,
387 fKDEborder, fFineFactor );
390 for (
Int_t i=1;i<fHist->GetNbinsX();i++) {
392 for (
Int_t j=1;j<fPDFHist->GetNbinsX();j++) {
394 fPDFHist->AddBinContent(j,fHist->GetBinContent(i)*
396 fPDFHist->GetBinLowEdge(j+1),
397 fHist->GetBinCenter(i),
401 if (fKDEborder == 3) {
405 if (i < fHist->GetNbinsX()/5 ) {
406 for (
Int_t j=1;j<fPDFHist->GetNbinsX();j++) {
408 fPDFHist->AddBinContent(j,fHist->GetBinContent(i)*
410 fPDFHist->GetBinLowEdge(j+1),
411 2*histoLowEdge-fHist->GetBinCenter(i),
416 if (i > 4*fHist->GetNbinsX()/5) {
417 for (
Int_t j=1;j<fPDFHist->GetNbinsX();j++) {
419 fPDFHist->AddBinContent( j,fHist->GetBinContent(i)*
421 fPDFHist->GetBinLowEdge(j+1),
422 2*histoUpperEdge-fHist->GetBinCenter(i), i) );
428 fPDFHist->SetEntries(fHist->GetEntries());
434 if (integral < 0)
Log() <<
kFATAL <<
"Integral: " << integral <<
" <= 0" <<
Endl;
438 if (integral>0) fPDFHist->Scale( 1.0/integral );
439 fPDFHist->SetDirectory(0);
446 if(fHist->GetNbinsX()==1)
return;
447 if (fMaxNsmooth == fMinNsmooth) {
448 fHist->Smooth( fMinNsmooth );
455 for (
Int_t bin=0; bin<fHist->GetNbinsX(); bin++) {
456 if (fHist->GetBinContent(bin+1) <= fHist->GetBinError(bin+1))
continue;
457 Err = fHist->GetBinError(bin+1) / fHist->GetBinContent(bin+1);
458 ErrAvg +=
Err; ErrRMS += Err*
Err; num++;
464 Float_t MaxErr=ErrAvg+ErrRMS, MinErr=ErrAvg-ErrRMS;
465 fNSmoothHist =
new TH1I(
"",
"",fHist->GetNbinsX(),0,fHist->GetNbinsX());
466 fNSmoothHist->SetTitle( (
TString)fHist->GetTitle() +
"_Nsmooth" );
467 fNSmoothHist->SetName ( (
TString)fHist->GetName() +
"_Nsmooth" );
468 for (
Int_t bin=0; bin<fHist->GetNbinsX(); bin++) {
469 if (fHist->GetBinContent(bin+1) <= fHist->GetBinError(bin+1))
472 Err = fHist->GetBinError(bin+1) / fHist->GetBinContent(bin+1);
473 smooth=(
Int_t)((Err-MinErr) /(MaxErr-MinErr) * (fMaxNsmooth-fMinNsmooth)) + fMinNsmooth;
476 fNSmoothHist->SetBinContent(bin+1,smooth);
481 for (
Int_t n=fMaxNsmooth;
n>=0;
n--) {
483 if (
n <= fMinNsmooth) { fHist->Smooth();
continue; }
484 Int_t MinBin=-1,MaxBin =-1;
485 for (
Int_t bin=0; bin < fHist->GetNbinsX(); bin++) {
486 if (fNSmoothHist->GetBinContent(bin+1) >=
n) {
487 if (MinBin==-1) MinBin = bin;
490 else if (MaxBin >= 0) {
491 #if ROOT_VERSION_CODE > ROOT_VERSION(5,19,2)
492 fHist->Smooth(1,
"R");
494 fHist->Smooth(1,MinBin+1,MaxBin+1);
518 if (UseHistogram()) {
520 fPDFHist = (
TH1*)fHist->Clone();
521 fPDFHist->SetTitle( (
TString)fHist->GetTitle() +
"_hist from_spline0" );
522 fPDFHist->SetName ( (
TString)fHist->GetName() +
"_hist_from_spline0" );
526 fPDFHist =
new TH1F(
"",
"", fgNbin_PdfHist, GetXmin(), GetXmax() );
527 fPDFHist->SetTitle( (
TString)fHist->GetTitle() +
"_hist from_" + fSpline->GetTitle() );
528 fPDFHist->SetName ( (
TString)fHist->GetName() +
"_hist_from_" + fSpline->GetTitle() );
530 for (
Int_t bin=1; bin <= fgNbin_PdfHist; bin++) {
531 Double_t x = fPDFHist->GetBinCenter( bin );
536 if (y <= fgEpsilon) y = fHist->GetBinContent( fHist->FindBin( x ) );
537 fPDFHist->SetBinContent( bin,
TMath::Max(y, fgEpsilon) );
540 fPDFHist->SetDirectory(0);
549 Log() <<
kFATAL <<
"<CheckHist> Called without valid histogram pointer!" <<
Endl;
557 if (fHist->GetBinContent(bin) == 0) emptyBins++;
561 <<
"%) of the bins in hist '"
562 << fHist->GetName() <<
"' are empty!" <<
Endl;
564 <<
" mean=" << fHist->GetMean() <<
" X_max= " << GetXmax() <<
Endl;
574 if (!originalHist) originalHist = fHistOriginal;
594 Int_t binPdfHist = fPDFHist->FindBin( x );
595 if (binPdfHist<0)
continue;
599 originalHist->
GetBinWidth( bin )/fPDFHist->GetBinWidth( binPdfHist ) );
607 if (d > 1) { nc1++;
if (d > 2) { nc2++;
if (d > 3) { nc3++;
if (d > 6) nc6++; } } }
611 Log() <<
"Validation result for PDF \"" << originalHist->
GetTitle() <<
"\"" <<
": " <<
Endl;
612 Log() <<
Form(
" chi2/ndof(!=0) = %.1f/%i = %.2f (Prob = %.2f)",
614 if ((1.0 -
TMath::Prob( chi2, ndof )) > 0.9999994) {
616 Log() <<
kWARNING <<
"with the corresponding PDF gave a chi2/ndof of " << chi2/ndof <<
"," <<
Endl;
617 Log() <<
kWARNING <<
"which corresponds to a deviation of more than 5 sigma! Please check!" <<
Endl;
619 Log() <<
Form(
" #bins-found(#expected-bins) deviating > [1,2,3,6] sigmas: " \
620 "[%i(%i),%i(%i),%i(%i),%i(%i)]",
630 Double_t integral = fPDFHist->GetSumOfWeights();
631 integral *= GetPdfHistBinWidth();
641 return ThisPDF()->GetVal( x[0] );
651 if (fgManualIntegration) {
654 Int_t imin = fPDFHist->FindBin(xmin);
655 Int_t imax = fPDFHist->FindBin(xmax);
656 if (imin < 1) imin = 1;
657 if (imax > fPDFHist->GetNbinsX()) imax = fPDFHist->GetNbinsX();
659 for (
Int_t bini = imin; bini <= imax; bini++) {
660 Float_t dx = fPDFHist->GetBinWidth(bini);
662 if (bini == imin) dx = fPDFHist->GetBinLowEdge(bini+1) -
xmin;
663 else if (bini == imax) dx = xmax - fPDFHist->GetBinLowEdge(bini);
664 if (dx < 0 && dx > -1.0e-8) dx = 0;
667 <<
"dx = " << dx << std::endl
668 <<
"bini = " << bini << std::endl
669 <<
"xmin = " << xmin << std::endl
670 <<
"xmax = " << xmax << std::endl
671 <<
"imin = " << imin << std::endl
672 <<
"imax = " << imax << std::endl
673 <<
"low edge of imin" << fPDFHist->GetBinLowEdge(imin) << std::endl
674 <<
"low edge of imin+1" << fPDFHist->GetBinLowEdge(imin+1) <<
Endl;
675 Log() <<
kFATAL <<
"<GetIntegral> dx = " << dx <<
" < 0" <<
Endl;
677 integral += fPDFHist->GetBinContent(bini)*dx;
684 if (fIGetVal == 0) fIGetVal =
new TF1(
"IGetVal",
PDF::IGetVal, GetXmin(), GetXmax(), 0 );
685 integral = fIGetVal->Integral( xmin, xmax );
697 Int_t bin = fPDFHist->FindBin(x);
703 if (UseHistogram()) {
705 retval = fPDFHist->GetBinContent( bin );
710 if ((x > fPDFHist->GetBinCenter(bin) && bin != fPDFHist->GetNbinsX()) || bin == 1)
716 Double_t dx = fPDFHist->GetBinCenter( bin ) - fPDFHist->GetBinCenter( nextbin );
717 Double_t dy = fPDFHist->GetBinContent( bin ) - fPDFHist->GetBinContent( nextbin );
718 retval = fPDFHist->GetBinContent( bin ) + (x - fPDFHist->GetBinCenter( bin ))*dy/dx;
729 Int_t lowerBin=0, higherBin=0;
730 Double_t lowerBinValue=0, higherBinValue=0;
731 FindBinInverse(fPDFHist,lowerBin,higherBin,lowerBinValue,higherBinValue,y,isMonotonouslyIncreasingFunction);
733 Double_t xValueLowerBin =fPDFHist->GetBinCenter (lowerBin);
734 Double_t xValueHigherBin=fPDFHist->GetBinCenter (higherBin);
739 fraction=(y-lowerBinValue)/length;
741 Double_t lengthX =xValueHigherBin-xValueLowerBin;
742 Double_t x =xValueLowerBin+lengthX*fraction;
757 if (isMonotonouslyIncreasingFunction) {
761 Int_t bin=higherBin/2;
763 while (bin>lowerBin && bin<higherBin) {
768 higherBinValue=binContent;
770 else if (y>=binContent){
772 lowerBinValue =binContent;
774 bin=lowerBin+(higherBin-lowerBin)/2;
779 for (
Int_t bin=0, binEnd=histogram->
GetNbinsX(); bin<binEnd; ++bin) {
784 lowerBinValue =binContent;
785 higherBinValue=binContent;
789 higherBinValue=binContent;
813 DeclareOptionRef( fNsmooth,
Form(
"NSmooth%s",fSuffix.Data()),
814 "Number of smoothing iterations for the input histograms" );
815 DeclareOptionRef( fMinNsmooth,
Form(
"MinNSmooth%s",fSuffix.Data()),
816 "Min number of smoothing iterations, for bins with most data" );
818 DeclareOptionRef( fMaxNsmooth,
Form(
"MaxNSmooth%s",fSuffix.Data()),
819 "Max number of smoothing iterations, for bins with least data" );
821 DeclareOptionRef( fHistAvgEvtPerBin,
Form(
"NAvEvtPerBin%s",fSuffix.Data()),
822 "Average number of events per PDF bin" );
824 DeclareOptionRef( fHistDefinedNBins,
Form(
"Nbins%s",fSuffix.Data()),
825 "Defined number of bins for the histogram from which the PDF is created" );
827 DeclareOptionRef( fCheckHist,
Form(
"CheckHist%s",fSuffix.Data()),
828 "Whether or not to check the source histogram of the PDF" );
830 DeclareOptionRef( fInterpolateString,
Form(
"PDFInterpol%s",fSuffix.Data()),
831 "Interpolation method for reference histograms (e.g. Spline2 or KDE)" );
832 AddPreDefVal(
TString(
"Spline0"));
833 AddPreDefVal(
TString(
"Spline1"));
834 AddPreDefVal(
TString(
"Spline2"));
835 AddPreDefVal(
TString(
"Spline3"));
836 AddPreDefVal(
TString(
"Spline5"));
839 DeclareOptionRef( fKDEtypeString,
Form(
"KDEtype%s",fSuffix.Data()),
"KDE kernel type (1=Gauss)" );
840 AddPreDefVal(
TString(
"Gauss"));
842 DeclareOptionRef( fKDEiterString,
Form(
"KDEiter%s",fSuffix.Data()),
"Number of iterations (1=non-adaptive, 2=adaptive)" );
843 AddPreDefVal(
TString(
"Nonadaptive"));
844 AddPreDefVal(
TString(
"Adaptive"));
846 DeclareOptionRef( fFineFactor ,
Form(
"KDEFineFactor%s",fSuffix.Data()),
847 "Fine tuning factor for Adaptive KDE: Factor to multyply the width of the kernel");
849 DeclareOptionRef( fBorderMethodString,
Form(
"KDEborder%s",fSuffix.Data()),
850 "Border effects treatment (1=no treatment , 2=kernel renormalization, 3=sample mirroring)" );
852 AddPreDefVal(
TString(
"Renorm"));
853 AddPreDefVal(
TString(
"Mirror"));
855 SetConfigName( GetName() );
856 SetConfigDescription(
"Configuration options for the PDF class" );
863 if (fNsmooth < 0) fNsmooth = 0;
865 if (fMaxNsmooth < 0 || fMinNsmooth < 0) {
866 fMinNsmooth = fMaxNsmooth = fNsmooth;
869 if (fMaxNsmooth < fMinNsmooth && fMinNsmooth >= 0) {
870 Log() <<
kFATAL <<
"ERROR: MaxNsmooth = "
871 << fMaxNsmooth <<
" < MinNsmooth = " << fMinNsmooth <<
Endl;
874 if (fMaxNsmooth < 0 || fMinNsmooth < 0) {
875 Log() <<
kFATAL <<
"ERROR: MaxNsmooth = "
876 << fMaxNsmooth <<
" or MinNsmooth = " << fMinNsmooth <<
" smaller than zero" <<
Endl;
885 else if (fInterpolateString ==
"KDE" ) fInterpolMethod =
TMVA::PDF::kKDE;
886 else if (fInterpolateString !=
"" ) {
887 Log() <<
kFATAL <<
"unknown setting for option 'InterpolateMethod': " << fKDEtypeString << ((fSuffix==
"")?
"":
Form(
" for pdf with suffix %s",fSuffix.Data())) <<
Endl;
892 else if (fKDEtypeString !=
"" )
893 Log() <<
kFATAL <<
"unknown setting for option 'KDEtype': " << fKDEtypeString << ((fSuffix==
"")?
"":
Form(
" for pdf with suffix %s",fSuffix.Data())) <<
Endl;
896 else if (fKDEiterString !=
"" )
897 Log() <<
kFATAL <<
"unknown setting for option 'KDEiter': " << fKDEtypeString << ((fSuffix==
"")?
"":
Form(
" for pdf with suffix %s",fSuffix.Data())) <<
Endl;
902 else if ( fKDEiterString !=
"" ) {
903 Log() <<
kFATAL <<
"unknown setting for option 'KDEBorder': " << fKDEtypeString << ((fSuffix==
"")?
"":
Form(
" for pdf with suffix %s",fSuffix.Data())) <<
Endl;
916 gTools().
AddAttr(pdfxml,
"InterpolMethod", fInterpolMethod );
922 TH1* histToWrite = GetOriginalHist();
928 gTools().
AddAttr(pdfhist,
"HasEquidistantBins", hasEquidistantBinning );
937 if (!hasEquidistantBinning) {
938 void* pdfhistbins =
gTools().
AddChild(pdfxml,
"HistogramBinning" );
967 Bool_t hasEquidistantBinning;
974 gTools().
ReadAttr( histch,
"HasEquidistantBins", hasEquidistantBinning );
978 if (hasEquidistantBinning) {
979 newhist =
new TH1F( hname, hname, nbins, xmin, xmax );
982 std::stringstream s(content);
991 std::stringstream s(content);
997 if (nbinning != nbins) {
998 Log() <<
kFATAL <<
"Number of bins in content and binning array differs"<<
Endl;
1001 std::stringstream sb(binString);
1002 for (
UInt_t i=0; i<=nbins; i++) sb >> binns[i];
1003 newhist =
new TH1F( hname, hname, nbins, binns.GetMatrixArray() );
1012 hnameSmooth.
ReplaceAll(
"_original",
"_smoothed" );
1014 if (fHistOriginal != 0)
delete fHistOriginal;
1015 fHistOriginal = newhist;
1016 fHist = (
TH1F*)fHistOriginal->
Clone( hnameSmooth );
1017 fHist->SetTitle( hnameSmooth );
1018 fHist->SetDirectory(0);
1020 if (fInterpolMethod ==
PDF::kKDE) BuildKDEPDF();
1021 else BuildSplinePDF();
1029 Int_t dp = os.precision();
1030 os <<
"MinNSmooth " << pdf.
fMinNsmooth << std::endl;
1031 os <<
"MaxNSmooth " << pdf.
fMaxNsmooth << std::endl;
1033 os <<
"KDE_type " << pdf.
fKDEtype << std::endl;
1034 os <<
"KDE_iter " << pdf.
fKDEiter << std::endl;
1035 os <<
"KDE_border " << pdf.
fKDEborder << std::endl;
1036 os <<
"KDE_finefactor " << pdf.
fFineFactor << std::endl;
1051 os <<
"Weights " << std::endl;
1052 os << std::setprecision(8);
1053 for (
Int_t i=0; i<nBins; i++) {
1054 os << std::setw(15) << std::left << histToWrite->
GetBinContent(i+1) << std::right <<
" ";
1055 if ((i+1)%5==0) os << std::endl;
1058 os << std::setprecision(dp);
1073 while (!doneReading) {
1075 if (devnullS==
"NSmooth")
1077 else if (devnullS==
"MinNSmooth") istr >> pdf.
fMinNsmooth;
1078 else if (devnullS==
"MaxNSmooth") istr >> pdf.
fMaxNsmooth;
1084 else if (devnullS ==
"KDE_finefactor") {
1088 istr >> nbins >> xmin >>
xmax;
1089 doneReading =
kTRUE;
1092 else if (devnullS ==
"Histogram") { istr >> hname >> nbins >> xmin >>
xmax; }
1093 else if (devnullS ==
"Weights") { doneReading =
kTRUE; }
1097 hnameSmooth.
ReplaceAll(
"_original",
"_smoothed" );
1101 std::cout <<
"PDF, trying to create a histogram without defined binning"<< std::endl;
1104 TH1* newhist =
new TH1F( hname,hname, nbins, xmin,
xmax );
1130 return GetThisPdfThreadLocal();
virtual const char * GetTitle() const
Returns title of object.
TString fBorderMethodString
MsgLogger & Endl(MsgLogger &ml)
void ReadXML(void *pdfnode)
XML file reading.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
static const Double_t fgEpsilon
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
ClassImp(TMVA::PDF) TMVA
default constructor needed for ROOT I/O
TString & ReplaceAll(const TString &s1, const TString &s2)
void BuildPDF(const TH1 *theHist)
Double_t GetIntegral() const
computes normalisation
void FindBinInverse(const TH1 *histogram, Int_t &lowerBin, Int_t &higherBin, Double_t &lowerBinValue, Double_t &higherBinValue, Double_t y, Bool_t isMonotonouslyIncreasingFunction=kFALSE) const
find bin from value on ordinate
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
static const Int_t fgNbin_PdfHist
1-D histogram with a float per channel (see TH1 documentation)}
Short_t Min(Short_t a, Short_t b)
PDF(const TString &name, Bool_t norm=kTRUE)
virtual Int_t GetNbinsX() const
virtual Double_t GetEntries() const
return the current number of entries
Double_t Prob(Double_t chi2, Int_t ndf)
Computation of the probability for a certain Chi-squared (chi2) and number of degrees of freedom (ndf...
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
virtual Double_t GetBinWidth(Int_t bin) const
return bin width for 1D historam Better to use h1.GetXaxis().GetBinWidth(bin)
TMVA::PDF::EInterpolateMethod fInterpolMethod
static PDF * ThisPDF(void)
virtual TArrayD * GetSumw2()
static const Bool_t fgManualIntegration
void ValidatePDF(TH1 *original=0) const
comparison of original histogram with reference PDF
void BuildSplinePDF()
build the PDF from the original histograms
Int_t GetHistNBins(Int_t evtNum=0)
virtual Double_t GetBinCenter(Int_t bin) const
return bin center for 1D historam Better to use h1.GetXaxis().GetBinCenter(bin)
Double_t length(const TVector2 &v)
TH1 * GetOriginalHist() const
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
char * Form(const char *fmt,...)
virtual Double_t GetSumOfWeights() const
Return the sum of weights excluding under/overflows.
virtual const char * GetName() const
Returns name of object.
UInt_t GetReadingVersion() const
Double_t GetValInverse(Double_t y, Bool_t isMonotonouslyIncreasingFunction=kFALSE) const
returns value PDF^{-1}(y)
std::ostream & operator<<(std::ostream &os, const BinaryTree &tree)
print the tree recursinvely using the << operator
std::istream & operator>>(std::istream &istr, BinaryTree &tree)
read the tree from an std::istream
MsgLogger * fLogger
the suffix for options
void DeclareOptions()
define the options (their key words) that can be set in the option string know options: PDFInterpol[i...
#define TMVA_VERSION(a, b, c)
void CheckHist() const
sanity check: compare PDF with original histogram
void BuildKDEPDF()
creates high-binned reference histogram to be used instead of the PDF for speed reasons ...
Float_t GetBinKernelIntegral(Float_t lowr, Float_t highr, Float_t mean, Int_t binnum)
calculates the integral of the Kernel
Double_t GetVal(Double_t x) const
returns value PDF(x)
void AddXMLTo(void *parent)
XML file writing.
Abstract ClassifierFactory template that handles arbitrary types.
void Err(int level, const char *msg, int size)
Short_t Max(Short_t a, Short_t b)
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
A Graph is a graphics object made of two arrays X and Y with npoints each.
static Double_t IGetVal(Double_t *, Double_t *)
static external auxiliary function (integrand)
KDEKernel::EKernelIter fKDEiter
void SetKernelType(EKernelType ktype=kGauss)
fIter == 1 —> nonadaptive KDE fIter == 2 —> adaptive KDE
virtual void SetTitle(const char *title)
Change (i.e.
TString fInterpolateString
Double_t Sqrt(Double_t x)
virtual Double_t GetBinError(Int_t bin) const
Return value of error associated to bin number bin.
void FillSplineToHist()
creates high-binned reference histogram to be used instead of the PDF for speed reasons ...
double norm(double *x, double *p)
KDEKernel::EKernelBorder fKDEborder
KDEKernel::EKernelType fKDEtype
void FillHistToGraph()
Simple conversion.