Belle II Software development
cdst_checkT0calibration.py
1#!/usr/bin/env python3
2
3
10
11# ---------------------------------------------------------------------------------------
12# Check T0 calibration with Bhabha (or dimuon) events. Results in a root file.
13#
14# usage: basf2 cdst_checkT0calibration.py -i <cdst_file.root>
15# ---------------------------------------------------------------------------------------
16
17import basf2 as b2
18from reconstruction import prepare_user_cdst_analysis
19
20# global tags
21# ******************************************************************************************************************
22# note: The patching global tags and their order are bucket number and basf2 version dependent.
23# Given below is what is needed for cdst files of bucket 16 calibration and January-2023 development version.
24# ******************************************************************************************************************
25b2.conditions.override_globaltags()
26b2.conditions.append_globaltag('patch_main_release-07_noTOP')
27b2.conditions.append_globaltag('data_reprocessing_proc13') # experiments 7 - 18
28# b2.conditions.append_globaltag('data_reprocessing_prompt') # experiments 20 - 26
29b2.conditions.append_globaltag('online')
30
31# Create path
32main = b2.create_path()
33
34# Input: cDST file(s) of Bhabha skim, use -i option
35# files of bucket 16 can be found on KEKCC in /gpfs/group/belle2/dataprod/Data/PromptReco/bucket16_calib/
36roinput = b2.register_module('RootInput')
37main.add_module(roinput)
38
39# run unpackers and post-tracking reconstruction
40prepare_user_cdst_analysis(main)
41
42# Calibration checker: for dimuon sample replace 'bhabha' with 'dimuon'
43calibrator = b2.register_module('TOPChannelT0Calibrator')
44calibrator.param('sample', 'bhabha')
45calibrator.param('outputFileName', 'checkT0cal_r*.root')
46main.add_module(calibrator)
47
48# Print progress
49progress = b2.register_module('Progress')
50main.add_module(progress)
51
52# Process events
53b2.process(main)
54
55# Print statistics
56print(b2.statistics)