4 if __name__==
"__main__":
7 parser = argparse.ArgumentParser(prog=
"l1calo-dq-web",description=
"Generate a WebDisplay website for a run, using the local DataQuality configuration",
8 formatter_class=argparse.ArgumentDefaultsHelpFormatter)
9 parser.add_argument(
"runNumber",help=
"run number to create website for")
10 parser.add_argument(
"stream",default=
"express_express",nargs=
"?",help=
"stream to create for")
11 parser.add_argument(
"--bulk",action=
'store_true',help=
"Use bulk processing")
12 parser.add_argument(
"--tag",default=
"*",help=
"Optional, specify a HIST file tag")
14 args = parser.parse_args()
17 files = glob.glob(f
"/eos/atlas/atlastier0/rucio/*/{args.stream}/*{args.runNumber}/*merge.HIST.{'f' if args.bulk else 'x'}*{args.tag}/*")
19 print(
"ERROR: No HIST file found for run")
22 print(
"ERROR: Multiple HIST files found:",*files)
23 print(
"Try specifying a particular file via the --tag option")
27 r = random.randrange(100000,999999)
28 cmdStr = f
"DQWebDisplay.py {files[0]} TestDisplay \"{r}\""
31 print(
"Executing:",cmdStr,
"... Please be patient ...")
32 process = subprocess.Popen(cmdStr, shell=
True)
34 if process.returncode==0:
35 urlStr = f
"https://atlasdqm.cern.ch/webdisplay/test/{r}/{args.stream}/run_{args.runNumber}/run/"
36 print(
"WebDisplay successfully generated:",urlStr)
38 print(
"ERROR: WebDisplay generation failed")