log.info("IOVs: %s", str(iovList)) log.info("%d IOVs in total, end of last IOV is %s", ie - ib, str(until)) if len(iovList) == 0: if run < 0: raise Exception("Please, provide run number at command line") else: log.info("Creating single IOV starting from run,lumi %d,%d", run, lumi) since = (run, lumi) until = (end, endlumi) iovList = [since] iovUntil = [until] #=== Open DB connections oschema = 'sqlite://;schema=' + outFile + ';dbname=' + dbName dbr = CaloCondTools.openDbConn(ischema, 'READONLY') update = update or (inFile == outFile) dbw = CaloCondTools.openDbConn(oschema, ('UPDATE' if update else 'RECREATE')) reader = CaloCondTools.CaloBlobReader(dbr, folderPath, inTag) writer = CaloCondTools.CaloBlobWriter(dbw, folderPath, 'Flt', (outTag != "" and outTag != "HEAD")) #== read input file cellData = {} ival = 0 igain = 0 icell = [0, 0, 0, 0, 0, 0, 0] gain = -1 useNames = None useModuleNames = None useGain = None
iovList.append(iov) except: print "Warning: can not read IOVs from input DB file" if run<0: raise Exception("Please, provide run number at command line") else: print "Using IOV starting run run %d" %run since = (run, lumi) until = (0xFFFFFFFF, 0xFFFFFFFF) iov = (since, until) iovList.append(iov) idb.closeDatabase() #=== Open DB connections oschema = 'sqlite://;schema='+outFile+';dbname='+dbName dbr = CaloCondTools.openDbConn(ischema,'READONLY') #dbw = CaloCondTools.openDbConn(oschema,'RECREATE') dbw = CaloCondTools.openDbConn(oschema,'UPDATE') reader = CaloCondTools.CaloBlobReader(dbr,folderPath,inTag) writer = CaloCondTools.CaloBlobWriter(dbw,folderPath,'Flt',True) from TileCalibBlobPython.TileCalibTools import MAXRUN, MAXLBK from math import sqrt #== read input file cellData = {} ival=0 igain=0 icell=[0,0,0,0,0,0,0] gain=-1 useNames=None
else: schema = 'COOLOFL_TILE/OFLP200' folderPath = '/TILE/OFL02/NOISE/CELL' if tag == 'UPD4': tag = 'IOVDEP-02' # change default to tag used in DC14 if run < 222222 or 'COMP200' in schema: cabling = 'RUN1' else: if ('OFLP200' in schema and run >= 310000) or run >= 343000: cabling = 'RUN2a' else: cabling = 'RUN2' hashMgr = TileCellTools.TileCellHashMgr(cabling=cabling) db = CaloCondTools.openDbConn(schema, "READONLY") if folderPath.startswith( '/TILE') or tag == 'UPD1' or tag == 'UPD4' or 'COND' in tag: folderTag = TileCalibTools.getFolderTag(db, folderPath, tag) elif folderPath.startswith('/CALO/Ofl'): folderTag = 'CaloOflNoiseCellnoise-' + tag elif folderPath.startswith('/CALO'): folderTag = 'CaloNoiseCellnoise-' + tag elif folderPath.startswith('/LAR'): folderTag = 'LARNoiseOflCellNoise-' + tag #=== Read from COOL server 2: if schema2 == 'ONL': # shortcut for COOLONL_CALO/COMP200 schema2 = 'COOLONL_CALO/COMP200'