Cut in inv mass of leptons not working correctly

Asked by Eleanor Cole

Hello,
I am trying to generate a p p > mu+ vm [QCD] event at NLO with cuts in mll. I have included :

  60.0 = mll ! Min inv. mass of all opposite sign lepton pairs
  60.0 = mll_sf ! Min inv. mass of all opp. sign same-flavor lepton pairs

in the run card and have made a custom cut in max mll:

  ['/Users/ellacole/my_projects/interpretation/FK_tables/LHCb/LHCb_DY/mg5_cuts/dummy_fct.f'] = custom_fcts ! List of files containing user hook function

This is the dummy_fct.f file:

      logical function dummy_cuts(p,istatus,ipdg)
      implicit none
      include 'nexternal.inc'
      include 'run.inc'
      include 'cuts.inc'

      integer istatus(nexternal)
      integer ipdg(nexternal)
      double precision p(0:4,nexternal)
      REAL*8 R2_04, invm2_04, pt_04, eta_04, pt, eta
      external R2_04, invm2_04, pt_04, eta_04, pt, eta
      double precision dot
      external dot
      logical is_a_lp_reco(nexternal), is_a_lm_reco(nexternal)

      double precision mll_max, mll_cut
      integer i, j

      mll_max = 120d0

C-- Loop over all reco leptons: lp vs lm
      do i = nincoming+1, nexternal
         if (is_a_lp_reco(i)) then
            do j = nincoming+1, nexternal
               if (is_a_lm_reco(j)) then
                  if (mll_max .gt. 0d0) then
                     if (invm2_04(p(0,i), p(0,j), 1d0) .gt. mll_max**2) then
                        dummy_cuts = .false.
                        return
                     endif
                  endif
               endif
            enddo
         endif
      enddo

      dummy_cuts = .true.
      return
      end

However, when I launch the process and plot the mll using this analysis file:

