How to access energy of a certain particle in a vertex

Asked by Arka Santra

Hello,
  I have a photon-fermion-antifermion vertex. The fermion is defined in the particles.py file as this:

mm__minus__ = Particle(pdg_code = 4110000,
                       name = 'mm-',
                       antiname = 'mm+',
                       spin = 2,
                       color = 1,
                       mass = Param.MMM,
                       width = Param.ZERO,
                       texname = 'mm-',
                       antitexname = 'mm+',
                       charge = 0,
                       GhostNumber = 0,
                       LeptonNumber = 1,
                       Y = 0)

where MMM is defined in the parameters.py:

MMM = Parameter(name = 'MMM',
               nature = 'external',
               type = 'real',
               value = 1500,
               texname = '\\text{MMM}',
               lhablock = 'MASS',
               lhacode = [ 4110000 ])

The vertex is defined in the vertices.py file as this:

 V_154 = Vertex(name = 'V_154',
              particles = [ P.mm__plus__, P.mm__minus__, P.a ],
              color = [ '1' ],
              lorentz = [ L.FFV1_mod ],
              couplings = {(0,0):C.GC_109})

where 'mm' is the fermion (magnetic monopole) and 'a' is the photon.

The FFV1_mod is defined in lorentz.py file:

FFV1_mod = Lorentz(name = 'FFV1_mod',
               spins = [ 2, 2, 3 ],
               structure = 'Gamma(3,2,1)')

Now I want to modify the above lorentz structure such that it depends on the mass and energy of the first fermion. I see that P(1,N) means momentum of the Nth particle. For the FFV1_mod vertex above, is P(0,1) ( P(0,2) ) the energy of the first (second) fermion?

Now if I have a fermion-antifermion-photon-photon vertex in my model and if I define it as

V_155 = Vertex(name = 'V_154',
              particles = [ P.mm__plus__, P.mm__minus__, P.a, P.a ],
              color = [ '1' ],
              lorentz = [ L.FFVV1_mod ],
              couplings = {(0,0):C.GC_109})

. The lorentz structure is:

FFVV1_mod = Lorentz(name = 'FFVV1_mod',
               spins = [ 2, 2, 3, 3],
               structure = '1')

how do I get the energy of the fermions in the vertex? Is it again P(0,1) for the first fermion and P(0,2) for the second fermion? Also is P(0,3) the energy of the first photon?

Thank you,
Arka

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Arka Santra
Solved:
Last query:
Last reply:
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

Hi,

The first index of the P is the lorentz index. So ‘0’ does not means energy, it identify an index named like that.
To have that part more readable, you should rather write it like P(‘mu’, N)

Using the Energy of a particle sounds a quite bad idea since you are going to explicitly break the lorentz invariance of your theory.
I actually do not see any possibilities to include such dependencies in the UFO file.

If you really want to have such type of dependencies, the only solution is to set the lorentz structure to ‘external’
and then include inside the UFO model all the helicity amplitude related to the given interaction.
This is of course something quite complex to do in general.

A solution which is also quite complex but maybe easier if you have a pretty strong level of python, would be to modify the
ALOHA package such that to include the definition of a projector on the Energy. The bad point of that is that it will made your model working only
with a hacked version of MG5aMC.

Cheers,

Olivier

