Belle II Software development
CDClayerTimeCutImporter.py
1#!/usr/bin/env python
2
3
10
11"""
12CDC Database importer.
13Simple example to import CDClayerTimeCut payload from json file to the database.
14"""
15
16import basf2
17from ROOT.Belle2 import FileSystem
18from ROOT.Belle2 import CDCDatabaseImporter
19
20# Input json file containing the CDClayerTimeCut
21# N.B. In the json file, -1 as upper limit means unbound.
22INPUT = FileSystem.findFile("data/cdc/CDClayerTimeCut_example.json")
23
24# Specify the exp and run where iov is valid.
25# N.B. -1 means unbound.
26expFirst = 0
27expLast = -1
28runFirst = 0
29runLast = -1
30
31basf2.conditions.testing_payloads = ["localdb/database.txt"]
32
33main = basf2.create_path()
34
35# Event info setter - execute single event
36eventinfosetter = basf2.register_module('EventInfoSetter')
37main.add_module(eventinfosetter)
38
39# process single event
40basf2.process(main)
41
42dbImporter = CDCDatabaseImporter(expFirst, runFirst, expLast, runLast)
43dbImporter.importCDClayerTimeCut(INPUT)
44
45# This line print the result for exp0/run0
46dbImporter.printCDClayerTimeCut()