test_dectree.C
Go to the documentation of this file.
1 // root -b -q load_libs.C test_dectree.C+'("dectree.root", a, b, c, d, e, f)'
3 
4 #include <iostream>
5 
7  double pidexp, double meanyexp, double meanqfracexp,
8  double energydiffexp, double calE, double enrichfracexp)
9 {
11 
13 
14  evt.vars[0] = pidexp;
15  evt.vars[1] = meanyexp;
16  evt.vars[2] = meanqfracexp;
17  evt.vars[3] = energydiffexp;
18  evt.vars[4] = calE;
19  evt.vars[5] = enrichfracexp;
20 
21  std::cout << forest->Classify(evt) << std::endl;
22 }
Decision Tree PID.
static Forest * FromFile(const std::string &fname)
Load PID from a file.
A training or trial event for the decision tree.
Definition: DecisionTree.h:28
void test_dectree(std::string fname, double pidexp, double meanyexp, double meanqfracexp, double energydiffexp, double calE, double enrichfracexp)
Definition: test_dectree.C:6
double Classify(const Evt &evt) const
Calculate the PID value for evt.
"Random forest" of decision trees
Definition: DecisionTree.h:42
int evt
OStream cout
Definition: OStream.cxx:6
double vars[kNumPIDVars]
Definition: DecisionTree.h:30
enum BeamMode string