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