> On Nov 10, 2017, at 20:44, Arka Santra <email address hidden> wrote:
>
> New question #660589 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/660589
>
> Hello,
> I have a photon-fermion-antifermion vertex. The fermion is defined in the particles.py file as this:
>
>
> mm__minus__ = Particle(pdg_code = 4110000,
> name = 'mm-',
> antiname = 'mm+',
> spin = 2,
> color = 1,
> mass = Param.MMM,
> width = Param.ZERO,
> texname = 'mm-',
> antitexname = 'mm+',
> charge = 0,
> GhostNumber = 0,
> LeptonNumber = 1,
> Y = 0)
>
>
> where MMM is defined in the parameters.py:
>
> MMM = Parameter(name = 'MMM',
> nature = 'external',
> type = 'real',
> value = 1500,
> texname = '\\text{MMM}',
> lhablock = 'MASS',
> lhacode = [ 4110000 ])
>
>
>
>
> The vertex is defined in the vertices.py file as this:
>
> V_154 = Vertex(name = 'V_154',
> particles = [ P.mm__plus__, P.mm__minus__, P.a ],
> color = [ '1' ],
> lorentz = [ L.FFV1_mod ],
> couplings = {(0,0):C.GC_109})
>
>
> where 'mm' is the fermion (magnetic monopole) and 'a' is the photon.
>
> The FFV1_mod is defined in lorentz.py file:
>
> FFV1_mod = Lorentz(name = 'FFV1_mod',
> spins = [ 2, 2, 3 ],
> structure = 'Gamma(3,2,1)')
>
>
>
> Now I want to modify the above lorentz structure such that it depends on the mass and energy of the first fermion. I see that P(1,N) means momentum of the Nth particle. For the FFV1_mod vertex above, is P(0,1) ( P(0,2) ) the energy of the first (second) fermion?
>
>
> Now if I have a fermion-antifermion-photon-photon vertex in my model and if I define it as
>
> V_155 = Vertex(name = 'V_154',
> particles = [ P.mm__plus__, P.mm__minus__, P.a, P.a ],
> color = [ '1' ],
> lorentz = [ L.FFVV1_mod ],
> couplings = {(0,0):C.GC_109})
>
> . The lorentz structure is:
>
> FFVV1_mod = Lorentz(name = 'FFVV1_mod',
> spins = [ 2, 2, 3, 3],
> structure = '1')
>
> how do I get the energy of the fermions in the vertex? Is it again P(0,1) for the first fermion and P(0,2) for the second fermion? Also is P(0,3) the energy of the first photon?
>
>
>
> Thank you,
> Arka
>
>
>
>
>
>
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Arka Santra (santra-arka) said :
#2

Hi Olivier,
   If momentum is defined as P('mu',N) for the N th particle, then how do I contract the momentum? As negative Lorentz indices mean contraction, will it be P(-1,N)*P(-1,N) for the Nth particle? Also, will this contraction give mass^2 of N th particle?

   I have another question. I have another vertex where coupling depends on the speed of a final particle. I was going through the form factor approach:
https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/FormFactors

I see that for v_4 (Old Model), the way to implement momentum dependence in a coupling is mentioned explicitly using

double precision pp(0:3,max_particles)

in the couplings.f file.

But I do not see such function for 'Method 1: Pure Python (UFO/ALOHA)'. How do I implement the coupling of a vertex to be dependent on the speed of a final particle?

I see that I need to write the form factor in form_factors.py:

from object_library import all_form_factors, FormFactor

from function_library import complexconjugate, re, im, csc, sec, acsc, asec, HeavTheta

AAA = FormFactor(name = 'AAA',
                 type = 'real',
                 value = '(-2*MH if MH - P(-1,1)*P(-1,3) > 0 else MH)')

Suppose I have a vertex photon (particle 1) - fermion (particle 2) - antifermion (particle 3) and mass of the fermion/antifermion is MMM which is defined in the parameters.py file. In that case, what should be the expression in the field 'value' of the form factor AAA so that it becomes the speed of particle 2?

Thank you,
Arka

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#3

Hi,

> If momentum is defined as P('mu',N) for the N th particle, then how do I contract the momentum? As negative Lorentz indices mean contraction, will it be P(-1,N)*P(-1,N) for the Nth particle? Also, will this contraction give mass^2 of N th particle?

All repeated index will be contracted.So
all the following expression are equivalent.
 P(‘mu’,N) * P(‘mu’,N)
 P(0,N) * P(0,N)
 P(-1,N)*P(-1,N)
This will give the invariant mass square of the associate momenta (which will be the mass square for initial/final state particle)

> I see that for v_4 (Old Model), the way to implement momentum dependence
> in a coupling is mentioned explicitly using
>
> double precision pp(0:3,max_particles)
>
> in the couplings.f file.

I hope that your computation does not depend of the frame in which those momenta are given, but note that they are given in the center of mass frame.

