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 = "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 76 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 206 of file beamspotman.py.
def beamspotman.fail | ( | message | ) |
Definition at line 201 of file beamspotman.py.
def beamspotman.getT0DbConnection | ( | ) |
Definition at line 169 of file beamspotman.py.
def beamspotman.getTaskManager | ( | ) |
Open task manager (used by all following commands, at the very least through subcommands)
Definition at line 193 of file beamspotman.py.
def beamspotman.run_jobs | ( | script, | |
ds_name, | |||
task_name, | |||
params, | |||
* | args | ||
) |
|
private |
Definition at line 10 of file beamspotman.py.
|
private |
Definition at line 12 of file beamspotman.py.
|
private |
Definition at line 11 of file beamspotman.py.
beamspotman.a = input('\nARE YOU SURE [n] ? ') |
Definition at line 408 of file beamspotman.py.
beamspotman.action |
Definition at line 86 of file beamspotman.py.
beamspotman.addWildCards |
Definition at line 536 of file beamspotman.py.
beamspotman.archivedCode = TaskManager.OnDiskCodes.get('RESULTSONDISK',None) if options.resultsondisk else TaskManager.OnDiskCodes.get('ARCHIVED',None) |
Definition at line 950 of file beamspotman.py.
string beamspotman.archivepath = '/eos/atlas/atlascerngroupdisk/phys-beamspot/jobs/archive' |
Definition at line 57 of file beamspotman.py.
beamspotman.args |
Definition at line 148 of file beamspotman.py.
Definition at line 1134 of file beamspotman.py.
string beamspotman.backuppath = '/eos/atlas/atlascerngroupdisk/phys-beamspot/jobs/backup' |
Definition at line 56 of file beamspotman.py.
string beamspotman.baklog = d+'/backup.log' |
Definition at line 386 of file beamspotman.py.
beamspotman.basename = statfile[0][:-17] |
Definition at line 640 of file beamspotman.py.
Definition at line 1018 of file beamspotman.py.
beamspotman.batch |
Definition at line 536 of file beamspotman.py.
string beamspotman.batchCmd = 'condor_submit condorSubmit.sub' |
Definition at line 1087 of file beamspotman.py.
string beamspotman.batchmode = '--batch' |
Definition at line 570 of file beamspotman.py.
Definition at line 1541 of file beamspotman.py.
beamspotman.BeamSpotPostProcessing |
Definition at line 524 of file beamspotman.py.
beamspotman.beamspottag = '' |
Definition at line 55 of file beamspotman.py.
string beamspotman.bstag = cooltags.split()[0] |
Definition at line 858 of file beamspotman.py.
Definition at line 866 of file beamspotman.py.
string beamspotman.cmd = args[0] |
Definition at line 150 of file beamspotman.py.
beamspotman.cmdargs = args[1:] |
Definition at line 151 of file beamspotman.py.
beamspotman.comment |
Definition at line 1216 of file beamspotman.py.
string beamspotman.condorScript = condorScriptTemplate % jobConfig |
Definition at line 1080 of file beamspotman.py.
string beamspotman.condorScriptTemplate |
Definition at line 1021 of file beamspotman.py.
beamspotman.confirmWithUser |
Definition at line 536 of file beamspotman.py.
beamspotman.coolQuery = COOLQuery() |
Definition at line 1275 of file beamspotman.py.
beamspotman.cooltags = options.beamspottag |
Definition at line 587 of file beamspotman.py.
def beamspotman.cur = oracle.cursor() |
Definition at line 671 of file beamspotman.py.
beamspotman.d = dslash[:-1] |
Definition at line 384 of file beamspotman.py.
beamspotman.dataset |
Definition at line 286 of file beamspotman.py.
beamspotman.datatag = taskName.split('.')[-1].split('_')[0] |
Definition at line 816 of file beamspotman.py.
string beamspotman.dbfile = args[1] |
Definition at line 242 of file beamspotman.py.
beamspotman.dbName = options.destdbname |
Definition at line 1653 of file beamspotman.py.
beamspotman.default |
Definition at line 86 of file beamspotman.py.
beamspotman.dest |
Definition at line 86 of file beamspotman.py.
string beamspotman.dir = os.path.join(dsname, task) |
Definition at line 623 of file beamspotman.py.
beamspotman.dircontents = os.listdir(basepath) |
Definition at line 1019 of file beamspotman.py.
list beamspotman.dirlist = [] |
Definition at line 382 of file beamspotman.py.
beamspotman.dsname = cmdargs[0] |
Definition at line 286 of file beamspotman.py.
beamspotman.dssel = args[1] |
Definition at line 696 of file beamspotman.py.
int beamspotman.earliestUpdateTime = time.time()-float(args[1]) |
Definition at line 795 of file beamspotman.py.
string beamspotman.eospath = options.eospath |
Definition at line 874 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 951 of file beamspotman.py.
beamspotman.excludeList = options.excludeds.split(',') |
Definition at line 739 of file beamspotman.py.
beamspotman.False |
Definition at line 86 of file beamspotman.py.
list beamspotman.filenames = [] |
Definition at line 1298 of file beamspotman.py.
dictionary beamspotman.files = [] |
Definition at line 1114 of file beamspotman.py.
string beamspotman.filter = 'AOD' |
Definition at line 860 of file beamspotman.py.
Definition at line 52 of file beamspotman.py.
beamspotman.flaskpasswd = flaskpasswdfile.read().strip() |
Definition at line 253 of file beamspotman.py.
Definition at line 1616 of file beamspotman.py.
beamspotman.forceRun |
Definition at line 524 of file beamspotman.py.
beamspotman.fs |
Definition at line 470 of file beamspotman.py.
Definition at line 781 of file beamspotman.py.
beamspotman.fulldatatag = taskName.split('.')[-1] |
Definition at line 850 of file beamspotman.py.
Definition at line 1039 of file beamspotman.py.
beamspotman.g_deprecated = OptionGroup(parser, 'Deprecated Options') |
Definition at line 144 of file beamspotman.py.
Definition at line 85 of file beamspotman.py.
beamspotman.g_mode = OptionGroup(parser, 'Mode flags') |
Definition at line 98 of file beamspotman.py.
string beamspotman.griddsname = '%s.%s-%s' % (options.griduser,dsname,task) |
Definition at line 624 of file beamspotman.py.
beamspotman.help |
Definition at line 86 of file beamspotman.py.
string beamspotman.ignoremode = '--passopt="--appendlocked --ignoremode %s"' % options.ignoremode |
Definition at line 566 of file beamspotman.py.
beamspotman.inputdata = args[4] |
Definition at line 1109 of file beamspotman.py.
list beamspotman.intlbs = [] |
Definition at line 1185 of file beamspotman.py.
bool beamspotman.isFailed = False |
Definition at line 1042 of file beamspotman.py.
bool beamspotman.isRunning = False |
Definition at line 1041 of file beamspotman.py.
dictionary beamspotman.jobConfig |
Definition at line 1071 of file beamspotman.py.
dictionary beamspotman.jobFileDict = {} |
Definition at line 1143 of file beamspotman.py.
beamspotman.jobId = 1 |
Definition at line 1148 of file beamspotman.py.
dictionary beamspotman.jobLBDict = {} |
Definition at line 1144 of file beamspotman.py.
string beamspotman.jobname = dir |
Definition at line 1036 of file beamspotman.py.
int beamspotman.jobnr = i*lbperjob+1 |
Definition at line 1180 of file beamspotman.py.
beamspotman.jobopts = args[1] |
Definition at line 1106 of file beamspotman.py.
dictionary beamspotman.jobParams = {} |
Definition at line 1270 of file beamspotman.py.
bool beamspotman.lbinfoinfiles = True |
Definition at line 329 of file beamspotman.py.
dictionary beamspotman.lbMap = {} |
Definition at line 1133 of file beamspotman.py.
string beamspotman.lboptions = '--lbperjob=10' if lbinfoinfiles else '--files-per-job=10' |
Definition at line 334 of file beamspotman.py.
beamspotman.lbperjob = options.lbperjob |
Definition at line 1111 of file beamspotman.py.
Definition at line 1154 of file beamspotman.py.
Definition at line 1277 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 826 of file beamspotman.py.
Definition at line 817 of file beamspotman.py.
beamspotman.n = taskman.getNTasks(["where DSNAME ='%s' and TASKNAME like '%s'" % (dsname,options.excludeiftask)]) |
Definition at line 731 of file beamspotman.py.
string beamspotman.nextbeamspot = '' |
Definition at line 593 of file beamspotman.py.
beamspotman.None |
Definition at line 94 of file beamspotman.py.
beamspotman.onDiskCode = TaskManager.OnDiskCodes['ALLONDISK'] |
Definition at line 805 of file beamspotman.py.
beamspotman.options |
Definition at line 148 of file beamspotman.py.
def beamspotman.oracle = getT0DbConnection() |
Definition at line 670 of file beamspotman.py.
Definition at line 889 of file beamspotman.py.
string beamspotman.oscmd = "find %s ! \( -name '%s' \) -type f -exec rm {} \;" % (dir, "' -or -name '".join(exceptList)) |
Definition at line 990 of file beamspotman.py.
beamspotman.out |
Definition at line 746 of file beamspotman.py.
string beamspotman.outname = d.replace('/','-')+time.strftime('-%G_%m_%d.tar.gz') |
Definition at line 414 of file beamspotman.py.
beamspotman.output |
Definition at line 389 of file beamspotman.py.
dictionary beamspotman.p = s.split('=',1) |
Definition at line 360 of file beamspotman.py.
dictionary beamspotman.params |
Definition at line 350 of file beamspotman.py.
string beamspotman.paramValues = '' |
Definition at line 907 of file beamspotman.py.
beamspotman.parser = OptionParser(usage=__usage__, version=__version__, option_class=BeamSpotOption) |
Definition at line 83 of file beamspotman.py.
beamspotman.passwd = passwdfile.read().strip() |
Definition at line 247 of file beamspotman.py.
string beamspotman.path = archivepath |
Definition at line 415 of file beamspotman.py.
beamspotman.plbnr |
Definition at line 1285 of file beamspotman.py.
beamspotman.posX |
Definition at line 1624 of file beamspotman.py.
beamspotman.posXErr |
Definition at line 1629 of file beamspotman.py.
beamspotman.posY |
Definition at line 1624 of file beamspotman.py.
beamspotman.posYErr |
Definition at line 1629 of file beamspotman.py.
beamspotman.posZ |
Definition at line 1624 of file beamspotman.py.
beamspotman.posZErr |
Definition at line 1629 of file beamspotman.py.
Definition at line 51 of file beamspotman.py.
beamspotman.proddir = '/afs/cern.ch/user/a/atlidbs/jobs' |
Definition at line 49 of file beamspotman.py.
Definition at line 53 of file beamspotman.py.
Definition at line 50 of file beamspotman.py.
beamspotman.ptag = dsname.split('.')[0] |
Definition at line 847 of file beamspotman.py.
list beamspotman.qual = ["where DSNAME like '%s' and TASKNAME like '%s'" % (dssel,tasksel)] |
Definition at line 481 of file beamspotman.py.
string beamspotman.queue = options.batch_queue or '"tomorrow"' |
Definition at line 347 of file beamspotman.py.
def beamspotman.r = cur.fetchall() |
Definition at line 676 of file beamspotman.py.
beamspotman.requireSingleTask |
Definition at line 536 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 1295 of file beamspotman.py.
beamspotman.run = args[1] |
Definition at line 284 of file beamspotman.py.
Definition at line 1619 of file beamspotman.py.
Definition at line 1618 of file beamspotman.py.
beamspotman.runner |
Definition at line 1192 of file beamspotman.py.
beamspotman.runnr = t['RUNNR'] |
Definition at line 724 of file beamspotman.py.
beamspotman.script = open('condorSubmit.sub','w') |
Definition at line 1082 of file beamspotman.py.
beamspotman.sigmaX |
Definition at line 1625 of file beamspotman.py.
beamspotman.sigmaXErr |
Definition at line 1630 of file beamspotman.py.
beamspotman.sigmaXY |
Definition at line 1628 of file beamspotman.py.
beamspotman.sigmaXYErr |
Definition at line 1632 of file beamspotman.py.
beamspotman.sigmaY |
Definition at line 1625 of file beamspotman.py.
beamspotman.sigmaYErr |
Definition at line 1630 of file beamspotman.py.
beamspotman.sigmaZ |
Definition at line 1625 of file beamspotman.py.
beamspotman.sigmaZErr |
Definition at line 1630 of file beamspotman.py.
beamspotman.sql = str("SELECT status FROM tasks WHERE taskname='%s' AND tasktype='beamspotproc'" % t0TaskName) |
Definition at line 674 of file beamspotman.py.
beamspotman.stat |
Definition at line 266 of file beamspotman.py.
beamspotman.statfile = glob.glob('%s/000/*.status.SUBMITTED' % (dir)) |
Definition at line 634 of file beamspotman.py.
int beamspotman.status = status >> 8 |
Definition at line 389 of file beamspotman.py.
Definition at line 505 of file beamspotman.py.
beamspotman.stream = dsname.split('.')[2] |
Definition at line 848 of file beamspotman.py.
bool beamspotman.submitjob = True |
Definition at line 873 of file beamspotman.py.
Definition at line 522 of file beamspotman.py.
Definition at line 862 of file beamspotman.py.
Definition at line 662 of file beamspotman.py.
beamspotman.tag = args[2] |
Definition at line 285 of file beamspotman.py.
beamspotman.tags = task.split('.')[-1] |
Definition at line 659 of file beamspotman.py.
list beamspotman.taskList |
Definition at line 514 of file beamspotman.py.
beamspotman.taskman |
Definition at line 524 of file beamspotman.py.
beamspotman.taskname = cmdargs[1] |
Definition at line 500 of file beamspotman.py.
beamspotman.taskName = t['TASKNAME'] |
Definition at line 815 of file beamspotman.py.
beamspotman.tasksel = args[2] |
Definition at line 697 of file beamspotman.py.
beamspotman.tend |
Definition at line 1285 of file beamspotman.py.
string beamspotman.testFlag = '' |
Definition at line 910 of file beamspotman.py.
Definition at line 54 of file beamspotman.py.
beamspotman.tiltX |
Definition at line 1626 of file beamspotman.py.
beamspotman.tiltXErr |
Definition at line 1631 of file beamspotman.py.
beamspotman.tiltY |
Definition at line 1627 of file beamspotman.py.
beamspotman.tiltYErr |
Definition at line 1631 of file beamspotman.py.
string beamspotman.tmpdir = '/tmp' |
Definition at line 412 of file beamspotman.py.
beamspotman.tmplist = glob.glob(args[1]+'/') |
Definition at line 381 of file beamspotman.py.
beamspotman.tokens = line.split() |
Definition at line 1284 of file beamspotman.py.
beamspotman.True |
Definition at line 536 of file beamspotman.py.
beamspotman.tstart |
Definition at line 1285 of file beamspotman.py.
beamspotman.type |
Definition at line 124 of file beamspotman.py.
string beamspotman.uploadflag = dbfile[0]+'.uploaded' |
Definition at line 582 of file beamspotman.py.
bool beamspotman.useRun = True |
Definition at line 818 of file beamspotman.py.