Reweighing with allmatrix2py
Hi,
I am trying to use allmatrix to calculate matrix elements for 10 different configurations of EWdim6 couplings. How ever, when I run it I get
Param card 1 of 10: 000.dat
Warning: parameter mdl_CWWWL2 not found
setting it to default value 0.99999990000000005
Warning: parameter mdl_CWL2 not found
setting it to default value 9.9999990000000007
Warning: parameter mdl_CBL2 not found
setting it to default value 99.999989999999997
Warning: parameter mdl_CPWWWL2 not found
setting it to default value 999.99990000000003
Warning: parameter mdl_CPWL2 not found
setting it to default value 9999.9989999999998
Warning: parameter mdl_MP not found
setting it to default value 125.01200000000000
Warning: parameter mdl_WTau not found
setting it to default value 2.2699999999999
Warning: parameter mdl_WH1 not found
setting it to default value 6.3823389999999
for all 10 parameter cards, and the matrix elements are identical for the 10 cards as if the cards are not loaded correctly.
Here is the code I use:
#!/usr/bin/env python
from __future__ import division
import sys
import math
import ROOT
sys.path.
import allmatrix2py
def invert_momenta(p):
""" fortran/C-python do not order table in the same order"""
new_p = []
for i in range(len(p[0])): new_p.append(
for i, onep in enumerate(p):
for j, x in enumerate(onep):
return new_p
if len(sys.argv) < 3:
print("Usage: add_weights.py input_file out_file")
sys.exit(2)
ROOT.gSystem.
try:
ROOT.
except:
print("Include failed. Exiting")
sys.exit(1)
inname = sys.argv[1]
outname = sys.argv[2]
fin = ROOT.TFile(inname)
t = fin.Get("LHEF")
nentries = t.GetEntries()
param_files = ["000.dat", "100.dat", "010.dat", "001.dat", "-100.dat", "0-10.dat", "00-1.dat", "1-10.dat", "01-1.dat", "-101.dat"]
import numpy
all_weights = numpy.zeros(
print("%d entries in tree" % nentries)
print("-"*15)
print("Computing MEs")
print('-'*15)
for j, card in enumerate(
print("Param card %d of %d: %s" % (j+1,len(
allmatrix2p
for i in range(nentries):
# Load selected branches with data from specified event
flavours = [par.PID for par in t.Particle if abs(par.PID) < 25]
p = [[par.E, par.Px, par.Py, par.Pz] for par in t.Particle if abs(par.PID) < 25]
print('\n')
fout = ROOT.TFile(outname, "RECREATE")
tout = t.CloneTree(
weights = ROOT.std.
tout.Branch(
print("-"*15)
print("Writing MEs to new tree")
print('-'*15)
for i in range(nentries):
for j in range(len(
weights[j] = all_weights[i,j]
if i == 0 : print weights[j]
tout.Fill()
tout.Write()
fout.Close()
Any idea as to why this is not working properly?
Emil
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Emil Gorm Nielsen
- Solved:
- Last query:
- Last reply: