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