48 for (
Int_t n = 0;
n < nPoints; ++
n) {
49 x = rng.Gaus(offset, scale);
50 y = rng.Gaus(offset, scale);
64 int TMVACrossValidationApplication()
81 TString jobname(
"TMVACrossEvaluation");
84 TString weightfile =
TString(
"dataset/weights/") + jobname +
"_" + methodName +
TString(
".weights.xml");
87 if (weightfileExists) {
88 reader->
BookMVA(methodName, weightfile);
90 std::cout <<
"Weightfile for method " << methodName <<
" not found." 91 " Did you run TMVACrossValidation with a specified" 92 " splitExpr?" << std::endl;
99 TString weightfile =
TString(
"dataset/weights/") + jobname +
"_" + methodName +
TString(
".weights.xml");
102 if (weightfileExists) {
103 reader->
BookMVA(methodName, weightfile);
105 std::cout <<
"Weightfile for method " << methodName <<
" not found." 106 " Did you run TMVACrossValidation with a specified" 107 " splitExpr?" << std::endl;
114 tree->
Branch(
"x", &x,
"x/F");
115 tree->
Branch(
"y", &y,
"y/F");
116 tree->
Branch(
"eventID", &eventID,
"eventID/I");
118 fillTree(tree, 1000, 1.0, 1.0, 100);
119 fillTree(tree, 1000, -1.0, 1.0, 101);
126 TH1F histBDTG{
"BDTG",
"BDTG", nbin, -1, 1};
127 TH1F histFisher{
"Fisher",
"Fisher", nbin, -1, 1};
136 histBDTG.Fill(valBDTG);
137 histFisher.Fill(valFisher);
144 TFile *target =
new TFile(
"TMVACrossEvaluationApp.root",
"RECREATE");
160 int main(
int argc,
char **argv)
162 TMVACrossValidationApplication();
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Random number generator class based on M.
void AddVariable(const TString &expression, Float_t *)
Add a float variable or expression to the reader.
virtual Int_t Fill()
Fill all branches.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
1-D histogram with a float per channel (see TH1 documentation)}
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
int main(int argc, char **argv)
IMethod * BookMVA(const TString &methodTag, const TString &weightfile)
read method name from weight file
R__EXTERN TSystem * gSystem
void AddSpectator(const TString &expression, Float_t *)
Add a float spectator or expression to the reader.
virtual void ResetBranchAddresses()
Tell all of our branches to drop their current objects and allocate new ones.
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...
virtual Long64_t GetEntries() const
virtual Int_t Branch(TCollection *list, Int_t bufsize=32000, Int_t splitlevel=99, const char *name="")
Create one branch for each element in the collection.
The Reader class serves to use the MVAs in a specific analysis context.
A TTree object has a header with a name and a title.
virtual void Close(Option_t *option="")
Close a file.