20 cout <<
"read file: " << fileName << endl;
21 cout <<
"kValue = " <<
kValue << endl;
30 gDirectory->Get(
"MultiTargetRegressionFoam")) {
31 TString macro =
Form(
"TMVA::Plot(\"%s\",%s, \"Event density\", %s)",
32 fileName.
Data(),
"TMVA::kValueDensity", (useTMVAStyle ?
"kTRUE" :
"kFALSE") );
33 cbar->
AddButton(
"Event density", macro,
"Plot event density",
"button" );
35 TString macro =
Form(
"TMVA::Plot(\"%s\", %s, \"Discriminator\", %s)",
36 fileName.
Data(),
"TMVA::kValue", (useTMVAStyle ?
"kTRUE" :
"kFALSE") );
37 cbar->
AddButton(
"Discriminator", macro,
"Plot discriminator",
"button" );
38 }
else if (
gDirectory->Get(
"MonoTargetRegressionFoam")){
39 TString macro =
Form(
"TMVA::Plot(\"%s\", %s, \"Target\", %s)",
40 fileName.
Data(),
"TMVA::kValue", (useTMVAStyle ?
"kTRUE" :
"kFALSE") );
41 cbar->
AddButton(
"Target", macro,
"Plot target",
"button" );
43 cout <<
"Error: no foams found in file: " << fileName << endl;
47 TString macro_rms =
Form(
"TMVA::Plot(\"%s\", %s, \"Variance\", %s)",
48 fileName.
Data(),
"TMVA::kRms", (useTMVAStyle ?
"kTRUE" :
"kFALSE") );
49 cbar->
AddButton(
"Variance", macro_rms,
"Plot variance",
"button" );
50 TString macro_rms_ov_mean =
Form(
"TMVA::Plot(\"%s\", %s, \"Variance/Mean\", %s)",
51 fileName.
Data(),
"TMVA::kRmsOvMean", (useTMVAStyle ?
"kTRUE" :
"kFALSE") );
52 cbar->
AddButton(
"Variance/Mean", macro_rms_ov_mean,
"Plot variance over mean",
"button" );
53 TString macro_cell_tree =
Form(
"TMVA::PlotCellTree(\"%s\", \"Cell tree\", %s)",
54 fileName.
Data(), (useTMVAStyle ?
"kTRUE" :
"kFALSE") );
55 cbar->
AddButton(
"Cell tree", macro_cell_tree,
"Plot cell tree",
"button" );
64 cout <<
"read file: " << fileName << endl;
78 if (SignalFoam && BgFoam) {
81 }
else if (DiscrFoam) {
83 }
else if (MultiClassFoam0) {
90 }
else if (MonoTargetRegressionFoam) {
91 foam_list.
Add(
new TPair(MonoTargetRegressionFoam,
93 }
else if (MultiTargetRegressionFoam) {
94 foam_list.
Add(
new TPair(MultiTargetRegressionFoam,
95 new TObjString(
"MultiTargetRegression Foam")));
97 cout <<
"ERROR: no Foams found in file: " << fileName << endl;
103 TPair *fm_pair = NULL;
105 while ((fm_pair = (
TPair*) foamIter())) {
108 <<
" (dimension = " << kDim <<
")" << endl;
126 const TString& cell_value_description,
131 TH1D* projection = NULL;
135 TPair* fm_pair = NULL;
136 while ((fm_pair = (
TPair*) it())) {
143 "1-dimensional PDEFoam", 400, 400);
145 projection = foam->
Draw1Dim(cell_value, 100, kernel);
146 projection->
SetTitle(cell_value_description +
" of " + foam_caption
147 +
";" + variable_name);
157 const TString& cell_value_description,
162 TH2D* projection = NULL;
166 TPair* fm_pair = NULL;
167 while ((fm_pair = (
TPair*) it())) {
174 for (
Int_t i = 0; i < kDim; ++i) {
175 for (
Int_t k = i + 1; k < kDim; ++k) {
177 canvas =
new TCanvas(
Form(
"canvas_%p_%i:%i", foam, i, k),
178 Form(
"Foam projections %i:%i", i, k),
179 (
Int_t)(400/(1.-0.2)), 400);
182 TString title =
Form(
"%s of %s: Projection %s:%s;%s;%s",
183 cell_value_description.
Data(),
190 projection = foam->
Project2(i, k, cell_value, kernel);
192 projection->
Draw(
"COLZ");
206 cout <<
"read file: " << fileName << endl;
213 TKey *foam_key = NULL;
215 while ((foam_key = (
TKey*) foamIter())) {
218 if (!class_name.Contains(
"PDEFoam"))
220 cout <<
"PDEFoam found: " << class_name <<
" " <<
name << endl;
244 if (xsize > 0.15) xsize=0.1;
279 cell->
GetHcub(cellPosi, cellSize);
char * Form(const char *fmt,...)
R__EXTERN TStyle * gStyle
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetRightMargin(Float_t rightmargin)
Set Pad right margin in fraction of the pad width.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void Update()
Update canvas pad buffers.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
A Control Bar is a fully user configurable tool which provides fast access to frequently used operati...
void Show()
Show control bar.
void AddButton(TControlBarButton *button)
Add button.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose, Int_t netopt=0)
Create / open a file.
1-D histogram with a double per channel (see TH1 documentation)}
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
virtual void SetTitle(const char *title)
See GetStatOverflows for more information.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
2-D histogram with a double per channel (see TH1 documentation)}
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual const char * GetClassName() const
virtual TObject * ReadObj()
To read a TObject* from the file.
virtual void Add(TObject *obj)
UInt_t GetTreeDepth(UInt_t depth=0)
Get depth of cell tree, starting at this cell.
PDEFoamCell * GetDau1() const
PDEFoamCell * GetDau0() const
TObject * GetElement() const
void GetHcub(PDEFoamVect &, PDEFoamVect &) const
Provides size and position of the cell These parameter are calculated by analyzing information in all...
This class is the abstract kernel interface for PDEFoam.
This class is a trivial PDEFoam kernel estimator.
Implementation of PDEFoam.
TObjString * GetVariableName(Int_t idx)
Float_t VarTransformInvers(Int_t idim, Float_t x) const
PDEFoamCell * GetRootCell() const
TH1D * Draw1Dim(ECellValue cell_value, Int_t nbin, PDEFoamKernelBase *kernel=NULL)
Draws 1-dimensional foam (= histogram)
virtual TH2D * Project2(Int_t idim1, Int_t idim2, ECellValue cell_value=kValue, PDEFoamKernelBase *kernel=NULL, UInt_t nbin=50)
Project foam variable idim1 and variable idim2 to histogram.
virtual const char * GetName() const
Returns name of object.
Collectable string class.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Class used by TMap to store (key,value) pairs.
A Pave (see TPave) with text, lines or/and boxes inside.
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
virtual void SetBorderSize(Int_t bordersize=4)
const char * Data() const
void SetNumberContours(Int_t number=20)
Set the default number of contour levels when drawing 2-d plots.
void Initialize(Bool_t useTMVAStyle=kTRUE)
void Plot1DimFoams(TList &foam_list, TMVA::ECellValue cell_value, const TString &cell_value_description, TMVA::PDEFoamKernelBase *kernel)
void PlotNDimFoams(TList &foam_list, TMVA::ECellValue cell_value, const TString &cell_value_description, TMVA::PDEFoamKernelBase *kernel)
void PlotFoams(TString fileName="weights/TMVAClassification_PDEFoam.weights_foams.root", bool useTMVAStyle=kTRUE)
void DrawCell(TMVA::PDEFoamCell *cell, TMVA::PDEFoam *foam, Double_t x, Double_t y, Double_t xscale, Double_t yscale)
void Plot(TString fileName, TMVA::ECellValue cv, TString cv_long, bool useTMVAStyle=kTRUE)
void PlotCellTree(TString fileName, TString cv_long, bool useTMVAStyle=kTRUE)