#include #include #include #include #include "TChain.h" #include "TSystem.h" #include void NN() { if(!gROOT->GetClass("TMultiLayerPerceptron")) { gSystem->Load("libMLP"); } TChain *ch = new TChain("Tree",""); ch->Add("Signal.root/Tree"); ch->Add("Bkground.root/Tree"); ch->Merge("all.root"); TFile input("all.root"); TTree *simu = (TTree *) input.Get("Tree"); std::cout<<" Entries : "<GetEntries()<Train(150,"text,graph,update=10"); // Use TMLPAnalyzer to see what it looks for TCanvas* mlpa_canvas = new TCanvas("mlpa_canvas","Network analysis"); mlpa_canvas->Divide(2,2); mlpa_canvas->SetFillColor(0); mlpa_canvas->SetBorderMode(0); mlpa_canvas->SetBorderSize(1); mlpa_canvas->SetFrameFillColor(1); mlpa_canvas->SetFrameFillStyle(0); TMLPAnalyzer ana(mlp); // Initialisation ana.GatherInformations(); // output to the console ana.CheckNetwork(); mlpa_canvas->cd(1); // shows how each variable influences the network ana.DrawDInputs(); mlpa_canvas->cd(2); // shows the network structure mlp->Draw(); mlpa_canvas->cd(3); // draws the resulting network ana.DrawNetwork(0,"type==1","type==0"); mlpa_canvas->cd(4); // draws the resulting network ana.DrawNetwork(0,"type==1","type==0"); mlp->Export("NameFile"); }