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

Go to the source code of this file.

Namespaces

namespace  DeMoUpdate

Functions

 DeMoUpdate.sort_period (text)
 Ancillary functions.
 DeMoUpdate.printProp (varname)
 DeMoUpdate.listify (l)
 DeMoUpdate.findLB (lbts, startOfVetoPeriod)
 DeMoUpdate.printBoth (string0, boolean, f)
 Functions dedicated to output printing.
 DeMoUpdate.singleRunReport (runNumber, dict1, dict2, directory, defects, veto, exactVetoComput)
 DeMoUpdate.extractNamePartition (foundDefect)
 Functions dedicated to defect retrieval and basic string manipulations.
 DeMoUpdate.retrieveDefectsFromDB (run, defectTag, grlDef, signOffDefects)
 DeMoUpdate.updateRunList (year=time.localtime().tm_year)
 Retrieval of new runs not yet in YearStats-common/runlist-[year]-AtlasReady.dat.
 DeMoUpdate.getRunInfo (runlist, defectTag="HEAD")
 Retrieval of run characteristics.

Variables

bool DeMoUpdate.debug = False
 DeMoUpdate.passfile = open("/afs/cern.ch/user/l/larmon/public/atlasdqmpass.txt")
 DeMoUpdate.passwd = passfile.read().strip(); passfile.close()
 DeMoUpdate.dqmapi = xmlrpc.client.ServerProxy('https://%s@atlasdqm.cern.ch'%(passwd))
str DeMoUpdate.runListDir = "./YearStats-common"
 DeMoUpdate.parser = ArgumentParser(description='',formatter_class=RawTextHelpFormatter)
 DeMoUpdate.dest
 DeMoUpdate.default
 DeMoUpdate.help
 DeMoUpdate.action
 DeMoUpdate.type
 DeMoUpdate.int
 DeMoUpdate.nargs
 DeMoUpdate.args = parser.parse_args()
dict DeMoUpdate.options = {}
dict DeMoUpdate.yearTagProperties = {}
dict DeMoUpdate.partitions = {}
dict DeMoUpdate.grlDef = {}
dict DeMoUpdate.defectVeto = {}
dict DeMoUpdate.veto = {}
dict DeMoUpdate.signOff = {}
dict DeMoUpdate.runlist = {'filename':"",'primary':[],'toprocess':[],'weeklyfile':[],'weekly-dqmeeting':"",'roughVeto':[]}
 DeMoUpdate.year
str DeMoUpdate.tokenName = "DeMo-%s-%s-%s.token"%(options['system'],options['year'],options['tag'])
int DeMoUpdate.startrun = 0
int DeMoUpdate.endrun = 1e12
str DeMoUpdate.runListFilename = "%s/%s/%s"%(runListDir,options['year'],runlist['filename'])
 DeMoUpdate.fRunList = open(runListFilename,'r')
str DeMoUpdate.roughVetoFilename = runListDir+"/%s/%s/roughVeto-%s.dat"%(options['system'],options['year'],options['year'])
 DeMoUpdate.fRoughVeto = open(roughVetoFilename,'r')
str DeMoUpdate.yearStatsArchiveFilename = '%s/TProfiles.root'%options['yearStatsDir']
str DeMoUpdate.confirm = "y"
 DeMoUpdate.fLastReset = open("%s/lastResetYS.dat"%options['yearStatsDir'],"w")
 DeMoUpdate.errorLogFile = open("%s/errors.log"%options['yearStatsDir'],'a')
 DeMoUpdate.notYetSignedOffRuns = open('%s/runs-notYetSignedOff.dat'%options['yearStatsDir'],'w')
 DeMoUpdate.runinfo = getRunInfo(runlist['primary'],options['defectTag'])
list DeMoUpdate.oldRunsNotYetignedOff = []
int DeMoUpdate.oneWeek = 7*24*3600
 DeMoUpdate.key
 DeMoUpdate.reverse
 DeMoUpdate.defects = runinfo[run]["signoffDefects"].keys()
list DeMoUpdate.statuses = [ runinfo[run]["signoffDefects"][d]["status"] for d in defects ]
bool DeMoUpdate.fullySignedOff = True
int DeMoUpdate.signOffTime = 0
 DeMoUpdate.weeklyFile = open("%s/%s/runlist-weekly.dat"%(runListDir,options['year']),'r')
dict DeMoUpdate.periodListCurrent = {}
list DeMoUpdate.newPeriodInYearStats = []
bool DeMoUpdate.bool_newRunsInYearStats = False
 DeMoUpdate.allperiods_full = list(set([ p for irun in runlist['toprocess'] for p in runinfo[irun]["periods"] ]))
 DeMoUpdate.allperiods = list(set([runinfo[irun]["period"] for irun in runlist['toprocess'] if runinfo[irun]["period"] != "?"]))
str DeMoUpdate.periodFileName = "%s/runs-%s.dat"%(options['yearStatsDir'],iper)
 DeMoUpdate.f = open(periodFileName,'r')
 DeMoUpdate.existingRuns = f.readlines()
bool DeMoUpdate.periodToBeAdded = False
dict DeMoUpdate.hProfRun_IntolDefect = {}
 Book Histograms for general plot with intolerable defects/veto Fill them with past period inefficiencies.
dict DeMoUpdate.hProfRun_Veto = {}
dict DeMoUpdate.hProfPeriod_IntolDefect = {}
dict DeMoUpdate.hProfPeriod_Veto = {}
list DeMoUpdate.allIntolDef = ["allIntol","allIntol_recov"]
 DeMoUpdate.idefName = idef.split("__")[0]
