Problem in compiling a user defined model

Asked by Arka Santra

Hi,
  I want to work with a user-defined model in MadGraph. In this model, I want to work with two vertices of 1. photon -> magnetic monopole + magnetic anti-monopole and 2. photon + photon -> magnetic monopole + magnetic anti-monopole. So I did the following:
1. wrote this in the VariableName.dat file:
gch #g_MM

2. wrote this in the particles.dat file:
#MODEL EXTENSION
mm- mm+ S D MMASS MWIDTH S mm 4110000

3. I modified the interactions.dat file:
# USRVertex
a mm- mm+ GAM QED
a a mm- mm+ GAAMM GAAMM QED QED

4. added this in the param_card.dat:
BLOCK MGUSER
         1 1.00000000e+00 # gch ,g_MM

5. added this in the couplings.f:
c************************************
c UserMode couplings
c************************************

      GAM=dcmplx(1d0,Zero)
      GAAMM=dcmplx(1d0,Zero)

but while I run the model, I get this error:

Error detected in "generate_events run_01"
write debug file /home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/TwoPhotonFusionSpinOneThree3/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/TwoPhotonFusionSpinOneThree3/SubProcesses/P1_aa_mmpmmm.
 The compilation fails with the following output message:
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c driver.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c myamp.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c genps.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c unwgt.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c setcuts.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c get_color.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c cuts.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c cluster.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c reweight.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c initcluster.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c addmothers.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c setscales.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c auto_dsig.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c auto_dsig1.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c matrix1.f -I../../Source/
     gfortran -o madevent driver.o myamp.o genps.o unwgt.o setcuts.o get_color.o cuts.o cluster.o reweight.o initcluster.o addmothers.o setscales.o idenparts.o auto_dsig.o auto_dsig1.o matrix1.o -L../../lib/ -ldhelas -ldsample -lmodel -lgeneric -lpdf -lcernlib -lbias -lstdc++
     matrix1.o: In function `matrix1_':
     matrix1.f:(.text+0x2f7): undefined reference to `vvvvxx_'
     collect2: error: ld returned 1 exit status
     makefile:44: recipe for target 'madevent' failed
     make: *** [madevent] Error 1

 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

How do I solve this issue?

Thank you,
Arka

Question information

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

Dear Arka,

From what I see, you are creating a model for the version 4 of MadGraph. Those model are still officially supported by MadGraph5_aMC@NLO. But you should expect that such support is going to be dropped soon. (Many functionality are not compatible with such old model) I would therefore suggest that you implement your Lagrangian in FeynRules (or an equivalent code) and generate a UFO model (or if you prefer you can write the UFO model directly)

Now the problem is that model version 4 relies on the HELAS library, and looks like that you did not update that library to include the routine needed by your model. In other word, you have to include how the various helicity amplitude combined themself in your model. This is obviously possible to do but not trivial. If you use an UFO model, this stage will be automatically be done by the ALOHA (which is shipped with MG5aMC). So I think that you really need to move to the current format for the model.

Cheers,

Olivier

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

Hi Olivier,
  Thank you for your answer. My problem is that I cannot use FeynRules as the coupling in my model is very high. I can only work the tree level diagrams. In that case, I think I can write the UFO model directly. For madGraph4, I had these instructions to create a user-defined model:

  https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/UserModel

Is there similar instructions for MadGraph5? Will you show me the documentation? (sorry, I could not find it out myself)

Thank you,
Arka

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

Hi,

My problem is that I cannot use FeynRules as the coupling in my model is very high.

This comment does not make sense to me. What do you mean? If you are saying that you do not have a perturbative Lagrangian, then I would be worried on how you will make any sensitive computation inside MG5aMC.

Is there similar instructions for MadGraph5? Will you show me the documentation? (sorry, I could not find it out myself)

The description of the format is given here: arXiv:1108.2040<http://arXiv.org/abs/arXiv:1108.2040>

Cheers,

Olivier

On 20 Sep 2017, at 11:21, Arka Santra <<email address hidden><mailto:<email address hidden>>> wrote:

