~vpec/maus/tof_calib_read

« back to all changes in this revision

Viewing changes to workers/CIS/.svn/text-base/EdgeCompare.py.svn-base

  • Committer: tunnell
  • Date: 2010-09-20 10:52:02 UTC
  • Revision ID: tunnell@itchy-20100920105202-ce4w9jm59zvgnsxq
moving stuff from tucs

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Author: Christopher Tunnell <tunnell@hep.uchicago.edu>
 
2
#
 
3
# March 04, 2009
 
4
#
 
5
 
 
6
from src.GenericWorker import *
 
7
 
 
8
class EdgeCompare(GenericWorker):
 
9
    'Edge compare'
 
10
 
 
11
    def ProcessStart(self):
 
12
        self.n = 0
 
13
 
 
14
    def ProcessStop(self):
 
15
        print 'edge samples', self.n
 
16
 
 
17
    def ProcessRegion(self, region):
 
18
        newevents = set()
 
19
        for event in region.GetEvents():
 
20
            if event.runType == 'CIS' and\
 
21
               event.data.has_key('problems') and\
 
22
               event.data['problems'].has_key('Edge Sample') and\
 
23
               event.data['problems']['Edge Sample']:
 
24
                event.data['moreInfo']=True
 
25
                self.n+=1
 
26
                
 
27
            else:
 
28
                event.data['moreInfo']=False
 
29
            newevents.add(event)
 
30
        region.SetEvents(newevents)
 
31
        return
 
32