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 print(len(sys.argv))
47 if len(sys.argv) < 5 or len(sys.argv) > 7:
48 usage()
49 sys.exit(64)
50
51 inputFile = sys.argv[1] # data file
52 runAccumulating = False
53 if len(sys.argv) in (6,7):
54 if sys.argv[4] == "True" or sys.argv[4] == "1":
55 runAccumulating = True
56
57 if len(sys.argv) == 7:
58 print('Setting condition', sys.argv[5])
59 ROOT.gSystem.Load('libDataQualityInterfaces')
60 ROOT.dqi.ConditionsSingleton.getInstance().setCondition(sys.argv[5])
61
62 configModule = ""
63
64 if sys.argv[2] == "TEST":
65 configModule = "TestDisplay"
66 elif sys.argv[2] == "RTT":
67 configModule = "RTTDisplay"
68 elif sys.argv[2] == "TCT":
69 configModule = "TCTDisplay"
70 elif sys.argv[2] == "FDR1":
71 configModule = "fdr08_run1"
72 elif sys.argv[2] == "FDR2" or sys.argv[2] == "FDR2a" or sys.argv[2] == "FDR2b" or sys.argv[2] == "FDR2c":
73 configModule = "fdr08_run2"
74 elif sys.argv[2] == "Cosmics08":
75 configModule = "data08_cos"
76 elif sys.argv[2] == "SingleBeam08":
77 configModule = "data08_1beam"
78 else:
79 configModule = sys.argv[2]
80
81 try:
82 cmod = importConfiguration(configModule)
83 except Exception as e:
84 print("Could not import configuration module \'" + configModule + "\'")
85 sys.exit(1)
86
87 try:
88 config = cmod.dqconfig
89 except Exception as e:
90 print("Configuration object 'dqconfig' not defined in module \'" + configModule + "\'")
91 sys.exit(1)
92
93
94 DQWebDisplay( inputFile, runAccumulating, config )
void print(char *figname, TCanvas *c1)
importConfiguration(modname)