19 cout <<
"read file: " << fileName << endl;
20 cout <<
"kValue = " <<
kValue << endl;
29 gDirectory->Get(
"MultiTargetRegressionFoam")) {
31 fileName.
Data(),
"TMVA::kValueDensity", (useTMVAStyle ?
"kTRUE" :
"kFALSE") );
32 cbar->
AddButton(
"Event density", macro,
"Plot event density",
"button" );
35 fileName.
Data(),
"TMVA::kValue", (useTMVAStyle ?
"kTRUE" :
"kFALSE") );
36 cbar->
AddButton(
"Discriminator", macro,
"Plot discriminator",
"button" );
37 }
else if (
gDirectory->Get(
"MonoTargetRegressionFoam")){
39 fileName.
Data(),
"TMVA::kValue", (useTMVAStyle ?
"kTRUE" :
"kFALSE") );
40 cbar->
AddButton(
"Target", macro,
"Plot target",
"button" );
42 cout <<
"Error: no foams found in file: " << fileName << endl;
47 fileName.
Data(),
"TMVA::kRms", (useTMVAStyle ?
"kTRUE" :
"kFALSE") );
48 cbar->
AddButton(
"Variance", macro_rms,
"Plot variance",
"button" );
50 fileName.
Data(),
"TMVA::kRmsOvMean", (useTMVAStyle ?
"kTRUE" :
"kFALSE") );
51 cbar->
AddButton(
"Variance/Mean", macro_rms_ov_mean,
"Plot variance over mean",
"button" );
53 fileName.
Data(), (useTMVAStyle ?
"kTRUE" :
"kFALSE") );
54 cbar->
AddButton(
"Cell tree", macro_cell_tree,
"Plot cell tree",
"button" );
63 cout <<
"read file: " << fileName << endl;
77 if (SignalFoam && BgFoam) {
80 }
else if (DiscrFoam) {
82 }
else if (MultiClassFoam0) {
89 }
else if (MonoTargetRegressionFoam) {
90 foam_list.
Add(
new TPair(MonoTargetRegressionFoam,
92 }
else if (MultiTargetRegressionFoam) {
93 foam_list.
Add(
new TPair(MultiTargetRegressionFoam,
94 new TObjString(
"MultiTargetRegression Foam")));
96 cout <<
"ERROR: no Foams found in file: " << fileName << endl;
102 TPair *fm_pair = NULL;
104 while ((fm_pair = (
TPair*) foamIter())) {
107 <<
" (dimension = " << kDim <<
")" << endl;
125 const TString& cell_value_description,
130 TH1D* projection = NULL;
134 TPair* fm_pair =
nullptr;
135 while ((fm_pair = (
TPair*) it())) {
142 "1-dimensional PDEFoam", 400, 400);
144 projection = foam->
Draw1Dim(cell_value, 100, kernel);
145 projection->
SetTitle(cell_value_description +
" of " + foam_caption
146 +
";" + variable_name);
156 const TString& cell_value_description,
161 TH2D* projection =
nullptr;
165 TPair* fm_pair = NULL;
166 while ((fm_pair = (
TPair*) it())) {
173 for (
Int_t i = 0; i < kDim; ++i) {
174 for (
Int_t k = i + 1; k < kDim; ++k) {
178 (
Int_t)(400/(1.-0.2)), 400);
182 cell_value_description.
Data(),
189 projection = foam->
Project2(i, k, cell_value, kernel);
191 projection->
Draw(
"COLZ");
205 cout <<
"read file: " << fileName << endl;
212 TKey *foam_key =
nullptr;
214 while ((foam_key = (
TKey*) foamIter())) {
217 if (!class_name.Contains(
"PDEFoam"))
219 cout <<
"PDEFoam found: " << class_name <<
" " <<
name << endl;
243 if (xsize > 0.15) xsize=0.1;
267 for (
Int_t i = 0; i <
vec->GetNrows(); ++i)
278 cell->
GetHcub(cellPosi, cellSize);
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.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
void Update() override
Update canvas pad buffers.
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 an on-disk file, usually with extension .root, that stores objects in a file-system-li...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
void Close(Option_t *option="") override
Close a file.
1-D histogram with a double per channel (see TH1 documentation)
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
void SetTitle(const char *title) override
Change/set the title.
void Draw(Option_t *option="") override
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.
Use the TLine constructor to create a simple line.
void Add(TObject *obj) override
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
TH1D * Draw1Dim(ECellValue cell_value, Int_t nbin, PDEFoamKernelBase *kernel=nullptr)
Draws 1-dimensional foam (= histogram)
PDEFoamCell * GetRootCell() const
virtual TH2D * Project2(Int_t idim1, Int_t idim2, ECellValue cell_value=kValue, PDEFoamKernelBase *kernel=nullptr, UInt_t nbin=50)
Project foam variable idim1 and variable idim2 to histogram.
const char * GetName() const override
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.
void Draw(Option_t *option="") override
Draw this pavetext with its current attributes.
virtual void SetBorderSize(Int_t bordersize=4)
Sets the border size of the TPave box and shadow.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
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)