> Suppose I have a vertex photon (particle 1) - fermion (particle 2) -
> antifermion (particle 3) and mass of the fermion/antifermion is MMM
> which is defined in the parameters.py file. In that case, what should be
> the expression in the field 'value' of the form factor AAA so that it
> becomes the speed of particle 2?

By construction all UFO expression are lorentz invariant, so you can not use such expression to build a non lorentz invariant function.
The first question is can you rewrite your expression in a covariant way?
IF not, the only solution that I see is to use the method 2 of the link that you mention. (You can combine it with method 1 if you want)

In the fortran file, you can use any common block of madevent that you want to access the information that you need. i.e.
      double precision pp(0:3,max_particles)
      common /momenta_pp/pp

Cheers,

Olivier

> On Nov 11, 2017, at 22:32, Arka Santra <email address hidden> wrote:
>
> Question #660589 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/660589
>
> Status: Answered => Open
>
> Arka Santra is still having a problem:
> Hi Olivier,
> If momentum is defined as P('mu',N) for the N th particle, then how do I contract the momentum? As negative Lorentz indices mean contraction, will it be P(-1,N)*P(-1,N) for the Nth particle? Also, will this contraction give mass^2 of N th particle?
>
>
> I have another question. I have another vertex where coupling depends on the speed of a final particle. I was going through the form factor approach:
> https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/FormFactors
>
> I see that for v_4 (Old Model), the way to implement momentum dependence
> in a coupling is mentioned explicitly using
>
> double precision pp(0:3,max_particles)
>
> in the couplings.f file.
>
> But I do not see such function for 'Method 1: Pure Python (UFO/ALOHA)'.
> How do I implement the coupling of a vertex to be dependent on the speed
> of a final particle?
>
> I see that I need to write the form factor in form_factors.py:
>
>
> from object_library import all_form_factors, FormFactor
>
> from function_library import complexconjugate, re, im, csc, sec, acsc,
> asec, HeavTheta
>
>
> AAA = FormFactor(name = 'AAA',
> type = 'real',
> value = '(-2*MH if MH - P(-1,1)*P(-1,3) > 0 else MH)')
>
>
>
> Suppose I have a vertex photon (particle 1) - fermion (particle 2) -
> antifermion (particle 3) and mass of the fermion/antifermion is MMM
> which is defined in the parameters.py file. In that case, what should be
> the expression in the field 'value' of the form factor AAA so that it
> becomes the speed of particle 2?
>
>
> Thank you,
> Arka
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Arka Santra (santra-arka) said :
#4

Hi Olivier,
  I followed the instructions described in Method 2: Fortran Way of this link:
https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/FormFactors

But while I compiled the model, I am getting the error:

