Commit b584f052 authored by Sanya Solodkov's avatar Sanya Solodkov Committed by Graeme Stewart
Browse files

allow arbitrary cool channel number in TileCalib.getDBobjsWithinRange...

allow arbitrary cool channel number in TileCalib.getDBobjsWithinRange (TileCalibBlobPython-00-00-66)

	* allow arbitrary cool channel number in TileCalib.getDBobjsWithinRange
	* dbChanNum = drawer if ros<0 else TileCalibUtils.getDrawerIdx(ros,drawer)
	* Tagging TileCalibBlobPython-00-00-66

2014-12-15  Sanya Solodkov  <solodkov@pcatl03.cern.ch>

	* Changing defaults from COMP200 to CONDBR2 in all python scripts
	* Tagging TileCalibBlobPython-00-00-65

2014-12-09  Sanya Solodkov  <solodkov@pcatl03.cern.ch>

	* ReadOfcFromCool.py updated to be able to read OF1 weights as well
	* Tagging TileCalibBlobPython-00-00-64

2014-12-01  Sanya Solodkov  <solodkov@pcatl03.cern.ch>

	* minor updates in ReadCalibFromCool.py and ReadBchFromCool.py
	* Now UPD1 and UPD4 tags can be resolved also in COMP200 database
	* Tagging TileCalibBlobPython-00-00-63
