9 from __future__
import print_function
13 from PyCool
import cool
16 dbSvc = cool.DatabaseSvcFactory.databaseService()
18 dbstring =
'sqlite://;schema=RPCDQMFOFFLINE.db;dbname=RPC_DQA'
19 if os.access(
'RPCDQMFOFFLINE.db', os.R_OK):
21 os.unlink(
'RPCDQMFOFFLINE.db')
22 except Exception
as e:
23 print(
'Unable to remove existing db file, reason', e)
25 db = dbSvc.createDatabase(dbstring)
26 except Exception
as e:
27 print(
'Problem creating database', e)
29 print(
"Created database", dbstring)
31 spec2 = cool.RecordSpecification()
32 spec2.extend(
"recEta", cool.StorageType.String4k)
33 spec2.extend(
"detEta", cool.StorageType.String4k)
34 spec2.extend(
"recPhi1", cool.StorageType.String4k)
35 spec2.extend(
"recPhi2", cool.StorageType.String4k)
36 spec2.extend(
"detPhi1", cool.StorageType.String4k)
37 spec2.extend(
"detPhi2", cool.StorageType.String4k)
40 desc =
"<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"1238547719\" /></addrHeader><typeName>CondAttrListCollection</typeName>"
46 folderSpec = cool.FolderSpecification(
47 cool.FolderVersioning.MULTI_VERSION, spec2)
48 db.createFolder(
'/OFFLINE/OFFLINE_DQMF', folderSpec, desc,
True)
54 from PyCool
import cool
57 dbSvc = cool.DatabaseSvcFactory.databaseService()
59 dbstring =
'sqlite://;schema=RPCConditionDB.db;dbname=RPC_DQA'
60 if os.access(
'RPCConditionDB.db', os.R_OK):
62 os.unlink(
'RPCConditionDB.db')
63 except Exception
as e:
64 print(
'Unable to remove existing db file, reason', e)
66 db = dbSvc.createDatabase(dbstring)
67 except Exception
as e:
68 print(
'Problem creating database', e)
70 print(
"Created database", dbstring)
72 spec2 = cool.RecordSpecification()
73 spec2.extend(
"PanelRes", cool.StorageType.String255)
74 spec2.extend(
"StripStatus", cool.StorageType.String4k)
76 desc =
"<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"1238547719\" /></addrHeader><typeName>CondAttrListCollection</typeName>"
83 folderSpec = cool.FolderSpecification(
84 cool.FolderVersioning.MULTI_VERSION, spec2)
85 db.createFolder(
'/OFFLINE/FINAL', folderSpec, desc,
True)