Belle II Software
release-08-02-06
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
w
x
z
Typedefs
a
b
c
d
e
g
i
k
l
m
n
p
r
s
t
u
v
w
Enumerations
a
b
c
e
f
g
n
p
s
v
z
Enumerator
c
d
f
p
t
u
v
w
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
z
Related Functions
b
c
d
g
i
o
r
s
t
Files
File List
File Members
All
Functions
Typedefs
Macros
trainFeasibleSegmentPairFilter.py
1
#!/usr/bin/env python3
2
# -*- coding: utf-8 -*-
3
4
11
12
import
os
13
import
sys
14
import
os.path
15
16
from
tracking.run.event_generation
import
ReadOrGenerateEventsRun
17
from
trackfindingcdc.run.training
import
TrainingRunMixin
18
19
20
class
FeasibleSegmentPairFilterTrainingRun
(TrainingRunMixin,
ReadOrGenerateEventsRun
):
21
"""Run to record segment pairs encountered at the SegmentPairCreator and retrain its mva method"""
22
23
24
n_events = 10000
25
26
generator_module =
"generic"
27
28
bkg_files = os.path.join(os.environ[
"VO_BELLE2_SW_DIR"
],
"bkg"
)
29
30
31
truth =
"truth_positive"
32
33
@property
34
def
identifier
(self):
35
"""Database identifier of the filter being trained"""
36
return
"trackfindingcdc_FeasibleSegmentPairFilter.xml"
37
38
def
create_path
(self):
39
"""Setup the recording path after the simulation"""
40
path = super().
create_path
()
41
42
# In contrast to other training use only the first *half* loop for more aggressive training
43
path.add_module(
"TFCDC_WireHitPreparer"
,
44
flightTimeEstimation=
"outwards"
)
45
46
path.add_module(
'TFCDC_ClusterPreparer'
,
47
SuperClusterDegree=3,
48
SuperClusterExpandOverApogeeGap=
True
)
49
50
# Also fix the segment orientation to outwards to make training additionally aggressive
51
path.add_module(
"TFCDC_SegmentFinderFacetAutomaton"
)
52
53
54
if
self.
task
task ==
"train"
:
55
varSets = [
56
"feasible"
,
57
"filter(truth)"
,
58
]
59
60
elif
self.
task
task ==
"eval"
:
61
varSets = [
62
"filter(feasible)"
,
63
"filter(truth)"
,
64
]
65
66
elif
self.
task
task ==
"explore"
:
67
varSets = [
68
"basic"
,
69
# "feasible",
70
"fitless"
,
71
"pre_fit"
,
72
# "fit",
73
"truth"
,
# for weighting
74
# "old_fit",
75
# "filter(fitless)",
76
# "filter(simple)",
77
# "filter(feasible)",
78
"filter(truth)"
,
79
]
80
81
else
:
82
raise
ValueError(
"Unknown task "
+ self.
task
task)
83
84
path.add_module(
"TFCDC_TrackFinderSegmentPairAutomaton"
,
85
SegmentPairFilter=
"unionrecording"
,
86
SegmentPairFilterParameters={
87
"rootFileName"
: self.sample_file_name,
88
"varSets"
: varSets,
89
})
90
91
return
path
92
93
94
def
main
():
95
run =
FeasibleSegmentPairFilterTrainingRun
()
96
run.configure_and_execute_from_commandline()
97
98
99
if
__name__ ==
"__main__"
:
100
import
logging
101
logging.basicConfig(stream=sys.stdout, level=logging.INFO, format=
'%(levelname)s:%(message)s'
)
102
main
()
tracking.run.event_generation.ReadOrGenerateEventsRun
Definition:
event_generation.py:35
trainFeasibleSegmentPairFilter.FeasibleSegmentPairFilterTrainingRun
Definition:
trainFeasibleSegmentPairFilter.py:20
trainFeasibleSegmentPairFilter.FeasibleSegmentPairFilterTrainingRun.create_path
def create_path(self)
Definition:
trainFeasibleSegmentPairFilter.py:38
trainFeasibleSegmentPairFilter.FeasibleSegmentPairFilterTrainingRun.task
task
Process each event according to the user's desired task (train, eval, explore)
Definition:
trainFeasibleSegmentPairFilter.py:54
trainFeasibleSegmentPairFilter.FeasibleSegmentPairFilterTrainingRun.identifier
def identifier(self)
Definition:
trainFeasibleSegmentPairFilter.py:34
main
Definition:
main.py:1
tracking.run.event_generation
Definition:
event_generation.py:1
main
int main(int argc, char **argv)
Run all tests.
Definition:
test_main.cc:91
tracking
trackFindingCDC
train
trainFeasibleSegmentPairFilter.py
Generated on Tue Jan 28 2025 01:57:45 for Belle II Software by
1.9.1