Belle II Software development
CDCWireHitRequirementsImporter.py
1#!/usr/bin/env python
2
3
10
11"""
12CDC Database importer.
13Simple example to import CDCWireHitRequirements to the database.
14"""
15
16import basf2
17from ROOT.Belle2 import FileSystem
18from ROOT.Belle2 import CDCDatabaseImporter
19
20# Input json file containing the CDCWireHitRequirements
21# N.B. In the json file, -1 as upper limit means unbound.
22INPUT = FileSystem.findFile("data/cdc/CDCWireHitRequirements_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
30basf2.conditions.testing_payloads = ["localdb/database.txt"]
31
32main = basf2.create_path()
33
34# Event info setter - execute single event
35eventinfosetter = basf2.register_module('EventInfoSetter')
36main.add_module(eventinfosetter)
37
38# process single event
39basf2.process(main)
40
41dbImporter = CDCDatabaseImporter(expFirst, runFirst, expLast, runLast)
42dbImporter.importCDCWireHitRequirements(INPUT)
43
44# This line print the result for exp0/run0
45dbImporter.printCDCWireHitRequirements()