Belle II Software  release-08-01-10
VXDQE_TrainingDataCollector.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 
18 
19 import basf2 as b2
20 from tracking import add_vxd_track_finding_vxdtf2, add_mc_matcher, add_hit_preparation_modules
21 
22 estimationMethod = 'tripletFit'
23 clusterInfo = 'Average'
24 
25 eval_file_train = "Upsilon4S_ForMVA_10000Events_w16th_overlay_Bkg.root" # Change to correct training file
26 sector_map = None # Default SectorMap
27 
28 # ---------------------------------------------------------------------------------------
29 name = 'VXDEQE_CollectedTrainingData_Default'
30 
31 # Logging and Debug Level
32 b2.set_log_level(b2.LogLevel.INFO)
33 
34 path = b2.create_path()
35 
36 rootInput = b2.register_module('RootInput')
37 rootInput.param('inputFileName', eval_file_train)
38 path.add_module(rootInput)
39 
40 # Event Info Module
41 eventinfoprinter = b2.register_module('EventInfoPrinter')
42 path.add_module(eventinfoprinter)
43 
44 path.add_module("Gearbox")
45 path.add_module("Geometry")
46 
47 add_hit_preparation_modules(path, components=['SVD'])
48 
49 add_vxd_track_finding_vxdtf2(path, reco_tracks="RecoTracks", components=['SVD'], suffix="", sectormap_file=sector_map)
50 
51 add_mc_matcher(path, components=['SVD'])
52 
53 data = b2.register_module('VXDQETrainingDataCollector')
54 data.param('EstimationMethod', estimationMethod)
55 data.param('ClusterInformation', clusterInfo)
56 data.param('TrainingDataOutputName', name + '.root')
57 data.param('SpacePointTrackCandsStoreArrayName', 'SPTrackCands')
58 data.param('MCRecoTracksStoreArrayName', 'MCRecoTracks')
59 path.add_module(data)
60 
61 b2.print_path(path)
62 b2.process(path)
63 print(b2.statistics)