Belle II Software  release-08-01-10
checkEventInfo.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 import basf2 as b2
12 from ROOT import Belle2
13 
14 
17 
18 
19 # register modules
20 eventinfosetter = b2.register_module("EventInfoSetter")
21 eventinfoprinter = b2.register_module("EventInfoPrinter")
22 
23 # set parameters in modules
24 param_eventinfosetter = {'expList': [1],
25  'runList': [1],
26  'evtNumList': [1]}
27 
28 
29 class Check_info(b2.Module):
30  ''' check the SVDEventInfo object'''
31 
32  def event(self):
33  '''print the SVDEventInfo to string in each event'''
34  eventInfo = Belle2.PyStoreObj('SVDEventInfo')
35  b2.B2INFO(eventInfo.toString())
36 
37 
38 eventinfosetter.param(param_eventinfosetter)
39 
40 # create path and add modules
41 main = b2.create_path()
42 main.add_module(eventinfosetter)
43 main.add_module(eventinfoprinter)
44 
45 setInfo = b2.register_module('SVDEventInfoSetter')
46 # exemplary settings that overwrite default ones
47 # setInfo.param('runType', 1) #transparent
48 # setInfo.param('eventType', 1) #local mode
49 # setInfo.param('daqMode', 1) #3 samples
50 # setInfo.param('triggerBin', 3) #last bin
51 # setInfo.param('triggerType', 1) #ecl trigger
52 # setInfo.param('crossTalk', True) #cross-talk event
53 
54 main.add_module(setInfo)
55 
56 checkInfo = b2.register_module(Check_info())
57 main.add_module(checkInfo)
58 
59 # process
60 b2.process(main)
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67