24 cout <<
"--- No TestTree saved in ROOT file. Parallel coordinates will not be plotted" << endl;
33 TLeaf* leaf = (TLeaf*)leafList->
At(iar);
35 TString leafName = leaf->
GetName();
36 if (leafName !=
"type" && leafName !=
"weight" && leafName !=
"boostweight" &&
37 leafName !=
"class" && leafName !=
"className" && leafName !=
"classID" &&
41 mvas.push_back( leafName );
44 vars.push_back( leafName );
50 cout <<
"--- Found: " << vars.size() <<
" variables" << endl;
51 cout <<
"--- Found: " <<
mvas.size() <<
" MVA(s)" << endl;
54 TString
type[2] = {
"Signal",
"Background" };
55 for (
UInt_t imva=0; imva<
mvas.size(); imva++) {
56 cout <<
"--- Plotting parallel coordinates for : " <<
mvas[imva] <<
" & input variables" << endl;
58 for (
Int_t itype=0; itype<2; itype++) {
61 TString varstr =
mvas[imva] +
":";
62 for (
UInt_t ivar=0; ivar<vars.size(); ivar++) varstr += vars[ivar] +
":";
68 TString::Format(
"Parallel coordinate representation for %s and input variables (%s events)",
69 mvashort.
Data(), type[itype].Data() ),
70 50*(itype), 50*(itype), 750, 500 );
75 TParallelCoord* para = (TParallelCoord*)
gPad->GetListOfPrimitives()->FindObject(
"ParaCoord" );
79 Double_t width = 0.2*(maxrange - minrange);
80 Double_t x1 = minrange, x2 = x1 + width;
81 TParallelCoordRange* parrange =
new TParallelCoordRange( mvavar, x1, x2 );
87 for (
Int_t ivar=1; ivar<std::min(
Int_t(vars.size()) + 1,3); ivar++) {
91 width = 0.2*(maxrange - minrange);
94 case 0: { x1 = minrange; x2 = x1 + width;
break; }
95 case 1: { x1 = 0.5*(maxrange + minrange - width)*0.02; x2 = x1 + width*0.02;
break; }
96 case 2: { x1 = maxrange - width; x2 = x1 + width;
break; }
99 parrange =
new TParallelCoordRange( var, x1, x2 );
100 parrange->
SetLineColor( ivar == 0 ? 2 : ivar == 1 ? 5 : 6 );
108 TString fname =
TString::Format(
"%s/plots/paracoor_c%i_%s",dataset.
Data(), imva, itype == 0 ?
"S" :
"B" );
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
TDirectory * GetDirectory(const char *apath, Bool_t printError=false, const char *funcname="GetDirectory") override
Find a directory using apath.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
const char * GetName() const override
Returns name of object.
TObject * At(Int_t idx) const override
void SetLineColor(Color_t col) override
Set the selection line color.
void AddRange(TParallelCoordRange *range)
Add a range to the current selection on the axis.
void AddSelection(const char *title)
Add a selection.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
Ssiz_t Last(char c) const
Find last occurrence of a character c.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual TObjArray * GetListOfLeaves()
void Draw(Option_t *opt) override
Default Draw method for all objects.
virtual Double_t GetMaximum(const char *columname)
Return maximum of column with name columname.
virtual Double_t GetMinimum(const char *columname)
Return minimum of column with name columname.
void Initialize(Bool_t useTMVAStyle=kTRUE)
TFile * OpenFile(const TString &fin)
Bool_t ExistMethodName(TString name, TDirectory *dir=nullptr)
void imgconv(TCanvas *c, const TString &fname)
void paracoor(TString dataset, TString fin="TMVA.root", Bool_t useTMVAStyle=kTRUE)
void mvas(TString dataset, TString fin="TMVA.root", HistType htype=kMVAType, Bool_t useTMVAStyle=kTRUE)