97 #include "TDirectory.h" 124 const
Double_t TMVA::MethodCuts::fgMaxAbsCutVal = 1.0e30;
134 MethodBase( jobName,
Types::kCuts, methodTitle, theData, theOption, theTargetDir ),
135 fFitMethod ( kUseGeneticAlgorithm ),
136 fEffMethod ( kUseEventSelection ),
161 fVarHistS_smooth( 0 ),
162 fVarHistB_smooth( 0 ),
176 fFitMethod ( kUseGeneticAlgorithm ),
177 fEffMethod ( kUseEventSelection ),
202 fVarHistS_smooth( 0 ),
203 fVarHistB_smooth( 0 ),
322 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)");
366 Log() <<
kWARNING <<
"Normalisation of the input variables for cut optimisation is not" <<
Endl;
367 Log() <<
kWARNING <<
"supported because this provides intransparent cut values, and no" <<
Endl;
368 Log() <<
kWARNING <<
"improvement in the performance of the algorithm." <<
Endl;
369 Log() <<
kWARNING <<
"Please remove \"Normalise\" option from booking option string" <<
Endl;
370 Log() <<
kWARNING <<
"==> Will reset normalisation flag to \"False\"" <<
Endl;
375 Log() <<
kFATAL <<
"Mechanism to ignore events with negative weights in training not yet available for method: " 377 <<
" --> Please remove \"IgnoreNegWeightsInTraining\" option from booking string." 387 Log() <<
kWARNING <<
"poor performance of MINUIT in MethodCuts; preferred fit method: GA" <<
Endl;
397 Log() <<
kINFO <<
Form(
"Use optimization method: \"%s\"",
402 Log() <<
kINFO <<
Form(
"Use efficiency computation method: \"%s\"",
419 <<
"\' for fit parameter option " <<
Form(
"VarProp[%i]",ivar) <<
Endl;
421 (*fFitParams)[ivar] = theFitP;
425 <<
"\" cuts for variable: " <<
"'" << (*fInputVars)[ivar] <<
"'" <<
Endl;
439 Log() <<
kFATAL <<
"<Eval_Cuts> fCutMin/Max have zero pointer. " 440 <<
"Did you book Cuts ?" <<
Endl;
449 if (ibin < 0 ) ibin = 0;
457 return passed ? 1. : 0. ;
467 std::vector<Double_t> cutsMin;
468 std::vector<Double_t> cutsMax;
474 std::vector<TString>* varVec = 0;
477 varVec =
new std::vector<TString>;
478 for (
UInt_t ivar=0; ivar<cutsMin.size(); ivar++) {
479 varVec->push_back(
DataInfo().GetVariableInfo(ivar).GetLabel() );
488 varVec =
new std::vector<TString>;
489 for (
UInt_t ivar=0; ivar<cutsMin.size(); ivar++) {
490 varVec->push_back(
DataInfo().GetVariableInfo(ivar).GetLabel() +
" [transformed]" );
495 for (
UInt_t ivar=0; ivar<cutsMin.size(); ivar++) {
496 if ((
UInt_t)(*varVec)[ivar].Length() > maxL) maxL = (*varVec)[ivar].Length();
498 UInt_t maxLine = 20+maxL+16;
500 for (
UInt_t i=0; i<maxLine; i++)
Log() <<
"-";
502 Log() <<
kINFO <<
"Cut values for requested signal efficiency: " << trueEffS <<
Endl;
505 Log() <<
kINFO <<
"Transformation applied to input variables : \"" 510 <<
" transformations applied in transformation chain; cuts applied on transformed quantities ] " <<
Endl;
513 Log() <<
kINFO <<
"Transformation applied to input variables : None" <<
Endl;
515 for (
UInt_t i=0; i<maxLine; i++)
Log() <<
"-";
517 for (
UInt_t ivar=0; ivar<cutsMin.size(); ivar++) {
519 <<
"Cut[" << std::setw(2) << ivar <<
"]: " 520 << std::setw(10) << cutsMin[ivar]
522 << std::setw(maxL) << (*varVec)[ivar]
524 << std::setw(10) << cutsMax[ivar] <<
Endl;
526 for (
UInt_t i=0; i<maxLine; i++)
Log() <<
"-";
538 std::vector<Double_t> cMin(
GetNvar() );
539 std::vector<Double_t> cMax(
GetNvar() );
542 cutMin[ivar] = cMin[ivar];
543 cutMax[ivar] = cMax[ivar];
552 std::vector<Double_t>& cutMin,
553 std::vector<Double_t>& cutMax )
const 562 if (ibin < 0 ) ibin = 0;
568 cutMin.push_back(
fCutMin[ivar][ibin] );
569 cutMax.push_back(
fCutMax[ivar][ibin] );
620 std::vector<TH1F*> signalDist, bkgDist;
638 std::vector<Interval*> ranges;
693 for (
UInt_t ivar=0; ivar<ranges.size(); ivar++)
delete ranges[ivar];
704 Int_t nsamples =
Int_t(0.5*nevents*(nevents - 1));
708 for (
Int_t ievt1=0; ievt1<nevents; ievt1++) {
709 for (
Int_t ievt2=ievt1+1; ievt2<nevents; ievt2++) {
722 Int_t nsamples = 200000;
724 DeclareOptionRef( nsamples,
"SampleSize",
"Number of Monte-Carlo-Event samples" );
725 DeclareOptionRef( seed,
"Seed",
"Seed for the random generator (0 takes random seeds)" );
737 Log() <<
kINFO <<
"Running Monte-Carlo-Event sampling over " << nsamples <<
" events" <<
Endl;
738 std::vector<Double_t> pars( 2*
GetNvar() );
740 for (
Int_t itoy=0; itoy<nsamples; itoy++) {
757 evt1 = ev1->GetValue( ivar );
763 if (nbreak++ > 10000)
Log() <<
kFATAL <<
"<MCEvents>: could not find signal events" 764 <<
" after 10000 trials - do you have signal events in your sample ?" 770 if (evt1 > evt2) {
Double_t z = evt1; evt1 = evt2; evt2 = z; }
772 pars[2*ivar+1] = evt2 - evt1;
824 if (!
DataInfo().IsSignal(ev1))
return -1;
827 if (!
DataInfo().IsSignal(ev2))
return -1;
833 for (
Int_t ivar=0; ivar<nvar; ivar++) {
839 std::vector<Double_t> pars;
840 for (
Int_t ivar=0; ivar<nvar; ivar++) {
843 if (evt1[ivar] < evt2[ivar]) {
852 pars.push_back( cutMin );
853 pars.push_back( cutMax - cutMin );
913 Double_t average = 0.5*(effBH_left + effBH_right);
914 if (effBH < effB) average = effBH;
918 eta = ( -
TMath::Abs(effBH-average) + (1.0 - (effBH - effB))) / (1.0 + effS);
925 if (effBH < 0 || effBH > effB) {
947 penalty+=4.*diff*diff;
950 if (effS<1.e-4)
return 10.0+penalty;
951 else return 10.*(1.-10.*effS);
964 cutMin[ivar] = ((*fRangeSign)[ivar] > 0) ? pars[ipar] : pars[ipar] - pars[ipar+1];
965 cutMax[ivar] = ((*fRangeSign)[ivar] > 0) ? pars[ipar] + pars[ipar+1] : pars[ipar];
975 if (ibin < 1 || ibin >
fNbins)
Log() <<
kFATAL <<
"::MatchCutsToPars: bin error: " 981 for (
UInt_t ivar=0; ivar<nvar; ivar++) {
982 cutMin[ivar] = cutMinAll[ivar][ibin-1];
983 cutMax[ivar] = cutMaxAll[ivar][ibin-1];
999 pars[ipar] = ((*fRangeSign)[ivar] > 0) ? cutMin[ivar] : cutMax[ivar];
1000 pars[ipar+1] = cutMax[ivar] - cutMin[ivar];
1014 effS *= (*fVarPdfS)[ivar]->GetIntegral( cutMin[ivar], cutMax[ivar] );
1015 effB *= (*fVarPdfB)[ivar]->GetIntegral( cutMin[ivar], cutMax[ivar] );
1021 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;
1026 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;
1054 if (nTotS == 0 && nTotB == 0) {
1055 Log() <<
kFATAL <<
"<GetEffsfromSelection> fatal error in zero total number of events:" 1056 <<
" nTotS, nTotB: " << nTotS <<
" " << nTotB <<
" ***" <<
Endl;
1063 Log() <<
kWARNING <<
"<ComputeEstimator> zero number of signal events" <<
Endl;
1065 else if (nTotB == 0) {
1068 Log() <<
kWARNING <<
"<ComputeEstimator> zero number of background events" <<
Endl;
1078 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;
1083 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;
1109 if( val > minVal ) minVal = val;
1110 if( val < maxVal ) maxVal = val;
1116 TString histTitle = (*fInputVars)[ivar] +
" signal training";
1117 TString histName = (*fInputVars)[ivar] +
"_sig";
1128 (*fVarHistS)[ivar] =
new TH1F(histName.
Data(), histTitle.
Data(),
fNbins, minVal, maxVal );
1131 histTitle = (*fInputVars)[ivar] +
" background training";
1132 histName = (*fInputVars)[ivar] +
"_bgd";
1143 (*fVarHistB)[ivar] =
new TH1F(histName.
Data(), histTitle.Data(),
fNbins, minVal, maxVal );
1149 (*fVarHistS)[ivar]->Fill( val );
1151 (*fVarHistB)[ivar]->Fill( val );
1158 (*fVarHistS_smooth)[ivar] = (
TH1F*)(*
fVarHistS)[ivar]->Clone();
1159 histTitle = (*fInputVars)[ivar] +
" signal training smoothed ";
1160 histTitle += nsmooth;
1161 histTitle +=
" times";
1162 histName = (*fInputVars)[ivar] +
"_sig_smooth";
1163 (*fVarHistS_smooth)[ivar]->SetName(histName);
1164 (*fVarHistS_smooth)[ivar]->SetTitle(histTitle);
1167 (*fVarHistS_smooth)[ivar]->Smooth(nsmooth);
1182 (*fVarHistB_smooth)[ivar] = (
TH1F*)(*fVarHistB)[ivar]->
Clone();
1183 histTitle = (*fInputVars)[ivar]+
" background training smoothed ";
1184 histTitle += nsmooth;
1185 histTitle +=
" times";
1186 histName = (*fInputVars)[ivar]+
"_bgd_smooth";
1187 (*fVarHistB_smooth)[ivar]->SetName(histName);
1188 (*fVarHistB_smooth)[ivar]->SetTitle(histTitle);
1191 (*fVarHistB_smooth)[ivar]->Smooth(nsmooth);
1208 istr >> dummy >>
dummy;
1213 istr >> dummy >> dummy >> dummy >> dummy >> dummy >> dummy >> dummyInt >>
dummy ;
1217 Log() <<
kFATAL <<
"<ReadWeightsFromStream> fatal error: mismatch " 1224 Log() <<
kINFO <<
"Read cuts optimised using sample of MC events" <<
Endl;
1227 Log() <<
kINFO <<
"Read cuts optimised using sample of MC events" <<
Endl;
1230 Log() <<
kINFO <<
"Read cuts optimised using Genetic Algorithm" <<
Endl;
1233 Log() <<
kINFO <<
"Read cuts optimised using Simulated Annealing algorithm" <<
Endl;
1236 Log() <<
kINFO <<
"Read cuts optimised using Full Event Scan" <<
Endl;
1241 Log() <<
kINFO <<
"in " << fNbins <<
" signal efficiency bins and for " <<
GetNvar() <<
" variables" <<
Endl;
1245 istr.getline(buffer,200);
1246 istr.getline(buffer,200);
1252 TString(
GetName()) +
" efficiency of B vs S", fNbins, 0.0, 1.0 );
1256 istr >> tmpbin >> tmpeffS >> tmpeffB;
1275 std::vector<Double_t> cutsMin;
1276 std::vector<Double_t> cutsMax;
1282 gTools().
AddComment( wght,
Form(
"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() ) );
1295 if (
TMath::Abs(trueEffS) < 1e-10) trueEffS = 0;
1322 Int_t tmpEffMethod, tmpFitMethod;
1323 gTools().
ReadAttr( wghtnode,
"OptimisationMethod", tmpEffMethod );
1332 Log() <<
kINFO <<
"Read cuts optimised using sample of MC events" <<
Endl;
1335 Log() <<
kINFO <<
"Read cuts optimised using sample of MC-Event events" <<
Endl;
1338 Log() <<
kINFO <<
"Read cuts optimised using Genetic Algorithm" <<
Endl;
1341 Log() <<
kINFO <<
"Read cuts optimised using Simulated Annealing algorithm" <<
Endl;
1344 Log() <<
kINFO <<
"Read cuts optimised using Full Event Scan" <<
Endl;
1379 if (tmpbin-1 >=
fNbins || tmpbin-1 < 0) {
1405 (*fVarHistS)[ivar]->Write();
1406 (*fVarHistB)[ivar]->Write();
1407 (*fVarHistS_smooth)[ivar]->Write();
1408 (*fVarHistB_smooth)[ivar]->Write();
1409 (*fVarPdfS)[ivar]->GetPDFHist()->Write();
1410 (*fVarPdfB)[ivar]->GetPDFHist()->Write();
1432 Log() <<
kFATAL <<
"<GetTrainingEfficiency> wrong number of arguments" 1433 <<
" in string: " << theString
1434 <<
" | required format, e.g., Efficiency:0.05" <<
Endl;
1447 if (results->
GetHist(
"EFF_BVSS_TR")==0) {
1467 results->
Store(eff_bvss_tr,
"EFF_BVSS_TR");
1468 results->
Store(rej_bvss_tr,
"REJ_BVSS_TR");
1475 Int_t nFailedBins=0;
1478 tmpCutMin[ivar] =
fCutMin[ivar][bini-1];
1479 tmpCutMax[ivar] =
fCutMax[ivar][bini-1];
1486 if (effBin != bini){
1487 Log()<<
kVERBOSE <<
"unable to fill efficiency bin " << bini<<
" " << effBin <<
Endl;
1496 if (nFailedBins>0)
Log()<<
kWARNING <<
" unable to fill "<< nFailedBins <<
" efficiency bins " <<
Endl;
1498 delete [] tmpCutMin;
1499 delete [] tmpCutMax;
1509 Double_t effS = 0., effB, effS_ = 0., effB_ = 0.;
1510 Int_t nbins_ = 1000;
1513 for (
Int_t bini=1; bini<=nbins_; bini++) {
1515 effS = (bini - 0.5)/
Float_t(nbins_);
1519 if ((effB - effBref)*(effB_ - effBref) < 0)
break;
1524 return 0.5*(effS + effS_);
1549 Log() <<
kFATAL <<
"<GetEfficiency> wrong number of arguments" 1550 <<
" in string: " << theString
1551 <<
" | required format, e.g., Efficiency:0.05, or empty string" <<
Endl;
1566 if (results->
GetHist(
"MVA_EFF_BvsS")==0) {
1590 results->
Store(eff_BvsS,
"MVA_EFF_BvsS");
1591 results->
Store(rej_BvsS);
1600 results->
Store(eff_s,
"MVA_S");
1601 results->
Store(eff_b,
"MVA_B");
1613 tmpCutMin[ivar] =
fCutMin[ivar][bini-1];
1614 tmpCutMax[ivar] =
fCutMax[ivar][bini-1];
1619 tmpBvsS->
SetPoint(bini, effS, effB);
1626 delete [] tmpCutMin;
1627 delete [] tmpCutMax;
1643 Double_t effS = 0, effB = 0, effS_ = 0, effB_ = 0;
1644 Int_t nbins_ = 1000;
1650 for (
Int_t bini=1; bini<=nbins_; bini++) {
1653 effS = (bini - 0.5)/
Float_t(nbins_);
1655 integral += (1.0 - effB);
1664 for (
Int_t bini=1; bini<=nbins_; bini++) {
1666 effS = (bini - 0.5)/
Float_t(nbins_);
1670 if ((effB - effBref)*(effB_ - effBref) < 0)
break;
1675 effS = 0.5*(effS + effS_);
1692 fout <<
" // not implemented for class: \"" << className <<
"\"" << std::endl;
1693 fout <<
"};" << std::endl;
1711 Log() <<
"The optimisation of rectangular cuts performed by TMVA maximises " <<
Endl;
1712 Log() <<
"the background rejection at given signal efficiency, and scans " <<
Endl;
1713 Log() <<
"over the full range of the latter quantity. Three optimisation" <<
Endl;
1714 Log() <<
"methods are optional: Monte Carlo sampling (MC), a Genetics" <<
Endl;
1715 Log() <<
"Algorithm (GA), and Simulated Annealing (SA). GA and SA are" <<
Endl;
1716 Log() <<
"expected to perform best." <<
Endl;
1718 Log() <<
"The difficulty to find the optimal cuts strongly increases with" <<
Endl;
1719 Log() <<
"the dimensionality (number of input variables) of the problem." <<
Endl;
1720 Log() <<
"This behavior is due to the non-uniqueness of the solution space."<<
Endl;
1724 Log() <<
"If the dimensionality exceeds, say, 4 input variables, it is " <<
Endl;
1725 Log() <<
"advisable to scrutinize the separation power of the variables," <<
Endl;
1726 Log() <<
"and to remove the weakest ones. If some among the input variables" <<
Endl;
1727 Log() <<
"can be described by a single cut (e.g., because signal tends to be" <<
Endl;
1728 Log() <<
"larger than background), this can be indicated to MethodCuts via" <<
Endl;
1729 Log() <<
"the \"Fsmart\" options (see option string). Choosing this option" <<
Endl;
1730 Log() <<
"reduces the number of requirements for the variable from 2 (min/max)" <<
Endl;
1731 Log() <<
"to a single one (TMVA finds out whether it is to be interpreted as" <<
Endl;
1732 Log() <<
"min or max)." <<
Endl;
1736 Log() << bold <<
"Monte Carlo sampling:" << resbold <<
Endl;
1738 Log() <<
"Apart form the \"Fsmart\" option for the variables, the only way" <<
Endl;
1739 Log() <<
"to improve the MC sampling is to increase the sampling rate. This" <<
Endl;
1740 Log() <<
"is done via the configuration option \"MC_NRandCuts\". The execution" <<
Endl;
1741 Log() <<
"time scales linearly with the sampling rate." <<
Endl;
1743 Log() << bold <<
"Genetic Algorithm:" << resbold <<
Endl;
1745 Log() <<
"The algorithm terminates if no significant fitness increase has" <<
Endl;
1746 Log() <<
"been achieved within the last \"nsteps\" steps of the calculation." <<
Endl;
1747 Log() <<
"Wiggles in the ROC curve or constant background rejection of 1" <<
Endl;
1748 Log() <<
"indicate that the GA failed to always converge at the true maximum" <<
Endl;
1749 Log() <<
"fitness. In such a case, it is recommended to broaden the search " <<
Endl;
1750 Log() <<
"by increasing the population size (\"popSize\") and to give the GA " <<
Endl;
1751 Log() <<
"more time to find improvements by increasing the number of steps" <<
Endl;
1752 Log() <<
"(\"nsteps\")" <<
Endl;
1753 Log() <<
" -> increase \"popSize\" (at least >10 * number of variables)" <<
Endl;
1754 Log() <<
" -> increase \"nsteps\"" <<
Endl;
1756 Log() << bold <<
"Simulated Annealing (SA) algorithm:" << resbold <<
Endl;
1758 Log() <<
"\"Increasing Adaptive\" approach:" <<
Endl;
1760 Log() <<
"The algorithm seeks local minima and explores their neighborhood, while" <<
Endl;
1761 Log() <<
"changing the ambient temperature depending on the number of failures" <<
Endl;
1762 Log() <<
"in the previous steps. The performance can be improved by increasing" <<
Endl;
1763 Log() <<
"the number of iteration steps (\"MaxCalls\"), or by adjusting the" <<
Endl;
1764 Log() <<
"minimal temperature (\"MinTemperature\"). Manual adjustments of the" <<
Endl;
1765 Log() <<
"speed of the temperature increase (\"TemperatureScale\" and \"AdaptiveSpeed\")" <<
Endl;
1766 Log() <<
"to individual data sets should also help. Summary:" << brk <<
Endl;
1767 Log() <<
" -> increase \"MaxCalls\"" << brk <<
Endl;
1768 Log() <<
" -> adjust \"MinTemperature\"" << brk <<
Endl;
1769 Log() <<
" -> adjust \"TemperatureScale\"" << brk <<
Endl;
1770 Log() <<
" -> adjust \"AdaptiveSpeed\"" <<
Endl;
1772 Log() <<
"\"Decreasing Adaptive\" approach:" <<
Endl;
1774 Log() <<
"The algorithm calculates the initial temperature (based on the effect-" <<
Endl;
1775 Log() <<
"iveness of large steps) and the multiplier that ensures to reach the" <<
Endl;
1776 Log() <<
"minimal temperature with the requested number of iteration steps." <<
Endl;
1777 Log() <<
"The performance can be improved by adjusting the minimal temperature" <<
Endl;
1778 Log() <<
" (\"MinTemperature\") and by increasing number of steps (\"MaxCalls\"):" << brk <<
Endl;
1779 Log() <<
" -> increase \"MaxCalls\"" << brk <<
Endl;
1780 Log() <<
" -> adjust \"MinTemperature\"" <<
Endl;
1782 Log() <<
"Other kernels:" <<
Endl;
1784 Log() <<
"Alternative ways of counting the temperature change are implemented. " <<
Endl;
1785 Log() <<
"Each of them starts with the maximum temperature (\"MaxTemperature\")" <<
Endl;
1786 Log() <<
"and descreases while changing the temperature according to a given" <<
Endl;
1787 Log() <<
"prescription:" << brk <<
Endl;
1788 Log() <<
"CurrentTemperature =" << brk <<
Endl;
1789 Log() <<
" - Sqrt: InitialTemperature / Sqrt(StepNumber+2) * TemperatureScale" << brk <<
Endl;
1790 Log() <<
" - Log: InitialTemperature / Log(StepNumber+2) * TemperatureScale" << brk <<
Endl;
1791 Log() <<
" - Homo: InitialTemperature / (StepNumber+2) * TemperatureScale" << brk <<
Endl;
1792 Log() <<
" - Sin: (Sin(StepNumber / TemperatureScale) + 1) / (StepNumber + 1)*InitialTemperature + Eps" << brk <<
Endl;
1793 Log() <<
" - Geo: CurrentTemperature * TemperatureScale" <<
Endl;
1795 Log() <<
"Their performance can be improved by adjusting initial temperature" <<
Endl;
1796 Log() <<
"(\"InitialTemperature\"), the number of iteration steps (\"MaxCalls\")," <<
Endl;
1797 Log() <<
"and the multiplier that scales the termperature descrease" <<
Endl;
1798 Log() <<
"(\"TemperatureScale\")" << brk <<
Endl;
1799 Log() <<
" -> increase \"MaxCalls\"" << brk <<
Endl;
1800 Log() <<
" -> adjust \"InitialTemperature\"" << brk <<
Endl;
1801 Log() <<
" -> adjust \"TemperatureScale\"" << brk <<
Endl;
1802 Log() <<
" -> adjust \"KernelTemperature\"" <<
Endl;
std::vector< Double_t > * fRmsS
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Double_t GetMvaValue(Double_t *err=0, Double_t *errUpper=0)
cut evaluation: returns 1.0 if event passed, 0.0 otherwise
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
Random number generator class based on M.
MsgLogger & Endl(MsgLogger &ml)
TH1 * GetHist(const TString &alias) const
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Double_t ComputeEstimator(std::vector< Double_t > &)
returns estimator for "cut fitness" used by GA there are two requirements: 1) the signal efficiency m...
void TestClassification()
nothing to test
Collectable string class.
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
const char * GetName() const
Returns name of object.
Bool_t IgnoreEventsWithNegWeightsInTraining() const
void CheckForUnusedOptions() const
checks for unused options in option string
OptionBase * DeclareOptionRef(T &ref, const TString &name, const TString &desc="")
void MatchParsToCuts(const std::vector< Double_t > &, Double_t *, Double_t *)
translates parameters into cuts
void Clone(Ssiz_t nc)
Make self a distinct copy with capacity of at least tot, where tot cannot be smaller than the current...
Bool_t IsNormalised() const
std::vector< TH1 * > * fVarHistS
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)
void AddWeightsXMLTo(void *parent) const
create XML description for LD classification and regression (for arbitrary number of output classes/t...
std::vector< PDF * > * fVarPdfS
const TString & GetInputVar(Int_t i) const
virtual const char * GetPath() const
Returns the full path of the directory.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
const TString & GetMethodName() const
Float_t GetValue(UInt_t ivar) const
return value of i'th variable
std::vector< TH1 * > * fVarHistS_smooth
const char * Data() const
Types::EAnalysisType GetAnalysisType() const
Double_t EstimatorFunction(std::vector< Double_t > &)
returns estimator for "cut fitness" used by GA
std::vector< Double_t > * fMeanB
virtual Double_t GetBinLowEdge(Int_t bin) const
return bin lower edge for 1D historam Better to use h1.GetXaxis().GetBinLowEdge(bin) ...
Double_t Run()
estimator function interface for fitting
Bool_t IsSignal(const Event *ev) const
std::vector< EFitParameters > * fFitParams
void Init(void)
default initialisation called by all constructors
void CreateVariablePDFs(void)
for PDF method: create efficiency reference histograms and PDFs
BinarySearchTree * fBinaryTreeS
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 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 ...
virtual void ParseOptions()
options parser
std::vector< TH1 * > * fVarHistB_smooth
void MatchCutsToPars(std::vector< Double_t > &, Double_t *, Double_t *)
translates cuts into parameters
Double_t SearchVolume(Volume *, std::vector< const TMVA::BinarySearchTreeNode * > *events=0)
search the whole tree and add up all weigths of events that lie within the given voluem ...
Double_t GetSumOfWeights(void) const
return the sum of event (node) weights
std::vector< PDF * > * fVarPdfB
UInt_t GetNVariables() const
void Train(void)
training method: here the cuts are optimised for the training sample
virtual Double_t GetBinCenter(Int_t bin) const
return bin center for 1D historam Better to use h1.GetXaxis().GetBinCenter(bin)
Float_t Max(Types::ESBType sb, UInt_t var)
Results * GetResults(const TString &, Types::ETreeType type, Types::EAnalysisType analysistype)
TString info(resultsName+"/"); switch(type) { case Types::kTraining: info += "kTraining/"; break; cas...
std::vector< Int_t > * fRangeSign
Float_t Min(Types::ESBType sb, UInt_t var)
Long64_t GetNEvtSigTest()
return number of signal test events in dataset
MethodCuts(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="MC:150:10000:", TDirectory *theTargetFile=0)
standard constructor
void PrintCuts(Double_t effS) const
print cuts
void MakeClassSpecific(std::ostream &, const TString &) const
write specific classifier response
void ReadWeightsFromXML(void *wghtnode)
read coefficients from xml weight file
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...
const Event * GetEvent() const
char * Form(const char *fmt,...)
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
TSpline * fSplTrainEffBvsS
void DeclareOptions()
define the options (their key words) that can be set in the option string know options: Method <strin...
void SetNormalised(Bool_t norm)
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
void SetCurrentType(Types::ETreeType type) const
const std::vector< TMVA::Event * > & GetEventCollection(Types::ETreeType type)
returns the event collection (i.e.
virtual Int_t GetSize() const
EFitMethodType fFitMethod
std::vector< Double_t > * fMeanS
void WriteMonitoringHistosToFile(void) const
write histograms and PDFs to file for monitoring purposes
Float_t RMS(Types::ESBType sb, UInt_t var)
Describe directory structure in memory.
void ReadWeightsFromStream(std::istream &i)
read the cuts from stream
TDirectory * BaseDir() const
returns the ROOT directory where info/histograms etc of the corresponding MVA method instance are sto...
static RooMathCoreReg dummy
Long64_t GetNEvents(Types::ETreeType type=Types::kMaxTreeType) const
UInt_t GetNVariables() const
access the number of variables through the datasetinfo
Double_t GetEfficiency(const TString &, Types::ETreeType, Double_t &)
DataSetInfo & DataInfo() const
VariableInfo & GetVariableInfo(Int_t i)
void AddPreDefVal(const T &)
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
std::vector< Double_t > * fRmsB
void GetHelpMessage() const
get help message text
Float_t Mean(Types::ESBType sb, UInt_t var)
#define REGISTER_METHOD(CLASS)
for example
virtual Double_t Eval(Double_t x) const =0
Abstract ClassifierFactory template that handles arbitrary types.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
virtual ~MethodCuts(void)
destructor
Double_t Fill(const std::vector< TMVA::Event * > &events, const std::vector< Int_t > &theVars, Int_t theType=-1)
create the search tree from the event collection using ONLY the variables specified in "theVars" ...
Short_t Max(Short_t a, Short_t b)
const TString & GetOptions() const
A Graph is a graphics object made of two arrays X and Y with npoints each.
static const Double_t fgMaxAbsCutVal
void ProcessOptions()
process user options sanity check, do not allow the input variables to be normalised, because this only creates problems when interpreting the cuts
void DrawProgressBar(Int_t, const TString &comment="")
draws progress bar in color or B&W caution:
Bool_t WriteOptionsReference() const
void Store(TObject *obj, const char *alias=0)
Double_t Sqrt(Double_t x)
TString GetMethodTypeName() const
Double_t GetTrainingEfficiency(const TString &)
virtual Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)
Cuts can only handle classification with 2 classes.
std::vector< Interval * > fCutRange
BinarySearchTree * fBinaryTreeB
std::vector< TH1 * > * fVarHistB
void NoErrorCalc(Double_t *const err, Double_t *const errUpper)
const TString & GetTestvarName() const