Error detected in "generate_events run_01"
write debug file /home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/run_01_tag_1_debug.log
If you need help with this issue please contact us on https://answers.launchpad.net/mg5amcnlo
MadGraph5Error : A compilation Error occurs when trying to compile /home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source.
 The compilation fails with the following output message:
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o StringCast.o StringCast.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o ranmar.o ranmar.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o alfas_functions.o alfas_functions.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o transpole.o transpole.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o invarients.o invarients.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o hfill.o hfill.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o pawgraphs.o pawgraphs.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o ran1.o ran1.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o rw_events.o rw_events.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o rw_routines.o rw_routines.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o kin_functions.o kin_functions.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o open_file.o open_file.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o basecode.o basecode.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o setrun.o setrun.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o run_printout.o run_printout.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o dgauss.o dgauss.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o readgrid.o readgrid.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o getissud.o getissud.f
     cd DHELAS; make
     make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
     cd PDF; make
     make[1]: Entering directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/DHELAS'
     make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
     make[1]: Entering directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/PDF'
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o aloha_functions.o aloha_functions.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o Ctq4Fn.o Ctq4Fn.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o Ctq5Par.o Ctq5Par.f
     cd MODEL; make
     make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
     make[1]: Entering directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/MODEL'
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o couplings.o couplings.f
     cd CERNLIB; make
     make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
     make[1]: Entering directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/CERNLIB'
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o abend.o abend.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o dlsqp2.o dlsqp2.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o Ctq5Pdf.o Ctq5Pdf.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o lenocc.o lenocc.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o lha_read.o lha_read.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mtlprt.o mtlprt.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mtlset.o mtlset.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o radmul.o radmul.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o printout.o printout.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o Partonx5.o Partonx5.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o Ctq6Pdf.o Ctq6Pdf.f
     ar cru ../../lib/libcernlib.a abend.o dlsqp2.o lenocc.o mtlprt.o mtlset.o radmul.o
     ar: `u' modifier ignored since `D' is the default (see `U')
     ranlib ../../lib/libcernlib.a
     make[1]: Leaving directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/CERNLIB'
     cd BIAS/dummy; make
     make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
     make[1]: Entering directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/BIAS/dummy'
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o dummy.o dummy.f
     ar cru ../../../lib/libbias.a dummy.o
     ar: `u' modifier ignored since `D' is the default (see `U')
     ranlib ../../../lib/libbias.a
     make[1]: Leaving directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/BIAS/dummy'
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o DiscreteSampler.o DiscreteSampler.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o cteq3.o cteq3.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o rw_para.o rw_para.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o model_functions.o model_functions.f
     /home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/genps.inc:5: Error: Can't open included file 'maxparticles.inc'
     <builtin>: recipe for target 'model_functions.o' failed
     make[1]: *** [model_functions.o] Error 1
     make[1]: Leaving directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/MODEL'
     makefile:54: recipe for target '../lib/libmodel.a' failed
     make: *** [../lib/libmodel.a] Error 2
     make: *** Waiting for unfinished jobs....
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o FFV1_mod_1.o FFV1_mod_1.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mrs98.o mrs98.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o FFV1_mod_2.o FFV1_mod_2.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o FFV1_mod_0.o FFV1_mod_0.f
     ar cru ../../lib/libdhelas.a aloha_functions.o FFV1_mod_1.o FFV1_mod_2.o FFV1_mod_0.o
     ar: `u' modifier ignored since `D' is the default (see `U')
     ranlib ../../lib/libdhelas.a
     make[1]: Leaving directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/DHELAS'
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mrs98lo.o mrs98lo.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mrs98ht.o mrs98ht.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mrs99.o mrs99.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mrst2001.o mrst2001.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mrst2002.o mrst2002.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o jeppe02.o jeppe02.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o pdfwrap.o pdfwrap.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o opendata.o opendata.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o pdf.o pdf.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o PhotonFlux.o PhotonFlux.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o pdg2pdf.o pdg2pdf.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o NNPDFDriver.o NNPDFDriver.f
     ar cru ../../lib/libpdf.a Ctq4Fn.o Ctq5Par.o Ctq5Pdf.o Partonx5.o Ctq6Pdf.o cteq3.o mrs98.o mrs98lo.o mrs98ht.o mrs99.o mrst2001.o mrst2002.o jeppe02.o pdfwrap.o opendata.o pdf.o PhotonFlux.o pdg2pdf.o NNPDFDriver.o
     ar: `u' modifier ignored since `D' is the default (see `U')
     ranlib ../../lib/libpdf.a
     make[1]: Leaving directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/PDF'

 Please try to fix this compilations issue and retry.
 Help might be found at https://answers.launchpad.net/mg5amcnlo.
 If you think that this is a bug, you can report this at https://bugs.launchpad.net/mg5amcnlo

Initially, I thought that genps.inc file is missing. I wrote the absolute path of that file in the functions.f file:

include '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/genps.inc'

but still the error persists.

This is my model:
https://github.com/asantra/MadGraphModels/tree/master/mono_spinhalf_beta

A quick walk through:
a. the fermion is defined here:
https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/particles.py#L386

b. the mass of the fermion is defined here:
https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/parameters.py#L188

c. the vertex is here:
https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/vertices.py#L930

d. The lorentz form is:
https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/lorentz.py#L54

e. The functions.f file is here:
https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/Fortran/functions.f

How do I solve this issue?
Thanks,
Arka

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#5

Hi,

The relevant error is the following one:

  gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o model_functions.o model_functions.f
     /home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/genps.inc:5: Error: Can't open included file 'maxparticles.inc'
     <builtin>: recipe for target ‘model_functions.o' failed