Question #658291 on MadGraph5_aMC@NLO changed:
https://answers.launchpad.net/mg5amcnlo/+question/658291

   Status: Answered => Open

Arka Santra is still having a problem:
Hi Olivier,
 Thank you for your answer. My problem is that I cannot use FeynRules as the coupling in my model is very high. I can only work the tree level diagrams. In that case, I think I can write the UFO model directly. For madGraph4, I had these instructions to create a user-defined model:

 https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/UserModel

Is there similar instructions for MadGraph5? Will you show me the documentation? (sorry, I could not find it out myself)

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 am now migrating to the MadGraph5 UFO models by rewriting my model in python. Specifically, I did the following:

1. Add these to the parameters.py:
MMM = Parameter(name = 'MMM',
               nature = 'external',
               type = 'real',
               value = 1500,
               texname = '\\text{MMM}',
               lhablock = 'MASS',
               lhacode = [ 4110000 ])

and

GCH = Parameter(name = 'GCH',
                  nature = 'external',
                  type = 'real',
                  value = 1.0,
                  texname = '\\text{GCH}',
                  lhablock = 'GCH',
                  lhacode = [ 1 ])

2. in the particles.py

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

3. In the couplings.py:

GC_109 = Coupling(name = 'GC_109',
                  value = 'cmath.sqrt(cmath.pi/aEW)*GCH',
                  order = {'QED':1})

4. In the vertices.py:

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

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

Now I need to have a coupling which is dependent on the velocity of the generated particle. To do that, I need to modify the setscales.f. These are the lines in setscales.f :

real*8 gm, shat, betam, gbeta, ee, Pi
alpha = 1d0/1.37d2
      print *,'alpha',alpha
      gm = dsqrt(Pi/alpha)
      write(*,*)'P(0,1),P(0,2)', P(0,1),P(0,2)
      shat = 2d0*dot(P(0,1),P(0,2))
      print *,'MMM', MMM

      betam = dsqrt(1d0 - 4d0*MMM*MMM/shat)

      gbeta = gm*betam

      GCH = dcmplx( gbeta, 0d0 )

But while I want to compile, MadGraph is showing me this error:

Error detected in "generate_events run_01"
write debug file /home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre7/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/Pre7/SubProcesses/P1_aa_mmpmmm.
 The compilation fails with the following output message:
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c driver.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c myamp.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c genps.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c unwgt.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c setcuts.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c get_color.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c cuts.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c cluster.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c reweight.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c initcluster.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c addmothers.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c setscales.f -I../../Source/
     setscales.f:148:9:

            GCH = dcmplx( gbeta, 0d0 )
              1
     Error: Symbol ‘gch’ at (1) has no IMPLICIT type
     setscales.f:138:24:

            print *,'MMM', MMM
                             1
     Error: Symbol ‘mmm’ at (1) has no IMPLICIT type
     makefile:60: recipe for target 'setscales.o' failed
     make: *** [setscales.o] Error 1
     make: *** Waiting for unfinished jobs....

 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

The model (mono_spinzero_beta), setscales.f and the debug log is kept here:

https://drive.google.com/open?id=0B9W0d8aQWpFmdzYtalRQanpsLUU

Please help me to solve this issue.
Thank you,
Arka

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

Hi,

I would suggest to include your speed dependence in your Lorentz structure.
We call this the form-factor approach:
https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/FormFactors

I guess something like this should be what you want:

FFV1_mod = Lorentz(name = 'FFV1_mod',
               spins = [ 2, 2, 3 ],
               structure = 'Gamma(3,2,1)*cmath.sqrt(1d0 - 2d0*MMM*MMM/(P(-1,3),P(-1,3)))')

Your problem is that GCH is not defined in the setscales routine.

Cheers,

Olivier

On 24 Sep 2017, at 11:24, Arka Santra <<email address hidden><mailto:<email address hidden>>> wrote:

Question #658291 on MadGraph5_aMC@NLO changed:
https://answers.launchpad.net/mg5amcnlo/+question/658291

   Status: Answered => Open

Arka Santra is still having a problem:
Hi Olivier,
 I am now migrating to the MadGraph5 UFO models by rewriting my model in python. Specifically, I did the following:

1. Add these to the parameters.py:
MMM = Parameter(name = 'MMM',
              nature = 'external',
              type = 'real',
              value = 1500,
              texname = '\\text{MMM}',
              lhablock = 'MASS',
              lhacode = [ 4110000 ])

and

GCH = Parameter(name = 'GCH',
                 nature = 'external',
                 type = 'real',
                 value = 1.0,
                 texname = '\\text{GCH}',
                 lhablock = 'GCH',
                 lhacode = [ 1 ])

2. in the particles.py

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

3. In the couplings.py:

GC_109 = Coupling(name = 'GC_109',
                 value = 'cmath.sqrt(cmath.pi/aEW)*GCH',
                 order = {'QED':1})

4. In the vertices.py:

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

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

Now I need to have a coupling which is dependent on the velocity of the generated particle. To do that, I need to modify the setscales.f. These are the lines in setscales.f :

real*8 gm, shat, betam, gbeta, ee, Pi
alpha = 1d0/1.37d2
     print *,'alpha',alpha
     gm = dsqrt(Pi/alpha)
     write(*,*)'P(0,1),P(0,2)', P(0,1),P(0,2)
     shat = 2d0*dot(P(0,1),P(0,2))
     print *,'MMM', MMM

     betam = dsqrt(1d0 - 4d0*MMM*MMM/shat)

     gbeta = gm*betam

     GCH = dcmplx( gbeta, 0d0 )

But while I want to compile, MadGraph is showing me this error:

Error detected in "generate_events run_01"
write debug file /home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Pre7/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/Pre7/SubProcesses/P1_aa_mmpmmm.
The compilation fails with the following output message:
   gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c driver.f -I../../Source/
   gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c myamp.f -I../../Source/
   gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c genps.f -I../../Source/
   gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c unwgt.f -I../../Source/
   gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c setcuts.f -I../../Source/
   gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c get_color.f -I../../Source/
   gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c cuts.f -I../../Source/
   gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c cluster.f -I../../Source/
   gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c reweight.f -I../../Source/
   gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c initcluster.f -I../../Source/
   gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c addmothers.f -I../../Source/
   gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c setscales.f -I../../Source/
   setscales.f:148:9:

          GCH = dcmplx( gbeta, 0d0 )
            1
   Error: Symbol ‘gch’ at (1) has no IMPLICIT type
   setscales.f:138:24:

          print *,'MMM', MMM
                           1
   Error: Symbol ‘mmm’ at (1) has no IMPLICIT type
   makefile:60: recipe for target 'setscales.o' failed
   make: *** [setscales.o] Error 1
   make: *** Waiting for unfinished jobs....

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

The model (mono_spinzero_beta), setscales.f and the debug log is kept
here:

https://drive.google.com/open?id=0B9W0d8aQWpFmdzYtalRQanpsLUU

Please help me to solve this issue.
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 :
#6

Hi Olivier,
  I tried to use your suggestion in the lorentz.py file namely:
FFV1_mod = Lorentz(name = 'FFV1_mod',
               spins = [ 2, 2, 3 ],
               structure = 'Gamma(3,2,1)*cmath.sqrt(1 - 2*MMM*MMM/(P(-1,3),P(-1,3)))')

But while running MadGraph, I get this error:

Command "import /home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Spin05Script.txt" interrupted in sub-command:
"output Pre1" with error:
TypeError : 'LexToken' object has no attribute '__getitem__'
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in 'MG5_debug'.
Please attach this file to your report.

I assume this error is coming because of (P(-1,3),P(-1,3)). I inserted the dot function to get the structure such that:

structure = 'Gamma(3,2,1)*cmath.sqrt(1 - 2*MMM*MMM/dot(P(-1,3),P(-1,3)))')

