1
# Author: Christopher Tunnell <tunnell@hep.uchicago.edu>
5
from src.region import *
6
from src.event import *
9
class GenericWorker(object):
10
"Generic Worker Class"
12
# one day we'll have test-suites
13
# testsuite = unittest.TestSuite()
16
def __init__(self, verbose=False):
18
print "Print class set to verbose"
19
self.verbose = verbose
21
# The set of events are passed to processEvents, then processEvent
22
# on each of the single events. This allows classes to pick if they
23
# want just events, or the whole set. handleEvents mainly does checks
25
def HandleDetector(self, detector):
26
if not isinstance(detector, Region):
27
print 'The following worker was not passed a region', self
30
assert(isinstance(detector, Region))
33
if hasattr(self, 'type'):
38
for region in detector.RegionGenerator(type):
39
self.ProcessRegion(region)
45
# Make sure people at least implement this
46
# def ProcessRegion(self, region):
49
def ProcessStart(self):
52
def ProcessStop(self):