FEDRA emulsion software from the OPERA Collaboration
testBGReduction_By_ANN.C File Reference

Functions

TMLPAnalyzer ana (mlp)
 
simu2 Branch ("ANNOUT", &ANNOUT, "ANNOUT/D")
 
simu Branch ("chi2", &chi2, "chi2/F")
 
simu Branch ("TT", &TT, "TT/F")
 
simu Branch ("type", &type, "type/I")
 
simu Branch ("W", &W, "W/I")
 
canv cd ()
 
canv cd (1)
 
canv cd (2)
 
canv cd (3)
 
mlpa_canvas cd (4)
 
ana CheckNetwork ()
 
mlpa_canvas Divide (2, 2)
 
canv Divide (3, 1)
 
simu2 Draw ("ANNOUT")
 
simu2 Draw ("chi2","ANNOUT>0.2","same")
 
simu Draw ("chi2","type==0")
 
simu Draw ("chi2:W","","box")
 
simu Draw ("chi2:W","type==0","samebox")
 
simu2 Draw ("chi2:W>>h2all(100,0,50,100,0,5)","","colz")
 
simu2 Draw ("chi2:W>>h2bg(100,0,50,100,0,5)","ANNOUT<0.2","colz")
 
simu2 Draw ("chi2:W>>h2sg(100,0,50,100,0,5)","ANNOUT>0.2","colz")
 
simu2 Draw ("TT","ANNOUT>0.2","same")
 
simu Draw ("TT","type==0")
 
simu2 Draw ("W","ANNOUT>0.2","same")
 
simu Draw ("W","type==0")
 
mlp Draw ()
 
ana DrawDInputs ()
 
ana DrawNetwork (0,"type==1","type==0")
 
 for (int n=0;n< ali->Npatterns();n++)
 
ana GatherInformations ()
 
mlp LoadWeights ("testweights.txt")
 
ali Print ()
 

Variables

EdbPVRecali = ePVR
 
Double_t ANNOUT
 
TCanvascanv = new TCanvas()
 
TCanvascanv2 = new TCanvas()
 
TCanvascanv2all = new TCanvas()
 
TCanvascanv2bg = new TCanvas()
 
TCanvascanv2sg = new TCanvas()
 
Float_t chi2
 
 ePVR = new EdbPVRec
 
TMultiLayerPerceptron * mlp = new TMultiLayerPerceptron("@chi2,@W,@TT:5:3:type",simu,"Entry$%2","(Entry$+1)%2")
 
TCanvasmlpa_canvas = new TCanvas("mlpa_canvas","Network analysis")
 
Double_t params [3]
 
TTree * simu = new TTree()
 
TTree * simu2 = new TTree()
 
Float_t TT
 
Int_t type
 
Int_t W
 

Function Documentation

◆ ana()

TMLPAnalyzer ana ( mlp  )

◆ Branch() [1/5]

simu2 Branch ( "ANNOUT"  ,
ANNOUT,
"ANNOUT/D"   
)

◆ Branch() [2/5]

simu2 Branch ( "chi2"  ,
chi2,
"chi2/F"   
)

◆ Branch() [3/5]

simu2 Branch ( "TT"  ,
TT,
"TT/F"   
)

◆ Branch() [4/5]

simu2 Branch ( "type"  ,
type,
"type/I"   
)

◆ Branch() [5/5]

simu2 Branch ( "W"  ,
W,
"W/I"   
)

◆ cd() [1/5]

canv cd ( )

◆ cd() [2/5]

canv cd ( )

◆ cd() [3/5]

canv cd ( )

◆ cd() [4/5]

canv cd ( )

◆ cd() [5/5]

mlpa_canvas cd ( )

◆ CheckNetwork()

ana CheckNetwork ( )

◆ Divide() [1/2]

mlpa_canvas Divide ( ,
 
)

◆ Divide() [2/2]

canv Divide ( ,
 
)

◆ Draw() [1/13]

simu2 Draw ( "ANNOUT"  )

◆ Draw() [2/13]

simu2 Draw ( "chi2"  ,
ANNOUT,
0.2"  ,
"same"   
)

◆ Draw() [3/13]

simu2 Draw ( "chi2"  )

