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;
105 while ((fm_pair = (
TPair*) foamIter())) {
108 <<
" (dimension = " << kDim <<
")" << endl;
126 const TString& cell_value_description,
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,
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");
193 projection->SetDirectory(0);
206 cout <<
"read file: " << fileName << endl;
215 while ((foam_key = (
TKey*) foamIter())) {
217 TString class_name(foam_key->GetClassName());
218 if (!class_name.Contains(
"PDEFoam"))
220 cout <<
"PDEFoam found: " << class_name <<
" " <<
name << endl;
244 if (xsize > 0.15) xsize=0.1;
246 TLine *a1 =
new TLine(x-xscale/4, y-ysize, x-xscale, y-ysize*2);
252 TLine *a1 =
new TLine(x+xscale/4, y-ysize, x+xscale, y-ysize*2);
269 t->AddText(
Form(
"E[%i]=%.5f", i, (*vec)[i]) );
279 cell->
GetHcub(cellPosi, cellSize);
282 t->AddText(
Form(
"dim=%i", kBest) );
void Show()
Show control bar.
PDEFoamCell * GetDau1() const
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
void AddButton(TControlBarButton *button)
Add button.
A Control Bar is a fully user configurable tool which provides fast access to frequently used operati...
This class is the abstract kernel interface for PDEFoam.
Collectable string class.
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
PDEFoamCell * GetRootCell() const
R__EXTERN TStyle * gStyle
void Plot1DimFoams(TList &foam_list, TMVA::ECellValue cell_value, const TString &cell_value_description, TMVA::PDEFoamKernelBase *kernel)
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
TH1D * Draw1Dim(ECellValue cell_value, Int_t nbin, PDEFoamKernelBase *kernel=NULL)
Draws 1-dimensional foam (= histogram)
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
void SetNumberContours(Int_t number=20)
Set the default number of contour levels when drawing 2-d plots.
void PlotCellTree(TString fileName, TString cv_long, bool useTMVAStyle=kTRUE)
void PlotNDimFoams(TList &foam_list, TMVA::ECellValue cell_value, const TString &cell_value_description, TMVA::PDEFoamKernelBase *kernel)
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Implementation of PDEFoam.
Float_t VarTransformInvers(Int_t idim, Float_t x) const
void Initialize(Bool_t useTMVAStyle=kTRUE)
virtual void Draw(Option_t *option="")
Draw this histogram with options.
UInt_t GetTreeDepth(UInt_t depth=0)
Get depth of cell tree, starting at this cell.
TObjString * GetVariableName(Int_t idx)
char * Form(const char *fmt,...)
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb"...
TObject * GetElement() const
tomato 1-D histogram with a double per channel (see TH1 documentation)}
void PlotFoams(TString fileName="weights/TMVAClassification_PDEFoam.weights_foams.root", bool useTMVAStyle=kTRUE)
Class used by TMap to store (key,value) pairs.
A Pave (see TPave) with text, lines or/and boxes inside.
PDEFoamCell * GetDau0() const
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 void SetRightMargin(Float_t rightmargin)
Set Pad right margin in fraction of the pad width.
void GetHcub(PDEFoamVect &, PDEFoamVect &) const
Provides size and position of the cell These parameter are calculated by analyzing information in all...
virtual void Add(TObject *obj)
This class is a trivial PDEFoam kernel estimator.
virtual void SetTitle(const char *title)
Change (i.e.
virtual void Update()
Update canvas pad buffers.
void Plot(TString fileName, TMVA::ECellValue cv, TString cv_long, bool useTMVAStyle=kTRUE)
virtual void Close(Option_t *option="")
Close a file.
tomato 2-D histogram with a double per channel (see TH1 documentation)}
const char * Data() const
void DrawCell(TMVA::PDEFoamCell *cell, TMVA::PDEFoam *foam, Double_t x, Double_t y, Double_t xscale, Double_t yscale)