c
c Example analysis for "p p > e+ ve [QCD]" process.
c Example analysis for "p p > e- ve~ [QCD]" process.
c Example analysis for "p p > mu+ vm [QCD]" process.
c Example analysis for "p p > mu- vm~ [QCD]" process.
c Example analysis for "p p > ta+ vt [QCD]" process.
c Example analysis for "p p > ta- vt~ [QCD]" process.
c
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
      subroutine analysis_begin(nwgt,weights_info)
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
      implicit none
      integer nwgt
      character*(*) weights_info(*)
      integer i,kk,l
      character*6 cc(2)
      data cc/'|T@NLO','|T@LO '/
      call HwU_inithist(nwgt,weights_info)
      do i=1,2
        l=(i-1)*3
        call HwU_book(l+1,'total rate '//cc(i), 1,0.5d0,1.5d0)
        call HwU_book(l+2,'lep rapidity '//cc(i), 10,2d0,4.5d0)
        call HwU_book(l+3,'invariant mass '//cc(i), 50,0d0,200d0)
      enddo
      return
      end

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
      subroutine analysis_end(dummy)
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
      implicit none
      double precision dummy
      call HwU_write_file
      return
      end

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
      subroutine analysis_fill(p,istatus,ipdg,wgts,ibody)
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
      implicit none
      include 'nexternal.inc'
      integer istatus(nexternal)
      integer iPDG(nexternal)
      double precision p(0:4,nexternal)
      double precision wgts(*)
      integer ibody
      double precision wgt,var
      integer i,kk,l
      double precision pw(0:3),pe(0:3),pn(0:3),ye,yw,pte,etmiss,mtr,ptw,cphi,www
      double precision getrapidity, getinvm
      external getrapidity, getinvm
      double precision mll, dot
      external dot

      if (nexternal.ne.5) then
         write (*,*) 'error #1 in analysis_fill: '/
     & /'only for process "p p > l vl [QCD]"'
         stop 1
      endif
      if (.not. (abs(ipdg(1)).le.4 .or. ipdg(1).eq.21)) then
         write (*,*) 'error #2 in analysis_fill: '/
     & /'only for process "p p > l vl [QCD]"'
         stop 1
      endif
      if (.not. (abs(ipdg(2)).le.4 .or. ipdg(2).eq.21)) then
         write (*,*) 'error #3 in analysis_fill: '/
     & /'only for process "p p > l vl [QCD]"'
         stop 1
      endif
      if (.not. (abs(ipdg(5)).le.4 .or. ipdg(5).eq.21)) then
         write (*,*) 'error #4 in analysis_fill: '/
     & /'only for process "p p > l vl [QCD]"'
         stop 1
      endif
      if( (abs(abs(ipdg(3))-abs(ipdg(4))).ne.1) .or.
     & (sign(1d0,dble(ipdg(3))).eq.sign(1d0,dble(ipdg(4)))) .or.
     & (abs(ipdg(3)).le.10.or.abs(ipdg(3)).ge.16) .or.
     & (abs(ipdg(4)).le.10.or.abs(ipdg(4)).ge.16) )then
         write(*,*)'analysis not suited for this process',ipdg(3),ipdg(4)
      endif

      do i=0,3
         if(abs(ipdg(3)).eq.11.or.abs(ipdg(3)).eq.13.or.abs(ipdg(3)).eq.15)then
            pe(i)=p(i,3)
            pn(i)=p(i,4)
         else
            pe(i)=p(i,4)
            pn(i)=p(i,3)
         endif
        pw(i)=pe(i)+pn(i)
      enddo

      ye = abs(getrapidity(pe(0), pe(3)))
      var = 1.d0

      mll = sqrt(max(0d0, (pe(0)+pn(0))**2 - (pe(1)+pn(1))**2 - (pe(2)+pn(2))**2 - (pe(3)+pn(3))**2))

      do i=1,2
         l=(i-1)*3
         if (ibody.ne.3 .and.i.eq.2) cycle
         call HwU_fill(l+1,var,wgts)
         call HwU_fill(l+2,ye,wgts)
         call HwU_fill(l+3,mll,wgts)
      enddo
 999 return
      end

      function getrapidity(en,pl)
      implicit none
      real*8 getrapidity,en,pl,tiny,xplus,xminus,y
      parameter (tiny=1.d-8)
      xplus=en+pl
      xminus=en-pl
      if(xplus.gt.tiny.and.xminus.gt.tiny)then
         if( (xplus/xminus).gt.tiny.and.(xminus/xplus).gt.tiny)then
            y=0.5d0*log( xplus/xminus )
         else
            y=sign(1.d0,pl)*1.d8
         endif
      else
         y=sign(1.d0,pl)*1.d8
      endif
      getrapidity=y
      return
      end

I don't see any cut in mll. I am not sure why this is.

Question information

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

Hi,

I'm not sure to understand why you specify those two cuts:
  60.0 = mll ! Min inv. mass of all opposite sign lepton pairs
  60.0 = mll_sf ! Min inv. mass of all opp. sign same-flavor lepton pairs
Since your process is
p p > mu+ vm [QCD]

You have only one charged lepton and the above cut is/are useless.

The same apply to your custom_cuts, you check the invariant mass of opposite charged lepton, they are non in your process, so all events are passing the cuts.

Cheers,

Olivier

Revision history for this message
Eleanor Cole (ella-cole) said :
#2

Hello,

Thank you so much, that's really helpful. I've now made this dummy cuts file and it seems to impose the cut correctly.

      logical function dummy_cuts(p,istatus,ipdg)
      implicit none
      include 'nexternal.inc'
      include 'run.inc'
      include 'cuts.inc'

      integer istatus(nexternal)
      integer ipdg(nexternal)
      double precision p(0:4,nexternal)
      double precision pe(0:4), pn(0:4), pw(0:4), m_lv
      integer i

      double precision m_lv_min, m_lv_max
      m_lv_min = 20d0
      m_lv_max = 120d0

C-- Identify lepton and neutrino in p p > mu+ vm [QCD]
      do i = nincoming+1, nexternal
         if (abs(ipdg(i)) .eq. 13) then
            pe(:) = p(:,i)
         else if (abs(ipdg(i)) .eq. 14) then
            pn(:) = p(:,i)
         endif
      enddo

C-- Compute invariant mass of lepton + neutrino system
      do i = 0,3
         pw(i) = pe(i) + pn(i)
      enddo

      m_lv = sqrt( max(0d0, pw(0)**2 - pw(1)**2 - pw(2)**2 - pw(3)**2) )

C-- Apply mass cut
      if (m_lv .lt. m_lv_min .or. m_lv .gt. m_lv_max) then
         dummy_cuts = .false.
         return
      endif

      dummy_cuts = .true.
      return
      end