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