WatchdogFx.py
Go to the documentation of this file.
1 # Python std stuff
2 import sys, datetime
3 import os
4 # all of root
5 from ROOT import *
6 # My utilities
7 import canMan, HTMLTools as html
8 # Hist set for early data plots
9 from collections import OrderedDict
10 import psycopg2
11 import subprocess
12 import samweb_client
13 
14 pubContext = os.environ["SRT_PUBLIC_CONTEXT"]
15 rootLogon=os.path.join(pubContext,"Utilities/rootlogon.C")
16 gROOT.Macro(rootLogon)
17 
18 #runHistoryHists = [rawRunsHist, rootRunsHist, recoRunsHist, cafRunsHist, dbRunsHist, onMonRunsHist]
19 #numiRunHistoryHists = [numiRawRunsHist, numiRootRunsHist, numiRecoRunsHist, numiCafRunsHist, dbRunsHist, onMonRunsHist]
20 #calRunHistoryHists = [rawRunsHist, rootRunsHist, pcHitRunsHist, attenProfRunsHist, dbRunsHist, onMonRunsHist]
21 """
22 runHistoryFillStyles = [1001, 1001, 1001, 1001, 1001, 0, 0]
23 runHistoryLineWidths = [1, 1, 1, 1, 1, 2, 2]
24 runHistoryLineStyles = [0, 0, 0, 0, 0, 1, 7]
25 runHistoryColors = [kRed-9, kAzure+1, kOrange+1, kMagenta - 6, kGreen - 7, kBlack, kRed]
26 varOpts = ["][", "][", "][", "][", "][", "", "]["]
27 """
28 
29 emptyFileColor = kGreen-9
30 rawColor = kRed-3
31 rootColor = kOrange+1
32 recoColor = kMagenta - 7
33 pidColor = kAzure+1
34 cafColor = kTeal + 9
35 dbColor = kBlack
36 onMonColor = kGray + 2
37 #onMonColor = kBlue -4
38 
39 runHistoryFillStyles = [1001, 1001, 1001, 1001, 1001, 0, 0]
40 runHistoryLineWidths = [1, 1, 1, 1, 1, 2, 2]
41 runHistoryLineStyles = [0, 1, 0, 0, 0, 1, 7]
42 runHistoryColors = [emptyFileColor, rawColor, rootColor, recoColor, cafColor, dbColor, onMonColor]
43 varOpts = ["][", "][", "][", "][", "][", "", "]["]
44 
45 
46 runHistoryFillStylesWithExtra = [1001, 1001, 1001, 1001, 1001, 1001, 0, 0]
47 runHistoryLineWidthsWithExtra = [1, 1, 1, 1, 1, 0, 2, 2]
48 runHistoryLineStylesWithExtra = [0, 0, 0, 0, 0, 0, 1, 7]
49 runHistoryColorsWithExtra = [emptyFileColor, rawColor, rootColor, recoColor, pidColor, cafColor, dbColor, onMonColor]
50 varOptsWithExtra = ["][", "][", "][", "][", "][", "][", "", "]["]
51 
52 
53 
54 
55 samweb = samweb_client.SAMWebClient(experiment="nova")
56 
57 
58 class Connection:
59  def __init__(self, config, pw):
60  try:
61  self.conn = psycopg2.connect(config + " password=" + pw)
62  except:
63  print "I am unable to connect to the database"
64  exit(0)
65 
66  self.cur = self.conn.cursor()
67 
68 
69 #Establish a connection to the DB.
70 pw = open(os.environ['NOVADBPWDFILE'], 'r').readlines()[0].strip()
71 
72 dbPort = OrderedDict()
73 dbPort["fardet"] = " 5436 "
74 dbPort["neardet"] = " 5434 "
75 
76 dbConfig = OrderedDict()
77 dbConfig["fardet"] = "dbname=nova_prod host=ifdbrep.fnal.gov user=nova_reader port=5436"
78 dbConfig["neardet"] = "dbname=nova_prod host=ifdbrep.fnal.gov user=nova_reader port=5434"
79 
80 db = OrderedDict()
81 for det, config in dbConfig.items():
82  db[det] = Connection(config, pw)
83 
84 
85 
86 onMonDirs = OrderedDict()
87 onMonDirs["fardet"] = "/nova/data/nearline-OnMon/FarDet/S16-10-26/"
88 onMonDirs["neardet"] = "/nova/data/nearline-OnMon/NearDet/S16-10-26/"
89 
90 onMonTriggerDirs = OrderedDict()
91 onMonTriggerDirs["fardet"] = "t02-t00/"
92 onMonTriggerDirs["neardet"] = "DDActivity1/"
93 
94 
95 def fetchTable(cur, query):
96  cur.execute(query)
97  return cur.fetchall()
98 
99 
100 def isNumber(s):
101  try:
102  float(s)
103  return True
104  except ValueError:
105  return False
106 
107 
108 
109 
110 
111 def getSAMRunsHist(name, maxRunNum, minRunNum, dataSet):
112 
113  hist = TH1F(name, ";Run Number;Number of Subruns", maxRunNum - minRunNum + 1, minRunNum, maxRunNum + 1)
114 
115 
116  command = dataSet + " " + " AND Online.RunNumber >= " + str(minRunNum) + " AND Online.RunNumber <= " + str(maxRunNum)
117  print "about to make samweb query:", command
118  files = samweb.listFiles(command)
119  print "done"
120  for file in files:
121  if len(file) <= 0:
122  continue
123  try:
124  begRun = file.find("_r")
125  endRun = file.find("_", begRun + 1)
126  run = int(file[begRun+2:endRun])
127  hist.Fill(run)
128  except:
129  print "oops : ", file
130  print "number of files returned: ", len(files)
131  return hist
132 
133 
134 def getCompletedRunsHist(path, name, maxRunNum, minRunNum, testStr="", skipStr=None,
135  additionalDir="", checkKeys=False, printRunNum=False, lineStyle=1, lineColor=kBlack):
136 
137  hist = TH1F(name, ";Run Number;Number of Subruns", maxRunNum - minRunNum + 1 , minRunNum, maxRunNum + 1)
138  hist.SetLineStyle(lineStyle)
139  hist.SetLineColor(lineColor)
140 
141  multiRunDirs = sorted(os.listdir(path))
142  # Loop to get info on recent runs
143  for multiRunDir in multiRunDirs:
144  if not isNumber(multiRunDir):
145  continue
146  multiRunPath = path + multiRunDir + "/"
147  if not os.path.isdir(multiRunPath):
148  continue
149  runDirs = sorted(os.listdir(multiRunPath))
150  for runDir in runDirs:
151  try:
152  runNum = float(runDir)
153  except:
154  print "Could not parse runDir", runDir
155  continue
156  if runNum >= minRunNum and runNum <= maxRunNum:
157  runPath = multiRunPath + runDir + "/" + additionalDir
158  if not os.path.isdir(runPath):
159  continue
160  fileNames = sorted(os.listdir(runPath))
161  for fileName in fileNames:
162  if checkKeys:
163  filePath = runPath + fileName
164  rootFile = TFile(filePath)
165  if rootFile.IsZombie() or rootFile.TestBit(TFile.kRecovered):
166  continue
167  if not testStr in fileName:
168  continue
169  if skipStr:
170  if skipStr in fileName:
171  continue
172  hist.Fill(runNum)
173  if printRunNum:
174  print runNum
175  return hist
176 
177 def getMaxMinRunNumDB(detector="fardet", maxTime="CURRENT_TIMESTAMP", interval=7):
178  # Get maximum run
179  maxRunNumDB = fetchTable(db[detector].cur, "select max(run) from "+detector+".runs")[0][0] #This returns a two by two table, get the 0,0 entry
180  #Get run from 7 days ago
181  #cur.execute("select min(run) from fardet.runs where tstart >= (CURRENT_TIMESTAMP - interval '7' day);")
182 
183  minRunNumDB = fetchTable(db[detector].cur, "select min(run) from "+detector+".runs where tstart >= ("+maxTime+" - interval '"+str(interval)+"' day);")[0][0] #This returns a two by two table, get the 0,0 entry
184  return (maxRunNumDB, minRunNumDB)
185 
186 def getDBRunsHist(minRun, maxRun,table="fardet", lineStyle=1, lineColor=dbColor):
187  dbRunData = fetchTable(db[table].cur, "select run, nsubruns from "+table+".runs where run >= "+str(minRun)+" and run <=" + str(maxRun) + " order by run asc;")
188  dbRunsHist = TH1F("Number of Subruns in DB", ";Run Number;Number of Subruns", maxRun - minRun+1, minRun, maxRun+1)
189  dbRunsHist.SetLineStyle(lineStyle)
190  dbRunsHist.SetLineColor(lineColor)
191  for line in dbRunData:
192  run = line[0]
193  subrun = line[1]
194  if run and subrun: dbRunsHist.Fill(float(run), float(subrun))
195  return dbRunsHist
196 
197 
198 
199 
200 def countFiles(dir, testStrs=[]):
201  files = os.listdir(dir)
202  count = 0
203  for file in files:
204  failed = False
205  for str in testStrs:
206  if not str in file:
207  failed = True
208  break
209  if not failed:
210  count += 1
211  return count
212 
213 
214 class Tier:
215  def __init__(self, name, query, color=kBlue, fillStyle=1001, lineWidth=0, lineStyle=0):
216  self.name = name
217  self.query = query
218  self.color = color
219  self.fillStyle = fillStyle
220  self.lineWidth = lineWidth
221  self.lineStyle = lineStyle
222  self.cache = dict()
223 
224  def getHist(self,maxRunNum, minRunNum):
225  histId = str(maxRunNum) + "-" + str(minRunNum)
226  if histId in self.cache.keys():
227  return self.cache[histId]
228  hist = getSAMRunsHist(self.name, maxRunNum, minRunNum, self.query)
229  hist.SetFillColor(self.color)
230  hist.SetLineColor(self.color)
231  hist.SetFillStyle(self.fillStyle)
232  hist.SetLineWidth(self.lineWidth)
233  hist.SetLineStyle(self.lineStyle)
234  for axis in [hist.GetXaxis(), hist.GetYaxis()]:
235  axis.SetNoExponent()
236  self.cache[histId] = hist
237  return hist
238 
239 
240 
241 
242 
243 class Path:
244  def __init__(self, name, title, legWidth=0.4, legHeight=0.3, padFactor=2):
245  # Things about this path histogram set
246  self.name = name
247  self.title = title
248  self.legWidth = legWidth
249  self.legHeight = legHeight
250  self.padFactor = padFactor
251 
252  # List of tier objects
253  self.tiers = []
254 
255 
256  # Add tier to path
257  def addTier(self, tier):
258  self.tiers.append(tier)
259 
260  # Get all of the histograms for this path
261  def getHists(self, maxRunNum, minRunNum, dbRunsHist, onMonRunsHist):
262  hists = []
263  for tier in self.tiers:
264  hists.append(tier.getHist(maxRunNum, minRunNum))
265  hists.append(dbRunsHist)
266 # hists.append(onMonRunsHist)
267  return hists
268  def getPlotCanvas(self, maxRunNum, minRunNum, dbRunsHist, onMonRunsHist):
269  hists = self.getHists(maxRunNum, minRunNum, dbRunsHist, onMonRunsHist)
270  # Hardcoding legend position. autoPlaceLegend() was putting the legend on top of the data for ND.
271  can = canMan.drawOverlay(hists, varOpts=varOpts, name=self.name, legPos = [0.15,0.55], legWidth=0.4, legHeight=0.3, padFactor=2, preserveStyle=True, yOffset=0.9)
272  return (can,hists)
273 
274  # Generator for tier names
275  def tierNames(self):
276  for tier in self.tiers:
277  yield tier.name
278 
279  # Generator for queries
280  def queries(self):
281  for tier in self.tiers:
282  yield tier.query
283 
284  # Generator for colors
285  def colors(self):
286  for tier in self.tiers:
287  yield tier.color
288 
289  # Generator for fillStyles
290  def fillStyles(self):
291  for tier in self.tiers:
292  yield tier.fillStyle
293 
294  # Generator for lineWidths
295  def lineWidths(self):
296  for tier in self.tiers:
297  yield tier.lineWidths
298 
299  # Generator for lineStyles
300  def lineStyles(self):
301  for tier in self.tiers:
302  yield tier.lineStyle
303 
304 
305 
306 paths = OrderedDict()
307 
308 paths["fardet_numi"] = Path("fardet_numi", "FD NuMI Keep-up")
309 
310 paths["fardet_numi"].addTier(Tier("NuMI Empty Raw Files",
311  'Online.Detector="fardet" AND data_tier="raw" AND Online.Stream=0',
312  color=emptyFileColor))
313 paths["fardet_numi"].addTier(Tier("NuMI Raw Files",
314  'Online.Detector="fardet" AND data_tier="raw" AND Online.Stream=0 AND Online.TotalEvents > 0',
315  color=rawColor))
316 paths["fardet_numi"].addTier(Tier("NuMI ROOT Files",
317  'Online.Detector="fardet" AND data_tier="artdaq" AND Online.Stream=0 AND (daq2rawdigit.base_release S15-03-11 OR daq2rawdigit.base_release S16-10-07 OR daq2rawdigit.base_release S16-11-02 OR daq2rawdigit.base_release S17-02-21 OR daq2rawdigit.base_release S17-10-30)',
318  color=rootColor))
319 #-------------------------------------------------------
320 """
321 paths["fardet_numi"].addTier(Tier("NuMI Reco Files",
322  "data_tier reco and reconstructed.base_release S14-09-29 and online.detector fardet and online.stream 0 and nova.special like %keepup%",
323  recoColor))
324 paths["fardet_numi"].addTier(Tier("NuMI CAFs",
325  "data_tier caf and reconstructed.base_release S14-09-29 and online.detector fardet and online.stream 0 and nova.special like %keepup%",
326  color=cafColor))
327 
328 """
329 #-------------------------------------------------------
330 paths["fardet_cosmic"] = Path("fardet_cosmic", "FD Cosmic Triggers")
331 
332 fdCosmicRawEmpty = Tier("Cosmic Empty Raw Files",
333  'Online.Detector="fardet" AND data_tier="raw" AND Online.Stream=2',
334  color=emptyFileColor )
335 paths["fardet_cosmic"].addTier(fdCosmicRawEmpty)
336 
337 fdCosmicRaw = Tier("Cosmic Raw Files",
338  'Online.Detector="fardet" AND data_tier="raw" AND Online.Stream=2 AND Online.TotalEvents > 0',
339  color=rawColor )
340 paths["fardet_cosmic"].addTier(fdCosmicRaw)
341 fdCosmicRoot = Tier("Cosmic ROOT Files",
342  'Online.Detector="fardet" AND data_tier="artdaq" AND Online.Stream=2 AND (daq2rawdigit.base_release S16-10-07 OR daq2rawdigit.base_release S16-11-02 OR daq2rawdigit.base_release S17-02-21 OR daq2rawdigit.base_release S17-10-30)',
343  color=rootColor )
344 paths["fardet_cosmic"].addTier(fdCosmicRoot)
345 #-------------------------------------------------------
346 
347 """
348 paths["fardet_cosmic"].addTier(Tier("Cosmic Reco Files",
349  'Online.Detector="fardet" AND data_tier="reco" AND Online.Stream=2 AND reconstructed.base_release FA14-10-28',
350  color=recoColor ))
351 
352 paths["fardet_cosmic"].addTier(Tier("Cosmic PID Files",
353  'Online.Detector="fardet" AND data_tier="pid" AND Online.Stream=2 AND reconstructed.base_release FA14-10-28 AND pid.base_release FA14-10-28',
354  color=pidColor ))
355 
356 paths["fardet_cosmic"].addTier(Tier("Cosmic CAFs",
357  'Online.Detector="fardet" AND data_tier="caf" AND Online.Stream=2 AND reconstructed.base_release FA14-10-28 AND pid.base_release FA14-10-28 AND caf.base_release FA14-10-28',
358  color=cafColor ))
359 
360 """
361 #-------------------------------------------------------
362 
363 """
364 paths["fardet_cal"] = Path("fardet_cal", "FD Cosmic Triggers -- Calibration Path")
365 
366 paths["fardet_cal"].addTier(fdCosmicRawEmpty)
367 paths["fardet_cal"].addTier(fdCosmicRaw)
368 paths["fardet_cal"].addTier(fdCosmicRoot)
369 
370 paths["fardet_cal"].addTier(Tier("PCHit Files",
371  'Online.Detector="fardet" AND data_tier="pclist" AND Online.Stream=2 AND (calibration.base_release S14-03-24 OR calibration.base_release S14-08-09)',
372  color=recoColor))
373 paths["fardet_cal"].addTier(Tier("AttenProf Files",
374  'Online.Detector="fardet" AND data_tier="attenprof" AND Online.Stream=2',
375  color=cafColor))
376 """
377 #-------------------------------------------------------
378 
379 paths["neardet_numi"] = Path("neardet_numi", "ND NuMI Triggers")
380 
381 paths["neardet_numi"].addTier(Tier("NuMI Empty Raw Files",
382  'Online.Detector="neardet" AND data_tier="raw" AND (Online.Stream=0 or file_name %t00%)',
383  color=emptyFileColor))
384 paths["neardet_numi"].addTier(Tier("NuMI Raw Files",
385  'Online.Detector="neardet" AND data_tier="raw" AND (Online.Stream=0 or file_name %t00%) AND Online.TotalEvents > 0',
386  color=rawColor))
387 paths["neardet_numi"].addTier(Tier("NuMI ROOT Files",
388  'Online.Detector="neardet" AND data_tier="artdaq" AND (DAQ2RawDigit.base_release FA14-10-03 OR DAQ2RawDigit.base_release S15-08-12 OR DAQ2RawDigit.base_release S16-02-02 OR daq2rawdigit.base_release S16-10-07 OR daq2rawdigit.base_release S16-11-02 OR daq2rawdigit.base_release S17-02-21 OR daq2rawdigit.base_release S17-10-30) AND Online.Stream=0',
389  color=rootColor))
390 #-------------------------------------------------------
391 """
392 paths["neardet_numi"].addTier(Tier("NuMI Reco Files",
393  "data_tier reco and reconstructed.base_release S14-09-29 and online.detector neardet and online.stream 0 and nova.special like %keepup%",
394  color=recoColor))
395 
396 paths["neardet_numi"].addTier(Tier("NuMI CAFs",
397  "data_tier caf and reconstructed.base_release S14-09-29 and online.detector neardet and online.stream 0 and nova.special like %keepup%",
398  color=cafColor))
399 
400 """
401 #-------------------------------------------------------
402 paths["neardet_cosmic"] = Path("neardet_cosmic", "ND Cosmic Triggers")
403 
404 ndCosmicRawEmpty = Tier("Cosmic Empty Raw Files",
405  'Online.Detector="neardet" AND data_tier="raw" AND Online.Stream=2',
406  color=emptyFileColor )
407 paths["neardet_cosmic"].addTier(ndCosmicRawEmpty)
408 
409 ndCosmicRaw = Tier("Cosmic Raw Files",
410  'Online.Detector="neardet" AND data_tier="raw" AND Online.Stream=2 AND Online.TotalEvents > 0',
411  color=rawColor )
412 paths["neardet_cosmic"].addTier(ndCosmicRaw)
413 ndCosmicRoot = Tier("Cosmic ROOT Files",
414  'Online.Detector="neardet" AND data_tier="artdaq" AND (DAQ2RawDigit.base_release FA14-10-03 OR DAQ2RawDigit.base_release S15-08-12 OR DAQ2RawDigit.base_release S16-02-02 OR daq2rawdigit.base_release S16-10-07 OR daq2rawdigit.base_release S16-11-02 OR daq2rawdigit.base_release S17-02-21 OR daq2rawdigit.base_release S17-10-30) AND Online.Stream=2',
415  color=rootColor )
416 paths["neardet_cosmic"].addTier(ndCosmicRoot)
417 #-------------------------------------------------------
418 
419 """
420 paths["neardet_cosmic"].addTier(Tier("Cosmic Reco Files",
421  'Online.Detector="neardet" AND data_tier="reco" AND Online.Stream=2',
422  color=recoColor ))
423 
424 paths["neardet_cosmic"].addTier(Tier("Cosmic PID Files",
425  'Online.Detector="neardet" AND data_tier="pid" AND Online.Stream=2',
426  color=pidColor ))
427 
428 paths["neardet_cosmic"].addTier(Tier("Cosmic CAFs",
429  'Online.Detector="neardet" AND data_tier="caf" AND Online.Stream=2',
430  color=cafColor ))
431 
432 """
433 #-------------------------------------------------------
434 
435 """
436 paths["neardet_cal"] = Path("neardet_cal", "ND Cosmic Triggers -- Calibration Path")
437 
438 paths["neardet_cal"].addTier(ndCosmicRawEmpty)
439 paths["neardet_cal"].addTier(ndCosmicRaw)
440 paths["neardet_cal"].addTier(ndCosmicRoot)
441 
442 paths["neardet_cal"].addTier(Tier("PCHit Files",
443  'Online.Detector="neardet" AND data_tier="pclist" AND Online.Stream=2 AND (calibration.base_release S14-03-24 OR calibration.base_release S14-08-09)',
444  color=recoColor))
445 paths["neardet_cal"].addTier(Tier("AttenProf Files",
446  'Online.Detector="neardet" AND data_tier="attenprof" AND Online.Stream=2',
447  color=cafColor))
448 """
449 #-------------------------------------------------------
450 
451 """
452 paths["neardet_ddcalmu"] = Path("neardet_ddcalmu", "ND DDCalMu Triggers -- Calibration Path")
453 
454 paths["neardet_ddcalmu"].addTier(Tier("DDCalMu Empty Raw Files",
455  'Online.Detector="neardet" AND data_tier="raw" AND (data_stream ddcalmu or file_name %DDcalmu%)',
456  color=emptyFileColor ))
457 paths["neardet_ddcalmu"].addTier(Tier("DDCalMu Raw Files",
458  'Online.Detector="neardet" AND data_tier="raw" AND (data_stream ddcalmu or file_name %DDcalmu%) and online.TotalEvents > 0',
459  color=rawColor ))
460 paths["neardet_ddcalmu"].addTier(Tier("DDCalMu ROOT Files",
461  'Online.Detector="neardet" AND data_tier="artdaq" AND (DAQ2RawDigit.base_release FA14-10-03 OR DAQ2RawDigit.base_release S15-08-12 OR DAQ2RawDigit.base_release S16-02-02 OR daq2rawdigit.base_release S16-10-07 OR daq2rawdigit.base_release S16-11-02 OR daq2rawdigit.base_release S17-02-21 OR daq2rawdigit.base_release S17-10-30) AND data_stream ddcalmu',
462  color=rootColor ))
463 
464 paths["neardet_ddcalmu"].addTier(Tier("PCHit Files",
465  'Online.Detector="neardet" AND data_tier="pclist" AND data_stream ddcalmu',
466  color=recoColor))
467 paths["neardet_ddcalmu"].addTier(Tier("AttenProf Files",
468  'Online.Detector="neardet" AND data_tier="attenprof" AND data_stream ddcalmu',
469  color=cafColor))
470 """
471 #-------------------------------------------------------
472 """
473 paths["neardet_ddactivity"] = Path("neardet_ddactivity", "ND DDActivity Triggers -- Calibration Path")
474 
475 paths["neardet_ddactivity"].addTier(Tier("DDActivity Empty Raw Files",
476  'Online.Detector="neardet" AND data_tier="raw" AND (data_stream ddactivity1 OR file_name %DDActivity1%)',
477  color=emptyFileColor ))
478 paths["neardet_ddactivity"].addTier(Tier("DDActivity Raw Files",
479  'Online.Detector="neardet" AND data_tier="raw" AND (data_stream ddactivity1 OR file_name %DDActivity1%) and online.TotalEvents > 0',
480  color=rawColor ))
481 paths["neardet_ddactivity"].addTier(Tier("DDActivity ROOT Files",
482  'Online.Detector="neardet" AND data_tier="artdaq" AND (DAQ2RawDigit.base_release FA14-10-03 OR DAQ2RawDigit.base_release S15-08-12 OR DAQ2RawDigit.base_release S16-02-02 OR daq2rawdigit.base_release S16-10-07 OR daq2rawdigit.base_release S16-11-02 OR daq2rawdigit.base_release S17-02-21 OR daq2rawdigit.base_release S17-10-30) AND data_stream ddactivity1',
483  color=rootColor ))
484 
485 paths["neardet_ddactivity"].addTier(Tier("DDActivity PCHit Files",
486  'Online.Detector="neardet" AND data_tier="pclist" AND data_stream ddactivity1',
487  color=recoColor))
488 paths["neardet_ddactivity"].addTier(Tier("DDActivity AttenProf Files",
489  'Online.Detector="neardet" AND data_tier="attenprof" AND data_stream ddactivity1',
490  color=cafColor))
491 """
492 
def getCompletedRunsHist(path, name, maxRunNum, minRunNum, testStr="", skipStr=None, additionalDir="", checkKeys=False, printRunNum=False, lineStyle=1, lineColor=kBlack)
Definition: WatchdogFx.py:135
def countFiles(dir, testStrs=[])
Definition: WatchdogFx.py:200
def __init__(self, name, title, legWidth=0.4, legHeight=0.3, padFactor=2)
Definition: WatchdogFx.py:244
def tierNames(self)
Definition: WatchdogFx.py:275
def fillStyles(self)
Definition: WatchdogFx.py:290
def getHist(self, maxRunNum, minRunNum)
Definition: WatchdogFx.py:224
def getMaxMinRunNumDB(detector="fardet", maxTime="CURRENT_TIMESTAMP", interval=7)
Definition: WatchdogFx.py:177
def isNumber(s)
Definition: WatchdogFx.py:100
def colors(self)
Definition: WatchdogFx.py:285
def getDBRunsHist(minRun, maxRun, table="fardet", lineStyle=1, lineColor=dbColor)
Definition: WatchdogFx.py:186
def queries(self)
Definition: WatchdogFx.py:280
def addTier(self, tier)
Definition: WatchdogFx.py:257
def getPlotCanvas(self, maxRunNum, minRunNum, dbRunsHist, onMonRunsHist)
Definition: WatchdogFx.py:268
procfile open("FD_BRL_v0.txt")
exit(0)
def getHists(self, maxRunNum, minRunNum, dbRunsHist, onMonRunsHist)
Definition: WatchdogFx.py:261
def __init__(self, config, pw)
Definition: WatchdogFx.py:59
def fetchTable(cur, query)
Definition: WatchdogFx.py:95
def lineWidths(self)
Definition: WatchdogFx.py:295
def lineStyles(self)
Definition: WatchdogFx.py:300
def drawOverlay(listOfHists, name="", opt="hist", varOpts=[""], colors=[kRed, kBlue, kGreen, kMagenta, kOrange, kBlack, kViolet, lineStyles=[1], legEntries=[], logY=False, axisMin=0, legPos="right", legTextSize=0, inputCan=None, legHeight=0.15, legWidth=0.2, supressZero=False, padFactor=1.1, lineWidths=[gStyle.GetHistLineWidth()], fillStyles=[0], preserveStyle=False, yOffset=1.05)
Definition: canMan.py:64
def __init__(self, name, query, color=kBlue, fillStyle=1001, lineWidth=0, lineStyle=0)
Definition: WatchdogFx.py:215
def getSAMRunsHist(name, maxRunNum, minRunNum, dataSet)
Definition: WatchdogFx.py:111