70 fInterpolMethod( PDF::kSpline2 ),
77 fHistAvgEvtPerBin ( 0 ),
78 fHistDefinedNBins ( 0 ),
81 fBorderMethodString( 0 ),
82 fInterpolateString ( 0 ),
83 fKDEtype ( KDEKernel::
kNone ),
84 fKDEiter ( KDEKernel::kNonadaptiveKDE ),
85 fKDEborder ( KDEKernel::kNoTreatment ),
88 fCheckHist ( kFALSE ),
93 fLogger =
new MsgLogger(
this);
94 GetThisPdfThreadLocal() =
this;
110 fMinNsmooth ( minnsmooth ),
111 fMaxNsmooth ( maxnsmooth ),
113 fInterpolMethod( method ),
120 fHistAvgEvtPerBin ( 0 ),
121 fHistDefinedNBins ( 0 ),
122 fKDEtypeString ( 0 ),
123 fKDEiterString ( 0 ),
124 fBorderMethodString( 0 ),
125 fInterpolateString ( 0 ),
130 fReadingVersion( 0 ),
131 fCheckHist ( checkHist ),
157 fInterpolMethod(
PDF::kKDE ),
164 fHistAvgEvtPerBin ( 0 ),
165 fHistDefinedNBins ( 0 ),
166 fKDEtypeString ( 0 ),
167 fKDEiterString ( 0 ),
168 fBorderMethodString( 0 ),
169 fInterpolateString ( 0 ),
172 fKDEborder ( kborder ),
173 fFineFactor ( FineFactor),
174 fReadingVersion( 0 ),
198 fInterpolMethod(
PDF::kSpline0 ),
205 fHistAvgEvtPerBin ( 50 ),
206 fHistDefinedNBins ( 0 ),
207 fKDEtypeString (
"Gauss" ),
208 fKDEiterString (
"Nonadaptive" ),
209 fBorderMethodString(
"None" ),
210 fInterpolateString (
"Spline2" ),
215 fReadingVersion( 0 ),
222 if (defaultPDF != 0) {
242 if (fSpline !=
NULL)
delete fSpline;
243 if (fHist !=
NULL)
delete fHist;
244 if (fPDFHist !=
NULL)
delete fPDFHist;
245 if (fHistOriginal !=
NULL)
delete fHistOriginal;
246 if (fIGetVal !=
NULL)
delete fIGetVal;
247 if (fGraph !=
NULL)
delete fGraph;
255 GetThisPdfThreadLocal() =
this;
257 if (hist ==
NULL)
Log() <<
kFATAL <<
"Called without valid histogram pointer!" <<
Endl;
268 <<
"type KDE kernel for histogram: \"" << hist->
GetName() <<
"\""
274 Log() <<
kFATAL <<
"PDF construction called with minnsmooth<0" <<
Endl;
275 else if (fMaxNsmooth<=0)
276 fMaxNsmooth = fMinNsmooth;
277 else if (fMaxNsmooth<fMinNsmooth)
278 Log() <<
kFATAL <<
"PDF construction called with maxnsmooth<minnsmooth" <<
Endl;
283 fHistOriginal->SetTitle( fHistOriginal->GetName() );
284 fHist ->SetTitle( fHist->GetName() );
287 fHistOriginal->SetDirectory(0);
288 fHist ->SetDirectory(0);
291 if (fInterpolMethod ==
PDF::kKDE) BuildKDEPDF();
292 else BuildSplinePDF();
300 if (evtNum == 0 && fHistDefinedNBins == 0)
302 else if (fHistDefinedNBins > 0)
303 return fHistDefinedNBins * ResolutionFactor;
304 else if ( evtNum > 0 && fHistAvgEvtPerBin > 0 )
305 return evtNum / fHistAvgEvtPerBin * ResolutionFactor;
307 Log() <<
kFATAL <<
"No number of bins or average event per bin set for PDF" << fHistAvgEvtPerBin <<
Endl;
317 if (fInterpolMethod !=
PDF::kSpline0 && fCheckHist) CheckHist();
320 if (fMaxNsmooth > 0 && fMinNsmooth >=0 ) SmoothHistogram();
326 switch (fInterpolMethod) {
331 fUseHistogram =
kTRUE;
351 Log() <<
kWARNING <<
"No valid interpolation method given! Use Spline2" <<
Endl;
353 Log() <<
kFATAL <<
" Well.. .thinking about it, I better quit so you notice you are forced to fix the mistake " <<
Endl;
359 if (!UseHistogram()) {
360 fSpline->SetTitle( (
TString)fHist->GetTitle() + fSpline->GetTitle() );
361 fSpline->SetName ( (
TString)fHist->GetName() + fSpline->GetName() );
367 if (integral < 0)
Log() <<
kFATAL <<
"Integral: " << integral <<
" <= 0" <<
Endl;
371 if (integral>0) fPDFHist->Scale( 1.0/integral );
373 fPDFHist->SetDirectory(0);
382 fPDFHist =
new TH1F(
"",
"", fgNbin_PdfHist, GetXmin(), GetXmax() );
383 fPDFHist->SetTitle( (
TString)fHist->GetTitle() +
"_hist from_KDE" );
384 fPDFHist->SetName ( (
TString)fHist->GetName() +
"_hist_from_KDE" );
387 Float_t histoLowEdge = fHist->GetBinLowEdge(1);
388 Float_t histoUpperEdge = fPDFHist->GetBinLowEdge(fPDFHist->GetNbinsX()) + fPDFHist->GetBinWidth(fPDFHist->GetNbinsX());
390 fHist, histoLowEdge, histoUpperEdge,
391 fKDEborder, fFineFactor );
394 for (
Int_t i=1;i<fHist->GetNbinsX();i++) {
396 for (
Int_t j=1;j<fPDFHist->GetNbinsX();j++) {
398 fPDFHist->AddBinContent(j,fHist->GetBinContent(i)*
400 fPDFHist->GetBinLowEdge(j+1),
401 fHist->GetBinCenter(i),
405 if (fKDEborder == 3) {
409 if (i < fHist->GetNbinsX()/5 ) {
410 for (
Int_t j=1;j<fPDFHist->GetNbinsX();j++) {
412 fPDFHist->AddBinContent(j,fHist->GetBinContent(i)*
414 fPDFHist->GetBinLowEdge(j+1),
415 2*histoLowEdge-fHist->GetBinCenter(i),
420 if (i > 4*fHist->GetNbinsX()/5) {
421 for (
Int_t j=1;j<fPDFHist->GetNbinsX();j++) {
423 fPDFHist->AddBinContent( j,fHist->GetBinContent(i)*
425 fPDFHist->GetBinLowEdge(j+1),
426 2*histoUpperEdge-fHist->GetBinCenter(i), i) );
432 fPDFHist->SetEntries(fHist->GetEntries());
438 if (integral < 0)
Log() <<
kFATAL <<
"Integral: " << integral <<
" <= 0" <<
Endl;
442 if (integral>0) fPDFHist->Scale( 1.0/integral );
443 fPDFHist->SetDirectory(0);
450 if(fHist->GetNbinsX()==1)
return;
451 if (fMaxNsmooth == fMinNsmooth) {
452 fHist->Smooth( fMinNsmooth );
459 for (
Int_t bin=0; bin<fHist->GetNbinsX(); bin++) {
460 if (fHist->GetBinContent(bin+1) <= fHist->GetBinError(bin+1))
continue;
461 Err = fHist->GetBinError(bin+1) / fHist->GetBinContent(bin+1);
462 ErrAvg +=
Err; ErrRMS += Err*
Err; num++;
468 Float_t MaxErr=ErrAvg+ErrRMS, MinErr=ErrAvg-ErrRMS;
469 fNSmoothHist =
new TH1I(
"",
"",fHist->GetNbinsX(),0,fHist->GetNbinsX());
471 fNSmoothHist->SetName ( (
TString)fHist->GetName() +
"_Nsmooth" );
472 for (
Int_t bin=0; bin<fHist->GetNbinsX(); bin++) {
473 if (fHist->GetBinContent(bin+1) <= fHist->GetBinError(bin+1))
476 Err = fHist->GetBinError(bin+1) / fHist->GetBinContent(bin+1);
477 smooth=(
Int_t)((Err-MinErr) /(MaxErr-MinErr) * (fMaxNsmooth-fMinNsmooth)) + fMinNsmooth;
480 fNSmoothHist->SetBinContent(bin+1,smooth);
485 for (
Int_t n=fMaxNsmooth;
n>=0;
n--) {
487 if (
n <= fMinNsmooth) { fHist->Smooth();
continue; }
488 Int_t MinBin=-1,MaxBin =-1;
489 for (
Int_t bin=0; bin < fHist->GetNbinsX(); bin++) {
490 if (fNSmoothHist->GetBinContent(bin+1) >=
n) {
491 if (MinBin==-1) MinBin = bin;
494 else if (MaxBin >= 0) {
495 #if ROOT_VERSION_CODE > ROOT_VERSION(5,19,2)
496 fHist->Smooth(1,
"R");
498 fHist->Smooth(1,MinBin+1,MaxBin+1);
522 if (UseHistogram()) {
524 fPDFHist = (
TH1*)fHist->Clone();
525 fPDFHist->SetTitle( (
TString)fHist->GetTitle() +
"_hist from_spline0" );
526 fPDFHist->SetName ( (
TString)fHist->GetName() +
"_hist_from_spline0" );
530 fPDFHist =
new TH1F(
"",
"", fgNbin_PdfHist, GetXmin(), GetXmax() );
531 fPDFHist->SetTitle( (
TString)fHist->GetTitle() +
"_hist from_" + fSpline->GetTitle() );
532 fPDFHist->SetName ( (
TString)fHist->GetName() +
"_hist_from_" + fSpline->GetTitle() );
534 for (
Int_t bin=1; bin <= fgNbin_PdfHist; bin++) {
535 Double_t x = fPDFHist->GetBinCenter( bin );
540 if (y <= fgEpsilon) y = fHist->GetBinContent( fHist->FindBin( x ) );
541 fPDFHist->SetBinContent( bin,
TMath::Max(y, fgEpsilon) );
544 fPDFHist->SetDirectory(0);
553 Log() <<
kFATAL <<
"<CheckHist> Called without valid histogram pointer!" <<
Endl;
561 if (fHist->GetBinContent(bin) == 0) emptyBins++;
565 <<
"%) of the bins in hist '"
566 << fHist->GetName() <<
"' are empty!" <<
Endl;
568 <<
" mean=" << fHist->GetMean() <<
" X_max= " << GetXmax() <<
Endl;
578 if (!originalHist) originalHist = fHistOriginal;
598 Int_t binPdfHist = fPDFHist->FindBin( x );
599 if (binPdfHist<0)
continue;
603 originalHist->
GetBinWidth( bin )/fPDFHist->GetBinWidth( binPdfHist ) );
611 if (d > 1) { nc1++;
if (d > 2) { nc2++;
if (d > 3) { nc3++;
if (d > 6) nc6++; } } }
615 Log() <<
"Validation result for PDF \"" << originalHist->
GetTitle() <<
"\"" <<
": " <<
Endl;
616 Log() <<
Form(
" chi2/ndof(!=0) = %.1f/%i = %.2f (Prob = %.2f)",
618 if ((1.0 -
TMath::Prob( chi2, ndof )) > 0.9999994) {
620 Log() <<
kWARNING <<
"with the corresponding PDF gave a chi2/ndof of " << chi2/ndof <<
"," <<
Endl;
621 Log() <<
kWARNING <<
"which corresponds to a deviation of more than 5 sigma! Please check!" <<
Endl;
623 Log() <<
Form(
" #bins-found(#expected-bins) deviating > [1,2,3,6] sigmas: " \
624 "[%i(%i),%i(%i),%i(%i),%i(%i)]",
634 Double_t integral = fPDFHist->GetSumOfWeights();
635 integral *= GetPdfHistBinWidth();
645 return ThisPDF()->GetVal( x[0] );
655 if (fgManualIntegration) {
658 Int_t imin = fPDFHist->FindBin(xmin);
659 Int_t imax = fPDFHist->FindBin(xmax);
660 if (imin < 1) imin = 1;
661 if (imax > fPDFHist->GetNbinsX()) imax = fPDFHist->GetNbinsX();
663 for (
Int_t bini = imin; bini <= imax; bini++) {
664 Float_t dx = fPDFHist->GetBinWidth(bini);
666 if (bini == imin) dx = fPDFHist->GetBinLowEdge(bini+1) -
xmin;
667 else if (bini == imax) dx = xmax - fPDFHist->GetBinLowEdge(bini);
668 if (dx < 0 && dx > -1.0e-8) dx = 0;
671 <<
"dx = " << dx << std::endl
672 <<
"bini = " << bini << std::endl
673 <<
"xmin = " << xmin << std::endl
674 <<
"xmax = " << xmax << std::endl
675 <<
"imin = " << imin << std::endl
676 <<
"imax = " << imax << std::endl
677 <<
"low edge of imin" << fPDFHist->GetBinLowEdge(imin) << std::endl
678 <<
"low edge of imin+1" << fPDFHist->GetBinLowEdge(imin+1) <<
Endl;
679 Log() <<
kFATAL <<
"<GetIntegral> dx = " << dx <<
" < 0" <<
Endl;
681 integral += fPDFHist->GetBinContent(bini)*dx;
688 if (fIGetVal == 0) fIGetVal =
new TF1(
"IGetVal",
PDF::IGetVal, GetXmin(), GetXmax(), 0 );
689 integral = fIGetVal->Integral( xmin, xmax );
701 Int_t bin = fPDFHist->FindBin(x);
707 if (UseHistogram()) {
709 retval = fPDFHist->GetBinContent( bin );
714 if ((x > fPDFHist->GetBinCenter(bin) && bin != fPDFHist->GetNbinsX()) || bin == 1)
720 Double_t dx = fPDFHist->GetBinCenter( bin ) - fPDFHist->GetBinCenter( nextbin );
721 Double_t dy = fPDFHist->GetBinContent( bin ) - fPDFHist->GetBinContent( nextbin );
722 retval = fPDFHist->GetBinContent( bin ) + (x - fPDFHist->GetBinCenter( bin ))*dy/dx;
733 Int_t lowerBin=0, higherBin=0;
734 Double_t lowerBinValue=0, higherBinValue=0;
735 FindBinInverse(fPDFHist,lowerBin,higherBin,lowerBinValue,higherBinValue,y,isMonotonouslyIncreasingFunction);
737 Double_t xValueLowerBin =fPDFHist->GetBinCenter (lowerBin);
738 Double_t xValueHigherBin=fPDFHist->GetBinCenter (higherBin);
743 fraction=(y-lowerBinValue)/length;
745 Double_t lengthX =xValueHigherBin-xValueLowerBin;
746 Double_t x =xValueLowerBin+lengthX*fraction;
761 if (isMonotonouslyIncreasingFunction) {
765 Int_t bin=higherBin/2;
767 while (bin>lowerBin && bin<higherBin) {
772 higherBinValue=binContent;
774 else if (y>=binContent){
776 lowerBinValue =binContent;
778 bin=lowerBin+(higherBin-lowerBin)/2;
783 for (
Int_t bin=0, binEnd=histogram->
GetNbinsX(); bin<binEnd; ++bin) {
788 lowerBinValue =binContent;
789 higherBinValue=binContent;
793 higherBinValue=binContent;
817 DeclareOptionRef( fNsmooth,
Form(
"NSmooth%s",fSuffix.Data()),
818 "Number of smoothing iterations for the input histograms" );
819 DeclareOptionRef( fMinNsmooth,
Form(
"MinNSmooth%s",fSuffix.Data()),
820 "Min number of smoothing iterations, for bins with most data" );
822 DeclareOptionRef( fMaxNsmooth,
Form(
"MaxNSmooth%s",fSuffix.Data()),
823 "Max number of smoothing iterations, for bins with least data" );
825 DeclareOptionRef( fHistAvgEvtPerBin,
Form(
"NAvEvtPerBin%s",fSuffix.Data()),
826 "Average number of events per PDF bin" );
828 DeclareOptionRef( fHistDefinedNBins,
Form(
"Nbins%s",fSuffix.Data()),
829 "Defined number of bins for the histogram from which the PDF is created" );
831 DeclareOptionRef( fCheckHist,
Form(
"CheckHist%s",fSuffix.Data()),
832 "Whether or not to check the source histogram of the PDF" );
834 DeclareOptionRef( fInterpolateString,
Form(
"PDFInterpol%s",fSuffix.Data()),
835 "Interpolation method for reference histograms (e.g. Spline2 or KDE)" );
836 AddPreDefVal(
TString(
"Spline0"));
837 AddPreDefVal(
TString(
"Spline1"));
838 AddPreDefVal(
TString(
"Spline2"));
839 AddPreDefVal(
TString(
"Spline3"));
840 AddPreDefVal(
TString(
"Spline5"));
843 DeclareOptionRef( fKDEtypeString,
Form(
"KDEtype%s",fSuffix.Data()),
"KDE kernel type (1=Gauss)" );
844 AddPreDefVal(
TString(
"Gauss"));
846 DeclareOptionRef( fKDEiterString,
Form(
"KDEiter%s",fSuffix.Data()),
"Number of iterations (1=non-adaptive, 2=adaptive)" );
847 AddPreDefVal(
TString(
"Nonadaptive"));
848 AddPreDefVal(
TString(
"Adaptive"));
850 DeclareOptionRef( fFineFactor ,
Form(
"KDEFineFactor%s",fSuffix.Data()),
851 "Fine tuning factor for Adaptive KDE: Factor to multyply the width of the kernel");
853 DeclareOptionRef( fBorderMethodString,
Form(
"KDEborder%s",fSuffix.Data()),
854 "Border effects treatment (1=no treatment , 2=kernel renormalization, 3=sample mirroring)" );
856 AddPreDefVal(
TString(
"Renorm"));
857 AddPreDefVal(
TString(
"Mirror"));
859 SetConfigName( GetName() );
860 SetConfigDescription(
"Configuration options for the PDF class" );
867 if (fNsmooth < 0) fNsmooth = 0;
869 if (fMaxNsmooth < 0 || fMinNsmooth < 0) {
870 fMinNsmooth = fMaxNsmooth = fNsmooth;
873 if (fMaxNsmooth < fMinNsmooth && fMinNsmooth >= 0) {
874 Log() <<
kFATAL <<
"ERROR: MaxNsmooth = "
875 << fMaxNsmooth <<
" < MinNsmooth = " << fMinNsmooth <<
Endl;
878 if (fMaxNsmooth < 0 || fMinNsmooth < 0) {
879 Log() <<
kFATAL <<
"ERROR: MaxNsmooth = "
880 << fMaxNsmooth <<
" or MinNsmooth = " << fMinNsmooth <<
" smaller than zero" <<
Endl;
889 else if (fInterpolateString ==
"KDE" ) fInterpolMethod =
TMVA::PDF::kKDE;
890 else if (fInterpolateString !=
"" ) {
891 Log() <<
kFATAL <<
"unknown setting for option 'InterpolateMethod': " << fKDEtypeString << ((fSuffix==
"")?
"":
Form(
" for pdf with suffix %s",fSuffix.Data())) <<
Endl;
896 else if (fKDEtypeString !=
"" )
897 Log() <<
kFATAL <<
"unknown setting for option 'KDEtype': " << fKDEtypeString << ((fSuffix==
"")?
"":
Form(
" for pdf with suffix %s",fSuffix.Data())) <<
Endl;
900 else if (fKDEiterString !=
"" )
901 Log() <<
kFATAL <<
"unknown setting for option 'KDEiter': " << fKDEtypeString << ((fSuffix==
"")?
"":
Form(
" for pdf with suffix %s",fSuffix.Data())) <<
Endl;
906 else if ( fKDEiterString !=
"" ) {
907 Log() <<
kFATAL <<
"unknown setting for option 'KDEBorder': " << fKDEtypeString << ((fSuffix==
"")?
"":
Form(
" for pdf with suffix %s",fSuffix.Data())) <<
Endl;
920 gTools().
AddAttr(pdfxml,
"InterpolMethod", fInterpolMethod );
926 TH1* histToWrite = GetOriginalHist();
932 gTools().
AddAttr(pdfhist,
"HasEquidistantBins", hasEquidistantBinning );
941 if (!hasEquidistantBinning) {
942 void* pdfhistbins =
gTools().
AddChild(pdfxml,
"HistogramBinning" );
971 Bool_t hasEquidistantBinning;
978 gTools().
ReadAttr( histch,
"HasEquidistantBins", hasEquidistantBinning );
982 if (hasEquidistantBinning) {
983 newhist =
new TH1F( hname, hname, nbins, xmin, xmax );
986 std::stringstream s(content);
995 std::stringstream s(content);
1001 if (nbinning != nbins) {
1002 Log() <<
kFATAL <<
"Number of bins in content and binning array differs"<<
Endl;
1005 std::stringstream sb(binString);
1006 for (
UInt_t i=0; i<=nbins; i++) sb >> binns[i];
1007 newhist =
new TH1F( hname, hname, nbins, binns.GetMatrixArray() );
1016 hnameSmooth.
ReplaceAll(
"_original",
"_smoothed" );
1018 if (fHistOriginal != 0)
delete fHistOriginal;
1019 fHistOriginal = newhist;
1020 fHist = (
TH1F*)fHistOriginal->
Clone( hnameSmooth );
1021 fHist->SetTitle( hnameSmooth );
1022 fHist->SetDirectory(0);
1024 if (fInterpolMethod ==
PDF::kKDE) BuildKDEPDF();
1025 else BuildSplinePDF();
1033 Int_t dp = os.precision();
1034 os <<
"MinNSmooth " << pdf.
fMinNsmooth << std::endl;
1035 os <<
"MaxNSmooth " << pdf.
fMaxNsmooth << std::endl;
1037 os <<
"KDE_type " << pdf.
fKDEtype << std::endl;
1038 os <<
"KDE_iter " << pdf.
fKDEiter << std::endl;
1039 os <<
"KDE_border " << pdf.
fKDEborder << std::endl;
1040 os <<
"KDE_finefactor " << pdf.
fFineFactor << std::endl;
1055 os <<
"Weights " << std::endl;
1056 os << std::setprecision(8);
1057 for (
Int_t i=0; i<nBins; i++) {
1058 os << std::setw(15) << std::left << histToWrite->
GetBinContent(i+1) << std::right <<
" ";
1059 if ((i+1)%5==0) os << std::endl;
1062 os << std::setprecision(dp);
1077 while (!doneReading) {
1079 if (devnullS==
"NSmooth")
1081 else if (devnullS==
"MinNSmooth") istr >> pdf.
fMinNsmooth;
1082 else if (devnullS==
"MaxNSmooth") istr >> pdf.
fMaxNsmooth;
1088 else if (devnullS ==
"KDE_finefactor") {
1092 istr >> nbins >> xmin >>
xmax;
1093 doneReading =
kTRUE;
1096 else if (devnullS ==
"Histogram") { istr >> hname >> nbins >> xmin >>
xmax; }
1097 else if (devnullS ==
"Weights") { doneReading =
kTRUE; }
1101 hnameSmooth.
ReplaceAll(
"_original",
"_smoothed" );
1105 std::cout <<
"PDF, trying to create a histogram without defined binning"<< std::endl;
1108 TH1* newhist =
new TH1F( hname,hname, nbins, xmin,
xmax );
1134 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
1-D histogram with a int per channel (see TH1 documentation)}
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.
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
TString()
TString default ctor.
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.