Classes | |
struct | MVAVar |
struct | MVAVarSet |
Enumerations | |
enum | MVAPurpose { PURPOSE_NORMAL = 0, PURPOSE_SPECTATOR =1, PURPOSE_TARGET = 2 } |
Functions | |
TTree * | makeTMVATree (TTree *intree, TFile *outfile, const char *out_tree_name, const MVAVarSet &vars, const char *selection) |
TTree * | makeTMVATree (int ntrees, TTree **intree, TFile *outfile, const char *out_tree_name, const MVAVarSet &vars, const char *selection) |
int | evaluateTMVA (TTree *tree, const MVAVarSet &vars, const char *branch_name, const char *tmva_weights_xml_file, double aux=0) |
TMVA helpers for ANITA analysis
The basic problem is that AnitaEventSummary has arrays of things, but TMVA doesn't support that properly (even though... it could in a way similar to TTree::Scan)
See macros/TMVAExample.C for an example analysis.
Cosmin Deaconu cozzy d@ki cp.uc hica go.ed u
int AnitaTMVA::evaluateTMVA | ( | TTree * | tree, |
const MVAVarSet & | vars, | ||
const char * | branch_name, | ||
const char * | tmva_weights_xml_file, | ||
double | aux = 0 |
||
) |
Adds the TMVA classifier result to a tree. This tree should have been generated with makeTMVATree. A branch will be added to the tree with the same name as the method
This takes care of generating the reader and such.
tree | the tree to evaluate. Should have been generated with maketMVATree |
vars | The set of variables that are being evaluated. All branches must exist in tree and the TMVA method must have been generated with it. |
branch_name | The name of the evaluation branch to be added to the tree |
tmva_weights_file | The weights.xml file that you want to read in. |
aux | aux parameter to EvaluateMVA 0 on success; |
Definition at line 163 of file AnitaTMVA.cc.
TTree * AnitaTMVA::makeTMVATree | ( | TTree * | intree, |
TFile * | outfile, | ||
const char * | out_tree_name, | ||
const MVAVarSet & | vars, | ||
const char * | selection | ||
) |
Creates a tree that may be used by TMVA. Stores in in file outfile, which must exist.
This tree can then be used for training or reading using the varName you provide. Note that internally this uses TTree::Draw, so if your cuts suck, you might end up with an insane amount of memory usage, but since TMVA loads everything into memory anyway, I don't think you lose much. This is necessary because TMVA's methods with selection don't properly handle cuts on array variables. Maybe in the future they'll fix this and this won't be necessary.
The tree will also have the iteration and entry number in it.
intree | The input tree |
outfile | The file to write the output tree to |
out_tree_hname | the name of the new tree |
varsAn | MVAVarSet describing the variables to use |
selection | The selection cuts. |
Definition at line 82 of file AnitaTMVA.cc.
TTree * AnitaTMVA::makeTMVATree | ( | int | ntrees, |
TTree ** | intree, | ||
TFile * | outfile, | ||
const char * | out_tree_name, | ||
const MVAVarSet & | vars, | ||
const char * | selection | ||
) |
Parallel version of above, will treat each input tree separately
Definition at line 88 of file AnitaTMVA.cc.