Package python :: Module event
[hide private]
[frames] | no frames]

Source Code for Module python.event

 1  from event_time import EventTime 
 2  import sys 
 3   
4 -class Event:
5 ''' 6 The Event class. This is a simple container 7 for the event information and has the following 8 member variables. 9 10 runID - The Run ID 11 year - The year the event triggered 12 startTime - The number tenths of nanoseconds since the beginning of the year. 13 eventLength - The length of the event in units of tenths of nanoseconds 14 triggers - A list of triggers in the event. This is a list of tuples where 15 the first entry of the tuple is the time of the trigger with respect 16 to the earliest trigger in the event. 17 hits - A list of hits in the event. A hit is simply a 5-tuple where the elements 18 0-4 are charge, time, x, y, and z respectively. 19 '''
20 - def __init__(self):
21 # int 22 self.runID = None 23 # int 24 self.year = None 25 # long 26 self.startTime = None 27 # float 28 self.eventLength = None 29 # list, tuple, float, string 30 self.triggers = list() 31 # list, tuple, float, float, float, float, float 32 self.hits = list()
33
34 - def event_time(self):
35 return EventTime(self.year, self.startTime)
36
37 - def __str__(self):
38 string = "RunID : " + str(self.runID) + '\n' 39 string += str("Start Time : %s" % self.event_time() ) + '\n' 40 string += str("Event Length : %f microsec" % self.eventLength) + '\n' 41 string += "Triggers : " + str(self.triggers) + '\n' 42 string += "Hits : " + str(self.hits) + '\n' 43 return string
44