Belle II Software  release-06-01-15
checkUnpacking.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # ---------------------------------------------------------------------------------------
13 # Checks the unpacking of raw data given in Interim FE format
14 # Usage: basf2 checkUnpacking.py -i <file_name.sroot> [<debug_level>]
15 # debug_level 100: to print additional information on errors
16 # debug_level 200: to print buffer sizes and additional information on errors
17 # ---------------------------------------------------------------------------------------
18 
19 import basf2 as b2
20 import sys
21 
22 debuglevel = 0
23 argvs = sys.argv
24 if len(argvs) > 1:
25  debuglevel = int(argvs[1])
26 
27 # Define a global tag (note: the one given bellow will become out-dated!)
28 b2.use_central_database('data_reprocessing_proc8')
29 
30 # Create path
31 main = b2.create_path()
32 
33 # input
34 roinput = b2.register_module('SeqRootInput')
35 # roinput = register_module('RootInput')
36 main.add_module(roinput)
37 
38 # conversion from RawCOPPER or RawDataBlock to RawDetector objects
39 converter = b2.register_module('Convert2RawDet')
40 main.add_module(converter)
41 
42 # Initialize TOP geometry parameters (creation of Geant geometry is not needed)
43 main.add_module('TOPGeometryParInitializer')
44 
45 # Unpacking (format auto detection works now)
46 unpack = b2.register_module('TOPUnpacker')
47 unpack.logging.log_level = b2.LogLevel.DEBUG
48 unpack.logging.debug_level = debuglevel
49 main.add_module(unpack)
50 
51 # Print progress
52 progress = b2.register_module('Progress')
53 main.add_module(progress)
54 
55 # Process events
56 b2.process(main)
57 
58 # Print statistics
59 print(b2.statistics)