Belle II Software  release-06-00-14
runSVDDQM.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 
19 
20 import basf2 as b2
21 from basf2 import conditions as b2conditions
22 from tracking import add_tracking_reconstruction
23 from rawdata import add_unpackers
24 
25 # needed for some temporary issues with BKLMDisplacement payload
26 b2conditions.override_globaltags()
27 b2conditions.globaltags = ['klm_alignment_testing', 'online']
28 
29 # main main
30 main = b2.create_path()
31 
32 # RAW
33 files = [' /group/belle2/dataprod/Data/Raw/e0010/r04295/sub00/physics.0010.04295.HLT1*.root']
34 
35 # old-format cDST
36 # files=["/group/belle2/dataprod/Data/release-04-00-02/DB00000523/Unofficial/e0010/4S/r04295/skim/hlt_hadron/cdst/sub00/cdst.physics.0010.04295.HLT1*.root","/group/belle2/dataprod/Data/release-04-00-02/DB00000523/Unofficial/e0010/4S/r04295/skim/hlt_bhabha/cdst/sub00/cdst.physics.0010.04295.HLT1.*.root","/group/belle2/dataprod/Data/release-04-00-02/DB00000523/Unofficial/e0010/4S/r04295/skim/hlt_mumu_2trk/cdst/sub00/cdst.physics.0010.04295.HLT1.*.root"]
37 
38 # read input rootfile
39 # -> can be overwritten with the -i option
40 main.add_module("RootInput", inputFileNames=files)
41 
42 # register the HistoManager and specify output file
43 main.add_module("HistoManager", histoFileName="SVDDQMOutput.root")
44 
45 # nee to know SVD geometry to create histograms
46 main.add_module('Gearbox')
47 main.add_module('Geometry')
48 
49 # if using RAW data you need to unpack them
50 add_unpackers(main, components=['SVD', 'CDC'])
51 # you may also want to do SVD reconstruction
52 # add_svd_reconstruction(main)
53 # or TRACKING reconstruction
54 add_tracking_reconstruction(main, components=['SVD', 'CDC'])
55 
56 # if using cDST with new format you have to do svd reconstruction
57 # add_svd_reconstruction(main)
58 
59 # add offline ZS
60 main.add_module(
61  'SVDZeroSuppressionEmulator',
62  SNthreshold=5,
63  ShaperDigits='SVDShaperDigits',
64  ShaperDigitsIN='SVDShaperDigitsZS5',
65  FADCmode=True)
66 
67 
68 # ** SVD DATA FORMAT - available only with unpacking
69 # -> it needs SVDDAQDiagnostic
70 # unpacker = main.add_module('SVDUnpackerDQM')
71 # unpacker.set_log_level(LogLevel.DEBUG) # LogLevel.DEBUG / LogLevel.INFO
72 # unpacker.set_debug_level(100)
73 
74 # ** SVD ExpressReco General
75 # main.add_module('SVDDQMExpressReco', offlineZSShaperDigits='SVDShaperDigitsZS5')
76 
77 # ** SVD Efficiency - available only with full reconstruction
78 # -> it neeeds Tracks and relations
79 # main.add_module('SetupGenfitExtrapolation')
80 # main.add_module('SVDROIFinder', recoTrackListName='RecoTracks', SVDInterceptListName='SVDIntercepts')
81 # main.add_module('SVDDQMEfficiency')
82 
83 # ** SVD Clusters On Track - available only with full reconstruction
84 # -> it neeeds Tracks and relations
85 # main.add_module('SVDDQMClustersOnTrack')
86 
87 # ** SVD Occupancy after Injection - need RawFTSW & Offline ZS
88 # injection = main.add_module('SVDDQMInjection', ShaperDigits='SVDShaperDigitsZS5')
89 # injection.set_log_level(LogLevel.DEBUG) # LogLevel.DEBUG / LogLevel.INFO
90 # injection.set_debug_level(30)
91 
92 # ** SVD Hit Time
93 SVDHitTimeDQMmodule = main.add_module("SVDDQMHitTime")
94 # SVDHitTimeDQMmodule.set_log_level(LogLevel.INFO) # LogLevel.DEBUG / LogLevel.INFO
95 # SVDHitTimeDQMmodule.set_debug_level(21)
96 
97 # == Show progress
98 main.add_module('Progress')
99 
100 b2.print_path(main)
101 
102 # Process events
103 b2.process(main)
104 
105 print(b2.statistics)