Logo ROOT  
Reference Guide
No Matches
EfficiencyPlotWrapper Class Reference

Note: This file assumes a certain structure on the input file.

The structure is as follows:

  • dataset (TDirectory)
  • ... some variables, plots ...
  • Method_XXX (TDirectory)
    • XXX (TDirectory)
      • ... some plots ...
      • MVA_Method_XXX_Test_::classname#
      • MVA_Method_XXX_Train_::classname#
      • ... some plots ...
  • Method_YYY (TDirectory)
    • YYY (TDirectory)
      • ... some plots ...
      • MVA_Method_YYY_Test_::classname#
      • MVA_Method_YYY_Train_::classname#
      • ... some plots ...
  • TestTree (TTree)
    • ... data...
  • TrainTree (TTree)
    • ... data...

Keeping this in mind makes the main loop in getRocCurves easier to follow :) Private class that simplify drawing plots combining information from several methods.

Each wrapper will manage a canvas and a legend and provide convenience functions to add data to these. It also provides a save function for saving an image representation to disk.

Feel free to extend this class as you see fit. It is intended as a convenience when showing multiclass roccurves, not a fully general tool.

Usage: auto p = new EfficiencyPlotWrapper(name, title, dataset, i): for (TGraph * g : listOfGraphs) { p->AddGraph(g); p->AddLegendEntry(methodName); } p->save();

Definition at line 88 of file efficienciesMulticlass.cxx.

Public Member Functions

 EfficiencyPlotWrapper (TString name, TString title, TString dataset, size_t i)
 Private class EfficiencyPlotWrapper - Implementation.
Int_t addGraph (TGraph *graph)
 Adds a new graph to the plot.
void addLegendEntry (TString methodTitle, TGraph *graph)
 WARNING: Uses the current color, thus the correct call ordering is: plotWrapper->addGraph(...); plotWrapper->addLegendEntry(...);.
void save ()
 Saves the current state of the plot to disk.

Public Attributes

Int_t fColor
TString fDataset
UInt_t fNumMethods

Private Member Functions

TCanvasnewEfficiencyCanvas (TString name, TString title, size_t i)
 Helper to create new Canvas.
TLegendnewEfficiencyLegend ()
 Helper to create new legend.

Private Attributes

Float_t fdxL
Float_t fdyH
Float_t fx0L
Float_t fy0H

Constructor & Destructor Documentation

◆ EfficiencyPlotWrapper()

EfficiencyPlotWrapper::EfficiencyPlotWrapper ( TString  name,
TString  title,
TString  dataset,
size_t  i 

Private class EfficiencyPlotWrapper - Implementation.

Constructs a new canvas + auxiliary data for showing an efficiency plot.

Definition at line 395 of file efficienciesMulticlass.cxx.

Member Function Documentation

◆ addGraph()

Int_t EfficiencyPlotWrapper::addGraph ( TGraph graph)

Adds a new graph to the plot.

The added graph should contain a single ROC curve.

Definition at line 419 of file efficienciesMulticlass.cxx.

◆ addLegendEntry()

void EfficiencyPlotWrapper::addLegendEntry ( TString  methodTitle,
TGraph graph 

WARNING: Uses the current color, thus the correct call ordering is: plotWrapper->addGraph(...); plotWrapper->addLegendEntry(...);.

Definition at line 443 of file efficienciesMulticlass.cxx.

◆ newEfficiencyCanvas()

TCanvas * EfficiencyPlotWrapper::newEfficiencyCanvas ( TString  name,
TString  title,
size_t  i 

Helper to create new Canvas.

titleTitle to be displayed on canvas
iIndex to offset a collection of canvases from each other

Definition at line 462 of file efficienciesMulticlass.cxx.

◆ newEfficiencyLegend()

TLegend * EfficiencyPlotWrapper::newEfficiencyLegend ( )

Helper to create new legend.

Definition at line 492 of file efficienciesMulticlass.cxx.

◆ save()

void EfficiencyPlotWrapper::save ( )

Saves the current state of the plot to disk.

Definition at line 507 of file efficienciesMulticlass.cxx.

Member Data Documentation

◆ fCanvas

TCanvas* EfficiencyPlotWrapper::fCanvas

Definition at line 90 of file efficienciesMulticlass.cxx.

◆ fColor

Int_t EfficiencyPlotWrapper::fColor

Definition at line 95 of file efficienciesMulticlass.cxx.

◆ fDataset

TString EfficiencyPlotWrapper::fDataset

Definition at line 93 of file efficienciesMulticlass.cxx.

◆ fdxL

Float_t EfficiencyPlotWrapper::fdxL

Definition at line 108 of file efficienciesMulticlass.cxx.

◆ fdyH

Float_t EfficiencyPlotWrapper::fdyH

Definition at line 110 of file efficienciesMulticlass.cxx.

◆ fLegend

TLegend* EfficiencyPlotWrapper::fLegend

Definition at line 91 of file efficienciesMulticlass.cxx.

◆ fNumMethods

UInt_t EfficiencyPlotWrapper::fNumMethods

Definition at line 97 of file efficienciesMulticlass.cxx.

◆ fx0L

Float_t EfficiencyPlotWrapper::fx0L

Definition at line 107 of file efficienciesMulticlass.cxx.

◆ fy0H

Float_t EfficiencyPlotWrapper::fy0H

Definition at line 109 of file efficienciesMulticlass.cxx.

  • tmva/tmvagui/src/efficienciesMulticlass.cxx