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 const UInt_t nmva = mvas.size();
59 for (
UInt_t imva=0; imva<mvas.size(); imva++) {
60 cout <<
"--- Plotting parallel coordinates for : " << mvas[imva] <<
" & input variables" << endl;
62 for (
Int_t itype=0; itype<2; itype++) {
65 TString varstr = mvas[imva] +
":";
66 for (
UInt_t ivar=0; ivar<vars.size(); ivar++) varstr += vars[ivar] +
":";
71 TCanvas*
c1 = (itype == 0) ? csig[imva] : cbkg[imva];
73 Form(
"Parallel coordinate representation for %s and input variables (%s events)",
74 mvashort.
Data(), type[itype].
Data() ),
75 50*(itype), 50*(itype), 750, 500 );
76 tree->
Draw( varstr.
Data(),
Form(
"classID==%i",1-itype) ,
"para" );
84 Double_t width = 0.2*(maxrange - minrange);
96 width = 0.2*(maxrange - minrange);
99 case 0: { x1 = minrange; x2 = x1 + width;
break; }
100 case 1: { x1 = 0.5*(maxrange + minrange - width)*0.02; x2 = x1 + width*0.02;
break; }
101 case 2: { x1 = maxrange - width; x2 = x1 + width;
break; }
105 parrange->
SetLineColor( ivar == 0 ? 2 : ivar == 1 ? 5 : 6 );
113 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)
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
Find an object in this list using its name.
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 void ToggleEditor()
Toggle editor.
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 void Update()
Update canvas pad buffers.
virtual Int_t GetSize() const
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