[Rivet-svn] r2236 - in trunk: bin doc

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Feb 2 11:17:08 GMT 2010


Author: fsiegert
Date: Tue Feb  2 11:17:08 2010
New Revision: 2236

Log:
Bugfix in bin/rivet: When reading a fifo, we can't open it twice, once
for initialising the beams and once for actual reading. Restructure file
looping to account for that.

Modified:
   trunk/bin/rivet
   trunk/doc/   (props changed)

Modified: trunk/bin/rivet
==============================================================================
--- trunk/bin/rivet	Tue Feb  2 10:17:56 2010	(r2235)
+++ trunk/bin/rivet	Tue Feb  2 11:17:08 2010	(r2236)
@@ -393,11 +393,8 @@
 ## Event loop
 starttime = time.time()
 EVTNUM = 0
-for file in HEPMCFILES:
-    logging.info("Reading events from '%s'" % file)
-    run.openFile(file)
-    if not run.readEvent():
-        continue
+for fileidx in range(len(HEPMCFILES)):
+    logging.info("Reading events from '%s'" % HEPMCFILES[fileidx])
     while opts.MAXEVTNUM is None or EVTNUM < opts.MAXEVTNUM:
         EVTNUM += 1
         logNEvt(EVTNUM, starttime, opts.MAXEVTNUM)
@@ -408,6 +405,10 @@
             break
         if not run.readEvent():
             break
+    if fileidx<len(HEPMCFILES)-1:
+        run.openFile(HEPMCFILES[fileidx+1])
+        if not run.readEvent():
+            continue
 logging.info("Finished event loop")
 run.finalize()
 


More information about the Rivet-svn mailing list