#include <cstdlib>
#include <iostream>
#include <map>
#include <string>
{
tree->SetBranchAddress(
"x", &
x);
tree->SetBranchAddress(
"y", &
y);
tree->SetBranchAddress(
"eventID", &eventID);
x = rng.Gaus(offset, scale);
y = rng.Gaus(offset, scale);
++eventID;
}
tree->ResetBranchAddresses();
}
int TMVACrossValidationApplication()
{
TString jobname(
"TMVACrossEvaluation");
{
if (weightfileExists) {
reader->
BookMVA(methodName, weightfile);
} else {
std::cout << "Weightfile for method " << methodName << " not found."
" Did you run TMVACrossValidation with a specified"
" splitExpr?" << std::endl;
exit(0);
}
}
{
if (weightfileExists) {
reader->
BookMVA(methodName, weightfile);
} else {
std::cout << "Weightfile for method " << methodName << " not found."
" Did you run TMVACrossValidation with a specified"
" splitExpr?" << std::endl;
exit(0);
}
}
tree->Branch(
"x", &
x,
"x/F");
tree->Branch(
"y", &
y,
"y/F");
tree->Branch(
"eventID", &eventID,
"eventID/I");
fillTree(
tree, 1000, 1.0, 1.0, 100);
fillTree(
tree, 1000, -1.0, 1.0, 101);
tree->SetBranchAddress(
"x", &
x);
tree->SetBranchAddress(
"y", &
y);
tree->SetBranchAddress(
"eventID", &eventID);
TH1F histBDTG{
"BDTG",
"BDTG", nbin, -1, 1};
TH1F histFisher{
"Fisher",
"Fisher", nbin, -1, 1};
for (
Long64_t ievt = 0; ievt <
tree->GetEntries(); ievt++) {
histBDTG.Fill(valBDTG);
histFisher.Fill(valFisher);
}
tree->ResetBranchAddresses();
{
TFile *target =
new TFile(
"TMVACrossEvaluationApp.root",
"RECREATE");
histBDTG.Write();
histFisher.Write();
delete target;
}
delete reader;
return 0;
}
int main(
int argc,
char **argv)
{
TMVACrossValidationApplication();
}
R__EXTERN TSystem * gSystem
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
virtual void Close(Option_t *option="")
Close a file.
1-D histogram with a float per channel (see TH1 documentation)}
The Reader class serves to use the MVAs in a specific analysis context.
Double_t EvaluateMVA(const std::vector< Float_t > &, const TString &methodTag, Double_t aux=0)
Evaluate a std::vector<float> of input data for a given method The parameter aux is obligatory for th...
IMethod * BookMVA(const TString &methodTag, const TString &weightfile)
read method name from weight file
void AddSpectator(const TString &expression, Float_t *)
Add a float spectator or expression to the reader.
void AddVariable(const TString &expression, Float_t *)
Add a float variable or expression to the reader.
Random number generator class based on M.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
A TTree represents a columnar dataset.
int main(int argc, char **argv)