Belle II Software development
CDCDatabaseImporter.py
1#!/usr/bin/env python
2
3
10
11"""
12CDC Database importer.
13Simple example.
14"""
15
16import basf2 as b2
17from ROOT import Belle2 # noqa: make the Belle2 namespace available
18from ROOT.Belle2 import CDCDatabaseImporter
19from ROOT.Belle2 import FileSystem
20
21# Specify the exp and run where iov is valid.
22# N.B. -1 means unbound.
23expFirst = 0
24expLast = -1
25runFirst = 0
26runLast = -1
27
28mapfile = FileSystem.findFile('data/cdc/ch_map.dat')
29t0file = FileSystem.findFile('data/cdc/t0_v1.dat')
30bwfile = FileSystem.findFile('data/cdc/badwire_v1.dat')
31psfile = FileSystem.findFile('data/cdc/propspeed_v0.dat')
32twfile = FileSystem.findFile('data/cdc/tw_off.dat')
33xtfile = FileSystem.findFile('data/cdc/xt_v3.0.1_chebyshev.dat.gz')
34sgfile = FileSystem.findFile('data/cdc/sigma_v2.dat')
35fffile = FileSystem.findFile('data/cdc/ffactor.dat')
36dispfile = FileSystem.findFile('data/cdc/displacement_v1.1.dat')
37alfile = FileSystem.findFile('data/cdc/alignment_v2.dat')
38# misalfile = FileSystem.findFile('data/cdc/misalignment_v2.dat')
39fefile = FileSystem.findFile('cdc/data/fee_phase3.dat')
40# edfile = FileSystem.findFile('cdc/data/edeptoadc.dat')
41b2.use_local_database("localDB/database.txt", "localDB")
42
43main = b2.create_path()
44
45# Event info setter - execute single event
46eventinfosetter = b2.register_module('EventInfoSetter')
47eventinfosetter.param({'evtNumList': [1], 'runList': [1]})
48main.add_module(eventinfosetter)
49
50# Gearbox - access to xml files
51gearbox = b2.register_module('Gearbox')
52main.add_module(gearbox)
53
54# process single event
55b2.process(main)
56
57dbImporter = CDCDatabaseImporter(expFirst, runFirst, expLast, runLast)
58# dbImporter = CDCDatabaseImporter()
59dbImporter.importChannelMap(mapfile)
60# dbImporter.importFEEParam(fefile)
61dbImporter.importTimeZero(t0file)
62dbImporter.importBadWire(bwfile)
63dbImporter.importPropSpeed(psfile)
64dbImporter.importTimeWalk(twfile)
65dbImporter.importXT(xtfile)
66dbImporter.importSigma(sgfile)
67dbImporter.importFFactor(fffile)
68dbImporter.importDisplacement(dispfile)
69dbImporter.importWirPosAlign(alfile)
70dbImporter.importADCDeltaPedestal()
71dbImporter.importFEElectronics(fefile)
72# dbImporter.importEDepToADC(edfile)
73# dbImporter.importWirPosMisalign(misalfile)
74
75# dbImporter.printChannelMap()
76# dbImporter.printFEEParam()
77# dbImporter.printTimeZero()
78# dbImporter.printBadWire()
79# dbImporter.printPropSpeed()
80# dbImporter.printTimeWalk()
81# dbImporter.printXT()
82# dbImporter.printSigma()
83# dbImporter.printFFactor()
84# dbImporter.printDisplacement()
85# dbImporter.printWirPosAlign()
86# dbImporter.printWirPosMisalign()
87# dbImporter.printFEElectronics()
88# dbImporter.printEDepToADC()