Belle II Software
release-08-01-10
cosmicsHoughTrackingValidation.py
1
#!/usr/bin/env python3
2
3
10
11
"""
12
<header>
13
<contact>software-tracking@belle2.org</contact>
14
<input>CosmicsSimNoBkg.root</input>
15
<description>Validates the hough finder working on segments in cosmics events.</description>
16
</header>
17
"""
18
19
from
tracking.validation.run
import
TrackingValidationRun
20
import
logging
21
import
trackfindingcdc.cdcdisplay
as
cdcdisplay
22
import
os
23
import
basf2
24
VALIDATION_OUTPUT_FILE =
'CosmicsHoughTrackingValidation.root'
25
N_EVENTS = 1000
26
ACTIVE =
False
27
28
29
class
CosmicsHough
(
TrackingValidationRun
):
30
"""Validate the CDC Hough track-segment finder with cosmic rays"""
31
32
n_events = N_EVENTS
33
34
generator_module =
'Cosmics'
35
36
root_input_file =
'../CosmicsSimNoBkg.root'
37
38
components =
None
39
40
def
finder_module
(self, path):
41
"""Add the CDC Hough track finder and related modules to the basf2 path"""
42
path.add_module(
'TFCDC_WireHitPreparer'
)
43
path.add_module(
'TFCDC_ClusterPreparer'
)
44
path.add_module(
'TFCDC_SegmentFinderFacetAutomaton'
,
45
SegmentOrientation=
"downwards"
)
46
path.add_module(
'TFCDC_AxialTrackCreatorSegmentHough'
,
47
tracks=
"CDCAxialTrackVector"
)
48
path.add_module(
'TFCDC_StereoHitFinder'
,
49
inputTracks=
"CDCAxialTrackVector"
)
50
path.add_module(
'TFCDC_TrackExporter'
,
51
inputTracks=
"CDCAxialTrackVector"
)
52
53
interactive_display =
False
54
if
interactive_display:
55
cdc_display_module = cdcdisplay.CDCSVGDisplayModule(os.getcwd(), interactive=
True
)
56
cdc_display_module.draw_recotracks =
True
57
cdc_display_module.draw_recotrack_seed_trajectories =
True
58
path.add_module(cdc_display_module)
59
60
61
tracking_coverage = {
62
'WhichParticles'
: [
'CDC'
],
# Include all particles seen in CDC, also secondaries
63
'UsePXDHits'
:
False
,
64
'UseSVDHits'
:
False
,
65
'UseCDCHits'
:
True
,
66
'UseOnlyAxialCDCHits'
:
False
,
67
"UseReassignedHits"
:
True
,
68
}
69
70
pulls =
True
71
72
output_file_name = VALIDATION_OUTPUT_FILE
73
74
75
def
main
():
76
basf2.set_random_seed(1337)
77
validation_run =
CosmicsHough
()
78
validation_run.configure_and_execute_from_commandline()
79
80
81
if
__name__ ==
'__main__'
:
82
logging.basicConfig(level=logging.INFO)
83
if
ACTIVE:
84
main
()
85
else
:
86
print(
"This validation deactivated and thus basf2 is not executed.\n"
87
"If you want to run this validation, please set the 'ACTIVE' flag above to 'True'.\n"
88
"Exiting."
)
cosmicsHoughTrackingValidation.CosmicsHough
Definition:
cosmicsHoughTrackingValidation.py:29
tracking.run.tracked_event_generation.ReadOrGenerateTrackedEventsRun.finder_module
finder_module
Name of the finder module to be used - can be everything that is accepted by tracking....
Definition:
tracked_event_generation.py:33
tracking.validation.run.TrackingValidationRun
Definition:
run.py:25
main
Definition:
main.py:1
trackfindingcdc.cdcdisplay
Definition:
__init__.py:1
tracking.validation.run
Definition:
run.py:1
main
int main(int argc, char **argv)
Run all tests.
Definition:
test_main.cc:91
tracking
validation
cosmicsHoughTrackingValidation.py
Generated on Mon Sep 23 2024 14:06:43 for Belle II Software by
1.9.1