61 def config(self, options, readoracle, loglevel, html, origQuery, datapath, parsedstring):
62
63 self.cmdlineOptions = options
64 self.origQuery = origQuery
65 QC.datapath = datapath
66 self.parsedstring = parsedstring
67 self.maxNumOfRuns = -1
68 self.makeSummary = 'summary' in options.show
69 self.makeDQSummary = 'dqsummary' in options.show
70 self.makeDQPlots = 'dqplots' in options.show
71 self.makeDQeff = 'dqeff' in options.show
72 self.xmlFileName = 'MyLBCollection.xml'
73 self.xmlFileLabel = 'MyLBCollection'
74 self.querystart = time()
75 self.selectionOutput = []
76
77
78 if QC.datapath=='':
79 QC.datapath='.'
80 else:
81 try:
82 os.makedirs(QC.datapath, exist_ok = True)
83 print(
"Using output directory: %s" % QC.datapath)
84 except (PermissionError, FileExistsError) as err:
85 print(
"Could not create data output directory: %s" % QC.datapath)
86 print(
"Reason: %s" % err)
87 print(
"Will write to local directory")
88 QC.datapath = "."
89
90
91 if not self.cmdlineOptions.show:
92 self.cmdlineOptions.show = ['run','time']
93
94 if self.cmdlineOptions.xmlfile is not None:
95
96 str1,str2 = self.cmdlineOptions.xmlfile.strip().
split(
':',1)
97 if '.xml' in str1:
98 self.xmlFileName = str1
99 if str2 != '':
100 self.xmlFileLabel = str2
101 elif '.xml' in str2:
102 self.xmlFileName = str2
103 if str1 != '':
104 self.xmlFileLabel = str1
105
106 if self.cmdlineOptions.html:
107 self.html = self.cmdlineOptions.html
108 else:
109 if html=="AUTO":
110 self.html = runsOnServer()
111 elif html=="YES":
112 self.html = True
113 elif html=="NO":
114 self.html = False
115 else:
116 raise RuntimeError ("Unknown argument for option 'html': %s" % html)
117 Run.writehtml = self.html
118
119 if self.cmdlineOptions.prodgrl is not None :
120 self.prodgrl = self.cmdlineOptions.prodgrl
121 elif self.cmdlineOptions.xmlfile is not None :
122 self.prodgrl = True
123 else:
124 self.prodgrl = not runsOnServer()
125
126 if self.cmdlineOptions.dictroot is not None :
127 self.dictroot = self.cmdlineOptions.dictroot
128 else:
129 self.dictroot = not runsOnServer()
130
131
132 if self.cmdlineOptions.database and self.cmdlineOptions.database.upper()=='MC':
133 Selector.setCondDBMC()
134
135 if self.cmdlineOptions.condtag:
136 Selector.condtag = self.cmdlineOptions.condtag
137
138 QC.localtime = (self.cmdlineOptions.utc is None)
139 QC.settimezone()
140
141
142
143 if self.html:
144 nemo_dir = '/afs/cern.ch/user/a/atlcond/scratch0/nemo/prod/web/'
145 try:
146 f = open( nemo_dir + 'calibruns.txt' )
147 for line in f:
148 try:
149 if line:
150 Run.PromptCalibRuns.append( int(line.strip()) )
151 except ValueError:
152 pass
153
154
155 fname = os.listdir( nemo_dir + 'tasks' )
156 i = 0
157 for taskname in fname:
158 m = re.match(r'.*(task_(\d+)_\d+.txt)',taskname)
159 if m:
160 i+=1
161 fname, runnr = m.groups()
162 Run.NemoTasks[int(runnr)] = fname
163 except IOError as err:
164 print (err)
165 print ("Because of this I can't mark runs that are currently in the calibration loop")
166
167
168 if 'cosmics' in options.show:
169 self.dqsumgrl = "PHYS_Cosmics_AllGood"
170 elif 'heavyions' in options.show:
171 self.dqsumgrl = "PHYS_HeavyIonP_All_Good"
172 elif self.cmdlineOptions.dqsumgrl:
173 self.dqsumgrl = self.cmdlineOptions.dqsumgrl
174 else:
175 self.dqsumgrl = 'PHYS_StandardGRL_All_Good_25ns'
176
177
178 if self.cmdlineOptions.defecttag and self.cmdlineOptions.logictag:
179 self.dbbtag = (self.cmdlineOptions.defecttag, self.cmdlineOptions.logictag)
180 else:
181 self.dbbtag = ("HEAD", "HEAD")
182
183
void print(char *figname, TCanvas *c1)
std::vector< std::string > split(const std::string &s, const std::string &t=":")