But now I get this error:

Survey return zero cross section.
   Typical reasons are the following:
   1) A massive s-channel particle has a width set to zero.
   2) The pdf are zero for at least one of the initial state particles
      or you are using maxjetflavor=4 for initial state b:s.
   3) The cuts are too strong.
   Please check/correct your param_card and/or your run_card.

My question is how I should write the structure in lorentz.py such that the coupling includes the velocity of the particle (velocity of the particle is defined by sqrt(1 - 4*Mass^2 / (s*s) ) where s is the centre of mass energy. )?

Thank you,
Arka

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

Hi,

Repeated indices are automatically contracted, so you have to use a normal multiplication
> FFV1_mod = Lorentz(name = 'FFV1_mod',
> spins = [ 2, 2, 3 ],
> structure = 'Gamma(3,2,1)*cmath.sqrt(1 - 2*MMM*MMM/(P(-1,3)*P(-1,3)))')

Cheers,

Olivier

> On 5 Oct 2017, at 14:11, Arka Santra <email address hidden> wrote:
>
> Question #658291 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/658291
>
> Status: Answered => Open
>
> Arka Santra is still having a problem:
> Hi Olivier,
> I tried to use your suggestion in the lorentz.py file namely:
> FFV1_mod = Lorentz(name = 'FFV1_mod',
> spins = [ 2, 2, 3 ],
> structure = 'Gamma(3,2,1)*cmath.sqrt(1 - 2*MMM*MMM/(P(-1,3),P(-1,3)))')
>
>
> But while running MadGraph, I get this error:
>
> Command "import /home/arka/LatestMadGraph5/MG5_aMC_v2_5_4/Spin05Script.txt" interrupted in sub-command:
> "output Pre1" with error:
> TypeError : 'LexToken' object has no attribute '__getitem__'
> Please report this bug on https://bugs.launchpad.net/mg5amcnlo
> More information is found in 'MG5_debug'.
> Please attach this file to your report.
>
>
> I assume this error is coming because of (P(-1,3),P(-1,3)). I inserted
> the dot function to get the structure such that:
>
> structure = 'Gamma(3,2,1)*cmath.sqrt(1 -
> 2*MMM*MMM/dot(P(-1,3),P(-1,3)))')
>
>
> But now I get this error:
>
> Survey return zero cross section.
> Typical reasons are the following:
> 1) A massive s-channel particle has a width set to zero.
> 2) The pdf are zero for at least one of the initial state particles
> or you are using maxjetflavor=4 for initial state b:s.
> 3) The cuts are too strong.
> Please check/correct your param_card and/or your run_card.
>
>
> My question is how I should write the structure in lorentz.py such that the coupling includes the velocity of the particle (velocity of the particle is defined by sqrt(1 - 4*Mass^2 / (s*s) ) where s is the centre of mass energy. )?
>
> 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 :
#8

Hi Olivier,
  When I used this in my FFV1_mod:

 FFV1_mod = Lorentz(name = 'FFV1_mod',
               spins = [ 2, 2, 3 ],
               structure = 'Gamma(3,2,1)*cmath.sqrt(1-2*pow(MMM,2)/(P(-1,3)*P(-1,3)))')

I get this error in MG5:

Survey return zero cross section.
   Typical reasons are the following:
   1) A massive s-channel particle has a width set to zero.
   2) The pdf are zero for at least one of the initial state particles
      or you are using maxjetflavor=4 for initial state b:s.
   3) The cuts are too strong.
   Please check/correct your param_card and/or your run_card.
Zero result detected: See https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/FAQ-General-14

It seems the value inside the cmath.sqrt() function is negative, hence MG5 cannot proceed.

When I changed it to:

FFV1_mod = Lorentz(name = 'FFV1_mod',
               spins = [ 2, 2, 3 ],
               structure = 'Gamma(3,2,1)*cmath.sqrt(1-2*pow(MMM,2)/(P(-1,1)*P(-1,3)))')

