14 Int_t FillStyle__S = 1001;
16 Int_t LineWidth__S = 2;
21 Int_t FillStyle__B = 3554;
23 Int_t LineWidth__B = 2;
64 Int_t FillColors[10] = {38,2,3,6,7,8,9,11};
65 Int_t LineColors[10] = {4,2,3,6,7,8,9,11};
66 Int_t FillStyles[5] = {1001,3554,3003,3545,0};
91 gPad->SetLeftMargin ( 0.108*scale );
92 gPad->SetRightMargin ( 0.050*scale );
93 gPad->SetBottomMargin( 0.120*scale );
100 gROOT->SetStyle(
"TMVA");
106 TMVAStyle->
SetTitle(
"TMVA style based on \"Plain\" with modifications defined in tmvaglob.C");
107 gROOT->GetListOfStyles()->Add(TMVAStyle);
108 gROOT->SetStyle(
"TMVA");
172 while ((o = itc()))
delete o;
183 gROOT->SetStyle(
"Plain");
195 if (
file==0 || fin !=
file->GetName()) {
200 cout <<
"--- Opening root file " << fin <<
" in read mode" << endl;
216 cout <<
"*** Error in TMVAGlob::imgconv: canvas is NULL" << endl;
225 Error(
"imgconv",
"Error creating plot directory: %s",dir.
Data());
229 TString pngName = fname +
".png";
230 TString gifName = fname +
".gif";
231 TString epsName = fname +
".eps";
232 TString pdfName = fname +
".pdf";
236 if (
gConfig().fVariablePlotting.fUsePaperStyle) {
240 if (
gConfig().fVariablePlotting.fPlotFormat == Config::VariablePlotting::kGIF)
242 else if (
gConfig().fVariablePlotting.fPlotFormat == Config::VariablePlotting::kPDF)
244 else if (
gConfig().fVariablePlotting.fPlotFormat == Config::VariablePlotting::kEPS)
256 TString tutorialPath = getenv (
"ROOTSYS");
257 tutorialPath+=
"/tutorials/tmva";
265 cout <<
"+++ Could not open image: " << fullName << endl;
275 cout <<
"+++ Could not open image tmva_logo.gif" << endl;
295 if (y1T>0.99) y1T = 0.99;
297 TPad *p1 =
new TPad(
"imgpad",
"imgpad", x1L, y1B, x1R, y1T );
306 if (xSizeInPixel<=25 || ySizeInPixel<=25) {
318 if (
h->GetSumw2N() == 0)
h->Sumw2();
319 if(
h->GetSumOfWeights()!=0) {
320 Float_t dx = (
h->GetXaxis()->GetXmax() -
h->GetXaxis()->GetXmin())/
h->GetNbinsX();
321 h->Scale( 1.0/
h->GetSumOfWeights()/dx );
345 name.ReplaceAll(
"Method_",
"");
356 name.ReplaceAll(
"Method_",
"");
376 if (key==0) loop =
kFALSE;
392 while ((mkey = (
TKey*)mnext())) {
406 cout <<
"tmvaglob::GetNumberOfTargets is called with *dir==NULL :( " << endl;
413 while ((key = (
TKey*)next())) {
426 while ((key = (
TKey*)next())) {
440 std::vector<TString> names;
442 while ((key = (
TKey*)next())) {
452 std::vector<TString>::const_iterator iter = names.begin();
453 while(iter != names.end()){
454 if(
name.CompareTo(*iter)==0)
459 names.push_back(
name);
466 return names.end() - names.begin();
475 std::vector<TString> names;
477 while ((key = (
TKey*)next())) {
485 name.ReplaceAll(
"_Deco",
"");
486 name.ReplaceAll(
"_Gauss",
"");
487 name.ReplaceAll(
"_PCA",
"");
488 name.ReplaceAll(
"_Id",
"");
489 name.ReplaceAll(
"_vs_",
"");
490 name.Remove(0, pos + 2);
506 std::vector<TString>::const_iterator iter = names.begin();
507 while(iter != names.end()){
508 if(
name.CompareTo(*iter)==0)
513 names.push_back(
name);
528 mkey = (
TKey*)mnext();
556 mkey = (
TKey*)mnext();
568 cout <<
"HUUUGE TROUBLES IN TMVAGlob::ExistMethodName() --> contact authors" << endl;
574 while ((mkey_ = (
TKey*)mnext_())) {
600 while ((mkey = (
TKey*)mnext())) {
611 cout <<
"--- Found " << ni <<
" classifier types" << endl;
621 while ((key = (
TKey*)next())) {
630 while ((jobkey = (
TKey*)keyIt())) {
631 if (!
gROOT->GetClass(jobkey->
GetClassName())->InheritsFrom(
"TDirectory"))
continue;
634 cout <<
"jobdir name " << jobDir->
GetName() << endl;
647 if (rfdir==0)
return 0;
650 cout <<
"+++ Directory '" << rfdir->
GetName() <<
"' contains no keys" << endl;
658 while ((rfkey = (
TKey*)rfnext())) {
666 cout <<
"--- Found " << ni <<
" instance(s) of the method " << rfdir->
GetName() << endl;
679 cout <<
"+++ Could not locate directory '" << methodName << endl;
687 cout <<
"+++ Directory '" << methodName <<
"' contains no keys" << endl;
695 while ((rfkey = (
TKey*)rfnext())) {
703 cout <<
"--- Found " << ni <<
" instance(s) of the method " << methodName << endl;
710 const TString directories[TMVAGlob::kNumOfMethods] = {
"InputVariables_Id",
711 "InputVariables_Deco",
712 "InputVariables_PCA",
713 "InputVariables_Gauss_Deco" };
719 cout <<
"+++ Could not locate input variable directory '" << directories[
type] << endl;
729 if (dir==0)
return 0;
733 cout <<
"+++ Could not find CorrelationPlots directory 'CorrelationPlots'" << endl;
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Option_t Option_t SetLineWidth
Option_t Option_t SetFillStyle
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t SetLineColor
Option_t Option_t SetFillColor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TStyle * gStyle
R__EXTERN TSystem * gSystem
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
virtual void SetTitleSize(Float_t size=0.04)
Set size of 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 SetConstRatio(Bool_t constRatio=kTRUE)
Set (constRatio = kTRUE) or unset (constRadio = kFALSE) the ratio flag.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual void SetBottomMargin(Float_t bottommargin)
Set Pad bottom margin in fraction of the pad height.
virtual void SetLeftMargin(Float_t leftmargin)
Set Pad left margin in fraction of the pad width.
virtual void SetRightMargin(Float_t rightmargin)
Set Pad right margin in fraction of the pad width.
virtual void SetTopMargin(Float_t topmargin)
Set Pad top margin in fraction of the pad height.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Bool_t InheritsFrom(const char *cl) const override
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.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
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 a suite of consecutive data records (TKey instances) with a well defined format.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
TH1 is the base class of all histogram classes in ROOT.
virtual void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X")
Set offset between axis and axis' labels.
virtual Int_t GetNbinsX() const
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
virtual Int_t GetSumw2N() const
virtual Double_t GetSumOfWeights() const
Return the sum of weights excluding under/overflows.
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
An abstract interface to image processing library.
static TImage * Open(const char *file, EImageFileTypes type=kUnknown)
Open a specified image file.
virtual UInt_t GetWidth() const
virtual UInt_t GetHeight() const
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual const char * GetClassName() const
Short_t GetCycle() const
Return cycle number associated to this key.
virtual TObject * ReadObj()
To read a TObject* from the file.
void Clear(Option_t *option="") override
Remove all objects from the list.
void Add(TObject *obj) override
class TMVA::Config::VariablePlotting fVariablePlotting
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
Int_t GetEntriesFast() const
Mother of all ROOT objects.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
The most important graphics class in the ROOT system.
Int_t UtoAbsPixel(Double_t u) const override
Int_t VtoAbsPixel(Double_t v) const override
TVirtualPad * cd(Int_t subpadnumber=0) override
Set Current pad.
void Draw(Option_t *option="") override
Draw Pad in Current pad (re-parent pad if necessary).
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Remove(Ssiz_t pos)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TStyle objects may be created to define special styles.
void SetPadBorderMode(Int_t mode=1)
void SetOptTitle(Int_t tit=1)
void SetPadTopMargin(Float_t margin=0.1)
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
void SetPadBottomMargin(Float_t margin=0.1)
void SetFrameFillColor(Color_t color=1)
void SetPadRightMargin(Float_t margin=0.1)
void SetCanvasColor(Color_t color=19)
Float_t GetPadRightMargin() const
void SetTitleBorderSize(Width_t size=2)
void SetCanvasBorderMode(Int_t mode=1)
void SetFrameBorderMode(Int_t mode=1)
void SetPadTickY(Int_t ticky)
void SetPadTickX(Int_t tickx)
void SetTitleTextColor(Color_t color=1)
void SetPalette(Int_t ncolors=kBird, Int_t *colors=nullptr, Float_t alpha=1.)
See TColor::SetPalette.
void SetPadLeftMargin(Float_t margin=0.1)
void SetLegendBorderSize(Width_t size=4)
void SetTitleFillColor(Color_t color=1)
void SetLineStyleString(Int_t i, const char *text)
Set line style string using the PostScript convention.
void SetPaperSize(EPaperSize size)
Set paper size for PostScript output.
void SetPadColor(Color_t color=19)
void SetTitleH(Float_t h=0)
void SetHistLineWidth(Width_t width=1)
void SetOptFit(Int_t fit=1)
The type of information about fit parameters printed in the histogram statistics box can be selected ...
Float_t GetPadTopMargin() const
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
Make a file system directory.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
UInt_t GetListOfJobs(TFile *file, TList &jobdirs)
UInt_t GetListOfTitles(TDirectory *rfdir, TList &titles)
void Initialize(Bool_t useTMVAStyle=kTRUE)
Int_t GetNumberOfInputVariablesMultiClass(TDirectory *dir)
Int_t GetNumberOfInputVariables(TDirectory *dir)
TKey * NextKey(TIter &keyIter, TString className)
void GetMethodTitle(TString &name, TKey *ikey)
void plot_logo(Float_t v_scale=1.0, Float_t skew=1.0)
Int_t getBackgroundFill()
TDirectory * GetInputVariablesDir(TMVAGlob::TypeOfPlot type, TDirectory *dir=nullptr)
void SetSignalAndBackgroundStyle(TH1 *sig, TH1 *bkg, TH1 *all=nullptr)
TFile * OpenFile(const TString &fin)
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
TKey * FindMethod(TString name, TDirectory *dir=nullptr)
void NormalizeHists(TH1 *sig, TH1 *bkg=nullptr)
Int_t getBackgroundLine()
Bool_t ExistMethodName(TString name, TDirectory *dir=nullptr)
UInt_t GetListOfMethods(TList &methods, TDirectory *dir=nullptr)
void GetMethodName(TString &name, TKey *mkey)
Int_t GetNumberOfTargets(TDirectory *dir)
TImage * findImage(const char *imageName)
std::vector< TString > GetInputVariableNames(TDirectory *dir)
void SetMultiClassStyle(TObjArray *hists)
void NormalizeHist(TH1 *h)
TDirectory * GetCorrelationPlotsDir(TMVAGlob::TypeOfPlot type, TDirectory *dir=nullptr)
std::vector< TString > GetClassNames(TDirectory *dir)
UInt_t GetListOfKeys(TList &keys, TString inherits, TDirectory *dir=nullptr)
void imgconv(TCanvas *c, const TString &fname)