Belle II Software
release-06-02-00
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
z
Typedefs
a
b
c
d
e
i
k
l
m
n
p
r
s
t
u
v
w
Enumerations
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
trainFacetRelationFilter.py
1
#!/usr/bin/env python3
2
# -*- coding: utf-8 -*-
3
4
11
12
# This is for training a mva classifier for relations between hit triplets
13
# It performs a tip better than the current default chi2 filter
14
# However run time is quite a bit slower which is why it wont be used in the standard chain.
15
# Nevertheless this script can be used to generate variables to consider
16
# for improvements or cross checks with --task explore
17
18
import
sys
19
20
from
tracking.run.event_generation
import
StandardEventGenerationRun
21
from
trackfindingcdc.run.training
import
TrainingRunMixin
22
23
24
class
FacetRelationFilterTrainingRun
(TrainingRunMixin,
StandardEventGenerationRun
):
25
"""Run for recording facets encountered at the filter"""
26
27
n_events = 1000
28
29
30
generator_module =
"generic"
31
# detector_setup = "TrackingDetector"
32
33
34
task =
"explore"
35
36
37
truth =
"truth_positive"
38
39
@property
40
def
identifier
(self):
41
"""Database identifier of the filter being trained"""
42
return
"trackfindingcdc_FacetRelationFilter.xml"
43
44
def
create_path
(self):
45
"""Setup the recording path after the simulation"""
46
path = super().
create_path
()
47
48
49
if
self.
task
task
task ==
"train"
:
50
var_sets = [
51
"mva"
,
52
"filter(truth)"
,
53
]
54
55
elif
self.
task
task
task ==
"eval"
:
56
var_sets = [
57
"basic"
,
58
"filter(chi2)"
,
59
"filter(chi2_old)"
,
60
"filter(simple)"
,
61
"filter(truth)"
,
62
]
63
64
self.
variables
variables = [
65
"chi2_weight"
,
66
"chi2_accept"
,
67
"chi2_old_weight"
,
68
"chi2_old_accept"
,
69
"simple_accept"
,
70
]
71
72
self.
groupby
groupby = [
""
,
"superlayer_id"
]
73
self.
auxiliaries
auxiliaries = [
74
"superlayer_id"
,
75
]
76
77
elif
self.
task
task
task ==
"explore"
:
78
var_sets = [
79
"basic"
,
80
"bend"
,
81
"fit"
,
82
"filter(chi2)"
,
83
"filter(simple)"
,
84
"filter(truth)"
,
85
]
86
87
89
self.
variables
variables = [
90
# "delta_phi",
91
# "delta_phi_pull",
92
# "delta_phi_pull_per_r",
93
# "delta_curv",
94
# "delta_curv_pull",
95
# "delta_curv_pull_per_r",
96
97
# "cos_delta",
98
# "from_middle_cos_delta",
99
# "to_middle_cos_delta",
100
101
"chi2_0"
,
102
# "chi2_0_per_s",
103
# "erf_0",
104
# "fit_0_phi0",
105
# "fit_0_cos_delta",
106
107
# "chi2_1",
108
# "chi2_1_per_s",
109
# "fit_1_phi0",
110
# "fit_1_cos_delta",
111
112
# "chi2",
113
# "chi2_per_s",
114
# "fit_phi0",
115
# "fit_cos_delta",
116
117
# "phi0_from_sigma",
118
# "phi0_to_sigma",
119
120
# "phi0_ref_pull",
121
# "phi0_ref_diff",
122
# "phi0_ref_sigma",
123
124
# "chi2_comb",
125
# "phi0_comb_pull",
126
# "phi0_comb_diff",
127
# "phi0_comb_sigma",
128
129
# "chi2_kari_unit",
130
# "abs_curv_unit",
131
132
# "chi2_kari_l",
133
# "abs_curv_l",
134
135
# "chi2_kari_pseudo",
136
# "abs_curv_pseudo",
137
138
# "chi2_kari_proper",
139
# "abs_curv_proper",
140
]
141
142
143
self.
groupby
groupby = [
""
,
"superlayer_id"
]
144
145
self.
auxiliaries
auxiliaries = [
146
"superlayer_id"
,
147
]
148
149
path.add_module(
"TFCDC_WireHitPreparer"
,
150
flightTimeEstimation=
"outwards"
,
151
UseNLoops=1.0)
152
153
path.add_module(
"TFCDC_ClusterPreparer"
)
154
155
path.add_module(
"TFCDC_SegmentFinderFacetAutomaton"
,
156
FacetRelationFilter=
"unionrecording"
,
157
FacetRelationFilterParameters={
158
"rootFileName"
: self.sample_file_name,
159
"varSets"
: var_sets,
160
})
161
162
return
path
163
164
165
def
main
():
166
"""Execute the facet relation recording"""
167
run =
FacetRelationFilterTrainingRun
()
168
run.configure_and_execute_from_commandline()
169
170
171
if
__name__ ==
"__main__"
:
172
import
logging
173
logging.basicConfig(stream=sys.stdout, level=logging.INFO, format=
'%(levelname)s:%(message)s'
)
174
main
()
tracking.run.event_generation.StandardEventGenerationRun
Definition:
event_generation.py:197
trainFacetRelationFilter.FacetRelationFilterTrainingRun
Definition:
trainFacetRelationFilter.py:24
trainFacetRelationFilter.FacetRelationFilterTrainingRun.create_path
def create_path(self)
Definition:
trainFacetRelationFilter.py:44
trainFacetRelationFilter.FacetRelationFilterTrainingRun.variables
variables
Signal some variables to select in the classification analysis self.variables = None #all variables.
Definition:
trainFacetRelationFilter.py:64
trainFacetRelationFilter.FacetRelationFilterTrainingRun.groupby
groupby
group output by superlayer_id
Definition:
trainFacetRelationFilter.py:72
trainFacetRelationFilter.FacetRelationFilterTrainingRun.task
string task
Default task set to explore.
Definition:
trainFacetRelationFilter.py:34
trainFacetRelationFilter.FacetRelationFilterTrainingRun.task
task
Post-process events according to the user's desired task (train, eval, explore)
Definition:
trainFacetRelationFilter.py:49
trainFacetRelationFilter.FacetRelationFilterTrainingRun.auxiliaries
auxiliaries
auxiliary histograms
Definition:
trainFacetRelationFilter.py:73
trainFacetRelationFilter.FacetRelationFilterTrainingRun.identifier
def identifier(self)
Definition:
trainFacetRelationFilter.py:40
tracking.run.event_generation
Definition:
event_generation.py:1
main
int main(int argc, char **argv)
Run all tests.
Definition:
test_main.cc:75
tracking
trackFindingCDC
train
trainFacetRelationFilter.py
Generated on Thu Dec 28 2023 02:38:33 for Belle II Software by
1.9.1