MG5 is running and giving me the cross-section. But I checked with the theoretical calculation of the cross-section, and the result coming from the theory and MG5 do not match. My questions are the following:

1. The velocity of the particle is defined by sqrt(1 - 4*mass^2/s) where s is the square of center of mass energy of the collision. How do I write the s part: is it simply 2*P(-1,1)*P(-1,3)?

2. If I want to write the Lagrangian and generate the UFO file using FeynRules, I need to know the center of mass energy of the collision - which is coming from the run_card.dat of MG5. How do I write this variable ( the center of mass energy ) in the .fr file of the FeynRules?

 I was thinking like this:

M$Parameters = {

  shat == {
     ParameterType -> External,
     Value -> 13000.0, ### for \sqrt{s} = 13000 GeV
     TeX -> s,
     Description -> "Center of Mass energy"
  },

  beta == {
     ParameterType -> Internal,
     Value -> Sqrt[1 - 4*MMM*MMM/(shat*shat)],
     TeX -> b,
     Description -> "Velocity of the monopole"
  }

}

But the problem is here center of mass energy is 13 TeV, which is hard coded. Is it possible to define it in such a way that it takes the value from run_card.dat?

Thank you,
Arka

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

Hi,

In principle you can not access any value of the run_card since ALOHA is often used in case where they are NO run_card defined.
(Like for MadSpin, Reweighting, MadWidth,...). ALOHA is also supposed to be local, so it only has access to the local momenta of the given vertex.
Again the variable which stored the full event momenta is not universal between the various code using ALOHA and therefore using those will only work for some of the code.

This being said, if you want to create a hack to have access to those additional information you can.
But of course, your model will not be supporting by many MG5aMC features (like auto-width, standalone, NLO, ...)
In top of being not supported at all by any other code supporting the UFO convention.

The idea is that you can define any function that you want in the UFO sub-directory:
Fortran/functions.f

so assuming the following file:

      double precision function GET_S(X)
      double precision x ! fake invariant mass. Since function need input
c
c Collider block for LO framework
c
      integer lpp(2)
      double precision ebeam(2), xbk(2),q2fact(2)
      common/to_collider/ ebeam , xbk ,q2fact, lpp

      double precision mp, m1, m2
      mp = 0.938
      m1=0d0
      m2=0d0
      if (abs(lpp(1)).eq.1) m1= mp
      if (abs(lpp(2)).eq.1) m2= mp
      get_s = 2* ebeam(1)* ebeam(2) +
     & 2*DSQRT((ebeam(1)**2-m1**2)*(ebeam(2)**2-m2**2)) + m1**2 +m2**2
      return
      end

Then you can do
> FFV1_mod = Lorentz(name = 'FFV1_mod',
> spins = [ 2, 2, 3 ],
> structure = 'Gamma(3,2,1)*cmath.sqrt(1-2*pow(MMM,2)/get_s(MMM))')

I will check if I can update aloha to allow function without any argument to avoid to pass an argument to the function.

