ATLAS Offline Software
Loading...
Searching...
No Matches
cmd-l1calo-dq-web.py
Go to the documentation of this file.
1#!/usr/bin/env python
2# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
4if __name__=="__main__":
5
6 import argparse
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")
13
14 args = parser.parse_args()
15
16 import glob
17 files = glob.glob(f"/eos/atlas/atlastier0/rucio/*/{args.stream}/*{args.runNumber}/*merge.HIST.{'f' if args.bulk else 'x'}*{args.tag}/*")
18 if len(files)==0:
19 print("ERROR: No HIST file found for run")
20 exit(1)
21 elif len(files)!=1:
22 print("ERROR: Multiple HIST files found:",*files)
23 print("Try specifying a particular file via the --tag option")
24 exit(1)
25
26 import random
27 r = random.randrange(100000,999999)
28 cmdStr = f"DQWebDisplay.py {files[0]} TestDisplay \"{r}\""
29
30 import subprocess
31 print("Executing:",cmdStr, "... Please be patient ...")
32 process = subprocess.Popen(cmdStr, shell=True)
33 process.wait()
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)
37 else:
38 print("ERROR: WebDisplay generation failed")
39 exit(1)
void print(char *figname, TCanvas *c1)