1 |
#include <iostream>
|
2 |
|
3 |
#include "TROOT.h"
|
4 |
#include "TControlBar.h"
|
5 |
|
6 |
void TMVAGui( const char* fName = "TMVA.root" )
|
7 |
{
|
8 |
// Use this script in order to run the various individual macros
|
9 |
// that plot the output of TMVA (e.g. running TMVAnalysis.C),
|
10 |
// stored in the file "TMVA.root"
|
11 |
// for further documentation, look in the individual macros
|
12 |
|
13 |
cout << "--- Open TMVAGui for input file: " << fName << endl;
|
14 |
|
15 |
// gROOT->Reset();
|
16 |
// gStyle->SetScreenFactor(2); // if you have a large screen, select 1,2 or 1.4
|
17 |
|
18 |
// create the control bar
|
19 |
TControlBar* cbar = new TControlBar( "vertical", "TMVA Plotting Macros", 0, 0 );
|
20 |
|
21 |
const char* buttonType = "button";
|
22 |
const char* scriptpath = "../macros";
|
23 |
|
24 |
// configure buttons
|
25 |
Int_t ic = 0;
|
26 |
cbar->AddButton( Form( "(%ia) Input Variables", ++ic),
|
27 |
Form( ".x %s/variables.C(\"%s\",0)", scriptpath, fName ),
|
28 |
"Plots all input variables (macro variables.C)",
|
29 |
buttonType );
|
30 |
|
31 |
cbar->AddButton( Form( "(%ib) [ Decorrelated Input Variables ]", ic ),
|
32 |
Form( ".x %s/variables.C(\"%s\",1)", scriptpath, fName ),
|
33 |
"Plots all decorrelated input variables (macro variables.C(1))",
|
34 |
buttonType );
|
35 |
|
36 |
cbar->AddButton( Form( "(%ic) [ PCA-transformed Input Variables ]", ic ),
|
37 |
Form( ".x %s/variables.C(\"%s\",2)", scriptpath, fName ),
|
38 |
"Plots all PCA-transformed input variables (macro variables.C(2))",
|
39 |
buttonType );
|
40 |
|
41 |
cbar->AddButton( Form( "(%ia) Input Variable Correlations (scatter profiles)", ++ic ),
|
42 |
Form( ".x %s/CorrGui.C\(\"%s\",0)", scriptpath, fName ),
|
43 |
"Plots signal and background correlation profiles between input variables (macro CorrGui.C)",
|
44 |
buttonType );
|
45 |
|
46 |
cbar->AddButton( Form( "(%ib) [ Decorrelated Input Variable Correlations (scatter profiles) ]", ic ),
|
47 |
Form( ".x %s/CorrGui.C\(\"%s\",1)", scriptpath, fName ),
|
48 |
"Plots signal and background correlation profiles between decorrelated input variables (macro CorrGui.C(1))",
|
49 |
buttonType );
|
50 |
|
51 |
cbar->AddButton( Form( "(%ic) [ PCA-transformed Input Variable Correlations (scatter profiles) ]", ic ),
|
52 |
Form( ".x %s/CorrGui.C\(\"%s\",2)", scriptpath, fName ),
|
53 |
"Plots signal and background correlation profiles between PCA-transformed input variables (macro CorrGui.C(2))",
|
54 |
buttonType );
|
55 |
|
56 |
cbar->AddButton( Form( "(%i) Input Variable Correlation Coefficients", ++ic ),
|
57 |
Form( ".x %s/correlations.C(\"%s\")", scriptpath, fName ),
|
58 |
"Plots signal and background correlation summaries for all input variables (macro correlations.C)",
|
59 |
buttonType );
|
60 |
|
61 |
cbar->AddButton( Form( "(%ia) Classifier Output Distributions", ++ic ),
|
62 |
Form( ".x %s/mvas.C(\"%s\",0)", scriptpath, fName ),
|
63 |
"Plots the output of each classifier for the test data (macro mvas.C(...,0))",
|
64 |
buttonType );
|
65 |
|
66 |
cbar->AddButton( Form( "(%ib) Classifier Probability Distributions", ic ),
|
67 |
Form( ".x %s/mvas.C(\"%s\",1)", scriptpath, fName ),
|
68 |
"Plots the probability of each classifier for the test data (macro mvas.C(...,1))",
|
69 |
buttonType );
|
70 |
|
71 |
cbar->AddButton( Form( "(%ic) Classifier Rarity Distributions", ic ),
|
72 |
Form( ".x %s/mvas.C(\"%s\",2)", scriptpath, fName ),
|
73 |
"Plots the rarity of each classifier for the test data (macro mvas.C(...,2))",
|
74 |
buttonType );
|
75 |
|
76 |
// cbar->AddButton( Form( "(%i) Mu-transforms (summary)", ++ic ),
|
77 |
// Form( ".x %s/mutransform.C(\"%s\")", scriptpath, fName ),
|
78 |
// "Plots the mu-transformed signal and background MVAs of each method (macro mutransform.C)",
|
79 |
// buttonType );
|
80 |
|
81 |
cbar->AddButton( Form( "(%ia) Classifier Cut Efficiencies", ++ic ),
|
82 |
Form( ".x %s/mvaeffs.C(\"%s\")", scriptpath, fName ),
|
83 |
"Plots signal and background efficiencies versus cut on classifier output (macro mvaeffs.C)",
|
84 |
buttonType );
|
85 |
|
86 |
cbar->AddButton( Form( "(%ib) Classifier Background Rejection vs Signal Efficiency (ROC curve)", ic ),
|
87 |
Form( ".x %s/efficiencies.C(\"%s\")", scriptpath, fName ),
|
88 |
"Plots background rejection vs signal efficiencies (macro efficiencies.C)",
|
89 |
buttonType );
|
90 |
|
91 |
cbar->AddButton( Form( "(%i) [ Likelihood Reference Distributiuons ]", ++ic),
|
92 |
Form( ".x %s/likelihoodrefs.C(\"%s\")", scriptpath, fName ),
|
93 |
"Plots to verify the likelihood reference distributions (macro likelihoodrefs.C)",
|
94 |
buttonType );
|
95 |
|
96 |
cbar->AddButton( Form( "(%ia) [ Network Architecture ]", ++ic ),
|
97 |
Form( ".x %s/network.C(\"%s\")", scriptpath, fName ),
|
98 |
"Plots the MLP weights (macro network.C)",
|
99 |
buttonType );
|
100 |
|
101 |
cbar->AddButton( Form( "(%ib) [ Network Convergence Test ]", ic ),
|
102 |
Form( ".x %s/annconvergencetest.C(\"%s\")", scriptpath, fName ),
|
103 |
"Plots error estimator versus training epoch for training and test samples (macro annconvergencetest.C)",
|
104 |
buttonType );
|
105 |
|
106 |
cbar->AddButton( Form( "(%i) [ Decision Tree (#1) ]", ++ic ),
|
107 |
Form( ".x %s/BDT.C", scriptpath, fName ),
|
108 |
"Plots the Decision Tree (#1); to plot other trees (i) call macro BDT.C(i) from command line",
|
109 |
buttonType );
|
110 |
|
111 |
cbar->AddButton( Form( "(%i) PDFs of Classifiers", ++ic ),
|
112 |
Form( ".x %s/probas.C(\"%s\")", scriptpath, fName ),
|
113 |
"Plots the Fit of the Methods outputs; to plot other trees (i) call macro from command line (macro probas.C(i))",
|
114 |
buttonType );
|
115 |
|
116 |
cbar->AddButton( Form( "(%i) [ Rule Ensemble Importance Plots ]", ++ic ),
|
117 |
Form( ".x %s/rulevis.C(\"%s\",0)", scriptpath, fName ),
|
118 |
"Plots all input variables with rule ensemble weights, including linear terms (macro rulevis.C)",
|
119 |
buttonType );
|
120 |
|
121 |
cbar->AddButton( Form( "(%i) Quit", ++ic ), ".q", "Quit", buttonType );
|
122 |
|
123 |
// set the style
|
124 |
cbar->SetTextColor("black");
|
125 |
|
126 |
// there seems to be a bug in ROOT: font jumps back to default after pressing on >2 different buttons
|
127 |
// cbar->SetFont("-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1");
|
128 |
|
129 |
// draw
|
130 |
cbar->Show();
|
131 |
|
132 |
gROOT->SaveContext();
|
133 |
}
|