If you pass "s" as a model parameter as you suggest to do, then you are allowed to include directly that parameter in the ALOHA, and you preserve all the possible feature of the code/ compatibility with other program. (But indeed you have to ensure yourself that you keep those two parameter in sync.

Cheers,

Olivier

> On 15 Oct 2017, at 12:34, Arka Santra <email address hidden> wrote:
>
> Question #658291 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/658291
>
> Status: Answered => Open
>
> Arka Santra is still having a problem:
> Hi Olivier,
> When I used this in my FFV1_mod:
>
> FFV1_mod = Lorentz(name = 'FFV1_mod',
> spins = [ 2, 2, 3 ],
> structure = 'Gamma(3,2,1)*cmath.sqrt(1-2*pow(MMM,2)/(P(-1,3)*P(-1,3)))')
>
>
> I get this error in MG5:
>
> Survey return zero cross section.
> Typical reasons are the following:
> 1) A massive s-channel particle has a width set to zero.
> 2) The pdf are zero for at least one of the initial state particles
> or you are using maxjetflavor=4 for initial state b:s.
> 3) The cuts are too strong.
> Please check/correct your param_card and/or your run_card.
> Zero result detected: See https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/FAQ-General-14
>
>
> It seems the value inside the cmath.sqrt() function is negative, hence MG5 cannot proceed.
>
> When I changed it to:
>
>
> FFV1_mod = Lorentz(name = 'FFV1_mod',
> spins = [ 2, 2, 3 ],
> structure = 'Gamma(3,2,1)*cmath.sqrt(1-2*pow(MMM,2)/(P(-1,1)*P(-1,3)))')
>
>
> MG5 is running and giving me the cross-section. But I checked with the theoretical calculation of the cross-section, and the result coming from the theory and MG5 do not match. My questions are the following:
>
>
> 1. The velocity of the particle is defined by sqrt(1 - 4*mass^2/s) where s is the square of center of mass energy of the collision. How do I write the s part: is it simply 2*P(-1,1)*P(-1,3)?
>
>
> 2. If I want to write the Lagrangian and generate the UFO file using FeynRules, I need to know the center of mass energy of the collision - which is coming from the run_card.dat of MG5. How do I write this variable ( the center of mass energy ) in the .fr file of the FeynRules?
>
> I was thinking like this:
>
>
> M$Parameters = {
>
> shat == {
> ParameterType -> External,
> Value -> 13000.0, ### for \sqrt{s} = 13000 GeV
> TeX -> s,
> Description -> "Center of Mass energy"
> },
>
> beta == {
> ParameterType -> Internal,
> Value -> Sqrt[1 - 4*MMM*MMM/(shat*shat)],
> TeX -> b,
> Description -> "Velocity of the monopole"
> }
>
> }
>
>
> But the problem is here center of mass energy is 13 TeV, which is hard coded. Is it possible to define it in such a way that it takes the value from run_card.dat?
>
>
> 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 :
#10

Hi Olivier,
  Unfortunately, I still face problem in applying velocity dependence in the monopole-photon coupling. I will try to be as explicit as I can so that you clearly understand what I want and where I am facing problem. So this will be a little long post, sorry for that.

*****************************************

1. I have a spin ½ monopole model written in Fortran which is working perfectly. I want to rewrite this model in python. The goal is to modify the python spin ½ model to get spin 0 and spin 1 models in future.

2. The working spin ½ model name is wendy_beta and it is kept here:
 https://github.com/asantra/MadGraphModels/tree/master/wendy_beta

I will walk through different parts of the model:
a. Monopoles are defined in particles.dat:
https://github.com/asantra/MadGraphModels/blob/master/wendy_beta/particles.dat#L43

b. Photon-monopole vertex is defined in interactions.dat:
https://github.com/asantra/MadGraphModels/blob/master/wendy_beta/interactions.dat#L115

c. To apply the velocity dependence, I use this setscales.f:
https://github.com/asantra/MadGraphModels/blob/master/FortranModelSetScale/setscales.f

d. In the setscales.f, the velocity is defined here as a function of monopole mass and the center of mass energy:
https://github.com/asantra/MadGraphModels/blob/master/FortranModelSetScale/setscales.f#L141

The couplings get modified in these lines in setscales.f:
https://github.com/asantra/MadGraphModels/blob/master/FortranModelSetScale/setscales.f#L148
https://github.com/asantra/MadGraphModels/blob/master/FortranModelSetScale/setscales.f#L149

3. With these modifications, I get a good beta dependent photon monopole coupling model for spin ½ monopole. Here you can see a transverse momentum distribution:
https://github.com/asantra/MadGraphModels/blob/master/ComparisonPlots_PhotonFusion_BetaNonBeta_v93_M1000Pt.png

As coupling is now beta dependent, the monopoles with higher velocities are produced with more probability, and hence there is a right shift in the transverse momentum distribution.

*******************************************

4. Now I want to do the same with the python UFO model. The model name is mono_spinhalf_beta and it is kept here:
https://github.com/asantra/MadGraphModels/tree/master/mono_spinhalf_beta

