1
# Author: Christopher Tunnell <tunnell@hep.uchicago.edu>
6
from src.GenericWorker import *
9
class CompareCIStoDQ(GenericWorker):
12
c1 = src.MakeCanvas.MakeCanvas()
14
def __init__(self, runType = 'CIS'):
15
self.runType = runType
20
def ProcessStart(self):
21
self.c1.Print("plots/compare_cis_dq.ps[")
23
def ProcessStop(self):
24
self.c1.Print("plots/compare_cis_dq.ps]")
26
print 'Fail CIS Only: ', self.nFailCisOnly
27
print 'Fail DQ Only: ', self.nFailDQOnly
28
print 'Fail Both: ', self.nFailBoth
30
def ProcessRegion(self, region):
31
if 'gain' not in region.GetHash():
39
for event in region.events:
40
if event.runType == 'CIS' and event.data.has_key('isCalibrated'):
41
failcis = not event.data['isCalibrated']
43
# if event.runType == 'CIS' and event.data.has_key('isBad'):
44
# if not event.data['isBad'] and event.data.has_key('scan'):
45
# scan = event.data['scan']
46
if event.runType == 'DQ' and event.data.has_key('isBad'):
47
faildq = event.data['isBad']
49
x,y,z,w = region.GetNumber()
51
if failcis and faildq:
53
#print 'DQandCIS', region.GetHash(), region.GetHash(True)
54
print './PyCisInfoADC.py -s -c 102009', x,y,z,w, '# both'
57
#print 'DQ ', region.GetHash(), region.GetHash(True
58
print './PyCisInfoADC.py -s -c 102009', x,y,z,w, '# dq'
60
self.nFailCisOnly += 1
61
#print ' CIS', region.GetHash(), region.GetHash(True)
62
print './PyCisInfoADC.py -s -c 102009', x,y,z,w, '# cis'
65
x, y, z, w = region.GetNumber()
68
print '%s\t%d\t%d\t%s' % (hs[1], y, z, hs[4]), '\tProbCIS', '\t%s'%region.GetHash(True)
76
pt = ROOT.TPaveText(0.8, 0.8, 1, 1)
84
self.c1.Print('plots/compare_cis_dq.ps')
85
self.c1.Print('blah.C')