ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/dhidas/OSUAnalysis/Tools/scripts/getTriggerReport.py
Revision: 1.1.1.1 (vendor branch)
Committed: Thu Dec 1 16:28:48 2011 UTC (13 years, 5 months ago) by dhidas
Content type: text/x-python
Branch: dhidas, MAIN
CVS Tags: START, HEAD
Changes since 1.1: +0 -0 lines
Log Message:
osu copy modified

File Contents

# Content
1 from __future__ import division
2 import sys
3
4 def triggerInfo(trigger, logString):
5 logString = logString.replace('\n', '')
6 #remove empty entries
7 entries = [token for token in logString.split(' ') if not token == '']
8 info = {}
9 info['name'] = entries[-1]
10 info['eventsTotal'] = entries[3]
11 info['eventsPassed'] = entries[4]
12 info['eventsFailed'] = entries[5]
13 info['efficiency'] = entries[4] / entries[3]
14 return info
15
16 if __name__ == "__main__":
17 args = sys.argv
18 if len(args) == 3:
19 file = open(args[1])
20 trigger = args[2]
21 for line in file.readlines():
22 if trigger in line:
23 info = triggerInfo(trigger, line)
24 print info
25 break;
26 file.close()
27