#Set up IOVDbService from IOVDbSvc.CondDB import conddb #Pick a database tag. #conddb.setGlobalTag('COMCOND-REPC-001-00') conddb.setGlobalTag('COMCOND-BLKPS-004-05') if (forceRunNumber > 0): Service("IOVDbSvc").forceRunNumber = forceRunNumber Service("IOVDbSvc").forceLumiblockNumber = 1 #Prepare db access strings in CscCoolStrSvc_read_jobOptions.py from MuonCondSvc.CscCondDB import cscCondDB #add pedestal folders cscCondDB.addGainFolder() cscCondDB.addPedFolders() cscCondDB.addF001Folder() cscCondDB.addRmsFolder() cscCondDB.addStatusFolder('CscStat-REF-001-00') #cscCondDB.addStatusFolder() cscCondDB.addPSlopeFolder() #------------------------------------------------------------ # Set output level threshold (1=VERBOSE, 2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL ) #-------------------------------------------------------------- #MessageSvc = Service( "MessageSvc" ) #StoreGateSvc = Service( "StoreGateSvc" ) #StoreGateSvc.OutputLevel = 3 ##EventSelector = Service ( "EventSelector" ) #EventSelector.RunNumber = 9 #EventSelector.EventsPerRun = 2 #EventSelector.FirstEvent = 1
cscCondDB.useLocalFile() from MuonCondSvc.CscCoolFolders import dict as coolFolders #Set pedestals #Note if override strings are "", no overide will occur if ("ped" in readPars): cscCondDB.addPedFolder(pedOverride) if ("noise" in readPars): cscCondDB.addNoiseFolder(noiseOverride) if ("rms" in readPars): cscCondDB.addRmsFolder(rmsOverride) if ("f001" in readPars): cscCondDB.addF001Folder(f001Override) if ("status" in readPars): cscCondDB.addStatusFolder(statOverride) if ("pslope" in readPars): cscCondDB.addPSlopeFolder(pslopeOverride) if ("t0phase" in readPars): cscCondDB.addT0PhaseFolder(t0phaseOverride) if ("t0base" in readPars): cscCondDB.addT0BaseFolder(t0baseOverride) #-------------------------------------------------------------- # Set output level threshold (1=VERBOSE, 2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL ) #-------------------------------------------------------------- #import AthenaPoolCnvSvc.ReadAthenaPool #ServiceMgr.MessageSvc.OutputLevel = VERBOSE #IOVDbSvc = Service( "IOVDbSvc" ) #IOVDbSvc.OutputLevel = 2 #ServiceMgr.EventSelector.RunNumber = 0
if (writeNewFolder): print "Setting up for new folder" cscCondDB.SetupForNewFolder() #Adding Folders if ('ped' in parsToWrite): cscCondDB.addPedFolders() if ('rms' in parsToWrite): cscCondDB.addRmsFolder() if ('f001' in parsToWrite): cscCondDB.addF001Folder() if ('pslope' in parsToWrite): cscCondDB.addPSlopeFolder() if ('status' in parsToWrite): cscCondDB.addStatusFolder() if ('t0base' in parsToWrite): cscCondDB.addT0BaseFolder() if ('t0phase' in parsToWrite): cscCondDB.addT0PhaseFolder() if (overrideCscTag != ""): conddb.addOverride("/CSC", overrideCscTag) #You can override tags for readign like this: #conddb.addOverride("/CSC/STAT","CscStat-comm-002-00") #ServiceMgr.MessageSvc.OutputLevel = DEBUG ServiceMgr.MessageSvc.debugLimit = 0 #ServiceMgr.CscCoolStrSvc.OutputLevel = VERBOSE
def setupCscCondDB(): # Access to the CSC calibration database # Copied and modified from: # include( "CscCalibTools/CscCalibTool_jobOptions.py" ) from MuonCondSvc.CscCondDB import cscCondDB ## Load Ped File if cscCalibFlags.CscPedFromLocalFile(): cscCondDB.useLocalFile( True) #All following "add" db folder commands are from local files cscCondDB.addPedFolder() #<--- Adds pedestal and noise folders cscCondDB.useLocalFile( False) #To make sure to stop refering to local sqlite DB file else: cscCondDB.addPedFolder() #<--- Adds pedestal and noise folders ## Load Noise File if cscCalibFlags.CscNoiseFromLocalFile(): cscCondDB.useLocalFile( True) #All following "add" db folder commands are from local files cscCondDB.addNoiseFolder() #<--- Adds pedestal and noise folders cscCondDB.useLocalFile( False) #To make sure to stop refering to local sqlite DB file else: cscCondDB.addNoiseFolder() #<--- Adds pedestal and noise folders ## Load PSlope File if cscCalibFlags.CscPSlopeFromLocalFile(): cscCondDB.useLocalFile( True) #All following "add" db folder commands are from local files cscCondDB.addPSlopeFolder() #<--- Adds pedestal and noise folders cscCondDB.useLocalFile( False) #To make sure to stop refering to local sqlite DB file else: cscCondDB.addPSlopeFolder() #<--- Adds pedestal and noise folders ## Load Status File if cscCalibFlags.CscStatusFromLocalFile(): cscCondDB.useLocalFile( True) #All following "add" db folder commands are from local files cscCondDB.addStatusFolder() #<--- Adds pedestal and noise folders cscCondDB.useLocalFile( False) #To make sure to stop refering to local sqlite DB file else: cscCondDB.addStatusFolder() #<--- Adds pedestal and noise folders ## Load Rms File if cscCalibFlags.CscRmsFromLocalFile(): cscCondDB.useLocalFile( True) #All following "add" db folder commands are from local files cscCondDB.addRmsFolder() #<--- Adds pedestal and noise folders cscCondDB.useLocalFile( False) #To make sure to stop refering to local sqlite DB file else: cscCondDB.addRmsFolder() #<--- Adds pedestal and noise folders ## Load F001 File if cscCalibFlags.CscF001FromLocalFile(): cscCondDB.useLocalFile( True) #All following "add" db folder commands are from local files cscCondDB.addF001Folder() cscCondDB.useLocalFile( False) #To make sure to stop refering to local sqlite DB file else: cscCondDB.addF001Folder() if not athenaCommonFlags.isOnline(): log = logging.getLogger(__name__ + ".setupCscCondDB()") log.info( "This is for OffLine so T0Base and T0Phase folders are added!!") ## Load T0Base File if cscCalibFlags.CscT0BaseFromLocalFile(): cscCondDB.useLocalFile( True ) #All following "add" db folder commands are from local files cscCondDB.addT0BaseFolder() cscCondDB.useLocalFile( False) #To make sure to stop refering to local sqlite DB file else: cscCondDB.addT0BaseFolder() ## Load T0Phase File if cscCalibFlags.CscT0PhaseFromLocalFile(): cscCondDB.useLocalFile( True ) #All following "add" db folder commands are from local files cscCondDB.addT0PhaseFolder() cscCondDB.useLocalFile( False) #To make sure to stop refering to local sqlite DB file else: cscCondDB.addT0PhaseFolder()