96 def createSqlite(sqliteName,folderName,foldertag,iovMin=cool.ValidityKeyMin,iovMax=cool.ValidityKeyMax,inputFileName=None,defaultvalue=1.0):
98 dbSvc = cool.DatabaseSvcFactory.databaseService()
100 if os.access(sqliteName,os.R_OK):
101 print (
"UPDATING existing sqlite file",sqliteName)
102 db=dbSvc.openDatabase(
"sqlite://;schema="+sqliteName+
";dbname=CONDBR2",
False)
104 print (
"Creating new sqlite file",sqliteName)
105 db=dbSvc.createDatabase(
"sqlite://;schema="+sqliteName+
";dbname=CONDBR2")
108 spec = cool.RecordSpecification()
109 spec.extend(
'CaloCondBlob16M', cool.StorageType.Blob16M )
111 desc=
'<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type="71" clid="40774348" /></addrHeader><typeName>AthenaAttributeList</typeName>'
113 if db.existsFolder(folderName):
114 folder=db.getFolder(folderName)
116 print (
"Creating COOL folder/tag %s/%s" % (folderName,foldertag))
118 folderSpec = cool.FolderSpecification(cool.FolderVersioning.MULTI_VERSION, spec)
119 folder = db.createFolder(folderName, folderSpec, desc,
True)
122 if inputFileName
is None or len(inputFileName)==0:
123 print (
"No input given. Create empty blob")
124 data = cool.Record(spec)
128 print (
"Storing CaloCondBlob object")
129 folder.storeObject(iovMin, iovMax, data, cool.ChannelId(0), foldertag,
True)