A-A-Abdelhamid / LLP_Sleptons_RPV_SUSY

Here you can find MadGraph5 cards, diagrams, logs, plots, and code used in the project
2 stars 1 forks source link

Modifying the UFO Model Parameters. Tuesday 09/26 #15

Open A-A-Abdelhamid opened 11 months ago

A-A-Abdelhamid commented 11 months ago

Last week Larry @lawrenceleejr suggested editing the UFO model parameters to automaticlly create the appropriate decay tables with our desired models.

I looked into the param_card_card.py:


        # put at the beginning SMINPUT + MASS + DECAY
        for name in ['DECAY', 'MASS','SMINPUTS']:
            if name in all_lhablock:
                all_lhablock.remove(name)
                all_lhablock.insert(0, name)

        for lhablock in all_lhablock:
            self.write_block(lhablock)
            need_writing = [ param for param in all_ext_param if \
                                                     param.lhablock == lhablock]
            from functools import cmp_to_key
            need_writing.sort(key=cmp_to_key(self.order_param))
            [self.write_param(param, lhablock) for param in need_writing]

            if self.generic_output:
                if lhablock in ['MASS', 'DECAY']:
                    self.write_dep_param_block(lhablock)

        if self.generic_output:
            self.write_qnumber()

    def write_block(self, name):
        """ write a comment for a block"""

        self.fsock.writelines(
        """\n###################################""" + \
        """\n## INFORMATION FOR %s""" % name.upper() +\
        """\n###################################\n"""
         )
        if name!='DECAY':
            self.fsock.write("""Block %s \n""" % name)

    def write_param(self, param, lhablock):

        lhacode=' '.join(['%3s' % key for key in param.lhacode])
        if lhablock != 'DECAY':
            text = """  %s %e # %s \n""" % (lhacode, complex(param.value).real, param.name ) 
        else:
            text = '''DECAY %s %e \n''' % (lhacode, complex(param.value).real)
        self.fsock.write(text) 

    def write_dep_param_block(self, lhablock):
        import cmath
        from parameters import all_parameters
        for parameter in all_parameters:
            try:
                exec("%s = %s" % (parameter.name, parameter.value))
            except Exception:
                pass

Which looks like it is getting the decay chains from another script: decays.py:

# This file was automatically created by FeynRules 2.3.2
# Mathematica version: 10.0 for Linux x86 (64-bit) (September 9, 2014)
......

Anyway, using this model MadGraph creates param cards with empty decay tables.

The best course of action seemed like to write a few lines on code at the end of write_param_card.py to create the decay table. I looked up the syntax for decay tables and this paper had the standard FORTRAN format: (’DECAY’,1x,I9,3x,1P,E16.8,0P,3x,’#’,1x,A), (3x,1P,E16.8,0P,3x,I2,3x,N (I9,1x),2x,’#’,1x,A).

With some help, I tried to follow this format and to write the gluon decay from the same paper as a test just to see if it works:

def write_decay_table(self, decay_entries):
  """Writes the decay table to the param card file"""

        for entry in decay_entries:
          pdg_number = entry['pdg']
          total_width = entry['width']
          human_readable = entry.get('human_readable', '')

          # Write the DECAY line
          decay_line = f"DECAY {pdg_number:<9} {total_width:16.8E} # {human_readable}\n"
          self.fsock.write(decay_line)

          for channel in entry['channels']:
            br = channel['br']
            nda = channel['nda']
            daughter_pdgs = channel['daughters']
            human_readable_channel = channel.get('human_readable', '')

            # Write the decay channel line
            channel_line = f"   {br:16.8E} {nda:<2} {' '.join(map(str, daughter_pdgs))}  # {human_readable_channel}\n"
            self.fsock.write(channel_line)

decay_entries = [
    {
        'pdg': 1000021,
        'width': 1.01752300e+00,
        'human_readable': 'gluino decays',
        'channels': [
            {'br': 4.18313300e-02, 'nda': 2, 'daughters': [1000001, -1], 'human_readable': '~g -> ~d_L dbar'},
            {'br': 1.55587600e-02, 'nda': 2, 'daughters': [2000001, -1], 'human_readable': '~g -> ~d_R dbar'}
        ]
    },
    # Add more entries as needed
]

# Write the decay table to the file
writer.write_decay_table(decay_entries)
self.fsock.write(decay_entries)

But the generated MadGraph param_card.dat still had empty decay tables.

I am not sure if manipulating the "decay.py" script is the way to go. However, I think there is a way to tell MadGraph to use a specific param_card. We can easily manipulate our param card (e.g. via bash script) and change/create the decay tables according to our models, then prompt MG5 to read it and generate events based on its parameters. This was my first attempt but MG5 kept ignoring this part. This "readme" might have the right syntax to do so:

https://github.com/A-A-Abdelhamid/DVMuReint/blob/main/RPVMSSM_UFO/example_monophi.md

A-A-Abdelhamid commented 11 months ago

Also please check Issue 14