12 from PyCool
import cool
15 dbSvc = cool.DatabaseSvcFactory.databaseService()
17 dbstring =
'sqlite://;schema=RPCDQMFOFFLINE.db;dbname=RPC_DQA'
18 if os.access(
'RPCDQMFOFFLINE.db', os.R_OK):
20 os.unlink(
'RPCDQMFOFFLINE.db')
21 except Exception
as e:
22 print(
'Unable to remove existing db file, reason', e)
24 db = dbSvc.createDatabase(dbstring)
25 except Exception
as e:
26 print(
'Problem creating database', e)
28 print(
"Created database", dbstring)
30 spec2 = cool.RecordSpecification()
31 spec2.extend(
"recEta", cool.StorageType.String4k)
32 spec2.extend(
"detEta", cool.StorageType.String4k)
33 spec2.extend(
"recPhi1", cool.StorageType.String4k)
34 spec2.extend(
"recPhi2", cool.StorageType.String4k)
35 spec2.extend(
"detPhi1", cool.StorageType.String4k)
36 spec2.extend(
"detPhi2", cool.StorageType.String4k)
39 desc =
"<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"1238547719\" /></addrHeader><typeName>CondAttrListCollection</typeName>"
45 folderSpec = cool.FolderSpecification(
46 cool.FolderVersioning.MULTI_VERSION, spec2)
47 db.createFolder(
'/OFFLINE/OFFLINE_DQMF', folderSpec, desc,
True)
53 from PyCool
import cool
56 dbSvc = cool.DatabaseSvcFactory.databaseService()
58 dbstring =
'sqlite://;schema=RPCConditionDB.db;dbname=RPC_DQA'
59 if os.access(
'RPCConditionDB.db', os.R_OK):
61 os.unlink(
'RPCConditionDB.db')
62 except Exception
as e:
63 print(
'Unable to remove existing db file, reason', e)
65 db = dbSvc.createDatabase(dbstring)
66 except Exception
as e:
67 print(
'Problem creating database', e)
69 print(
"Created database", dbstring)
71 spec2 = cool.RecordSpecification()
72 spec2.extend(
"PanelRes", cool.StorageType.String255)
73 spec2.extend(
"StripStatus", cool.StorageType.String4k)
75 desc =
"<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"1238547719\" /></addrHeader><typeName>CondAttrListCollection</typeName>"
82 folderSpec = cool.FolderSpecification(
83 cool.FolderVersioning.MULTI_VERSION, spec2)
84 db.createFolder(
'/OFFLINE/FINAL', folderSpec, desc,
True)