83 fStructure.
Last(
':') - fStructure.
First(
':') - 1));
88 num = atoi(
TString(hidden(beg, end - beg)).Data());
91 end = hidden.
Index(
":", beg + 1);
92 if(layer==cnt)
return num;
96 if(layer==cnt)
return num;
114 brName =
TString(input(beg, end - beg));
116 brName = brName(1,brName.
Length()-1);
118 end = input.
Index(
",", beg + 1);
119 if(cnt==idx)
return brName;
124 brName = brName(1,brName.
Length()-1);
134 return neuron ? neuron->
GetName() :
"NO SUCH NEURON";
143 return neuron ? neuron->
GetName() :
"NO SUCH NEURON";
152 std::cout <<
"Network with structure: " << fStructure.
Data() << std::endl;
153 std::cout <<
"inputs with low values in the differences plot may not be needed" << std::endl;
155 char var[64], sel[64];
164 <<
" +/- " << tmp->
GetRMS() << std::endl;
188 Int_t i(0), j(0), k(0),
l(0);
191 pos = re.
Index(formula,&len);
192 if(pos==-1 || len<3) {
197 TString newformula(formula,pos);
198 TString val = formula(pos+1,len-2);
200 formula = newformula;
201 index[i] = val.
Atoi();
203 TH1D tmp(
"tmpb",
"tmpb", 1, -FLT_MAX, FLT_MAX);
223 leaflist+=
Form(
"In%d/D:",i);
228 for (i=0; i<numOutNodes; i++)
229 leaflist+=
Form(
"Out%d/D:",i);
234 for (i=0; i<numOutNodes; i++)
235 leaflist+=
Form(
"True%d/D:",i);
241 for(j=0; j< nEvents; j++) {
259 params[i] += shift*rms[i];
261 params[i] -= 2*shift*rms[i];
263 diff += (v1-v2)*(v1-v2);
265 params[i] += shift*rms[i];
276 for(i=0; i<
GetNeurons(1); i++)
delete formulas[i];
290 snprintf(sel,64,
"inNeuron==%d", i);
316 THStack* stack =
new THStack(
"differences",
"differences (impact of variables on ANN)");
319 char var[64], sel[64];
322 snprintf(sel,64,
"inNeuron==%d", i);
330 stack->
Draw(
"nostack");
346 THStack* stack =
new THStack(
"__NNout_TMLPA",
Form(
"Neural net output (neuron %d)",neuron));
347 TH1F *bgh =
new TH1F(
"__bgh_TMLPA",
"NN output", 50, -0.5, 1.5);
348 TH1F *sigh =
new TH1F(
"__sigh_TMLPA",
"NN output", 50, -0.5, 1.5);
356 data->
Draw(
">>__tmpSig_MLPA",signal,
"goff");
357 data->
Draw(
">>__tmpBkg_MLPA",bg,
"goff");
360 nEvents = bg_list->
GetN();
361 for(j=0; j< nEvents; j++) {
365 nEvents = signal_list->
GetN();
366 for(j=0; j< nEvents; j++) {
381 legend->
AddEntry(bgh,
"Background");
383 stack->
Draw(
"nostack");
407 drawline.
Form(
"Out.Out%d-True.True%d:True.True%d>>",
408 outnode, outnode, outnode);
409 fIOTree->
Draw(drawline+pipehist+
"(20)",
"",
"goff prof");
414 h->
SetTitle(
Form(
"#Delta(output - truth) vs. truth for %s",
419 if (!strstr(option,
"goff"))
437 "Deviation of MLP output from truth");
441 if (!option || !strstr(option,
"goff"))
442 leg=
new TLegend(.4,.85,.95,.95,
"#Delta(output - truth) vs. truth for:");
444 const char* xAxisTitle=0;
482 TString pipehist=
Form(
"MLP_truthdev_i%d_o%d", innode, outnode);
484 drawline.
Form(
"Out.Out%d-True.True%d:In.In%d>>",
485 outnode, outnode, innode);
486 fIOTree->
Draw(drawline+pipehist+
"(50)",
"",
"goff prof");
491 h->
SetTitle(
Form(
"#Delta(output - truth) of %s vs. input %s",
492 titleOutNeuron, titleInNeuron));
496 if (!strstr(option,
"goff"))
513 sName.
Form(
"MLP_TruthDeviationIO_%d", outnode);
516 Form(
"Deviation of MLP output %s from truth",
521 if (!option || !strstr(option,
"goff"))
522 leg=
new TLegend(.4,.75,.95,.95,
523 Form(
"#Delta(output - truth) of %s vs. input for:",
530 for (innode=0; innode<numInNodes; innode++) {
virtual const char * GetName() const
Returns name of object.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
const char * GetOutputNeuronTitle(Int_t out)
Returns the name of any neuron from the output layer.
This class displays a legend box (TPaveText) containing several legend entries.
The Histogram stack class.
void CheckNetwork()
Gives some information about the network in the terminal.
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
void DrawDInput(Int_t i)
Draws the distribution (on the test sample) of the impact on the network output of a small variation ...
virtual Int_t Fill()
Fill all branches.
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
TAxis * GetXaxis() const
Get x axis of the histogram used to draw the stack.
Regular expression class.
Double_t Evaluate(Int_t index, Double_t *params) const
Returns the Neural Net for a given set of input parameters #parameters must equal #input neurons...
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.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
1-D histogram with a float per channel (see TH1 documentation)}
void GatherInformations()
Collect information about what is usefull in the network.
Double_t GetRMS(Int_t axis=1) const
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
void DrawDInputs()
Draws the distribution (on the test sample) of the impact on the network output of a small variation ...
Int_t GetLayers()
Returns the number of layers.
Int_t GetNeurons(Int_t layer)
Returns the number of neurons in given layer.
virtual void Draw(Option_t *chopt="")
Draw this multihist with its current attributes.
void DrawNetwork(Int_t neuron, const char *signal, const char *bg)
Draws the distribution of the neural network (using ith neuron).
TProfile * DrawTruthDeviationInOut(Int_t innode, Int_t outnode=0, Option_t *option="")
Creates a profile of the difference of the MLP output outnode minus the true value of outnode vs the ...
virtual Long64_t GetEntry(Int_t index) const
Return value of entry at index in the list.
virtual Int_t GetN() const
Ssiz_t First(char c) const
Find first occurrence of a character c.
TMultiLayerPerceptron * fNetwork
virtual void SetEventList(TEventList *list)
This function transfroms the given TEventList into a TEntryList The new TEntryList is owned by the TT...
virtual void SetLineColor(Color_t lcolor)
Set the line color.
const char * GetInputNeuronTitle(Int_t in)
Returns the name of any neuron from the input layer.
const char * GetTitle() const
Returns title of object.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual ~TMLPAnalyzer()
Destructor.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
char * Form(const char *fmt,...)
A TEventList object is a list of selected events (entries) in a TTree.
1-D histogram with a double per channel (see TH1 documentation)}
TString & Remove(Ssiz_t pos)
virtual void SetDirectory(TDirectory *dir)
Change the tree's directory.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
Ssiz_t Index(const TString &str, Ssiz_t *len, Ssiz_t start=0) const
Find the first occurrence of the regexp in string and return the position, or -1 if there is no match...
Ssiz_t Last(char c) const
Find last occurrence of a character c.
virtual void ResetBranchAddresses()
Tell all of our branches to drop their current objects and allocate new ones.
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
virtual void Add(TH1 *h, Option_t *option="")
add a new histogram to the list Only 1-d and 2-d histograms currently supported.
TEventList * fTest
EventList defining the events in the training dataset.
TString GetNeuronFormula(Int_t idx)
Returns the formula used as input for neuron (idx) in the first layer.
virtual Int_t Branch(TCollection *list, Int_t bufsize=32000, Int_t splitlevel=99, const char *name="")
Create one branch for each element in the collection.
TProfile * DrawTruthDeviation(Int_t outnode=0, Option_t *option="")
Create a profile of the difference of the MLP output minus the true value for a given output node out...
TAxis * GetYaxis() const
Get x axis of the histogram used to draw the stack.
Int_t CountChar(Int_t c) const
Return number of times character c occurs in the string.
Int_t Atoi() const
Return integer value of string.
A TTree object has a header with a name and a title.
THStack * DrawTruthDeviations(Option_t *option="")
Creates TProfiles of the difference of the MLP output minus the true value vs the true value...
TEventList * GetEventList() const
virtual void SetTitle(const char *title)
See GetStatOverflows for more information.
void GetEntry(Int_t) const
Load an entry into the network.
Double_t Sqrt(Double_t x)
Double_t Result(Int_t event, Int_t index=0) const
Computes the output for a given event.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
TString GetStructure() const
const char * Data() const
THStack * DrawTruthDeviationInsOut(Int_t outnode=0, Option_t *option="")
Creates a profile of the difference of the MLP output outnode minus the true value of outnode vs the ...