list DeMoUpdate.periodListYear = []
str DeMoUpdate.profPeriodName = "hProfPeriod_IntolDefect_%s"%(idef)
 DeMoUpdate.file = TFile(yearStatsArchiveFilename)
 DeMoUpdate.hProfPeriod_archive = file.Get("%s_archive"%(profPeriodName))
 DeMoUpdate.periodNbYear = len(periodListYear)
 DeMoUpdate.h1Run_IntLuminosity = MakeTH1("h1_IntLumi","Run","Integrated luminosity", -0.5,+0.5+len(runlist['toprocess']),len(runlist['toprocess'])+1,kBlack)
 DeMoUpdate.h1Per_IntLumi = MakeTH1("periodLuminosity","Period","Luminosity(pb-1)",-0.5,+0.5+periodNbYear,periodNbYear+1,1)
 TO BE MODIFIED WHEN TH1 IS SAVED IN TPROFILE.ROOT.
dict DeMoUpdate.h1_vetoInstLumiEvol = {}
 Book histograms for luminosity profile and veto rejection as a function of luminosity.
dict DeMoUpdate.lbAffected = {}
 Main loop over selected runs.
tuple DeMoUpdate.boolExactVetoComput_run = (options['exactVetoComput']) and (runNb not in runlist['roughVeto'])
 DeMoUpdate.v_lbTimeSt = GetLBTimeStamps(runNb)
 DeMoUpdate.defectDatabase = DQDefects.DefectsDB(tag=options['defectTag'])
list DeMoUpdate.globalFilterLB = []
 DeMoUpdate.retrievedDefects = defectDatabase.retrieve((runNb, 1), (runNb, runinfo[runNb]['nLB']), grlDef["globalFilterDefects"])
 DeMoUpdate.atlasready = GetReadyFlag(runNb)
 DeMoUpdate.thisRunPerLB = dict()
 DeMoUpdate.lumiacct = fetch_iovs('COOLOFL_TRIGGER::/TRIGGER/OFLLUMI/LumiAccounting', tag=yearTagProperties["OflLumiAcct tag"], since=v_lbTimeSt[1][0]*1000000000, until=v_lbTimeSt[len(v_lbTimeSt)][1]*1000000000)
str DeMoUpdate.errorMsg = "Missing lumi for Run %d - LB %d\n"%(runNb,lb)
 DeMoUpdate.parsedDefects = retrieveDefectsFromDB(runNb, options['defectTag'], grlDef,signOff)
 DeMoUpdate.defectFound
 DeMoUpdate.partAffected
str DeMoUpdate.db2 = "COOLOFL_LAR/CONDBR2"
str DeMoUpdate.folderName = "/LAR/BadChannelsOfl/EventVeto"
 DeMoUpdate.totalVeto = showEventVeto.showEventVetoFolder(db2,folderName,options['vetoTag'],runNb,runNb,0)
 DeMoUpdate.lb0 = findLB(v_lbTimeSt,totalVeto[veto["COOL"][iVeto]][iVetoedLB][0]/1e9)
 DeMoUpdate.lb1 = findLB(v_lbTimeSt,totalVeto[veto["COOL"][iVeto]][iVetoedLB][0]/1e9)
dict DeMoUpdate.lineNb = {}
dict DeMoUpdate.column = {}
dict DeMoUpdate.c1 = {}
int DeMoUpdate.canvasIndex = 0
bool DeMoUpdate.newCanvas = True
list DeMoUpdate.labels_col = ["Run","Run start / stop","LB ready","Peak lumi","Filt. lumi","GRL ineff.","Veto ineff.","Period","Status"]
list DeMoUpdate.xlow_col = [0.01,0.075,0.405,0.485,0.57,0.65,0.735,0.83,0.89,0.99]
float DeMoUpdate.ylowTable = 0.99 - 0.98/(len(runlist['toprocess'])+6)*(len(runlist['toprocess'])+2)
 DeMoUpdate.notYetSignedOff_TPave = TPaveText(xlow_col[0],0.01,xlow_col[len(labels_col)],ylowTable)
str DeMoUpdate.tmp = "Old runs (> 7 days) not yet signed off: "
str DeMoUpdate.tmp2 = ""
dict DeMoUpdate.canvasResults = {}
dict DeMoUpdate.legendResults = {}
dict DeMoUpdate.stackResults = {}
str DeMoUpdate.filename = 'Files/weeklyHisto-%s-%s.root'%(startrun, endrun)
 DeMoUpdate.fAll = open("%s/runs-ALL.dat"%options['yearStatsDir'],'a')
str DeMoUpdate.irun_string = "%d (%.0f ub-1)"%(irun,runinfo[irun]['Lumi'])
str DeMoUpdate.defectFileName = "%s/loss-%s.dat"%(options['yearStatsDir'],idef)
str DeMoUpdate.defString = "%s -> %.6f pb-1 (recov: %.6f pb-1)\n"%(irun_string,runinfo[irun]["lumiDefect_%s"%(idef)]/1e6,runinfo[irun]["lumiDefect_%s__recov"%(idef)]/1e6)
bool DeMoUpdate.toAdd = True
 DeMoUpdate.f2 = open(defectFileName,'r')
str DeMoUpdate.vetoFileName = "%s/loss-%sVETO.dat"%(options['yearStatsDir'],iVeto)
str DeMoUpdate.vetoString = "%s -> %.6f pb-1 \n"%(irun_string,runinfo[irun]["lumiVeto_%s"%(iVeto)]/1e6)