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" };
84 hrf = (
TH2F *)rfkey->ReadObj();
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 sprintf( cn,
"rulecorr%d_", 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 backgroung histo for" << hname << endl;
213 hrf2->
SetContour(nContours,&contourLevels[0]);
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) {
278 TString fname =
Form(
"plots/%s_c%i", outputName.
Data(), countCanvas+1 );
286 if (countPad <= noPad) {
288 TString fname =
Form(
"plots/%s_c%i", outfname[type].
Data(), countCanvas+1 );
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title Offset is a correction factor with respect to the "s...
virtual const char * GetTitle() const
Returns title of object.
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
void imgconv(TCanvas *c, const TString &fname)
virtual void SetMaximum(Double_t maximum=-1111)
This class displays a legend box (TPaveText) containing several legend entries.
virtual TList * GetListOfKeys() const
TString & ReplaceAll(const TString &s1, const TString &s2)
virtual void SetContour(Int_t nlevels, const Double_t *levels=0)
Set the number and values of contour levels.
TFile * OpenFile(const TString &fin)
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual void SetMinimum(Double_t minimum=-1111)
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
virtual void Update()
Update pad.
void SetMargin(Float_t margin)
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
TKey * NextKey(TIter &keyIter, TString className)
const char * Data() const
virtual TKey * GetKey(const char *, Short_t=9999) const
Float_t GetTopMargin() const
std::vector< std::vector< double > > Data
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
tomato 2-D histogram with a float per channel (see TH1 documentation)}
void rulevisCorr(TString fin="TMVA.root", TMVAGlob::TypeOfPlot type=TMVAGlob::kNorm, bool useTMVAStyle=kTRUE)
The most important graphics class in the ROOT system.
char * Form(const char *fmt,...)
virtual const char * GetName() const
Returns name of object.
The ROOT global object gROOT contains a list of all defined classes.
Float_t GetLeftMargin() const
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
Describe directory structure in memory.
virtual void SetRightMargin(Float_t rightmargin)
Set Pad right margin in fraction of the pad width.
virtual TObject * ReadObj()
To read a TObject* from the file.
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
Short_t Max(Short_t a, Short_t b)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
virtual void SetTitle(const char *title)
Change (i.e.
virtual void Update()
Update canvas pad buffers.
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 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...
virtual void SetBorderSize(Int_t bordersize=4)
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.
UInt_t GetListOfTitles(TDirectory *rfdir, TList &titles)