21 TString dirname = methodType +
"/" + methodTitle +
"/" +
"EpochMonitoring";
24 cout <<
"Big troubles: could not find directory \"" << dirname <<
"\"" << endl;
32 std::vector<TString> epochList;
34 while ((key = (
TKey*)keyIt())) {
36 if (!
gROOT->GetClass(key->GetClassName())->InheritsFrom(
"TH2F"))
continue;
39 if (!name.
BeginsWith(
"epochmonitoring___"))
continue;
47 for (std::vector<TString>::const_iterator it = epochList.begin(); it < epochList.end(); it++) {
48 if (*it == es) isOld =
kTRUE;
51 epochList.push_back( es );
54 TString bulkname =
Form(
"epochmonitoring___epoch_%s_weights_hist", es.
Data() );
68 const Int_t width = 600;
79 Int_t countCanvas = 0;
82 TString dirname = methodType +
"/" + methodTitle +
"/" +
"EpochMonitoring";
85 cout <<
"Big troubles: could not find directory \"" << dirname <<
"\"" << endl;
92 while ((titkeyTit = (
TKey*)keyItTit())) {
94 if (!
gROOT->GetClass(titkeyTit->GetClassName())->InheritsFrom(
"TH1F"))
continue;
95 TString name = titkeyTit->GetName();
97 if (!name.
BeginsWith(
"convergencetest___"))
continue;
98 if (!name.
Contains(
"_train_"))
continue;
103 cout <<
"Big troubles with histogram: " << name <<
" -> should end with _S" << endl;
109 TString ctitle =
Form(
"TMVA response %s",methodTitle.Data());
110 c =
new TCanvas(
Form(
"canvas%d", countCanvas), ctitle, 0, 0, width, (
Int_t)width*0.78 );
112 TH1F* sig = (
TH1F*)titkeyTit->ReadObj();
113 sig->
SetTitle(
Form(
"TMVA response for classifier: %s", methodTitle.Data()) );
115 TString dataType = (name.
Contains(
"_train_") ?
"(training sample)" :
"(test sample)");
119 TH1F* bgd =
dynamic_cast<TH1F*
>(epochDir->
Get( nbn ));
121 cout <<
"Big troubles with histogram: " << bgd <<
" -> cannot find!" << endl;
125 cout <<
"sig = " << sig->
GetName() << endl;
126 cout <<
"bgd = " << bgd->
GetName() << endl;
136 if (xmin == 0 && xmax == 0) {
164 cout <<
"Big troubles in epoch parsing: \"" << es <<
"\" is not float" << endl;
172 c->GetPad(0)->SetLeftMargin( 0.105 );
177 c->GetLeftMargin() + 0.5, 1 - c->GetTopMargin() );
183 legend->
Draw(
"same");
189 t->
DrawTextNDC( 1 - c->GetRightMargin(), 1 - c->GetTopMargin() + 0.015,
Form(
"Epoch: %i", epoch) );
192 sig->
Draw(
"samehist");
193 bgd->
Draw(
"samehist");
196 TString outdirname =
"movieplots";
202 cout <<
"storing file: " << foutname << endl;
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 * GetName() const
Returns name of object.
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 TList * GetListOfKeys() const
This class displays a legend box (TPaveText) containing several legend entries.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
Collectable string class.
TString & ReplaceAll(const TString &s1, const TString &s2)
TFile * OpenFile(const TString &fin)
void NormalizeHists(TH1 *sig, TH1 *bkg=0)
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
Bool_t IsFloat() const
Returns kTRUE if string contains a floating point or integer number.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
void SetSignalAndBackgroundStyle(TH1 *sig, TH1 *bkg, TH1 *all=0)
virtual Double_t GetMean(Int_t axis=1) const
For axis = 1,2 or 3 returns the mean value of the histogram along X,Y or Z axis.
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
tomato 1-D histogram with a float per channel (see TH1 documentation)}
Short_t Min(Short_t a, Short_t b)
void SetMargin(Float_t margin)
Double_t GetRMS(Int_t axis=1) const
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
void MovieMaker(TString dataset, TString methodType="Method_MLP", TString methodTitle="MLP")
TObject * At(Int_t idx) const
virtual TText * DrawTextNDC(Double_t x, Double_t y, const char *text)
Draw this text with new coordinates in NDC.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Base class for several text objects.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
void draw_network(TString dataset, TFile *f, TDirectory *d, const TString &hName="weights_hist", Bool_t movieMode=kFALSE, const TString &epoch="")
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
void DrawMLPoutputMovie(TString dataset, TFile *file, const TString &methodType, const TString &methodTitle)
virtual void Draw(Option_t *option="")
Draw this histogram with options.
tomato 2-D histogram with a float per channel (see TH1 documentation)}
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
char * Form(const char *fmt,...)
virtual TDirectory * GetDirectory(const char *apath, Bool_t printError=false, const char *funcname="GetDirectory")
Find a directory named "apath".
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
Describe directory structure in memory.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Mother of all ROOT objects.
void DrawNetworkMovie(TString dataset, TFile *file, const TString &methodType, const TString &methodTitle)
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
Short_t Max(Short_t a, Short_t b)
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
Int_t Atoi() const
Return integer value of string.
virtual void SetTitle(const char *title)
Change (i.e.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
THist< 2, float, THistStatContent, THistStatUncertainty > TH2F
virtual void SetBorderSize(Int_t bordersize=4)
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
virtual const char * GetTitle() const
Returns title of object.
const char * Data() const