ATLAS Offline Software
Loading...
Searching...
No Matches
beamspotman.py File Reference

Go to the source code of this file.

Classes

class  beamspotman.BeamSpotOption

Namespaces

namespace  beamspotman

Functions

 beamspotman.check_commsep (option, opt, value)
 beamspotman.getT0DbConnection ()
 beamspotman.getTaskManager ()
 beamspotman.fail (message)
 beamspotman.dataset_from_run_and_tag (run, tag)
 beamspotman.run_jobs (script, ds_name, task_name, params, *args)

Variables

list beamspotman.__authors__ = ['Juerg Beringer', 'Carl Suster']
str beamspotman.__version__ = 'beamspotman.py atlas/athena'
str beamspotman.__usage__
str beamspotman.proddir = '/afs/cern.ch/user/a/atlidbs/jobs'
str beamspotman.produserfile = '/afs/cern.ch/user/a/atlidbs/private/produsers.dat'
str beamspotman.prodcoolpasswdfile = '/afs/cern.ch/user/a/atlidbs/private/coolinfo.dat'
str beamspotman.flaskcoolpasswdfile = '/afs/cern.ch/user/a/atlidbs/private/flaskinfo.dat'
str beamspotman.proddqcoolpasswdfile = '/afs/cern.ch/user/a/atlidbs/private/cooldqinfo.dat'
str beamspotman.tier0dbinfofile = '/afs/cern.ch/user/a/atlidbs/private/t0dbinfo.dat'
str beamspotman.beamspottag = ''
str beamspotman.backuppath = '/eos/atlas/atlascerngroupdisk/phys-beamspot/jobs/backup'
str beamspotman.archivepath = '/eos/atlas/atlascerngroupdisk/phys-beamspot/jobs/archive'
 beamspotman.parser = OptionParser(usage=__usage__, version=__version__, option_class=BeamSpotOption)
 beamspotman.g_input = OptionGroup(parser, 'Input file options')
 beamspotman.dest
 beamspotman.default
 beamspotman.False
 beamspotman.action
 beamspotman.help
 beamspotman.None
 beamspotman.g_mode = OptionGroup(parser, 'Mode flags')
 beamspotman.type
 beamspotman.g_deprecated = OptionGroup(parser, 'Deprecated Options')
 beamspotman.options
 beamspotman.args
 beamspotman.cmd = args[0]
 beamspotman.cmdargs = args[1:]
 beamspotman.dbfile = args[1]
 beamspotman.passwd = passwdfile.read().strip()
 beamspotman.flaskpasswd = flaskpasswdfile.read().strip()
 beamspotman.stat
 beamspotman.run = args[1]
 beamspotman.tag = args[2]
 beamspotman.dataset
 beamspotman.dsname = cmdargs[0]
bool beamspotman.lbinfoinfiles = True
str beamspotman.lboptions = '--lbperjob=10' if lbinfoinfiles else '--files-per-job=10'
str beamspotman.queue = options.batch_queue or '"tomorrow"'
dict beamspotman.params
 beamspotman.p = s.split('=',1)
 beamspotman.tmplist = glob.glob(args[1]+'/')
list beamspotman.dirlist = []
 beamspotman.d = dslash[:-1]
str beamspotman.baklog = d+'/backup.log'
 beamspotman.status = status >> 8
 beamspotman.output
 beamspotman.a = input('\nARE YOU SURE [n] ? ')
str beamspotman.tmpdir = '/tmp'
 beamspotman.outname = d.replace('/','-')+time.strftime('-%G_%m_%d.tar.gz')
str beamspotman.path = archivepath
 beamspotman.fs
 beamspotman.qual = ["where DSNAME like '%s' and TASKNAME like '%s'" % (dssel,tasksel)]
 beamspotman.taskname = cmdargs[1]
int beamspotman.steps = options.postprocsteps if len(cmdargs) < 3 else cmdargs[2].split(',')
 beamspotman.taskList
 beamspotman.t = taskman.getTaskDict(taskName[0], taskName[1])
 beamspotman.taskman
 beamspotman.BeamSpotPostProcessing
 beamspotman.forceRun
 beamspotman.requireSingleTask
 beamspotman.True
 beamspotman.confirmWithUser
 beamspotman.batch
 beamspotman.addWildCards
str beamspotman.ignoremode = '--passopt="--appendlocked --ignoremode %s"' % options.ignoremode
str beamspotman.batchmode = '--batch'
str beamspotman.uploadflag = dbfile[0]+'.uploaded'
str beamspotman.cooltags = options.beamspottag
str beamspotman.nextbeamspot = ''
str beamspotman.dir = os.path.join(dsname, task)
str beamspotman.griddsname = '%s.%s-%s' % (options.griduser,dsname,task)
 beamspotman.statfile = glob.glob('%s/000/*.status.SUBMITTED' % (dir))
 beamspotman.basename = statfile[0][:-17]
 beamspotman.tags = task.split('.')[-1]
