148 fEpsilon ( 1.e3 * DBL_MIN ),
149 fTransformLikelihoodOutput(
kFALSE ),
153 fHistSig_smooth( 0 ),
154 fHistBgd_smooth( 0 ),
155 fDefaultPDFLik ( 0 ),
161 fAverageEvtPerBin( 0 ),
162 fAverageEvtPerBinVarS (0),
163 fAverageEvtPerBinVarB (0),
164 fKDEfineFactor ( 0 ),
165 fInterpolateString(0)
173 const TString& theWeightFile) :
175 fEpsilon ( 1.e3 * DBL_MIN ),
176 fTransformLikelihoodOutput(
kFALSE ),
180 fHistSig_smooth( 0 ),
181 fHistBgd_smooth( 0 ),
182 fDefaultPDFLik ( 0 ),
188 fAverageEvtPerBin( 0 ),
189 fAverageEvtPerBinVarS (0),
190 fAverageEvtPerBinVarB (0),
191 fKDEfineFactor ( 0 ),
192 fInterpolateString(0)
246 "Transform likelihood output by inverse sigmoid function" );
257 (*fPDFSig)[ivar] =
new PDF(
Form(
"%s PDF Sig[%d]",
GetName(), ivar), updatedOptions,
259 (*fPDFSig)[ivar]->DeclareOptions();
260 (*fPDFSig)[ivar]->ParseOptions();
261 updatedOptions = (*fPDFSig)[ivar]->GetOptions();
262 (*fPDFBgd)[ivar] =
new PDF(
Form(
"%s PDF Bkg[%d]",
GetName(), ivar), updatedOptions,
264 (*fPDFBgd)[ivar]->DeclareOptions();
265 (*fPDFBgd)[ivar]->ParseOptions();
266 updatedOptions = (*fPDFBgd)[ivar]->GetOptions();
280 "Number of smoothing iterations for the input histograms");
282 "Average number of events per PDF bin");
284 "Fine tuning factor for Adaptive KDE: Factor to multyply the width of the kernel");
286 "Border effects treatment (1=no treatment , 2=kernel renormalization, 3=sample mirroring)" );
288 "Number of iterations (1=non-adaptive, 2=adaptive)" );
290 "KDE kernel type (1=Gauss)" );
302 "Average num of events per PDF bin and variable (signal)");
304 "Average num of events per PDF bin and variable (background)");
306 "Number of smoothing iterations for the input histograms");
308 "Number of smoothing iterations for the input histograms");
325 (*fPDFBgd)[ivar]->ProcessOptions();
326 (*fPDFSig)[ivar]->ProcessOptions();
341 std::vector<Double_t>
xmin(nvar),
xmax(nvar);
342 for (
UInt_t ivar=0; ivar<nvar; ivar++) {
xmin[ivar]=1e30; xmax[ivar]=-1e30;}
345 for (
UInt_t ievt=0; ievt<nevents; ievt++) {
351 for (
int cls=0;cls<2;cls++){
354 for (
UInt_t ivar=0; ivar<nvar; ivar++) {
356 if (value <
xmin[ivar])
xmin[ivar] = value;
357 if (value > xmax[ivar]) xmax[ivar] = value;
365 TString var = (*fInputVars)[ivar];
375 xmax[ivar]=xmax[ivar]+1;
378 (*fHistSig)[ivar] =
new TH1F(
GetMethodName()+
"_"+var +
"_sig", var +
" signal training", nbins, ixmin, ixmax );
379 (*fHistBgd)[ivar] =
new TH1F(
GetMethodName()+
"_"+var +
"_bgd", var +
" background training", nbins, ixmin, ixmax );
383 Int_t nbinsS = (*fPDFSig)[ivar]->GetHistNBins( minNEvt );
384 Int_t nbinsB = (*fPDFBgd)[ivar]->GetHistNBins( minNEvt );
394 Log() <<
kINFO <<
"Filling reference histograms" <<
Endl;
413 if (value >= xmax[ivar]) value = xmax[ivar] - 1.0e-10;
414 else if (value <
xmin[ivar]) value =
xmin[ivar] + 1.0e-10;
419 <<
"error in filling likelihood reference histograms var=" 420 <<(*fInputVars)[ivar]
421 <<
", xmin="<<(*fHistSig)[ivar]->GetXaxis()->GetXmin()
423 <<
", xmax="<<(*fHistSig)[ivar]->GetXaxis()->GetXmax()
426 if (
DataInfo().IsSignal(ev)) (*fHistSig)[ivar]->Fill( value, weight );
427 else (*
fHistBgd)[ivar]->Fill( value, weight );
432 Log() <<
kINFO <<
"Building PDF out of reference histograms" <<
Endl;
437 (*fPDFSig)[ivar]->BuildPDF( (*
fHistSig)[ivar] );
438 (*fPDFBgd)[ivar]->BuildPDF( (*
fHistBgd)[ivar] );
440 (*fPDFSig)[ivar]->ValidatePDF( (*
fHistSig)[ivar] );
441 (*fPDFBgd)[ivar]->ValidatePDF( (*
fHistBgd)[ivar] );
444 if ((*
fPDFSig)[ivar]->GetSmoothedHist() != 0) (*fHistSig_smooth)[ivar] = (*fPDFSig)[ivar]->GetSmoothedHist();
445 if ((*
fPDFBgd)[ivar]->GetSmoothedHist() != 0) (*fHistBgd_smooth)[ivar] = (*fPDFBgd)[ivar]->GetSmoothedHist();
482 for (ivar=0; ivar<
GetNvar(); ivar++) {
489 for (
UInt_t itype=0; itype < 2; itype++) {
492 if (x[itype] >= (*
fPDFSig)[ivar]->
GetXmax()) x[itype] = (*fPDFSig)[ivar]->GetXmax() - 1.0e-10;
493 else if (x[itype] < (*
fPDFSig)[ivar]->
GetXmin()) x[itype] = (*fPDFSig)[ivar]->GetXmin();
496 PDF* pdf = (itype == 0) ? (*
fPDFSig)[ivar] : (*fPDFBgd)[ivar];
497 if (pdf == 0)
Log() <<
kFATAL <<
"<GetMvaValue> Reference histograms don't exist" <<
Endl;
507 DataInfo().GetVariableInfo(ivar).GetVarType() ==
'N') {
524 if (itype == 0) ps *= p;
541 if (r >= 1.0) r = 1. - 1.e-15;
548 else if (r >= 1.0) r = 1. - 1.e-15;
566 o << prefix << std::endl << prefix <<
"#Default Likelihood PDF Options:" << std::endl << prefix << std::endl;
571 o << prefix << std::endl << prefix <<
Form(
"#Signal[%d] Likelihood PDF Options:",ivar) << std::endl << prefix << std::endl;
572 (*fPDFSig)[ivar]->WriteOptionsToStream( o, prefix );
575 o << prefix << std::endl << prefix <<
"#Background[%d] Likelihood PDF Options:" << std::endl << prefix << std::endl;
576 (*fPDFBgd)[ivar]->WriteOptionsToStream( o, prefix );
591 if ( (*
fPDFSig)[ivar]==0 || (*fPDFBgd)[ivar]==0 )
592 Log() <<
kFATAL <<
"Reference histograms for variable " << ivar
593 <<
" don't exist, can't write it to weight file" <<
Endl;
597 (*fPDFSig)[ivar]->AddXMLTo(pdfwrap);
601 (*fPDFBgd)[ivar]->AddXMLTo(pdfwrap);
622 TH1* rS =
new TH1F( nameS, nameS, 80, 0, 1 );
623 TH1* rB =
new TH1F( nameB, nameB, 80, 0, 1 );
635 else rB->
Fill( lk, w );
640 if (ivar == -1) sepRef =
sep;
662 (*fPDFSig)[ivar]->Write( pname +
GetInputVar( ivar ) +
"_S" );
663 (*fPDFBgd)[ivar]->Write( pname +
GetInputVar( ivar ) +
"_B" );
677 for (
UInt_t ivar=0; ivar<nvars; ivar++){
680 if ((*
fPDFSig)[ivar] !=0)
delete (*fPDFSig)[ivar];
681 if ((*
fPDFBgd)[ivar] !=0)
delete (*fPDFBgd)[ivar];
686 (*(*fPDFSig)[ivar]).ReadXML(pdfnode);
689 (*(*fPDFBgd)[ivar]).ReadXML(pdfnode);
705 if ((*
fPDFSig)[ivar] !=0)
delete (*fPDFSig)[ivar];
706 if ((*
fPDFBgd)[ivar] !=0)
delete (*fPDFBgd)[ivar];
711 istr >> *(*fPDFSig)[ivar];
712 istr >> *(*fPDFBgd)[ivar];
741 (*fHistSig)[ivar]->Write();
742 (*fHistBgd)[ivar]->Write();
745 (*fPDFSig)[ivar]->GetPDFHist()->Write();
746 (*fPDFBgd)[ivar]->GetPDFHist()->Write();
748 if ((*
fPDFSig)[ivar]->GetNSmoothHist() != 0) (*fPDFSig)[ivar]->GetNSmoothHist()->Write();
749 if ((*
fPDFBgd)[ivar]->GetNSmoothHist() != 0) (*fPDFBgd)[ivar]->GetNSmoothHist()->Write();
755 (*
fInputVars)[ivar]+
"_additional_check", 15000, xmin, xmax );
757 for (
Int_t bin=0; bin < 15000; bin++) {
764 TH1*
h[2] = { (*fHistSig)[ivar], (*fHistBgd)[ivar] };
765 for (
UInt_t i=0; i<2; i++) {
771 hclone->
Rebin( resFactor );
772 hclone->
Scale( 1.0/resFactor );
785 fout <<
"#include <math.h>" << std::endl;
786 fout <<
"#include <cstdlib>" << std::endl;
794 Int_t dp = fout.precision();
795 fout <<
" double fEpsilon;" << std::endl;
801 nbin[ivar]=(*fPDFSig)[ivar]->GetPDFHist()->GetNbinsX();
802 if (nbin[ivar] > nbinMax) nbinMax=nbin[ivar];
805 fout <<
" static float fRefS[][" << nbinMax <<
"]; " 806 <<
"// signal reference vector [nvars][max_nbins]" << std::endl;
807 fout <<
" static float fRefB[][" << nbinMax <<
"]; " 808 <<
"// backgr reference vector [nvars][max_nbins]" << std::endl << std::endl;
809 fout <<
"// if a variable has its PDF encoded as a spline0 --> treat it like an Integer valued one" <<std::endl;
810 fout <<
" bool fHasDiscretPDF[" <<
GetNvar() <<
"]; "<< std::endl;
811 fout <<
" int fNbin[" <<
GetNvar() <<
"]; " 812 <<
"// number of bins (discrete variables may have less bins)" << std::endl;
813 fout <<
" double fHistMin[" <<
GetNvar() <<
"]; " << std::endl;
814 fout <<
" double fHistMax[" <<
GetNvar() <<
"]; " << std::endl;
816 fout <<
" double TransformLikelihoodOutput( double, double ) const;" << std::endl;
817 fout <<
"};" << std::endl;
818 fout <<
"" << std::endl;
819 fout <<
"inline void " << className <<
"::Initialize() " << std::endl;
820 fout <<
"{" << std::endl;
821 fout <<
" fEpsilon = " <<
fEpsilon <<
";" << std::endl;
823 fout <<
" fNbin[" << ivar <<
"] = " << (*fPDFSig)[ivar]->GetPDFHist()->GetNbinsX() <<
";" << std::endl;
824 fout <<
" fHistMin[" << ivar <<
"] = " << (*fPDFSig)[ivar]->GetPDFHist()->GetXaxis()->GetXmin() <<
";" << std::endl;
825 fout <<
" fHistMax[" << ivar <<
"] = " << (*fPDFSig)[ivar]->GetPDFHist()->GetXaxis()->GetXmax() <<
";" << std::endl;
827 if ((((*
fPDFSig)[ivar]->GetPDFHist()->GetNbinsX() != nbin[ivar] ||
828 (*
fPDFBgd)[ivar]->GetPDFHist()->GetNbinsX() != nbin[ivar])
830 (*
fPDFSig)[ivar]->GetPDFHist()->GetNbinsX() != (*
fPDFBgd)[ivar]->GetPDFHist()->GetNbinsX()) {
831 Log() <<
kFATAL <<
"<MakeClassSpecific> Mismatch in binning of variable " 834 <<
"nxS = " << (*fPDFSig)[ivar]->GetPDFHist()->GetNbinsX() <<
", " 835 <<
"nxB = " << (*fPDFBgd)[ivar]->GetPDFHist()->GetNbinsX()
836 <<
" while we expect " << nbin[ivar]
842 fout <<
" fHasDiscretPDF[" << ivar <<
"] = true; " << std::endl;
844 fout <<
" fHasDiscretPDF[" << ivar <<
"] = false; " << std::endl;
847 fout <<
"}" << std::endl << std::endl;
849 fout <<
"inline double " << className
850 <<
"::GetMvaValue__( const std::vector<double>& inputValues ) const" << std::endl;
851 fout <<
"{" << std::endl;
852 fout <<
" double ps(1), pb(1);" << std::endl;
853 fout <<
" std::vector<double> inputValuesSig = inputValues;" << std::endl;
854 fout <<
" std::vector<double> inputValuesBgd = inputValues;" << std::endl;
856 fout <<
" Transform(inputValuesSig,0);" << std::endl;
857 fout <<
" Transform(inputValuesBgd,1);" << std::endl;
859 fout <<
" for (size_t ivar = 0; ivar < GetNvar(); ivar++) {" << std::endl;
861 fout <<
" // dummy at present... will be used for variable transforms" << std::endl;
862 fout <<
" double x[2] = { inputValuesSig[ivar], inputValuesBgd[ivar] };" << std::endl;
864 fout <<
" for (int itype=0; itype < 2; itype++) {" << std::endl;
866 fout <<
" // interpolate linearly between adjacent bins" << std::endl;
867 fout <<
" // this is not useful for discrete variables (or forced Spline0)" << std::endl;
868 fout <<
" int bin = int((x[itype] - fHistMin[ivar])/(fHistMax[ivar] - fHistMin[ivar])*fNbin[ivar]) + 0;" << std::endl;
870 fout <<
" // since the test data sample is in general different from the training sample" << std::endl;
871 fout <<
" // it can happen that the min/max of the training sample are trespassed --> correct this" << std::endl;
872 fout <<
" if (bin < 0) {" << std::endl;
873 fout <<
" bin = 0;" << std::endl;
874 fout <<
" x[itype] = fHistMin[ivar];" << std::endl;
875 fout <<
" }" << std::endl;
876 fout <<
" else if (bin >= fNbin[ivar]) {" << std::endl;
877 fout <<
" bin = fNbin[ivar]-1;" << std::endl;
878 fout <<
" x[itype] = fHistMax[ivar];" << std::endl;
879 fout <<
" }" << std::endl;
881 fout <<
" // find corresponding histogram from cached indices" << std::endl;
882 fout <<
" float ref = (itype == 0) ? fRefS[ivar][bin] : fRefB[ivar][bin];" << std::endl;
884 fout <<
" // sanity check" << std::endl;
885 fout <<
" if (ref < 0) {" << std::endl;
886 fout <<
" std::cout << \"Fatal error in " << className
887 <<
": bin entry < 0 ==> abort\" << std::endl;" << std::endl;
888 fout <<
" std::exit(1);" << std::endl;
889 fout <<
" }" << std::endl;
891 fout <<
" double p = ref;" << std::endl;
893 fout <<
" if (GetType(ivar) != 'I' && !fHasDiscretPDF[ivar]) {" << std::endl;
894 fout <<
" float bincenter = (bin + 0.5)/fNbin[ivar]*(fHistMax[ivar] - fHistMin[ivar]) + fHistMin[ivar];" << std::endl;
895 fout <<
" int nextbin = bin;" << std::endl;
896 fout <<
" if ((x[itype] > bincenter && bin != fNbin[ivar]-1) || bin == 0) " << std::endl;
897 fout <<
" nextbin++;" << std::endl;
898 fout <<
" else" << std::endl;
899 fout <<
" nextbin--; " << std::endl;
901 fout <<
" double refnext = (itype == 0) ? fRefS[ivar][nextbin] : fRefB[ivar][nextbin];" << std::endl;
902 fout <<
" float nextbincenter = (nextbin + 0.5)/fNbin[ivar]*(fHistMax[ivar] - fHistMin[ivar]) + fHistMin[ivar];" << std::endl;
904 fout <<
" double dx = bincenter - nextbincenter;" << std::endl;
905 fout <<
" double dy = ref - refnext;" << std::endl;
906 fout <<
" p += (x[itype] - bincenter) * dy/dx;" << std::endl;
907 fout <<
" }" << std::endl;
909 fout <<
" if (p < fEpsilon) p = fEpsilon; // avoid zero response" << std::endl;
911 fout <<
" if (itype == 0) ps *= p;" << std::endl;
912 fout <<
" else pb *= p;" << std::endl;
913 fout <<
" } " << std::endl;
914 fout <<
" } " << std::endl;
916 fout <<
" // the likelihood ratio (transform it ?)" << std::endl;
917 fout <<
" return TransformLikelihoodOutput( ps, pb ); " << std::endl;
918 fout <<
"}" << std::endl << std::endl;
920 fout <<
"inline double " << className <<
"::TransformLikelihoodOutput( double ps, double pb ) const" << std::endl;
921 fout <<
"{" << std::endl;
922 fout <<
" // returns transformed or non-transformed output" << std::endl;
923 fout <<
" if (ps < fEpsilon) ps = fEpsilon;" << std::endl;
924 fout <<
" if (pb < fEpsilon) pb = fEpsilon;" << std::endl;
925 fout <<
" double r = ps/(ps + pb);" << std::endl;
926 fout <<
" if (r >= 1.0) r = 1. - 1.e-15;" << std::endl;
929 fout <<
" // inverse Fermi function" << std::endl;
931 fout <<
" // sanity check" << std::endl;
932 fout <<
" if (r <= 0.0) r = fEpsilon;" << std::endl;
933 fout <<
" else if (r >= 1.0) r = 1. - 1.e-15;" << std::endl;
935 fout <<
" double tau = 15.0;" << std::endl;
936 fout <<
" r = - log(1.0/r - 1.0)/tau;" << std::endl;
937 fout <<
" }" << std::endl;
939 fout <<
" return r;" << std::endl;
940 fout <<
"}" << std::endl;
943 fout <<
"// Clean up" << std::endl;
944 fout <<
"inline void " << className <<
"::Clear() " << std::endl;
945 fout <<
"{" << std::endl;
946 fout <<
" // nothing to clear" << std::endl;
947 fout <<
"}" << std::endl << std::endl;
949 fout <<
"// signal map" << std::endl;
950 fout <<
"float " << className <<
"::fRefS[][" << nbinMax <<
"] = " << std::endl;
951 fout <<
"{ " << std::endl;
954 for (
Int_t ibin=1; ibin<=nbinMax; ibin++) {
955 if (ibin-1 < nbin[ivar])
956 fout << (*fPDFSig)[ivar]->GetPDFHist()->GetBinContent(ibin);
960 if (ibin < nbinMax) fout <<
", ";
962 fout <<
" }, " << std::endl;
964 fout <<
"}; " << std::endl;
967 fout <<
"// background map" << std::endl;
968 fout <<
"float " << className <<
"::fRefB[][" << nbinMax <<
"] = " << std::endl;
969 fout <<
"{ " << std::endl;
972 fout << std::setprecision(8);
973 for (
Int_t ibin=1; ibin<=nbinMax; ibin++) {
974 if (ibin-1 < nbin[ivar])
975 fout << (*fPDFBgd)[ivar]->GetPDFHist()->GetBinContent(ibin);
979 if (ibin < nbinMax) fout <<
", ";
981 fout <<
" }, " << std::endl;
983 fout <<
"}; " << std::endl;
985 fout << std::setprecision(dp);
1001 Log() <<
"The maximum-likelihood classifier models the data with probability " <<
Endl;
1002 Log() <<
"density functions (PDF) reproducing the signal and background" <<
Endl;
1003 Log() <<
"distributions of the input variables. Correlations among the " <<
Endl;
1004 Log() <<
"variables are ignored." <<
Endl;
1008 Log() <<
"Required for good performance are decorrelated input variables" <<
Endl;
1009 Log() <<
"(PCA transformation via the option \"VarTransform=Decorrelate\"" <<
Endl;
1010 Log() <<
"may be tried). Irreducible non-linear correlations may be reduced" <<
Endl;
1011 Log() <<
"by precombining strongly correlated input variables, or by simply" <<
Endl;
1012 Log() <<
"removing one of the variables." <<
Endl;
1016 Log() <<
"High fidelity PDF estimates are mandatory, i.e., sufficient training " <<
Endl;
1017 Log() <<
"statistics is required to populate the tails of the distributions" <<
Endl;
1018 Log() <<
"It would be a surprise if the default Spline or KDE kernel parameters" <<
Endl;
1019 Log() <<
"provide a satisfying fit to the data. The user is advised to properly" <<
Endl;
1020 Log() <<
"tune the events per bin and smooth options in the spline cases" <<
Endl;
1021 Log() <<
"individually per variable. If the KDE kernel is used, the adaptive" <<
Endl;
1022 Log() <<
"Gaussian kernel may lead to artefacts, so please always also try" <<
Endl;
1023 Log() <<
"the non-adaptive one." <<
Endl;
1025 Log() <<
"All tuning parameters must be adjusted individually for each input" <<
Endl;
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
void DeclareCompatibilityOptions()
options that are used ONLY for the READER to ensure backward compatibility they are hence without any...
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
UInt_t GetNVariables() const
void WriteWeightsToStream(TFile &rf) const
write reference PDFs to ROOT file
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
MsgLogger & Endl(MsgLogger &ml)
virtual void WriteOptionsToStream(std::ostream &o, const TString &prefix) const
write options to stream
void Train()
create reference distributions (PDFs) from signal and background events: fill histograms and smooth t...
const TString & GetOriginalVarName(Int_t ivar) const
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
virtual ~MethodLikelihood()
destructor
OptionBase * DeclareOptionRef(T &ref, const TString &name, const TString &desc="")
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
std::vector< TH1 * > * fHistSig
static Bool_t AddDirectoryStatus()
Static function: cannot be inlined on Windows/NT.
tomato 1-D histogram with a float per channel (see TH1 documentation)}
TransformationHandler & GetTransformationHandler(Bool_t takeReroutedIfAvailable=true)
Short_t Min(Short_t a, Short_t b)
std::vector< TString > * fInputVars
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
const TString & GetInputVar(Int_t i) const
void MakeClassSpecific(std::ostream &, const TString &) const
write specific classifier response
void ReadWeightsFromXML(void *wghtnode)
read weights from XML
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t tau
TString * fInterpolateString
UInt_t GetTrainingTMVAVersionCode() const
const Event * GetEvent() const
TString fBorderMethodString
virtual void ParseOptions()
options parser
Double_t GetXmin(Int_t ivar) const
DataSetInfo & DataInfo() const
void SetOptions(const TString &s)
std::vector< PDF * > * fPDFSig
Double_t GetWeight() const
return the event weight - depending on whether the flag IgnoreNegWeightsInTraining is or not...
Long64_t GetNTrainingEvents() const
std::vector< TH1 * > * fHistBgd_smooth
Double_t GetXmax(Int_t ivar) const
const char * GetName() const
Int_t * fAverageEvtPerBinVarS
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...
virtual TH1 * Rebin(Int_t ngroup=2, const char *newname="", const Double_t *xbins=0)
Rebin this histogram.
std::vector< TH1 * > * fHistSig_smooth
const Ranking * CreateRanking()
computes ranking of input variables
char * Form(const char *fmt,...)
const TString & GetMethodName() const
void WriteMonitoringHistosToFile() const
write histograms and PDFs to file for monitoring purposes
virtual const char * GetPath() const
Returns the full path of the directory.
Bool_t fTransformLikelihoodOutput
virtual Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)
FDA can handle classification with 2 classes.
Float_t GetValue(UInt_t ivar) const
return value of i'th variable
virtual void SetName(const char *name)
Change the name of this histogram.
void DeclareOptions()
define the options (their key words) that can be set in the option string know options: PDFInterpol[i...
Bool_t IgnoreEventsWithNegWeightsInTraining() const
void DeclareOptions()
define the options (their key words) that can be set in the option string TransformOutput <bool> tran...
std::vector< PDF * > * fPDFBgd
VariableInfo & GetVariableInfo(Int_t i)
virtual const char * GetName() const
Returns name of object.
void MakeClassSpecificHeader(std::ostream &, const TString &="") const
write specific header of the classifier (mostly include files)
const TString & GetOptions() const
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
void Init()
default initialisation called by all constructors
void ReadWeightsFromStream(std::istream &istr)
read weight info from file nothing to do for this method
#define REGISTER_METHOD(CLASS)
for example
Abstract ClassifierFactory template that handles arbitrary types.
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
TDirectory * BaseDir() const
returns the ROOT directory where info/histograms etc of the corresponding MVA method instance are sto...
virtual void AddRank(const Rank &rank)
Add a new rank take ownership of it.
virtual void DeclareCompatibilityOptions()
options that are used ONLY for the READER to ensure backward compatibility they are hence without any...
Short_t Max(Short_t a, Short_t b)
Double_t TransformLikelihoodOutput(Double_t ps, Double_t pb) const
returns transformed or non-transformed output
Long64_t GetNEvents(Types::ETreeType type=Types::kMaxTreeType) const
void GetHelpMessage() const
get help message text
std::vector< TH1 * > * fHistBgd
virtual void SetTitle(const char *title)
Change (i.e.
virtual Int_t GetNbinsX() const
virtual Int_t GetSize() const
MethodLikelihood(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="")
standard constructor
const Event * GetEvent() const
Int_t * fAverageEvtPerBinVarB
void NoErrorCalc(Double_t *const err, Double_t *const errUpper)
void SetSignalReferenceCut(Double_t cut)
void WriteOptionsToStream(std::ostream &o, const TString &prefix) const
write options to output stream (e.g. in writing the MVA weight files
virtual const char * GetTitle() const
Returns title of object.
Double_t GetMvaValue(Double_t *err=0, Double_t *errUpper=0)
returns the likelihood estimator for signal fill a new Likelihood branch into the testTree ...
void AddWeightsXMLTo(void *parent) const
write weights to XML
const char * Data() const