ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
JetTagging
JetTagPerformanceCalibration
CalibrationDataInterface
share
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
13
import
os,commands,sys
14
15
os.system(
'rm -f consolecmds'
)
16
f=open(
'consolecmds'
,
'w'
)
17
18
tagname =
'MyCalibV1'
19
hfileprefix=
'BTaggingPerformance'
+tagname+
'_'
20
froot =
'/GLOBAL/BTagPerfCalib/'
21
db =
'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
26
folder =
'Cuts'
27
channel =
' 1 '
28
29
longfolder = froot + folder
30
hfile = hfileprefix + folder +
'.root'
31
longtag = tagname +
'_'
+ folder
32
cmd = db +
' '
+ longfolder + channel + longtag +
' '
+ hfile
33
os.system(
'coolHist_setReference.py '
+ cmd)
34
smd =
'setchan '
+ longfolder + channel + folder
35
f.write(smd+
'\n'
)
36
smd =
'settag '
+ longfolder +
' '
+ longtag +
' '
+ tagname
37
f.write(smd+
'\n'
)
38
39
f.write(
'exit\n'
)
40
f.close()
41
42
#os.system('AtlCoolConsole.py "sqlite://;schema=mycool.db;dbname=OFLP200" < consolecmds')
Generated on
for ATLAS Offline Software by
1.17.0