25 cout <<
"--- No TestTree saved in ROOT file. Parallel coordinates will not be plotted" << endl;
37 if (leafName !=
"type" && leafName !=
"weight" && leafName !=
"boostweight" &&
38 leafName !=
"class" && leafName !=
"className" && leafName !=
"classID" &&
42 mvas.push_back( leafName );
45 vars.push_back( leafName );
51 cout <<
"--- Found: " << vars.size() <<
" variables" << endl;
52 cout <<
"--- Found: " << mvas.size() <<
" MVA(s)" << endl;
56 for (
UInt_t imva=0; imva<mvas.size(); imva++) {
57 cout <<
"--- Plotting parallel coordinates for : " << mvas[imva] <<
" & input variables" << endl;
59 for (
Int_t itype=0; itype<2; itype++) {
62 TString varstr = mvas[imva] +
":";
63 for (
UInt_t ivar=0; ivar<vars.size(); ivar++) varstr += vars[ivar] +
":";
69 Form(
"Parallel coordinate representation for %s and input variables (%s events)",
70 mvashort.
Data(), type[itype].
Data() ),
71 50*(itype), 50*(itype), 750, 500 );
72 tree->
Draw( varstr.
Data(),
Form(
"classID==%i",1-itype) ,
"para" );
92 width = 0.2*(maxrange - minrange);
95 case 0: { x1 = minrange; x2 = x1 +
width;
break; }
96 case 1: { x1 = 0.5*(maxrange + minrange -
width)*0.02; x2 = x1 + width*0.02;
break; }
97 case 2: { x1 = maxrange -
width; x2 = x1 +
width;
break; }
101 parrange->
SetLineColor( ivar == 0 ? 2 : ivar == 1 ? 5 : 6 );
109 TString fname =
Form(
"%s/plots/paracoor_c%i_%s",dataset.
Data(), imva, itype == 0 ?
"S" :
"B" );
virtual const char * GetName() const
Returns name of object.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
void imgconv(TCanvas *c, const TString &fname)
void paracoor(TString dataset, TString fin="TMVA.root", Bool_t useTMVAStyle=kTRUE)
image html pict1_TGaxis_012 png width
Define new text attributes for the label number "labNum".
TString & ReplaceAll(const TString &s1, const TString &s2)
R__EXTERN TStyle * gStyle
TFile * OpenFile(const TString &fin)
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Bool_t ExistMethodName(TString name, TDirectory *dir=0)
A TParallelCoordRange is a range used for parallel coordinates plots.
Short_t Min(Short_t a, Short_t b)
void mvas(TString dataset, TString fin="TMVA.root", HistType htype=kMVAType, Bool_t useTMVAStyle=kTRUE)
TObject * At(Int_t idx) const
virtual TObject * FindObject(const char *name) const
Delete a TObjLink object.
virtual Double_t GetMinimum(const char *columname)
Return minimum of column with name columname.
static const double x2[5]
virtual Double_t GetMaximum(const char *columname)
Return maximum of column with name columname.
virtual void SetLineColor(Color_t col)
Set the selection line color.
void AddSelection(const char *title)
Add a selection.
void Initialize(Bool_t useTMVAStyle=kTRUE)
char * Form(const char *fmt,...)
virtual TDirectory * GetDirectory(const char *apath, Bool_t printError=false, const char *funcname="GetDirectory")
Find a directory named "apath".
static const double x1[5]
Ssiz_t Last(char c) const
Find last occurrence of a character c.
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Parallel Coordinates class.
void SetOptTitle(Int_t tit=1)
A TTree object has a header with a name and a title.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
void AddRange(TParallelCoordRange *range)
Add a range to the current selection on the axis.
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
virtual TObjArray * GetListOfLeaves()
const char * Data() const