ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DataQuality
DataQualityUtils
python
createMdtFolders.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2
3
# *************************************************
4
# Author monica.verducci@cern.ch
5
# python script to create the MDT DQ folders in sqlite files and fill in it
6
# during the postprocessing algorithm
7
# ************************************************
8
9
def
createMDTConditionDBDead
():
10
import
os
11
from
PyCool
import
cool
12
13
# get database service and open database
14
dbSvc = cool.DatabaseSvcFactory.databaseService()
15
# database accessed via physical name
16
17
dbstring =
'sqlite://;schema=MDTDQMFOFFLINE_DEAD.db;dbname=MDT_DQA'
18
19
if
os.access(
'MDTDQMFOFFLINE_DEAD.db'
, os.R_OK):
20
try
:
21
os.unlink(
'MDTDQMFOFFLINE_DEAD.db'
)
22
#print 'Trying to Delete'
23
except
Exception
as
e:
24
print
(
'Unable to remove existing db file, reason'
, e)
25
try
:
26
db = dbSvc.createDatabase(dbstring)
27
except
Exception
as
e:
28
print
(
'Problem creating database'
, e)
29
return
30
#print "Created database",dbstring
31
32
spec2 = cool.RecordSpecification()
33
spec2.extend(
"Chamber_Name"
, cool.StorageType.String255)
34
spec2.extend(
"Dead_multilayer"
, cool.StorageType.String255)
35
spec2.extend(
"Dead_layer"
, cool.StorageType.String255)
36
spec2.extend(
"Dead_mezz"
, cool.StorageType.String255)
37
spec2.extend(
"Dead_asd"
, cool.StorageType.String255)
38
spec2.extend(
"Dead_tube"
, cool.StorageType.String4k)
39
40
desc =
"<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"1238547719\" /></addrHeader><typeName>CondAttrListCollection</typeName>"
41
42
# create the folder - single version
43
# last argument is createParents - if true, automatically creates parent
44
# folders if needed
45
# note this will not work if the database already exists - delete mycool.db first
46
# Deprecated/dropped: myfolder=db.createFolder("/OFFLINE/DQMFOFFLINE/DQMFOFFLINE_DEAD",spec2,desc,cool.FolderVersioning.MULTI_VERSION,True)
47
folderSpec = cool.FolderSpecification(
48
cool.FolderVersioning.MULTI_VERSION, spec2)
49
db.createFolder(
50
"/OFFLINE/DQMFOFFLINE/DQMFOFFLINE_DEAD"
, folderSpec, desc,
True
)
51
db.closeDatabase()
52
53
54
def
createMDTConditionDBNoisy
():
55
import
os
56
from
PyCool
import
cool
57
58
# get database service and open database
59
dbSvc = cool.DatabaseSvcFactory.databaseService()
60
# database accessed via physical name
61
62
dbstring =
'sqlite://;schema=MDTDQMFOFFLINE_NOISY.db;dbname=MDT_DQA'
63
64
if
os.access(
'MDTDQMFOFFLINE_NOISY.db'
, os.R_OK):
65
try
:
66
os.unlink(
'MDTDQMFOFFLINE_NOISY.db'
)
67
except
Exception
as
e:
68
print
(
'Unable to remove existing db file, reason'
, e)
69
try
:
70
db = dbSvc.createDatabase(dbstring)
71
except
Exception
as
e:
72
print
(
'Problem creating database'
, e)
73
return
74
#print "Created database",dbstring
75
76
spec2 = cool.RecordSpecification()
77
spec2.extend(
"Chamber_Name"
, cool.StorageType.String255)
78
spec2.extend(
"Noisy_multilayer"
, cool.StorageType.String255)
79
spec2.extend(
"Noisy_layer"
, cool.StorageType.String255)
80
spec2.extend(
"Noisy_mezz"
, cool.StorageType.String255)
81
spec2.extend(
"Noisy_asd"
, cool.StorageType.String255)
82
spec2.extend(
"Noisy_tube"
, cool.StorageType.String4k)
83
84
desc =
"<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"1238547719\" /></addrHeader><typeName>CondAttrListCollection</typeName>"
85
86
# create the folder - single version
87
# last argument is createParents - if true, automatically creates parent
88
# folders if needed
89
# note this will not work if the database already exists - delete mycool.db first
90
# Deprecated/dropped: myfolder=db.createFolder("/OFFLINE/DQMFOFFLINE/DQMFOFFLINE_NOISY",spec2,desc,cool.FolderVersioning.MULTI_VERSION,True)
91
folderSpec = cool.FolderSpecification(
92
cool.FolderVersioning.MULTI_VERSION, spec2)
93
db.createFolder(
94
"/OFFLINE/DQMFOFFLINE/DQMFOFFLINE_NOISY"
, folderSpec, desc,
True
)
95
db.closeDatabase()
print
void print(char *figname, TCanvas *c1)
Definition
TRTCalib_StrawStatusPlots.cxx:26
python.createMdtFolders.createMDTConditionDBDead
createMDTConditionDBDead()
Definition
createMdtFolders.py:9
python.createMdtFolders.createMDTConditionDBNoisy
createMDTConditionDBNoisy()
Definition
createMdtFolders.py:54
Generated on
for ATLAS Offline Software by
1.17.0