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