Looks like you try to use maxparticles.inc but that file is not present in the MODEL directory, please fix the path such that it point to an existing file.

Cheers,

Olivier

> On Nov 12, 2017, at 16:38, Arka Santra <email address hidden> wrote:
>
> Question #660589 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/660589
>
> Status: Answered => Open
>
> Arka Santra is still having a problem:
> Hi Olivier,
> I followed the instructions described in Method 2: Fortran Way of this link:
> https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/FormFactors
>
>
> But while I compiled the model, I am getting the error:
>
>
>
> Error detected in "generate_events run_01"
> write debug file /home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/run_01_tag_1_debug.log
> If you need help with this issue please contact us on https://answers.launchpad.net/mg5amcnlo
> MadGraph5Error : A compilation Error occurs when trying to compile /home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source.
> The compilation fails with the following output message:
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o StringCast.o StringCast.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o ranmar.o ranmar.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o alfas_functions.o alfas_functions.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o transpole.o transpole.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o invarients.o invarients.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o hfill.o hfill.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o pawgraphs.o pawgraphs.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o ran1.o ran1.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o rw_events.o rw_events.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o rw_routines.o rw_routines.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o kin_functions.o kin_functions.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o open_file.o open_file.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o basecode.o basecode.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o setrun.o setrun.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o run_printout.o run_printout.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o dgauss.o dgauss.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o readgrid.o readgrid.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o getissud.o getissud.f
> cd DHELAS; make
> make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
> cd PDF; make
> make[1]: Entering directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/DHELAS'
> make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
> make[1]: Entering directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/PDF'
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o aloha_functions.o aloha_functions.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o Ctq4Fn.o Ctq4Fn.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o Ctq5Par.o Ctq5Par.f
> cd MODEL; make
> make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
> make[1]: Entering directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/MODEL'
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o couplings.o couplings.f
> cd CERNLIB; make
> make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
> make[1]: Entering directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/CERNLIB'
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o abend.o abend.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o dlsqp2.o dlsqp2.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o Ctq5Pdf.o Ctq5Pdf.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o lenocc.o lenocc.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o lha_read.o lha_read.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mtlprt.o mtlprt.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mtlset.o mtlset.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o radmul.o radmul.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o printout.o printout.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o Partonx5.o Partonx5.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o Ctq6Pdf.o Ctq6Pdf.f
> ar cru ../../lib/libcernlib.a abend.o dlsqp2.o lenocc.o mtlprt.o mtlset.o radmul.o
> ar: `u' modifier ignored since `D' is the default (see `U')
> ranlib ../../lib/libcernlib.a
> make[1]: Leaving directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/CERNLIB'
> cd BIAS/dummy; make
> make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
> make[1]: Entering directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/BIAS/dummy'
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o dummy.o dummy.f
> ar cru ../../../lib/libbias.a dummy.o
> ar: `u' modifier ignored since `D' is the default (see `U')
> ranlib ../../../lib/libbias.a
> make[1]: Leaving directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/BIAS/dummy'
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o DiscreteSampler.o DiscreteSampler.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o cteq3.o cteq3.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o rw_para.o rw_para.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o model_functions.o model_functions.f
> /home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/genps.inc:5: Error: Can't open included file 'maxparticles.inc'
> <builtin>: recipe for target 'model_functions.o' failed
> make[1]: *** [model_functions.o] Error 1
> make[1]: Leaving directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/MODEL'
> makefile:54: recipe for target '../lib/libmodel.a' failed
> make: *** [../lib/libmodel.a] Error 2
> make: *** Waiting for unfinished jobs....
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o FFV1_mod_1.o FFV1_mod_1.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mrs98.o mrs98.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o FFV1_mod_2.o FFV1_mod_2.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o FFV1_mod_0.o FFV1_mod_0.f
> ar cru ../../lib/libdhelas.a aloha_functions.o FFV1_mod_1.o FFV1_mod_2.o FFV1_mod_0.o
> ar: `u' modifier ignored since `D' is the default (see `U')
> ranlib ../../lib/libdhelas.a
> make[1]: Leaving directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/DHELAS'
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mrs98lo.o mrs98lo.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mrs98ht.o mrs98ht.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mrs99.o mrs99.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mrst2001.o mrst2001.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mrst2002.o mrst2002.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o jeppe02.o jeppe02.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o pdfwrap.o pdfwrap.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o opendata.o opendata.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o pdf.o pdf.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o PhotonFlux.o PhotonFlux.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o pdg2pdf.o pdg2pdf.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o NNPDFDriver.o NNPDFDriver.f
> ar cru ../../lib/libpdf.a Ctq4Fn.o Ctq5Par.o Ctq5Pdf.o Partonx5.o Ctq6Pdf.o cteq3.o mrs98.o mrs98lo.o mrs98ht.o mrs99.o mrst2001.o mrst2002.o jeppe02.o pdfwrap.o opendata.o pdf.o PhotonFlux.o pdg2pdf.o NNPDFDriver.o
> ar: `u' modifier ignored since `D' is the default (see `U')
> ranlib ../../lib/libpdf.a
> make[1]: Leaving directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/PDF'
>
> Please try to fix this compilations issue and retry.
> Help might be found at https://answers.launchpad.net/mg5amcnlo.
> If you think that this is a bug, you can report this at https://bugs.launchpad.net/mg5amcnlo
>
>
>
> Initially, I thought that genps.inc file is missing. I wrote the absolute path of that file in the functions.f file:
>
> include
> '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/genps.inc'
>
>
> but still the error persists.
>
>
> This is my model:
> https://github.com/asantra/MadGraphModels/tree/master/mono_spinhalf_beta
>
> A quick walk through:
> a. the fermion is defined here:
> https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/particles.py#L386
>
> b. the mass of the fermion is defined here:
> https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/parameters.py#L188
>
> c. the vertex is here:
> https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/vertices.py#L930
>
> d. The lorentz form is:
> https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/lorentz.py#L54
>
> e. The functions.f file is here:
> https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/Fortran/functions.f
>
>
> How do I solve this issue?
> Thanks,
> Arka
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Arka Santra (santra-arka) said :
#6

