31 while ((key = (
TKey *)keys_dir())) {
33 if (
name.BeginsWith(
"InputVariables_")) {
50 Int_t countCanvas = 0;
55 while ((key = (
TKey*)next())) {
67 while ((titkey = (
TKey*)keyIt())) {
69 if (!
gROOT->GetClass(titkey->
GetClassName())->InheritsFrom(
"TDirectory"))
continue;
75 cout <<
"--- Found directory for method: " << methodName <<
"::" << methodTitle << endl;
76 TString hname =
"MVA_" + methodTitle;
77 for(
UInt_t icls = 0; icls < classnames.size(); ++icls){
80 std::vector<TString>::iterator classiter = classnames.
begin();
81 for(; classiter!=classnames.end(); ++classiter){
83 +
"_prob_for_" + *classiter);
86 cout <<
":\t mva distribution not available (this is normal for Cut classifier)" << endl;
99 TString::Format(
"TMVA response for class %s %s", classnames.at(icls).Data(),methodTitle.
Data()) :
100 TString::
Format(
"TMVA comparison for class %s %s", classnames.at(icls).Data(),methodTitle.Data())) ;
113 if(((
TH1*)hists[i])->GetMaximum() > histmax)
114 histmax = ((
TH1*)hists[i])->GetMaximum();
132 frame->
GetXaxis()->
SetTitle(methodTitle +
" response for " + classnames.at(icls));
139 c->GetPad(0)->SetLeftMargin( 0.105 );
143 TLegend *legend=
new TLegend(
c->GetLeftMargin(), 1 -
c->GetTopMargin() - 0.12,
144 c->GetLeftMargin() + (htype == kCompareType ? 0.40 : 0.3), 1 -
c->GetTopMargin() );
146 classiter = classnames.begin();
154 legend->
Draw(
"same");
159 ((
TH1*)hists[i])->Draw(
"histsame");
161 ((
TH1*)hists[i])->GetYaxis()->SetTitle( ytit );
166 if (htype == kCompareType) {
170 classiter = classnames.
begin();
171 for(; classiter!=classnames.end(); ++classiter){
173 +
"_prob_for_" + *classiter);
176 cout <<
":\t comparison histogram for overtraining check not available!" << endl;
182 TLegend *legend2=
new TLegend( 1 -
c->GetRightMargin() - 0.42, 1 -
c->GetTopMargin() - 0.12,
183 1 -
c->GetRightMargin(), 1 -
c->GetTopMargin() );
187 classiter = classnames.begin();
189 legend2->
AddEntry(((
TH1*)othists[i]),*classiter+
" (training sample)",
"P");
192 legend2->
Draw(
"same");
197 if(((
TH1*)othists[i])->GetMaximum() > histmax)
198 histmax = ((
TH1*)othists[i])->GetMaximum();
203 Int_t col = ((
TH1*)hists[i])->GetLineColor();
204 ((
TH1*)othists[i])->SetMarkerSize( 0.7 );
205 ((
TH1*)othists[i])->SetMarkerStyle( 20 );
206 ((
TH1*)othists[i])->SetMarkerColor( col );
207 ((
TH1*)othists[i])->SetLineWidth( 1 );
208 ((
TH1*)othists[i])->Draw(
"e1same");
211 ymax = histmax*maxMult;
217 ((
TH1*)hists[i])->SetLineWidth( 1 );
223 cout <<
"--- Perform Kolmogorov-Smirnov tests" << endl;
224 cout <<
"--- Goodness of consistency for class " << classnames.at(icls)<< endl;
227 Float_t kol = ((
TH1*)hists[j])->KolmogorovTest(((
TH1*)othists[j]),
"X");
228 cout << classnames.at(j) <<
": " << kol << endl;
241 frame->
Draw(
"sameaxis");
static char * Format(const char *format, va_list ap)
Format a string in a circular formatting buffer (using a printf style format descriptor).
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
TDirectory * GetDirectory(const char *apath, Bool_t printError=false, const char *funcname="GetDirectory") override
Find a directory named "apath".
Describe directory structure in memory.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual TList * GetListOfKeys() const
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
1-D histogram with a float per channel (see TH1 documentation)
TH1 is the base class of all histogram classes in ROOT.
virtual void SetMaximum(Double_t maximum=-1111)
void Draw(Option_t *option="") override
Draw this histogram with options.
virtual void SetMinimum(Double_t minimum=-1111)
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual const char * GetClassName() const
virtual TObject * ReadObj()
To read a TObject* from the file.
This class displays a legend box (TPaveText) containing several legend entries.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
void Draw(Option_t *option="") override
Draw this legend with its current attributes.
void SetMargin(Float_t margin)
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
Int_t GetEntriesFast() const
TObject * First() const override
Return the object in the first slot.
void Add(TObject *obj) override
Mother of all ROOT objects.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
virtual void SetBorderSize(Int_t bordersize=4)
Sets the border size of the TPave box and shadow.
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Initialize(Bool_t useTMVAStyle=kTRUE)
void GetMethodTitle(TString &name, TKey *ikey)
void plot_logo(Float_t v_scale=1.0, Float_t skew=1.0)
TFile * OpenFile(const TString &fin)
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
void GetMethodName(TString &name, TKey *mkey)
void SetMultiClassStyle(TObjArray *hists)
void NormalizeHist(TH1 *h)
std::vector< TString > GetClassNames(TDirectory *dir)
void imgconv(TCanvas *c, const TString &fname)
void mvasMulticlass(TString dataset, TString fin="TMVAMulticlass.root", HistType htype=kMVAType, Bool_t useTMVAStyle=kTRUE)