Belle II Software development
evaluateVXDTF1.py
1#!/usr/bin/env python3
2
3
10
11
18
19
20import basf2 as b2
21import tracking
22from tracking.harvesting_validation.combined_module import CombinedTrackingValidationModule
23
24
25# ---------------------------------------------------------------------------------------
26# Settings
27usePXD = False
28
29performFit = False
30
31# Logging and Debug Levels
32b2.set_log_level(b2.LogLevel.ERROR)
33b2.log_to_file('logVXDTF1Evaluation.log', append=False)
34
35
36# ---------------------------------------------------------------------------------------
37path = b2.create_path()
38
39# Input
40rootInput = b2.register_module('RootInput')
41path.add_module(rootInput)
42
43# Event Info Module
44eventinfoprinter = b2.register_module('EventInfoPrinter')
45path.add_module(eventinfoprinter)
46
47# Gearbox
48gearbox = b2.register_module('Gearbox')
49path.add_module(gearbox)
50
51# Geometry
52geometry = b2.register_module('Geometry')
53geometry.param('components', ['BeamPipe',
54 'MagneticFieldConstant4LimitedRSVD',
55 'PXD',
56 'SVD',
57 'CDC'])
58path.add_module(geometry)
59
60# Event counter
61eventCounter = b2.register_module('EventCounter')
62path.add_module(eventCounter)
63
64genFitExtrapolation = b2.register_module('SetupGenfitExtrapolation')
65path.add_module(genFitExtrapolation)
66
67tracking.add_vxd_track_finding(path, "RecoTracks", components=["SVD"])
68
69if performFit:
70 fitter = b2.register_module('DAFRecoFitter')
71 path.add_module(fitter)
72
73# Matching
74mcTrackMatcherModule = b2.register_module('MCRecoTracksMatcher')
75mcTrackMatcherModule.param({
76 'UseCDCHits': False,
77 'UseSVDHits': True,
78 'UsePXDHits': False,
79 'mcRecoTracksStoreArrayName': 'MCRecoTracks',
80 'MinimalPurity': .66,
81})
82path.add_module(mcTrackMatcherModule)
83
84# Evaluation of matching
85trackingValidationModule = CombinedTrackingValidationModule(
86 "",
87 contact="",
88 output_file_name="VXDTF1Validation.root",
89 expert_level=2)
90path.add_module(trackingValidationModule)
91
92b2.process(path)
93print(b2.statistics)