Hi Olivier,
  I now used the absolute path of maxparticles.inc inside genps.inc. Now MG5 could find that file. But unfortunately, now I see this error:

            gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o model_functions.o model_functions.f
     model_functions.f:97:1:

      double complex mymdl_FormFactor(Mass):
      1
     Error: Non-numeric character in statement label at (1)
     model_functions.f:97:1:

      double complex mymdl_FormFactor(Mass):
      1
     Error: Unclassifiable statement at (1)
     <builtin>: recipe for target 'model_functions.o' failed
     make[1]: *** [model_functions.o] Error 1
     make[1]: Leaving directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/MODEL'
     makefile:54: recipe for target '../lib/libmodel.a' failed
     make: *** [../lib/libmodel.a] Error 2
     make: *** Waiting for unfinished jobs...

My function 'mymdl_FormFactor()' is defined in the functions.f file:
https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/Fortran/functions.f

From this line of lorentz.py, I call the function:
https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/lorentz.py#L56

The argument of the function is the mass of a particle. How should I modify my functions.f to solve this issue?

I have another question. Every time, I need to launch MadGraph, I need to change the path of 'maxparticles.inc' inside genps.inc. Is it possible that I change the path of 'maxparticles.inc' inside genps.inc only once? In short, in which folder of MG5, the master file of genps.inc is written?

Thanks,
Arka

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#7

Hi,

This looks like a number of space issue at the start of the line.

So did you write yourself that line? Or is it one created on the flight by the UFO to fortran converter?
In the second case, can you send me the model?

Cheers,

Olivier

