def getRunsFromDQM(config, mask, pd, mode, datatier, runMask="all", runlistfile=[], jsonfile=[]): from src.dqmjson import dqm_get_samples, dqm_getTFile_Version # import simplejson as jsonn import json as jsonn serverUrl = config.get("dqmServer", "url") dataType = config.get("dqmServer", "type") json = dqm_get_samples(serverUrl, mask, dataType) masks = [] if runlistfile != []: runs1 = [x.strip() for x in open(runlistfile, "r")] if jsonfile != []: print "file:", jsonfile aaf = open(jsonfile) info = aaf.read() decoded = jsonn.loads(info) print decoded runs1 = [] for item in decoded: runs1.append(item) for runNr, dataset in json: if dataset not in masks: masks.append(dataset) for m in masks: print m result = {} for mask in masks: json = dqm_get_samples(serverUrl, mask, dataType) for runNr, dataset in json: if 'Cosmics' in pd and mode != 'ALL': ##For this to run correctly, I need autoRunDecoDetector.py checked out (UserCode/TkDQM/Tools) if checkStripMode(runNr) != mode: continue if runlistfile == [] and jsonfile == []: if eval(runMask, {"all": True, "run": runNr}): result[runNr] = (serverUrl, runNr, dataset) else: for run_temp in runs1: if int(run_temp) == int(runNr): print "test1=", run_temp, runNr result[runNr] = (serverUrl, runNr, dataset) if not result: print "*** WARNING: YOUR REQUEST DOESNT MATCH ANY EXISTING DATASET ***" print "-> check your settings in ./cfg/trendPlots.py" print "--> check your runmask!" print "===> maybe choose a different primary dataset" print "--> or check the runrange!" print "*** end of warning *********************************************" return return result
def getRunsFromDQM(config, mask, pd, mode, runMask="all", runlistfile=[], jsonfile=[]): from src.dqmjson import dqm_get_samples # import simplejson as jsonn import json as jsonn serverUrl = config.get("dqmServer", "url") dataType = config.get("dqmServer", "type") json = dqm_get_samples(serverUrl, mask, dataType) masks = [] if runlistfile != []: runs1 = [x.strip() for x in open(runlistfile, "r")] if jsonfile != []: print "file:", jsonfile aaf = open(jsonfile) info = aaf.read() decoded = jsonn.loads(info) print decoded runs1 = [] for item in decoded: runs1.append(item) for runNr, dataset in json: if dataset not in masks: masks.append(dataset) for m in masks: print m result = {} for mask in masks: json = dqm_get_samples(serverUrl, mask, dataType) for runNr, dataset in json: if "Cosmics" in pd and mode != "ALL": ##For this to run correctly, I need autoRunDecoDetector.py checked out (UserCode/TkDQM/Tools) if checkStripMode(runNr) != mode: continue if runlistfile == [] and jsonfile == []: if eval(runMask, {"all": True, "run": runNr}): result[runNr] = (serverUrl, runNr, dataset) else: for run_temp in runs1: if int(run_temp) == int(runNr): print "test1=", run_temp, runNr result[runNr] = (serverUrl, runNr, dataset) if not result: print "*** WARNING: YOUR REQUEST DOESNT MATCH ANY EXISTING DATASET ***" print "-> check your settings in ./cfg/trendPlots.py" print "--> check your runmask!" print "===> maybe choose a different primary dataset" print "--> or check the runrange!" print "*** end of warning *********************************************" return return result
def getRunsFromDQM(config, dset, epochs, reco, tag, datatier, runMask="all", runlistfile=[], jsonfile=[]): from src.dqmjson import dqm_get_samples, dqm_getTFile_Version # import simplejson as jsonn import json as jsonn serverUrl = config.get("dqmServer", "url") dataType = config.get("dqmServer", "type") maskList = [] for epoch in epochs: maskList.append(".*/" + dset + "/" + epoch + ".*" + reco + "*.*" + tag + "/" + datatier) print "dsetmask = ", maskList json = [] for mask in maskList: #print "------------------------------------------------------> ",mask json += dqm_get_samples(serverUrl, mask, dataType) #print json masks = [] if runlistfile != []: runs1 = [x.strip() for x in open(runlistfile, "r")] if jsonfile != []: if runMask == "all": print "file:", jsonfile aaf = open(jsonfile) info = aaf.read() decoded = jsonn.loads(info) runs1 = [] for item in decoded: runs1.append(item) else: print "file:", jsonfile aaf = open(jsonfile) info = aaf.read() decoded = jsonn.loads(info) runs1 = [] print "Start selection" for item in decoded: if eval(runMask, {"all": True, "run": int(item)}): runs1.append(item) for runNr, dataset in json: if dataset not in masks: masks.append(dataset) for m in masks: print m result = {} for mask in masks: json = dqm_get_samples(serverUrl, mask, dataType) for epoch in epochs: if epoch in mask: runEpoch = epoch for runNr, dataset in json: if runlistfile == [] and jsonfile == []: if eval(runMask, {"all": True, "run": runNr}): result[runNr] = (serverUrl, runNr, dataset, runEpoch) else: for run_temp in runs1: if int(run_temp) == int(runNr): #print "test1=",run_temp,runNr result[runNr] = (serverUrl, runNr, dataset, runEpoch) if not result: print "*** WARNING: YOUR REQUEST DOESNT MATCH ANY EXISTING DATASET ***" print "-> check your settings in ./cfg/trendPlots.py" print "--> check your runmask!" print "===> maybe choose a different primary dataset" print "--> or check the runrange!" print "*** end of warning *********************************************" return return result