str beamspotman.t0TaskName = '%s.recon.ESD.%s.beamspotproc.task' % (dsname,tags)
 beamspotman.oracle = getT0DbConnection()
 beamspotman.cur = oracle.cursor()
 beamspotman.sql = str("SELECT status FROM tasks WHERE taskname='%s' AND tasktype='beamspotproc'" % t0TaskName)
 beamspotman.r = cur.fetchall()
 beamspotman.dssel = args[1]
 beamspotman.tasksel = args[2]
 beamspotman.runnr = t['RUNNR']
 beamspotman.n = taskman.getNTasks(["where DSNAME ='%s' and TASKNAME like '%s'" % (dsname,options.excludeiftask)])
 beamspotman.excludeList = options.excludeds.split(',')
 beamspotman.out
 beamspotman.fullcmd = cmd % t
 beamspotman.earliestUpdateTime = time.time()-float(args[1])
 beamspotman.onDiskCode = TaskManager.OnDiskCodes['ALLONDISK']
 beamspotman.taskName = t['TASKNAME']
 beamspotman.datatag = taskName.split('.')[-1].split('_')[0]
str beamspotman.monTaskName = 'MON.%s.%s' % (taskName,datatag)
bool beamspotman.useRun = True
 beamspotman.m = next(taskman.taskIterDict('*',["where RUNNR =",DbParam(runnr),"and DSNAME =",DbParam(dsname),"and TASKNAME =",DbParam(monTaskName),"order by UPDATED desc"]))
 beamspotman.ptag = dsname.split('.')[0]
 beamspotman.stream = dsname.split('.')[2]
 beamspotman.fulldatatag = taskName.split('.')[-1]
str beamspotman.bstag = cooltags.split()[0]
str beamspotman.filter = 'AOD'
str beamspotman.t0dsname = '%s.merge.AOD.%s%%' % (dsname, datatag)
 beamspotman.c = getJobConfig('.',dsname,taskName)
bool beamspotman.submitjob = True
 beamspotman.eospath = options.eospath
str beamspotman.origt0TaskName = '%s.recon.AOD.%s%%.aodmerge.task' % (dsname,datatag)
str beamspotman.paramValues = ''
str beamspotman.testFlag = ''
 beamspotman.archivedCode = TaskManager.OnDiskCodes.get('RESULTSONDISK',None) if options.resultsondisk else TaskManager.OnDiskCodes.get('ARCHIVED',None)
list beamspotman.exceptList = ['*dqflags.txt', '*.gif', '*.pdf', '*.config.py*', '*.argdict.gpickle', '*.AveBeamSpot.log', '*.PlotBeamSpotCompareReproc.log', '*.sh', '*.BeamSpotNt*', '*.BeamSpotGlobalNt.log', '*.status.*', '*.exit.*']
str beamspotman.oscmd = r"find %s ! \‍( -name '%s' \‍) -type f -exec rm {} \;" % (dir, "' -or -name '".join(exceptList))
str beamspotman.basepath = os.path.join(os.getcwd(), dsname, taskname)
 beamspotman.dircontents = os.listdir(basepath)
str beamspotman.condorScriptTemplate
str beamspotman.jobname = dir
str beamspotman.fullpath = os.path.join(basepath, dir)
bool beamspotman.isRunning = False
bool beamspotman.isFailed = False
dict beamspotman.jobConfig
str beamspotman.condorScript = condorScriptTemplate % jobConfig
 beamspotman.script = open('condorSubmit.sub','w')
str beamspotman.batchCmd = 'condor_submit condorSubmit.sub'
 beamspotman.jobopts = args[1]
 beamspotman.inputdata = args[4]
 beamspotman.lbperjob = options.lbperjob
list beamspotman.files = []
dict beamspotman.lbMap = {}
 beamspotman.backend = DiskUtils.EOS() if options.eos else None
dict beamspotman.jobFileDict = {}
dict beamspotman.jobLBDict = {}
int beamspotman.jobId = 1
 beamspotman.lbs = sorted(lbMap[f.split('/')[-1]])
int beamspotman.jobnr = i*lbperjob+1
list beamspotman.intlbs = []
 beamspotman.runner
 beamspotman.comment
dict beamspotman.jobParams = {}
 beamspotman.coolQuery = COOLQuery()
 beamspotman.lbTimes = coolQuery.getLbTimes( getRunFromName(dsname, None, True) )
 beamspotman.tokens = line.split()
 beamspotman.plbnr
 beamspotman.tstart
 beamspotman.tend
list beamspotman.rlbs = [lb for (lb,time) in lbTimes.items() if (time[0] - tend/1e9)*(time[1] - tstart/1e9) < 0]
list beamspotman.filenames = []
str beamspotman.bcidTaskName = 'BCID.%s.%s' % (taskName,datatag)
 beamspotman.folderHandle = openBeamSpotDbFile(dbfile, dbName = 'OFLP200', forceNew = True)
int beamspotman.runMin = options.runMin if options.runMin is not None else 0
int beamspotman.runMax = options.runMax if options.runMax is not None else (1 << 31)-1
 beamspotman.posX
 beamspotman.posY
 beamspotman.posZ
 beamspotman.sigmaX
 beamspotman.sigmaY
 beamspotman.sigmaZ
 beamspotman.tiltX
 beamspotman.tiltY
 beamspotman.sigmaXY
 beamspotman.posXErr
 beamspotman.posYErr
 beamspotman.posZErr
 beamspotman.sigmaXErr
 beamspotman.sigmaYErr
 beamspotman.sigmaZErr
 beamspotman.tiltXErr
 beamspotman.tiltYErr
 beamspotman.sigmaXYErr
 beamspotman.dbName = options.destdbname