13 TString outfname = dirName;
14 TString tmp = dirName;
22 TString htitle = title;
32 cout <<
"No information about " << title <<
" available in directory " << dirName <<
" of file " << fin << endl;
48 xPad = 1; yPad = 1; width = 550; height = 0.90*width;
break;
50 xPad = 2; yPad = 1; width = 600; height = 0.50*width;
break;
52 xPad = 3; yPad = 1; width = 900; height = 0.4*width;
break;
54 xPad = 2; yPad = 2; width = 600; height = width;
break;
56 xPad = 3; yPad = 2; width = 800; height = 0.55*width;
break;
59 Int_t noPadPerCanv = xPad * yPad ;
62 Int_t countCanvas = 0;
66 TCanvas* canv =
nullptr;
74 std::vector<TString>::iterator variter = varnames.begin();
75 std::vector<TString>::iterator classiter = classnames.begin();
93 variter = varnames.begin();
94 for(; variter!=varnames.end(); ++variter){
97 if (countPad%noPadPerCanv==0) {
100 countCanvas*50+50, countCanvas*20, width, height );
104 TPad* cPad = (TPad*)canv->
cd(countPad++%noPadPerCanv+1);
105 classiter = classnames.begin();
108 for(; classiter!=classnames.end(); ++classiter){
110 TString hname = *variter +
"__" + *classiter +
"_" + tmp;
111 TH1 *hist = (TH1*)dir->
Get(hname);
114 cout <<
"ERROR!!! couldn't find " << *variter <<
" histogram for class " << *classiter << endl;
125 ((TH1*)hists.
First())->SetTitle( TString( htitle ) +
": " + *variter );
133 if(((TH1*)hists[i])->GetMaximum() > histmax)
134 histmax = ((TH1*)hists[i])->GetMaximum();
139 if (countPad == 1) sc = 1.3;
140 ((TH1*)hists.
First())->SetMaximum( histmax*sc );
142 ((TH1*)hists.
First())->Draw(
"hist" );
144 ((TH1*)hists.
First())->GetYaxis()->SetTitleOffset( 1.70 );
148 ((TH1*)hists[i])->Draw(
"histsame");
149 TString ytit = TString(
"(1/N) ") + ((TH1*)hists[i])->GetYaxis()->GetTitle();
150 ((TH1*)hists[i])->GetYaxis()->SetTitle( ytit );
162 classiter = classnames.begin();
165 legend->
AddEntry(((TH1*)hists[i]),*classiter,
"F");
170 legend->
Draw(
"same");
174 ((TH1*)hists.
First())->Draw(
"sameaxis");
178 Int_t nbin = ((TH1*)hists.
First())->GetNbinsX();
183 classiter = classnames.begin();
185 if(((TH1*)hists[i])->GetBinContent(0)!=0 || ((TH1*)hists[i])->GetBinContent(nbin+1)!=0){
186 uoflow += *classiter;
188 ((TH1*)hists[i])->GetBinContent(0)*dxu*100, ((TH1*)hists[i])->GetBinContent(nbin+1)*dxo*100);
192 TText* t =
new TText( 0.98, 0.14, uoflow );
200 if (countPad%noPadPerCanv==0) {
207 createNewFig =
kTRUE;
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetLeftMargin(Float_t leftmargin)
Set Pad left margin in fraction of the pad width.
Float_t GetLeftMargin() const
Float_t GetTopMargin() const
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
void Draw(Option_t *option="") override
Draw a canvas.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
TDirectory * GetDirectory(const char *apath, Bool_t printError=false, const char *funcname="GetDirectory") override
Find a directory using apath.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual Bool_t cd()
Change current directory to "this" directory.
virtual TList * GetListOfKeys() const
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
void Draw(Option_t *option="") override
Draw this box with its current attributes.
void SetMargin(Float_t margin)
Int_t GetEntriesFast() const
TObject * First() const override
Return the object in the first slot.
void Add(TObject *obj) override
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
Automatic pad generation by division.
virtual void SetBorderSize(Int_t bordersize=4)
Sets the border size of the TPave box and shadow.
void ToLower()
Change string to lower-case.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
virtual void SetNDC(Bool_t isNDC=kTRUE)
void Initialize(Bool_t useTMVAStyle=kTRUE)
Int_t GetNumberOfInputVariables(TDirectory *dir)
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)
std::vector< TString > GetInputVariableNames(TDirectory *dir)
void SetMultiClassStyle(TObjArray *hists)
void NormalizeHist(TH1 *h)
std::vector< TString > GetClassNames(TDirectory *dir)
void imgconv(TCanvas *c, const TString &fname)
void variablesMultiClass(TString dataset, TString fin="TMVA.root", TString dirName="InputVariables_Id", TString title="TMVA Input Variables", Bool_t isRegression=kFALSE, Bool_t useTMVAStyle=kTRUE)