00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 def readFile(filename, maxRecords = 10):
00011
00012 import ROOT
00013 ROOT.gSystem.Load("libCintex")
00014 ROOT.Cintex.Enable()
00015 ROOT.gSystem.Load("libRawDataDict")
00016
00017
00018 rr = ROOT.DayaBay.RawDataReader()
00019 ok = rr.open( filename );
00020 if not ok:
00021 print "Failed to open: ", filename;
00022 return
00023
00024
00025 currentRecord = 0;
00026 while True:
00027 record = rr.nextRecord()
00028 if not record: break
00029 record.dump( ROOT.cout )
00030 currentRecord += 1
00031 if currentRecord > maxRecords: break
00032 return
00033
00034 if __name__ == "__main__":
00035 import sys
00036 if len(sys.argv) != 2:
00037 print "Usage: ./readFile.py daq.data"
00038 sys.exit(1)
00039 readFile( sys.argv[1] )