> On Nov 13, 2017, at 13:09, Arka Santra <email address hidden> wrote:
>
> Question #660589 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/660589
>
> Status: Answered => Open
>
> Arka Santra is still having a problem:
> Hi Olivier,
> I now used the absolute path of maxparticles.inc inside genps.inc. Now MG5 could find that file. But unfortunately, now I see this error:
>
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o model_functions.o model_functions.f
> model_functions.f:97:1:
>
> double complex mymdl_FormFactor(Mass):
> 1
> Error: Non-numeric character in statement label at (1)
> model_functions.f:97:1:
>
> double complex mymdl_FormFactor(Mass):
> 1
> Error: Unclassifiable statement at (1)
> <builtin>: recipe for target 'model_functions.o' failed
> make[1]: *** [model_functions.o] Error 1
> make[1]: Leaving directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/MODEL'
> makefile:54: recipe for target '../lib/libmodel.a' failed
> make: *** [../lib/libmodel.a] Error 2
> make: *** Waiting for unfinished jobs...
>
>
> My function 'mymdl_FormFactor()' is defined in the functions.f file:
> https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/Fortran/functions.f
>
>> From this line of lorentz.py, I call the function:
> https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/lorentz.py#L56
>
> The argument of the function is the mass of a particle. How should I
> modify my functions.f to solve this issue?
>
>
> I have another question. Every time, I need to launch MadGraph, I need
> to change the path of 'maxparticles.inc' inside genps.inc. Is it
> possible that I change the path of 'maxparticles.inc' inside genps.inc
> only once? In short, in which folder of MG5, the master file of
> genps.inc is written?
>
>
> Thanks,
> Arka
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Arka Santra (santra-arka) said :
#8

Hi Olivier,
  I wrote the absolute path of maxparticles.inc inside genps.inc myself, because I do not know how to change the absolute path on the fly.
  I first create the directory 'Pre6' using MadGraph 'output Pre6' command. Then I manually change the path of maxparticles.inc inside genps.inc (in Pre6/Source directory). Then I compile the code using 'launch Pre6' command.

  This is my model directory:
  https://github.com/asantra/MadGraphModels/tree/master/mono_spinhalf_beta

Thank you,
Arka

Revision history for this message
Arka Santra (santra-arka) said :
#9

Hi Olivier,
  I changed my functions.f file which is here:
 https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/Fortran/functions.f

But now when I compile the code, I get this error:

make[1]: Leaving directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/BIAS/dummy'
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o DiscreteSampler.o DiscreteSampler.f
     model_functions.f:100:23:

            double complex M1
                            1
     Error: Symbol ‘m1’ at (1) already has basic type of INTEGER
     model_functions.f:97:38:

            double complex mymdl_FormFactor(M1)
                                           1
     Error: Variable ‘m1’ cannot appear in the expression at (1)
     model_functions.f:97:41:

            double complex mymdl_FormFactor(M1)
                                              1
     Error: The module or main program array 'mymdl_formfactor' at (1) must have constant shape
     <builtin>: recipe for target 'model_functions.o' failed
     make[1]: *** [model_functions.o] Error 1
     make[1]: Leaving directory '/home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre6/Source/MODEL'
     makefile:54: recipe for target '../lib/libmodel.a' failed
     make: *** [../lib/libmodel.a] Error 2
     make: *** Waiting for unfinished jobs....

I do not understand why m1 is taken as integer even though I used 'implicit none' statement in functions.f. How do I solve this issue?

Thank you,
Arka

Revision history for this message
Arka Santra (santra-arka) said :
#10

Hi Olivier,
  I think I have solved the issue with Fortran. I needed to change my functions.f like this:

 https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/Fortran/functions.f

 I want to provide two comments about the Method 2: Fortran way here:
https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/FormFactors

Here, in the example of functions.f, the colon (:) after 'double complex FormFactor(S1, S2)' should be removed. Also, it should be written as 'double complex function FormFactor(S1, S2)'.

I have another question though. I have defined the three-momentum square of a particle in my functions.f like this:
https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/Fortran/functions.f#L15

Is this the right way to define the three-momentum square of a particle?

Thank you,
Arka

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#11

Hi,

Great that you fix your problem and thank you for the suggestion concerning the wiki page, I have applied the associated modification.

> I have another question though. I have defined the three-momentum square of a particle in my functions.f like this:
https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/Fortran/functions.f#L15

I found confusing that you call the momenta of the second particle "shat", since this variable is anything but shat.
Otherwise, you indeed compute the three-momenta square of the second particle (and actually also the one of the first).

Cheers,

Olivier