9 if (!
gROOT->GetClass(
"TMultiLayerPerceptron")) {
16 const char *fname =
"mlpHiggs.root";
21 printf(
"accessing %s file from http://root.cern.ch/files\n",fname);
28 TTree *simu =
new TTree(
"MonteCarlo",
"Filtered Monte Carlo Events");
29 Float_t ptsumf, qelep, nch, msumf, minvis, acopl, acolin;
45 simu->
Branch(
"ptsumf", &ptsumf,
"ptsumf/F");
46 simu->
Branch(
"qelep", &qelep,
"qelep/F");
47 simu->
Branch(
"nch", &nch,
"nch/F");
48 simu->
Branch(
"msumf", &msumf,
"msumf/F");
49 simu->
Branch(
"minvis", &minvis,
"minvis/F");
50 simu->
Branch(
"acopl", &acopl,
"acopl/F");
51 simu->
Branch(
"acolin", &acolin,
"acolin/F");
52 simu->
Branch(
"type", &type,
"type/I");
60 for (i = 0; i < background->
GetEntries(); i++) {
69 "ptsumf",simu,
"Entry$%2",
"(Entry$+1)%2");
70 mlp->
Train(ntrain,
"text,graph,update=10");
71 mlp->
Export(
"test",
"python");
73 TCanvas* mlpa_canvas =
new TCanvas(
"mlpa_canvas",
"Network analysis");
94 TH1F *bg =
new TH1F(
"bgh",
"NN output", 50, -.5, 1.5);
95 TH1F *sig =
new TH1F(
"sigh",
"NN output", 50, -.5, 1.5);
99 for (i = 0; i < background->
GetEntries(); i++) {
122 legend->
AddEntry(bg,
"Background (WW)");
123 legend->
AddEntry(sig,
"Signal (Higgs)");
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
This class displays a legend box (TPaveText) containing several legend entries.
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 ...
virtual Int_t Fill()
Fill all branches.
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
1-D histogram with a float per channel (see TH1 documentation)}
void GatherInformations()
Collect information about what is usefull in the network.
virtual void SetFillStyle(Style_t fstyle)
void DrawDInputs()
Draws the distribution (on the test sample) of the impact on the network output of a small variation ...
void DrawNetwork(Int_t neuron, const char *signal, const char *bg)
Draws the distribution of the neural network (using ith neuron).
void Export(Option_t *filename="NNfunction", Option_t *language="C++") const
Exports the NN as a function for any non-ROOT-dependant code Supported languages are: only C++ ...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
void mlpHiggs(Int_t ntrain=100)
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
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 void SetLineColor(Color_t lcolor)
R__EXTERN TSystem * gSystem
virtual void Draw(Option_t *option="")
Draw this histogram with options.
void Train(Int_t nEpoch, Option_t *option="text", Double_t minE=0)
Train the network.
virtual void Draw(Option_t *option="")
Draws the network structure.
virtual void SetFillColor(Color_t fcolor)
char * Form(const char *fmt,...)
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
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.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
virtual Long64_t GetEntries() const
A TTree object has a header with a name and a title.
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.