Belle II Software  release-06-01-15
cdst_checkT0calibration.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # ---------------------------------------------------------------------------------------
13 # Check T0 calibration with Bhabha (or dimuon) events. Results in a root file.
14 #
15 # usage: basf2 cdst_checkT0calibration.py -i <cdst_file.root>
16 # ---------------------------------------------------------------------------------------
17 
18 import basf2 as b2
19 
20 # Global tag: use global tag replay
21 
22 # Create path
23 main = b2.create_path()
24 
25 # Input: cDST file(s) of Bhabha skim, use -i option
26 roinput = b2.register_module('RootInput')
27 main.add_module(roinput)
28 
29 # Initialize TOP geometry parameters (creation of Geant geometry is not needed)
30 main.add_module('TOPGeometryParInitializer')
31 
32 # Channel masking
33 main.add_module('TOPChannelMasker')
34 
35 # Calibration checker: for dimuon sample replace 'bhabha' with 'dimuon'
36 calibrator = b2.register_module('TOPChannelT0Calibrator')
37 calibrator.param('sample', 'bhabha')
38 calibrator.param('outputFileName', 'checkT0cal_r*.root')
39 main.add_module(calibrator)
40 
41 # Print progress
42 progress = b2.register_module('Progress')
43 main.add_module(progress)
44 
45 # Process events
46 b2.process(main)
47 
48 # Print statistics
49 print(b2.statistics)