171 const TString& theWeightFile) :
320 DeclareOptionRef(
fFitMethodS =
"GA",
"FitMethod",
"Minimisation Method (GA, SA, and MC are the primary methods to be used; the others have been introduced for testing purposes and are depreciated)");
365 Log() << kWARNING <<
"Normalisation of the input variables for cut optimisation is not" <<
Endl;
366 Log() << kWARNING <<
"supported because this provides intransparent cut values, and no" <<
Endl;
367 Log() << kWARNING <<
"improvement in the performance of the algorithm." <<
Endl;
368 Log() << kWARNING <<
"Please remove \"Normalise\" option from booking option string" <<
Endl;
369 Log() << kWARNING <<
"==> Will reset normalisation flag to \"False\"" <<
Endl;
374 Log() << kFATAL <<
"Mechanism to ignore events with negative weights in training not yet available for method: "
376 <<
" --> Please remove \"IgnoreNegWeightsInTraining\" option from booking string."
386 Log() << kWARNING <<
"poor performance of MINUIT in MethodCuts; preferred fit method: GA" <<
Endl;
396 Log() << kINFO <<
Form(
"Use optimization method: \"%s\"",
401 Log() << kINFO <<
Form(
"Use efficiency computation method: \"%s\"",
417 Log() << kFATAL <<
"unknown value \'" <<
fAllVarsI[ivar]
418 <<
"\' for fit parameter option " <<
Form(
"VarProp[%i]",ivar) <<
Endl;
420 (*fFitParams)[ivar] = theFitP;
424 <<
"\" cuts for variable: " <<
"'" << (*fInputVars)[ivar] <<
"'" <<
Endl;
438 Log() << kFATAL <<
"<Eval_Cuts> fCutMin/Max have zero pointer. "
439 <<
"Did you book Cuts ?" <<
Endl;
448 if (ibin < 0 ) ibin = 0;
456 return passed ? 1. : 0. ;
466 std::vector<Double_t> cutsMin;
467 std::vector<Double_t> cutsMax;
473 std::vector<TString>* varVec = 0;
476 varVec =
new std::vector<TString>;
477 for (
UInt_t ivar=0; ivar<cutsMin.size(); ivar++) {
478 varVec->push_back(
DataInfo().GetVariableInfo(ivar).GetLabel() );
487 varVec =
new std::vector<TString>;
488 for (
UInt_t ivar=0; ivar<cutsMin.size(); ivar++) {
489 varVec->push_back(
DataInfo().GetVariableInfo(ivar).GetLabel() +
" [transformed]" );
494 for (
UInt_t ivar=0; ivar<cutsMin.size(); ivar++) {
495 if ((
UInt_t)(*varVec)[ivar].Length() > maxL) maxL = (*varVec)[ivar].Length();
497 UInt_t maxLine = 20+maxL+16;
499 for (
UInt_t i=0; i<maxLine; i++)
Log() <<
"-";
501 Log() << kHEADER <<
"Cut values for requested signal efficiency: " << trueEffS <<
Endl;
502 Log() << kINFO <<
"Corresponding background efficiency : " <<
fEffBvsSLocal->GetBinContent( ibin ) <<
Endl;
504 Log() << kINFO <<
"Transformation applied to input variables : \""
509 <<
" transformations applied in transformation chain; cuts applied on transformed quantities ] " <<
Endl;
512 Log() << kINFO <<
"Transformation applied to input variables : None" <<
Endl;
514 for (
UInt_t i=0; i<maxLine; i++)
Log() <<
"-";
516 for (
UInt_t ivar=0; ivar<cutsMin.size(); ivar++) {
518 <<
"Cut[" << std::setw(2) << ivar <<
"]: "
519 << std::setw(10) << cutsMin[ivar]
521 << std::setw(maxL) << (*varVec)[ivar]
523 << std::setw(10) << cutsMax[ivar] <<
Endl;
525 for (
UInt_t i=0; i<maxLine; i++)
Log() <<
"-";
537 std::vector<Double_t> cMin(
GetNvar() );
538 std::vector<Double_t> cMax(
GetNvar() );
541 cutMin[ivar] = cMin[ivar];
542 cutMax[ivar] = cMax[ivar];
551 std::vector<Double_t>& cutMin,
552 std::vector<Double_t>& cutMax )
const
561 if (ibin < 0 ) ibin = 0;
567 cutMin.push_back(
fCutMin[ivar][ibin] );
568 cutMax.push_back(
fCutMax[ivar][ibin] );
594 for (
UInt_t ivar =0; ivar <
Data()->GetNVariables(); ivar++) {
619 std::vector<TH1F*> signalDist, bkgDist;
637 std::vector<Interval*> ranges;
642 if (
DataInfo().GetVariableInfo(ivar).GetVarType() ==
'I') {
694 for (
UInt_t ivar=0; ivar<ranges.size(); ivar++)
delete ranges[ivar];
705 Int_t nsamples =
Int_t(0.5*nevents*(nevents - 1));
709 Log() << kINFO <<
"Running full event scan: " <<
Endl;
710 for (
Int_t ievt1=0; ievt1<nevents; ievt1++) {
711 for (
Int_t ievt2=ievt1+1; ievt2<nevents; ievt2++) {
726 Int_t nsamples = 200000;
728 DeclareOptionRef( nsamples,
"SampleSize",
"Number of Monte-Carlo-Event samples" );
729 DeclareOptionRef( seed,
"Seed",
"Seed for the random generator (0 takes random seeds)" );
742 Log() << kINFO <<
"Running Monte-Carlo-Event sampling over " << nsamples <<
" events" <<
Endl;
743 std::vector<Double_t> pars( 2*
GetNvar() );
745 for (
Int_t itoy=0; itoy<nsamples; itoy++) {
763 isSignal =
DataInfo().IsSignal(ev1);
767 isSignal &=
DataInfo().IsSignal(ev2);
770 if (nbreak++ > 10000) {
771 Log() << kFATAL <<
"<MCEvents>: could not find signal events"
772 <<
" after 10000 trials - do you have signal events in your sample ?"
779 if (evt1 > evt2) {
Double_t z = evt1; evt1 = evt2; evt2 = z; }
781 pars[2*ivar+1] = evt2 - evt1;
836 if (!
DataInfo().IsSignal(ev1))
return -1;
839 if (!
DataInfo().IsSignal(ev2))
return -1;
845 for (
Int_t ivar=0; ivar<nvar; ivar++) {
851 std::vector<Double_t> pars;
852 for (
Int_t ivar=0; ivar<nvar; ivar++) {
855 if (evt1[ivar] < evt2[ivar]) {
864 pars.push_back( cutMin );
865 pars.push_back( cutMax - cutMin );
927 Double_t average = 0.5*(effBH_left + effBH_right);
928 if (effBH < effB) average = effBH;
932 eta = ( -
TMath::Abs(effBH-average) + (1.0 - (effBH - effB))) / (1.0 + effS);
939 if (effBH < 0 || effBH > effB) {
961 penalty+=4.*diff*diff;
964 if (effS<1.e-4)
return 10.0+penalty;
965 else return 10.*(1.-10.*effS);
978 cutMin[ivar] = ((*fRangeSign)[ivar] > 0) ? pars[ipar] : pars[ipar] - pars[ipar+1];
979 cutMax[ivar] = ((*fRangeSign)[ivar] > 0) ? pars[ipar] + pars[ipar+1] : pars[ipar];
989 if (ibin < 1 || ibin >
fNbins)
Log() << kFATAL <<
"::MatchCutsToPars: bin error: "
995 for (
UInt_t ivar=0; ivar<nvar; ivar++) {
996 cutMin[ivar] = cutMinAll[ivar][ibin-1];
997 cutMax[ivar] = cutMaxAll[ivar][ibin-1];
1012 Int_t ipar = 2*ivar;
1013 pars[ipar] = ((*fRangeSign)[ivar] > 0) ? cutMin[ivar] : cutMax[ivar];
1014 pars[ipar+1] = cutMax[ivar] - cutMin[ivar];
1028 effS *= (*fVarPdfS)[ivar]->GetIntegral( cutMin[ivar], cutMax[ivar] );
1029 effB *= (*fVarPdfB)[ivar]->GetIntegral( cutMin[ivar], cutMax[ivar] );
1035 if( !
fNegEffWarning )
Log() << kWARNING <<
"Negative signal efficiency found and set to 0. This is probably due to many events with negative weights in a certain cut-region." <<
Endl;
1040 if( !
fNegEffWarning )
Log() << kWARNING <<
"Negative background efficiency found and set to 0. This is probably due to many events with negative weights in a certain cut-region." <<
Endl;
1068 if (nTotS == 0 && nTotB == 0) {
1069 Log() << kFATAL <<
"<GetEffsfromSelection> fatal error in zero total number of events:"
1070 <<
" nTotS, nTotB: " << nTotS <<
" " << nTotB <<
" ***" <<
Endl;
1077 Log() << kWARNING <<
"<ComputeEstimator> zero number of signal events" <<
Endl;
1079 else if (nTotB == 0) {
1082 Log() << kWARNING <<
"<ComputeEstimator> zero number of background events" <<
Endl;
1092 if( !
fNegEffWarning )
Log() << kWARNING <<
"Negative signal efficiency found and set to 0. This is probably due to many events with negative weights in a certain cut-region." <<
Endl;
1097 if( !
fNegEffWarning )
Log() << kWARNING <<
"Negative background efficiency found and set to 0. This is probably due to many events with negative weights in a certain cut-region." <<
Endl;
1120 for(
UInt_t ievt=0; ievt<
Data()->GetNEvents(); ievt++ ){
1123 if( val > minVal ) minVal = val;
1124 if( val < maxVal ) maxVal = val;
1130 TString histTitle = (*fInputVars)[ivar] +
" signal training";
1131 TString histName = (*fInputVars)[ivar] +
"_sig";
1142 (*fVarHistS)[ivar] =
new TH1F(histName.
Data(), histTitle.
Data(),
fNbins, minVal, maxVal );
1145 histTitle = (*fInputVars)[ivar] +
" background training";
1146 histName = (*fInputVars)[ivar] +
"_bgd";
1157 (*fVarHistB)[ivar] =
new TH1F(histName.
Data(), histTitle.
Data(),
fNbins, minVal, maxVal );
1159 for(
UInt_t ievt=0; ievt<
Data()->GetNEvents(); ievt++ ){
1163 (*fVarHistS)[ivar]->Fill( val );
1165 (*fVarHistB)[ivar]->Fill( val );
1172 (*fVarHistS_smooth)[ivar] = (
TH1F*)(*
fVarHistS)[ivar]->Clone();
1173 histTitle = (*fInputVars)[ivar] +
" signal training smoothed ";
1174 histTitle += nsmooth;
1175 histTitle +=
" times";
1176 histName = (*fInputVars)[ivar] +
"_sig_smooth";
1177 (*fVarHistS_smooth)[ivar]->SetName(histName);
1178 (*fVarHistS_smooth)[ivar]->SetTitle(histTitle);
1181 (*fVarHistS_smooth)[ivar]->Smooth(nsmooth);
1197 histTitle = (*fInputVars)[ivar]+
" background training smoothed ";
1198 histTitle += nsmooth;
1199 histTitle +=
" times";
1200 histName = (*fInputVars)[ivar]+
"_bgd_smooth";
1201 (*fVarHistB_smooth)[ivar]->SetName(histName);
1202 (*fVarHistB_smooth)[ivar]->SetTitle(histTitle);
1205 (*fVarHistB_smooth)[ivar]->Smooth(nsmooth);
1222 istr >> dummy >> dummy;
1227 istr >> dummy >> dummy >> dummy >> dummy >> dummy >> dummy >> dummyInt >> dummy ;
1231 Log() << kFATAL <<
"<ReadWeightsFromStream> fatal error: mismatch "
1232 <<
"in number of variables: " << dummyInt <<
" != " <<
Data()->GetNVariables() <<
Endl;
1238 Log() << kWARNING <<
"Read cuts optimised using sample of MC events" <<
Endl;
1241 Log() << kWARNING <<
"Read cuts optimised using sample of MC events" <<
Endl;
1244 Log() << kINFO <<
"Read cuts optimised using Genetic Algorithm" <<
Endl;
1247 Log() << kINFO <<
"Read cuts optimised using Simulated Annealing algorithm" <<
Endl;
1250 Log() << kINFO <<
"Read cuts optimised using Full Event Scan" <<
Endl;
1255 Log() << kINFO <<
"in " <<
fNbins <<
" signal efficiency bins and for " <<
GetNvar() <<
" variables" <<
Endl;
1259 istr.getline(buffer,200);
1260 istr.getline(buffer,200);
1270 istr >> tmpbin >> tmpeffS >> tmpeffB;
1289 std::vector<Double_t> cutsMin;
1290 std::vector<Double_t> cutsMax;
1296 gTools().
AddComment( wght,
TString::Format(
"Below are the optimised cuts for %i variables: Format: ibin(hist) effS effB cutMin[ivar=0] cutMax[ivar=0] ... cutMin[ivar=n-1] cutMax[ivar=n-1]",
GetNvar() ) );
1336 Int_t tmpEffMethod, tmpFitMethod;
1337 gTools().
ReadAttr( wghtnode,
"OptimisationMethod", tmpEffMethod );
1346 Log() << kINFO <<
"Read cuts optimised using sample of MC events" <<
Endl;
1349 Log() << kINFO <<
"Read cuts optimised using sample of MC-Event events" <<
Endl;
1352 Log() << kINFO <<
"Read cuts optimised using Genetic Algorithm" <<
Endl;
1355 Log() << kINFO <<
"Read cuts optimised using Simulated Annealing algorithm" <<
Endl;
1358 Log() << kINFO <<
"Read cuts optimised using Full Event Scan" <<
Endl;
1363 Log() << kINFO <<
"Reading " <<
fNbins <<
" signal efficiency bins for " <<
GetNvar() <<
" variables" <<
Endl;
1393 if (tmpbin-1 >=
fNbins || tmpbin-1 < 0) {
1394 Log() << kFATAL <<
"Mismatch in bins: " << tmpbin-1 <<
" >= " <<
fNbins <<
Endl;
1412 Log() << kINFO <<
"Write monitoring histograms to file: " <<
BaseDir()->GetPath() <<
Endl;
1419 (*fVarHistS)[ivar]->Write();
1420 (*fVarHistB)[ivar]->Write();
1421 (*fVarHistS_smooth)[ivar]->Write();
1422 (*fVarHistB_smooth)[ivar]->Write();
1423 (*fVarPdfS)[ivar]->GetPDFHist()->Write();
1424 (*fVarPdfB)[ivar]->GetPDFHist()->Write();
1446 if (list->GetSize() != 2) {
1447 Log() << kFATAL <<
"<GetTrainingEfficiency> wrong number of arguments"
1448 <<
" in string: " << theString
1449 <<
" | required format, e.g., Efficiency:0.05" <<
Endl;
1462 if (results->
GetHist(
"EFF_BVSS_TR")==0) {
1482 results->
Store(eff_bvss_tr,
"EFF_BVSS_TR");
1483 results->
Store(rej_bvss_tr,
"REJ_BVSS_TR");
1490 Int_t nFailedBins=0;
1493 tmpCutMin[ivar] =
fCutMin[ivar][bini-1];
1494 tmpCutMax[ivar] =
fCutMax[ivar][bini-1];
1501 if (effBin != bini){
1502 Log()<< kVERBOSE <<
"unable to fill efficiency bin " << bini<<
" " << effBin <<
Endl;
1511 if (nFailedBins>0)
Log()<< kWARNING <<
" unable to fill "<< nFailedBins <<
" efficiency bins " <<
Endl;
1513 delete [] tmpCutMin;
1514 delete [] tmpCutMax;
1524 Double_t effS = 0., effB, effS_ = 0., effB_ = 0.;
1525 Int_t nbins_ = 1000;
1528 for (
Int_t bini=1; bini<=nbins_; bini++) {
1530 effS = (bini - 0.5)/
Float_t(nbins_);
1534 if ((effB - effBref)*(effB_ - effBref) < 0)
break;
1539 return 0.5*(effS + effS_);
1556 Data()->SetCurrentType(type);
1563 if (list->GetSize() > 2) {
1565 Log() << kFATAL <<
"<GetEfficiency> wrong number of arguments"
1566 <<
" in string: " << theString
1567 <<
" | required format, e.g., Efficiency:0.05, or empty string" <<
Endl;
1572 Bool_t computeArea = (list->GetSize() < 2);
1576 Float_t effBref = (computeArea?1.:atof( ((
TObjString*)list->At(1))->GetString() ));
1582 if (results->
GetHist(
"MVA_EFF_BvsS")==0) {
1606 results->
Store(eff_BvsS,
"MVA_EFF_BvsS");
1607 results->
Store(rej_BvsS);
1616 results->
Store(eff_s,
"MVA_S");
1617 results->
Store(eff_b,
"MVA_B");
1629 tmpCutMin[ivar] =
fCutMin[ivar][bini-1];
1630 tmpCutMax[ivar] =
fCutMax[ivar][bini-1];
1635 tmpBvsS->
SetPoint(bini, effS, effB);
1642 delete [] tmpCutMin;
1643 delete [] tmpCutMax;
1659 Double_t effS = 0, effB = 0, effS_ = 0, effB_ = 0;
1660 Int_t nbins_ = 1000;
1666 for (
Int_t bini=1; bini<=nbins_; bini++) {
1669 effS = (bini - 0.5)/
Float_t(nbins_);
1671 integral += (1.0 - effB);
1680 for (
Int_t bini=1; bini<=nbins_; bini++) {
1682 effS = (bini - 0.5)/
Float_t(nbins_);
1686 if ((effB - effBref)*(effB_ - effBref) < 0)
break;
1691 effS = 0.5*(effS + effS_);
1693 if (
Data()->GetNEvtSigTest() > 0)
1708 fout <<
" // not implemented for class: \"" << className <<
"\"" << std::endl;
1709 fout <<
"};" << std::endl;
1727 Log() <<
"The optimisation of rectangular cuts performed by TMVA maximises " <<
Endl;
1728 Log() <<
"the background rejection at given signal efficiency, and scans " <<
Endl;
1729 Log() <<
"over the full range of the latter quantity. Three optimisation" <<
Endl;
1730 Log() <<
"methods are optional: Monte Carlo sampling (MC), a Genetics" <<
Endl;
1731 Log() <<
"Algorithm (GA), and Simulated Annealing (SA). GA and SA are" <<
Endl;
1732 Log() <<
"expected to perform best." <<
Endl;
1734 Log() <<
"The difficulty to find the optimal cuts strongly increases with" <<
Endl;
1735 Log() <<
"the dimensionality (number of input variables) of the problem." <<
Endl;
1736 Log() <<
"This behavior is due to the non-uniqueness of the solution space."<<
Endl;
1740 Log() <<
"If the dimensionality exceeds, say, 4 input variables, it is " <<
Endl;
1741 Log() <<
"advisable to scrutinize the separation power of the variables," <<
Endl;
1742 Log() <<
"and to remove the weakest ones. If some among the input variables" <<
Endl;
1743 Log() <<
"can be described by a single cut (e.g., because signal tends to be" <<
Endl;
1744 Log() <<
"larger than background), this can be indicated to MethodCuts via" <<
Endl;
1745 Log() <<
"the \"Fsmart\" options (see option string). Choosing this option" <<
Endl;
1746 Log() <<
"reduces the number of requirements for the variable from 2 (min/max)" <<
Endl;
1747 Log() <<
"to a single one (TMVA finds out whether it is to be interpreted as" <<
Endl;
1748 Log() <<
"min or max)." <<
Endl;
1752 Log() << bold <<
"Monte Carlo sampling:" << resbold <<
Endl;
1754 Log() <<
"Apart form the \"Fsmart\" option for the variables, the only way" <<
Endl;
1755 Log() <<
"to improve the MC sampling is to increase the sampling rate. This" <<
Endl;
1756 Log() <<
"is done via the configuration option \"MC_NRandCuts\". The execution" <<
Endl;
1757 Log() <<
"time scales linearly with the sampling rate." <<
Endl;
1759 Log() << bold <<
"Genetic Algorithm:" << resbold <<
Endl;
1761 Log() <<
"The algorithm terminates if no significant fitness increase has" <<
Endl;
1762 Log() <<
"been achieved within the last \"nsteps\" steps of the calculation." <<
Endl;
1763 Log() <<
"Wiggles in the ROC curve or constant background rejection of 1" <<
Endl;
1764 Log() <<
"indicate that the GA failed to always converge at the true maximum" <<
Endl;
1765 Log() <<
"fitness. In such a case, it is recommended to broaden the search " <<
Endl;
1766 Log() <<
"by increasing the population size (\"popSize\") and to give the GA " <<
Endl;
1767 Log() <<
"more time to find improvements by increasing the number of steps" <<
Endl;
1768 Log() <<
"(\"nsteps\")" <<
Endl;
1769 Log() <<
" -> increase \"popSize\" (at least >10 * number of variables)" <<
Endl;
1770 Log() <<
" -> increase \"nsteps\"" <<
Endl;
1772 Log() << bold <<
"Simulated Annealing (SA) algorithm:" << resbold <<
Endl;
1774 Log() <<
"\"Increasing Adaptive\" approach:" <<
Endl;
1776 Log() <<
"The algorithm seeks local minima and explores their neighborhoods, while" <<
Endl;
1777 Log() <<
"changing the ambient temperature depending on the number of failures" <<
Endl;
1778 Log() <<
"in the previous steps. The performance can be improved by increasing" <<
Endl;
1779 Log() <<
"the number of iteration steps (\"MaxCalls\"), or by adjusting the" <<
Endl;
1780 Log() <<
"minimal temperature (\"MinTemperature\"). Manual adjustments of the" <<
Endl;
1781 Log() <<
"speed of the temperature increase (\"TemperatureScale\" and \"AdaptiveSpeed\")" <<
Endl;
1782 Log() <<
"to individual data sets should also help. Summary:" << brk <<
Endl;
1783 Log() <<
" -> increase \"MaxCalls\"" << brk <<
Endl;
1784 Log() <<
" -> adjust \"MinTemperature\"" << brk <<
Endl;
1785 Log() <<
" -> adjust \"TemperatureScale\"" << brk <<
Endl;
1786 Log() <<
" -> adjust \"AdaptiveSpeed\"" <<
Endl;
1788 Log() <<
"\"Decreasing Adaptive\" approach:" <<
Endl;
1790 Log() <<
"The algorithm calculates the initial temperature (based on the effect-" <<
Endl;
1791 Log() <<
"iveness of large steps) and the multiplier that ensures to reach the" <<
Endl;
1792 Log() <<
"minimal temperature with the requested number of iteration steps." <<
Endl;
1793 Log() <<
"The performance can be improved by adjusting the minimal temperature" <<
Endl;
1794 Log() <<
" (\"MinTemperature\") and by increasing number of steps (\"MaxCalls\"):" << brk <<
Endl;
1795 Log() <<
" -> increase \"MaxCalls\"" << brk <<
Endl;
1796 Log() <<
" -> adjust \"MinTemperature\"" <<
Endl;
1798 Log() <<
"Other kernels:" <<
Endl;
1800 Log() <<
"Alternative ways of counting the temperature change are implemented. " <<
Endl;
1801 Log() <<
"Each of them starts with the maximum temperature (\"MaxTemperature\")" <<
Endl;
1802 Log() <<
"and decreases while changing the temperature according to a given" <<
Endl;
1803 Log() <<
"prescription:" << brk <<
Endl;
1804 Log() <<
"CurrentTemperature =" << brk <<
Endl;
1805 Log() <<
" - Sqrt: InitialTemperature / Sqrt(StepNumber+2) * TemperatureScale" << brk <<
Endl;
1806 Log() <<
" - Log: InitialTemperature / Log(StepNumber+2) * TemperatureScale" << brk <<
Endl;
1807 Log() <<
" - Homo: InitialTemperature / (StepNumber+2) * TemperatureScale" << brk <<
Endl;
1808 Log() <<
" - Sin: (Sin(StepNumber / TemperatureScale) + 1) / (StepNumber + 1)*InitialTemperature + Eps" << brk <<
Endl;
1809 Log() <<
" - Geo: CurrentTemperature * TemperatureScale" <<
Endl;
1811 Log() <<
"Their performance can be improved by adjusting initial temperature" <<
Endl;
1812 Log() <<
"(\"InitialTemperature\"), the number of iteration steps (\"MaxCalls\")," <<
Endl;
1813 Log() <<
"and the multiplier that scales the temperature decrease" <<
Endl;
1814 Log() <<
"(\"TemperatureScale\")" << brk <<
Endl;
1815 Log() <<
" -> increase \"MaxCalls\"" << brk <<
Endl;
1816 Log() <<
" -> adjust \"InitialTemperature\"" << brk <<
Endl;
1817 Log() <<
" -> adjust \"TemperatureScale\"" << brk <<
Endl;
1818 Log() <<
" -> adjust \"KernelTemperature\"" <<
Endl;
#define REGISTER_METHOD(CLASS)
for example
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
1-D histogram with a float per channel (see TH1 documentation)
TH1 is the base class of all histogram classes in ROOT.
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...
A simple Binary search tree including a volume search method.
Bool_t WriteOptionsReference() const
OptionBase * DeclareOptionRef(T &ref, const TString &name, const TString &desc="")
void AddPreDefVal(const T &)
virtual void ParseOptions()
options parser
const TString & GetOptions() const
void CheckForUnusedOptions() const
checks for unused options in option string
Class that contains all the data information.
Float_t GetValue(UInt_t ivar) const
return value of i'th variable
Base class for TMVA fitters.
void SetIPythonInteractive(bool *ExitFromTraining, UInt_t *fIPyMaxIter_, UInt_t *fIPyCurrentIter_)
Double_t Run()
estimator function interface for fitting
Fitter using a Genetic Algorithm.
The TMVA::Interval Class.
Fitter using Monte Carlo sampling of parameters.
MethodBase(const TString &jobName, Types::EMVA methodType, const TString &methodTitle, DataSetInfo &dsi, const TString &theOption="")
standard constructor
const char * GetName() const override
TString GetMethodTypeName() const
TSpline * fSplTrainEffBvsS
splines for training signal eff. versus background eff.
Types::EAnalysisType GetAnalysisType() const
const TString & GetInputVar(Int_t i) const
Bool_t IgnoreEventsWithNegWeightsInTraining() const
const TString & GetTestvarName() const
const std::vector< TMVA::Event * > & GetEventCollection(Types::ETreeType type)
returns the event collection (i.e.
TDirectory * BaseDir() const
returns the ROOT directory where info/histograms etc of the corresponding MVA method instance are sto...
TSpline * fSpleffBvsS
splines for signal eff. versus background eff.
const TString & GetMethodName() const
const Event * GetEvent() const
DataSetInfo & DataInfo() const
UInt_t GetNVariables() const
void SetNormalised(Bool_t norm)
TransformationHandler & GetTransformationHandler(Bool_t takeReroutedIfAvailable=true)
void NoErrorCalc(Double_t *const err, Double_t *const errUpper)
Bool_t IsNormalised() const
IPythonInteractive * fInteractive
TRandom * fRandom
random generator for MC optimisation method
Double_t EstimatorFunction(std::vector< Double_t > &) override
returns estimator for "cut fitness" used by GA
Double_t fEffRef
reference efficiency
TString fFitMethodS
chosen fit method (string)
Double_t ComputeEstimator(std::vector< Double_t > &)
returns estimator for "cut fitness" used by GA.
void MakeClassSpecific(std::ostream &, const TString &) const override
write specific classifier response
BinarySearchTree * fBinaryTreeS
void AddWeightsXMLTo(void *parent) const override
create XML description for LD classification and regression (for arbitrary number of output classes/t...
std::vector< Int_t > * fRangeSign
used to match cuts to fit parameters (and vice versa)
Int_t fNpar
number of parameters in fit (default: 2*Nvar)
TString fEffMethodS
chosen efficiency calculation method (string)
EFitMethodType fFitMethod
chosen fit method
Bool_t fNegEffWarning
flag risen in case of negative efficiency warning
void DeclareOptions() override
define the options (their key words) that can be set in the option string.
void Train(void) override
training method: here the cuts are optimised for the training sample
Double_t fEffSMin
used to test optimized signal efficiency
Double_t * fCutRangeMax
maximum of allowed cut range
void MatchCutsToPars(std::vector< Double_t > &, Double_t *, Double_t *)
translates cuts into parameters
Double_t GetTrainingEfficiency(const TString &) override
Overloaded function to create background efficiency (rejection) versus signal efficiency plot (first ...
void ProcessOptions() override
process user options.
static const Double_t fgMaxAbsCutVal
std::vector< TH1 * > * fVarHistB
reference histograms (background)
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets) override
Cuts can only handle classification with 2 classes.
void CreateVariablePDFs(void)
for PDF method: create efficiency reference histograms and PDFs
std::vector< PDF * > * fVarPdfB
reference PDFs (background)
EEffMethod fEffMethod
chosen efficiency calculation method
Double_t * fTmpCutMin
temporary minimum requirement
Double_t ** fCutMin
minimum requirement
void ReadWeightsFromStream(std::istream &i) override
read the cuts from stream
std::vector< TH1 * > * fVarHistS
reference histograms (signal)
std::vector< Double_t > * fRmsB
RMSs of variables (background).
Double_t fEffSMax
used to test optimized signal efficiency
std::vector< TH1 * > * fVarHistB_smooth
smoothed reference histograms (background)
std::vector< PDF * > * fVarPdfS
reference PDFs (signal)
void GetEffsfromSelection(Double_t *cutMin, Double_t *cutMax, Double_t &effS, Double_t &effB)
compute signal and background efficiencies from event counting for given cut sample
void TestClassification() override
nothing to test
void WriteMonitoringHistosToFile(void) const override
write histograms and PDFs to file for monitoring purposes
void MatchParsToCuts(const std::vector< Double_t > &, Double_t *, Double_t *)
translates parameters into cuts
virtual ~MethodCuts(void)
destructor
Double_t * fCutRangeMin
minimum of allowed cut range
BinarySearchTree * fBinaryTreeB
std::vector< Double_t > * fRmsS
RMSs of variables (signal).
std::vector< Double_t > * fMeanS
means of variables (signal)
std::vector< Double_t > * fMeanB
means of variables (background)
TString * fAllVarsI
what to do with variables
Double_t GetEfficiency(const TString &, Types::ETreeType, Double_t &) override
Overloaded function to create background efficiency (rejection) versus signal efficiency plot (first ...
std::vector< EFitParameters > * fFitParams
vector for series of fit methods
Double_t fTestSignalEff
used to test optimized signal efficiency
std::vector< Interval * > fCutRange
allowed ranges for cut optimisation
Double_t * fTmpCutMax
temporary maximum requirement
std::vector< TH1 * > * fVarHistS_smooth
smoothed reference histograms (signal)
void Init(void) override
default initialisation called by all constructors
Double_t ** fCutMax
maximum requirement
TH1 * fEffBvsSLocal
intermediate eff. background versus eff signal histo
Double_t GetMvaValue(Double_t *err=nullptr, Double_t *errUpper=nullptr) override
cut evaluation: returns 1.0 if event passed, 0.0 otherwise
void ReadWeightsFromXML(void *wghtnode) override
read coefficients from xml weight file
void GetHelpMessage() const override
get help message text
void GetEffsfromPDFs(Double_t *cutMin, Double_t *cutMax, Double_t &effS, Double_t &effB)
compute signal and background efficiencies from PDFs for given cut sample
Double_t GetCuts(Double_t effS, std::vector< Double_t > &cutMin, std::vector< Double_t > &cutMax) const
retrieve cut values for given signal efficiency
void PrintCuts(Double_t effS) const
print cuts
PDF wrapper for histograms; uses user-defined spline interpolation.
Class that is the base-class for a vector of result.
void Store(TObject *obj, const char *alias=nullptr)
TH1 * GetHist(const TString &alias) const
Fitter using a Simulated Annealing Algorithm.
Linear interpolation of TGraph.
Timing information for training and evaluation of MVA methods.
void DrawProgressBar(Int_t, const TString &comment="")
draws progress bar in color or B&W caution:
Singleton class for Global types used by TMVA.
@ kSignal
Never change this number - it is elsewhere assumed to be zero !
Volume for BinarySearchTree.
Collectable string class.
Random number generator class based on M.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Clone(Ssiz_t nc)
Make self a distinct copy with capacity of at least tot, where tot cannot be smaller than the current...
MsgLogger & Endl(MsgLogger &ml)
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.