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