Etmiss in user-defined function (kin_func.f)

Asked by Jory Sonneveld

I would like to define a function in kin_func.f for fractional missing energy, or
etmiss/(effective mass)
with effective mass
Meff = etmiss + sum(p_Ti), with p_Ti the transverse energy of the ith jet. My goal is to impose a cut on this quantity in ma_card.dat. It turns out that etmiss needs arguments in kin_func.f, which I do not understand - this should be the etmiss for an event, not a particle. See specifications below. I am sure I made mistakes and/or have misunderstood something entirely. What would be the best way to achieve my goal?

Goal
From the cuts section in ma_card.dat:
-------------------
XY1min 1 1 1 2 0.3 # Fractional missing energy etmiss/effective mass for dijet channel
XYZ1min 1 1 1 2 1 3 0.25 # Fractional missing energy etmiss/effective mass for trijet channel
XYZA1min 1 1 1 2 1 3 1 4 0.2 # Fractional missing energy etmiss/effective mass for multijet channel
-------------------

Means
Functions in kin_func.f:
-------------------
      double precision function XY1(p1,p2)
C****************************************************************************
C Fractional Missing Energy etmiss/effective mass
C Effective Mass = ETmiss + PTi, i = jet i, up to channel multiplicity
C****************************************************************************
      implicit none
      double precision p1(0:3),p2(0:3)
      double precision pt,etmiss
      external etmiss,pt

      XY1=etmiss + pt(p1) + pt(p2)
      XY1 = etmiss/(XY1)

      end

      double precision function XYZ1(p1,p2,p3)
C****************************************************************************
C Fractional Missing Energy etmiss/effective mass
C Effective Mass = ETmiss + PTi, i = jet i, up to channel multiplicity
C****************************************************************************
      implicit none
      double precision p1(0:3),p2(0:3),p3(0:3)
      double precision pt,etmiss
      external etmiss,pt

      XYZ1=etmiss + pt(p1) + pt(p2) + pt(p3)
      XYZ1 = etmiss/(XYZ1)

      end

C****************************************************************************
C Fractional Missing Energy etmiss/effective mass
C Effective Mass = ETmiss + PTi, i = jet i, up to channel multiplicity
C****************************************************************************
      implicit none
      double precision p1(0:3),p2(0:3),p3(0:3),p4(0:3)
      double precision pt,etmiss
      external etmiss,pt

      XYZA1=etmiss + pt(p1) + pt(p2) + pt(p3) + pt(p4)
      XYZA1 = etmiss/(XYZA1)

      end
---------------------

Problem
Make output:
----------------------
% make
gfortran -O -w -ffixed-line-length-132 -c kin_func.f
kin_func.f:279.16:

      XY1=etmiss + pt(p1) + pt(p2)
                1
Error: Function 'etmiss' requires an argument list at (1)
kin_func.f:280.18:

      XY1 = etmiss/(XY1)
                  1
Error: Function 'etmiss' requires an argument list at (1)
kin_func.f:317.17:

      XYZ1=etmiss + pt(p1) + pt(p2) + pt(p3)
                 1
Error: Function 'etmiss' requires an argument list at (1)
kin_func.f:318.19:

      XYZ1 = etmiss/(XYZ1)
                   1
Error: Function 'etmiss' requires an argument list at (1)
kin_func.f:355.18:

      XYZA1=etmiss + pt(p1) + pt(p2) + pt(p3) + pt(p4)
                  1
Error: Function 'etmiss' requires an argument list at (1)
kin_func.f:356.20:

      XYZA1 = etmiss/(XYZA1)
                    1
Error: Function 'etmiss' requires an argument list at (1)
make: *** [kin_func.o] Error 1
------------------------

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Johan Alwall
Solved:
Last query:
Last reply:
Revision history for this message
Best Johan Alwall (johan-alwall) said :
#1

Hello Jory,

In Fortran, "external" means that you are declaring an external function. I believe what you are looking for is a common block, which can be used to transfer information between different parts of a program:

double precision etmiss
common/to_etmiss/etmiss

 You need to set the etmiss where it is calculated, and can then use it in this function by declaring the common block in both places.

All the best,
Johan

Revision history for this message
Jory Sonneveld (jory) said :
#2

Hi Johan,

I now have no more errors, thanks.

I still do not see, however, where etmiss is defined. I can only find the instance where the bin range is defined in kin_func.f, but cannot find a declaration or calculation. In info.inc I find etmissmin and etmissmax, as well as etmissrange - but not etmiss.

What did I miss?

Thanks,
Jory

Revision history for this message
Johan Alwall (johan-alwall) said :
#3

Hello Jory,

The variable is called mET, and it's set in plot_events.f around line 237.

All the best,
Johan

Revision history for this message
Jory Sonneveld (jory) said :
#4

Thanks!

Revision history for this message
Jory Sonneveld (jory) said :
#5

Thanks Johan Alwall, that solved my question.