Belle II Software development
svdDQMEfficiency.py
1# !/usr/bin/env python3
2
3
10
11import basf2 as b2
12import sys
13import rawdata as raw
14import tracking as tr
15from basf2 import conditions as b2conditions
16
17main = b2.Path()
18outputFile = sys.argv[1]
19
20b2conditions.prepend_globaltag('data_reprocessing_prompt')
21
22main.add_module('RootInput', branchNames=['RawSVDs', 'RawPXDs', 'RawCDCs'])
23main.add_module('HistoManager', histoFileName=outputFile)
24
25main.add_module('Gearbox')
26main.add_module('Geometry')
27
28# raw data unpacking
29raw.add_unpackers(main, components=['PXD', 'SVD', 'CDC'])
30for module in main.modules():
31 if module.name() == 'PXDPostErrorChecker':
32 module.param('CriticalErrorMask', 0)
33
34tr.add_tracking_reconstruction(main)
35
36main = b2.remove_module(main, 'FullGridChi2TrackTimeExtractor')
37
38
39# ROI finder
40svdDataRed = b2.register_module('SVDROIFinder')
41param_svdDataRed = {
42 'recoTrackListName': 'RecoTracks',
43 'SVDInterceptListName': 'SVDIntercepts',
44}
45svdDataRed.param(param_svdDataRed)
46# svdDataRed.logging.log_level = LogLevel.INFO
47main.add_module(svdDataRed)
48
49dqm = b2.register_module('SVDDQMEfficiency')
50dqm.param("svdClustersName", "SVDClusters")
51dqm.param("interceptsName", "SVDIntercepts")
52dqm.param("histogramDirectoryName", "svdeff")
53dqm.param("binsU", 4)
54dqm.param("binsV", 6)
55dqm.param("minSVDHits", 1)
56dqm.param("minCDCHits", 20)
57dqm.param("momCut", 0)
58dqm.param("ptCut", 1)
59dqm.param("maxHalfResidU", 0.05)
60dqm.param("maxHalfResidV", 0.05)
61# dqm.logging.log_level = LogLevel.ERROR
62main.add_module(dqm)
63
64# Process the events
65main.add_module('Progress')
66b2.print_path(main)
67b2.process(main)
68
69# print out the summary
70print(b2.statistics)