Belle II Software  release-08-01-10
KLMDQM2Test.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import modularAnalysis as ma
13 import rawdata as raw
14 import reconstruction as re
15 from daqdqm.commondqm import add_common_dqm
16 import basf2 as b2
17 
18 # Set the log level to show only error and fatal messages
19 # set_log_level(LogLevel.ERROR)
20 b2.set_log_level(b2.LogLevel.INFO)
21 
22 path = "/group/belle2/dataprod/Data/Raw/e0018/r01553/sub00/"
23 files = path+"physics.0018.01553.HLT8.f0000*.root"
24 
25 # Create main path
26 main = b2.create_path()
27 
28 # useful tags for release-06
29 b2.conditions.globaltags = ['online',
30  'dp_recon_release6_patch',
31  'ecl_release06_forOnline']
32 
33 main.add_module("RootInput", inputFileNames=files)
34 main.add_module("HistoManager", histoFileName="KLMDQMHistograms.root")
35 main.add_module('Gearbox')
36 main.add_module('Geometry')
37 raw.add_unpackers(main)
38 re.add_reconstruction(main, add_muid_hits=True)
39 
40 software_trigger = "software_trigger_cut&skim&accept_mumutight"
41 cut_string = f'SoftwareTriggerResult({software_trigger})>0'
42 
43 add_common_dqm(main, dqm_environment='HLT', dqm_mode='dont_care')
44 ma.fillParticleList('mu+:all', cut="", path=main)
45 ma.cutAndCopyList("mu+:cut", "mu+:all", cut_string, path=main)
46 
47 collector = b2.register_module('KLMStripEfficiencyCollector')
48 collector.param('Debug', True)
49 collector.param('DebugFileName', 'KLMStripEffCollector_debugFile.root')
50 collector.param('MuonListName', 'mu+:cut') # to be consistent with KLMDQM2
51 main.add_module(collector)
52 
53 klm2 = b2.register_module('KLMDQM2')
54 main.add_module(klm2)
55 
56 main.add_module('Progress')
57 b2.print_path(main)
58 
59 
60 # Process all events
61 b2.process(main, max_event=1000)
62 print(b2.statistics)