![]() |
ATLAS Offline Software
|
Classes | |
class | BeamSpotOption |
Functions | |
def | check_commsep (option, opt, value) |
def | getT0DbConnection () |
def | getTaskManager () |
def | fail (message) |
def | dataset_from_run_and_tag (run, tag) |
def | run_jobs (script, ds_name, task_name, params, *args) |
Variables | |
list | __authors__ = ['Juerg Beringer', 'Carl Suster'] |
string | __version__ = 'beamspotman.py atlas/athena' |
string | __usage__ |
string | proddir = '/afs/cern.ch/user/a/atlidbs/jobs' |
string | produserfile = '/afs/cern.ch/user/a/atlidbs/private/produsers.dat' |
string | prodcoolpasswdfile = '/afs/cern.ch/user/a/atlidbs/private/coolinfo.dat' |
string | flaskcoolpasswdfile = '/afs/cern.ch/user/a/atlidbs/private/flaskinfo.dat' |
string | proddqcoolpasswdfile = '/afs/cern.ch/user/a/atlidbs/private/cooldqinfo.dat' |
string | tier0dbinfofile = '/afs/cern.ch/user/a/atlidbs/private/t0dbinfo.dat' |
string | beamspottag = '' |
string | backuppath = '/eos/atlas/atlascerngroupdisk/phys-beamspot/jobs/backup' |
string | archivepath = '/eos/atlas/atlascerngroupdisk/phys-beamspot/jobs/archive' |
parser = OptionParser(usage=__usage__, version=__version__, option_class=BeamSpotOption) | |
g_input = OptionGroup(parser, 'Input file options') | |
dest | |
default | |
False | |
action | |
help | |
None | |
g_mode = OptionGroup(parser, 'Mode flags') | |
type | |
g_deprecated = OptionGroup(parser, 'Deprecated Options') | |
options | |
args | |
cmd = args[0] | |
cmdargs = args[1:] | |
dbfile = args[1] | |
passwd = passwdfile.read().strip() | |
flaskpasswd = flaskpasswdfile.read().strip() | |
stat | |
run = args[1] | |
tag = args[2] | |
dataset | |
dsname = cmdargs[0] | |
bool | lbinfoinfiles = True |
string | lboptions = '--lbperjob=10' if lbinfoinfiles else '--files-per-job=10' |
string | queue = options.batch_queue or '"tomorrow"' |
dictionary | params |
p = s.split('=',1) | |
tmplist = glob.glob(args[1]+'/') | |
list | dirlist = [] |
d = dslash[:-1] | |
string | baklog = d+'/backup.log' |
status = status >> 8 | |
output | |
a = input('\nARE YOU SURE [n] ? ') | |
string | tmpdir = '/tmp' |
outname = d.replace('/','-')+time.strftime('-%G_%m_%d.tar.gz') | |
string | path = archivepath |
fs | |
qual = ["where DSNAME like '%s' and TASKNAME like '%s'" % (dssel,tasksel)] | |
taskname = cmdargs[1] | |
int | steps = options.postprocsteps if len(cmdargs) < 3 else cmdargs[2].split(',') |
taskList | |
t = taskman.getTaskDict(taskName[0], taskName[1]) | |
taskman | |
BeamSpotPostProcessing | |
forceRun | |
requireSingleTask | |
True | |
confirmWithUser | |
batch | |
addWildCards | |
string | ignoremode = '--passopt="--appendlocked --ignoremode %s"' % options.ignoremode |
string | batchmode = '--batch' |
string | uploadflag = dbfile[0]+'.uploaded' |
string | cooltags = options.beamspottag |
string | nextbeamspot = '' |
string | dir = os.path.join(dsname, task) |
string | griddsname = '%s.%s-%s' % (options.griduser,dsname,task) |
statfile = glob.glob('%s/000/*.status.SUBMITTED' % (dir)) | |
basename = statfile[0][:-17] | |
tags = task.split('.')[-1] | |
string | t0TaskName = '%s.recon.ESD.%s.beamspotproc.task' % (dsname,tags) |
def | oracle = getT0DbConnection() |
def | cur = oracle.cursor() |
sql = str("SELECT status FROM tasks WHERE taskname='%s' AND tasktype='beamspotproc'" % t0TaskName) | |
def | r = cur.fetchall() |
dssel = args[1] | |
tasksel = args[2] | |
runnr = t['RUNNR'] | |
n = taskman.getNTasks(["where DSNAME ='%s' and TASKNAME like '%s'" % (dsname,options.excludeiftask)]) | |
excludeList = options.excludeds.split(',') | |
out | |
fullcmd = cmd % t | |
earliestUpdateTime = time.time()-float(args[1]) | |
onDiskCode = TaskManager.OnDiskCodes['ALLONDISK'] | |
taskName = t['TASKNAME'] | |
datatag = taskName.split('.')[-1].split('_')[0] | |
string | monTaskName = 'MON.%s.%s' % (taskName,datatag) |
bool | useRun = True |
m = next(taskman.taskIterDict('*',["where RUNNR =",DbParam(runnr),"and DSNAME =",DbParam(dsname),"and TASKNAME =",DbParam(monTaskName),"order by UPDATED desc"])) | |
ptag = dsname.split('.')[0] | |
stream = dsname.split('.')[2] | |
fulldatatag = taskName.split('.')[-1] | |
string | bstag = cooltags.split()[0] |
string | filter = 'AOD' |
string | t0dsname = '%s.merge.AOD.%s%%' % (dsname, datatag) |
c = getJobConfig('.',dsname,taskName) | |
bool | submitjob = True |
eospath = options.eospath | |
string | origt0TaskName = '%s.recon.AOD.%s%%.aodmerge.task' % (dsname,datatag) |
string | paramValues = '' |
string | testFlag = '' |
archivedCode = TaskManager.OnDiskCodes.get('RESULTSONDISK',None) if options.resultsondisk else TaskManager.OnDiskCodes.get('ARCHIVED',None) | |
list | exceptList = ['*dqflags.txt', '*.gif', '*.pdf', '*.config.py*', '*.argdict.gpickle', '*.AveBeamSpot.log', '*.PlotBeamSpotCompareReproc.log', '*.sh', '*.BeamSpotNt*', '*.BeamSpotGlobalNt.log', '*.status.*', '*.exit.*'] |
string | oscmd = r"find %s ! \( -name '%s' \) -type f -exec rm {} \;" % (dir, "' -or -name '".join(exceptList)) |
string | basepath = os.path.join(os.getcwd(), dsname, taskname) |
dircontents = os.listdir(basepath) | |
string | condorScriptTemplate |
string | jobname = dir |
string | fullpath = os.path.join(basepath, dir) |
bool | isRunning = False |
bool | isFailed = False |
dictionary | jobConfig |
string | condorScript = condorScriptTemplate % jobConfig |
script = open('condorSubmit.sub','w') | |
string | batchCmd = 'condor_submit condorSubmit.sub' |
jobopts = args[1] | |
inputdata = args[4] | |
lbperjob = options.lbperjob | |
list | files = [] |
dictionary | lbMap = {} |
backend = DiskUtils.EOS() if options.eos else None | |
dictionary | jobFileDict = {} |
dictionary | jobLBDict = {} |
int | jobId = 1 |
lbs = sorted(lbMap[f.split('/')[-1]]) | |
int | jobnr = i*lbperjob+1 |
list | intlbs = [] |
runner | |
comment | |
dictionary | jobParams = {} |
coolQuery = COOLQuery() | |
lbTimes = coolQuery.getLbTimes( getRunFromName(dsname, None, True) ) | |
tokens = line.split() | |
plbnr | |
tstart | |
tend | |
list | rlbs = [lb for (lb,time) in lbTimes.items() if (time[0] - tend/1e9)*(time[1] - tstart/1e9) < 0] |
list | filenames = [] |
string | bcidTaskName = 'BCID.%s.%s' % (taskName,datatag) |
folderHandle = openBeamSpotDbFile(dbfile, dbName = 'OFLP200', forceNew = True) | |
int | runMin = options.runMin if options.runMin is not None else 0 |
int | runMax = options.runMax if options.runMax is not None else (1 << 31)-1 |
posX | |
posY | |
posZ | |
sigmaX | |
sigmaY | |
sigmaZ | |
tiltX | |
tiltY | |
sigmaXY | |
posXErr | |
posYErr | |
posZErr | |
sigmaXErr | |
sigmaYErr | |
sigmaZErr | |
tiltXErr | |
tiltYErr | |
sigmaXYErr | |
dbName = options.destdbname | |
def beamspotman.check_commsep | ( | option, | |
opt, | |||
value | |||
) |
Definition at line 74 of file beamspotman.py.
def beamspotman.dataset_from_run_and_tag | ( | run, | |
tag | |||
) |
Given a run number and tag, check input dataset and work out name.
Definition at line 204 of file beamspotman.py.
def beamspotman.fail | ( | message | ) |
Definition at line 199 of file beamspotman.py.
def beamspotman.getT0DbConnection | ( | ) |
Definition at line 167 of file beamspotman.py.
def beamspotman.getTaskManager | ( | ) |
Open task manager (used by all following commands, at the very least through subcommands)
Definition at line 191 of file beamspotman.py.
def beamspotman.run_jobs | ( | script, | |
ds_name, | |||
task_name, | |||
params, | |||
* | args | ||
) |
|
private |
Definition at line 9 of file beamspotman.py.
|
private |
Definition at line 11 of file beamspotman.py.
|
private |
Definition at line 10 of file beamspotman.py.
beamspotman.a = input('\nARE YOU SURE [n] ? ') |
Definition at line 406 of file beamspotman.py.
beamspotman.action |
Definition at line 84 of file beamspotman.py.
beamspotman.addWildCards |
Definition at line 534 of file beamspotman.py.
beamspotman.archivedCode = TaskManager.OnDiskCodes.get('RESULTSONDISK',None) if options.resultsondisk else TaskManager.OnDiskCodes.get('ARCHIVED',None) |
Definition at line 948 of file beamspotman.py.
string beamspotman.archivepath = '/eos/atlas/atlascerngroupdisk/phys-beamspot/jobs/archive' |
Definition at line 56 of file beamspotman.py.
beamspotman.args |
Definition at line 146 of file beamspotman.py.
Definition at line 1132 of file beamspotman.py.
string beamspotman.backuppath = '/eos/atlas/atlascerngroupdisk/phys-beamspot/jobs/backup' |
Definition at line 55 of file beamspotman.py.
string beamspotman.baklog = d+'/backup.log' |
Definition at line 384 of file beamspotman.py.
beamspotman.basename = statfile[0][:-17] |
Definition at line 638 of file beamspotman.py.
Definition at line 1016 of file beamspotman.py.
beamspotman.batch |
Definition at line 534 of file beamspotman.py.
string beamspotman.batchCmd = 'condor_submit condorSubmit.sub' |
Definition at line 1085 of file beamspotman.py.
string beamspotman.batchmode = '--batch' |
Definition at line 568 of file beamspotman.py.
Definition at line 1539 of file beamspotman.py.
beamspotman.BeamSpotPostProcessing |
Definition at line 522 of file beamspotman.py.
beamspotman.beamspottag = '' |
Definition at line 54 of file beamspotman.py.
string beamspotman.bstag = cooltags.split()[0] |
Definition at line 856 of file beamspotman.py.
Definition at line 864 of file beamspotman.py.
string beamspotman.cmd = args[0] |
Definition at line 148 of file beamspotman.py.
beamspotman.cmdargs = args[1:] |
Definition at line 149 of file beamspotman.py.
beamspotman.comment |
Definition at line 1214 of file beamspotman.py.
string beamspotman.condorScript = condorScriptTemplate % jobConfig |
Definition at line 1078 of file beamspotman.py.
string beamspotman.condorScriptTemplate |
Definition at line 1019 of file beamspotman.py.
beamspotman.confirmWithUser |
Definition at line 534 of file beamspotman.py.
beamspotman.coolQuery = COOLQuery() |
Definition at line 1273 of file beamspotman.py.
beamspotman.cooltags = options.beamspottag |
Definition at line 585 of file beamspotman.py.
def beamspotman.cur = oracle.cursor() |
Definition at line 669 of file beamspotman.py.
beamspotman.d = dslash[:-1] |
Definition at line 382 of file beamspotman.py.
beamspotman.dataset |
Definition at line 284 of file beamspotman.py.
beamspotman.datatag = taskName.split('.')[-1].split('_')[0] |
Definition at line 814 of file beamspotman.py.
string beamspotman.dbfile = args[1] |
Definition at line 240 of file beamspotman.py.
beamspotman.dbName = options.destdbname |
Definition at line 1651 of file beamspotman.py.
beamspotman.default |
Definition at line 84 of file beamspotman.py.
beamspotman.dest |
Definition at line 84 of file beamspotman.py.
string beamspotman.dir = os.path.join(dsname, task) |
Definition at line 621 of file beamspotman.py.
beamspotman.dircontents = os.listdir(basepath) |
Definition at line 1017 of file beamspotman.py.
list beamspotman.dirlist = [] |
Definition at line 380 of file beamspotman.py.
beamspotman.dsname = cmdargs[0] |
Definition at line 284 of file beamspotman.py.
beamspotman.dssel = args[1] |
Definition at line 694 of file beamspotman.py.
int beamspotman.earliestUpdateTime = time.time()-float(args[1]) |
Definition at line 793 of file beamspotman.py.
string beamspotman.eospath = options.eospath |
Definition at line 872 of file beamspotman.py.
list beamspotman.exceptList = ['*dqflags.txt', '*.gif', '*.pdf', '*.config.py*', '*.argdict.gpickle', '*.AveBeamSpot.log', '*.PlotBeamSpotCompareReproc.log', '*.sh', '*.BeamSpotNt*', '*.BeamSpotGlobalNt.log', '*.status.*', '*.exit.*'] |
Definition at line 949 of file beamspotman.py.
beamspotman.excludeList = options.excludeds.split(',') |
Definition at line 737 of file beamspotman.py.
beamspotman.False |
Definition at line 84 of file beamspotman.py.
list beamspotman.filenames = [] |
Definition at line 1296 of file beamspotman.py.
dictionary beamspotman.files = [] |
Definition at line 1112 of file beamspotman.py.
string beamspotman.filter = 'AOD' |
Definition at line 858 of file beamspotman.py.
Definition at line 51 of file beamspotman.py.
beamspotman.flaskpasswd = flaskpasswdfile.read().strip() |
Definition at line 251 of file beamspotman.py.
Definition at line 1614 of file beamspotman.py.
beamspotman.forceRun |
Definition at line 522 of file beamspotman.py.
beamspotman.fs |
Definition at line 468 of file beamspotman.py.
Definition at line 779 of file beamspotman.py.
beamspotman.fulldatatag = taskName.split('.')[-1] |
Definition at line 848 of file beamspotman.py.
Definition at line 1037 of file beamspotman.py.
beamspotman.g_deprecated = OptionGroup(parser, 'Deprecated Options') |
Definition at line 142 of file beamspotman.py.
Definition at line 83 of file beamspotman.py.
beamspotman.g_mode = OptionGroup(parser, 'Mode flags') |
Definition at line 96 of file beamspotman.py.
string beamspotman.griddsname = '%s.%s-%s' % (options.griduser,dsname,task) |
Definition at line 622 of file beamspotman.py.
beamspotman.help |
Definition at line 84 of file beamspotman.py.
string beamspotman.ignoremode = '--passopt="--appendlocked --ignoremode %s"' % options.ignoremode |
Definition at line 564 of file beamspotman.py.
beamspotman.inputdata = args[4] |
Definition at line 1107 of file beamspotman.py.
list beamspotman.intlbs = [] |
Definition at line 1183 of file beamspotman.py.
bool beamspotman.isFailed = False |
Definition at line 1040 of file beamspotman.py.
bool beamspotman.isRunning = False |
Definition at line 1039 of file beamspotman.py.
dictionary beamspotman.jobConfig |
Definition at line 1069 of file beamspotman.py.
dictionary beamspotman.jobFileDict = {} |
Definition at line 1141 of file beamspotman.py.
beamspotman.jobId = 1 |
Definition at line 1146 of file beamspotman.py.
dictionary beamspotman.jobLBDict = {} |
Definition at line 1142 of file beamspotman.py.
string beamspotman.jobname = dir |
Definition at line 1034 of file beamspotman.py.
int beamspotman.jobnr = i*lbperjob+1 |
Definition at line 1178 of file beamspotman.py.
beamspotman.jobopts = args[1] |
Definition at line 1104 of file beamspotman.py.
dictionary beamspotman.jobParams = {} |
Definition at line 1268 of file beamspotman.py.
bool beamspotman.lbinfoinfiles = True |
Definition at line 327 of file beamspotman.py.
dictionary beamspotman.lbMap = {} |
Definition at line 1131 of file beamspotman.py.
string beamspotman.lboptions = '--lbperjob=10' if lbinfoinfiles else '--files-per-job=10' |
Definition at line 332 of file beamspotman.py.
beamspotman.lbperjob = options.lbperjob |
Definition at line 1109 of file beamspotman.py.
Definition at line 1152 of file beamspotman.py.
Definition at line 1275 of file beamspotman.py.
beamspotman.m = next(taskman.taskIterDict('*',["where RUNNR =",DbParam(runnr),"and DSNAME =",DbParam(dsname),"and TASKNAME =",DbParam(monTaskName),"order by UPDATED desc"])) |
Definition at line 824 of file beamspotman.py.
Definition at line 815 of file beamspotman.py.
beamspotman.n = taskman.getNTasks(["where DSNAME ='%s' and TASKNAME like '%s'" % (dsname,options.excludeiftask)]) |
Definition at line 729 of file beamspotman.py.
string beamspotman.nextbeamspot = '' |
Definition at line 591 of file beamspotman.py.
beamspotman.None |
Definition at line 92 of file beamspotman.py.
beamspotman.onDiskCode = TaskManager.OnDiskCodes['ALLONDISK'] |
Definition at line 803 of file beamspotman.py.
beamspotman.options |
Definition at line 146 of file beamspotman.py.
def beamspotman.oracle = getT0DbConnection() |
Definition at line 668 of file beamspotman.py.
Definition at line 887 of file beamspotman.py.
string beamspotman.oscmd = r"find %s ! \( -name '%s' \) -type f -exec rm {} \;" % (dir, "' -or -name '".join(exceptList)) |
Definition at line 988 of file beamspotman.py.
beamspotman.out |
Definition at line 744 of file beamspotman.py.
string beamspotman.outname = d.replace('/','-')+time.strftime('-%G_%m_%d.tar.gz') |
Definition at line 412 of file beamspotman.py.
beamspotman.output |
Definition at line 387 of file beamspotman.py.
dictionary beamspotman.p = s.split('=',1) |
Definition at line 358 of file beamspotman.py.
dictionary beamspotman.params |
Definition at line 348 of file beamspotman.py.
string beamspotman.paramValues = '' |
Definition at line 905 of file beamspotman.py.
beamspotman.parser = OptionParser(usage=__usage__, version=__version__, option_class=BeamSpotOption) |
Definition at line 81 of file beamspotman.py.
beamspotman.passwd = passwdfile.read().strip() |
Definition at line 245 of file beamspotman.py.
string beamspotman.path = archivepath |
Definition at line 413 of file beamspotman.py.
beamspotman.plbnr |
Definition at line 1283 of file beamspotman.py.
beamspotman.posX |
Definition at line 1622 of file beamspotman.py.
beamspotman.posXErr |
Definition at line 1627 of file beamspotman.py.
beamspotman.posY |
Definition at line 1622 of file beamspotman.py.
beamspotman.posYErr |
Definition at line 1627 of file beamspotman.py.
beamspotman.posZ |
Definition at line 1622 of file beamspotman.py.
beamspotman.posZErr |
Definition at line 1627 of file beamspotman.py.
Definition at line 50 of file beamspotman.py.
beamspotman.proddir = '/afs/cern.ch/user/a/atlidbs/jobs' |
Definition at line 48 of file beamspotman.py.
Definition at line 52 of file beamspotman.py.
Definition at line 49 of file beamspotman.py.
beamspotman.ptag = dsname.split('.')[0] |
Definition at line 845 of file beamspotman.py.
list beamspotman.qual = ["where DSNAME like '%s' and TASKNAME like '%s'" % (dssel,tasksel)] |
Definition at line 479 of file beamspotman.py.
string beamspotman.queue = options.batch_queue or '"tomorrow"' |
Definition at line 345 of file beamspotman.py.
def beamspotman.r = cur.fetchall() |
Definition at line 674 of file beamspotman.py.
beamspotman.requireSingleTask |
Definition at line 534 of file beamspotman.py.
list beamspotman.rlbs = [lb for (lb,time) in lbTimes.items() if (time[0] - tend/1e9)*(time[1] - tstart/1e9) < 0] |
Definition at line 1293 of file beamspotman.py.
beamspotman.run = args[1] |
Definition at line 282 of file beamspotman.py.
Definition at line 1617 of file beamspotman.py.
Definition at line 1616 of file beamspotman.py.
beamspotman.runner |
Definition at line 1190 of file beamspotman.py.
beamspotman.runnr = t['RUNNR'] |
Definition at line 722 of file beamspotman.py.
beamspotman.script = open('condorSubmit.sub','w') |
Definition at line 1080 of file beamspotman.py.
beamspotman.sigmaX |
Definition at line 1623 of file beamspotman.py.
beamspotman.sigmaXErr |
Definition at line 1628 of file beamspotman.py.
beamspotman.sigmaXY |
Definition at line 1626 of file beamspotman.py.
beamspotman.sigmaXYErr |
Definition at line 1630 of file beamspotman.py.
beamspotman.sigmaY |
Definition at line 1623 of file beamspotman.py.
beamspotman.sigmaYErr |
Definition at line 1628 of file beamspotman.py.
beamspotman.sigmaZ |
Definition at line 1623 of file beamspotman.py.
beamspotman.sigmaZErr |
Definition at line 1628 of file beamspotman.py.
beamspotman.sql = str("SELECT status FROM tasks WHERE taskname='%s' AND tasktype='beamspotproc'" % t0TaskName) |
Definition at line 672 of file beamspotman.py.
beamspotman.stat |
Definition at line 264 of file beamspotman.py.
beamspotman.statfile = glob.glob('%s/000/*.status.SUBMITTED' % (dir)) |
Definition at line 632 of file beamspotman.py.
int beamspotman.status = status >> 8 |
Definition at line 387 of file beamspotman.py.
Definition at line 503 of file beamspotman.py.
beamspotman.stream = dsname.split('.')[2] |
Definition at line 846 of file beamspotman.py.
bool beamspotman.submitjob = True |
Definition at line 871 of file beamspotman.py.
Definition at line 520 of file beamspotman.py.
Definition at line 860 of file beamspotman.py.
Definition at line 660 of file beamspotman.py.
beamspotman.tag = args[2] |
Definition at line 283 of file beamspotman.py.
beamspotman.tags = task.split('.')[-1] |
Definition at line 657 of file beamspotman.py.
list beamspotman.taskList |
Definition at line 512 of file beamspotman.py.
beamspotman.taskman |
Definition at line 522 of file beamspotman.py.
beamspotman.taskname = cmdargs[1] |
Definition at line 498 of file beamspotman.py.
beamspotman.taskName = t['TASKNAME'] |
Definition at line 813 of file beamspotman.py.
beamspotman.tasksel = args[2] |
Definition at line 695 of file beamspotman.py.
beamspotman.tend |
Definition at line 1283 of file beamspotman.py.
string beamspotman.testFlag = '' |
Definition at line 908 of file beamspotman.py.
Definition at line 53 of file beamspotman.py.
beamspotman.tiltX |
Definition at line 1624 of file beamspotman.py.
beamspotman.tiltXErr |
Definition at line 1629 of file beamspotman.py.
beamspotman.tiltY |
Definition at line 1625 of file beamspotman.py.
beamspotman.tiltYErr |
Definition at line 1629 of file beamspotman.py.
string beamspotman.tmpdir = '/tmp' |
Definition at line 410 of file beamspotman.py.
beamspotman.tmplist = glob.glob(args[1]+'/') |
Definition at line 379 of file beamspotman.py.
beamspotman.tokens = line.split() |
Definition at line 1282 of file beamspotman.py.
beamspotman.True |
Definition at line 534 of file beamspotman.py.
beamspotman.tstart |
Definition at line 1283 of file beamspotman.py.
beamspotman.type |
Definition at line 122 of file beamspotman.py.
string beamspotman.uploadflag = dbfile[0]+'.uploaded' |
Definition at line 580 of file beamspotman.py.
bool beamspotman.useRun = True |
Definition at line 816 of file beamspotman.py.