◆ Draw() [4/13]

simu Draw ( "chi2:W"  ,
""  ,
"box"   
)

◆ Draw() [5/13]

simu Draw ( "chi2:W"  )

◆ Draw() [6/13]

simu2 Draw ( "chi2:W>>h2all(100,0,50,100,0,5)"  ,
""  ,
"colz"   
)

◆ Draw() [7/13]

simu2 Draw ( "chi2:W>>h2bg(100,0,50,100,0,5)"  )

◆ Draw() [8/13]

simu2 Draw ( "chi2:W>>h2sg(100,0,50,100,0,5)"  ,
ANNOUT,
0.2"  ,
"colz"   
)

◆ Draw() [9/13]

simu2 Draw ( "TT"  ,
ANNOUT,
0.2"  ,
"same"   
)

◆ Draw() [10/13]

simu2 Draw ( "TT"  )

◆ Draw() [11/13]

simu2 Draw ( "W"  ,
ANNOUT,
0.2"  ,
"same"   
)

◆ Draw() [12/13]

simu2 Draw ( "W"  )

◆ Draw() [13/13]

mlp Draw ( )

◆ DrawDInputs()

ana DrawDInputs ( )

◆ DrawNetwork()

ana DrawNetwork ( )

◆ for()

for ( int  n = 0; n<ali->Npatterns(); n++)
26 {
27
29 Int_t npat=pat->N();
30 EdbSegP* seg=0;
31 for (int j=0; j<npat; j++) {
32 seg=pat->GetSegment(j);
33 TT = seg->Theta();
34 chi2 = seg->Chi2();
35 W = seg->W();
36 if (seg->MCEvt()>0) type = 1;
37 if (seg->MCEvt()<0) type = 0;
38 simu->Fill();
39 }
40 n++;
41}
Int_t npat
Definition: Xi2HatStartScript.C:33
Definition: EdbPattern.h:273
EdbPattern * GetPattern(int id) const
Definition: EdbPattern.cxx:1721
Definition: EdbSegP.h:21
Float_t Chi2() const
Definition: EdbSegP.h:157
Float_t W() const
Definition: EdbSegP.h:151
Float_t Theta() const
Definition: EdbSegP.h:184
Int_t MCEvt() const
Definition: EdbSegP.h:145
Int_t N() const
Definition: EdbPattern.h:86
EdbSegP * GetSegment(int i) const
Definition: EdbPattern.h:66
Float_t chi2
Definition: testBGReduction_By_ANN.C:14
Int_t W
Definition: testBGReduction_By_ANN.C:15
EdbPVRec * ali
Definition: testBGReduction_By_ANN.C:5
TTree * simu
Definition: testBGReduction_By_ANN.C:12
Float_t TT
Definition: testBGReduction_By_ANN.C:14
Int_t type
Definition: testBGReduction_By_ANN.C:15

◆ GatherInformations()

ana GatherInformations ( )

◆ LoadWeights()

mlp LoadWeights ( "testweights.txt"  )

◆ Print()

ali Print ( )

Variable Documentation

◆ ali

EdbPVRec* ali = ePVR

◆ ANNOUT

Double_t ANNOUT

◆ canv

TCanvas * canv = new TCanvas()

◆ canv2

TCanvas* canv2 = new TCanvas()

◆ canv2all

TCanvas* canv2all = new TCanvas()

◆ canv2bg

TCanvas* canv2bg = new TCanvas()

◆ canv2sg

TCanvas* canv2sg = new TCanvas()

◆ chi2

Float_t chi2

◆ ePVR

dproc ReadTracksTree * ePVR = new EdbPVRec

◆ mlp

TMultiLayerPerceptron* mlp = new TMultiLayerPerceptron("@chi2,@W,@TT:5:3:type",simu,"Entry$%2","(Entry$+1)%2")

◆ mlpa_canvas

TCanvas* mlpa_canvas = new TCanvas("mlpa_canvas","Network analysis")

◆ params

Double_t params[3]

◆ simu

TTree* simu = new TTree()

◆ simu2

TTree* simu2 = new TTree()

◆ TT

Float_t TT

◆ type

Int_t type

◆ W

Int_t W