1 from event_time import EventTime
2 import sys
3
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 '''
21
22 self.runID = None
23
24 self.year = None
25
26 self.startTime = None
27
28 self.eventLength = None
29
30 self.triggers = list()
31
32 self.hits = list()
33
35 return EventTime(self.year, self.startTime)
36
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