ATLAS Offline Software
Loading...
Searching...
No Matches
defineDB.py
Go to the documentation of this file.
1# python script to define the DB for b-tagging performance calibration
2# Copied from the same functionality in the JetTagCalibration package
3#
4# This assumes:
5# - a single calibration file for all channels (jet algorithms) / taggers / flavours / operating points
6# - overall tag: tagname
7# The ROOT file containing the calibrations should be present, with a name like: BTaggingPerformanceMyCalibV1_Cuts.root
8# and it must have a GUID defined by the command: 'coolHist_setFileIdentifier.sh filename'.
9#
10# To run: python defineDB.py
11# Results: a local file called mycool.db
12
13import os,commands,sys
14
15os.system('rm -f consolecmds')
16f=open('consolecmds', 'w')
17
18tagname = 'MyCalibV1'
19hfileprefix='BTaggingPerformance'+tagname+'_'
20froot = '/GLOBAL/BTagPerfCalib/'
21db = 'OFLP200'
22
23# With the use of the CalibrationBroker's "ShadowFoldersAndChannels" option, there remains a single folder and a single channel.
24# Everything else (notably the Jet Collections) does not affect the DB.
25
26folder = 'Cuts'
27channel = ' 1 '
28
29longfolder = froot + folder
30hfile = hfileprefix + folder + '.root'
31longtag = tagname + '_' + folder
32cmd = db + ' ' + longfolder + channel + longtag + ' ' + hfile
33os.system('coolHist_setReference.py ' + cmd)
34smd = 'setchan ' + longfolder + channel + folder
35f.write(smd+'\n')
36smd = 'settag ' + longfolder + ' ' + longtag + ' ' + tagname
37f.write(smd+'\n')
38
39f.write('exit\n')
40f.close()
41
42#os.system('AtlCoolConsole.py "sqlite://;schema=mycool.db;dbname=OFLP200" < consolecmds')