54 for (
Int_t n = 0;
n < nPoints; ++
n) {
55 x = rng.Rndm() * scale;
56 y = offset + rng.Rndm() * scale;
73void TMVAMinimalClassification()
75 TString outputFilename =
"out.root";
76 TFile *outFile =
new TFile(outputFilename,
"RECREATE");
79 TTree *signalTree = genTree(1000, 0.0, 2.0, 100);
80 TTree *backgroundTree = genTree(1000, 1.0, 2.0, 101);
82 TString factoryOptions =
"AnalysisType=Classification";
89 dataloader.AddVariable(
"y",
'D');
91 dataloader.AddSignalTree(signalTree, 1.0);
92 dataloader.AddBackgroundTree(backgroundTree, 1.0);
95 TCut backgroundCut =
"";
96 TString datasetOptions =
"SplitMode=Random";
97 dataloader.PrepareTrainingAndTestTree(signalCut, backgroundCut, datasetOptions);
104 factory.TrainAllMethods();
105 factory.TestAllMethods();
106 factory.EvaluateAllMethods();
113 delete backgroundTree;
A specialized string object used for TTree selections.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
void Close(Option_t *option="") override
Close a file.
void AddVariable(const TString &expression, const TString &title, const TString &unit, char type='F', Double_t min=0, Double_t max=0)
user inserts discriminating variable in data set info
This is the main MVA steering class.
This is the base class for the ROOT Random number generators.
A TTree represents a columnar dataset.
virtual Int_t Fill()
Fill all branches.
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.