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