test_ParserArtEvents.py
Go to the documentation of this file.
1 # Test functions for ParserArtEvents
2 print "test : --- Testing ParserArtEvents"
3 import ParserArtEvents
4 ###########################
5 # parseSTDOUT
6 print "\ntest : --- parseSTDOUT from a log file"
7 input_file = "output/FD_data_cosmics_pchits.out"
8 usage = ParserArtEvents.parseSTDOUT(input_file, verbose=True)
9 print usage
10 print "test : ---"
11 ###########################
12 # parseSTDOUT
13 print "\ntest : --- parseSTDOUT from a pickle"
14 input_file = "output/FD_data_cosmics_pchits.pkl"
15 import cPickle
16 chain = cPickle.load(open(input_file, "rb"))
17 tier = chain.GetTier("pchits")
18 log = tier.log
19 lines = tier.log.split("\n")
20 usage = ParserArtEvents.parseLines(lines, verbose=True)
21 events = usage.events
22 print usage
23 print "test : found %i events"%len(events.keys())
24 print "test : ---"
def parseSTDOUT(file_name, verbose=True)
Parse output file.
procfile open("FD_BRL_v0.txt")
def parseLines(lines, verbose=False)
Parse output file.