~maddevelopers/mg5amcnlo/color_ordering

« back to all changes in this revision

Viewing changes to Template/NLO/Utilities/VetoPrefactors/virt_reweighter.py

  • Committer: olivier-mattelaer
  • Date: 2021-02-21 11:03:42 UTC
  • mfrom: (50.85.73 madgraph5)
  • Revision ID: olivier-mattelaer-20210221110342-wn2nvdefctey5e0k
merge up to 2.8.0 --not python3 compatible

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
#
10
10
################################################################################
11
11
 
 
12
from __future__ import absolute_import
12
13
import os
13
14
import re
14
15
import subprocess
174
175
 
175
176
# Detect the total number of event in an efficient way
176
177
n_evts = int(subprocess.Popen('grep -rin "<event>" %s | wc -l'%os.path.realpath(eventFile),
177
 
                        stdout=subprocess.PIPE, shell=True).communicate()[0])
 
178
                              stdout=subprocess.PIPE, shell=True).communicate()[0].decode())
178
179
 
179
180
logging.info("Writing out the reweighted event file on\n   %s"%outPath)
180
181
# Write out the output event file