29 Function to create folder FOLDER_NAME in db with channels and input data from values_list with tag TAG_NAME
30 :param db: Open cool db
31 :param values_list: list of tuples ('channel name', valus array)
34 spec = cool.RecordSpecification()
35 spec.extend(
'array_value',cool.StorageType.Float)
36 _logger.info(
'Create folder %s' % FOLDER_NAME)
37 folder_spec = cool.FolderSpecification(cool.FolderVersioning.MULTI_VERSION,
39 cool.PayloadMode.VECTORPAYLOAD)
40 folder = db.createFolder(FOLDER_NAME, folder_spec,
41 ' <timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type="71" clid="55403898"/></addrHeader><typeName>CondAttrListVec</typeName>',
44 for index, channel_name
in enumerate(values_list):
45 folder.createChannel(index,channel_name[0])
46 print '%i - %s' % (index, channel_name[0])
47 folder.setupStorageBuffer()
48 for index, channel_values
in enumerate(values_list):
49 _logger.info(
'Store data from %s' % channel_values[0])
50 values = channel_values[1]
53 vector = cool.IRecordVector()
56 data = cool.PyCool.Helpers.IRecordPtr(spec)
57 data.get()[
'array_value'] = value
58 vector.push_back(data)
59 folder.storeObject(0,cool.ValidityKeyMax, vector, index, TAG_NAME )
60 folder.flushStorageBuffer()