Skip to content

Commit

Permalink
Update TMVA scripts for ROOT6
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Pulvermacher committed Feb 27, 2015
1 parent abacbf8 commit 4466fd8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
6 changes: 3 additions & 3 deletions tmva/test/CorrGui.C
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ void CorrGui( TString fin = "TMVA.root", TString dirName = "InputVariables_Id",

// how many variables are in the directory?
Int_t noVar = TMVAGlob::GetNumberOfInputVariables(dir);
cout << "found number of variables='" << noVar<< endl;
TString Var[noVar];
cout << "found number of variables: " << noVar<< endl;
vector<TString> Var(noVar);

TIter next(dir->GetListOfKeys());
Int_t it=0;
Expand All @@ -69,7 +69,7 @@ void CorrGui( TString fin = "TMVA.root", TString dirName = "InputVariables_Id",
}
}
}
cout << "found histos for "<< it <<" variables='" << endl;
cout << "found histos for "<< it <<" variables." << endl;

for (Int_t ic=0;ic<it;ic++) {
cbar->AddButton( (Var[ic].Contains("_target") ?
Expand Down
11 changes: 9 additions & 2 deletions tmva/test/paracoor.C
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#include "tmvaglob.C"

#include "TParallelCoord.h"
#include "TParallelCoordVar.h"
#include "TParallelCoordRange.h"
#include "TTree.h"
#include "TLeaf.h"
#include "TFile.h"

// plot parallel coordinates

void paracoor( TString fin = "TMVA.root", Bool_t useTMVAStyle = kTRUE )
Expand Down Expand Up @@ -45,14 +52,14 @@ void paracoor( TString fin = "TMVA.root", Bool_t useTMVAStyle = kTRUE )
const Int_t nmva = mvas.size();
TCanvas* csig[nmva];
TCanvas* cbkg[nmva];
for (Int_t imva=0; imva<mvas.size(); imva++) {
for (UInt_t imva=0; imva<mvas.size(); imva++) {
cout << "--- Plotting parallel coordinates for : " << mvas[imva] << " & input variables" << endl;

for (Int_t itype=0; itype<2; itype++) {

// create draw option
TString varstr = mvas[imva] + ":";
for (Int_t ivar=0; ivar<vars.size(); ivar++) varstr += vars[ivar] + ":";
for (UInt_t ivar=0; ivar<vars.size(); ivar++) varstr += vars[ivar] + ":";
varstr.Resize( varstr.Last( ':' ) );

// create canvas
Expand Down
8 changes: 5 additions & 3 deletions tmva/test/probas.C
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "tmvaglob.C"

#include "TH2F.h"

// this macro plots the MVA probability distributions (Signal and
// Background overlayed) of different MVA methods run in TMVA
// (e.g. running TMVAnalysis.C).
Expand Down Expand Up @@ -72,7 +74,7 @@ void probas( TString fin = "TMVA.root", Bool_t useTMVAStyle = kTRUE )
TString methodTitle;
TMVAGlob::GetMethodTitle(methodTitle,instDir);
Bool_t found = kFALSE;
while (hkey = (TKey*)nextInDir()) {
while ((hkey = (TKey*)nextInDir())) {
TH1 *th1 = (TH1*)hkey->ReadObj();
TString hname= th1->GetName();
if (hname.Contains( suffixSig ) && !hname.Contains( "Cut") &&
Expand Down Expand Up @@ -147,7 +149,7 @@ void probas( TString fin = "TMVA.root", Bool_t useTMVAStyle = kTRUE )
Float_t ymin = 0;
Float_t ymax = TMath::Max( sig->GetMaximum(), bgd->GetMaximum() )*1.5;

if (Draw_CFANN_Logy && mvaName[imva] == "CFANN") ymin = 0.01;
if (Draw_CFANN_Logy && methodTitle == "CFANN") ymin = 0.01;

// build a frame
Int_t nb = 500;
Expand All @@ -160,7 +162,7 @@ void probas( TString fin = "TMVA.root", Bool_t useTMVAStyle = kTRUE )
// eventually: draw the frame
frame->Draw();

if (Draw_CFANN_Logy && mvaName[imva] == "CFANN") c->SetLogy();
if (Draw_CFANN_Logy && methodTitle == "CFANN") c->SetLogy();

// overlay signal and background histograms
sig->SetMarkerColor( TMVAGlob::c_SignalLine );
Expand Down

0 comments on commit 4466fd8

Please sign in to comment.