34 TString dirname=
"Method_RuleFit";
43 while ((key = (
TKey*)next())) {
45 if (!
gROOT->GetClass(key->GetClassName())->InheritsFrom(
"TDirectory"))
continue;
52 TIter keyIter(&titles);
64 if (vardir==0)
return;
65 if (corrdir==0)
return;
68 const TString maintitle = rfName +
" : Rule Importance, 2D";
69 const TString rfNameOpt =
"_RF2D_";
73 "rulevisCorr_gaussdecorr" };
93 if (valmax>rfmax) rfmax = valmax;
94 if (valmin<rfmin) rfmin = valmin;
101 cout <<
"ERROR: no RF2D plots found..." << endl;
106 Double_t targetrange = maxrange - minrange;
108 const Int_t nContours = 100;
112 for (
Int_t i=0; i<nContours; i++) {
113 contourLevels[i] = rfmin+dcl*
Double_t(i);
121 Int_t noPlots = (noVars*(noVars+1)/2) - noVars;
132 xPad = 1; yPad = 1;
width = 500; height = 0.7*
width;
break;
134 xPad = 2; yPad = 1;
width = 600; height = 0.7*
width;
break;
136 xPad = 3; yPad = 1;
width = 900; height = 0.4*
width;
break;
138 xPad = 2; yPad = 2;
width = 600; height =
width;
break;
140 xPad = 3; yPad = 2;
width = 800; height = 0.7*
width;
break;
142 Int_t noPad = xPad * yPad ;
145 const Int_t noCanvas = 1 + (
Int_t)((noPlots - 0.001)/noPad);
147 for (
Int_t ic=0; ic<noCanvas; ic++)
c[ic] = 0;
150 Int_t countCanvas = 0;
160 while ((key = (
TKey*)next())) {
171 if ((
c[countCanvas]==NULL) || (countPad>noPad)) {
173 cname += countCanvas + 1;
176 c[countCanvas] =
new TCanvas( cname, maintitle,
177 countCanvas*50+200, countCanvas*20,
width, height );
179 c[countCanvas]->Divide(xPad,yPad);
183 TPad *cPad = (
TPad *)(
c[countCanvas]->GetPad(countPad));
184 c[countCanvas]->
cd(countPad);
193 cout <<
"ERROR!!! couldn't find background histo for" << hname << endl;
213 hrf2->
SetContour(nContours,&contourLevels[0]);
225 title.ReplaceAll(
"signal",
"");
235 hrf2->
Draw(
"colz ah");
237 if (countPad==2) sc = 1.3;
241 sig->
Scale(1.0/smax);
243 sig->
Draw(
"same cont3");
246 bgd->
Scale(1.0/smax);
248 bgd->
Draw(
"same cont3");
255 sig->
Draw(
"sameaxis");
267 legend->
AddEntry(bgd,
"Background",
"F");
268 legend->
Draw(
"same");
276 if (countPad > noPad) {
277 c[countCanvas]->Update();
278 TString fname =
Form(
"plots/%s_c%i", outputName.
Data(), countCanvas+1 );
286 if (countPad <= noPad) {
287 c[countCanvas]->Update();
288 TString fname =
Form(
"plots/%s_c%i", outfname[
type].Data(), countCanvas+1 );
include TDocParser_001 C image html pict1_TDocParser_001 png width
char * Form(const char *fmt,...)
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Float_t GetLeftMargin() const
virtual void SetRightMargin(Float_t rightmargin)
Set Pad right margin in fraction of the pad width.
Float_t GetTopMargin() const
TClass instances represent classes, structs and namespaces in the ROOT type system.
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Describe directory structure in memory.
virtual Bool_t cd()
Change current directory to "this" directory.
virtual TKey * GetKey(const char *, Short_t=9999) const
virtual TList * GetListOfKeys() const
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
virtual void SetTitle(const char *title)
See GetStatOverflows for more information.
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
virtual void SetMaximum(Double_t maximum=-1111)
virtual void SetContour(Int_t nlevels, const Double_t *levels=0)
Set the number and values of contour levels.
virtual void SetMinimum(Double_t minimum=-1111)
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
virtual Double_t GetMinimum(Double_t minval=-FLT_MAX) const
Return minimum value larger than minval of bins in the range, unless the value has been overridden by...
2-D histogram with a float per channel (see TH1 documentation)}
virtual TH2 * Rebin2D(Int_t nxgroup=2, Int_t nygroup=2, const char *newname="")
Rebin this histogram grouping nxgroup/nygroup bins along the xaxis/yaxis together.
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.
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
void SetMargin(Float_t margin)
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
The most important graphics class in the ROOT system.
void Update() override
Update pad.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set Current pad.
virtual void SetBorderSize(Int_t bordersize=4)
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
UInt_t GetListOfTitles(TDirectory *rfdir, TList &titles)
TKey * NextKey(TIter &keyIter, TString className)
TFile * OpenFile(const TString &fin)
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
void imgconv(TCanvas *c, const TString &fname)
void rulevisCorr(TString fin="TMVA.root", TMVAGlob::TypeOfPlot type=TMVAGlob::kNorm, bool useTMVAStyle=kTRUE)
Short_t Max(Short_t a, Short_t b)