EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
CbmRichRingSelectNeuralNet.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file CbmRichRingSelectNeuralNet.h
1
/*
2
* Description : Implementation for concrete RICH ring selection algorithm:
3
* reject rings using a trained neural net (input file with weights needed!)
4
* store resulting value (0-1) in "SelectionNN":
5
* 0 = good rings
6
* 1 = rings to be rejected
7
* --> choose a value in between depending on required purity/ efficiency
8
*
9
* Author : Semen Lebedev
10
* E-mail : S.Lebedev@gsi.de
11
* */
12
13
#ifndef CBM_RICH_RING_SELECT_NEURALNET_H
14
#define CBM_RICH_RING_SELECT_NEURALNET_H
15
16
#include "
NNfunction.h
"
17
#include "
CbmRichRingLight.h
"
18
#include "
CbmRichRingSelectImplLight.h
"
19
20
#include <iostream>
21
22
using
std::cout;
23
using
std::endl;
24
25
26
class
CbmRichRingSelectNeuralNet
27
{
28
29
const
char
*
fNeuralNetWeights
;
30
31
public
:
32
CbmRichRingSelectNeuralNet
(
const
char
* NNFile);
// Standard constructor
33
~CbmRichRingSelectNeuralNet
();
34
35
virtual
void
Init
();
36
void
DoSelect
(
CbmRichRingLight
* ring);
37
38
NNfunction
*
fNNfunction
;
39
CbmRichRingSelectImplLight
*
fSelectImpl
;
40
};
41
42
#endif
43
44
45
inline
CbmRichRingSelectNeuralNet::CbmRichRingSelectNeuralNet
(
const
char
* NNFile )
46
{
47
fNeuralNetWeights
= NNFile;
48
}
49
50
51
inline
CbmRichRingSelectNeuralNet::~CbmRichRingSelectNeuralNet
()
52
{}
53
54
inline
void
CbmRichRingSelectNeuralNet::Init
()
55
{
56
fSelectImpl
=
new
CbmRichRingSelectImplLight
();
57
fNNfunction
=
new
NNfunction
();
58
}
59
60
// ----- Exec ----------------------------------------------------
61
inline
void
CbmRichRingSelectNeuralNet::DoSelect
(
CbmRichRingLight
* ring)
62
{
63
if
(ring->
GetRadius
() >= 10.f || ring->
GetRadius
() <= 0.f ||
64
ring->
GetNofHits
() <= 5.f ||
65
ring->
GetRadialPosition
() <= 0.f || ring->
GetRadialPosition
() >= 999.f ){
66
67
ring->
SetSelectionNN
(-1.f);
68
return
;
69
}
70
ring->
SetNofHitsOnRing
(
fSelectImpl
->
GetNofHitsOnRingCircle
(ring));
71
if
(ring->
GetNofHitsOnRing
() < 5){
72
ring->
SetSelectionNN
(-1.f);
73
return
;
74
}
75
76
ring->
SetAngle
(
fSelectImpl
->
GetAngle
(ring));
77
if
(ring->
GetAngle
() < 0.f || ring->
GetAngle
() > 6.3f){
78
ring->
SetSelectionNN
(-1.f);
79
return
;
80
}
81
82
double
nnPar[10];
83
nnPar[0] = ring->
GetNofHits
();
84
nnPar[1] = ring->
GetAngle
();
85
nnPar[2] = ring->
GetNofHitsOnRing
();
86
nnPar[3] = ring->
GetRadialPosition
();
87
nnPar[4] = ring->
GetRadius
();
88
nnPar[5] = ring->
GetChi2
() / ring->
GetNDF
();
89
90
float
nnEval =
fNNfunction
->
Value
(0,nnPar);
91
92
ring->
SetSelectionNN
(nnEval);
93
}
94
EicRoot
blob
master
rich
standalone
algorithm
CbmRichRingSelectNeuralNet.h
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:37
using
1.8.2 with
EIC GitHub integration