...
(Long ChangeLog diff - truncated)
parent 76e2cee2
......@@ -41,7 +41,9 @@ class TileBchMgr(TileCalibLogger):
self.__newStat = (self.__getAdcIdx(4,63,47,1) + 1) * [TileBchStatus()]
self.__oldStat = (self.__getAdcIdx(4,63,47,1) + 1) * [TileBchStatus()]
self.__comment = ""
self.__mode = 1
self.__runLumi = (MAXRUN,MAXLBK-1)
self.__multiVersion = True
#____________________________________________________________________
def __getAdcIdx(self, ros, drawer, channel, adc):
......@@ -52,7 +54,7 @@ class TileBchMgr(TileCalibLogger):
return TileCalibUtils.getAdcIdx(ros,drawer,channel,adc)
#____________________________________________________________________
def __updateFromDb(self, db, folderPath, tag, runLumi, fillNewStat=True):
def __updateFromDb(self, db, folderPath, tag, runLumi, fillTable=1):
"""
Updates the internal bad channel cache with the content
found in the database. An open database instance (db) has to
......@@ -72,15 +74,16 @@ class TileBchMgr(TileCalibLogger):
reader = TileCalibTools.TileBlobReader(db,folderPath,tag)
self.log().info("Updating dictionary from \'%s\'" % db.databaseName())
self.log().info("... using tag \'%s\', run-lumi=%s" % (tag,runLumi))
self.__multiVersion = reader.folderIsMultiVersion()
self.__comment = reader.getComment(runLumi)
self.log().info("... comment: %s" % self.__comment)
#=== loop over the whole detector
for ros in xrange(0,TileCalibUtils.max_ros()):
for mod in xrange(TileCalibUtils.getMaxDrawer(ros)):
bch = reader.getDrawer(ros, mod, runLumi)
bch = reader.getDrawer(ros, mod, runLumi, False)
if bch is None:
self.log().warning("Missing IOV in condDB: ros=%i mod=%i runLumi=%s" % (ros,mod,runLumi))
if fillTable>=0: self.log().warning("Missing IOV in condDB: ros=%i mod=%i runLumi=%s" % (ros,mod,runLumi))
continue
bchDecoder = TileBchDecoder(bch.getBitPatternVersion())
for chn in xrange(TileCalibUtils.max_chan()):
......@@ -91,21 +94,29 @@ class TileBchMgr(TileCalibLogger):
chnBits = bch.getData(chn, 2,0)
#=== build status from both adc and channel bits
status = TileBchStatus( bchDecoder.decode(chnBits,adcBits) )
if fillNewStat:
if fillTable==0:
self.__oldStat[self.__getAdcIdx(ros,mod,chn,adc)] = status
elif fillTable==1 or fillTable==-1:
self.__newStat[self.__getAdcIdx(ros,mod,chn,adc)] = status
else:
elif fillTable==2 or fillTable==-2:
self.__oldStat[self.__getAdcIdx(ros,mod,chn,adc)] = status
self.__newStat[self.__getAdcIdx(ros,mod,chn,adc)] = status
else:
self.__newStat[self.__getAdcIdx(ros,mod,chn,adc)] = status
status1 = TileBchStatus( bchDecoder.decode(chnBits,adcBits) )
self.__oldStat[self.__getAdcIdx(ros,mod,chn,adc)] = status1
#____________________________________________________________________
def getComment(self):
return self.__comment
#____________________________________________________________________
def updateFromDb(self, db, folderPath, tag, runLumi):
self.__updateFromDb(db, folderPath, tag, runLumi)
def updateFromDb(self, db, folderPath, tag, runLumi, fillTable=1, mode=None):
if mode: self.__mode = mode
self.__updateFromDb(db, folderPath, tag, runLumi, fillTable)
#____________________________________________________________________
def initialize(self, db, folderPath, tag="", runLumi=(MAXRUN,MAXLBK-1)):
def initialize(self, db, folderPath, tag="", runLumi=(MAXRUN,MAXLBK-1), mode=None):
"""
Initializes the internal bad channel cache. Any changes applied to the
cache previous to calling this function are lost. Typically this function
......@@ -113,10 +124,20 @@ class TileBchMgr(TileCalibLogger):
current bad channels.
"""
self.log().info("Initializing from database, resetting all changes!")
self.updateFromDb(db,folderPath,tag,runLumi)
#=== initialize reference to current status
for idx in xrange(len(self.__newStat)):
self.__oldStat[idx] = self.__newStat[idx]
self.__runLumi = runLumi
if mode: self.__mode = mode
if self.__mode<0: # silent mode
self.__mode = -self.__mode
if self.__mode==2:
self.updateFromDb(db,folderPath,tag,runLumi,-3)
else:
self.updateFromDb(db,folderPath,tag,runLumi,-2)
else:
if self.__mode==2:
self.updateFromDb(db,folderPath,tag,runLumi,3)
else:
self.updateFromDb(db,folderPath,tag,runLumi,2)
#=== update TileBchStatus::isBad() definition from DB
self.log().info("Updating TileBchStatus::isBad() definition from DB")
......@@ -153,7 +174,6 @@ class TileBchMgr(TileCalibLogger):
prbDescDict[prb] = TileBchPrbs.getDescription(prb)
return prbDescDict
#____________________________________________________________________
def setAdcProblems(self, ros, drawer, channel, adc, problems):
"""
......@@ -182,6 +202,85 @@ class TileBchMgr(TileCalibLogger):
status -= problem
self.setAdcStatus(ros,drawer,channel,adc,status)
#____________________________________________________________________
def decodeModule(self, module):
"""
convert module name to ros,drawer
"""
try:
part_dict = {'LBA':1,'LBC':2,'EBA':3,'EBC':4}
partname = str(module[0:3])
ros = part_dict[partname]
drawer = int(module[3:])-1
except Exception, e:
drawer = -1
if drawer<0 or drawer>63:
self.log().critical( "Invalid module name %s" % module )
raise SystemExit
return (ros,drawer)
#____________________________________________________________________
def getADCStatus(self, module, channel, adc):
"""
Get TileBchStatus for a given ADC.
"""
(ros,drawer) = self.decodeModule(module)
return self.__newStat[self.__getAdcIdx(ros,drawer,channel,adc)]
#____________________________________________________________________
def setADCStatus(self, module, channel, adc, status):
"""
Set TileBchStatus for a given ADC.
"""
(ros,drawer) = self.decodeModule(module)
self.__newStat[self.__getAdcIdx(ros,drawer,channel,adc)] = status
#____________________________________________________________________
def getADCProblems(self, module, channel, adc):
"""
Returns a dictionary with { problemEnum : 'Description'}
"""
(ros,drawer) = self.decodeModule(module)
prbDescDict = {}
status = self.getAdcStatus(ros,drawer,channel,adc)
if not status.isGood():
prbs = status.getPrbs()
for prb in prbs:
prbDescDict[prb] = TileBchPrbs.getDescription(prb)
return prbDescDict
#____________________________________________________________________
def setADCProblems(self, module, channel, adc, problems):
"""
Expects a list of TileBchPrbs::PrbS as input
"""
(ros,drawer) = self.decodeModule(module)
status = TileBchStatus()
for prb in problems:
status += prb
self.setAdcStatus(ros,drawer,channel,adc,status)
#____________________________________________________________________
def addADCProblem(self, module, channel, adc, problem):
"""
Sets a specific problem
"""
(ros,drawer) = self.decodeModule(module)
status = self.getAdcStatus(ros,drawer,channel,adc)
status += problem
self.setAdcStatus(ros,drawer,channel,adc,status)
#____________________________________________________________________
def delADCProblem(self, module, channel, adc, problem):
"""
Removes a specific problem
"""
(ros,drawer) = self.decodeModule(module)
status = self.getAdcStatus(ros,drawer,channel,adc)
status -= problem
self.setAdcStatus(ros,drawer,channel,adc,status)
#____________________________________________________________________
def listBadAdcs(self, rosBeg=0, modBeg=0, rosEnd=5, modEnd=64):
"""
......@@ -283,6 +382,7 @@ class TileBchMgr(TileCalibLogger):
except Exception, e:
raise( e )
multiVersion = self.__multiVersion
#=== get latest state from db
if since != (MINRUN,MINLBK):
justBefore = list(since)
......@@ -292,11 +392,17 @@ class TileBchMgr(TileCalibLogger):
justBefore[0] = justBefore[0]-1
justBefore[1] = MAXLBK
justBefore = tuple(justBefore)
self.log().info("Reading db state just before %s, i.e. at %s" % (since,justBefore))
self.log().info("Reading db state at %s, i.e. at %s" % (since,justBefore))
self.__updateFromDb(db, folderPath, tag, justBefore, False)
if self.__mode!=2:
self.log().info("Reading db state just before %s, i.e. at %s" % (since,justBefore))
self.__updateFromDb(db, folderPath, tag, justBefore, 0)
else:
self.log().info("Using previous bad channel list from input DB")
self.log().info("And comparing it with new list of bad channels")
else:
self.log().info("Filling db from %s, resetting old status cache" % since)
if self.__mode!=2:
reader = TileCalibTools.TileBlobReader(db,folderPath,tag)
multiVersion = reader.folderIsMultiVersion()
self.log().info("Filling db from %s, resetting old status cache" % list(since))
self.__oldStat = len(self.__oldStat) * [TileBchStatus()]
#=== print status information
......@@ -320,25 +426,31 @@ class TileBchMgr(TileCalibLogger):
defVec.push_back(comChnDefVec)
#=== loop over the whole detector
reader = TileCalibTools.TileBlobReader(db,folderPath,tag)
writer = TileCalibTools.TileBlobWriter(db,folderPath,'Bch',reader.folderIsMultiVersion())
writer.setComment(author, comment)
writer = TileCalibTools.TileBlobWriter(db,folderPath,'Bch',multiVersion)
if len(comment): writer.setComment(author, comment)
bchDecoder = TileBchDecoder(bitPatVer)
nUpdates = 0
goodComment = True
for ros in xrange(0,TileCalibUtils.max_ros()):
for mod in xrange(TileCalibUtils.getMaxDrawer(ros)):
modName = TileCalibUtils.getDrawerString(ros,mod)
nChange = self.checkModuleForChanges(ros,mod)
if nChange == 0:
#=== do nothing if nothing changed
continue
if nChange==-1:
nUpdates += 1
self.log().debug("Drawer (ros,mod) = (%i,%2i) reset to GOOD"%(ros,mod))
self.log().info("Drawer %s reset to GOOD"%(modName))
if modName not in comment:
goodComment = False
self.log().error("Comment string - '%s' - doesn't contain drawer %s" %(comment,modName))
writer.zeroBlob(ros,mod)
else:
nUpdates += 1
self.log().debug("Applying %2i changes to drawer (ros,mod) = (%i,%2i)"
%(nChange,ros,mod))
self.log().info("Applying %2i changes to drawer %s" %(nChange,modName))
if modName not in comment:
goodComment = False
self.log().error("Comment string - '%s' - doesn't contain drawer %s" %(comment,modName))
drawer = writer.getDrawer(ros,mod)
drawer.init(defVec,TileCalibUtils.max_chan(),bitPatVer)
for chn in xrange(TileCalibUtils.max_chan()):
......@@ -357,7 +469,10 @@ class TileBchMgr(TileCalibLogger):
#=== register
if nUpdates>0:
self.log().info("Attempting to register %i modified drawers..." % nUpdates)
writer.register(since,until,tag)
if goodComment:
self.log().info("Attempting to register %i modified drawers..." % nUpdates)
writer.register(since,until,tag)
else:
self.log().error("Aborting update due to errors in comment string")
else:
self.log().warning("No drawer modifications detected, ignoring commit request")
......@@ -78,7 +78,7 @@ class TileCalibDefaultWriter(TileCalibLogger):
# self.__tilePrefixOfl+"CALIB/CIS/FMA/",
# self.__tilePrefixOfl+"CALIB/CIS/FLT/"]
folders = [self.__tilePrefixOfl2+"CALIB/CIS/FIT/"]
folders = [self.__tilePrefixOfl2+"CALIB/CIS/"]
#=== fill LIN (linear) folders first
loGainDefVec = PyCintex.gbl.std.vector('float')()
......
......@@ -13,8 +13,9 @@ Python helper module for managing COOL DB connections and TileCalibBlobs.
import ROOT
ROOT.gInterpreter.EnableAutoLoading()
import cx_Oracle
from PyCool import cool
import time, types, re, sys
import time, types, re, sys, os
import PyCintex
PyCintex.makeClass('std::vector<float>')
......@@ -53,6 +54,23 @@ UNIXTMAX = cool.Int32Max
# empty Tile channel for storing laser partition variation. DO NOT CHANGE.
LASPARTCHAN = 43
#
#______________________________________________________________________
def getLastRunNumber(partition=""):
"""
Return the run number of last run taken in the pit
if partition name is not empty, max run number taken with given TDAQ partition is returned
"""
connection=cx_Oracle.connect(dsn="ATLR",user="atlas_run_number_r",password="-Run.Num@rEaDeR-x-12")
con=connection.cursor()
sql="SELECT MAX(RUNNUMBER) FROM ATLAS_RUN_NUMBER.RUNNUMBER"
if len(partition):
sql += (" WHERE PARTITIONNAME='%s'" % partition)
con.execute(sql)
data=con.fetchall()
connection.close()
return data[0][0]
#
#______________________________________________________________________
def getTilePrefix(ofl=True,splitOnlInOflSchema=False):
......@@ -131,6 +149,11 @@ def openDb(db, instance, mode="READONLY",schema="COOLONL_TILE",sqlfn="tileSqlite
#=== construct connection string
connStr = ""
if db=='SQLITE':
if mode=="READONLY" and not os.path.exists(sqlfn):
raise Exception( "Sqlite file %s does not exist" % (sqlfn) )
if (mode=="RECREATE" or mode=="UPDATE") and not os.path.exists(os.path.dirname(sqlfn)):
dirn=os.path.dirname(sqlfn)
if dirn: os.makedirs(dirn)
connStr="sqlite://X;schema=%s;dbname=%s" % (sqlfn,instance)
elif db=='ORACLE':
connStr='oracle://%s;schema=ATLAS_%s;dbname=%s' % ('ATLAS_COOLPROD',schema,instance)
......@@ -258,16 +281,62 @@ def getCoolValidityKey(pointInTime, isSince=True):
#____________________________________________________________________
def getFolderTag(db, folderPath, globalTag):
folder = db.getFolder(folderPath)
if globalTag=='CURRENT':
globalTag=resolveAlias.getCurrent()
log.info("Resolved CURRENT globalTag to \'%s\'" % globalTag)
elif globalTag=='NEXT':
globalTag=resolveAlias.getNext()
log.info("Resolved NEXT globalTag to \'%s\'" % globalTag)
globalTag=globalTag.replace('*','')
tag = folder.resolveTag(globalTag)
log.info("Resolved globalTag \'%s\' to folderTag \'%s\'" % (globalTag,tag))
tag=""
if globalTag.startswith("/") or globalTag.startswith("TileO"):
tag = globalTag
log.warning("Using tag as-is for folder %s" % folderPath)
elif '/TILE/ONL01' in folderPath:
log.info("Using empty tag for single-version folder %s" % folderPath)
elif globalTag.startswith(" "):
log.warning("Using empty tag for folder %s" % folderPath)
elif globalTag=="":
tag = TileCalibUtils.getFullTag(folderPath, globalTag)
log.warning("Using tag with empty suffix for folder %s" % folderPath)
else:
schema='COOLOFL_TILE/CONDBR2'
if isinstance(db, (str, unicode)):
if 'OFLP200' in db or 'MC' in db:
schema='COOLOFL_TILE/OFLP200'
globalTag='OFLCOND-RUN12-SDR-21'
log.info("Using Simulation global tag \'%s\'" % globalTag)
elif 'COMP200' in db or 'RUN1' in db:
schema='COOLOFL_TILE/COMP200'
globalTag='COMCOND-BLKPA-RUN1-06'
log.info("Using RUN1 global tag \'%s\'" % globalTag)
if schema == 'COOLOFL_TILE/CONDBR2':
if globalTag=='CURRENT' or globalTag=='UPD4' or globalTag=='':
globalTag=resolveAlias.getCurrent()
log.info("Resolved CURRENT globalTag to \'%s\'" % globalTag)
elif globalTag=='CURRENTES' or globalTag=='UPD1':
globalTag=resolveAlias.getCurrentES()
log.info("Resolved CURRENT ES globalTag to \'%s\'" % globalTag)
elif globalTag=='NEXT':
globalTag=resolveAlias.getNext()
log.info("Resolved NEXT globalTag to \'%s\'" % globalTag)
elif globalTag=='NEXTES':
globalTag=resolveAlias.getNextES()
log.info("Resolved NEXT ES globalTag to \'%s\'" % globalTag)
globalTag=globalTag.replace('*','')
if 'UPD1' in globalTag or 'UPD4' in globalTag or 'COND' not in globalTag:
tag = TileCalibUtils.getFullTag(folderPath, globalTag)
log.info("Resolved localTag \'%s\' to folderTag \'%s\'" % (globalTag,tag))
else:
if not isinstance(db, (str, unicode)):
try:
folder = db.getFolder(folderPath)
tag = folder.resolveTag(globalTag)
log.info("Resolved globalTag \'%s\' to folderTag \'%s\'" % (globalTag,tag))
schema=""
except Exception, e:
log.warning(e)
log.warning("Using %s to resolve globalTag",schema)
if len(schema):
dbr = openDbConn(schema,'READONLY')
folder = dbr.getFolder(folderPath)
tag = folder.resolveTag(globalTag)
dbr.closeDatabase()
log.info("Resolved globalTag \'%s\' to folderTag \'%s\'" % (globalTag,tag))
return tag
#
......@@ -617,7 +686,7 @@ class TileBlobReader(TileCalibLogger):
return "<no comment found>"
#____________________________________________________________________
def getDrawer(self, ros, drawer, pointInTime):
def getDrawer(self, ros, drawer, pointInTime, printError=True, useDefault=True):
"""
Returns a TileCalibDrawer object for the given ROS and drawer.
"""
......@@ -637,6 +706,8 @@ class TileBlobReader(TileCalibLogger):
blob = obj.payload()[0]
self.log().debug("blob size: %d" % blob.size())
#=== default policy
if not useDefault and blob.size()==0:
return 0
while blob.size()==0:
#=== no default at all?
if ros==0 and drawer==0:
......@@ -673,11 +744,11 @@ class TileBlobReader(TileCalibLogger):
raise Exception( "Invalid blob type requested: %s" % typeName )
return calibDrawer
except Exception, e:
self.log().error("TileCalibTools.getDrawer(): Fetching of ros=%i, drawer=%i failed with exception %s"%(ros,drawer,e))
if printError: self.log().error("TileCalibTools.getDrawer(): Fetching of ros=%i, drawer=%i failed with exception %s"%(ros,drawer,e))
return None
#____________________________________________________________________
def getDefaultDrawer(self, ros, drawer, pointInTime):
def getDefaultDrawer(self, ros, drawer, pointInTime, printError=True):
"""
Returns a TileCalibDrawer object for the given ROS and drawer.
"""
......@@ -733,11 +804,11 @@ class TileBlobReader(TileCalibLogger):
raise Exception( "Invalid blob type requested: %s" % typeName )
return calibDrawer
except Exception, e:
self.log().error("TileCalibTools.getDefaultDrawer(): Fetching of ros=%i, drawer=%i failed with exception %s"%(ros,drawer,e))
if printError: self.log().error("TileCalibTools.getDefaultDrawer(): Fetching of ros=%i, drawer=%i failed with exception %s"%(ros,drawer,e))
return None
#____________________________________________________________________
def getDBobjsWithinRange(self, ros, drawer, point1inTime=(0,0), point2inTime=(2147483647,4294967295)):
def getDBobjsWithinRange(self, ros, drawer, point1inTime=(0,0), point2inTime=(2147483647,4294967295), printError=True):
"""
Returns all DB objects for the given ROS and drawer, within given validity range -- default: [0-Infty)
Check getBlobsWithinRange for an example on how to loop over objects and check validity ranges.
......@@ -751,12 +822,12 @@ class TileBlobReader(TileCalibLogger):
objs = None
try:
dbChanNum = TileCalibUtils.getDrawerIdx(ros,drawer)
dbChanNum = drawer if ros<0 else TileCalibUtils.getDrawerIdx(ros,drawer)
dbChanSel = cool.ChannelSelection(dbChanNum)
#self.log().debug("Fetching blobs from DB: %s" % obj)
objs = self.__folder.browseObjects(validityKey1,validityKey2,dbChanSel,self.__tag)
except Exception, e:
self.log().error("TileCalibTools.getDBobjsWithinRange(): Fetching of ros=%i, drawer=%i failed with exception %s"%(ros,drawer,e))
if printError: self.log().error("TileCalibTools.getDBobjsWithinRange(): Fetching of ros=%i, drawer=%i failed with exception %s"%(ros,drawer,e))
return objs
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
import bisect
class TileCellHashMgr():
"""
This class ised to convert cell hash to cell name
"""
#____________________________________________________________________
def __init__(self):
#=== initialize all arrays
self.__cellNames=[
["A-1","B-1","A-2","B-2","A-3","B-3","D-1","A-4","B-4","A-5","B-5","D-2","A-6","B-6","A-7","B-7","D-3","A-8","B-8","A-9","B-9","A-10"],
["A+1","B+1","D*0","A+2","B+2","A+3","B+3","D+1","A+4","B+4","A+5","B+5","D+2","A+6","B+6","A+7","B+7","D+3","A+8","B+8","A+9","B+9","A+10"],
["B-11","D-5","A-12","B-12","A-13","B-13","D-6","A-14","B-14","A-15","B-15","A-16"],
["B+11","D+5","A+12","B+12","A+13","B+13","D+6","A+14","B+14","A+15","B+15","A+16"],
["D-4","C-10","E-1","E-2","E-3","E-4","spD-4","spC-10","spD-40"],
["D+4","C+10","E+1","E+2","E+3","E+4","spD+4","spC+10","spD+40"]
]
self.__partNames=["LBC","LBA","EBC","EBA","EBC","EBA"]
self.__nCellsModule = [22,23,12,12,6,6]
self.__nModules = 64
self.__nCellsPart = [0]
self.__nHashMax=0
for p in xrange(6):
self.__nHashMax+=self.__nCellsModule[p]*self.__nModules
self.__nCellsPart.append(self.__nHashMax)
#____________________________________________________________________
def getNames(self, hash):
"""
return module name and cell name for given hash
"""
if hash>=self.__nHashMax or hash<0:
return (None,None)
part=bisect.bisect(self.__nCellsPart,hash)-1
module=(hash-self.__nCellsPart[part])/self.__nCellsModule[part]+1
modName="%s%02d" % (self.__partNames[part],module)
index=(hash-self.__nCellsPart[part])%self.__nCellsModule[part]
if part>=4:
if index==0 and ((part==4 and module==18) or (part==5 and module==15)): index+=8
if index==0 and (module>=15 and module<=18): index+=6
if index==1 and ((module>=39 and module<=42) or (module>=55 and module<=58)): index+=6
return (modName,self.__cellNames[part][index])
#____________________________________________________________________
def cellName(self, hash):
"""
return cell name for given hash
"""
if hash>=self.__nHashMax or hash<0:
return None
part=bisect.bisect(self.__nCellsPart,hash)-1
module=(hash-self.__nCellsPart[part])/self.__nCellsModule[part]+1
index=(hash-self.__nCellsPart[part])%self.__nCellsModule[part]
if part>=4:
if index==0 and ((part==4 and module==18) or (part==5 and module==15)): index+=8
if index==0 and (module>=15 and module<=18): index+=6
if index==1 and ((module>=39 and module<=42) or (module>=55 and module<=58)): index+=6
return self.__cellNames[part][index]
#____________________________________________________________________
def moduleName(self, hash):
"""
return module name for given hash
"""
if hash>=self.__nHashMax or hash<0:
return None
part=bisect.bisect(self.__nCellsPart,hash)-1
module=(hash-self.__nCellsPart[part])/self.__nCellsModule[part]+1
modName="%s%02d" % (self.__partNames[part],module)
return modName
......@@ -20,7 +20,7 @@ def usage():
print "-f, --folder= specify status folder to use ONL01, OFL01 or OFL02 "
print "-t, --tag= specify tag to use, f.i. UPD1 or UPD4"
print "-o, --outtag= specify output tag to be used for cleaned up result, f.i. UPD4-99"
print "-i, --instance= specify DB instance (COMP200 or OFLP200)"
print "-i, --instance= specify DB instance (CONDBR2 or COMP200 or OFLP200)"
print ""
def showAdcProblems(mgr,ros,mod):
......@@ -82,7 +82,7 @@ def writeMergedIOV(ros,mod,since,until):
runUntil += 1
lumUntil = 0
msg = 'AtlCoolCopy.exe \"%s\" \"%s\" -folder /TILE/OFL02/STATUS/ADC -tag TileOfl02StatusAdc-UPD4-08 -rls %i %i -rlu %i %i -alliov -outtag %s -ch1 %i -ch2 %i -nrls %i %i -nrlu %i %i\n' % (ischema,oschema,runSince,lumSince,runSince,lumSince+1,outtagFull,chanNum,chanNum,runSince,lumSince,runUntil,lumUntil)
msg = 'AtlCoolCopy.exe \"%s\" \"%s\" -folder /TILE/OFL02/STATUS/ADC -tag TileOfl02StatusAdc-RUN2-UPD4-08 -rls %i %i -rlu %i %i -alliov -outtag %s -ch1 %i -ch2 %i -nrls %i %i -nrlu %i %i\n' % (ischema,oschema,runSince,lumSince,runSince,lumSince+1,outtagFull,chanNum,chanNum,runSince,lumSince,runUntil,lumUntil)
log.info(msg)
......@@ -138,16 +138,6 @@ if __name__ == "__main__":