Belle II Software  release-08-01-10
runSVDDQM.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 
19 
20 import basf2 as b2
21 from tracking import add_tracking_reconstruction
22 from rawdata import add_unpackers
23 
24 # needed for some temporary issues with BKLMDisplacement payload
25 # b2conditions.override_globaltags()
26 # b2conditions.globaltags = ['patch_main_release-08', 'patch_main_release-07',
27 # 'data_reprocessing_prompt', 'dp_recon_release6_patch','online', 'svd_basic']
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 # SVD space point
68 b2.set_module_parameters(
69  main,
70  'SVDSpacePointCreator',
71  forceGroupingFromDB=False,
72  useSVDGroupInfoIn3Sample=False,
73  useSVDGroupInfoIn6Sample=False)
74 
75 # SVD grouping
76 b2.set_module_parameters(
77  main,
78  'SVDTimeGrouping',
79  forceGroupingFromDB=False,
80  isEnabledIn6Samples=True,
81  isEnabledIn3Samples=True)
82 
83 # ** SVD DATA FORMAT - available only with unpacking
84 # -> it needs SVDDAQDiagnostic
85 unpacker = main.add_module('SVDUnpackerDQM')
86 # unpacker.set_log_level(LogLevel.DEBUG) # LogLevel.DEBUG / LogLevel.INFO
87 # unpacker.set_debug_level(100)
88 
89 # ** SVD ExpressReco General
90 main.add_module('SVDDQMExpressReco', offlineZSShaperDigits='SVDShaperDigitsZS5')
91 
92 # ** SVD Efficiency - available only with full reconstruction
93 # -> it neeeds Tracks and relations
94 main.add_module('SetupGenfitExtrapolation')
95 main.add_module('SVDROIFinder', recoTrackListName='RecoTracks', SVDInterceptListName='SVDIntercepts')
96 main.add_module('SVDDQMEfficiency')
97 
98 # ** SVD Clusters On Track - available only with full reconstruction
99 # -> it neeeds Tracks and relations
100 main.add_module('SVDDQMClustersOnTrack')
101 
102 # ** SVD Occupancy after Injection - need RawFTSW & Offline ZS
103 injection = main.add_module('SVDDQMInjection', ShaperDigits='SVDShaperDigitsZS5')
104 # injection.set_log_level(LogLevel.DEBUG) # LogLevel.DEBUG / LogLevel.INFO
105 # injection.set_debug_level(30)
106 
107 # ** SVD Hit Time
108 SVDHitTimeDQMmodule = main.add_module("SVDDQMHitTime")
109 # SVDHitTimeDQMmodule.set_log_level(LogLevel.INFO) # LogLevel.DEBUG / LogLevel.INFO
110 # SVDHitTimeDQMmodule.set_debug_level(21)
111 
112 # == Show progress
113 main.add_module('Progress')
114 
115 b2.print_path(main)
116 
117 # Process events
118 b2.process(main)
119 
120 print(b2.statistics)