I will walk through different parts of the model:

a. monopoles are defined in particles.py file:
https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/particles.py#L386

b. The coupling constant (GCH) is defined in parameters.py:
https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/parameters.py#L236

c. The centre of mass energy (COM) is defined in parameters.py:
https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/parameters.py#L244

d. The vertices are defined in vertices.py:
https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/vertices.py#L930

e. The lorentz structure (with velocity = sqrt(1 – 4*mass^2/s) where s is square of COM) is defined in lorentz.py:
https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/lorentz.py#L54

f. The coupling order is defined in couplings.py:
https://github.com/asantra/MadGraphModels/blob/master/mono_spinhalf_beta/couplings.py#L444

5. This is again the transverse momentum distribution of the monopoles:
https://github.com/asantra/MadGraphModels/blob/master/ComparisonPlots_PhotonFusion_BetaNonBeta_v95_M1000Pt.png

Here velocity (beta) dependent and independent model give same distribution. So beta dependence was not applied properly.

6. I wanted to modify the setscales.f as before (like I did with the Fortran model wendy_beta). This is the modified setscales.f:

https://github.com/asantra/MadGraphModels/blob/master/PythonModelSetScale/setscales.f

A quick walk through of the setscales.f:
–-----------
a. defined the coupling:
https://github.com/asantra/MadGraphModels/blob/master/PythonModelSetScale/setscales.f#L72

b. the velocity of the particle:
https://github.com/asantra/MadGraphModels/blob/master/PythonModelSetScale/setscales.f#L77

c. velocity dependent coupling:
https://github.com/asantra/MadGraphModels/blob/master/PythonModelSetScale/setscales.f#L78
(one additional question: is it possible to take the value of mass from param_card.dat? )

d. Then the scale is set here:
https://github.com/asantra/MadGraphModels/blob/master/PythonModelSetScale/setscales.f#L122

7. But when I ran the python UFO model with this new setscales.f, I got the error:
https://github.com/asantra/MadGraphModels/blob/master/ErrorMessage.txt

It seems GCH(1) is not declared for python UFO model, though GAM(1) was declared for the Fortran model.

*********************

My questions are the following:

1. How do I implement proper velocity dependent coupling in python UFO model by modifying setscales.f? More precisely, how do I access the mass of the particle and modify the coupling from setscales.f?

2. Is there any documentation on setscales.f?

Thank you very much,
Arka

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

Hi Arka,

Your model wendy_beta does not actually work on his own since you are requested to modify some file which does not have anything to do with the model (i.e setscales.f). This means that your model only works for a given version of MG5aMC (since that file can be removed and/or modified by removing/adding functions).
I would strongly suggest to not have to rely on setscales.f (you actually do not need to modify setscales.f since you can do the same inside the model. (just do it in the routine updating the coupling depending of alphas)

So the answer to your question are:

> 1. How do I implement proper velocity dependent coupling in python UFO model by modifying setscales.f? More precisely, how do I access the mass of the particle and modify the coupling from setscales.f?

You should not touch to that file. This is hacking the code in a bad way.

> 2. Is there any documentation on setscales.f?

Not for those type of applications since the only thing that a user might want to do in that file, is to add a new choices of scale for alphas. Everything else should not be done in that file.

> Here velocity (beta) dependent and independent model give same distribution. So beta dependence was not applied properly.

Well in your model, you implement:
Gamma(3,2,1)*cmath.sqrt(1-4*pow(MMM,2)/(shat*shat))
So your beta value is a constant. So obviously it will not impact any kinematical distribution (only the cross-section)

> It seems GCH(1) is not declared for python UFO model, though GAM(1) was declared for the Fortran model.

From what you send to me why would you expect GCH(1) to be defined?, you never define it as a list. GCH might be defined in that file but it should not and I should remove that include in the next version.

Cheers,

Olivier

Can you help with this problem?

Provide an answer of your own, or ask Arka Santra for more information if necessary.

To post a message you must log in.