Belle II Software
release-05-02-19
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
k
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
u
v
w
x
z
Typedefs
a
b
c
d
e
h
i
l
m
n
p
r
s
t
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
run.py
1
#!/usr/bin/env python3
2
# -*- coding: utf-8 -*-
3
4
import
basf2
5
6
import
logging
7
import
argparse
8
9
from
tracking.run.tracked_event_generation
import
ReadOrGenerateTrackedEventsRun
10
from
tracking.run.mixins
import
BrowseTFileOnTerminateRunMixin
11
from
tracking.validation.hit_module
import
ExpertTrackingValidationModule
12
from
tracking.harvesting_validation.combined_module
import
CombinedTrackingValidationModule
13
14
15
TRACKING_MAILING_LIST =
'software-tracking@belle2.org'
16
17
18
class
TrackingValidationRun
(
BrowseTFileOnTerminateRunMixin
,
ReadOrGenerateTrackedEventsRun
):
19
"""Run setup to compose a path to validate the the tracking procedures from pre-simulated events
20
or from events simulated on the fly. Considering parameters from the commandline."""
21
22
23
contact = TRACKING_MAILING_LIST
24
25
26
output_file_name =
'TrackingValidation.root'
# Also specification for BrowseTFileOnTerminateRunMixin
27
28
29
root_output_file =
None
30
31
32
pulls =
True
33
34
35
resolution =
False
36
37
38
use_expert_folder =
True
39
40
41
exclude_profile_mc_parameter = []
42
43
44
exclude_profile_pr_parameter = []
45
46
47
use_fit_information =
False
48
49
50
extended =
False
51
52
53
saveFullTrees =
False
54
55
def
preparePathValidation
(self, path):
56
"""The default way to add the validation module to the path.
57
58
Derived classes can overload this method modify the validation module
59
or add more than one validation steps.
60
"""
61
62
if
self.
extended
:
63
expert_level =
None
64
if
self.
saveFullTrees
:
65
expert_level = 200
66
67
trackingValidationModule =
CombinedTrackingValidationModule
(
68
name=self.
name
,
69
contact=self.
contact
,
70
output_file_name=self.
output_file_name
,
71
expert_level=expert_level
72
)
73
else
:
74
# Validation module generating plots
75
trackingValidationModule =
ExpertTrackingValidationModule
(
76
self.
name
,
77
contact=self.
contact
,
78
fit=self.
use_fit_information
or
self.
fit_tracks
,
79
pulls=self.
pulls
,
80
resolution=self.
resolution
,
81
output_file_name=self.
output_file_name
,
82
use_expert_folder=self.
use_expert_folder
,
83
exclude_profile_mc_parameter=self.
exclude_profile_mc_parameter
,
84
exclude_profile_pr_parameter=self.
exclude_profile_pr_parameter
85
)
86
trackingValidationModule.trackCandidatesColumnName =
"RecoTracks"
87
88
path.add_module(trackingValidationModule)
89
90
def
create_argument_parser
(self, **kwds):
91
"""Create command line argument parser"""
92
argument_parser = super().
create_argument_parser
(**kwds)
93
94
# Left over from earlier parameter settings. Overwrites the more fundamental simulation_only parameter
95
argument_parser.add_argument(
96
'-o'
,
97
'--output'
,
98
dest=
'simulation_output'
,
99
default=argparse.SUPPRESS,
100
help=
'Output file to which the simulated events shall be written.'
101
)
102
103
argument_parser.add_argument(
104
'-e'
,
105
'--extended'
,
106
dest=
'extended'
,
107
action=
'store_true'
,
108
default=argparse.SUPPRESS,
109
help=
'Use the extended validation with more plots and whistles'
110
)
111
112
return
argument_parser
113
114
def
create_path
(self):
115
"""Create path from parameters"""
116
# Sets up a path that plays back pregenerated events or generates events
117
# based on the properties in the base class.
118
path = super().
create_path
()
119
120
# add the validation module to the path
121
self.
preparePathValidation
(path)
122
123
if
self.
root_output_file
:
124
path.add_module(
"RootOutput"
, outputFileName=self.
root_output_file
)
125
126
return
path
127
128
129
def
main
():
130
trackingValiddationRun =
TrackingValidationRun
()
131
trackingValiddationRun.configure_and_execute_from_commandline()
132
133
134
if
__name__ ==
'__main__'
:
135
logging.basicConfig(level=logging.INFO)
136
main
()
tracking.run.minimal.EmptyRun.name
def name(self)
Definition:
minimal.py:35
tracking.run.mixins
Definition:
mixins.py:1
tracking.run.tracked_event_generation.ReadOrGenerateTrackedEventsRun
Definition:
tracked_event_generation.py:18
tracking.run.mixins.BrowseTFileOnTerminateRunMixin
Definition:
mixins.py:50
tracking.validation.hit_module.ExpertTrackingValidationModule
Definition:
hit_module.py:36
tracking.validation.run.TrackingValidationRun.preparePathValidation
def preparePathValidation(self, path)
Definition:
run.py:55
tracking.validation.run.TrackingValidationRun.exclude_profile_pr_parameter
list exclude_profile_pr_parameter
Exclude some of the perigee parameters from the pr side plots.
Definition:
run.py:44
tracking.validation.run.TrackingValidationRun.root_output_file
root_output_file
Optional file name as a destination of all event data which is discarded otherwise.
Definition:
run.py:29
tracking.validation.run.TrackingValidationRun.use_expert_folder
bool use_expert_folder
Use the "expert" folder in the validation file as the destination of the pull and residual plots.
Definition:
run.py:38
tracking.validation.run.TrackingValidationRun.pulls
bool pulls
Include the pull plots of the fit parameters in the validation.
Definition:
run.py:32
tracking.validation.run.TrackingValidationRun.resolution
bool resolution
Include the residual plots of the fit parameters in the validation.
Definition:
run.py:35
tracking.harvesting_validation.combined_module
Definition:
combined_module.py:1
tracking.validation.run.TrackingValidationRun.create_argument_parser
def create_argument_parser(self, **kwds)
Definition:
run.py:90
tracking.validation.run.TrackingValidationRun.saveFullTrees
bool saveFullTrees
Only works in extended mode.
Definition:
run.py:53
tracking.harvesting_validation.combined_module.CombinedTrackingValidationModule
Definition:
combined_module.py:9
main
int main(int argc, char **argv)
Run all tests.
Definition:
test_main.cc:77
tracking.validation.hit_module
Definition:
hit_module.py:1
tracking.run.tracked_event_generation.ReadOrGenerateTrackedEventsRun.fit_tracks
bool fit_tracks
By default, do not add the track fitting to the execution.
Definition:
tracked_event_generation.py:40
tracking.validation.run.TrackingValidationRun.exclude_profile_mc_parameter
list exclude_profile_mc_parameter
Exclude some of the perigee parameters from the mc side plots.
Definition:
run.py:41
tracking.validation.run.TrackingValidationRun.use_fit_information
bool use_fit_information
Do not fit the tracks but access the fit information for pulls etc.
Definition:
run.py:47
tracking.validation.run.TrackingValidationRun.contact
contact
Default contact email address for the validation results.
Definition:
run.py:23
tracking.validation.run.TrackingValidationRun.extended
bool extended
Switch to use the extended harvesting validation instead.
Definition:
run.py:50
tracking.run.tracked_event_generation
Definition:
tracked_event_generation.py:1
tracking.validation.run.TrackingValidationRun
Definition:
run.py:18
tracking.run.mixins.BrowseTFileOnTerminateRunMixin.output_file_name
output_file_name
There is no default for the name of the output TFile.
Definition:
mixins.py:54
tracking.validation.run.TrackingValidationRun.create_path
def create_path(self)
Definition:
run.py:114
tracking
scripts
tracking
validation
run.py
Generated on Tue Jan 4 2022 03:06:08 for Belle II Software by
1.8.17