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())) {
39 if (!
name.BeginsWith(
"epochmonitoring___"))
continue;
42 TObjArray* tokens =
name.Tokenize(
"_");
43 TString es = ((TObjString*)tokens->
At(2))->GetString();
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 );
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())) {
97 if (!
name.BeginsWith(
"convergencetest___"))
continue;
98 if (!
name.Contains(
"_train_"))
continue;
99 if (
name.EndsWith(
"_B"))
continue;
102 if (!
name.EndsWith(
"_S")) {
103 cout <<
"Big troubles with histogram: " <<
name <<
" -> should end with _S" << endl;
109 TString ctitle =
TString::Format(
"TMVA response %s",methodTitle.Data());
112 TH1F* sig = (TH1F*)titkeyTit->
ReadObj();
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;
151 TString hFrameName(TString(
"frame") + methodTitle);
152 TObject *o =
gROOT->FindObject(hFrameName);
154 TH2F* frame =
new TH2F( hFrameName, sig->
GetTitle(),
161 TObjArray* tokens =
name.Tokenize(
"_");
162 TString es = ((TObjString*)tokens->
At(4))->GetString();
164 cout <<
"Big troubles in epoch parsing: \"" << es <<
"\" is not float" << endl;
172 c->GetPad(0)->SetLeftMargin( 0.105 );
176 TLegend *legend=
new TLegend(
c->GetLeftMargin(), 1 -
c->GetTopMargin() - 0.12,
177 c->GetLeftMargin() + 0.5, 1 -
c->GetTopMargin() );
179 legend->
AddEntry(sig,TString(
"Signal ") + dataType,
"F");
180 legend->
AddEntry(bgd,TString(
"Background ") + dataType,
"F");
183 legend->
Draw(
"same");
192 sig->
Draw(
"samehist");
193 bgd->
Draw(
"samehist");
196 TString outdirname =
"movieplots";
197 TString foutname = outdirname +
"/" +
name;
202 cout <<
"storing file: " << foutname << endl;
213 TString fname =
"TMVA.root";
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
float Float_t
Float 4 bytes (float).
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
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
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
void SetTitle(const char *title) override
Change/set the title.
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.
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...
void Draw(Option_t *option="") override
Draw this histogram with options.
Double_t GetRMS(Int_t axis=1) const
This function returns the Standard Deviation (Sigma) of the distribution not the Root Mean Square (RM...
virtual const char * GetClassName() const
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.
void SetMargin(Float_t margin)
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.
TObject * At(Int_t idx) const override
virtual void SetBorderSize(Int_t bordersize=4)
Sets the border size of the TPave box and shadow.
Int_t Atoi() const
Return integer value of string.
Bool_t IsFloat() const
Returns kTRUE if string contains a floating point or integer number.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
virtual TText * DrawTextNDC(Double_t x, Double_t y, const char *text)
void SetSignalAndBackgroundStyle(TH1 *sig, TH1 *bkg, TH1 *all=nullptr)
TFile * OpenFile(const TString &fin)
void SetFrameStyle(TH1 *frame, Float_t scale=1.0)
void NormalizeHists(TH1 *sig, TH1 *bkg=nullptr)
void draw_network(TString dataset, TFile *f, TDirectory *d, const TString &hName="weights_hist", Bool_t movieMode=kFALSE, const TString &epoch="")
void DrawMLPoutputMovie(TString dataset, TFile *file, const TString &methodType, const TString &methodTitle)
void DrawNetworkMovie(TString dataset, TFile *file, const TString &methodType, const TString &methodTitle)
void MovieMaker(TString dataset, TString methodType="Method_MLP", TString methodTitle="MLP")