ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileCalib
TileCalibBlobPython
share
integrator_readDb.py
Go to the documentation of this file.
1
#!/bin/env python
2
3
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4
#
5
# integrator_readDb.py
6
# Nils Gollub <nils.gollub@cern.ch>, 2008-02-07
7
8
import
sys
9
10
#=== process command line arguments
11
usage =
"Usage: integrator_readDb.py [\"yyyy-mm-dd hh:mm:ss\"]"
12
if
(len(sys.argv)>2)
or
(
"-h"
in
sys.argv)
or
(
"--help"
in
sys.argv):
13
print
(usage)
14
sys.exit(0)
15
sys.argv.pop(0)
16
pointInTime = -1
17
if
len(sys.argv)>0:
18
pointInTime = sys.argv.pop(0)
19
20
#=== get a logger
21
from
TileCalibBlobPython.TileCalibLogger
import
getLogger
22
log = getLogger(
"int_readDb"
)
23
24
#=== open the database
25
from
TileCalibBlobPython
import
TileCalibTools
26
db = TileCalibTools.openDb(
'SQLITE'
,
'CONDBR2'
,
'READONLY'
)
27
28
#=== get a blob writer
29
blobReader = TileCalibTools.TileBlobReader(db,
"/TILE/ONL01/INTEGRATOR"
)
30
31
#=== write out the comment
32
comment = blobReader.getComment(pointInTime)
33
log.info(
"Comment: \"%s\""
, comment)
34
35
#=== write out all values
36
for
ros
in
range(1,5):
37
for
mod
in
range(64):
38
39
#=== get the drawer
40
cd = blobReader.getDrawer(ros,mod,pointInTime)
41
#=== check if data is avialable and continue if not
42
if
not
cd:
43
continue
44
45
for
pmt
in
range(48):
46
for
gain
in
range(6):
47
outStr =
"ros/mod/pmt/gain = %i/%2i/%2i/%i : "
% (ros,mod,pmt,gain)
48
outStr+=
"gain=%f+/-%f "
% (cd.getData(pmt,gain,0),cd.getData(pmt,gain,1))
49
outStr+=
"ped=%f+/-%f "
% (cd.getData(pmt,gain,4),cd.getData(pmt,gain,5))
50
outStr+=
"rms=%f+/-%f "
% (cd.getData(pmt,gain,6),cd.getData(pmt,gain,7))
51
outStr+=
"dac=%3i chi2=%f"
% (cd.getData(pmt,gain,3),cd.getData(pmt,gain,2))
52
log.info(outStr)
53
54
55
#=== close the database connection
56
db.closeDatabase()
Generated on
for ATLAS Offline Software by
1.17.0