Index: /trunk/readers/DelphesProMC.py
===================================================================
--- /trunk/readers/DelphesProMC.py	(revision 1250)
+++ /trunk/readers/DelphesProMC.py	(revision 1251)
@@ -3,5 +3,5 @@
 import urllib2
 import cStringIO
-import zipfile 
+import zipfile
 
 import ROOT
@@ -11,4 +11,6 @@
 
 ################################################################################
+# HttpFile class is written by Eli Carter (retracile)
+# http://stackoverflow.com/a/7852229
 
 class HttpFile(object):
@@ -62,5 +64,5 @@
   data = ProMC_pb2.ProMCEvent()
   data.ParseFromString(zip.read(name))
-  
+
   event = data.event
   particles = data.particles
@@ -68,19 +70,18 @@
   element = branch.NewEntry()
 
-
-# element.Number = event.Number
-# element.ProcessID = event.Process_ID
-# element.MPI = event.MPI
-# element.Weight = event.Weight
-# element.Scale = event.Scale
-# element.AlphaQED = event.Alpha_QED
-# element.AlphaQCD = event.Alpha_QCD
-# element.ID1 = event.ID1
-# element.ID2 = event.ID2
-# element.X1 = event.X1
-# element.X2 = event.X2
-# element.ScalePDF = event.Scale_PDF
-# element.PDF1 = event.PDF1
-# element.PDF2 = event.PDF2
+  element.Number = event.Number[0] if event.Number else 0
+  element.ProcessID = event.Process_ID[0] if event.Process_ID else 0
+  element.MPI = event.MPI[0] if event.MPI else 0
+#  element.Weight = event.Weight[0] if event.Weight else 0
+  element.Scale = event.Scale[0] if event.Scale else 0
+  element.AlphaQED = event.Alpha_QED[0] if event.Alpha_QED else 0
+  element.AlphaQCD = event.Alpha_QCD[0] if event.Alpha_QCD else 0
+  element.ID1 = event.ID1[0] if event.ID1 else 0
+  element.ID2 = event.ID2[0] if event.ID2 else 0
+  element.X1 = event.X1[0] if event.X1 else 0
+  element.X2 = event.X2[0] if event.X2 else 0
+  element.ScalePDF = event.Scale_PDF[0] if event.Scale_PDF else 0
+  element.PDF1 = event.PDF1[0] if event.PDF1 else 0
+  element.PDF2 = event.PDF2[0] if event.PDF2 else 0
 
   for i in range(len(particles.pdg_id)):
@@ -104,9 +105,9 @@
     candidate.Status = status
 
-#    candidate.M1 = particles.mother1[i]
-#    candidate.M2 = particles.mother2[i]
-
-#    candidate.D1 = particles.daughter1[i]
-#    candidate.D2 = particles.daughter2[i]
+    candidate.M1 = particles.mother1[i]
+    candidate.M2 = particles.mother2[i]
+
+    candidate.D1 = particles.daughter1[i]
+    candidate.D2 = particles.daughter2[i]
 
     candidate.Mass = mass
@@ -141,5 +142,5 @@
 
 if not outputFile.IsOpen():
-  print "** ERROR: can't open ", sys.argv[2]
+  print "** ERROR: can't open", sys.argv[2]
   sys.exit(1)
 
@@ -163,8 +164,17 @@
 
 for fileName in sys.argv[3:]:
-  print "** Reading " + fileName
-
-  file = HttpFile(fileName)
+  print "** Reading", fileName
+
+  if fileName.startswith("http://"):
+    file = HttpFile(fileName)
+  else:
+    file = open(fileName)
+
   zip = zipfile.ZipFile(file)
+
+  numberOfEvents = len(zip.namelist())
+  if numberOfEvents <= 0: continue
+
+  progressBar = ROOT.ExRootProgressBar(numberOfEvents - 1)
 
   # retrive information from the header file
@@ -176,16 +186,22 @@
   modularDelphes.Clear()
   treeWriter.Clear()
+  eventCounter = 0
   for name in zip.namelist():
-    if name.isdigit():
-      ConvertInput(name, momentumUnit, lengthUnit, branchEvent, factory,
-        allParticleOutputArray, stableParticleOutputArray, partonOutputArray)
-
-      modularDelphes.ProcessTask()
-
-      treeWriter.Fill()
-
-      modularDelphes.Clear()
-      treeWriter.Clear()
-
+    eventCounter += 1
+    if not name.isdigit(): continue
+
+    ConvertInput(name, momentumUnit, lengthUnit, branchEvent, factory,
+      allParticleOutputArray, stableParticleOutputArray, partonOutputArray)
+
+    modularDelphes.ProcessTask()
+
+    treeWriter.Fill()
+
+    modularDelphes.Clear()
+    treeWriter.Clear()
+    progressBar.Update(eventCounter)
+
+  progressBar.Update(eventCounter, eventCounter, ROOT.kTRUE)
+  progressBar.Finish()
   zip.close()
 
