#include <cstdlib>
#include <iostream>
#include <map>
#include <string>
{
x = rng.Gaus(offset, scale);
y = rng.Gaus(offset, scale);
++eventID;
}
return tree;
}
int TMVACrossValidationApplication()
{
TString jobname(
"TMVACrossValidation");
{
TString weightfile =
TString(
"datasetcv/weights/") + jobname +
"_" + methodName +
TString(
".weights.xml");
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);
}
}
{
TString weightfile =
TString(
"datasetcv/weights/") + jobname +
"_" + methodName +
TString(
".weights.xml");
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(
"eventID", &eventID,
"eventID/I");
fillTree(tree, 1000, 1.0, 1.0, 100);
fillTree(tree, 1000, -1.0, 1.0, 101);
TH1F histBDTG{
"BDTG",
"BDTG", nbin, -1, 1};
TH1F histFisher{
"Fisher",
"Fisher", nbin, -1, 1};
histFisher.
Fill(valFisher);
}
delete tree;
}
else
{
TFile *target =
new TFile(
"TMVACrossEvaluationApp.root",
"RECREATE");
delete target;
}
delete reader;
return 0;
}
int main(
int argc,
char **argv)
{
TMVACrossValidationApplication();
}
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.
long long Long64_t
Portable signed long integer 8 bytes.
float Float_t
Float 4 bytes (float).
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
void Close(Option_t *option="") override
Close a file.
1-D histogram with a float per channel (see TH1 documentation)
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
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.
virtual TObject * DrawClone(Option_t *option="") const
Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Random number generator class based on M.
A TTree represents a columnar dataset.
virtual Int_t Fill()
Fill all branches.
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr, TClass *realClass, EDataType datatype, bool isptr, bool suppressMissingBranchError)
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
virtual Long64_t GetEntries() const
TBranch * Branch(const char *name, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Add a new branch, and infer the data type from the type of obj being passed.
virtual void ResetBranchAddresses()
Tell all of our branches to drop their current objects and allocate new ones.