30 }
else if (type == 3) {
38 TCanvas*
c =
new TCanvas(
"c",
"the canvas", 200, 0, 650, 500 );
45 Float_t x0L = 0.107, y0H = 0.899;
46 Float_t dxL = 0.457-x0L, dyH = 0.22;
49 y0H = 1 - y0H + dyH + 0.07;
51 TLegend *legend =
new TLegend( x0L, y0H-dyH, x0L+dxL, y0H );
56 TString xtit =
"Signal efficiency";
57 TString ytit =
"Background efficiency";
58 if (type == 2) ytit =
"Background rejection";
59 if (type == 3) ytit =
"1/(Background eff.)";
60 TString ftit = ytit +
" versus " + xtit;
62 TString hNameRef =
"effBvsS";
63 if (type == 2) hNameRef =
"rejBvsS";
64 if (type == 3) hNameRef =
"invBeffvsSeff";
67 if (TString(BinDir->
GetName()).Contains(
"multicut")){
76 cout <<
"ups .. no methods found in to plot ROC curve for ... give up" << endl;
79 TIter xnext(&xmethods);
82 while ((xkey = (TKey*)xnext())) {
83 TDirectory * mDir = (TDirectory*)xkey->
ReadObj();
86 if (ninst==0) cout <<
"hmm... sorry, but this printout was supposed to be only to keep the compiler quite.. never supposed to happen :(" << endl;
87 TIter nextTitle(&titles);
91 titDir = (TDirectory *)titkey->
ReadObj();
100 if (type==3 &&
h->GetMaximum() > y2) y2 =
h->GetMaximum()*1.1;
108 if(
gROOT->FindObject(
"frame")!=0)
gROOT->FindObject(
"frame")->Delete();
109 TH2F* frame =
new TH2F(
"frame", ftit, 500, x1, x2, 500, y1, y2 );
124 cout <<
"ups .. no methods found in to plot ROC curve for ... give up" << endl;
128 TIter next(&methods);
131 while ((key = (TKey*)next())) {
132 TDirectory * mDir = (TDirectory*)key->
ReadObj();
135 if (ninst==0) cout <<
"hmm... sorry, but this printout was supposed to be only to keep the compiler quite.. never supposed to happen :(" << endl;
136 TIter nextTitle(&titles);
140 titDir = (TDirectory *)titkey->
ReadObj();
147 TString hname =
h->GetName();
150 h->SetLineColor(color);
151 color++;
if (color == 5 || color == 10 || color == 11)
color++;
161 TListIter hIt(&hists);
164 TH1* histWithLargestInt(0);
165 while ((hist = (TH1*)hIt())!=0) {
166 Double_t integral = hist->Integral(1,hist->FindBin(0.9999));
167 if (integral>largestInt) {
168 largestInt = integral;
169 histWithLargestInt = hist;
172 if (histWithLargestInt == 0) {
173 cout <<
"ERROR - unknown hist \"histWithLargestInt\" --> serious problem in ROOT file" << endl;
176 legend->
AddEntry(histWithLargestInt,TString(histWithLargestInt->GetTitle()).ReplaceAll(
"MVA_",
""),
"l");
177 hists.
Remove(histWithLargestInt);
183 dyH *= (1.0 +
Float_t(nmva - 3.0)/4.0);
184 legend->
SetY1( y0H - dyH );
187 dyH *= (
Float_t(std::min(10,nmva) - 3.0)/4.0);
188 legend->
SetY2( y0H + dyH);
192 frame->
Draw(
"sameaxis");
193 legend->
Draw(
"same");
203 TString fname = dataset+
"/plots/" + hNameRef;
204 if (TString(BinDir->
GetName()).Contains(
"multicut")){
205 TString fprepend(BinDir->
GetName());
206 fprepend.ReplaceAll(
"multicutMVA_",
"");
207 fname = dataset+
"plots/" + fprepend +
"_" + hNameRef;
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
TDirectory * GetDirectory(const char *apath, Bool_t printError=false, const char *funcname="GetDirectory") override
Find a directory using apath.
Describe directory structure in memory.
virtual TList * GetListOfKeys() const
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
void Draw(Option_t *option="") override
Draw this histogram with options.
virtual TObject * ReadObj()
To read a TObject* from the file.
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.
virtual void SetHeader(const char *header="", Option_t *option="")
void SetMargin(Float_t margin)
void Add(TObject *obj) override
TObject * Remove(TObject *obj) override
Remove object from the list.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual const char * GetName() const
Returns name of object.
void SetY1(Double_t y1) override
Set the Y1 value.
void SetY2(Double_t y2) override
Set the Y2 value.
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
UInt_t GetListOfTitles(TDirectory *rfdir, TList &titles)
void Initialize(Bool_t useTMVAStyle=kTRUE)
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)
TFile * OpenFile(const TString &fin)
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
UInt_t GetListOfMethods(TList &methods, TDirectory *dir=nullptr)
void imgconv(TCanvas *c, const TString &fname)
void efficiencies(TString dataset, TString fin="TMVA.root", Int_t type=2, Bool_t useTMVAStyle=kTRUE)
void plot_efficiencies(TString dataset, TFile *file, Int_t type=2, TDirectory *BinDir=nullptr)