468 def register(self, since=(MINRUN,MINLBK), tag=
""):
469 """
470 Registers the folder in the database.
471 - since: lower limit of IOV
472 - tag : The tag to write to
473
474 The interpretation of the 'since' inputs depends on their type:
475 - tuple(int,int) : run and lbk number
476 """
477
478 jdata = {}
479 for drawerIdx,blob in self.__drawerBlob.items():
480 if blob is None or blob==0:
481 b64string = ''
482 else:
483 b64string = str(base64.b64encode(blob.read()), 'ascii')
484 jdata[drawerIdx] = [b64string]
485
486 (sinceRun, sinceLumi) = since
487
488 if not self.__db or (self.__db and self.__db.endswith('.json')):
489
490 fullTag = tag
491 if self.__folderPath and not (tag.upper().startswith('TILE') or tag.upper().startswith('CALO')):
493 fileName = f"{fullTag}.{sinceRun}.{sinceLumi}.json"
494 if self.__db:
495 fileName = f'{self.__db[:-5]}.{fileName}'
496
497 with open(fileName, 'w') as the_file:
498 json.dump(jdata, the_file)
499 the_file.write('\n')
500
501
502 self.log().info( 'Writting tag "%s"', fullTag)
503 self.log().info( '... since : [%s,%s]' , sinceRun, sinceLumi)
504 self.log().info( '... with comment field: "%s"', self.getComment())
505 self.log().info( '... into file : %s' , fileName)
506
static std::string getFullTag(const std::string &folder, const std::string &tag)
Returns the full tag string, composed of camelized folder name and tag part.