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