ATLAS Offline Software
Loading...
Searching...
No Matches
DQWebDisplay.py
Go to the documentation of this file.
1#!/usr/bin/env python
2
3# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4
5
6import os
7
8import logging
9logging.basicConfig(level=logging.INFO)
10
11
12CWD = os.getcwd()
13os.chdir(CWD)
14
15
16os.environ['TDAQ_ERS_NO_SIGNAL_HANDLERS'] = '1'
17
18import sys
19sys.argv.append( '-b-' )
20import ROOT
21
24from ROOT import gSystem # noqa: F401
25os.chdir(CWD)
26
27from DataQualityUtils.DQWebDisplayMod import DQWebDisplay
28
30 from DataQualityConfigurations import getmodule
31 print('Getting configuration', modname)
32 return getmodule(modname)
33
34def usage():
35 cmdi = sys.argv[0].rfind("/")
36 cmd = sys.argv[0][cmdi+1:]
37 print("")
38 print("Usage: ", cmd, "<data_file> <config> <processing_version> [run_accumulating [conditions_string]]")
39 print("")
40 print("This is a production utility; use TEST config for development and testing.")
41 print("")
42 print("Processing version is an integer, starting from 1 (not 0)")
43 print("")
44
45if __name__ == "__main__":
46 if len(sys.argv) < 5 or len(sys.argv) > 7:
47 usage()
48 sys.exit(64)
49
50 inputFile = sys.argv[1] # data file
51 runAccumulating = False
52 if len(sys.argv) in (6,7):
53 if sys.argv[4] == "True" or sys.argv[4] == "1":
54 runAccumulating = True
55
56 if len(sys.argv) == 7:
57 print('Setting condition', sys.argv[5])
58 ROOT.gSystem.Load('libDataQualityInterfaces')
59 ROOT.dqi.ConditionsSingleton.getInstance().setCondition(sys.argv[5])
60
61 configModule = ""
62
63 if sys.argv[2] == "TEST":
64 configModule = "TestDisplay"
65 elif sys.argv[2] == "RTT":
66 configModule = "RTTDisplay"
67 elif sys.argv[2] == "TCT":
68 configModule = "TCTDisplay"
69 elif sys.argv[2] == "FDR1":
70 configModule = "fdr08_run1"
71 elif sys.argv[2] == "FDR2" or sys.argv[2] == "FDR2a" or sys.argv[2] == "FDR2b" or sys.argv[2] == "FDR2c":
72 configModule = "fdr08_run2"
73 elif sys.argv[2] == "Cosmics08":
74 configModule = "data08_cos"
75 elif sys.argv[2] == "SingleBeam08":
76 configModule = "data08_1beam"
77 else:
78 configModule = sys.argv[2]
79
80 try:
81 cmod = importConfiguration(configModule)
82 except Exception as e:
83 print("Could not import configuration module \'" + configModule + "\'")
84 sys.exit(1)
85
86 try:
87 config = cmod.dqconfig
88 except Exception as e:
89 print("Configuration object 'dqconfig' not defined in module \'" + configModule + "\'")
90 sys.exit(1)
91
92
93 DQWebDisplay( inputFile, runAccumulating, config )
void print(char *figname, TCanvas *c1)
importConfiguration(modname)